[FFmpeg-devel] [PATCH v2 1/3] avfilter/vf_colorbalance: Fix for the wrong step value for 16bit format
Paul B Mahol
onemda at gmail.com
Wed Nov 13 13:38:47 EET 2019
Do not touch this file I actively working on it.
On 11/13/19, lance.lmwang at gmail.com <lance.lmwang at gmail.com> wrote:
> From: Limin Wang <lance.lmwang at gmail.com>
>
> Please try to reproduce with below command:
> ./ffplay -vf format=rgba64,colorbalance=rm=.2 ../fate-suite/mpeg2/t.mpg
>
> Without the patch, the step is 8 if you check it by gdb or print out.
>
> Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> ---
> libavfilter/vf_colorbalance.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavfilter/vf_colorbalance.c b/libavfilter/vf_colorbalance.c
> index eb870ac2ad..3fd1426696 100644
> --- a/libavfilter/vf_colorbalance.c
> +++ b/libavfilter/vf_colorbalance.c
> @@ -303,6 +303,7 @@ static int config_output(AVFilterLink *outlink)
> ColorBalanceContext *s = ctx->priv;
> const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(outlink->format);
> const int depth = desc->comp[0].depth;
> + const int is16bit = depth > 8;
> const int max = 1 << depth;
> const int planar = av_pix_fmt_count_planes(outlink->format) > 1;
>
> @@ -319,7 +320,7 @@ static int config_output(AVFilterLink *outlink)
> }
>
> ff_fill_rgba_map(s->rgba_map, outlink->format);
> - s->step = av_get_padded_bits_per_pixel(desc) >> 3;
> + s->step = av_get_padded_bits_per_pixel(desc) >> (3 + is16bit);
>
> return 0;
> }
> --
> 2.21.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
More information about the ffmpeg-devel
mailing list