[FFmpeg-cvslog] hevc: fix transform_skip which is only valid for 4x4( cherry picked from commit 740e5a71e5121dbf3fabdc4fec97829c18ecc2d8)

Mickaël Raulet git at videolan.org
Tue Oct 22 08:48:08 CEST 2013


ffmpeg | branch: master | Mickaël Raulet <mraulet at insa-rennes.fr> | Mon Oct 21 12:44:18 2013 +0200| [c68faca68e211d8725fc5a1a88850cc3544e7960] | committer: Michael Niedermayer

hevc: fix transform_skip which is only valid for 4x4(cherry picked from commit 740e5a71e5121dbf3fabdc4fec97829c18ecc2d8)

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

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

 libavcodec/hevcdsp_template.c |   40 ++++++----------------------------------
 1 file changed, 6 insertions(+), 34 deletions(-)

diff --git a/libavcodec/hevcdsp_template.c b/libavcodec/hevcdsp_template.c
index 6c4331a..bda1dee 100644
--- a/libavcodec/hevcdsp_template.c
+++ b/libavcodec/hevcdsp_template.c
@@ -109,7 +109,6 @@ static void FUNC(transform_skip)(uint8_t *_dst, int16_t *coeffs, ptrdiff_t _stri
 {
     pixel *dst = (pixel*)_dst;
     ptrdiff_t stride = _stride / sizeof(pixel);
-    int size = 4;
     int shift = 13 - BIT_DEPTH;
 #if BIT_DEPTH <= 13
     int offset = 1 << (shift - 1);
@@ -117,39 +116,12 @@ static void FUNC(transform_skip)(uint8_t *_dst, int16_t *coeffs, ptrdiff_t _stri
     int offset = 0;
 #endif
     int x, y;
-    switch (size){
-        case 32:
-            for (y = 0; y < 32*32; y+=32) {
-                for (x = 0; x < 32; x++) {
-                    dst[x] = av_clip_pixel(dst[x] + ((coeffs[y + x] + offset) >> shift));
-                }
-                dst += stride;
-            }
-            break;
-        case 16:
-            for (y = 0; y < 16*16; y+=16) {
-                for (x = 0; x < 16; x++) {
-                    dst[x] = av_clip_pixel(dst[x] + ((coeffs[y + x] + offset) >> shift));
-                }
-                dst += stride;
-            }
-            break;
-        case 8:
-            for (y = 0; y < 8*8; y+=8) {
-                for (x = 0; x < 8; x++) {
-                    dst[x] = av_clip_pixel(dst[x] + ((coeffs[y + x] + offset) >> shift));
-                }
-                dst += stride;
-            }
-            break;
-        case 4:
-            for (y = 0; y < 4*4; y+=4) {
-                for (x = 0; x < 4; x++) {
-                    dst[x] = av_clip_pixel(dst[x] + ((coeffs[y + x] + offset) >> shift));
-                }
-                dst += stride;
-            }
-            break;
+
+    for (y = 0; y < 4*4; y+=4) {
+        for (x = 0; x < 4; x++) {
+            dst[x] = av_clip_pixel(dst[x] + ((coeffs[y + x] + offset) >> shift));
+        }
+        dst += stride;
     }
 }
 



More information about the ffmpeg-cvslog mailing list