Mercurial > libavcodec.hg
annotate i386/mpegvideo_mmx.c @ 1141:6d6003cf89c2 libavcodec
qmin/qmax cleanup
author | michaelni |
---|---|
date | Mon, 17 Mar 2003 11:02:33 +0000 |
parents | f59c3f66363b |
children | 362947395f5c |
rev | line source |
---|---|
8 | 1 /* |
2 * The simplest mpeg encoder (well, it was the simplest!) | |
429 | 3 * Copyright (c) 2000,2001 Fabrice Bellard. |
8 | 4 * |
429 | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Lesser General Public | |
7 * License as published by the Free Software Foundation; either | |
8 * version 2 of the License, or (at your option) any later version. | |
8 | 9 * |
429 | 10 * This library is distributed in the hope that it will be useful, |
8 | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
429 | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Lesser General Public License for more details. | |
8 | 14 * |
429 | 15 * You should have received a copy of the GNU Lesser General Public |
16 * License along with this library; if not, write to the Free Software | |
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
8 | 18 * |
19 * Optimized for ia32 cpus by Nick Kurshev <nickols_k@mail.ru> | |
325 | 20 * h263, mpeg1, mpeg2 dequantizer & draw_edges by Michael Niedermayer <michaelni@gmx.at> |
8 | 21 */ |
22 | |
14
8ceb13af9cb6
renamed - use of s->dct_unquantize function pointer - SHOULD add faster h263 mmx specific unquantization stuff
glantau
parents:
8
diff
changeset
|
23 #include "../dsputil.h" |
8ceb13af9cb6
renamed - use of s->dct_unquantize function pointer - SHOULD add faster h263 mmx specific unquantization stuff
glantau
parents:
8
diff
changeset
|
24 #include "../mpegvideo.h" |
220 | 25 #include "../avcodec.h" |
14
8ceb13af9cb6
renamed - use of s->dct_unquantize function pointer - SHOULD add faster h263 mmx specific unquantization stuff
glantau
parents:
8
diff
changeset
|
26 |
1064 | 27 extern uint8_t zigzag_direct_noperm[64]; |
28 extern uint16_t inv_zigzag_direct16[64]; | |
29 extern uint32_t inverse[256]; | |
200 | 30 |
8 | 31 static const unsigned long long int mm_wabs __attribute__ ((aligned(8))) = 0xffffffffffffffffULL; |
32 static const unsigned long long int mm_wone __attribute__ ((aligned(8))) = 0x0001000100010001ULL; | |
33 | |
145
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
34 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
35 static void dct_unquantize_h263_mmx(MpegEncContext *s, |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
36 DCTELEM *block, int n, int qscale) |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
37 { |
706
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
38 int level, qmul, qadd, nCoeffs; |
145
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
39 |
706
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
40 qmul = qscale << 1; |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
41 qadd = (qscale - 1) | 1; |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
42 |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
43 assert(s->block_last_index[n]>=0); |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
44 |
145
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
45 if (s->mb_intra) { |
249
42a0b7b16738
- Bug fixes in H.263+ Advanced INTRA Coding decoder.
pulento
parents:
248
diff
changeset
|
46 if (!s->h263_aic) { |
42a0b7b16738
- Bug fixes in H.263+ Advanced INTRA Coding decoder.
pulento
parents:
248
diff
changeset
|
47 if (n < 4) |
706
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
48 level = block[0] * s->y_dc_scale; |
249
42a0b7b16738
- Bug fixes in H.263+ Advanced INTRA Coding decoder.
pulento
parents:
248
diff
changeset
|
49 else |
706
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
50 level = block[0] * s->c_dc_scale; |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
51 }else{ |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
52 qadd = 0; |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
53 level= block[0]; |
249
42a0b7b16738
- Bug fixes in H.263+ Advanced INTRA Coding decoder.
pulento
parents:
248
diff
changeset
|
54 } |
706
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
55 nCoeffs=63; |
145
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
56 } else { |
855
df26acd21c84
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
768
diff
changeset
|
57 nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ]; |
df26acd21c84
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
768
diff
changeset
|
58 level = 0;/* keep gcc quiet */ |
145
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
59 } |
200 | 60 //printf("%d %d ", qmul, qadd); |
145
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
61 asm volatile( |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
62 "movd %1, %%mm6 \n\t" //qmul |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
63 "packssdw %%mm6, %%mm6 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
64 "packssdw %%mm6, %%mm6 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
65 "movd %2, %%mm5 \n\t" //qadd |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
66 "pxor %%mm7, %%mm7 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
67 "packssdw %%mm5, %%mm5 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
68 "packssdw %%mm5, %%mm5 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
69 "psubw %%mm5, %%mm7 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
70 "pxor %%mm4, %%mm4 \n\t" |
153 | 71 ".balign 16\n\t" |
145
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
72 "1: \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
73 "movq (%0, %3), %%mm0 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
74 "movq 8(%0, %3), %%mm1 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
75 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
76 "pmullw %%mm6, %%mm0 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
77 "pmullw %%mm6, %%mm1 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
78 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
79 "movq (%0, %3), %%mm2 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
80 "movq 8(%0, %3), %%mm3 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
81 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
82 "pcmpgtw %%mm4, %%mm2 \n\t" // block[i] < 0 ? -1 : 0 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
83 "pcmpgtw %%mm4, %%mm3 \n\t" // block[i] < 0 ? -1 : 0 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
84 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
85 "pxor %%mm2, %%mm0 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
86 "pxor %%mm3, %%mm1 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
87 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
88 "paddw %%mm7, %%mm0 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
89 "paddw %%mm7, %%mm1 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
90 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
91 "pxor %%mm0, %%mm2 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
92 "pxor %%mm1, %%mm3 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
93 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
94 "pcmpeqw %%mm7, %%mm0 \n\t" // block[i] == 0 ? -1 : 0 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
95 "pcmpeqw %%mm7, %%mm1 \n\t" // block[i] == 0 ? -1 : 0 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
96 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
97 "pandn %%mm2, %%mm0 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
98 "pandn %%mm3, %%mm1 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
99 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
100 "movq %%mm0, (%0, %3) \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
101 "movq %%mm1, 8(%0, %3) \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
102 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
103 "addl $16, %3 \n\t" |
706
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
104 "jng 1b \n\t" |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
105 ::"r" (block+nCoeffs), "g"(qmul), "g" (qadd), "r" (2*(-nCoeffs)) |
145
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
106 : "memory" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
107 ); |
706
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
108 if(s->mb_intra) |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
109 block[0]= level; |
145
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
110 } |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
111 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
112 |
8 | 113 /* |
114 NK: | |
115 Note: looking at PARANOID: | |
116 "enable all paranoid tests for rounding, overflows, etc..." | |
117 | |
118 #ifdef PARANOID | |
119 if (level < -2048 || level > 2047) | |
120 fprintf(stderr, "unquant error %d %d\n", i, level); | |
121 #endif | |
122 We can suppose that result of two multiplications can't be greate of 0xFFFF | |
123 i.e. is 16-bit, so we use here only PMULLW instruction and can avoid | |
124 a complex multiplication. | |
125 ===================================================== | |
126 Full formula for multiplication of 2 integer numbers | |
127 which are represent as high:low words: | |
128 input: value1 = high1:low1 | |
129 value2 = high2:low2 | |
130 output: value3 = value1*value2 | |
131 value3=high3:low3 (on overflow: modulus 2^32 wrap-around) | |
132 this mean that for 0x123456 * 0x123456 correct result is 0x766cb0ce4 | |
133 but this algorithm will compute only 0x66cb0ce4 | |
134 this limited by 16-bit size of operands | |
135 --------------------------------- | |
136 tlow1 = high1*low2 | |
137 tlow2 = high2*low1 | |
138 tlow1 = tlow1 + tlow2 | |
139 high3:low3 = low1*low2 | |
140 high3 += tlow1 | |
141 */ | |
14
8ceb13af9cb6
renamed - use of s->dct_unquantize function pointer - SHOULD add faster h263 mmx specific unquantization stuff
glantau
parents:
8
diff
changeset
|
142 static void dct_unquantize_mpeg1_mmx(MpegEncContext *s, |
8ceb13af9cb6
renamed - use of s->dct_unquantize function pointer - SHOULD add faster h263 mmx specific unquantization stuff
glantau
parents:
8
diff
changeset
|
143 DCTELEM *block, int n, int qscale) |
8 | 144 { |
325 | 145 int nCoeffs; |
1064 | 146 const uint16_t *quant_matrix; |
706
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
147 |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
148 assert(s->block_last_index[n]>=0); |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
149 |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
150 nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ]+1; |
200 | 151 |
8 | 152 if (s->mb_intra) { |
325 | 153 int block0; |
8 | 154 if (n < 4) |
325 | 155 block0 = block[0] * s->y_dc_scale; |
8 | 156 else |
325 | 157 block0 = block[0] * s->c_dc_scale; |
8 | 158 /* XXX: only mpeg1 */ |
159 quant_matrix = s->intra_matrix; | |
145
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
160 asm volatile( |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
161 "pcmpeqw %%mm7, %%mm7 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
162 "psrlw $15, %%mm7 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
163 "movd %2, %%mm6 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
164 "packssdw %%mm6, %%mm6 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
165 "packssdw %%mm6, %%mm6 \n\t" |
325 | 166 "movl %3, %%eax \n\t" |
153 | 167 ".balign 16\n\t" |
145
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
168 "1: \n\t" |
325 | 169 "movq (%0, %%eax), %%mm0 \n\t" |
170 "movq 8(%0, %%eax), %%mm1 \n\t" | |
171 "movq (%1, %%eax), %%mm4 \n\t" | |
172 "movq 8(%1, %%eax), %%mm5 \n\t" | |
173 "pmullw %%mm6, %%mm4 \n\t" // q=qscale*quant_matrix[i] | |
174 "pmullw %%mm6, %%mm5 \n\t" // q=qscale*quant_matrix[i] | |
175 "pxor %%mm2, %%mm2 \n\t" | |
176 "pxor %%mm3, %%mm3 \n\t" | |
177 "pcmpgtw %%mm0, %%mm2 \n\t" // block[i] < 0 ? -1 : 0 | |
178 "pcmpgtw %%mm1, %%mm3 \n\t" // block[i] < 0 ? -1 : 0 | |
179 "pxor %%mm2, %%mm0 \n\t" | |
180 "pxor %%mm3, %%mm1 \n\t" | |
181 "psubw %%mm2, %%mm0 \n\t" // abs(block[i]) | |
182 "psubw %%mm3, %%mm1 \n\t" // abs(block[i]) | |
183 "pmullw %%mm4, %%mm0 \n\t" // abs(block[i])*q | |
184 "pmullw %%mm5, %%mm1 \n\t" // abs(block[i])*q | |
185 "pxor %%mm4, %%mm4 \n\t" | |
186 "pxor %%mm5, %%mm5 \n\t" // FIXME slow | |
187 "pcmpeqw (%0, %%eax), %%mm4 \n\t" // block[i] == 0 ? -1 : 0 | |
188 "pcmpeqw 8(%0, %%eax), %%mm5 \n\t" // block[i] == 0 ? -1 : 0 | |
189 "psraw $3, %%mm0 \n\t" | |
190 "psraw $3, %%mm1 \n\t" | |
191 "psubw %%mm7, %%mm0 \n\t" | |
192 "psubw %%mm7, %%mm1 \n\t" | |
193 "por %%mm7, %%mm0 \n\t" | |
194 "por %%mm7, %%mm1 \n\t" | |
195 "pxor %%mm2, %%mm0 \n\t" | |
196 "pxor %%mm3, %%mm1 \n\t" | |
197 "psubw %%mm2, %%mm0 \n\t" | |
198 "psubw %%mm3, %%mm1 \n\t" | |
199 "pandn %%mm0, %%mm4 \n\t" | |
200 "pandn %%mm1, %%mm5 \n\t" | |
201 "movq %%mm4, (%0, %%eax) \n\t" | |
202 "movq %%mm5, 8(%0, %%eax) \n\t" | |
203 | |
204 "addl $16, %%eax \n\t" | |
205 "js 1b \n\t" | |
206 ::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "g" (qscale), "g" (-2*nCoeffs) | |
207 : "%eax", "memory" | |
208 ); | |
209 block[0]= block0; | |
210 | |
211 } else { | |
344 | 212 quant_matrix = s->inter_matrix; |
325 | 213 asm volatile( |
214 "pcmpeqw %%mm7, %%mm7 \n\t" | |
215 "psrlw $15, %%mm7 \n\t" | |
216 "movd %2, %%mm6 \n\t" | |
217 "packssdw %%mm6, %%mm6 \n\t" | |
218 "packssdw %%mm6, %%mm6 \n\t" | |
219 "movl %3, %%eax \n\t" | |
220 ".balign 16\n\t" | |
221 "1: \n\t" | |
222 "movq (%0, %%eax), %%mm0 \n\t" | |
223 "movq 8(%0, %%eax), %%mm1 \n\t" | |
224 "movq (%1, %%eax), %%mm4 \n\t" | |
225 "movq 8(%1, %%eax), %%mm5 \n\t" | |
145
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
226 "pmullw %%mm6, %%mm4 \n\t" // q=qscale*quant_matrix[i] |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
227 "pmullw %%mm6, %%mm5 \n\t" // q=qscale*quant_matrix[i] |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
228 "pxor %%mm2, %%mm2 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
229 "pxor %%mm3, %%mm3 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
230 "pcmpgtw %%mm0, %%mm2 \n\t" // block[i] < 0 ? -1 : 0 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
231 "pcmpgtw %%mm1, %%mm3 \n\t" // block[i] < 0 ? -1 : 0 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
232 "pxor %%mm2, %%mm0 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
233 "pxor %%mm3, %%mm1 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
234 "psubw %%mm2, %%mm0 \n\t" // abs(block[i]) |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
235 "psubw %%mm3, %%mm1 \n\t" // abs(block[i]) |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
236 "paddw %%mm0, %%mm0 \n\t" // abs(block[i])*2 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
237 "paddw %%mm1, %%mm1 \n\t" // abs(block[i])*2 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
238 "paddw %%mm7, %%mm0 \n\t" // abs(block[i])*2 + 1 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
239 "paddw %%mm7, %%mm1 \n\t" // abs(block[i])*2 + 1 |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
240 "pmullw %%mm4, %%mm0 \n\t" // (abs(block[i])*2 + 1)*q |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
241 "pmullw %%mm5, %%mm1 \n\t" // (abs(block[i])*2 + 1)*q |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
242 "pxor %%mm4, %%mm4 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
243 "pxor %%mm5, %%mm5 \n\t" // FIXME slow |
325 | 244 "pcmpeqw (%0, %%eax), %%mm4 \n\t" // block[i] == 0 ? -1 : 0 |
245 "pcmpeqw 8(%0, %%eax), %%mm5 \n\t" // block[i] == 0 ? -1 : 0 | |
145
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
246 "psraw $4, %%mm0 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
247 "psraw $4, %%mm1 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
248 "psubw %%mm7, %%mm0 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
249 "psubw %%mm7, %%mm1 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
250 "por %%mm7, %%mm0 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
251 "por %%mm7, %%mm1 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
252 "pxor %%mm2, %%mm0 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
253 "pxor %%mm3, %%mm1 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
254 "psubw %%mm2, %%mm0 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
255 "psubw %%mm3, %%mm1 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
256 "pandn %%mm0, %%mm4 \n\t" |
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
257 "pandn %%mm1, %%mm5 \n\t" |
325 | 258 "movq %%mm4, (%0, %%eax) \n\t" |
259 "movq %%mm5, 8(%0, %%eax) \n\t" | |
260 | |
261 "addl $16, %%eax \n\t" | |
262 "js 1b \n\t" | |
263 ::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "g" (qscale), "g" (-2*nCoeffs) | |
264 : "%eax", "memory" | |
265 ); | |
266 } | |
706
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
267 |
325 | 268 } |
269 | |
270 static void dct_unquantize_mpeg2_mmx(MpegEncContext *s, | |
271 DCTELEM *block, int n, int qscale) | |
272 { | |
273 int nCoeffs; | |
1064 | 274 const uint16_t *quant_matrix; |
325 | 275 |
706
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
276 assert(s->block_last_index[n]>=0); |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
277 |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
278 if(s->alternate_scan) nCoeffs= 63; //FIXME |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
279 else nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ]; |
325 | 280 |
281 if (s->mb_intra) { | |
282 int block0; | |
283 if (n < 4) | |
284 block0 = block[0] * s->y_dc_scale; | |
285 else | |
286 block0 = block[0] * s->c_dc_scale; | |
287 quant_matrix = s->intra_matrix; | |
288 asm volatile( | |
289 "pcmpeqw %%mm7, %%mm7 \n\t" | |
290 "psrlw $15, %%mm7 \n\t" | |
291 "movd %2, %%mm6 \n\t" | |
292 "packssdw %%mm6, %%mm6 \n\t" | |
293 "packssdw %%mm6, %%mm6 \n\t" | |
294 "movl %3, %%eax \n\t" | |
295 ".balign 16\n\t" | |
296 "1: \n\t" | |
297 "movq (%0, %%eax), %%mm0 \n\t" | |
298 "movq 8(%0, %%eax), %%mm1 \n\t" | |
299 "movq (%1, %%eax), %%mm4 \n\t" | |
300 "movq 8(%1, %%eax), %%mm5 \n\t" | |
301 "pmullw %%mm6, %%mm4 \n\t" // q=qscale*quant_matrix[i] | |
302 "pmullw %%mm6, %%mm5 \n\t" // q=qscale*quant_matrix[i] | |
303 "pxor %%mm2, %%mm2 \n\t" | |
304 "pxor %%mm3, %%mm3 \n\t" | |
305 "pcmpgtw %%mm0, %%mm2 \n\t" // block[i] < 0 ? -1 : 0 | |
306 "pcmpgtw %%mm1, %%mm3 \n\t" // block[i] < 0 ? -1 : 0 | |
307 "pxor %%mm2, %%mm0 \n\t" | |
308 "pxor %%mm3, %%mm1 \n\t" | |
309 "psubw %%mm2, %%mm0 \n\t" // abs(block[i]) | |
310 "psubw %%mm3, %%mm1 \n\t" // abs(block[i]) | |
311 "pmullw %%mm4, %%mm0 \n\t" // abs(block[i])*q | |
312 "pmullw %%mm5, %%mm1 \n\t" // abs(block[i])*q | |
313 "pxor %%mm4, %%mm4 \n\t" | |
314 "pxor %%mm5, %%mm5 \n\t" // FIXME slow | |
315 "pcmpeqw (%0, %%eax), %%mm4 \n\t" // block[i] == 0 ? -1 : 0 | |
316 "pcmpeqw 8(%0, %%eax), %%mm5 \n\t" // block[i] == 0 ? -1 : 0 | |
317 "psraw $3, %%mm0 \n\t" | |
318 "psraw $3, %%mm1 \n\t" | |
319 "pxor %%mm2, %%mm0 \n\t" | |
320 "pxor %%mm3, %%mm1 \n\t" | |
321 "psubw %%mm2, %%mm0 \n\t" | |
322 "psubw %%mm3, %%mm1 \n\t" | |
323 "pandn %%mm0, %%mm4 \n\t" | |
324 "pandn %%mm1, %%mm5 \n\t" | |
325 "movq %%mm4, (%0, %%eax) \n\t" | |
326 "movq %%mm5, 8(%0, %%eax) \n\t" | |
145
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
327 |
325 | 328 "addl $16, %%eax \n\t" |
706
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
329 "jng 1b \n\t" |
325 | 330 ::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "g" (qscale), "g" (-2*nCoeffs) |
331 : "%eax", "memory" | |
332 ); | |
333 block[0]= block0; | |
334 //Note, we dont do mismatch control for intra as errors cannot accumulate | |
335 | |
336 } else { | |
344 | 337 quant_matrix = s->inter_matrix; |
325 | 338 asm volatile( |
339 "pcmpeqw %%mm7, %%mm7 \n\t" | |
340 "psrlq $48, %%mm7 \n\t" | |
341 "movd %2, %%mm6 \n\t" | |
342 "packssdw %%mm6, %%mm6 \n\t" | |
343 "packssdw %%mm6, %%mm6 \n\t" | |
344 "movl %3, %%eax \n\t" | |
345 ".balign 16\n\t" | |
346 "1: \n\t" | |
347 "movq (%0, %%eax), %%mm0 \n\t" | |
348 "movq 8(%0, %%eax), %%mm1 \n\t" | |
349 "movq (%1, %%eax), %%mm4 \n\t" | |
350 "movq 8(%1, %%eax), %%mm5 \n\t" | |
351 "pmullw %%mm6, %%mm4 \n\t" // q=qscale*quant_matrix[i] | |
352 "pmullw %%mm6, %%mm5 \n\t" // q=qscale*quant_matrix[i] | |
353 "pxor %%mm2, %%mm2 \n\t" | |
354 "pxor %%mm3, %%mm3 \n\t" | |
355 "pcmpgtw %%mm0, %%mm2 \n\t" // block[i] < 0 ? -1 : 0 | |
356 "pcmpgtw %%mm1, %%mm3 \n\t" // block[i] < 0 ? -1 : 0 | |
357 "pxor %%mm2, %%mm0 \n\t" | |
358 "pxor %%mm3, %%mm1 \n\t" | |
359 "psubw %%mm2, %%mm0 \n\t" // abs(block[i]) | |
360 "psubw %%mm3, %%mm1 \n\t" // abs(block[i]) | |
361 "paddw %%mm0, %%mm0 \n\t" // abs(block[i])*2 | |
362 "paddw %%mm1, %%mm1 \n\t" // abs(block[i])*2 | |
363 "pmullw %%mm4, %%mm0 \n\t" // abs(block[i])*2*q | |
364 "pmullw %%mm5, %%mm1 \n\t" // abs(block[i])*2*q | |
365 "paddw %%mm4, %%mm0 \n\t" // (abs(block[i])*2 + 1)*q | |
366 "paddw %%mm5, %%mm1 \n\t" // (abs(block[i])*2 + 1)*q | |
367 "pxor %%mm4, %%mm4 \n\t" | |
368 "pxor %%mm5, %%mm5 \n\t" // FIXME slow | |
369 "pcmpeqw (%0, %%eax), %%mm4 \n\t" // block[i] == 0 ? -1 : 0 | |
370 "pcmpeqw 8(%0, %%eax), %%mm5 \n\t" // block[i] == 0 ? -1 : 0 | |
371 "psrlw $4, %%mm0 \n\t" | |
372 "psrlw $4, %%mm1 \n\t" | |
373 "pxor %%mm2, %%mm0 \n\t" | |
374 "pxor %%mm3, %%mm1 \n\t" | |
375 "psubw %%mm2, %%mm0 \n\t" | |
376 "psubw %%mm3, %%mm1 \n\t" | |
377 "pandn %%mm0, %%mm4 \n\t" | |
378 "pandn %%mm1, %%mm5 \n\t" | |
379 "pxor %%mm4, %%mm7 \n\t" | |
380 "pxor %%mm5, %%mm7 \n\t" | |
381 "movq %%mm4, (%0, %%eax) \n\t" | |
382 "movq %%mm5, 8(%0, %%eax) \n\t" | |
383 | |
384 "addl $16, %%eax \n\t" | |
706
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
385 "jng 1b \n\t" |
325 | 386 "movd 124(%0, %3), %%mm0 \n\t" |
387 "movq %%mm7, %%mm6 \n\t" | |
388 "psrlq $32, %%mm7 \n\t" | |
389 "pxor %%mm6, %%mm7 \n\t" | |
390 "movq %%mm7, %%mm6 \n\t" | |
391 "psrlq $16, %%mm7 \n\t" | |
392 "pxor %%mm6, %%mm7 \n\t" | |
393 "pslld $31, %%mm7 \n\t" | |
394 "psrlq $15, %%mm7 \n\t" | |
395 "pxor %%mm7, %%mm0 \n\t" | |
396 "movd %%mm0, 124(%0, %3) \n\t" | |
397 | |
398 ::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "g" (qscale), "r" (-2*nCoeffs) | |
399 : "%eax", "memory" | |
145
bd1adece8280
dct_unquantize_h263_mmx() by Michael Niedermayer <michaelni@gmx.at>
arpi_esp
parents:
14
diff
changeset
|
400 ); |
8 | 401 } |
402 } | |
403 | |
206 | 404 /* draw the edges of width 'w' of an image of size width, height |
405 this mmx version can only handle w==8 || w==16 */ | |
1064 | 406 static void draw_edges_mmx(uint8_t *buf, int wrap, int width, int height, int w) |
206 | 407 { |
1064 | 408 uint8_t *ptr, *last_line; |
206 | 409 int i; |
410 | |
411 last_line = buf + (height - 1) * wrap; | |
412 /* left and right */ | |
413 ptr = buf; | |
414 if(w==8) | |
415 { | |
416 asm volatile( | |
417 "1: \n\t" | |
418 "movd (%0), %%mm0 \n\t" | |
419 "punpcklbw %%mm0, %%mm0 \n\t" | |
420 "punpcklwd %%mm0, %%mm0 \n\t" | |
421 "punpckldq %%mm0, %%mm0 \n\t" | |
422 "movq %%mm0, -8(%0) \n\t" | |
423 "movq -8(%0, %2), %%mm1 \n\t" | |
424 "punpckhbw %%mm1, %%mm1 \n\t" | |
425 "punpckhwd %%mm1, %%mm1 \n\t" | |
426 "punpckhdq %%mm1, %%mm1 \n\t" | |
427 "movq %%mm1, (%0, %2) \n\t" | |
428 "addl %1, %0 \n\t" | |
429 "cmpl %3, %0 \n\t" | |
430 " jb 1b \n\t" | |
431 : "+r" (ptr) | |
432 : "r" (wrap), "r" (width), "r" (ptr + wrap*height) | |
433 ); | |
434 } | |
435 else | |
436 { | |
437 asm volatile( | |
438 "1: \n\t" | |
439 "movd (%0), %%mm0 \n\t" | |
440 "punpcklbw %%mm0, %%mm0 \n\t" | |
441 "punpcklwd %%mm0, %%mm0 \n\t" | |
442 "punpckldq %%mm0, %%mm0 \n\t" | |
443 "movq %%mm0, -8(%0) \n\t" | |
444 "movq %%mm0, -16(%0) \n\t" | |
445 "movq -8(%0, %2), %%mm1 \n\t" | |
446 "punpckhbw %%mm1, %%mm1 \n\t" | |
447 "punpckhwd %%mm1, %%mm1 \n\t" | |
448 "punpckhdq %%mm1, %%mm1 \n\t" | |
449 "movq %%mm1, (%0, %2) \n\t" | |
450 "movq %%mm1, 8(%0, %2) \n\t" | |
451 "addl %1, %0 \n\t" | |
452 "cmpl %3, %0 \n\t" | |
453 " jb 1b \n\t" | |
454 : "+r" (ptr) | |
455 : "r" (wrap), "r" (width), "r" (ptr + wrap*height) | |
456 ); | |
457 } | |
458 | |
459 for(i=0;i<w;i+=4) { | |
460 /* top and bottom (and hopefully also the corners) */ | |
461 ptr= buf - (i + 1) * wrap - w; | |
462 asm volatile( | |
463 "1: \n\t" | |
464 "movq (%1, %0), %%mm0 \n\t" | |
465 "movq %%mm0, (%0) \n\t" | |
466 "movq %%mm0, (%0, %2) \n\t" | |
467 "movq %%mm0, (%0, %2, 2) \n\t" | |
468 "movq %%mm0, (%0, %3) \n\t" | |
469 "addl $8, %0 \n\t" | |
470 "cmpl %4, %0 \n\t" | |
471 " jb 1b \n\t" | |
472 : "+r" (ptr) | |
473 : "r" ((int)buf - (int)ptr - w), "r" (-wrap), "r" (-wrap*3), "r" (ptr+width+2*w) | |
474 ); | |
475 ptr= last_line + (i + 1) * wrap - w; | |
476 asm volatile( | |
477 "1: \n\t" | |
478 "movq (%1, %0), %%mm0 \n\t" | |
479 "movq %%mm0, (%0) \n\t" | |
480 "movq %%mm0, (%0, %2) \n\t" | |
481 "movq %%mm0, (%0, %2, 2) \n\t" | |
482 "movq %%mm0, (%0, %3) \n\t" | |
483 "addl $8, %0 \n\t" | |
484 "cmpl %4, %0 \n\t" | |
485 " jb 1b \n\t" | |
486 : "+r" (ptr) | |
487 : "r" ((int)last_line - (int)ptr - w), "r" (wrap), "r" (wrap*3), "r" (ptr+width+2*w) | |
488 ); | |
489 } | |
490 } | |
491 | |
220 | 492 #undef HAVE_MMX2 |
493 #define RENAME(a) a ## _MMX | |
494 #include "mpegvideo_mmx_template.c" | |
495 | |
496 #define HAVE_MMX2 | |
497 #undef RENAME | |
498 #define RENAME(a) a ## _MMX2 | |
499 #include "mpegvideo_mmx_template.c" | |
206 | 500 |
14
8ceb13af9cb6
renamed - use of s->dct_unquantize function pointer - SHOULD add faster h263 mmx specific unquantization stuff
glantau
parents:
8
diff
changeset
|
501 void MPV_common_init_mmx(MpegEncContext *s) |
8 | 502 { |
14
8ceb13af9cb6
renamed - use of s->dct_unquantize function pointer - SHOULD add faster h263 mmx specific unquantization stuff
glantau
parents:
8
diff
changeset
|
503 if (mm_flags & MM_MMX) { |
706
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
504 const int dct_algo = s->avctx->dct_algo; |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
687
diff
changeset
|
505 |
325 | 506 s->dct_unquantize_h263 = dct_unquantize_h263_mmx; |
507 s->dct_unquantize_mpeg1 = dct_unquantize_mpeg1_mmx; | |
508 s->dct_unquantize_mpeg2 = dct_unquantize_mpeg2_mmx; | |
312 | 509 |
350
6ebbecc10063
- Advanced Intra Coding (AIC) support for H.263+ encoder, just DC by now.
pulento
parents:
344
diff
changeset
|
510 draw_edges = draw_edges_mmx; |
220 | 511 |
625
bb6a69f9d409
slow but accurate integer dct from IJG (should be ok with the LGPL as the old DCT is the fast integer DCT from IJG)
michaelni
parents:
620
diff
changeset
|
512 if(dct_algo==FF_DCT_AUTO || dct_algo==FF_DCT_MMX){ |
bb6a69f9d409
slow but accurate integer dct from IJG (should be ok with the LGPL as the old DCT is the fast integer DCT from IJG)
michaelni
parents:
620
diff
changeset
|
513 if(mm_flags & MM_MMXEXT){ |
bb6a69f9d409
slow but accurate integer dct from IJG (should be ok with the LGPL as the old DCT is the fast integer DCT from IJG)
michaelni
parents:
620
diff
changeset
|
514 s->dct_quantize= dct_quantize_MMX2; |
bb6a69f9d409
slow but accurate integer dct from IJG (should be ok with the LGPL as the old DCT is the fast integer DCT from IJG)
michaelni
parents:
620
diff
changeset
|
515 } else { |
bb6a69f9d409
slow but accurate integer dct from IJG (should be ok with the LGPL as the old DCT is the fast integer DCT from IJG)
michaelni
parents:
620
diff
changeset
|
516 s->dct_quantize= dct_quantize_MMX; |
bb6a69f9d409
slow but accurate integer dct from IJG (should be ok with the LGPL as the old DCT is the fast integer DCT from IJG)
michaelni
parents:
620
diff
changeset
|
517 } |
350
6ebbecc10063
- Advanced Intra Coding (AIC) support for H.263+ encoder, just DC by now.
pulento
parents:
344
diff
changeset
|
518 } |
14
8ceb13af9cb6
renamed - use of s->dct_unquantize function pointer - SHOULD add faster h263 mmx specific unquantization stuff
glantau
parents:
8
diff
changeset
|
519 } |
8 | 520 } |