[FFmpeg-devel] [PATCH] avfilter/framepool: fix alignment requirements for audio and video filters

James Almer jamrial at gmail.com
Tue Mar 1 15:43:11 EET 2022


On 3/1/2022 4:12 AM, Xiang, Haihao wrote:
> Hi,
> 
> fate-vsynth1-mpeg2-422 is broken after this patch (commit 17a59a6).
> 
> --- ./tests/ref/vsynth/vsynth1-mpeg2-422        2021-11-22 12:59:25.013517219 +0800
> +++ tests/data/fate/vsynth1-mpeg2-422   2022-03-01 13:30:48.446378312 +0800
> @@ -1,4 +1,4 @@
> -6e135a1a27235a320311a932147846b4 *tests/data/fate/vsynth1-mpeg2-422.mpeg2video
> -730780 tests/data/fate/vsynth1-mpeg2-422.mpeg2video
> -0273cd8463d1fc115378748239951560 *tests/data/fate/vsynth1-mpeg2-422.out.rawvideo
> -stddev:   10.27 PSNR: 27.90 MAXDIFF:  162 bytes:  7603200/  7603200
> +ac2bfd738a93180bd3cb285367236d85 *tests/data/fate/vsynth1-mpeg2-422.mpeg2video
> +702035 tests/data/fate/vsynth1-mpeg2-422.mpeg2video
> +b8db8de89c37fab3b9a0248c2820a5ed *tests/data/fate/vsynth1-mpeg2-422.out.rawvideo
> +stddev:   10.30 PSNR: 27.87 MAXDIFF:  167 bytes:  7603200/  7603200
> 
> configuration: --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --disable-static --enable-shared --enable-gpl
> 
> It works with option --disable-ssse3
> 
> Below is the info for my CPU
> 
> $ cat /proc/cpuinfo | grep 'model name' | head -1
> model name      : Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz
> 
> Thanks
> Haihao

Does this help?

> diff --git a/libavfilter/framepool.c b/libavfilter/framepool.c
> index 5b510c9af9..8258a79845 100644
> --- a/libavfilter/framepool.c
> +++ b/libavfilter/framepool.c
> @@ -90,7 +90,7 @@ FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(size_t size),
>      }
> 
>      for (i = 0; i < 4 && pool->linesize[i]; i++) {
> -        int h = pool->height;
> +        int h = FFALIGN(pool->height, align);
>          if (i == 1 || i == 2)
>              h = AV_CEIL_RSHIFT(h, desc->log2_chroma_h);

It's the only behavior change i could find in the patch that could make 
a difference.

I'll send a different approach in a bit either way.


More information about the ffmpeg-devel mailing list