[FFmpeg-cvslog] hevc: remove useless clip in FUNC(sao_band_filter)()

Guillaume Martres git at videolan.org
Mon Jan 13 17:28:58 CET 2014


ffmpeg | branch: release/2.1 | Guillaume Martres <smarter at ubuntu.com> | Sat Jan 11 22:46:25 2014 +0100| [e43805d40188f2797619cdf068b64d2c3ada8a8f] | committer: Michael Niedermayer

hevc: remove useless clip in FUNC(sao_band_filter)()

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.

This removes the code that was changed in 5856bca360c5bc3e340a357d91b1f993c80a7bea
as the clip that was repositioned in that commit is removed

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit b00a8b4d194f1bf23343f3f42138affa1fe26641)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 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 8e9db63..4f6b711 100644
--- a/libavcodec/hevcdsp_template.c
+++ b/libavcodec/hevcdsp_template.c
@@ -391,7 +391,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