Commit f03a0299 authored by Michael Niedermayer's avatar Michael Niedermayer

swscale: Add cliping to yuv2422_1_c_template()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent ef96bf29
...@@ -519,6 +519,13 @@ yuv2422_1_c_template(SwsContext *c, const int16_t *buf0, ...@@ -519,6 +519,13 @@ yuv2422_1_c_template(SwsContext *c, const int16_t *buf0,
int U = (ubuf0[i] +64) >> 7; int U = (ubuf0[i] +64) >> 7;
int V = (vbuf0[i] +64) >> 7; int V = (vbuf0[i] +64) >> 7;
if ((Y1 | Y2 | U | V) & 0x100) {
Y1 = av_clip_uint8(Y1);
Y2 = av_clip_uint8(Y2);
U = av_clip_uint8(U);
V = av_clip_uint8(V);
}
output_pixels(i * 4, Y1, U, Y2, V); output_pixels(i * 4, Y1, U, Y2, V);
} }
} else { } else {
...@@ -529,6 +536,13 @@ yuv2422_1_c_template(SwsContext *c, const int16_t *buf0, ...@@ -529,6 +536,13 @@ yuv2422_1_c_template(SwsContext *c, const int16_t *buf0,
int U = (ubuf0[i] + ubuf1[i]+128) >> 8; int U = (ubuf0[i] + ubuf1[i]+128) >> 8;
int V = (vbuf0[i] + vbuf1[i]+128) >> 8; int V = (vbuf0[i] + vbuf1[i]+128) >> 8;
if ((Y1 | Y2 | U | V) & 0x100) {
Y1 = av_clip_uint8(Y1);
Y2 = av_clip_uint8(Y2);
U = av_clip_uint8(U);
V = av_clip_uint8(V);
}
output_pixels(i * 4, Y1, U, Y2, V); output_pixels(i * 4, Y1, U, Y2, V);
} }
} }
......
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