[SCM] libav/experimental: Reintroduce lost idctSparseCol for Alpha. Sorry for adding even more code duplication, I'm currently working on the put/add variants, but I did not get them to be as fast as the old method yet...

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 15:32:32 UTC 2013


The following commit has been merged in the experimental branch:
commit 3155c994b606c451284ab0cbf900457cb33067b1
Author: Falk Hüffner <mellum at users.sourceforge.net>
Date:   Mon Jun 24 21:17:22 2002 +0000

    Reintroduce lost idctSparseCol for Alpha. Sorry for adding even more
    code duplication, I'm currently working on the put/add variants, but I
    did not get them to be as fast as the old method yet...
    
    Originally committed as revision 703 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/simple_idct.c b/libavcodec/simple_idct.c
index 0665f66..9edb726 100644
--- a/libavcodec/simple_idct.c
+++ b/libavcodec/simple_idct.c
@@ -167,6 +167,79 @@ static inline int idctRowCondDC(int16_t *row)
 
 	return 2;
 }
+
+inline static void idctSparseCol(int16_t *col)
+{
+        int a0, a1, a2, a3, b0, b1, b2, b3;
+
+        col[0] += (1 << (COL_SHIFT - 1)) / W4;
+
+        a0 = W4 * col[8 * 0];
+        a1 = W4 * col[8 * 0];
+        a2 = W4 * col[8 * 0];
+        a3 = W4 * col[8 * 0];
+
+        if (col[8 * 2]) {
+                a0 += W2 * col[8 * 2];
+                a1 += W6 * col[8 * 2];
+                a2 -= W6 * col[8 * 2];
+                a3 -= W2 * col[8 * 2];
+        }
+
+        if (col[8 * 4]) {
+                a0 += W4 * col[8 * 4];
+                a1 -= W4 * col[8 * 4];
+                a2 -= W4 * col[8 * 4];
+                a3 += W4 * col[8 * 4];
+        }
+
+        if (col[8 * 6]) {
+                a0 += W6 * col[8 * 6];
+                a1 -= W2 * col[8 * 6];
+                a2 += W2 * col[8 * 6];
+                a3 -= W6 * col[8 * 6];
+        }
+
+        if (col[8 * 1]) {
+                b0 = W1 * col[8 * 1];
+                b1 = W3 * col[8 * 1];
+                b2 = W5 * col[8 * 1];
+                b3 = W7 * col[8 * 1];
+        } else {
+                b0 = b1 = b2 = b3 = 0;
+        }
+
+        if (col[8 * 3]) {
+                b0 += W3 * col[8 * 3];
+                b1 -= W7 * col[8 * 3];
+                b2 -= W1 * col[8 * 3];
+                b3 -= W5 * col[8 * 3];
+        }
+
+        if (col[8 * 5]) {
+                b0 += W5 * col[8 * 5];
+                b1 -= W1 * col[8 * 5];
+                b2 += W7 * col[8 * 5];
+                b3 += W3 * col[8 * 5];
+        }
+
+        if (col[8 * 7]) {
+                b0 += W7 * col[8 * 7];
+                b1 -= W5 * col[8 * 7];
+                b2 += W3 * col[8 * 7];
+                b3 -= W1 * col[8 * 7];
+        }
+
+        col[8 * 0] = (a0 + b0) >> COL_SHIFT;
+        col[8 * 7] = (a0 - b0) >> COL_SHIFT;
+        col[8 * 1] = (a1 + b1) >> COL_SHIFT;
+        col[8 * 6] = (a1 - b1) >> COL_SHIFT;
+        col[8 * 2] = (a2 + b2) >> COL_SHIFT;
+        col[8 * 5] = (a2 - b2) >> COL_SHIFT;
+        col[8 * 3] = (a3 + b3) >> COL_SHIFT;
+        col[8 * 4] = (a3 - b3) >> COL_SHIFT;
+}
+
 #else  /* not ARCH_ALPHA */
 
 static inline void idctRowCondDC (int16_t * row)

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list