On 06/07/2011 02:20 PM, Ronald S. Bultje wrote:

>          if ((R|G|B)&(0xC0000000)) {\
> -            if (R>=(256<<22))   R=(256<<22)-1; \
> -            else if (R<0)R=0;   \
> -            if (G>=(256<<22))   G=(256<<22)-1; \
> -            else if (G<0)G=0;   \
> -            if (B>=(256<<22))   B=(256<<22)-1; \
> -            else if (B<0)B=0;   \
> +            R = av_clip_uintp2(R, 22); \
> +            G = av_clip_uintp2(G, 22); \
> +            B = av_clip_uintp2(B, 22); \
>          }


256<<22 is 1<<30

Also, just in general, these are only checking for overflow by 1 bit,
correct?

-Justin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to