[FFmpeg-cvslog] AAC encoder: fix OOB access in search_for_pns
ffmpeg | branch: master | Claudio Freire | Sat Sep 26 04:49:16 2015 -0300| [0f98fd30e2d3c7254a1c56ce42a9a8bf0f6dc0eb] | committer: Claudio Freire AAC encoder: fix OOB access in search_for_pns Fix out of bounds access caused by wrongful usage of swb_offset constants when computing scalefactor positions. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0f98fd30e2d3c7254a1c56ce42a9a8bf0f6dc0eb --- libavcodec/aaccoder.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c index 4749d8c..10ea14b 100644 --- a/libavcodec/aaccoder.c +++ b/libavcodec/aaccoder.c @@ -597,13 +597,13 @@ static void search_for_pns(AACEncContext *s, AVCodecContext *avctx, SingleChanne memcpy(sce->band_alt, sce->band_type, sizeof(sce->band_type)); for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { -int wstart = sce->ics.swb_offset[w*16]; +int wstart = w*128; for (g = 0; g < sce->ics.num_swb; g++) { int noise_sfi; float dist1 = 0.0f, dist2 = 0.0f, noise_amp; float pns_energy = 0.0f, pns_tgt_energy, energy_ratio, dist_thresh; float sfb_energy = 0.0f, threshold = 0.0f, spread = 0.0f; -const int start = sce->ics.swb_offset[w*16+g]; +const int start = wstart+sce->ics.swb_offset[g]; const float freq = (start-wstart)*freq_mult; const float freq_boost = FFMAX(0.88f*freq/NOISE_LOW_LIMIT, 1.0f); if (freq < NOISE_LOW_LIMIT || avctx->cutoff && freq >= avctx->cutoff) @@ -632,7 +632,7 @@ static void search_for_pns(AACEncContext *s, AVCodecContext *avctx, SingleChanne noise_amp = -ff_aac_pow2sf_tab[noise_sfi + POW_SF2_ZERO];/* Dequantize */ for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { float band_energy, scale, pns_senergy; -const int start_c = sce->ics.swb_offset[(w+w2)*16+g]; +const int start_c = (w+w2)*128+sce->ics.swb_offset[g]; band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g]; for (i = 0; i < sce->ics.swb_sizes[g]; i++) PNS[i] = s->random_state = lcg_random(s->random_state); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '49623f531972be5dc2dd8c1b4b8748cad7c424ff'
ffmpeg | branch: master | Hendrik Leppkes | Sat Sep 26 11:07:44 2015 +0200| [f3310df8538d201e8623ffbcf7f4fee0bec94f83] | committer: Hendrik Leppkes Merge commit '49623f531972be5dc2dd8c1b4b8748cad7c424ff' * commit '49623f531972be5dc2dd8c1b4b8748cad7c424ff': mmal: Remove setting extradata on input format Merged-by: Hendrik Leppkes > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f3310df8538d201e8623ffbcf7f4fee0bec94f83 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] mmal: Remove setting extradata on input format
ffmpeg | branch: master | wm4 | Thu Sep 24 08:49:41 2015 +0200| [49623f531972be5dc2dd8c1b4b8748cad7c424ff] | committer: Luca Barbato mmal: Remove setting extradata on input format This works only for extradata sizes up to 128 bytes. Additionally, I could never actually see it doing anything. The new code using MMAL_BUFFER_HEADER_FLAG_CONFIG now takes care of this. Signed-off-by: Luca Barbato > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=49623f531972be5dc2dd8c1b4b8748cad7c424ff --- libavcodec/mmaldec.c |7 --- 1 file changed, 7 deletions(-) diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c index 5aaa54c..fea3fc4 100644 --- a/libavcodec/mmaldec.c +++ b/libavcodec/mmaldec.c @@ -352,13 +352,6 @@ static av_cold int ffmmal_init_decoder(AVCodecContext *avctx) format_in->es->video.par.den = avctx->sample_aspect_ratio.den; format_in->flags = MMAL_ES_FORMAT_FLAG_FRAMED; -if (avctx->extradata_size) { -if ((status = mmal_format_extradata_alloc(format_in, avctx->extradata_size))) -goto fail; -format_in->extradata_size = avctx->extradata_size; -memcpy(format_in->extradata, avctx->extradata, format_in->extradata_size); -} - if ((status = mmal_port_format_commit(decoder->input[0]))) goto fail; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] mmal: Fix AVBufferRef usage
ffmpeg | branch: master | wm4 | Thu Sep 24 08:49:41 2015 +0200| [a9b8c638cfe2f82191db65e3e3a39f3b35df81f5] | committer: Luca Barbato mmal: Fix AVBufferRef usage AVBufferRef.data and AVPacket.data don't need to have the same value. AVPacket could point anywhere into the buffer. Likewise, the sizes don't need to be the same. Signed-off-by: Luca Barbato > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a9b8c638cfe2f82191db65e3e3a39f3b35df81f5 --- libavcodec/mmaldec.c |9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c index fea3fc4..ae9d749 100644 --- a/libavcodec/mmaldec.c +++ b/libavcodec/mmaldec.c @@ -433,17 +433,20 @@ static int ffmmal_add_packet(AVCodecContext *avctx, AVPacket *avpkt, if (avpkt->size) { if (avpkt->buf) { buf = av_buffer_ref(avpkt->buf); +size = avpkt->size; +data = avpkt->data; } else { buf = av_buffer_alloc(avpkt->size); -if (buf) +if (buf) { memcpy(buf->data, avpkt->data, avpkt->size); +size = buf->size; +data = buf->data; +} } if (!buf) { ret = AVERROR(ENOMEM); goto done; } -size = buf->size; -data = buf->data; if (!is_extradata) ctx->packets_sent++; } else { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] mmal: drop the h264 BSF
ffmpeg | branch: master | wm4 | Thu Sep 24 08:49:41 2015 +0200| [f290e48d86e10f34b5ddc519127636bcebec7c43] | committer: Luca Barbato mmal: drop the h264 BSF We can send mp4-style data directly. But for some reason, this requires sending the extradata as buffer with MMAL_BUFFER_HEADER_FLAG_CONFIG set. Reuse the infrastructure for sending AVPackets to do this. Signed-off-by: Luca Barbato > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f290e48d86e10f34b5ddc519127636bcebec7c43 --- libavcodec/mmaldec.c | 64 +- 1 file changed, 27 insertions(+), 37 deletions(-) diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c index 1099129..5aaa54c 100644 --- a/libavcodec/mmaldec.c +++ b/libavcodec/mmaldec.c @@ -67,8 +67,6 @@ typedef struct MMALDecodeContext { AVClass *av_class; int extra_buffers; -AVBitStreamFilterContext *bsfc; - MMAL_COMPONENT_T *decoder; MMAL_QUEUE_T *queue_decoded_frames; MMAL_POOL_T *pool_in; @@ -86,6 +84,7 @@ typedef struct MMALDecodeContext { int64_t frames_output; int eos_received; int eos_sent; +int extradata_sent; } MMALDecodeContext; // Assume decoder is guaranteed to produce output after at least this many @@ -165,7 +164,7 @@ static void ffmmal_stop_decoder(AVCodecContext *avctx) } ctx->waiting_buffers_tail = NULL; -ctx->frames_output = ctx->eos_received = ctx->eos_sent = ctx->packets_sent = 0; +ctx->frames_output = ctx->eos_received = ctx->eos_sent = ctx->packets_sent = ctx->extradata_sent = 0; } static av_cold int ffmmal_close_decoder(AVCodecContext *avctx) @@ -181,9 +180,6 @@ static av_cold int ffmmal_close_decoder(AVCodecContext *avctx) mmal_pool_destroy(ctx->pool_in); ffmmal_poolref_unref(ctx->pool_out); -if (ctx->bsfc) -av_bitstream_filter_close(ctx->bsfc); - mmal_vc_deinit(); return 0; @@ -356,18 +352,6 @@ static av_cold int ffmmal_init_decoder(AVCodecContext *avctx) format_in->es->video.par.den = avctx->sample_aspect_ratio.den; format_in->flags = MMAL_ES_FORMAT_FLAG_FRAMED; -if (avctx->codec->id == AV_CODEC_ID_H264 && avctx->extradata && avctx->extradata[0] == 1) { -uint8_t *dummy_p; -int dummy_int; -ctx->bsfc = av_bitstream_filter_init("h264_mp4toannexb"); -if (!ctx->bsfc) { -av_log(avctx, AV_LOG_ERROR, "Cannot open the h264_mp4toannexb BSF!\n"); -ret = AVERROR(ENOSYS); -goto fail; -} -av_bitstream_filter_filter(ctx->bsfc, avctx, NULL, &dummy_p, &dummy_int, NULL, 0, 0); -} - if (avctx->extradata_size) { if ((status = mmal_format_extradata_alloc(format_in, avctx->extradata_size))) goto fail; @@ -442,7 +426,9 @@ fail: // (due to us not reading/returning enough output buffers) and won't accept // new input. (This wouldn't be an issue if MMAL input buffers always were // complete frames - then the input buffer just would have to be big enough.) -static int ffmmal_add_packet(AVCodecContext *avctx, AVPacket *avpkt) +// If is_extradata is set, send it as MMAL_BUFFER_HEADER_FLAG_CONFIG. +static int ffmmal_add_packet(AVCodecContext *avctx, AVPacket *avpkt, + int is_extradata) { MMALDecodeContext *ctx = avctx->priv_data; AVBufferRef *buf = NULL; @@ -452,23 +438,12 @@ static int ffmmal_add_packet(AVCodecContext *avctx, AVPacket *avpkt) int ret = 0; if (avpkt->size) { -if (ctx->bsfc) { -uint8_t *tmp_data; -int tmp_size; -if ((ret = av_bitstream_filter_filter(ctx->bsfc, avctx, NULL, - &tmp_data, &tmp_size, - avpkt->data, avpkt->size, - avpkt->flags & AV_PKT_FLAG_KEY)) < 0) -goto done; -buf = av_buffer_create(tmp_data, tmp_size, NULL, NULL, 0); +if (avpkt->buf) { +buf = av_buffer_ref(avpkt->buf); } else { -if (avpkt->buf) { -buf = av_buffer_ref(avpkt->buf); -} else { -buf = av_buffer_alloc(avpkt->size); -if (buf) -memcpy(buf->data, avpkt->data, avpkt->size); -} +buf = av_buffer_alloc(avpkt->size); +if (buf) +memcpy(buf->data, avpkt->data, avpkt->size); } if (!buf) { ret = AVERROR(ENOMEM); @@ -476,7 +451,8 @@ static int ffmmal_add_packet(AVCodecContext *avctx, AVPacket *avpkt) } size = buf->size; data = buf->data; -ctx->packets_sent++; +if (!is_extradata) +ctx->packets_sent++; } else { if (!ctx->packets_sent) { // Short-cut the flush logic to avoid upsetting MMAL. @@ -498,6 +474,9 @@ static int ffmmal_add_packet(AVCodecContext
[FFmpeg-cvslog] Merge commit 'a9b8c638cfe2f82191db65e3e3a39f3b35df81f5'
ffmpeg | branch: master | Hendrik Leppkes | Sat Sep 26 11:07:54 2015 +0200| [2b61cc44433e47c98ec3336bea14f69fdfc9c616] | committer: Hendrik Leppkes Merge commit 'a9b8c638cfe2f82191db65e3e3a39f3b35df81f5' * commit 'a9b8c638cfe2f82191db65e3e3a39f3b35df81f5': mmal: Fix AVBufferRef usage Merged-by: Hendrik Leppkes > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2b61cc44433e47c98ec3336bea14f69fdfc9c616 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'f290e48d86e10f34b5ddc519127636bcebec7c43'
ffmpeg | branch: master | Hendrik Leppkes | Sat Sep 26 11:07:33 2015 +0200| [c5a312dd6afb9aded1f8f763be71ef70d69c7e17] | committer: Hendrik Leppkes Merge commit 'f290e48d86e10f34b5ddc519127636bcebec7c43' * commit 'f290e48d86e10f34b5ddc519127636bcebec7c43': mmal: drop the h264 BSF Merged-by: Hendrik Leppkes > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c5a312dd6afb9aded1f8f763be71ef70d69c7e17 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] dxv: Parse ancillary encoder information
ffmpeg | branch: master | Vittorio Giovara | Tue Sep 22 13:57:56 2015 +0200| [588a5619da0d041e55b365f63d0fa9c72bdbd4d3] | committer: Vittorio Giovara dxv: Parse ancillary encoder information Header does not contain the number of channels, but rather the encoder version, so rename the variable, and read the additional byte. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=588a5619da0d041e55b365f63d0fa9c72bdbd4d3 --- libavcodec/dxv.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c index dc11f38..22148a9 100644 --- a/libavcodec/dxv.c +++ b/libavcodec/dxv.c @@ -322,7 +322,8 @@ static int dxv_decode(AVCodecContext *avctx, void *data, GetByteContext *gbc = &ctx->gbc; int (*decompress_tex)(AVCodecContext *avctx); uint32_t tag; -int channels, size = 0, old_type = 0; +int version_major, version_minor = 0; +int size = 0, old_type = 0; int ret; bytestream2_init(gbc, avpkt->data, avpkt->size); @@ -351,7 +352,8 @@ static int dxv_decode(AVCodecContext *avctx, void *data, /* Old version does not have a real header, just size and type. */ size = tag & 0x00FF; old_type = tag >> 24; -channels = old_type & 0x0F; +version_major = (old_type & 0x0F) - 1; + if (old_type & 0x40) { av_log(avctx, AV_LOG_DEBUG, "LZF compression and DXT5 texture "); ctx->tex_funct = ctx->texdsp.dxt5_block; @@ -371,11 +373,13 @@ static int dxv_decode(AVCodecContext *avctx, void *data, /* New header is 12 bytes long. */ if (!old_type) { -channels = bytestream2_get_byte(gbc); -bytestream2_skip(gbc, 3); // unknown +version_major = bytestream2_get_byte(gbc) - 1; +version_minor = bytestream2_get_byte(gbc); + +bytestream2_skip(gbc, 2); // unknown size = bytestream2_get_le32(gbc); } -av_log(avctx, AV_LOG_DEBUG, "(%d channels)\n", channels); +av_log(avctx, AV_LOG_DEBUG, "(version %d.%d)\n", version_major, version_minor); if (size != bytestream2_get_bytes_left(gbc)) { av_log(avctx, AV_LOG_ERROR, "Incomplete or invalid file (%u > %u)\n.", ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] dxv: Support RAW intermediate compression
ffmpeg | branch: master | Vittorio Giovara | Tue Sep 22 13:57:59 2015 +0200| [1bcd4a476ba45a7fdf59d1701b8f0e274418cc32] | committer: Vittorio Giovara dxv: Support RAW intermediate compression Sample-Id: boombox64.mov Reported-by: Aarni Koskela Signed-off-by: Vittorio Giovara > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1bcd4a476ba45a7fdf59d1701b8f0e274418cc32 --- libavcodec/dxv.c | 28 +--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c index 9fafef9..3f060cb 100644 --- a/libavcodec/dxv.c +++ b/libavcodec/dxv.c @@ -314,6 +314,15 @@ static int dxv_decompress_lzf(AVCodecContext *avctx) return ff_lzf_uncompress(&ctx->gbc, &ctx->tex_data, &ctx->tex_size); } +static int dxv_decompress_raw(AVCodecContext *avctx) +{ +DXVContext *ctx = avctx->priv_data; +GetByteContext *gbc = &ctx->gbc; + +bytestream2_get_buffer(gbc, ctx->tex_data, ctx->tex_size); +return 0; +} + static int dxv_decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { @@ -356,7 +365,14 @@ static int dxv_decode(AVCodecContext *avctx, void *data, size = tag & 0x00FF; old_type = tag >> 24; version_major = (old_type & 0x0F) - 1; -msgcomp = "LZF"; + +if (old_type & 0x80) { +msgcomp = "RAW"; +decompress_tex = dxv_decompress_raw; +} else { +msgcomp = "LZF"; +decompress_tex = dxv_decompress_lzf; +} if (old_type & 0x40) { msgtext = "DXT5"; @@ -372,7 +388,6 @@ static int dxv_decode(AVCodecContext *avctx, void *data, av_log(avctx, AV_LOG_ERROR, "Unsupported header (0x%08X)\n.", tag); return AVERROR_INVALIDDATA; } -decompress_tex = dxv_decompress_lzf; ctx->tex_rat = 1; break; } @@ -382,7 +397,14 @@ static int dxv_decode(AVCodecContext *avctx, void *data, version_major = bytestream2_get_byte(gbc) - 1; version_minor = bytestream2_get_byte(gbc); -bytestream2_skip(gbc, 2); // unknown +/* Encoder copies texture data when compression is not advantageous. */ +if (bytestream2_get_byte(gbc)) { +msgcomp = "RAW"; +ctx->tex_rat = 1; +decompress_tex = dxv_decompress_raw; +} + +bytestream2_skip(gbc, 1); // unknown size = bytestream2_get_le32(gbc); } av_log(avctx, AV_LOG_DEBUG, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] dxv: Print texture information after header parsing
ffmpeg | branch: master | Vittorio Giovara | Tue Sep 22 13:57:58 2015 +0200| [bbf71d46db3417b43bcbd745cbf235e8e2ff69ae] | committer: Vittorio Giovara dxv: Print texture information after header parsing > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bbf71d46db3417b43bcbd745cbf235e8e2ff69ae --- libavcodec/dxv.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c index df2b6c6..9fafef9 100644 --- a/libavcodec/dxv.c +++ b/libavcodec/dxv.c @@ -321,6 +321,7 @@ static int dxv_decode(AVCodecContext *avctx, void *data, ThreadFrame tframe; GetByteContext *gbc = &ctx->gbc; int (*decompress_tex)(AVCodecContext *avctx); +const char *msgcomp, *msgtext; uint32_t tag; int version_major, version_minor = 0; int size = 0, old_type = 0; @@ -335,14 +336,16 @@ static int dxv_decode(AVCodecContext *avctx, void *data, ctx->tex_funct = ctx->texdsp.dxt1_block; ctx->tex_rat = 8; ctx->tex_step = 8; -av_log(avctx, AV_LOG_DEBUG, "DXTR1 compression and DXT1 texture "); +msgcomp = "DXTR1"; +msgtext = "DXT1"; break; case MKBETAG('D', 'X', 'T', '5'): decompress_tex = dxv_decompress_dxt5; ctx->tex_funct = ctx->texdsp.dxt5_block; ctx->tex_rat = 4; ctx->tex_step = 16; -av_log(avctx, AV_LOG_DEBUG, "DXTR5 compression and DXT5 texture "); +msgcomp = "DXTR5"; +msgtext = "DXT5"; break; case MKBETAG('Y', 'C', 'G', '6'): case MKBETAG('Y', 'G', '1', '0'): @@ -353,13 +356,16 @@ static int dxv_decode(AVCodecContext *avctx, void *data, size = tag & 0x00FF; old_type = tag >> 24; version_major = (old_type & 0x0F) - 1; +msgcomp = "LZF"; if (old_type & 0x40) { -av_log(avctx, AV_LOG_DEBUG, "LZF compression and DXT5 texture "); +msgtext = "DXT5"; + ctx->tex_funct = ctx->texdsp.dxt5_block; ctx->tex_step = 16; } else if (old_type & 0x20 || version_major == 1) { -av_log(avctx, AV_LOG_DEBUG, "LZF compression and DXT1 texture "); +msgtext = "DXT1"; + ctx->tex_funct = ctx->texdsp.dxt1_block; ctx->tex_step = 8; } else { @@ -379,7 +385,9 @@ static int dxv_decode(AVCodecContext *avctx, void *data, bytestream2_skip(gbc, 2); // unknown size = bytestream2_get_le32(gbc); } -av_log(avctx, AV_LOG_DEBUG, "(version %d.%d)\n", version_major, version_minor); +av_log(avctx, AV_LOG_DEBUG, + "%s compression with %s texture (version %d.%d)\n", + msgcomp, msgtext, version_major, version_minor); if (size != bytestream2_get_bytes_left(gbc)) { av_log(avctx, AV_LOG_ERROR, "Incomplete or invalid file (%u > %u)\n.", ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] dxv: Support the original first version
ffmpeg | branch: master | Vittorio Giovara | Tue Sep 22 13:57:57 2015 +0200| [fb2889691cb7720d2680e188eb6036a35afa2392] | committer: Vittorio Giovara dxv: Support the original first version DXV 1.0 provided DXT1 with LZF only. Sample-Id: Orange-Strings-07_640_DXV.mov Reported-by: Carl Eugen Hoyos Signed-off-by: Vittorio Giovara > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fb2889691cb7720d2680e188eb6036a35afa2392 --- libavcodec/dxv.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c index 22148a9..df2b6c6 100644 --- a/libavcodec/dxv.c +++ b/libavcodec/dxv.c @@ -358,7 +358,7 @@ static int dxv_decode(AVCodecContext *avctx, void *data, av_log(avctx, AV_LOG_DEBUG, "LZF compression and DXT5 texture "); ctx->tex_funct = ctx->texdsp.dxt5_block; ctx->tex_step = 16; -} else if (old_type & 0x20) { +} else if (old_type & 0x20 || version_major == 1) { av_log(avctx, AV_LOG_DEBUG, "LZF compression and DXT1 texture "); ctx->tex_funct = ctx->texdsp.dxt1_block; ctx->tex_step = 8; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] dxv: Improve error message
ffmpeg | branch: master | Vittorio Giovara | Tue Sep 22 13:58:00 2015 +0200| [b2417ee6d1ee0c5e9b170a642d73bdf68908966f] | committer: Vittorio Giovara dxv: Improve error message > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b2417ee6d1ee0c5e9b170a642d73bdf68908966f --- libavcodec/dxv.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c index 3f060cb..32137f5 100644 --- a/libavcodec/dxv.c +++ b/libavcodec/dxv.c @@ -412,7 +412,8 @@ static int dxv_decode(AVCodecContext *avctx, void *data, msgcomp, msgtext, version_major, version_minor); if (size != bytestream2_get_bytes_left(gbc)) { -av_log(avctx, AV_LOG_ERROR, "Incomplete or invalid file (%u > %u)\n.", +av_log(avctx, AV_LOG_ERROR, + "Incomplete or invalid file (header %d, left %d).\n", size, bytestream2_get_bytes_left(gbc)); return AVERROR_INVALIDDATA; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '588a5619da0d041e55b365f63d0fa9c72bdbd4d3'
ffmpeg | branch: master | Hendrik Leppkes | Sat Sep 26 11:11:06 2015 +0200| [d0aec0aae872d00402e6d81d0884ddbcb657c087] | committer: Hendrik Leppkes Merge commit '588a5619da0d041e55b365f63d0fa9c72bdbd4d3' * commit '588a5619da0d041e55b365f63d0fa9c72bdbd4d3': dxv: Parse ancillary encoder information Merged-by: Hendrik Leppkes > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d0aec0aae872d00402e6d81d0884ddbcb657c087 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'bbf71d46db3417b43bcbd745cbf235e8e2ff69ae'
ffmpeg | branch: master | Hendrik Leppkes | Sat Sep 26 11:14:01 2015 +0200| [f6048e4920de96f5ddf3a149638e0ffbb055ef8a] | committer: Hendrik Leppkes Merge commit 'bbf71d46db3417b43bcbd745cbf235e8e2ff69ae' * commit 'bbf71d46db3417b43bcbd745cbf235e8e2ff69ae': dxv: Print texture information after header parsing Merged-by: Hendrik Leppkes > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f6048e4920de96f5ddf3a149638e0ffbb055ef8a --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '1bcd4a476ba45a7fdf59d1701b8f0e274418cc32'
ffmpeg | branch: master | Hendrik Leppkes | Sat Sep 26 11:14:25 2015 +0200| [b4ea8a7305214c0460e0ac951135aafcfa99d9e5] | committer: Hendrik Leppkes Merge commit '1bcd4a476ba45a7fdf59d1701b8f0e274418cc32' * commit '1bcd4a476ba45a7fdf59d1701b8f0e274418cc32': dxv: Support RAW intermediate compression Merged-by: Hendrik Leppkes > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b4ea8a7305214c0460e0ac951135aafcfa99d9e5 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'b2417ee6d1ee0c5e9b170a642d73bdf68908966f'
ffmpeg | branch: master | Hendrik Leppkes | Sat Sep 26 11:14:31 2015 +0200| [9c3c8d2c56027f2f6dd72daca76a78d309e3acf3] | committer: Hendrik Leppkes Merge commit 'b2417ee6d1ee0c5e9b170a642d73bdf68908966f' * commit 'b2417ee6d1ee0c5e9b170a642d73bdf68908966f': dxv: Improve error message Merged-by: Hendrik Leppkes > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9c3c8d2c56027f2f6dd72daca76a78d309e3acf3 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'fb2889691cb7720d2680e188eb6036a35afa2392'
ffmpeg | branch: master | Hendrik Leppkes | Sat Sep 26 11:13:48 2015 +0200| [234c7378ca1991d3389f25927e9e98184dccb4a1] | committer: Hendrik Leppkes Merge commit 'fb2889691cb7720d2680e188eb6036a35afa2392' * commit 'fb2889691cb7720d2680e188eb6036a35afa2392': dxv: Support the original first version Merged-by: Hendrik Leppkes > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=234c7378ca1991d3389f25927e9e98184dccb4a1 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] checkasm: clip vp9 loopfilter test pixels inside allowed bitdepth range.
ffmpeg | branch: master | Ronald S. Bultje | Tue Sep 22 20:48:15 2015 -0400| [7a4b97e946f5a1fdf9839c11db3331381bb8643c] | committer: Ronald S. Bultje checkasm: clip vp9 loopfilter test pixels inside allowed bitdepth range. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7a4b97e946f5a1fdf9839c11db3331381bb8643c --- tests/checkasm/vp9dsp.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/checkasm/vp9dsp.c b/tests/checkasm/vp9dsp.c index 46af118..0f45a8b 100644 --- a/tests/checkasm/vp9dsp.c +++ b/tests/checkasm/vp9dsp.c @@ -97,9 +97,9 @@ static void check_ipred(void) #define setpx(a,b,c) \ do { \ if (SIZEOF_PIXEL == 1) { \ -buf0[(a) + (b) * jstride] = c; \ +buf0[(a) + (b) * jstride] = av_clip_uint8(c); \ } else { \ -((uint16_t *)buf0)[(a) + (b) * jstride] = c; \ +((uint16_t *)buf0)[(a) + (b) * jstride] = av_clip_uintp2(c, bit_depth); \ } \ } while (0) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/ffv1dec: Fix off by 1 error in quant_table_count check
ffmpeg | branch: master | Michael Niedermayer | Sat Sep 26 13:20:59 2015 +0200| [2d221d9e069e6269cb41f3678f2734800171d87b] | committer: Michael Niedermayer avcodec/ffv1dec: Fix off by 1 error in quant_table_count check Fixes: invalid_read.nut Found-by: Paul B Mahol Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2d221d9e069e6269cb41f3678f2734800171d87b --- libavcodec/ffv1dec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index 2a1fc0d..662ef13 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -305,7 +305,7 @@ static int decode_slice_header(FFV1Context *f, FFV1Context *fs) for (i = 0; i < f->plane_count; i++) { PlaneContext * const p = &fs->plane[i]; int idx = get_symbol(c, state, 0); -if (idx > (unsigned)f->quant_table_count) { +if (idx >= (unsigned)f->quant_table_count) { av_log(f->avctx, AV_LOG_ERROR, "quant_table_index out of range\n"); return -1; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/ffv1dec: Explicitly check read_quant_table() return value
ffmpeg | branch: master | Michael Niedermayer | Sat Sep 26 13:09:59 2015 +0200| [10bbf6cf622f8a954c6cc694ca07c24f989c99af] | committer: Michael Niedermayer avcodec/ffv1dec: Explicitly check read_quant_table() return value Forwards the error code, avoids potential integer overflow Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=10bbf6cf622f8a954c6cc694ca07c24f989c99af --- libavcodec/ffv1dec.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index 6ab6a96..2a1fc0d 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -502,7 +502,10 @@ static int read_quant_tables(RangeCoder *c, int context_count = 1; for (i = 0; i < 5; i++) { -context_count *= read_quant_table(c, quant_table[i], context_count); +int ret = read_quant_table(c, quant_table[i], context_count); +if (ret < 0) +return ret; +context_count *= ret; if (context_count > 32768U) { return AVERROR_INVALIDDATA; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] checkasm: Use a self-balancing tree
ffmpeg | branch: master | Henrik Gramner | Fri Sep 25 18:56:00 2015 +0200| [2ab65b652dc5e69fb738f1afdc55f7a2f9cbc0e0] | committer: Henrik Gramner checkasm: Use a self-balancing tree Tested functions are internally kept in a binary search tree for efficient lookups. The downside of the current implementation is that the tree quickly becomes unbalanced which causes an unneccessary amount of comparisons between nodes. Improve this by changing the tree into a self-balancing left-leaning red-black tree with a worst case lookup/insertion time complexity of O(log n). Significantly reduces the recursion depth and makes the tests run around 10% faster overall. The relative performance improvement compared to the existing non-balanced tree will also most likely increase as more tests are added. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2ab65b652dc5e69fb738f1afdc55f7a2f9cbc0e0 --- tests/checkasm/checkasm.c | 59 - 1 file changed, 47 insertions(+), 12 deletions(-) diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c index 2bfa9d4..2f967e3 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -134,6 +134,7 @@ typedef struct CheckasmFuncVersion { typedef struct CheckasmFunc { struct CheckasmFunc *child[2]; CheckasmFuncVersion versions; +uint8_t color; /* 0 = red, 1 = black */ char name[1]; } CheckasmFunc; @@ -296,24 +297,57 @@ static int cmp_func_names(const char *a, const char *b) return (digit_diff = av_isdigit(*a) - av_isdigit(*b)) ? digit_diff : ascii_diff; } +/* Perform a tree rotation in the specified direction and return the new root */ +static CheckasmFunc *rotate_tree(CheckasmFunc *f, int dir) +{ +CheckasmFunc *r = f->child[dir^1]; +f->child[dir^1] = r->child[dir]; +r->child[dir] = f; +r->color = f->color; +f->color = 0; +return r; +} + +#define is_red(f) ((f) && !(f)->color) + +/* Balance a left-leaning red-black tree at the specified node */ +static void balance_tree(CheckasmFunc **root) +{ +CheckasmFunc *f = *root; + +if (is_red(f->child[0]) && is_red(f->child[1])) { +f->color ^= 1; +f->child[0]->color = f->child[1]->color = 1; +} + +if (!is_red(f->child[0]) && is_red(f->child[1])) +*root = rotate_tree(f, 0); /* Rotate left */ +else if (is_red(f->child[0]) && is_red(f->child[0]->child[0])) +*root = rotate_tree(f, 1); /* Rotate right */ +} + /* Get a node with the specified name, creating it if it doesn't exist */ -static CheckasmFunc *get_func(const char *name, int length) +static CheckasmFunc *get_func(CheckasmFunc **root, const char *name) { -CheckasmFunc *f, **f_ptr = &state.funcs; +CheckasmFunc *f = *root; -/* Search the tree for a matching node */ -while ((f = *f_ptr)) { +if (f) { +/* Search the tree for a matching node */ int cmp = cmp_func_names(name, f->name); -if (!cmp) -return f; +if (cmp) { +f = get_func(&f->child[cmp > 0], name); -f_ptr = &f->child[(cmp > 0)]; +/* Rebalance the tree on the way up if a new node was inserted */ +if (!f->versions.func) +balance_tree(root); +} +} else { +/* Allocate and insert a new node into the tree */ +int name_length = strlen(name); +f = *root = checkasm_malloc(sizeof(CheckasmFunc) + name_length); +memcpy(f->name, name, name_length + 1); } -/* Allocate and insert a new node into the tree */ -f = *f_ptr = checkasm_malloc(sizeof(CheckasmFunc) + length); -memcpy(f->name, name, length+1); - return f; } @@ -414,7 +448,8 @@ void *checkasm_check_func(void *func, const char *name, ...) if (!func || name_length <= 0 || name_length >= sizeof(name_buf)) return NULL; -state.current_func = get_func(name_buf, name_length); +state.current_func = get_func(&state.funcs, name_buf); +state.funcs->color = 1; v = &state.current_func->versions; if (v->func) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_blend: add addition128 mode
ffmpeg | branch: master | Paul B Mahol | Sat Sep 26 15:31:36 2015 +0200| [4cf60b4fa12f4e1804c05d58ed79d2bbb991c3f5] | committer: Paul B Mahol avfilter/vf_blend: add addition128 mode Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4cf60b4fa12f4e1804c05d58ed79d2bbb991c3f5 --- doc/filters.texi |1 + libavfilter/vf_blend.c |5 + 2 files changed, 6 insertions(+) diff --git a/doc/filters.texi b/doc/filters.texi index 044876c..0fdb677 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -3493,6 +3493,7 @@ of @var{all_mode}. Default value is @code{normal}. Available values for component modes are: @table @samp @item addition +@item addition128 @item and @item average @item burn diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c index ef0e7e4..f6a649b 100644 --- a/libavfilter/vf_blend.c +++ b/libavfilter/vf_blend.c @@ -62,6 +62,7 @@ enum BlendMode { BLEND_HARDMIX, BLEND_LINEARLIGHT, BLEND_GLOW, +BLEND_ADDITION128, BLEND_NB }; @@ -110,6 +111,7 @@ typedef struct { { "c3_mode", "set component #3 blend mode", OFFSET(params[3].mode), AV_OPT_TYPE_INT, {.i64=0}, 0, BLEND_NB-1, FLAGS, "mode"},\ { "all_mode", "set blend mode for all components", OFFSET(all_mode), AV_OPT_TYPE_INT, {.i64=-1},-1, BLEND_NB-1, FLAGS, "mode"},\ { "addition", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_ADDITION}, 0, 0, FLAGS, "mode" },\ +{ "addition128", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_ADDITION128}, 0, 0, FLAGS, "mode" },\ { "and","", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_AND},0, 0, FLAGS, "mode" },\ { "average","", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_AVERAGE},0, 0, FLAGS, "mode" },\ { "burn", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_BURN}, 0, 0, FLAGS, "mode" },\ @@ -224,6 +226,7 @@ static void blend_## name##_16bit(const uint8_t *_top, int top_linesize, \ #define DODGE(a, b) (((a) == 255) ? (a) : FFMIN(255, (((b) << 8) / (255 - (a) DEFINE_BLEND8(addition, FFMIN(255, A + B)) +DEFINE_BLEND8(addition128, av_clip_uint8(A + B - 128)) DEFINE_BLEND8(average,(A + B) / 2) DEFINE_BLEND8(subtract, FFMAX(0, A - B)) DEFINE_BLEND8(multiply, MULTIPLY(1, A, B)) @@ -262,6 +265,7 @@ DEFINE_BLEND8(linearlight,av_clip_uint8((B < 128) ? B + 2 * A - 255 : B + 2 * (A #define DODGE(a, b) (((a) == 65535) ? (a) : FFMIN(65535, (((b) << 16) / (65535 - (a) DEFINE_BLEND16(addition, FFMIN(65535, A + B)) +DEFINE_BLEND16(addition128, av_clip_uint16(A + B - 32768)) DEFINE_BLEND16(average,(A + B) / 2) DEFINE_BLEND16(subtract, FFMAX(0, A - B)) DEFINE_BLEND16(multiply, MULTIPLY(1, A, B)) @@ -481,6 +485,7 @@ static int config_output(AVFilterLink *outlink) switch (param->mode) { case BLEND_ADDITION: param->blend = is_16bit ? blend_addition_16bit : blend_addition_8bit; break; +case BLEND_ADDITION128: param->blend = is_16bit ? blend_addition128_16bit : blend_addition128_8bit; break; case BLEND_AND:param->blend = is_16bit ? blend_and_16bit : blend_and_8bit;break; case BLEND_AVERAGE:param->blend = is_16bit ? blend_average_16bit : blend_average_8bit;break; case BLEND_BURN: param->blend = is_16bit ? blend_burn_16bit : blend_burn_8bit; break; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] dnxhddec: proper rule for interlaced mb flag
ffmpeg | branch: master | Christophe Gisquet | Sat Sep 26 14:31:55 2015 +0200| [e4b7c3a9f21b9be84fe3ba9aed953c60720c6459] | committer: Michael Niedermayer dnxhddec: proper rule for interlaced mb flag It currently only applies to CID 1260, but this flag is dependent on a higher-level flag located in the header. Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e4b7c3a9f21b9be84fe3ba9aed953c60720c6459 --- libavcodec/dnxhddec.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index 044e479..e5c5f07 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -50,6 +50,7 @@ typedef struct DNXHDContext { const CIDEntry *cid_table; int bit_depth; // 8, 10 or 0 if not initialized at all. int is_444; +int mbaff; void (*decode_dct_block)(struct DNXHDContext *ctx, int16_t *block, int n, int qscale); int last_qscale; @@ -144,6 +145,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, } else { ctx->cur_field = 0; } +ctx->mbaff = buf[0x6] & 32; ctx->height = AV_RB16(buf + 0x18); ctx->width = AV_RB16(buf + 0x1a); @@ -183,6 +185,9 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, if ((ret = dnxhd_init_vlc(ctx, cid)) < 0) return ret; +if (ctx->mbaff && ctx->cid_table->cid != 1260) +av_log(ctx->avctx, AV_LOG_WARNING, + "Adaptive MB interlace flag in an unsupported profile.\n"); // make sure profile size constraints are respected // DNx100 allows 1920->1440 and 1280->960 subsampling @@ -352,7 +357,7 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame, int qscale, i; int interlaced_mb = 0; -if (ctx->cid_table->cid == 1260) { +if (ctx->mbaff) { interlaced_mb = get_bits1(&ctx->gb); qscale = get_bits(&ctx->gb, 10); } else ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] dnxhddec: parse and print adaptive color transform
ffmpeg | branch: master | Christophe Gisquet | Fri Sep 25 17:07:38 2015 +0200| [dc218bd08305656d97ad51c57ee4ab2040cd2425] | committer: Michael Niedermayer dnxhddec: parse and print adaptive color transform Indicates a YCbCr->RGB transform at the block level. Although nothing explicitly states it, this would assume the actual content is planar RGB. Currently unsupported, but the one sequence I found using it flagged every mb that way, actually meaning the content was YCbCr, and thus best left to the output format to decide what to do of it. Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dc218bd08305656d97ad51c57ee4ab2040cd2425 --- libavcodec/dnxhddec.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index e5c5f07..22d8c0b 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -51,6 +51,7 @@ typedef struct DNXHDContext { int bit_depth; // 8, 10 or 0 if not initialized at all. int is_444; int mbaff; +int act; void (*decode_dct_block)(struct DNXHDContext *ctx, int16_t *block, int n, int qscale); int last_qscale; @@ -189,6 +190,11 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, av_log(ctx->avctx, AV_LOG_WARNING, "Adaptive MB interlace flag in an unsupported profile.\n"); +ctx->act = buf[0x2C] & 7; +if (ctx->act && ctx->cid_table->cid != 1256) +av_log(ctx->avctx, AV_LOG_WARNING, + "Adaptive color transform in an unsupported profile.\n"); + // make sure profile size constraints are respected // DNx100 allows 1920->1440 and 1280->960 subsampling if (ctx->width != ctx->cid_table->width) { @@ -354,7 +360,7 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame, int dct_linesize_chroma = frame->linesize[1]; uint8_t *dest_y, *dest_u, *dest_v; int dct_y_offset, dct_x_offset; -int qscale, i; +int qscale, i, act; int interlaced_mb = 0; if (ctx->mbaff) { @@ -362,7 +368,15 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame, qscale = get_bits(&ctx->gb, 10); } else qscale = get_bits(&ctx->gb, 11); -skip_bits1(&ctx->gb); +act = get_bits1(&ctx->gb); +if (act) { +static int warned = 0; +if (!warned) { +warned = 1; +av_log(ctx->avctx, AV_LOG_ERROR, + "Unsupported adaptive color transform, patch welcome.\n"); +} +} if (qscale != ctx->last_qscale) { for (i = 0; i < 64; i++) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/hls: remove unused function
ffmpeg | branch: master | Ganesh Ajjanagadde | Wed Sep 16 20:26:42 2015 -0400| [db9de9b954a7dd453e928d17d7521915afe86764] | committer: wm4 avformat/hls: remove unused function Fixes -Wunused-function from http://fate.ffmpeg.org/report.cgi?time=20150820031140&slot=arm64-darwin-clang-apple-5.1 Signed-off-by: Ganesh Ajjanagadde > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=db9de9b954a7dd453e928d17d7521915afe86764 --- libavformat/hls.c | 13 - 1 file changed, 13 deletions(-) diff --git a/libavformat/hls.c b/libavformat/hls.c index f17fd45..deba61f 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -495,19 +495,6 @@ static int ensure_playlist(HLSContext *c, struct playlist **pls, const char *url return 0; } -static int open_in(HLSContext *c, AVIOContext **in, const char *url) -{ -AVDictionary *tmp = NULL; -int ret; - -av_dict_copy(&tmp, c->avio_opts, 0); - -ret = avio_open2(in, url, AVIO_FLAG_READ, c->interrupt_callback, &tmp); - -av_dict_free(&tmp); -return ret; -} - static int url_connect(struct playlist *pls, AVDictionary *opts, AVDictionary *opts2) { AVDictionary *tmp = NULL; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avutil/opencl: Fix volatile pointer
ffmpeg | branch: master | Timo Rothenpieler | Thu Sep 24 16:58:30 2015 +0200| [31ee86cd9869200c69f39ac7fbe648cee2dace68] | committer: Timo Rothenpieler avutil/opencl: Fix volatile pointer Reviewed-by: Michael Niedermayer Signed-off-by: Timo Rothenpieler > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=31ee86cd9869200c69f39ac7fbe648cee2dace68 --- libavutil/opencl.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavutil/opencl.c b/libavutil/opencl.c index 1d78214..8686493 100644 --- a/libavutil/opencl.c +++ b/libavutil/opencl.c @@ -37,7 +37,7 @@ #endif #include "atomic.h" -static volatile pthread_mutex_t *atomic_opencl_lock = NULL; +static pthread_mutex_t * volatile atomic_opencl_lock = NULL; #define LOCK_OPENCL pthread_mutex_lock(atomic_opencl_lock) #define UNLOCK_OPENCL pthread_mutex_unlock(atomic_opencl_lock) #else @@ -363,7 +363,7 @@ static inline int init_opencl_mtx(void) av_free(tmp); return AVERROR(err); } -if (avpriv_atomic_ptr_cas(&atomic_opencl_lock, NULL, tmp)) { +if (avpriv_atomic_ptr_cas((void * volatile *)&atomic_opencl_lock, NULL, tmp)) { pthread_mutex_destroy(tmp); av_free(tmp); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] checkasm/vp9dsp: add const to suppress "discards const qualifier" warnings
ffmpeg | branch: master | James Almer | Sat Sep 26 16:08:51 2015 -0300| [4e03f0ab08e27537512107cba6e357d34284a35f] | committer: James Almer checkasm/vp9dsp: add const to suppress "discards const qualifier" warnings Reviewed-by: Henrik Gramner Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4e03f0ab08e27537512107cba6e357d34284a35f --- tests/checkasm/vp9dsp.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/checkasm/vp9dsp.c b/tests/checkasm/vp9dsp.c index 0f45a8b..d175e17 100644 --- a/tests/checkasm/vp9dsp.c +++ b/tests/checkasm/vp9dsp.c @@ -107,8 +107,8 @@ static void check_ipred(void) #define setdx(a,b,c,d) setpx(a,b,c-(d)+(rnd()%((d)*2+1))) #define setsx(a,b,c,d) setdx(a,b,c,(d) << (bit_depth - 8)) static void randomize_loopfilter_buffers(int bidx, int lineoff, int str, - int bit_depth, int dir, - int* E, int* F, int* H, int* I, + int bit_depth, int dir, const int *E, + const int *F, const int *H, const int *I, uint8_t *buf0, uint8_t *buf1) { uint32_t mask = (1 << bit_depth) - 1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] checkasm/Makefile: add missing testclean target
ffmpeg | branch: master | James Almer | Sat Sep 26 16:08:04 2015 -0300| [af990d72b7e3fef3d09e1a79c53a80f1416a5ab2] | committer: James Almer checkasm/Makefile: add missing testclean target Reviewed-by: Henrik Gramner Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=af990d72b7e3fef3d09e1a79c53a80f1416a5ab2 --- tests/checkasm/Makefile |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/checkasm/Makefile b/tests/checkasm/Makefile index 03e0e3f..f30e9c4 100644 --- a/tests/checkasm/Makefile +++ b/tests/checkasm/Makefile @@ -30,7 +30,7 @@ $(CHECKASM): $(EXEOBJS) $(CHECKASMOBJS) $(FF_STATIC_DEP_LIBS) checkasm: $(CHECKASM) -clean:: checkasmclean +testclean:: checkasmclean checkasmclean: $(RM) $(CHECKASM) $(CLEANSUFFIXES:%=tests/checkasm/%) $(CLEANSUFFIXES:%=tests/checkasm/$(ARCH)/%) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avutil/avstring: Inline some tiny functions
ffmpeg | branch: master | Henrik Gramner | Sat Sep 26 18:04:11 2015 +0200| [ad9a543e9351d940a53450f793458664c8a74a73] | committer: Henrik Gramner avutil/avstring: Inline some tiny functions They're short enough that inlining them actually reduces code size due to all the overhead associated with making a function call. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ad9a543e9351d940a53450f793458664c8a74a73 --- libavutil/avstring.c | 22 -- libavutil/avstring.h | 22 ++ 2 files changed, 18 insertions(+), 26 deletions(-) diff --git a/libavutil/avstring.c b/libavutil/avstring.c index 24d1bb9..57fe74d 100644 --- a/libavutil/avstring.c +++ b/libavutil/avstring.c @@ -317,28 +317,6 @@ int av_escape(char **dst, const char *src, const char *special_chars, } } -int av_isdigit(int c) -{ -return c >= '0' && c <= '9'; -} - -int av_isgraph(int c) -{ -return c > 32 && c < 127; -} - -int av_isspace(int c) -{ -return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || - c == '\v'; -} - -int av_isxdigit(int c) -{ -c = av_tolower(c); -return av_isdigit(c) || (c >= 'a' && c <= 'f'); -} - int av_match_name(const char *name, const char *names) { const char *p; diff --git a/libavutil/avstring.h b/libavutil/avstring.h index 234c030..a306e89 100644 --- a/libavutil/avstring.h +++ b/libavutil/avstring.h @@ -203,17 +203,27 @@ char *av_strtok(char *s, const char *delim, char **saveptr); /** * Locale-independent conversion of ASCII isdigit. */ -av_const int av_isdigit(int c); +static inline av_const int av_isdigit(int c) +{ +return c >= '0' && c <= '9'; +} /** * Locale-independent conversion of ASCII isgraph. */ -av_const int av_isgraph(int c); +static inline av_const int av_isgraph(int c) +{ +return c > 32 && c < 127; +} /** * Locale-independent conversion of ASCII isspace. */ -av_const int av_isspace(int c); +static inline av_const int av_isspace(int c) +{ +return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || + c == '\v'; +} /** * Locale-independent conversion of ASCII characters to uppercase. @@ -238,7 +248,11 @@ static inline av_const int av_tolower(int c) /** * Locale-independent conversion of ASCII isxdigit. */ -av_const int av_isxdigit(int c); +static inline av_const int av_isxdigit(int c) +{ +c = av_tolower(c); +return av_isdigit(c) || (c >= 'a' && c <= 'f'); +} /** * Locale-independent case-insensitive compare. ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] configure: Combine dynamicbase and nxcompat checks
ffmpeg | branch: master | Alex Smith | Sat Sep 26 02:15:24 2015 -0400| [20b079963bf8985c2b7d85452426593bd5d10b9e] | committer: Michael Niedermayer configure: Combine dynamicbase and nxcompat checks They were added to binutils in the same version so it's safe to combine. Signed-off-by: Alex Smith Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=20b079963bf8985c2b7d85452426593bd5d10b9e --- configure |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configure b/configure index f6bc622..11b6dc4 100755 --- a/configure +++ b/configure @@ -4367,8 +4367,6 @@ case $target_os in LIBTARGET=arm-wince fi enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres -check_ldflags -Wl,--nxcompat -check_ldflags -Wl,--dynamicbase enabled x86_32 && check_ldflags -Wl,--large-address-aware shlibdir_default="$bindir_default" SLIBPREF="" @@ -4392,6 +4390,7 @@ case $target_os in objformat="win32" ranlib=: enable dos_paths +check_ldflags -Wl,--nxcompat,--dynamicbase # Lets work around some stupidity in binutils. # ld will strip relocations from executables even though we need them # for dynamicbase (ASLR). Using -pie does retain the reloc section ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffplay: introduce key repeats
ffmpeg | branch: master | Ganesh Ajjanagadde | Sat Sep 26 11:37:03 2015 -0400| [265b106b9296d20c60cfb1cab64388e62150d066] | committer: Marton Balint ffplay: introduce key repeats Key repeats have been introduced simply because they improve usability in my experience for volume, brightness, and other such controls by speeding up the time taken to go from 0 to max intensity. As a side benefit, this enables rapid seeking through a file via left/right keys. Signed-off-by: Ganesh Ajjanagadde Signed-off-by: Marton Balint > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=265b106b9296d20c60cfb1cab64388e62150d066 --- ffplay.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/ffplay.c b/ffplay.c index d302793..9b5ee84 100644 --- a/ffplay.c +++ b/ffplay.c @@ -3740,6 +3740,8 @@ int main(int argc, char **argv) SDL_EventState(SDL_SYSWMEVENT, SDL_IGNORE); SDL_EventState(SDL_USEREVENT, SDL_IGNORE); +SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); + if (av_lockmgr_register(lockmgr)) { av_log(NULL, AV_LOG_FATAL, "Could not initialize lock manager!\n"); do_exit(NULL); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] dnxhddec: implement slice multithreading
ffmpeg | branch: master | Christophe Gisquet | Fri Sep 25 08:56:43 2015 +0200| [08a7510fcad552bfcda644e4ba047605de15fab5] | committer: Michael Niedermayer dnxhddec: implement slice multithreading Around 3x speedup with 4 threads. Maybe more mb lines should be batched per thread, but that's good enough for a first try. Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=08a7510fcad552bfcda644e4ba047605de15fab5 --- libavcodec/dnxhddec.c | 219 + 1 file changed, 131 insertions(+), 88 deletions(-) diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index 22d8c0b..fa93407 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -32,10 +32,21 @@ #include "internal.h" #include "thread.h" +typedef struct RowContext { +DECLARE_ALIGNED(16, int16_t, blocks)[12][64]; +int luma_scale[64]; +int chroma_scale[64]; +GetBitContext gb; +int last_dc[3]; +int last_qscale; +} RowContext; + typedef struct DNXHDContext { AVCodecContext *avctx; -GetBitContext gb; +RowContext *rows; BlockDSPContext bdsp; +const uint8_t* buf; +int buf_size; int64_t cid;///< compression id unsigned int width, height; enum AVPixelFormat pix_fmt; @@ -43,30 +54,29 @@ typedef struct DNXHDContext { uint32_t mb_scan_index[68]; /* max for 1080p */ int cur_field; ///< current interlaced field VLC ac_vlc, dc_vlc, run_vlc; -int last_dc[3]; IDCTDSPContext idsp; -DECLARE_ALIGNED(16, int16_t, blocks)[12][64]; ScanTable scantable; const CIDEntry *cid_table; int bit_depth; // 8, 10 or 0 if not initialized at all. int is_444; int mbaff; int act; -void (*decode_dct_block)(struct DNXHDContext *ctx, int16_t *block, +void (*decode_dct_block)(const struct DNXHDContext *ctx, + RowContext *row, int16_t *block, int n, int qscale); -int last_qscale; -int luma_scale[64]; -int chroma_scale[64]; } DNXHDContext; #define DNXHD_VLC_BITS 9 #define DNXHD_DC_VLC_BITS 7 -static void dnxhd_decode_dct_block_8(DNXHDContext *ctx, int16_t *block, +static void dnxhd_decode_dct_block_8(const DNXHDContext *ctx, + RowContext *row, int16_t *block, int n, int qscale); -static void dnxhd_decode_dct_block_10(DNXHDContext *ctx, int16_t *block, +static void dnxhd_decode_dct_block_10(const DNXHDContext *ctx, + RowContext *row, int16_t *block, int n, int qscale); -static void dnxhd_decode_dct_block_10_444(DNXHDContext *ctx, int16_t *block, +static void dnxhd_decode_dct_block_10_444(const DNXHDContext *ctx, + RowContext *row, int16_t *block, int n, int qscale); static av_cold int dnxhd_decode_init(AVCodecContext *avctx) @@ -76,6 +86,11 @@ static av_cold int dnxhd_decode_init(AVCodecContext *avctx) ctx->avctx = avctx; ctx->cid = -1; avctx->colorspace = AVCOL_SPC_BT709; + +ctx->rows = av_mallocz_array(avctx->thread_count, sizeof(RowContext)); +if (!ctx->rows) +return AVERROR(ENOMEM); + return 0; } @@ -116,6 +131,20 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid) return 0; } +static av_cold int dnxhd_decode_init_thread_copy(AVCodecContext *avctx) +{ +DNXHDContext *ctx = avctx->priv_data; + +// make sure VLC tables will be loaded when cid is parsed +ctx->cid = -1; + +ctx->rows = av_mallocz_array(avctx->thread_count, sizeof(RowContext)); +if (!ctx->rows) +return AVERROR(ENOMEM); + +return 0; +} + static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, const uint8_t *buf, int buf_size, int first_field) @@ -240,7 +269,8 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, return 0; } -static av_always_inline void dnxhd_decode_dct_block(DNXHDContext *ctx, +static av_always_inline void dnxhd_decode_dct_block(const DNXHDContext *ctx, +RowContext *row, int16_t *block, int n, int qscale, int index_bits, @@ -254,61 +284,61 @@ static av_always_inline void dnxhd_decode_dct_block(DNXHDContext *ctx, const uint8_t *ac_level = ctx->cid_table->ac_level; const uint8_t *ac_flags = ctx->cid_table->ac_flags; const int eob_index = ctx->cid_table->eob_index; -OPEN_READER(bs, &ctx->gb); +OPEN_READER(bs, &row->gb); if (!ctx->is_444) { if (n & 2) { component = 1 +
[FFmpeg-cvslog] ffplay: dynamically allocate filename buffer
ffmpeg | branch: master | Ganesh Ajjanagadde | Sat Sep 26 17:09:52 2015 -0400| [23acb982a3c79e993ed45bffde4b1cfc574402df] | committer: Marton Balint ffplay: dynamically allocate filename buffer filename was set to an arbitrary 1024 characters. ffplay would thus be unable to play files whose name exceeds that arbitrary threshold. This patch dynamically allocates and frees the filename buffer to remove such limitations. Signed-off-by: Ganesh Ajjanagadde Signed-off-by: Marton Balint > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=23acb982a3c79e993ed45bffde4b1cfc574402df --- ffplay.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ffplay.c b/ffplay.c index 9b5ee84..2bb5d26 100644 --- a/ffplay.c +++ b/ffplay.c @@ -285,7 +285,7 @@ typedef struct VideoState { SDL_Rect last_display_rect; int eof; -char filename[1024]; +char *filename; int width, height, xleft, ytop; int step; @@ -1132,6 +1132,7 @@ static void stream_close(VideoState *is) sws_freeContext(is->img_convert_ctx); #endif sws_freeContext(is->sub_convert_ctx); +av_free(is->filename); av_free(is); } @@ -3099,7 +3100,9 @@ static VideoState *stream_open(const char *filename, AVInputFormat *iformat) is = av_mallocz(sizeof(VideoState)); if (!is) return NULL; -av_strlcpy(is->filename, filename, sizeof(is->filename)); +is->filename = av_strdup(filename); +if (!is->filename) +goto fail; is->iformat = iformat; is->ytop= 0; is->xleft = 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog