[libav-devel] [PATCH] swscale: fix another yuv range conversion overflow. in 16bit scaling

Kostya kostya.shishkov at gmail.com
Thu Jun 30 07:13:51 CEST 2011


On Wed, Jun 29, 2011 at 09:55:25PM -0700, Ronald S. Bultje wrote:
> ---
>  libswscale/swscale.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/libswscale/swscale.c b/libswscale/swscale.c
> index 644f848..06ce8ff 100644
> --- a/libswscale/swscale.c
> +++ b/libswscale/swscale.c
> @@ -2001,7 +2001,7 @@ static void lumRangeToJpeg16_c(int16_t *_dst, int width)
>      int i;
>      int32_t *dst = (int32_t *) _dst;
>      for (i = 0; i < width; i++)
> -        dst[i] = (FFMIN(dst[i],30189<<4)*19077 - (39057361<<4))>>14;
> +        dst[i] = (FFMIN(dst[i],30189<<4)*4769 - (39057361<<2))>>12;
>  }
>  static void lumRangeFromJpeg16_c(int16_t *_dst, int width)
>  {
> -- 

looks even better than previous patch


More information about the libav-devel mailing list