]> git.sesse.net Git - ffmpeg/commitdiff
hevc: Remove useless clip
authorGuillaume Martres <smarter@ubuntu.com>
Sat, 11 Jan 2014 21:46:25 +0000 (22:46 +0100)
committerLuca Barbato <lu_zero@gentoo.org>
Tue, 21 Jan 2014 10:58:52 +0000 (11:58 +0100)
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@gentoo.org>
libavcodec/hevcdsp_template.c

index 7ebe490cc4af8c07560ee6839e364e9ab1fe53fb..104c1eb3df76365804fe574fb06184d22e056608 100644 (file)
@@ -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;
     }