Commit 4f4ca675 authored by Michael Niedermayer's avatar Michael Niedermayer

swscale/output: Implement Luma computation from yuv2ya16_X_c_template() without 64bit

This also reverts 21838cad
The revert is in this commit to avoid 2 fate updates
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent e831f601
...@@ -904,13 +904,14 @@ yuv2ya16_X_c_template(SwsContext *c, const int16_t *lumFilter, ...@@ -904,13 +904,14 @@ yuv2ya16_X_c_template(SwsContext *c, const int16_t *lumFilter,
for (i = 0; i < dstW; i++) { for (i = 0; i < dstW; i++) {
int j; int j;
int64_t Y = 1 << 18; int Y = -0x40000000;
int64_t A = 0xffff<<14; int64_t A = 0xffff<<14;
for (j = 0; j < lumFilterSize; j++) for (j = 0; j < lumFilterSize; j++)
Y += lumSrc[j][i] * lumFilter[j]; Y += lumSrc[j][i] * lumFilter[j];
Y >>= 15; Y >>= 15;
Y += (1<<3) + 0x8000;
Y = av_clip_uint16(Y); Y = av_clip_uint16(Y);
if (hasAlpha) { if (hasAlpha) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment