aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/faandct.c
diff options
context:
space:
mode:
authorRoman Shaposhnik <roman@shaposhnik.org>2003-10-25 00:32:54 +0000
committerRoman Shaposhnik <roman@shaposhnik.org>2003-10-25 00:32:54 +0000
commit48b1f80012102847fb961c8d3dfb846b5665681c (patch)
treef38f606cb0aa9f296051cd0487daed4f63e99231 /libavcodec/faandct.c
parentb292469633752def3d03341edd956ffd542b777e (diff)
downloadffmpeg-48b1f80012102847fb961c8d3dfb846b5665681c.tar.gz
* adding integer/floating point AAN implementations for DCT 2-4-8
Originally committed as revision 2430 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/faandct.c')
-rw-r--r--libavcodec/faandct.c86
1 files changed, 86 insertions, 0 deletions
diff --git a/libavcodec/faandct.c b/libavcodec/faandct.c
index a7b9102cfe..e78d49b47c 100644
--- a/libavcodec/faandct.c
+++ b/libavcodec/faandct.c
@@ -160,3 +160,89 @@ void ff_faandct(DCTELEM * data)
data[8*7 + i]= lrintf(SCALE(8*7 + i) * (z11 - z4));
}
}
+
+void ff_faandct248(DCTELEM * data)
+{
+ FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+ FLOAT tmp10, tmp11, tmp12, tmp13;
+ FLOAT z1, z2, z3, z4, z5, z11, z13;
+ FLOAT temp[64];
+ int i;
+
+ emms_c();
+
+ for (i=0; i<8*8; i+=8) {
+ tmp0= data[0 + i] + data[7 + i];
+ tmp7= data[0 + i] - data[7 + i];
+ tmp1= data[1 + i] + data[6 + i];
+ tmp6= data[1 + i] - data[6 + i];
+ tmp2= data[2 + i] + data[5 + i];
+ tmp5= data[2 + i] - data[5 + i];
+ tmp3= data[3 + i] + data[4 + i];
+ tmp4= data[3 + i] - data[4 + i];
+
+ tmp10= tmp0 + tmp3;
+ tmp13= tmp0 - tmp3;
+ tmp11= tmp1 + tmp2;
+ tmp12= tmp1 - tmp2;
+
+ temp[0 + i]= tmp10 + tmp11;
+ temp[4 + i]= tmp10 - tmp11;
+
+ z1= (tmp12 + tmp13)*A1;
+ temp[2 + i]= tmp13 + z1;
+ temp[6 + i]= tmp13 - z1;
+
+ tmp10= tmp4 + tmp5;
+ tmp11= tmp5 + tmp6;
+ tmp12= tmp6 + tmp7;
+
+ z5= (tmp10 - tmp12) * A5;
+ z2= tmp10*A2 + z5;
+ z4= tmp12*A4 + z5;
+ z3= tmp11*A1;
+
+ z11= tmp7 + z3;
+ z13= tmp7 - z3;
+
+ temp[5 + i]= z13 + z2;
+ temp[3 + i]= z13 - z2;
+ temp[1 + i]= z11 + z4;
+ temp[7 + i]= z11 - z4;
+ }
+
+ for (i=0; i<8; i++) {
+ tmp0 = temp[8*0 + i] + temp[8*1 + i];
+ tmp1 = temp[8*2 + i] + temp[8*3 + i];
+ tmp2 = temp[8*4 + i] + temp[8*5 + i];
+ tmp3 = temp[8*6 + i] + temp[8*7 + i];
+ tmp4 = temp[8*0 + i] - temp[8*1 + i];
+ tmp5 = temp[8*2 + i] - temp[8*3 + i];
+ tmp6 = temp[8*4 + i] - temp[8*5 + i];
+ tmp7 = temp[8*6 + i] - temp[8*7 + i];
+
+ tmp10 = tmp0 + tmp3;
+ tmp11 = tmp1 + tmp2;
+ tmp12 = tmp1 - tmp2;
+ tmp13 = tmp0 - tmp3;
+
+ data[8*0 + i] = lrintf(SCALE(8*0 + i) * (tmp10 + tmp11));
+ data[8*4 + i] = lrintf(SCALE(8*4 + i) * (tmp10 - tmp11));
+
+ z1 = (tmp12 + tmp13)* A1;
+ data[8*2 + i] = lrintf(SCALE(8*2 + i) * (tmp13 + z1));
+ data[8*6 + i] = lrintf(SCALE(8*6 + i) * (tmp13 - z1));
+
+ tmp10 = tmp4 + tmp7;
+ tmp11 = tmp5 + tmp6;
+ tmp12 = tmp5 - tmp6;
+ tmp13 = tmp4 - tmp7;
+
+ data[8*1 + i] = lrintf(SCALE(8*0 + i) * (tmp10 + tmp11));
+ data[8*5 + i] = lrintf(SCALE(8*4 + i) * (tmp10 - tmp11));
+
+ z1 = (tmp12 + tmp13)* A1;
+ data[8*3 + i] = lrintf(SCALE(8*2 + i) * (tmp13 + z1));
+ data[8*7 + i] = lrintf(SCALE(8*6 + i) * (tmp13 - z1));
+ }
+}