Mercurial > libavcodec.hg
annotate i386/fdct_mmx.c @ 1574:1396e33a9cb6 libavcodec
10l
author | michael |
---|---|
date | Sat, 25 Oct 2003 19:44:37 +0000 |
parents | 9a9c14e87ebf |
children | f16ae8e69bd9 |
rev | line source |
---|---|
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
1 /* |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
2 * MMX optimized forward DCT |
429 | 3 * The gcc porting is Copyright (c) 2001 Fabrice Bellard. |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
4 * |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
5 * from fdctam32.c - AP922 MMX(3D-Now) forward-DCT |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
6 * |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
7 * Intel Application Note AP-922 - fast, precise implementation of DCT |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
8 * http://developer.intel.com/vtune/cbts/appnotes.htm |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
9 */ |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
10 #include "../common.h" |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
11 #include "mmx.h" |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
12 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
13 #define ATTR_ALIGN(align) __attribute__ ((__aligned__ (align))) |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
14 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
15 ////////////////////////////////////////////////////////////////////// |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
16 // |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
17 // constants for the forward DCT |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
18 // ----------------------------- |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
19 // |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
20 // Be sure to check that your compiler is aligning all constants to QWORD |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
21 // (8-byte) memory boundaries! Otherwise the unaligned memory access will |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
22 // severely stall MMX execution. |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
23 // |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
24 ////////////////////////////////////////////////////////////////////// |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
25 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
26 #define BITS_FRW_ACC 3 //; 2 or 3 for accuracy |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
27 #define SHIFT_FRW_COL BITS_FRW_ACC |
635 | 28 #define SHIFT_FRW_ROW (BITS_FRW_ACC + 17 - 3) |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
29 //#define RND_FRW_ROW (262144 * (BITS_FRW_ACC - 1)) //; 1 << (SHIFT_FRW_ROW-1) |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
30 #define RND_FRW_ROW (1 << (SHIFT_FRW_ROW-1)) |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
31 //#define RND_FRW_COL (2 * (BITS_FRW_ACC - 1)) //; 1 << (SHIFT_FRW_COL-1) |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
32 #define RND_FRW_COL (1 << (SHIFT_FRW_COL-1)) |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
33 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
34 //concatenated table, for forward DCT transformation |
839 | 35 static const int16_t fdct_tg_all_16[] ATTR_ALIGN(8) = { |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
36 13036, 13036, 13036, 13036, // tg * (2<<16) + 0.5 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
37 27146, 27146, 27146, 27146, // tg * (2<<16) + 0.5 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
38 -21746, -21746, -21746, -21746, // tg * (2<<16) + 0.5 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
39 }; |
839 | 40 static const int16_t cos_4_16[4] ATTR_ALIGN(8) = { |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
41 -19195, -19195, -19195, -19195, //cos * (2<<16) + 0.5 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
42 }; |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
43 |
839 | 44 static const int16_t ocos_4_16[4] ATTR_ALIGN(8) = { |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
45 23170, 23170, 23170, 23170, //cos * (2<<15) + 0.5 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
46 }; |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
47 |
839 | 48 static const long long fdct_one_corr ATTR_ALIGN(8) = 0x0001000100010001LL; |
49 static const long fdct_r_row[2] ATTR_ALIGN(8) = {RND_FRW_ROW, RND_FRW_ROW }; | |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
50 |
839 | 51 static const int16_t tab_frw_01234567[] ATTR_ALIGN(8) = { // forward_dct coeff table |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
52 //row0 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
53 16384, 16384, 21407, -8867, // w09 w01 w08 w00 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
54 16384, 16384, 8867, -21407, // w13 w05 w12 w04 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
55 16384, -16384, 8867, 21407, // w11 w03 w10 w02 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
56 -16384, 16384, -21407, -8867, // w15 w07 w14 w06 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
57 22725, 12873, 19266, -22725, // w22 w20 w18 w16 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
58 19266, 4520, -4520, -12873, // w23 w21 w19 w17 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
59 12873, 4520, 4520, 19266, // w30 w28 w26 w24 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
60 -22725, 19266, -12873, -22725, // w31 w29 w27 w25 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
61 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
62 //row1 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
63 22725, 22725, 29692, -12299, // w09 w01 w08 w00 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
64 22725, 22725, 12299, -29692, // w13 w05 w12 w04 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
65 22725, -22725, 12299, 29692, // w11 w03 w10 w02 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
66 -22725, 22725, -29692, -12299, // w15 w07 w14 w06 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
67 31521, 17855, 26722, -31521, // w22 w20 w18 w16 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
68 26722, 6270, -6270, -17855, // w23 w21 w19 w17 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
69 17855, 6270, 6270, 26722, // w30 w28 w26 w24 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
70 -31521, 26722, -17855, -31521, // w31 w29 w27 w25 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
71 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
72 //row2 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
73 21407, 21407, 27969, -11585, // w09 w01 w08 w00 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
74 21407, 21407, 11585, -27969, // w13 w05 w12 w04 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
75 21407, -21407, 11585, 27969, // w11 w03 w10 w02 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
76 -21407, 21407, -27969, -11585, // w15 w07 w14 w06 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
77 29692, 16819, 25172, -29692, // w22 w20 w18 w16 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
78 25172, 5906, -5906, -16819, // w23 w21 w19 w17 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
79 16819, 5906, 5906, 25172, // w30 w28 w26 w24 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
80 -29692, 25172, -16819, -29692, // w31 w29 w27 w25 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
81 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
82 //row3 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
83 19266, 19266, 25172, -10426, // w09 w01 w08 w00 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
84 19266, 19266, 10426, -25172, // w13 w05 w12 w04 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
85 19266, -19266, 10426, 25172, // w11 w03 w10 w02 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
86 -19266, 19266, -25172, -10426, // w15 w07 w14 w06, |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
87 26722, 15137, 22654, -26722, // w22 w20 w18 w16 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
88 22654, 5315, -5315, -15137, // w23 w21 w19 w17 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
89 15137, 5315, 5315, 22654, // w30 w28 w26 w24 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
90 -26722, 22654, -15137, -26722, // w31 w29 w27 w25, |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
91 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
92 //row4 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
93 16384, 16384, 21407, -8867, // w09 w01 w08 w00 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
94 16384, 16384, 8867, -21407, // w13 w05 w12 w04 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
95 16384, -16384, 8867, 21407, // w11 w03 w10 w02 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
96 -16384, 16384, -21407, -8867, // w15 w07 w14 w06 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
97 22725, 12873, 19266, -22725, // w22 w20 w18 w16 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
98 19266, 4520, -4520, -12873, // w23 w21 w19 w17 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
99 12873, 4520, 4520, 19266, // w30 w28 w26 w24 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
100 -22725, 19266, -12873, -22725, // w31 w29 w27 w25 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
101 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
102 //row5 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
103 19266, 19266, 25172, -10426, // w09 w01 w08 w00 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
104 19266, 19266, 10426, -25172, // w13 w05 w12 w04 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
105 19266, -19266, 10426, 25172, // w11 w03 w10 w02 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
106 -19266, 19266, -25172, -10426, // w15 w07 w14 w06 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
107 26722, 15137, 22654, -26722, // w22 w20 w18 w16 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
108 22654, 5315, -5315, -15137, // w23 w21 w19 w17 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
109 15137, 5315, 5315, 22654, // w30 w28 w26 w24 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
110 -26722, 22654, -15137, -26722, // w31 w29 w27 w25 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
111 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
112 //row6 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
113 21407, 21407, 27969, -11585, // w09 w01 w08 w00 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
114 21407, 21407, 11585, -27969, // w13 w05 w12 w04 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
115 21407, -21407, 11585, 27969, // w11 w03 w10 w02 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
116 -21407, 21407, -27969, -11585, // w15 w07 w14 w06, |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
117 29692, 16819, 25172, -29692, // w22 w20 w18 w16 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
118 25172, 5906, -5906, -16819, // w23 w21 w19 w17 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
119 16819, 5906, 5906, 25172, // w30 w28 w26 w24 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
120 -29692, 25172, -16819, -29692, // w31 w29 w27 w25, |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
121 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
122 //row7 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
123 22725, 22725, 29692, -12299, // w09 w01 w08 w00 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
124 22725, 22725, 12299, -29692, // w13 w05 w12 w04 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
125 22725, -22725, 12299, 29692, // w11 w03 w10 w02 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
126 -22725, 22725, -29692, -12299, // w15 w07 w14 w06, |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
127 31521, 17855, 26722, -31521, // w22 w20 w18 w16 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
128 26722, 6270, -6270, -17855, // w23 w21 w19 w17 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
129 17855, 6270, 6270, 26722, // w30 w28 w26 w24 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
130 -31521, 26722, -17855, -31521 // w31 w29 w27 w25 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
131 }; |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
132 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
133 |
1564
b6b7d080f1a1
inline -> always_inline (842 -> 690 cpu cycles for dct_quantize() difference for the dct itself should be even bigger)
michael
parents:
839
diff
changeset
|
134 static always_inline void fdct_col(const int16_t *in, int16_t *out, int offset) |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
135 { |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
136 movq_m2r(*(in + offset + 1 * 8), mm0); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
137 movq_m2r(*(in + offset + 6 * 8), mm1); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
138 movq_r2r(mm0, mm2); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
139 movq_m2r(*(in + offset + 2 * 8), mm3); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
140 paddsw_r2r(mm1, mm0); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
141 movq_m2r(*(in + offset + 5 * 8), mm4); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
142 psllw_i2r(SHIFT_FRW_COL, mm0); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
143 movq_m2r(*(in + offset + 0 * 8), mm5); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
144 paddsw_r2r(mm3, mm4); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
145 paddsw_m2r(*(in + offset + 7 * 8), mm5); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
146 psllw_i2r(SHIFT_FRW_COL, mm4); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
147 movq_r2r(mm0, mm6); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
148 psubsw_r2r(mm1, mm2); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
149 movq_m2r(*(fdct_tg_all_16 + 4), mm1); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
150 psubsw_r2r(mm4, mm0); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
151 movq_m2r(*(in + offset + 3 * 8), mm7); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
152 pmulhw_r2r(mm0, mm1); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
153 paddsw_m2r(*(in + offset + 4 * 8), mm7); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
154 psllw_i2r(SHIFT_FRW_COL, mm5); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
155 paddsw_r2r(mm4, mm6); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
156 psllw_i2r(SHIFT_FRW_COL, mm7); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
157 movq_r2r(mm5, mm4); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
158 psubsw_r2r(mm7, mm5); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
159 paddsw_r2r(mm5, mm1); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
160 paddsw_r2r(mm7, mm4); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
161 por_m2r(fdct_one_corr, mm1); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
162 psllw_i2r(SHIFT_FRW_COL + 1, mm2); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
163 pmulhw_m2r(*(fdct_tg_all_16 + 4), mm5); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
164 movq_r2r(mm4, mm7); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
165 psubsw_m2r(*(in + offset + 5 * 8), mm3); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
166 psubsw_r2r(mm6, mm4); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
167 movq_r2m(mm1, *(out + offset + 2 * 8)); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
168 paddsw_r2r(mm6, mm7); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
169 movq_m2r(*(in + offset + 3 * 8), mm1); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
170 psllw_i2r(SHIFT_FRW_COL + 1, mm3); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
171 psubsw_m2r(*(in + offset + 4 * 8), mm1); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
172 movq_r2r(mm2, mm6); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
173 movq_r2m(mm4, *(out + offset + 4 * 8)); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
174 paddsw_r2r(mm3, mm2); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
175 pmulhw_m2r(*ocos_4_16, mm2); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
176 psubsw_r2r(mm3, mm6); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
177 pmulhw_m2r(*ocos_4_16, mm6); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
178 psubsw_r2r(mm0, mm5); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
179 por_m2r(fdct_one_corr, mm5); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
180 psllw_i2r(SHIFT_FRW_COL, mm1); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
181 por_m2r(fdct_one_corr, mm2); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
182 movq_r2r(mm1, mm4); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
183 movq_m2r(*(in + offset + 0 * 8), mm3); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
184 paddsw_r2r(mm6, mm1); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
185 psubsw_m2r(*(in + offset + 7 * 8), mm3); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
186 psubsw_r2r(mm6, mm4); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
187 movq_m2r(*(fdct_tg_all_16 + 0), mm0); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
188 psllw_i2r(SHIFT_FRW_COL, mm3); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
189 movq_m2r(*(fdct_tg_all_16 + 8), mm6); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
190 pmulhw_r2r(mm1, mm0); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
191 movq_r2m(mm7, *(out + offset + 0 * 8)); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
192 pmulhw_r2r(mm4, mm6); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
193 movq_r2m(mm5, *(out + offset + 6 * 8)); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
194 movq_r2r(mm3, mm7); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
195 movq_m2r(*(fdct_tg_all_16 + 8), mm5); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
196 psubsw_r2r(mm2, mm7); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
197 paddsw_r2r(mm2, mm3); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
198 pmulhw_r2r(mm7, mm5); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
199 paddsw_r2r(mm3, mm0); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
200 paddsw_r2r(mm4, mm6); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
201 pmulhw_m2r(*(fdct_tg_all_16 + 0), mm3); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
202 por_m2r(fdct_one_corr, mm0); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
203 paddsw_r2r(mm7, mm5); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
204 psubsw_r2r(mm6, mm7); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
205 movq_r2m(mm0, *(out + offset + 1 * 8)); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
206 paddsw_r2r(mm4, mm5); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
207 movq_r2m(mm7, *(out + offset + 3 * 8)); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
208 psubsw_r2r(mm1, mm3); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
209 movq_r2m(mm5, *(out + offset + 5 * 8)); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
210 movq_r2m(mm3, *(out + offset + 7 * 8)); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
211 } |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
212 |
1570 | 213 static always_inline void fdct_row_mmx2(const int16_t *in, int16_t *out, const int16_t *table) |
1564
b6b7d080f1a1
inline -> always_inline (842 -> 690 cpu cycles for dct_quantize() difference for the dct itself should be even bigger)
michael
parents:
839
diff
changeset
|
214 { |
1565 | 215 pshufw_m2r(*(in + 4), mm5, 0x1B); |
216 movq_m2r(*(in + 0), mm0); | |
1570 | 217 movq_r2r(mm0, mm1); |
218 paddsw_r2r(mm5, mm0); | |
219 psubsw_r2r(mm5, mm1); | |
220 pshufw_r2r(mm1, mm5, 0x88); | |
221 pshufw_r2r(mm1, mm6, 0xDD); | |
222 pshufw_r2r(mm0, mm1, 0xDD); | |
223 pshufw_r2r(mm0, mm0, 0x88); | |
224 movq_m2r(*(table + 0), mm3); | |
225 movq_m2r(*(table + 4), mm4); | |
226 movq_m2r(*(table + 16), mm2); | |
227 movq_m2r(*(table + 20), mm7); | |
228 pmaddwd_r2r(mm0, mm3); | |
229 pmaddwd_r2r(mm1, mm4); | |
230 pmaddwd_r2r(mm5, mm2); | |
231 pmaddwd_r2r(mm6, mm7); | |
232 pmaddwd_m2r(*(table + 8), mm0); | |
233 pmaddwd_m2r(*(table + 12), mm1); | |
234 pmaddwd_m2r(*(table + 24), mm5); | |
235 pmaddwd_m2r(*(table + 28), mm6); | |
1574 | 236 paddd_r2r(mm4, mm3); |
237 paddd_r2r(mm7, mm2); | |
1570 | 238 paddd_r2r(mm1, mm0); |
239 paddd_r2r(mm6, mm5); | |
240 movq_m2r(*fdct_r_row, mm7); | |
241 paddd_r2r(mm7, mm3); | |
242 paddd_r2r(mm7, mm0); | |
243 paddd_r2r(mm7, mm2); | |
244 paddd_r2r(mm7, mm5); | |
245 psrad_i2r(SHIFT_FRW_ROW, mm3); | |
246 psrad_i2r(SHIFT_FRW_ROW, mm2); | |
247 psrad_i2r(SHIFT_FRW_ROW, mm0); | |
248 psrad_i2r(SHIFT_FRW_ROW, mm5); | |
249 packssdw_r2r(mm0, mm3); | |
250 packssdw_r2r(mm5, mm2); | |
251 movq_r2r(mm3, mm6); | |
252 punpcklwd_r2r(mm2, mm3); | |
253 punpckhwd_r2r(mm2, mm6); | |
254 movq_r2m(mm3, *(out + 0)); | |
255 movq_r2m(mm6, *(out + 4)); | |
256 } | |
257 | |
258 static always_inline void fdct_row_mmx(const int16_t *in, int16_t *out, const int16_t *table) | |
259 { | |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
260 movd_m2r(*(in + 6), mm5); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
261 punpcklwd_m2r(*(in + 4), mm5); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
262 movq_r2r(mm5, mm2); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
263 psrlq_i2r(0x20, mm5); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
264 movq_m2r(*(in + 0), mm0); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
265 punpcklwd_r2r(mm2, mm5); |
1564
b6b7d080f1a1
inline -> always_inline (842 -> 690 cpu cycles for dct_quantize() difference for the dct itself should be even bigger)
michael
parents:
839
diff
changeset
|
266 movq_r2r(mm0, mm1); |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
267 paddsw_r2r(mm5, mm0); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
268 psubsw_r2r(mm5, mm1); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
269 movq_r2r(mm0, mm2); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
270 punpcklwd_r2r(mm1, mm0); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
271 punpckhwd_r2r(mm1, mm2); |
1570 | 272 movq_r2r(mm0, mm1); |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
273 movq_m2r(*(table + 0), mm3); |
1570 | 274 punpcklwd_r2r(mm2, mm0); |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
275 movq_r2r(mm0, mm5); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
276 punpckldq_r2r(mm0, mm0); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
277 movq_m2r(*(table + 4), mm4); |
1570 | 278 punpckhwd_r2r(mm2, mm1); |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
279 pmaddwd_r2r(mm0, mm3); |
1570 | 280 movq_r2r(mm1, mm6); |
281 movq_m2r(*(table + 16), mm2); | |
282 punpckldq_r2r(mm1, mm1); | |
283 pmaddwd_r2r(mm1, mm4); | |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
284 punpckhdq_r2r(mm5, mm5); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
285 pmaddwd_m2r(*(table + 8), mm0); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
286 punpckhdq_r2r(mm6, mm6); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
287 movq_m2r(*(table + 20), mm7); |
1570 | 288 pmaddwd_r2r(mm5, mm2); |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
289 paddd_m2r(*fdct_r_row, mm3); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
290 pmaddwd_r2r(mm6, mm7); |
1570 | 291 pmaddwd_m2r(*(table + 12), mm1); |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
292 paddd_r2r(mm4, mm3); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
293 pmaddwd_m2r(*(table + 24), mm5); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
294 pmaddwd_m2r(*(table + 28), mm6); |
1570 | 295 paddd_r2r(mm7, mm2); |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
296 paddd_m2r(*fdct_r_row, mm0); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
297 psrad_i2r(SHIFT_FRW_ROW, mm3); |
1570 | 298 paddd_m2r(*fdct_r_row, mm2); |
299 paddd_r2r(mm1, mm0); | |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
300 paddd_m2r(*fdct_r_row, mm5); |
1570 | 301 psrad_i2r(SHIFT_FRW_ROW, mm2); |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
302 paddd_r2r(mm6, mm5); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
303 psrad_i2r(SHIFT_FRW_ROW, mm0); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
304 psrad_i2r(SHIFT_FRW_ROW, mm5); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
305 packssdw_r2r(mm0, mm3); |
1570 | 306 packssdw_r2r(mm5, mm2); |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
307 movq_r2r(mm3, mm6); |
1570 | 308 punpcklwd_r2r(mm2, mm3); |
309 punpckhwd_r2r(mm2, mm6); | |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
310 movq_r2m(mm3, *(out + 0)); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
311 movq_r2m(mm6, *(out + 4)); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
312 } |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
313 |
687
9abb13c21fbe
fdct_mmx -> ff_fdct_mmx (renamed to avoid namespace conflict with xvid)
arpi_esp
parents:
635
diff
changeset
|
314 void ff_fdct_mmx(int16_t *block) |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
315 { |
839 | 316 int64_t align_tmp[16] ATTR_ALIGN(8); |
317 int16_t * const block_tmp= (int16_t*)align_tmp; | |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
318 int16_t *block1, *out; |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
319 const int16_t *table; |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
320 int i; |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
321 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
322 block1 = block_tmp; |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
323 fdct_col(block, block1, 0); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
324 fdct_col(block, block1, 4); |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
325 |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
326 block1 = block_tmp; |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
327 table = tab_frw_01234567; |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
328 out = block; |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
329 for(i=8;i>0;i--) { |
1570 | 330 fdct_row_mmx(block1, out, table); |
72
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
331 block1 += 8; |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
332 table += 32; |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
333 out += 8; |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
334 } |
3049d6d452a3
suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff
changeset
|
335 } |
1565 | 336 |
337 void ff_fdct_mmx2(int16_t *block) | |
338 { | |
339 int64_t align_tmp[16] ATTR_ALIGN(8); | |
340 int16_t * const block_tmp= (int16_t*)align_tmp; | |
341 int16_t *block1, *out; | |
342 const int16_t *table; | |
343 int i; | |
344 | |
345 block1 = block_tmp; | |
346 fdct_col(block, block1, 0); | |
347 fdct_col(block, block1, 4); | |
348 | |
349 block1 = block_tmp; | |
350 table = tab_frw_01234567; | |
351 out = block; | |
352 for(i=8;i>0;i--) { | |
1570 | 353 fdct_row_mmx2(block1, out, table); |
1565 | 354 block1 += 8; |
355 table += 32; | |
356 out += 8; | |
357 } | |
358 } |