summaryrefslogtreecommitdiff
path: root/libswscale
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-02-14 20:41:19 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-02-14 21:33:45 +0100
commit94bc672489a2b209a8972fbce3039f279f447103 (patch)
treecebe5ff750b9756fa98c72302b738a028db022b0 /libswscale
parentf03a02993935420201b3cf60842e202475619ee3 (diff)
swscale: yuv2422_2_c_template() add cliping.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/output.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libswscale/output.c b/libswscale/output.c
index d24cf1f1ea..75d0baad39 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -499,6 +499,13 @@ yuv2422_2_c_template(SwsContext *c, const int16_t *buf[2],
int U = (ubuf0[i] * uvalpha1 + ubuf1[i] * uvalpha) >> 19;
int V = (vbuf0[i] * uvalpha1 + vbuf1[i] * uvalpha) >> 19;
+ 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);
}
}