[FFmpeg-devel] [PATCH 1/2] lavc/cfhd: error due to improper allocation of height in buffers

Gagandeep Singh deepgagan231197 at gmail.com
Tue Mar 27 10:24:55 EEST 2018


On Tue, 27 Mar 2018, 12:41 Gagandeep Singh, <deepgagan231197 at gmail.com>
wrote:

> ticket #6675 the distortion in the bottom 8 pixels fixed
> ---
>  libavcodec/cfhd.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
> index e35732df45..f10742f4fa 100644
> --- a/libavcodec/cfhd.c
> +++ b/libavcodec/cfhd.c
> @@ -213,13 +213,14 @@ static int alloc_buffers(AVCodecContext *avctx)
>          int width  = i ? avctx->width  >> chroma_x_shift : avctx->width;
>          int height = i ? avctx->height >> chroma_y_shift : avctx->height;
>          ptrdiff_t stride = FFALIGN(width  / 8, 8) * 8;
> -        height           = FFALIGN(height / 8, 2) * 8;
> +        if (chroma_y_shift)
> +            height = FFALIGN(height / 8, 2) * 8;
>          s->plane[i].width  = width;
>          s->plane[i].height = height;
>          s->plane[i].stride = stride;
>
>          w8 = FFALIGN(s->plane[i].width  / 8, 8);
> -        h8 = FFALIGN(s->plane[i].height / 8, 2);
> +        h8 = height / 8;
>          w4 = w8 * 2;
>          h4 = h8 * 2;
>          w2 = w4 * 2;
> --
> 2.14.1
>
>
> From b1912774babcf737bd20ce0264c9b10fd0ca0183 Mon Sep 17 00:00:00 2001
> From: Gagandeep Singh <deepgagan231197 at gmail.com>
> Date: Tue, 27 Mar 2018 12:34:27 +0530
> Subject: [FFmpeg-devel][PATCH 2/2] tests/ref/fate/cfhd-3: updated
> reference to work with the
>  patch
>
> the output can be confirmed to be better than the one with the reference
> hash.
> ---
>  tests/ref/fate/cfhd-3 | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/tests/ref/fate/cfhd-3 b/tests/ref/fate/cfhd-3
> index 60e13c64a7..59fdc92260 100644
> --- a/tests/ref/fate/cfhd-3
> +++ b/tests/ref/fate/cfhd-3
> @@ -3,13 +3,13 @@
>  #codec_id 0: rawvideo
>  #dimensions 0: 496x241
>  #sar 0: 0/1
> -0,          0,          0,        1,   478144, 0x6ed01dcd
> -0,          1,          1,        1,   478144, 0x6ed01dcd
> -0,          2,          2,        1,   478144, 0x6ed01dcd
> -0,          3,          3,        1,   478144, 0xb1b4a74b
> -0,          4,          4,        1,   478144, 0x94c345c3
> -0,          5,          5,        1,   478144, 0x05e0388d
> -0,          6,          6,        1,   478144, 0xe747476a
> -0,          7,          7,        1,   478144, 0x8c1561f1
> -0,          8,          8,        1,   478144, 0x8c1561f1
> -0,          9,          9,        1,   478144, 0x8c1561f1
> +0,          0,          0,        1,   478144, 0x48a01dbb
> +0,          1,          1,        1,   478144, 0x48a01dbb
> +0,          2,          2,        1,   478144, 0x48a01dbb
> +0,          3,          3,        1,   478144, 0xb978a72f
> +0,          4,          4,        1,   478144, 0x7bbb4679
> +0,          5,          5,        1,   478144, 0xc3fd3f59
> +0,          6,          6,        1,   478144, 0xfd2a4816
> +0,          7,          7,        1,   478144, 0x207f65d3
> +0,          8,          8,        1,   478144, 0x207f65d3
> +0,          9,          9,        1,   478144, 0x207f65d3
> --
> 2.14.1
>


Don't use this patch, I have sent updated patch mail , here I messed up
combining two commits

>
>


More information about the ffmpeg-devel mailing list