X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fclearvideo.c;h=27b00ce820340029a3d57239eb0d288d5c753a2a;hb=f78f3df7e01c266e83a98285fa3b5cd5823dab4d;hp=437c459aa55b1dd397fe461236a67e9472c60711;hpb=1fd76277708cf83572ba243e98f9e848c652f83d;p=ffmpeg diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c index 437c459aa55..27b00ce8203 100644 --- a/libavcodec/clearvideo.c +++ b/libavcodec/clearvideo.c @@ -185,12 +185,12 @@ static inline int decode_block(CLVContext *ctx, int16_t *blk, int has_ac, const int t3 = OP( 2408 * blk[5 * step] - 1609 * blk[3 * step]); \ const int t4 = OP( 1108 * blk[2 * step] - 2676 * blk[6 * step]); \ const int t5 = OP( 2676 * blk[2 * step] + 1108 * blk[6 * step]); \ - const int t6 = ((blk[0 * step] + blk[4 * step]) << dshift) + bias; \ - const int t7 = ((blk[0 * step] - blk[4 * step]) << dshift) + bias; \ + const int t6 = ((blk[0 * step] + blk[4 * step]) * (1 << dshift)) + bias; \ + const int t7 = ((blk[0 * step] - blk[4 * step]) * (1 << dshift)) + bias; \ const int t8 = t0 + t2; \ const int t9 = t0 - t2; \ - const int tA = 181 * (t9 + (t1 - t3)) + 0x80 >> 8; \ - const int tB = 181 * (t9 - (t1 - t3)) + 0x80 >> 8; \ + const int tA = (int)(181U * (t9 + (t1 - t3)) + 0x80) >> 8; \ + const int tB = (int)(181U * (t9 - (t1 - t3)) + 0x80) >> 8; \ const int tC = t1 + t3; \ \ blk[0 * step] = (t6 + t5 + t8) >> shift; \