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/swscale.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/swscale.c')
-rw-r--r-- | libswscale/swscale.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 16a31cee40..6e47a92ac7 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -805,9 +805,9 @@ static void xyz12Torgb48(struct SwsContext *c, uint16_t *dst, c->xyz2rgb_matrix[2][2] * z >> 12; // limit values to 12-bit depth - r = av_clip(r, 0, 4095); - g = av_clip(g, 0, 4095); - b = av_clip(b, 0, 4095); + r = av_clip_uintp2(r, 12); + g = av_clip_uintp2(g, 12); + b = av_clip_uintp2(b, 12); // convert from sRGBlinear to RGB and scale from 12bit to 16bit if (desc->flags & AV_PIX_FMT_FLAG_BE) { @@ -861,9 +861,9 @@ static void rgb48Toxyz12(struct SwsContext *c, uint16_t *dst, c->rgb2xyz_matrix[2][2] * b >> 12; // limit values to 12-bit depth - x = av_clip(x, 0, 4095); - y = av_clip(y, 0, 4095); - z = av_clip(z, 0, 4095); + x = av_clip_uintp2(x, 12); + y = av_clip_uintp2(y, 12); + z = av_clip_uintp2(z, 12); // convert from XYZlinear to X'Y'Z' and scale from 12bit to 16bit if (desc->flags & AV_PIX_FMT_FLAG_BE) { |