update libswscale/output.c.

fix ffmpeg bug

Signed-off-by: ziyugao <gaoziyu0614@outlook.com>
This commit is contained in:
ziyugao 2024-10-31 02:11:12 +00:00 committed by Gitee
parent 81b3e6655e
commit 12a0ca33f1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -643,7 +643,7 @@ yuv2mono_2_c_template(SwsContext *c, const int16_t *buf[2],
if (c->dither == SWS_DITHER_ED) { if (c->dither == SWS_DITHER_ED) {
int err = 0; int err = 0;
int acc = 0; unsigned acc = 0;
for (i = 0; i < dstW; i +=2) { for (i = 0; i < dstW; i +=2) {
int Y; int Y;
@ -665,7 +665,8 @@ yuv2mono_2_c_template(SwsContext *c, const int16_t *buf[2],
c->dither_error[0][i] = err; c->dither_error[0][i] = err;
} else { } else {
for (i = 0; i < dstW; i += 8) { for (i = 0; i < dstW; i += 8) {
int Y, acc = 0; int Y;
unsigned acc = 0;
Y = (buf0[i + 0] * yalpha1 + buf1[i + 0] * yalpha) >> 19; Y = (buf0[i + 0] * yalpha1 + buf1[i + 0] * yalpha) >> 19;
accumulate_bit(acc, Y + d128[0]); accumulate_bit(acc, Y + d128[0]);
@ -700,7 +701,7 @@ yuv2mono_1_c_template(SwsContext *c, const int16_t *buf0,
if (c->dither == SWS_DITHER_ED) { if (c->dither == SWS_DITHER_ED) {
int err = 0; int err = 0;
int acc = 0; unsigned acc = 0;
for (i = 0; i < dstW; i +=2) { for (i = 0; i < dstW; i +=2) {
int Y; int Y;
@ -722,7 +723,7 @@ yuv2mono_1_c_template(SwsContext *c, const int16_t *buf0,
c->dither_error[0][i] = err; c->dither_error[0][i] = err;
} else { } else {
for (i = 0; i < dstW; i += 8) { for (i = 0; i < dstW; i += 8) {
int acc = 0; unsigned acc = 0;
accumulate_bit(acc, ((buf0[i + 0] + 64) >> 7) + d128[0]); accumulate_bit(acc, ((buf0[i + 0] + 64) >> 7) + d128[0]);
accumulate_bit(acc, ((buf0[i + 1] + 64) >> 7) + d128[1]); accumulate_bit(acc, ((buf0[i + 1] + 64) >> 7) + d128[1]);
accumulate_bit(acc, ((buf0[i + 2] + 64) >> 7) + d128[2]); accumulate_bit(acc, ((buf0[i + 2] + 64) >> 7) + d128[2]);