[FFmpeg-devel] [PATCH] mpeg2dec: Fix field selection for skipped macroblocks
For B field pictures, the spec says, > The prediction shall be made from the field of the same parity as the field > being predicted. I did it. --- libavcodec/mpeg12dec.c | 2 + tests/ref/fate/mpeg2-ticket186 | 328 - 2 files changed, 166 insertions(+), 164 deletions(-) diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index f5f2c69..9e076e8 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -1969,6 +1969,8 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y, s->mv[0][0][1] = s->last_mv[0][0][1]; s->mv[1][0][0] = s->last_mv[1][0][0]; s->mv[1][0][1] = s->last_mv[1][0][1]; +s->field_select[0][0] = (s->picture_structure - 1) & 1; +s->field_select[1][0] = (s->picture_structure - 1) & 1; } } } diff --git a/tests/ref/fate/mpeg2-ticket186 b/tests/ref/fate/mpeg2-ticket186 index b716ca5..31afda1 100644 --- a/tests/ref/fate/mpeg2-ticket186 +++ b/tests/ref/fate/mpeg2-ticket186 @@ -3,354 +3,354 @@ #codec_id 0: rawvideo #dimensions 0: 352x288 #sar 0: 12/11 -0, 0, 0,1, 152064, 0xd23ffc59 +0, 0, 0,1, 152064, 0x8f9d00c1 0, 1, 1,1, 152064, 0x899fb8b1 -0, 2, 2,1, 152064, 0x5958d070 +0, 2, 2,1, 152064, 0x7225cb39 0, 3, 3,1, 152064, 0xf2becd8f -0, 4, 4,1, 152064, 0xb47bbed7 +0, 4, 4,1, 152064, 0xd56bc556 0, 5, 5,1, 152064, 0x7ca54f36 -0, 6, 6,1, 152064, 0x02389610 +0, 6, 6,1, 152064, 0x06d7805c 0, 7, 7,1, 152064, 0x469f3f87 -0, 8, 8,1, 152064, 0x935a780e +0, 8, 8,1, 152064, 0xdb2f57d5 0, 9, 9,1, 152064, 0x3876c20c -0, 10, 10,1, 152064, 0x49df265f +0, 10, 10,1, 152064, 0x5b670e79 0, 11, 11,1, 152064, 0xdfe420e0 -0, 12, 12,1, 152064, 0x6e34a0c4 +0, 12, 12,1, 152064, 0x17578222 0, 13, 13,1, 152064, 0x47e1cb26 -0, 14, 14,1, 152064, 0x68e74188 +0, 14, 14,1, 152064, 0x168e35d6 0, 15, 15,1, 152064, 0xe9d34b4e -0, 16, 16,1, 152064, 0xa8665e1a +0, 16, 16,1, 152064, 0x5e395308 0, 17, 17,1, 152064, 0x88e3b39f -0, 18, 18,1, 152064, 0x1c1ab2c3 +0, 18, 18,1, 152064, 0x6b099c51 0, 19, 19,1, 152064, 0xb1a24ddf -0, 20, 20,1, 152064, 0x030d5afc +0, 20, 20,1, 152064, 0xcea840fc 0, 21, 21,1, 152064, 0x98306d64 -0, 22, 22,1, 152064, 0x5ce0548d +0, 22, 22,1, 152064, 0xb05354d3 0, 23, 23,1, 152064, 0xacac26f3 -0, 24, 24,1, 152064, 0xf167f698 +0, 24, 24,1, 152064, 0xbccdf14b 0, 25, 25,1, 152064, 0xd9398539 -0, 26, 26,1, 152064, 0xd7aec2c4 +0, 26, 26,1, 152064, 0x07aec13a 0, 27, 27,1, 152064, 0xa6ef9440 -0, 28, 28,1, 152064, 0xc289b278 +0, 28, 28,1, 152064, 0x0e7ab64e 0, 29, 29,1, 152064, 0x3796939d -0, 30, 30,1, 152064, 0x48c09366 +0, 30, 30,1, 152064, 0xcc219365 0, 31, 31,1, 152064, 0xf4cc815a -0, 32, 32,1, 152064, 0x1c63cdc2 +0, 32, 32,1, 152064, 0x8b91c622 0, 33, 33,1, 152064, 0xd3a8ad8e -0, 34, 34,1, 152064, 0x70f94bc0 +0, 34, 34,1, 152064, 0x658e498f 0, 35, 35,1, 152064, 0xf9c115ea -0, 36, 36,1, 152064, 0x44a2f607 +0, 36, 36,1, 152064, 0xb639f8d2 0, 37, 37,1, 152064, 0x7e9eaa64 -0, 38, 38,1, 152064, 0x37b86b68 +0, 38, 38,1, 152064, 0x8a546bcf 0, 39, 39,1, 152064, 0x59d22dd4 -0, 40, 40,1, 152064, 0x5d0d0e8d +0, 40, 40,1, 152064, 0x80a10edc 0, 41, 41,1, 152064, 0x5c97d4a1 -0, 42, 42,1, 152064, 0xd44ef54d +0, 42, 42,
[FFmpeg-devel] [PATCH] mpeg2dec: Fix motion vector rounding for chroma components
In 16x8 motion compensation, for lower 16x8 region, the input to mpeg_motion() for motion_y was "motion_y + 16", which causes wrong rounding. For 4:2:0, chroma scaling for y is dividing by two and rounding toward zero. When motion_y < 0 and motion_y + 16 > 0, the rounding direction of "motion_y" and "motion_y + 16" is different and rounding "motion_y + 16" would be incorrect. We should input "motion_y" as is to round correctly. I add "is_16x8" flag to do that. --- libavcodec/mpegvideo_motion.c| 30 - tests/ref/fate/filter-w3fdif-complex | 60 +- tests/ref/fate/filter-w3fdif-simple | 60 +- tests/ref/fate/filter-yadif-mode0| 60 +- tests/ref/fate/filter-yadif-mode1| 118 +-- tests/ref/fate/filter-yadif10| 60 +- tests/ref/fate/filter-yadif16| 60 +- tests/ref/fate/mpeg2-field-enc | 60 +- tests/ref/fate/mpeg2-ticket6677 | 12 ++-- 9 files changed, 261 insertions(+), 259 deletions(-) diff --git a/libavcodec/mpegvideo_motion.c b/libavcodec/mpegvideo_motion.c index c913504..5624c10 100644 --- a/libavcodec/mpegvideo_motion.c +++ b/libavcodec/mpegvideo_motion.c @@ -239,20 +239,22 @@ void mpeg_motion_internal(MpegEncContext *s, int motion_y, int h, int is_mpeg12, + int is_16x8, int mb_y) { uint8_t *ptr_y, *ptr_cb, *ptr_cr; int dxy, uvdxy, mx, my, src_x, src_y, -uvsrc_x, uvsrc_y, v_edge_pos; +uvsrc_x, uvsrc_y, v_edge_pos, block_y_half; ptrdiff_t uvlinesize, linesize; v_edge_pos = s->v_edge_pos >> field_based; linesize = s->current_picture.f->linesize[0] << field_based; uvlinesize = s->current_picture.f->linesize[1] << field_based; +block_y_half = (field_based | is_16x8); dxy = ((motion_y & 1) << 1) | (motion_x & 1); src_x = s->mb_x * 16 + (motion_x >> 1); -src_y = (mb_y << (4 - field_based)) + (motion_y >> 1); +src_y = (mb_y << (4 - block_y_half)) + (motion_y >> 1); if (!is_mpeg12 && s->out_format == FMT_H263) { if ((s->workaround_bugs & FF_BUG_HPEL_CHROMA) && field_based) { @@ -260,7 +262,7 @@ void mpeg_motion_internal(MpegEncContext *s, my = motion_y >> 1; uvdxy = ((my & 1) << 1) | (mx & 1); uvsrc_x = s->mb_x * 8 + (mx >> 1); -uvsrc_y = (mb_y << (3 - field_based)) + (my >> 1); +uvsrc_y = (mb_y << (3 - block_y_half)) + (my >> 1); } else { uvdxy = dxy | (motion_y & 2) | ((motion_x & 2) >> 1); uvsrc_x = src_x >> 1; @@ -279,7 +281,7 @@ void mpeg_motion_internal(MpegEncContext *s, my = motion_y / 2; uvdxy = ((my & 1) << 1) | (mx & 1); uvsrc_x = s->mb_x * 8 + (mx >> 1); -uvsrc_y = (mb_y << (3 - field_based)) + (my >> 1); +uvsrc_y = (mb_y << (3 - block_y_half)) + (my >> 1); } else { if (s->chroma_x_shift) { // Chroma422 @@ -370,18 +372,18 @@ static void mpeg_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int field_select, uint8_t **ref_picture, op_pixels_func (*pix_op)[4], -int motion_x, int motion_y, int h, int mb_y) +int motion_x, int motion_y, int h, int is_16x8, int mb_y) { #if !CONFIG_SMALL if (s->out_format == FMT_MPEG1) mpeg_motion_internal(s, dest_y, dest_cb, dest_cr, 0, 0, field_select, ref_picture, pix_op, - motion_x, motion_y, h, 1, mb_y); + motion_x, motion_y, h, 1, is_16x8, mb_y); else #endif mpeg_motion_internal(s, dest_y, dest_cb, dest_cr, 0, 0, field_select, ref_picture, pix_op, - motion_x, motion_y, h, 0, mb_y); + motion_x, motion_y, h, 0, is_16x8, mb_y); } static void mpeg_motion_field(MpegEncContext *s, uint8_t *dest_y, @@ -395,12 +397,12 @@ static void mpeg_motion_field(MpegEncContext *s, uint8_t *dest_y, if (s->out_format == FMT_MPEG1) mpeg_motion_internal(s, dest_y, dest_cb, dest_cr, 1, bottom_field, field_select, ref_picture, pix_op, - motion_x, motion_y, h, 1, mb_y); + motion_x, motion_y, h, 1, 0, mb_y); else #endif mpeg_motion_internal(s, dest_y, dest_cb, dest_cr, 1, bottom_field, field_select, ref_picture, pix_op, - motion_x, motion_y, h, 0, mb_y); + motion_x, motion_y, h, 0, 0, mb_y); } // FIXME: SIMDify, avg
[FFmpeg-devel] [PATCH] fate/libavcodec: add codec_desc test
Remove runtime check at codec_desc.c Signed-off-by: Muhammad Faiz --- libavcodec/Makefile | 1 + libavcodec/codec_desc.c | 24 --- libavcodec/tests/codec_desc.c | 45 +++ tests/fate/libavcodec.mak | 5 + 4 files changed, 51 insertions(+), 24 deletions(-) create mode 100644 libavcodec/tests/codec_desc.c diff --git a/libavcodec/Makefile b/libavcodec/Makefile index beaca9ee51..3d4b738e0b 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -1090,6 +1090,7 @@ SKIPHEADERS-$(CONFIG_V4L2_M2M) += v4l2_buffers.h v4l2_context.h v4l2_m2m TESTPROGS = avpacket\ celp_math \ +codec_desc \ htmlsubtitles \ imgconvert \ jpeg2000dwt \ diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c index 15f6489278..44a54a31c9 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -21,10 +21,8 @@ #include -#include "libavutil/avassert.h" #include "libavutil/common.h" #include "libavutil/internal.h" -#include "libavutil/thread.h" #include "avcodec.h" #include "profiles.h" #include "version.h" @@ -3111,26 +3109,6 @@ static const AVCodecDescriptor codec_descriptors[] = { }, }; -#if defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2 -static void check_validity(void) -{ -int i; - -for (i = 0; i < FF_ARRAY_ELEMS(codec_descriptors) - 1; i++) { -if (codec_descriptors[i].id >= codec_descriptors[i+1].id) { -av_log(NULL, AV_LOG_FATAL, "unsorted codec_id '%s' and '%s'.\n", - codec_descriptors[i].name, codec_descriptors[i+1].name); -av_assert0(0); -} -} -} - -static AVOnce check_validity_once = AV_ONCE_INIT; -#define CHECK_VALIDITY() ff_thread_once(&check_validity_once, check_validity); -#else -#define CHECK_VALIDITY() ((void)0) -#endif - static int descriptor_compare(const void *key, const void *member) { enum AVCodecID id = *(const enum AVCodecID *) key; @@ -3141,8 +3119,6 @@ static int descriptor_compare(const void *key, const void *member) const AVCodecDescriptor *avcodec_descriptor_get(enum AVCodecID id) { -CHECK_VALIDITY(); - return bsearch(&id, codec_descriptors, FF_ARRAY_ELEMS(codec_descriptors), sizeof(codec_descriptors[0]), descriptor_compare); } diff --git a/libavcodec/tests/codec_desc.c b/libavcodec/tests/codec_desc.c new file mode 100644 index 00..c9b3497343 --- /dev/null +++ b/libavcodec/tests/codec_desc.c @@ -0,0 +1,45 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavcodec/avcodec.h" + +int main(int argc, char **argv) +{ +const AVCodecDescriptor *old_desc = NULL, *desc; + +while (desc = avcodec_descriptor_next(old_desc)) { +if (old_desc && old_desc->id >= desc->id) { +av_log(NULL, AV_LOG_FATAL, "Unsorted codec_descriptors '%s' and '%s'.\n", old_desc->name, desc->name); +return 1; +} + +if (avcodec_descriptor_get(desc->id) != desc) { +av_log(NULL, AV_LOG_FATAL, "avcodec_descriptor_get() failed with '%s'.\n", desc->name); +return 1; +} + +if (avcodec_descriptor_get_by_name(desc->name) != desc) { +av_log(NULL, AV_LOG_FATAL, "avcodec_descriptor_get_by_name() failed with '%s'.\n", desc->name); +return 1; +} + +old_desc = desc; +} + +return 0; +} diff --git a/tests/fate/libavcodec.mak b/tests/fate/libavcodec.mak index a2d5d9fe33..d3b2dd874e 100644 --- a/tests/fate/libavcodec.mak +++ b/tests/fate/libavcodec.mak @@ -13,6 +13,11 @@ fate-celp_math: libavcodec/tests/celp_math$(EXESUF) fate-celp_math: CMD = run libavcodec/tests/celp_math fate-celp_math: CMP = null +FATE_LIBAVCODEC-yes += fate-codec_desc +fate-codec_desc: libavcodec/tests/codec_desc$(EXESUF) +fate-codec_desc: CMD = run libavcodec/tests/codec_desc +fate-codec_desc: CMP = null + FAT
Re: [FFmpeg-devel] [PATCH] mpeg2dec: fix decoding field pictures
> On Fri, Feb 09, 2018 at 02:03:24AM +0900, Nekopanda wrote: >> - Fix field selection for skipped macroblocks >> >> For B field pictures, the spec says, >> >> > The prediction shall be made from the field of the same parity as the > field being predicted. >> >> I did it. >> >> - Fix motion vector rounding for chroma components >> >> In 16x8 motion compensation, for lower 16x8 region, the input to > mpeg_motion() for motion_y was "motion_y + 16", which causes wrong > rounding. For 4:2:0, chroma scaling for y is dividing by two and rounding > toward > zero. When motion_y < 0 and motion_y + 16 > 0, the rounding direction of > "motion_y" and "motion_y + 16" is different and rounding > "motion_y + 16" would be incorrect. >> >> We should input "motion_y" as is to round correctly. I add > "is_16x8" flag to do that. > > please split this patch in 2. > I think these are 2 independant bugfixes. > > also please update the fate checksums so make fate does not break after > either patch I split into 2 patches and sent them. They also include new checksums. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [FFmpeg-cvslog] lavc: add new API for iterating codecs and codec parsers
On Sat, Feb 10, 2018 at 7:51 AM, Michael Niedermayer wrote: > On Fri, Feb 09, 2018 at 10:21:04PM +0700, Muhammad Faiz wrote: >> On Fri, Feb 9, 2018 at 6:53 PM, James Almer wrote: >> > On 2/9/2018 7:56 AM, Muhammad Faiz wrote: >> >> On Thu, Feb 8, 2018 at 7:04 AM, Michael Niedermayer >> >> wrote: >> >>> On Wed, Feb 07, 2018 at 01:52:33PM +0100, Nicolas George wrote: >> Josh de Kock (2018-02-06): >> > ffmpeg | branch: master | Josh de Kock | Fri Dec 22 >> > 22:17:00 2017 +| [7e8eba2d8755962d9dca5eade57bf8f591a73c0c] | >> > committer: Josh de Kock >> > >> > lavc: add new API for iterating codecs and codec parsers >> > >> > Based on an unfinished patch by atomnuker. >> >>> >> >>> This commit also breaks >> >>> >> >>> ./configure --enable-libsoxr && make -j12 fate-checkasm >> >>> make -j12 fate-checkasm >> >>> ... >> >>> LD tests/checkasm/checkasm >> >>> libswresample/libswresample.a(soxr_resample.o): In function >> >>> `get_out_samples': >> >>> ffmpeg/libswresample/soxr_resample.c:118: undefined reference to >> >>> `soxr_delay' >> >>> libswresample/libswresample.a(soxr_resample.o): In function `get_delay': >> >>> ffmpeg/libswresample/soxr_resample.c:100: undefined reference to >> >>> `soxr_delay' >> >>> libswresample/libswresample.a(soxr_resample.o): In function `flush': >> >>> ffmpeg/libswresample/soxr_resample.c:70: undefined reference to >> >>> `soxr_delay' >> >>> ffmpeg/libswresample/soxr_resample.c:72: undefined reference to >> >>> `soxr_process' >> >>> ffmpeg/libswresample/soxr_resample.c:77: undefined reference to >> >>> `soxr_process' >> >>> ffmpeg/libswresample/soxr_resample.c:78: undefined reference to >> >>> `soxr_delay' >> >>> libswresample/libswresample.a(soxr_resample.o): In function `process': >> >>> ffmpeg/libswresample/soxr_resample.c:88: undefined reference to >> >>> `soxr_set_num_channels' >> >>> ffmpeg/libswresample/soxr_resample.c:88: undefined reference to >> >>> `soxr_set_error' >> >>> ffmpeg/libswresample/soxr_resample.c:90: undefined reference to >> >>> `soxr_process' >> >>> libswresample/libswresample.a(soxr_resample.o): In function `destroy': >> >>> ffmpeg/libswresample/soxr_resample.c:65: undefined reference to >> >>> `soxr_delete' >> >>> libswresample/libswresample.a(soxr_resample.o): In function `create': >> >>> ffmpeg/libswresample/soxr_resample.c:46: undefined reference to >> >>> `soxr_io_spec' >> >>> ffmpeg/libswresample/soxr_resample.c:48: undefined reference to >> >>> `soxr_quality_spec' >> >>> ffmpeg/libswresample/soxr_resample.c:56: undefined reference to >> >>> `soxr_delete' >> >>> ffmpeg/libswresample/soxr_resample.c:57: undefined reference to >> >>> `soxr_create' >> >>> collect2: error: ld returned 1 exit status >> >>> make: *** [tests/checkasm/checkasm] Error 1 >> >> >> >> Fixed in 81d6501be77b273053a66eeced94d78e2021f1d1 >> >> >> >> Thank's. >> > >> > This is not a proper solution. swr is pulled by avcodec only if Opus >> > decoder is enabled. There's no reason to hardcode it for checkasm >> > otherwise. >> > The problem here is that the Makefile should pull all the dependencies >> > of its hardcoded dependencies. This is what FFLIBS and FFEXTRALIBS do in >> > common.mak to link the actual libraries. >> >> Probably, this is not a proper solution, but it is trivial enough. >> (I'm sorry that I pushed it without posting). >> So, please fix it with the proper solution. Probably, by adding >> swresample-extralibs to avcodec-extralibs when avcodec has dependency >> to swresample. I don't know how to do it. >> > >> > >> > That said, was this really a regression generated by this commit? It >> > looks unrelated. >> >> Actually, it was a bug even before this commit. Just, previously it >> was hidden because linker was smart enough to discard unneeded >> dependency. But now when the list is changed to array, the linker is >> unable to do it. > > iam not sure i understand correctly. But does this mean that > tools/target_dec_"codec"_fuzzer will now include everything and not just > the "codec" ? > If so this will possibly prevent FFmpeg from being tested in googles ossfuzz > framework. As their diskspace was already rather tight. > > i do see on my disk that the more recently build fuzzers have gottem MUCH > larger: > -rwxr-x--- 1 michael michael 17588987 Feb 3 18:53 > tools/target_dec_scpr_fuzzer* > -rwxr-x--- 1 michael michael 17476326 Feb 4 02:16 > tools/target_dec_paf_video_fuzzer* > -rwxr-x--- 1 michael michael 143210465 Feb 9 13:53 > tools/target_dec_h264_fuzzer* > -rwxr-x--- 1 michael michael 143210465 Feb 9 13:56 > tools/target_dec_vp3_fuzzer* > Does the attached patch fix the problem? Thank's. From 46d5a15dba7578d312aae59048ad608c9afdacbf Mon Sep 17 00:00:00 2001 From: Muhammad Faiz Date: Sat, 10 Feb 2018 17:08:04 +0700 Subject: [PATCH] tools/target_dec_fuzzer: don't use avcodec_register() Signed-off-by: Muhammad Faiz --- tools/target_dec_fuzzer.c | 3 ++- 1 file changed, 2 insertions(+),
Re: [FFmpeg-devel] [PATCH] fate/libavcodec: add codec_desc test
On Sat, 10 Feb 2018 16:37:00 +0700 Muhammad Faiz wrote: > Remove runtime check at codec_desc.c > > Signed-off-by: Muhammad Faiz > --- > libavcodec/Makefile | 1 + > libavcodec/codec_desc.c | 24 --- > libavcodec/tests/codec_desc.c | 45 > +++ > tests/fate/libavcodec.mak | 5 + > 4 files changed, 51 insertions(+), 24 deletions(-) > create mode 100644 libavcodec/tests/codec_desc.c > Seems like a pretty good idea. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] h264_idct: enable unmacro on newer NASM versions
Signed-off-by: Rostislav Pehlivanov --- libavcodec/x86/h264_idct.asm | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavcodec/x86/h264_idct.asm b/libavcodec/x86/h264_idct.asm index 8804638091..c54f9f1a68 100644 --- a/libavcodec/x86/h264_idct.asm +++ b/libavcodec/x86/h264_idct.asm @@ -1144,7 +1144,11 @@ IDCT_DC_DEQUANT 0 INIT_MMX sse2 IDCT_DC_DEQUANT 7 -; %unmacro STORE_DIFFx2 8 ; remove macro from x86util.asm but yasm doesn't have this yet +%ifdef __NASM_VER__ +%if __NASM_MAJOR__ >= 2 && __NASM_MINOR__ >= 4 +%unmacro STORE_DIFFx2 8 ; remove macro from x86util.asm but yasm doesn't have this yet +%endif +%endif %macro STORE_DIFFx2 8 ; add1, add2, reg1, reg2, zero, shift, source, stride movd %3, [%7] movd %4, [%7+%8] -- 2.16.1.101.gde0f0111ea ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] lavf/aptxdec: fix the limit on the APTX demuxer definition
Fixes breakage with --disable-muxers as it was originally limited to the muxer, and not the demuxer. --- libavformat/aptxdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/aptxdec.c b/libavformat/aptxdec.c index 467bc3fd5a..a262cd9ebe 100644 --- a/libavformat/aptxdec.c +++ b/libavformat/aptxdec.c @@ -87,7 +87,7 @@ static const AVOption aptx_options[] = { { NULL }, }; -#if CONFIG_APTX_MUXER +#if CONFIG_APTX_DEMUXER static const AVClass aptx_demuxer_class = { .class_name = "aptx demuxer", .item_name = av_default_item_name, -- 2.14.3 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCHv4] mpeg4video: Add support for MPEG-4 Simple Studio Profile.
$subj. Still depends on simple_idct template patch Fixes crashes in ER 0001-mpeg4video-Add-support-for-MPEG-4-Simple-Studio-Prof.patch Description: Binary data ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] MAINTAINERS: add myself for aptx.c
On Fri, Feb 09, 2018 at 10:27:39PM +0100, Aurelien Jacobs wrote: > --- > MAINTAINERS | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/MAINTAINERS b/MAINTAINERS > index ba7a7284eb..b691bd56ec 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -139,6 +139,7 @@ Codecs: >aacenc*, aaccoder.c Rostislav Pehlivanov >alacenc.c Jaikrishnan Menon >alsdec.c Thilo Borgmann, Umair Khan > + aptx.cAurelien Jacobs >ass* Aurelien Jacobs >asv* Michael Niedermayer >atrac3plus* Maxim Poliakovski Applied. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavf/aptxdec: fix the limit on the APTX demuxer definition
On 2/10/18, Jan Ekstroem wrote: > Fixes breakage with --disable-muxers as it was originally limited > to the muxer, and not the demuxer. > --- > libavformat/aptxdec.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavformat/aptxdec.c b/libavformat/aptxdec.c > index 467bc3fd5a..a262cd9ebe 100644 > --- a/libavformat/aptxdec.c > +++ b/libavformat/aptxdec.c > @@ -87,7 +87,7 @@ static const AVOption aptx_options[] = { > { NULL }, > }; > > -#if CONFIG_APTX_MUXER > +#if CONFIG_APTX_DEMUXER > static const AVClass aptx_demuxer_class = { > .class_name = "aptx demuxer", > .item_name = av_default_item_name, > -- > 2.14.3 > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > lgtm ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavf/aptxdec: fix the limit on the APTX demuxer definition
On Sat, Feb 10, 2018 at 6:18 PM, Paul B Mahol wrote: > > lgtm > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel Cheers, pushed. Jan ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavf/aptxdec: fix the limit on the APTX demuxer definition
On 2/10/2018 1:21 PM, Jan Ekström wrote: > On Sat, Feb 10, 2018 at 6:18 PM, Paul B Mahol wrote: >> >> lgtm >> ___ >> ffmpeg-devel mailing list >> ffmpeg-devel@ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > Cheers, pushed. > > Jan I know it's a simple fix so in this case it's fine, but keep in mind Aurelien Jacobs is the maintainer of aptx for future patches. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavf/aptxdec: fix the limit on the APTX demuxer definition
On Sat, Feb 10, 2018 at 6:27 PM, James Almer wrote: > > I know it's a simple fix so in this case it's fine, but keep in mind > Aurelien Jacobs is the maintainer of aptx for future patches. Yes, if this was less straightforward I would have waited for the maintainer. Jan ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/2] avformat/aviobuf: add ff_read_line_to_bprint and ff_read_line_to_bprint_overwrite functions
To be able to read lines longer than a static buffer size. Signed-off-by: Marton Balint --- libavformat/aviobuf.c | 46 ++ libavformat/internal.h | 26 ++ 2 files changed, 72 insertions(+) diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 86eb6579f4..12cd73745d 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -821,6 +821,52 @@ int ff_get_line(AVIOContext *s, char *buf, int maxlen) return i; } +int64_t ff_read_line_to_bprint(AVIOContext *s, AVBPrint *bp) +{ +int len, end; +int64_t read = 0; +char tmp[1024]; +char c; + +do { +len = 0; +do { +c = avio_r8(s); +end = (c == '\r' || c == '\n' || c == '\0'); +if (!end) +tmp[len++] = c; +} while (!end && len < sizeof(tmp)); +av_bprint_append_data(bp, tmp, len); +read += len; +} while (!end); + +if (c == '\r' && avio_r8(s) != '\n' && !avio_feof(s)) +avio_skip(s, -1); + +if (!c && s->error) +return s->error; + +if (!c && !read && avio_feof(s)) +return AVERROR_EOF; + +return read; +} + +int64_t ff_read_line_to_bprint_overwrite(AVIOContext *s, AVBPrint *bp) +{ +int64_t ret; + +av_bprint_clear(bp); +ret = ff_read_line_to_bprint(s, bp); +if (ret < 0) +return ret; + +if (!av_bprint_is_complete(bp)) +return AVERROR(ENOMEM); + +return bp->len; +} + int avio_get_str(AVIOContext *s, int maxlen, char *buf, int buflen) { int i; diff --git a/libavformat/internal.h b/libavformat/internal.h index 0d08576c29..2ac7e2e1a0 100644 --- a/libavformat/internal.h +++ b/libavformat/internal.h @@ -299,6 +299,32 @@ void ff_put_v(AVIOContext *bc, uint64_t val); */ int ff_get_line(AVIOContext *s, char *buf, int maxlen); +/** + * Read a whole line of text from AVIOContext to an AVBPrint buffer. Stop + * reading after reaching a \\r, a \\n, a \\r\\n, a \\0 or EOF. The line + * ending characters are NOT included in the buffer, but they are skipped on + * the input. + * + * @param s the read-only AVIOContext + * @param bp the AVBPrint buffer + * @return the length of the read line, not including the line endings, + * negative on error. + */ +int64_t ff_read_line_to_bprint(AVIOContext *s, AVBPrint *bp); + +/** + * Read a whole line of text from AVIOContext to an AVBPrint buffer overwriting + * its contents. Stop reading after reaching a \\r, a \\n, a \\r\\n, a \\0 or + * EOF. The line ending characters are NOT included in the buffer, but they + * are skipped on the input. + * + * @param s the read-only AVIOContext + * @param bp the AVBPrint buffer + * @return the length of the read line not including the line endings, + * negative on error, or if the buffer becomes truncated. + */ +int64_t ff_read_line_to_bprint_overwrite(AVIOContext *s, AVBPrint *bp); + #define SPACE_CHARS " \t\r\n" /** -- 2.13.6 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/2] avformat/concatdec: add support for very long line sizes
Fixes ticket #6761. Signed-off-by: Marton Balint --- libavformat/concatdec.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c index 178fac86cb..3e41a62a36 100644 --- a/libavformat/concatdec.c +++ b/libavformat/concatdec.c @@ -24,6 +24,7 @@ #include "libavutil/opt.h" #include "libavutil/parseutils.h" #include "libavutil/timestamp.h" +#include "libavutil/bprint.h" #include "avformat.h" #include "internal.h" #include "url.h" @@ -386,18 +387,18 @@ static int concat_read_close(AVFormatContext *avf) static int concat_read_header(AVFormatContext *avf) { ConcatContext *cat = avf->priv_data; -uint8_t buf[4096]; +AVBPrint bp; uint8_t *cursor, *keyword; -int ret, line = 0, i; +int line = 0, i; unsigned nb_files_alloc = 0; ConcatFile *file = NULL; -int64_t time = 0; +int64_t ret, time = 0; -while (1) { -if ((ret = ff_get_line(avf->pb, buf, sizeof(buf))) <= 0) -break; +av_bprint_init(&bp, 0, AV_BPRINT_SIZE_UNLIMITED); + +while ((ret = ff_read_line_to_bprint_overwrite(avf->pb, &bp)) >= 0) { line++; -cursor = buf; +cursor = bp.str; keyword = get_keyword(&cursor); if (!*keyword || *keyword == '#') continue; @@ -473,7 +474,7 @@ static int concat_read_header(AVFormatContext *avf) FAIL(AVERROR_INVALIDDATA); } } -if (ret < 0) +if (ret != AVERROR_EOF && ret < 0) goto fail; if (!cat->nb_files) FAIL(AVERROR_INVALIDDATA); @@ -499,9 +500,11 @@ static int concat_read_header(AVFormatContext *avf) MATCH_ONE_TO_ONE; if ((ret = open_file(avf, 0)) < 0) goto fail; +av_bprint_finalize(&bp, NULL); return 0; fail: +av_bprint_finalize(&bp, NULL); concat_read_close(avf); return ret; } -- 2.13.6 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] rawenc: use av_get_padded_bits_per_pixel() instead of non-padded bps
Bitrate was calculated incorrectly. Signed-off-by: Rostislav Pehlivanov --- libavcodec/rawenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/rawenc.c b/libavcodec/rawenc.c index d181b74570..cd476d4bb1 100644 --- a/libavcodec/rawenc.c +++ b/libavcodec/rawenc.c @@ -41,7 +41,7 @@ FF_DISABLE_DEPRECATION_WARNINGS avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I; FF_ENABLE_DEPRECATION_WARNINGS #endif -avctx->bits_per_coded_sample = av_get_bits_per_pixel(desc); +avctx->bits_per_coded_sample = av_get_padded_bits_per_pixel(desc); if(!avctx->codec_tag) avctx->codec_tag = avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt); avctx->bit_rate = ff_guess_coded_bitrate(avctx); -- 2.16.1.101.gde0f0111ea ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avformat/mpeg12enc: add support for specifying video_format in the sequence_display_extension
In a recent commit the default was changed from 0 (component) to 5 (unspecified), however some standards require using 0. With this option, the user will be able to do so. Signed-off-by: Marton Balint --- doc/encoders.texi | 5 + libavcodec/mpeg12enc.c | 12 ++-- libavcodec/mpegvideo.h | 7 +++ libavcodec/version.h | 2 +- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/doc/encoders.texi b/doc/encoders.texi index c5dfc646d9..f25d47e272 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -2359,6 +2359,11 @@ Never write it. @itemx always Always write it. @end table +@item video_format @var{integer} +Specifies the video_format written into the sequence display extension +indicating the source of the video pictures. The default is @samp{unspecified}, +can be @samp{component}, @samp{pal}, @samp{ntsc}, @samp{secam} or @samp{mac}. +For maximum compatibility, use @samp{component}. @end table @section png diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index 0084f544f2..d0b458e34b 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -348,12 +348,13 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s) height != s->height || s->avctx->color_primaries != AVCOL_PRI_UNSPECIFIED || s->avctx->color_trc != AVCOL_TRC_UNSPECIFIED || -s->avctx->colorspace != AVCOL_SPC_UNSPECIFIED); +s->avctx->colorspace != AVCOL_SPC_UNSPECIFIED || +s->video_format != VIDEO_FORMAT_UNSPECIFIED); if (s->seq_disp_ext == 1 || (s->seq_disp_ext == -1 && use_seq_disp_ext)) { put_header(s, EXT_START_CODE); put_bits(&s->pb, 4, 2); // sequence display extension -put_bits(&s->pb, 3, 5); // video_format: 5 is unspecified +put_bits(&s->pb, 3, s->video_format); // video_format put_bits(&s->pb, 1, 1); // colour_description put_bits(&s->pb, 8, s->avctx->color_primaries); // colour_primaries put_bits(&s->pb, 8, s->avctx->color_trc); // transfer_characteristics @@ -1125,6 +1126,13 @@ static const AVOption mpeg2_options[] = { { "auto", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = -1}, 0, 0, VE, "seq_disp_ext" }, { "never", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, 0, 0, VE, "seq_disp_ext" }, { "always", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 1 }, 0, 0, VE, "seq_disp_ext" }, +{ "video_format", "Video_format in the sequence_display_extension indicating the source of the video.", OFFSET(video_format), AV_OPT_TYPE_INT, { .i64 = VIDEO_FORMAT_UNSPECIFIED }, 0, 7, VE, "video_format" }, +{ "component",NULL, 0, AV_OPT_TYPE_CONST, {.i64 = VIDEO_FORMAT_COMPONENT }, 0, 0, VE, "video_format" }, +{ "pal", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = VIDEO_FORMAT_PAL}, 0, 0, VE, "video_format" }, +{ "ntsc", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = VIDEO_FORMAT_NTSC }, 0, 0, VE, "video_format" }, +{ "secam",NULL, 0, AV_OPT_TYPE_CONST, {.i64 = VIDEO_FORMAT_SECAM }, 0, 0, VE, "video_format" }, +{ "mac", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = VIDEO_FORMAT_MAC}, 0, 0, VE, "video_format" }, +{ "unspecified", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = VIDEO_FORMAT_UNSPECIFIED}, 0, 0, VE, "video_format" }, FF_MPV_COMMON_OPTS { NULL }, }; diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index c5e3359458..e800e4a3b8 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -464,6 +464,13 @@ typedef struct MpegEncContext { int intra_vlc_format; int alternate_scan; int seq_disp_ext; +int video_format; +#define VIDEO_FORMAT_COMPONENT 0 +#define VIDEO_FORMAT_PAL 1 +#define VIDEO_FORMAT_NTSC2 +#define VIDEO_FORMAT_SECAM 3 +#define VIDEO_FORMAT_MAC 4 +#define VIDEO_FORMAT_UNSPECIFIED 5 int repeat_first_field; int chroma_420_type; int chroma_format; diff --git a/libavcodec/version.h b/libavcodec/version.h index e36cea30b5..e5eefd789c 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #define LIBAVCODEC_VERSION_MAJOR 58 #define LIBAVCODEC_VERSION_MINOR 10 -#define LIBAVCODEC_VERSION_MICRO 100 +#define LIBAVCODEC_VERSION_MICRO 101 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ -- 2.13.6 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCHv4] mpeg4video: Add support for MPEG-4 Simple Studio Profile.
On Sat, Feb 10, 2018 at 03:36:21PM +, Kieran Kunhya wrote: > $subj. Still depends on simple_idct template patch > > Fixes crashes in ER [...] > diff --git a/libavcodec/mpeg4video.h b/libavcodec/mpeg4video.h > index 0ba502d50b..3c9ec4ac42 100644 > --- a/libavcodec/mpeg4video.h > +++ b/libavcodec/mpeg4video.h > @@ -61,6 +61,10 @@ > #define GOP_STARTCODE0x1B3 > #define VISUAL_OBJ_STARTCODE 0x1B5 > #define VOP_STARTCODE0x1B6 > +#define SLICE_STARTCODE 0x1B7 > +#define EXT_STARTCODE0x1B8 > + > +#define QUANT_MATRIX_EXT_ID 0x3 > > /* smaller packets likely don't contain a real frame */ > #define MAX_NVOP_SIZE 19 > @@ -108,8 +112,16 @@ typedef struct Mpeg4DecContext { > int cplx_estimation_trash_i; > int cplx_estimation_trash_p; > int cplx_estimation_trash_b; > + > +VLC studio_intra_tab[12]; > +VLC studio_luma_dc; > +VLC studio_chroma_dc; > + > +int rgb; > } Mpeg4DecContext; > > +static const uint8_t mpeg4_block_count[4] = {0, 6, 8, 12}; > + > /* dc encoding for MPEG-4 */ > extern const uint8_t ff_mpeg4_DCtab_lum[13][2]; > extern const uint8_t ff_mpeg4_DCtab_chrom[13][2]; > @@ -137,6 +149,10 @@ extern const uint16_t ff_mpeg4_resync_prefix[8]; > > extern const uint8_t ff_mpeg4_dc_threshold[8]; > > +extern const uint16_t ff_mpeg4_studio_dc_luma[19][2]; > +extern const uint16_t ff_mpeg4_studio_dc_chroma[19][2]; > +extern const uint16_t ff_mpeg4_studio_intra[12][22][2]; > + > void ff_mpeg4_encode_mb(MpegEncContext *s, > int16_t block[6][64], > int motion_x, int motion_y); > @@ -155,6 +171,7 @@ void ff_clean_mpeg4_qscales(MpegEncContext *s); > int ff_mpeg4_decode_partitions(Mpeg4DecContext *ctx); > int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s); > int ff_mpeg4_decode_video_packet_header(Mpeg4DecContext *ctx); > +int ff_mpeg4_decode_studio_slice_header(Mpeg4DecContext *ctx); > void ff_mpeg4_init_direct_mv(MpegEncContext *s); > void ff_mpeg4videodec_static_init(void); > int ff_mpeg4_workaround_bugs(AVCodecContext *avctx); > diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c > index 756753e2fc..d5449ce43d 100644 > --- a/libavcodec/mpeg4videodec.c > +++ b/libavcodec/mpeg4videodec.c > @@ -44,6 +44,7 @@ > #define SPRITE_TRAJ_VLC_BITS 6 > #define DC_VLC_BITS 9 > #define MB_TYPE_B_VLC_BITS 4 > +#define STUDIO_INTRA_BITS 9 > > static VLC dc_lum, dc_chrom; > static VLC sprite_trajectory; > @@ -528,6 +529,64 @@ int ff_mpeg4_decode_video_packet_header(Mpeg4DecContext > *ctx) > return 0; > } > > +static inline int get_qscale(MpegEncContext *s) > +{ > +int qscale = get_bits(&s->gb, 5); > +if (s->q_scale_type) > +return ff_mpeg2_non_linear_qscale[qscale]; > +else > +return qscale << 1; > +} duplicate of libavcodec/mpeg12dec.c-static inline int get_qscale(MpegEncContext *s) libavcodec/mpeg12dec.c-{ libavcodec/mpeg12dec.c-int qscale = get_bits(&s->gb, 5); libavcodec/mpeg12dec.c-if (s->q_scale_type) libavcodec/mpeg12dec.c:return ff_mpeg2_non_linear_qscale[qscale]; libavcodec/mpeg12dec.c-else libavcodec/mpeg12dec.c-return qscale << 1; libavcodec/mpeg12dec.c-} > + > +static void reset_studio_dc_predictors(MpegEncContext *s) > +{ > +/* Reset DC Predictors */ > +s->studio_dc_val[0] = > +s->studio_dc_val[1] = > +s->studio_dc_val[2] = 1 << (s->avctx->bits_per_raw_sample + > s->dct_precision + s->intra_dc_precision - 1); > +} > + > +/** > + * Decode the next video packet. > + * @return <0 if something went wrong > + */ > +int ff_mpeg4_decode_studio_slice_header(Mpeg4DecContext *ctx) > +{ > +MpegEncContext *s = &ctx->m; > +GetBitContext *gb = &s->gb; > +unsigned vlc_len; > +uint16_t mb_num; > + > +if (get_bits_left(gb) >= 32 && get_bits_long(gb, 32) == > SLICE_START_CODE) { > +vlc_len = av_log2(((s->width + 15) / 16) * ((s->height + 15) / 16)) > + 1; can possibly be simplified with mb_width * mb_height > +mb_num = get_bits(gb, vlc_len); > + > +if (mb_num >= s->mb_num) > +return AVERROR_INVALIDDATA; > + > +s->mb_x = mb_num % s->mb_width; > +s->mb_y = mb_num / s->mb_width; > + > +if (ctx->shape != BIN_ONLY_SHAPE) > +s->qscale = get_qscale(s); > + > +if (get_bits1(gb)) { /* slice_extension_flag */ > +skip_bits1(gb); /* intra_slice */ > +skip_bits1(gb); /* slice_VOP_id_enable */ > +skip_bits(gb, 6); /* slice_VOP_id */ > +while (get_bits1(gb)) /* extra_bit_slice */ > +skip_bits(gb, 8); /* extra_information_slice */ > +} > + > +reset_studio_dc_predictors(s); > +} > +else { > +return AVERROR_INVALIDDATA; > +} > + > +return 0; > +} > + > /** > * Get the average motion vector for a GMC MB. > * @param n either 0 for the x component or 1 for y > @@ -1721,6 +1780,192 @@ end
Re: [FFmpeg-devel] [PATCHv4] mpeg4video: Add support for MPEG-4 Simple Studio Profile.
2018-02-10 16:36 GMT+01:00 Kieran Kunhya : > $subj. Still depends on simple_idct template patch > +FF_ALLOCZ_OR_GOTO(s->avctx, s->block32, 64 * 12 * sizeof(int32_t), fail) I believe this should be sizeof(variable). > +} > +else { Since this is still unusual in FFmpeg, I suggest to merge the lines. Thank you, Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/mpeg12enc: add support for specifying video_format in the sequence_display_extension
On Sat, Feb 10, 2018 at 07:45:36PM +0100, Marton Balint wrote: > In a recent commit the default was changed from 0 (component) to 5 > (unspecified), however some standards require using 0. With this option, the > user will be able to do so. > > Signed-off-by: Marton Balint > --- > doc/encoders.texi | 5 + > libavcodec/mpeg12enc.c | 12 ++-- > libavcodec/mpegvideo.h | 7 +++ > libavcodec/version.h | 2 +- > 4 files changed, 23 insertions(+), 3 deletions(-) it would be better to pass this on from the input but as theres no support for that, the patch LGTM thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Everything should be made as simple as possible, but not simpler. -- Albert Einstein signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/mpeg12enc: add support for specifying video_format in the sequence_display_extension
On Sat, Feb 10, 2018 at 07:45:36PM +0100, Marton Balint wrote: > In a recent commit the default was changed from 0 (component) to 5 > (unspecified), however some standards require using 0. With this option, the > user will be able to do so. > > Signed-off-by: Marton Balint > --- > doc/encoders.texi | 5 + > libavcodec/mpeg12enc.c | 12 ++-- > libavcodec/mpegvideo.h | 7 +++ > libavcodec/version.h | 2 +- just realized this mismatches the prefix of the commit message [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Many things microsoft did are stupid, but not doing something just because microsoft did it is even more stupid. If everything ms did were stupid they would be bankrupt already. signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]lavf/rtpdec: Constify several pointers
On Sat, Feb 10, 2018 at 8:57 AM, Carl Eugen Hoyos wrote: > Hi! > > Attached patch fixes two warnings. > libavformat/rtpdec.c: In function ‘ff_rtp_handler_find_by_name’: > libavformat/rtpdec.c:155:20: warning: return discards ‘const’ > qualifier from pointer target type [-Wdiscarded-qualifiers] > return handler; > ^~~ > libavformat/rtpdec.c: In function ‘ff_rtp_handler_find_by_id’: > libavformat/rtpdec.c:168:20: warning: return discards ‘const’ > qualifier from pointer target type [-Wdiscarded-qualifiers] > return handler; > ^~~ > > Please comment, Carl Eugen > > From b0383afe16c62fcb0fbc7ea49168edd2f26ac0aa Mon Sep 17 00:00:00 2001 > From: Carl Eugen Hoyos > Date: Sat, 10 Feb 2018 02:54:42 +0100 > Subject: [PATCH] lavf/rtpdec: Constify several pointers. > > Fixes two warnings: > libavformat/rtpdec.c:155:20: warning: return discards 'const' qualifier from > pointer target type [-Wdiscarded-qualifiers] > libavformat/rtpdec.c:168:20: warning: return discards 'const' qualifier from > pointer target type [-Wdiscarded-qualifiers] > --- > libavformat/rdt.c|2 +- > libavformat/rdt.h|2 +- > libavformat/rtpdec.c |6 +++--- > libavformat/rtpdec.h |6 +++--- > libavformat/rtsp.c |8 > libavformat/rtsp.h |2 +- > 6 files changed, 13 insertions(+), 13 deletions(-) LGTM. Probably, the variables should also be constified. Thank's. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [FFmpeg-cvslog] lavc: add new API for iterating codecs and codec parsers
On Sat, Feb 10, 2018 at 05:13:10PM +0700, Muhammad Faiz wrote: > On Sat, Feb 10, 2018 at 7:51 AM, Michael Niedermayer > wrote: > > On Fri, Feb 09, 2018 at 10:21:04PM +0700, Muhammad Faiz wrote: > >> On Fri, Feb 9, 2018 at 6:53 PM, James Almer wrote: > >> > On 2/9/2018 7:56 AM, Muhammad Faiz wrote: > >> >> On Thu, Feb 8, 2018 at 7:04 AM, Michael Niedermayer > >> >> wrote: > >> >>> On Wed, Feb 07, 2018 at 01:52:33PM +0100, Nicolas George wrote: > >> Josh de Kock (2018-02-06): > >> > ffmpeg | branch: master | Josh de Kock | Fri Dec > >> > 22 22:17:00 2017 +| [7e8eba2d8755962d9dca5eade57bf8f591a73c0c] | > >> > committer: Josh de Kock > >> > > >> > lavc: add new API for iterating codecs and codec parsers > >> > > >> > Based on an unfinished patch by atomnuker. > >> >>> > >> >>> This commit also breaks > >> >>> > >> >>> ./configure --enable-libsoxr && make -j12 fate-checkasm > >> >>> make -j12 fate-checkasm > >> >>> ... > >> >>> LD tests/checkasm/checkasm > >> >>> libswresample/libswresample.a(soxr_resample.o): In function > >> >>> `get_out_samples': > >> >>> ffmpeg/libswresample/soxr_resample.c:118: undefined reference to > >> >>> `soxr_delay' > >> >>> libswresample/libswresample.a(soxr_resample.o): In function > >> >>> `get_delay': > >> >>> ffmpeg/libswresample/soxr_resample.c:100: undefined reference to > >> >>> `soxr_delay' > >> >>> libswresample/libswresample.a(soxr_resample.o): In function `flush': > >> >>> ffmpeg/libswresample/soxr_resample.c:70: undefined reference to > >> >>> `soxr_delay' > >> >>> ffmpeg/libswresample/soxr_resample.c:72: undefined reference to > >> >>> `soxr_process' > >> >>> ffmpeg/libswresample/soxr_resample.c:77: undefined reference to > >> >>> `soxr_process' > >> >>> ffmpeg/libswresample/soxr_resample.c:78: undefined reference to > >> >>> `soxr_delay' > >> >>> libswresample/libswresample.a(soxr_resample.o): In function `process': > >> >>> ffmpeg/libswresample/soxr_resample.c:88: undefined reference to > >> >>> `soxr_set_num_channels' > >> >>> ffmpeg/libswresample/soxr_resample.c:88: undefined reference to > >> >>> `soxr_set_error' > >> >>> ffmpeg/libswresample/soxr_resample.c:90: undefined reference to > >> >>> `soxr_process' > >> >>> libswresample/libswresample.a(soxr_resample.o): In function `destroy': > >> >>> ffmpeg/libswresample/soxr_resample.c:65: undefined reference to > >> >>> `soxr_delete' > >> >>> libswresample/libswresample.a(soxr_resample.o): In function `create': > >> >>> ffmpeg/libswresample/soxr_resample.c:46: undefined reference to > >> >>> `soxr_io_spec' > >> >>> ffmpeg/libswresample/soxr_resample.c:48: undefined reference to > >> >>> `soxr_quality_spec' > >> >>> ffmpeg/libswresample/soxr_resample.c:56: undefined reference to > >> >>> `soxr_delete' > >> >>> ffmpeg/libswresample/soxr_resample.c:57: undefined reference to > >> >>> `soxr_create' > >> >>> collect2: error: ld returned 1 exit status > >> >>> make: *** [tests/checkasm/checkasm] Error 1 > >> >> > >> >> Fixed in 81d6501be77b273053a66eeced94d78e2021f1d1 > >> >> > >> >> Thank's. > >> > > >> > This is not a proper solution. swr is pulled by avcodec only if Opus > >> > decoder is enabled. There's no reason to hardcode it for checkasm > >> > otherwise. > >> > The problem here is that the Makefile should pull all the dependencies > >> > of its hardcoded dependencies. This is what FFLIBS and FFEXTRALIBS do in > >> > common.mak to link the actual libraries. > >> > >> Probably, this is not a proper solution, but it is trivial enough. > >> (I'm sorry that I pushed it without posting). > >> So, please fix it with the proper solution. Probably, by adding > >> swresample-extralibs to avcodec-extralibs when avcodec has dependency > >> to swresample. I don't know how to do it. > >> > > > >> > > >> > That said, was this really a regression generated by this commit? It > >> > looks unrelated. > >> > >> Actually, it was a bug even before this commit. Just, previously it > >> was hidden because linker was smart enough to discard unneeded > >> dependency. But now when the list is changed to array, the linker is > >> unable to do it. > > > > iam not sure i understand correctly. But does this mean that > > tools/target_dec_"codec"_fuzzer will now include everything and not just > > the "codec" ? > > If so this will possibly prevent FFmpeg from being tested in googles ossfuzz > > framework. As their diskspace was already rather tight. > > > > i do see on my disk that the more recently build fuzzers have gottem MUCH > > larger: > > -rwxr-x--- 1 michael michael 17588987 Feb 3 18:53 > > tools/target_dec_scpr_fuzzer* > > -rwxr-x--- 1 michael michael 17476326 Feb 4 02:16 > > tools/target_dec_paf_video_fuzzer* > > -rwxr-x--- 1 michael michael 143210465 Feb 9 13:53 > > tools/target_dec_h264_fuzzer* > > -rwxr-x--- 1 michael michael 143210465 Feb 9 13:56 > > tools/target_dec_vp3_fuzzer* > > > > Does the attached patch fix the problem? in my local build this make
Re: [FFmpeg-devel] [PATCH] fate/libavcodec: add codec_desc test
On Sat, Feb 10, 2018 at 04:37:00PM +0700, Muhammad Faiz wrote: > Remove runtime check at codec_desc.c > > Signed-off-by: Muhammad Faiz > --- > libavcodec/Makefile | 1 + > libavcodec/codec_desc.c | 24 --- > libavcodec/tests/codec_desc.c | 45 > +++ > tests/fate/libavcodec.mak | 5 + > 4 files changed, 51 insertions(+), 24 deletions(-) > create mode 100644 libavcodec/tests/codec_desc.c LGTM [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Let us carefully observe those good qualities wherein our enemies excel us and endeavor to excel them, by avoiding what is faulty, and imitating what is excellent in them. -- Plutarch signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [FFmpeg-cvslog] lavc: add new API for iterating codecs and codec parsers
On Sun, Feb 11, 2018 at 6:37 AM, Michael Niedermayer wrote: > On Sat, Feb 10, 2018 at 05:13:10PM +0700, Muhammad Faiz wrote: >> On Sat, Feb 10, 2018 at 7:51 AM, Michael Niedermayer >> wrote: >> > On Fri, Feb 09, 2018 at 10:21:04PM +0700, Muhammad Faiz wrote: >> >> On Fri, Feb 9, 2018 at 6:53 PM, James Almer wrote: >> >> > On 2/9/2018 7:56 AM, Muhammad Faiz wrote: >> >> >> On Thu, Feb 8, 2018 at 7:04 AM, Michael Niedermayer >> >> >> wrote: >> >> >>> On Wed, Feb 07, 2018 at 01:52:33PM +0100, Nicolas George wrote: >> >> Josh de Kock (2018-02-06): >> >> > ffmpeg | branch: master | Josh de Kock | Fri Dec >> >> > 22 22:17:00 2017 +| [7e8eba2d8755962d9dca5eade57bf8f591a73c0c] >> >> > | committer: Josh de Kock >> >> > >> >> > lavc: add new API for iterating codecs and codec parsers >> >> > >> >> > Based on an unfinished patch by atomnuker. >> >> >>> >> >> >>> This commit also breaks >> >> >>> >> >> >>> ./configure --enable-libsoxr && make -j12 fate-checkasm >> >> >>> make -j12 fate-checkasm >> >> >>> ... >> >> >>> LD tests/checkasm/checkasm >> >> >>> libswresample/libswresample.a(soxr_resample.o): In function >> >> >>> `get_out_samples': >> >> >>> ffmpeg/libswresample/soxr_resample.c:118: undefined reference to >> >> >>> `soxr_delay' >> >> >>> libswresample/libswresample.a(soxr_resample.o): In function >> >> >>> `get_delay': >> >> >>> ffmpeg/libswresample/soxr_resample.c:100: undefined reference to >> >> >>> `soxr_delay' >> >> >>> libswresample/libswresample.a(soxr_resample.o): In function `flush': >> >> >>> ffmpeg/libswresample/soxr_resample.c:70: undefined reference to >> >> >>> `soxr_delay' >> >> >>> ffmpeg/libswresample/soxr_resample.c:72: undefined reference to >> >> >>> `soxr_process' >> >> >>> ffmpeg/libswresample/soxr_resample.c:77: undefined reference to >> >> >>> `soxr_process' >> >> >>> ffmpeg/libswresample/soxr_resample.c:78: undefined reference to >> >> >>> `soxr_delay' >> >> >>> libswresample/libswresample.a(soxr_resample.o): In function `process': >> >> >>> ffmpeg/libswresample/soxr_resample.c:88: undefined reference to >> >> >>> `soxr_set_num_channels' >> >> >>> ffmpeg/libswresample/soxr_resample.c:88: undefined reference to >> >> >>> `soxr_set_error' >> >> >>> ffmpeg/libswresample/soxr_resample.c:90: undefined reference to >> >> >>> `soxr_process' >> >> >>> libswresample/libswresample.a(soxr_resample.o): In function `destroy': >> >> >>> ffmpeg/libswresample/soxr_resample.c:65: undefined reference to >> >> >>> `soxr_delete' >> >> >>> libswresample/libswresample.a(soxr_resample.o): In function `create': >> >> >>> ffmpeg/libswresample/soxr_resample.c:46: undefined reference to >> >> >>> `soxr_io_spec' >> >> >>> ffmpeg/libswresample/soxr_resample.c:48: undefined reference to >> >> >>> `soxr_quality_spec' >> >> >>> ffmpeg/libswresample/soxr_resample.c:56: undefined reference to >> >> >>> `soxr_delete' >> >> >>> ffmpeg/libswresample/soxr_resample.c:57: undefined reference to >> >> >>> `soxr_create' >> >> >>> collect2: error: ld returned 1 exit status >> >> >>> make: *** [tests/checkasm/checkasm] Error 1 >> >> >> >> >> >> Fixed in 81d6501be77b273053a66eeced94d78e2021f1d1 >> >> >> >> >> >> Thank's. >> >> > >> >> > This is not a proper solution. swr is pulled by avcodec only if Opus >> >> > decoder is enabled. There's no reason to hardcode it for checkasm >> >> > otherwise. >> >> > The problem here is that the Makefile should pull all the dependencies >> >> > of its hardcoded dependencies. This is what FFLIBS and FFEXTRALIBS do in >> >> > common.mak to link the actual libraries. >> >> >> >> Probably, this is not a proper solution, but it is trivial enough. >> >> (I'm sorry that I pushed it without posting). >> >> So, please fix it with the proper solution. Probably, by adding >> >> swresample-extralibs to avcodec-extralibs when avcodec has dependency >> >> to swresample. I don't know how to do it. >> >> >> > >> >> > >> >> > That said, was this really a regression generated by this commit? It >> >> > looks unrelated. >> >> >> >> Actually, it was a bug even before this commit. Just, previously it >> >> was hidden because linker was smart enough to discard unneeded >> >> dependency. But now when the list is changed to array, the linker is >> >> unable to do it. >> > >> > iam not sure i understand correctly. But does this mean that >> > tools/target_dec_"codec"_fuzzer will now include everything and not just >> > the "codec" ? >> > If so this will possibly prevent FFmpeg from being tested in googles >> > ossfuzz >> > framework. As their diskspace was already rather tight. >> > >> > i do see on my disk that the more recently build fuzzers have gottem MUCH >> > larger: >> > -rwxr-x--- 1 michael michael 17588987 Feb 3 18:53 >> > tools/target_dec_scpr_fuzzer* >> > -rwxr-x--- 1 michael michael 17476326 Feb 4 02:16 >> > tools/target_dec_paf_video_fuzzer* >> > -rwxr-x--- 1 michael michael 143210465 Feb 9 13:53 >> > tools/target_dec_h264_fuzz
Re: [FFmpeg-devel] [PATCH] mpeg2dec: Fix field selection for skipped macroblocks
On Sat, Feb 10, 2018 at 06:36:32PM +0900, Nekopanda wrote: > For B field pictures, the spec says, > > > The prediction shall be made from the field of the same parity as the field > > being predicted. > > I did it. > --- > libavcodec/mpeg12dec.c | 2 + > tests/ref/fate/mpeg2-ticket186 | 328 > - > 2 files changed, 166 insertions(+), 164 deletions(-) applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Let us carefully observe those good qualities wherein our enemies excel us and endeavor to excel them, by avoiding what is faulty, and imitating what is excellent in them. -- Plutarch signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] mpeg2dec: Fix motion vector rounding for chroma components
On Sat, Feb 10, 2018 at 06:36:33PM +0900, Nekopanda wrote: > In 16x8 motion compensation, for lower 16x8 region, the input to > mpeg_motion() for motion_y was "motion_y + 16", which causes wrong rounding. > For 4:2:0, chroma scaling for y is dividing by two and rounding toward zero. > When motion_y < 0 and motion_y + 16 > 0, the rounding direction of "motion_y" > and "motion_y + 16" is different and rounding "motion_y + 16" would be > incorrect. > > We should input "motion_y" as is to round correctly. I add "is_16x8" flag to > do that. > --- > libavcodec/mpegvideo_motion.c| 30 - > tests/ref/fate/filter-w3fdif-complex | 60 +- > tests/ref/fate/filter-w3fdif-simple | 60 +- > tests/ref/fate/filter-yadif-mode0| 60 +- > tests/ref/fate/filter-yadif-mode1| 118 > +-- > tests/ref/fate/filter-yadif10| 60 +- > tests/ref/fate/filter-yadif16| 60 +- > tests/ref/fate/mpeg2-field-enc | 60 +- > tests/ref/fate/mpeg2-ticket6677 | 12 ++-- > 9 files changed, 261 insertions(+), 259 deletions(-) This patch changes 2 fate tests: make: *** [fate-filter-mcdeint-fast] Error 1 make: *** [fate-filter-mcdeint-medium] Error 1 [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If you fake or manipulate statistics in a paper in physics you will never get a job again. If you fake or manipulate statistics in a paper in medicin you will get a job for life at the pharma industry. signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/scpr: Fix reading a pixel before the first
On Sat, Feb 03, 2018 at 07:07:19PM +0100, Michael Niedermayer wrote: > Fixes: 5540/clusterfuzz-testcase-minimized-6122458273808384 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavcodec/scpr.c | 4 > 1 file changed, 4 insertions(+) applied [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB "Nothing to hide" only works if the folks in power share the values of you and everyone you know entirely and always will -- Tom Scott signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/pafvideo: Check allocated frame size
On Sun, Feb 04, 2018 at 03:56:19AM +0100, Michael Niedermayer wrote: > Fixes: OOM > Fixes: 5549/clusterfuzz-testcase-minimized-5390553567985664 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavcodec/pafvideo.c | 4 > 1 file changed, 4 insertions(+) applied [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Old school: Use the lowest level language in which you can solve the problem conveniently. New school: Use the highest level language in which the latest supercomputer can solve the problem without the user falling asleep waiting. signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] avcodec/utvideodec: Add several out of array read related checks
On Fri, Feb 09, 2018 at 10:24:59PM +0100, Michael Niedermayer wrote: > Fixes: OV_decode_plane.avi > > Found-by: GwanYeong Kim > Signed-off-by: Michael Niedermayer > --- > libavcodec/utvideodec.c | 17 - > 1 file changed, 12 insertions(+), 5 deletions(-) applied [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws. -- Plato signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/vp3: Check eob_run
On Fri, Feb 09, 2018 at 01:56:39PM +0100, Michael Niedermayer wrote: > Fixes: out of array access > Fixes: 5919/clusterfuzz-testcase-minimized-5859311382167552 > Fixes: special case for theora (untested due to lack of sample) > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavcodec/vp3.c | 3 +++ > 1 file changed, 3 insertions(+) applied [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Breaking DRM is a little like attempting to break through a door even though the window is wide open and the only thing in the house is a bunch of things you dont want and which you would get tomorrow for free anyway signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] How to pass metadata between filters
Dear ffmpeg-devel, I have a general question about the capabilities of avfilter. Is it possible to send meta-data between avfilters? Specifically, I want to create a filter to take a single input image, and produce a single output image along with metadata which encodes information about the image. Sincerely, Mujib This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avcodec/vp3: Error out on invalid num_coeffs in unpack_vlcs()
This fixes a hypothetical integer overflow Signed-off-by: Michael Niedermayer --- libavcodec/vp3.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 33be345c14..1d83753314 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -951,9 +951,11 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb, Vp3Fragment *all_fragments = s->all_fragments; VLC_TYPE(*vlc_table)[2] = table->table; -if (num_coeffs < 0) +if (num_coeffs < 0) { av_log(s->avctx, AV_LOG_ERROR, "Invalid number of coefficients at level %d\n", coeff_index); +return AVERROR_INVALIDDATA; +} if (eob_run > num_coeffs) { coeff_i = -- 2.16.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel