[FFmpeg-cvslog] hevc: Remove useless clip

Guillaume Martres git at videolan.org
Tue Jan 21 15:29:58 CET 2014


ffmpeg | branch: master | Guillaume Martres <smarter at ubuntu.com> | Sat Jan 11 22:46:25 2014 +0100| [faf03ecba03155bb1f5416713bd01da043863b43] | committer: Luca Barbato

hevc: Remove useless clip

The src buffer should only contain values in the interval
[0, (1 << BIT_DEPTH) - 1].

Since shift = (BIT_DEPTH - 5), src[x] >> shift must be in
the interval [0, 31], so no clip is needed.

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=faf03ecba03155bb1f5416713bd01da043863b43
---

 libavcodec/hevcdsp_template.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/hevcdsp_template.c b/libavcodec/hevcdsp_template.c
index 7ebe490..104c1eb 100644
--- a/libavcodec/hevcdsp_template.c
+++ b/libavcodec/hevcdsp_template.c
@@ -393,7 +393,7 @@ static void FUNC(sao_band_filter)(uint8_t *_dst, uint8_t *_src,
         offset_table[(k + sao_left_class) & 31] = sao_offset_val[k + 1];
     for (y = 0; y < height; y++) {
         for (x = 0; x < width; x++)
-            dst[x] = av_clip_pixel(src[x] + offset_table[av_clip_pixel(src[x] >> shift)]);
+            dst[x] = av_clip_pixel(src[x] + offset_table[src[x] >> shift]);
         dst += stride;
         src += stride;
     }



More information about the ffmpeg-cvslog mailing list