diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-02-21 14:49:17 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-21 14:49:17 +0100 |
commit | 03bffb68f6df8f4d730542076f8ede8e0cb2495c (patch) | |
tree | ecb4ccf1aabe0ec33fbf5be6d8d6c8d7337bb873 /libswscale/output.c | |
parent | b20426398cc475e12a0ea6d7269408435c982044 (diff) | |
download | ffmpeg-03bffb68f6df8f4d730542076f8ede8e0cb2495c.tar.gz |
swscale: Use av_clip_uintp2()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale/output.c')
-rw-r--r-- | libswscale/output.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/libswscale/output.c b/libswscale/output.c index eee6b4874b..88fa2b57ae 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -1549,16 +1549,16 @@ static av_always_inline void yuv2rgb_write_full(SwsContext *c, r = (((R >> 19) + A_DITHER(i,y) -96)>>8); g = (((G >> 19) + A_DITHER(i + 17,y) - 96)>>8); b = (((B >> 20) + A_DITHER(i + 17*2,y) -96)>>8); - r = av_clip(r, 0, 7); - g = av_clip(g, 0, 7); - b = av_clip(b, 0, 3); + r = av_clip_uintp2(r, 3); + g = av_clip_uintp2(g, 3); + b = av_clip_uintp2(b, 2); } else { r = (((R >> 21) + A_DITHER(i,y)-256)>>8); g = (((G >> 19) + A_DITHER(i + 17,y)-256)>>8); b = (((B >> 21) + A_DITHER(i + 17*2,y)-256)>>8); - r = av_clip(r, 0, 1); - g = av_clip(g, 0, 3); - b = av_clip(b, 0, 1); + r = av_clip_uintp2(r, 1); + g = av_clip_uintp2(g, 2); + b = av_clip_uintp2(b, 1); } break; case SWS_DITHER_X_DITHER: @@ -1568,16 +1568,16 @@ static av_always_inline void yuv2rgb_write_full(SwsContext *c, r = (((R >> 19) + X_DITHER(i,y) - 96)>>8); g = (((G >> 19) + X_DITHER(i + 17,y) - 96)>>8); b = (((B >> 20) + X_DITHER(i + 17*2,y) - 96)>>8); - r = av_clip(r, 0, 7); - g = av_clip(g, 0, 7); - b = av_clip(b, 0, 3); + r = av_clip_uintp2(r, 3); + g = av_clip_uintp2(g, 3); + b = av_clip_uintp2(b, 2); } else { r = (((R >> 21) + X_DITHER(i,y)-256)>>8); g = (((G >> 19) + X_DITHER(i + 17,y)-256)>>8); b = (((B >> 21) + X_DITHER(i + 17*2,y)-256)>>8); - r = av_clip(r, 0, 1); - g = av_clip(g, 0, 3); - b = av_clip(b, 0, 1); + r = av_clip_uintp2(r, 1); + g = av_clip_uintp2(g, 2); + b = av_clip_uintp2(b, 1); } break; |