[FFmpeg-devel] [PATCH 1/5] avcodec/diracdsp: use av_clip_uintp2

James Almer jamrial at gmail.com
Wed Jan 20 19:04:04 CET 2016


Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavcodec/diracdsp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/diracdsp.c b/libavcodec/diracdsp.c
index e82b587..5698dd0 100644
--- a/libavcodec/diracdsp.c
+++ b/libavcodec/diracdsp.c
@@ -158,10 +158,10 @@ static void put_signed_rect_clamped_10bit_c(uint8_t *_dst, int dst_stride, const
     int32_t *src = (int32_t *)_src;
     for (y = 0; y < height; y++) {
         for (x = 0; x < width; x+=4) {
-            dst[x  ] = av_clip(src[x  ] + 512, 0, (1 << 10) - 1);
-            dst[x+1] = av_clip(src[x+1] + 512, 0, (1 << 10) - 1);
-            dst[x+2] = av_clip(src[x+2] + 512, 0, (1 << 10) - 1);
-            dst[x+3] = av_clip(src[x+3] + 512, 0, (1 << 10) - 1);
+            dst[x  ] = av_clip_uintp2(src[x  ] + 512, 10);
+            dst[x+1] = av_clip_uintp2(src[x+1] + 512, 10);
+            dst[x+2] = av_clip_uintp2(src[x+2] + 512, 10);
+            dst[x+3] = av_clip_uintp2(src[x+3] + 512, 10);
         }
         dst += dst_stride >> 1;
         src += src_stride >> 2;
-- 
2.7.0



More information about the ffmpeg-devel mailing list