mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-28 20:53:54 +02:00
swscale/output: Fix several invalid shifts in yuv2rgb_full_1_c_template()
Fixes: Invalid shifts
Fixes: #8320
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7b7f97532b
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
0ec11133d9
commit
f541744f73
@ -2099,7 +2099,7 @@ yuv2rgb_full_1_c_template(SwsContext *c, const int16_t *buf0,
|
||||
if (uvalpha < 2048) {
|
||||
int A = 0; //init to silence warning
|
||||
for (i = 0; i < dstW; i++) {
|
||||
int Y = buf0[i] << 2;
|
||||
int Y = buf0[i] * 4;
|
||||
int U = (ubuf0[i] - (128<<7)) * 4;
|
||||
int V = (vbuf0[i] - (128<<7)) * 4;
|
||||
|
||||
@ -2116,9 +2116,9 @@ yuv2rgb_full_1_c_template(SwsContext *c, const int16_t *buf0,
|
||||
const int16_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1];
|
||||
int A = 0; //init to silence warning
|
||||
for (i = 0; i < dstW; i++) {
|
||||
int Y = buf0[i] << 2;
|
||||
int U = (ubuf0[i] + ubuf1[i] - (128<<8)) << 1;
|
||||
int V = (vbuf0[i] + vbuf1[i] - (128<<8)) << 1;
|
||||
int Y = buf0[i] * 4;
|
||||
int U = (ubuf0[i] + ubuf1[i] - (128<<8)) * 2;
|
||||
int V = (vbuf0[i] + vbuf1[i] - (128<<8)) * 2;
|
||||
|
||||
if (hasAlpha) {
|
||||
A = (abuf0[i] + 64) >> 7;
|
||||
|
Loading…
Reference in New Issue
Block a user