38 qmul_u.
i = qscale << 1;
46 qadd_u.
i = (qscale-1) | 1;
55 nCoeffs =
s->intra_scantable.raster_end[
s->block_last_index[n]];
58 "pxor %[ftmp0], %[ftmp0], %[ftmp0] \n\t"
59 "packsswh %[qmul], %[qmul], %[qmul] \n\t"
60 "packsswh %[qmul], %[qmul], %[qmul] \n\t"
61 "packsswh %[qadd], %[qadd], %[qadd] \n\t"
62 "packsswh %[qadd], %[qadd], %[qadd] \n\t"
63 "psubh %[ftmp0], %[ftmp0], %[qadd] \n\t"
64 "pxor %[ftmp5], %[ftmp5], %[ftmp5] \n\t"
68 PTR_ADDU "%[addr0], %[block], %[nCoeffs] \n\t"
69 MMI_LDC1(%[ftmp1], %[addr0], 0x00)
70 MMI_LDC1(%[ftmp2], %[addr0], 0x08)
71 "mov.d %[ftmp3], %[ftmp1] \n\t"
72 "mov.d %[ftmp4], %[ftmp2] \n\t"
73 "pmullh %[ftmp1], %[ftmp1], %[qmul] \n\t"
74 "pmullh %[ftmp2], %[ftmp2], %[qmul] \n\t"
75 "pcmpgth %[ftmp3], %[ftmp3], %[ftmp5] \n\t"
76 "pcmpgth %[ftmp4], %[ftmp4], %[ftmp5] \n\t"
77 "pxor %[ftmp1], %[ftmp1], %[ftmp3] \n\t"
78 "pxor %[ftmp2], %[ftmp2], %[ftmp4] \n\t"
79 "paddh %[ftmp1], %[ftmp1], %[ftmp0] \n\t"
80 "paddh %[ftmp2], %[ftmp2], %[ftmp0] \n\t"
81 "pxor %[ftmp3], %[ftmp3], %[ftmp1] \n\t"
82 "pxor %[ftmp4], %[ftmp4], %[ftmp2] \n\t"
83 "pcmpeqh %[ftmp1], %[ftmp1], %[ftmp0] \n\t"
84 "pcmpeqh %[ftmp2], %[ftmp2], %[ftmp0] \n\t"
85 "pandn %[ftmp1], %[ftmp1], %[ftmp3] \n\t"
86 "pandn %[ftmp2], %[ftmp2], %[ftmp4] \n\t"
87 PTR_ADDIU "%[nCoeffs], %[nCoeffs], 0x10 \n\t"
88 MMI_SDC1(%[ftmp1], %[addr0], 0x00)
89 MMI_SDC1(%[ftmp2], %[addr0], 0x08)
90 "blez %[nCoeffs], 1b \n\t"
91 : [ftmp0]
"=&f"(ftmp[0]), [ftmp1]
"=&f"(ftmp[1]),
92 [ftmp2]
"=&f"(ftmp[2]), [ftmp3]
"=&f"(ftmp[3]),
93 [ftmp4]
"=&f"(ftmp[4]), [ftmp5]
"=&f"(ftmp[5]),
97 [nCoeffs]
"r"((
mips_reg)(2*(-nCoeffs))),
98 [qmul]
"f"(qmul_u.
f), [qadd]
"f"(qadd_u.
f)
114 qmul_u.
i = qscale << 1;
115 qadd_u.
i = (qscale - 1) | 1;
117 nCoeffs =
s->inter_scantable.raster_end[
s->block_last_index[n]];
120 "packsswh %[qmul], %[qmul], %[qmul] \n\t"
121 "packsswh %[qmul], %[qmul], %[qmul] \n\t"
122 "pxor %[ftmp0], %[ftmp0], %[ftmp0] \n\t"
123 "packsswh %[qadd], %[qadd], %[qadd] \n\t"
124 "packsswh %[qadd], %[qadd], %[qadd] \n\t"
125 "psubh %[ftmp0], %[ftmp0], %[qadd] \n\t"
126 "pxor %[ftmp5], %[ftmp5], %[ftmp5] \n\t"
129 PTR_ADDU "%[addr0], %[block], %[nCoeffs] \n\t"
130 MMI_LDC1(%[ftmp1], %[addr0], 0x00)
131 MMI_LDC1(%[ftmp2], %[addr0], 0x08)
132 "mov.d %[ftmp3], %[ftmp1] \n\t"
133 "mov.d %[ftmp4], %[ftmp2] \n\t"
134 "pmullh %[ftmp1], %[ftmp1], %[qmul] \n\t"
135 "pmullh %[ftmp2], %[ftmp2], %[qmul] \n\t"
136 "pcmpgth %[ftmp3], %[ftmp3], %[ftmp5] \n\t"
137 "pcmpgth %[ftmp4], %[ftmp4], %[ftmp5] \n\t"
138 "pxor %[ftmp1], %[ftmp1], %[ftmp3] \n\t"
139 "pxor %[ftmp2], %[ftmp2], %[ftmp4] \n\t"
140 "paddh %[ftmp1], %[ftmp1], %[ftmp0] \n\t"
141 "paddh %[ftmp2], %[ftmp2], %[ftmp0] \n\t"
142 "pxor %[ftmp3], %[ftmp3], %[ftmp1] \n\t"
143 "pxor %[ftmp4], %[ftmp4], %[ftmp2] \n\t"
144 "pcmpeqh %[ftmp1], %[ftmp1], %[ftmp0] \n\t"
145 "pcmpeqh %[ftmp2], %[ftmp2], %[ftmp0] \n\t"
146 "pandn %[ftmp1], %[ftmp1], %[ftmp3] \n\t"
147 "pandn %[ftmp2], %[ftmp2], %[ftmp4] \n\t"
148 PTR_ADDIU "%[nCoeffs], %[nCoeffs], 0x10 \n\t"
149 MMI_SDC1(%[ftmp1], %[addr0], 0x00)
150 MMI_SDC1(%[ftmp2], %[addr0], 0x08)
151 "blez %[nCoeffs], 1b \n\t"
152 : [ftmp0]
"=&f"(ftmp[0]), [ftmp1]
"=&f"(ftmp[1]),
153 [ftmp2]
"=&f"(ftmp[2]), [ftmp3]
"=&f"(ftmp[3]),
154 [ftmp4]
"=&f"(ftmp[4]), [ftmp5]
"=&f"(ftmp[5]),
156 [addr0]
"=&r"(addr[0])
158 [nCoeffs]
"r"((
mips_reg)(2*(-nCoeffs))),
159 [qmul]
"f"(qmul_u.
f), [qadd]
"f"(qadd_u.
f)
168 const uint16_t *quant_matrix;
177 nCoeffs =
s->intra_scantable.raster_end[
s->block_last_index[n]] + 1;
180 block0 =
block[0] *
s->y_dc_scale;
182 block0 =
block[0] *
s->c_dc_scale;
185 quant_matrix =
s->intra_matrix;
188 "dli %[tmp0], 0x0f \n\t"
189 "pcmpeqh %[ftmp0], %[ftmp0], %[ftmp0] \n\t"
190 "dmtc1 %[tmp0], %[ftmp4] \n\t"
191 "dmtc1 %[qscale], %[ftmp1] \n\t"
192 "psrlh %[ftmp0], %[ftmp0], %[ftmp4] \n\t"
193 "packsswh %[ftmp1], %[ftmp1], %[ftmp1] \n\t"
194 "packsswh %[ftmp1], %[ftmp1], %[ftmp1] \n\t"
195 "or %[addr0], %[nCoeffs], $0 \n\t"
199 MMI_LDXC1(%[ftmp2], %[addr0], %[
block], 0x00)
200 MMI_LDXC1(%[ftmp3], %[addr0], %[
block], 0x08)
201 "mov.d %[ftmp4], %[ftmp2] \n\t"
202 "mov.d %[ftmp5], %[ftmp3] \n\t"
203 MMI_LDXC1(%[ftmp6], %[addr0], %[
quant], 0x00)
204 MMI_LDXC1(%[ftmp7], %[addr0], %[
quant], 0x08)
205 "pmullh %[ftmp6], %[ftmp6], %[ftmp1] \n\t"
206 "pmullh %[ftmp7], %[ftmp7], %[ftmp1] \n\t"
207 "pxor %[ftmp8], %[ftmp8], %[ftmp8] \n\t"
208 "pxor %[ftmp9], %[ftmp9], %[ftmp9] \n\t"
209 "pcmpgth %[ftmp8], %[ftmp8], %[ftmp2] \n\t"
210 "pcmpgth %[ftmp9], %[ftmp9], %[ftmp3] \n\t"
211 "pxor %[ftmp2], %[ftmp2], %[ftmp8] \n\t"
212 "pxor %[ftmp3], %[ftmp3], %[ftmp9] \n\t"
213 "psubh %[ftmp2], %[ftmp2], %[ftmp8] \n\t"
214 "psubh %[ftmp3], %[ftmp3], %[ftmp9] \n\t"
215 "pmullh %[ftmp2], %[ftmp2], %[ftmp6] \n\t"
216 "pmullh %[ftmp3], %[ftmp3], %[ftmp7] \n\t"
217 "pxor %[ftmp6], %[ftmp6], %[ftmp6] \n\t"
218 "pxor %[ftmp7], %[ftmp7], %[ftmp7] \n\t"
219 "pcmpeqh %[ftmp6], %[ftmp6], %[ftmp4] \n\t"
220 "dli %[tmp0], 0x03 \n\t"
221 "pcmpeqh %[ftmp7], %[ftmp7], %[ftmp5] \n\t"
222 "dmtc1 %[tmp0], %[ftmp4] \n\t"
223 "psrah %[ftmp2], %[ftmp2], %[ftmp4] \n\t"
224 "psrah %[ftmp3], %[ftmp3], %[ftmp4] \n\t"
225 "psubh %[ftmp2], %[ftmp2], %[ftmp0] \n\t"
226 "psubh %[ftmp3], %[ftmp3], %[ftmp0] \n\t"
227 "por %[ftmp2], %[ftmp2], %[ftmp0] \n\t"
228 "por %[ftmp3], %[ftmp3], %[ftmp0] \n\t"
229 "pxor %[ftmp2], %[ftmp2], %[ftmp8] \n\t"
230 "pxor %[ftmp3], %[ftmp3], %[ftmp9] \n\t"
231 "psubh %[ftmp2], %[ftmp2], %[ftmp8] \n\t"
232 "psubh %[ftmp3], %[ftmp3], %[ftmp9] \n\t"
233 "pandn %[ftmp6], %[ftmp6], %[ftmp2] \n\t"
234 "pandn %[ftmp7], %[ftmp7], %[ftmp3] \n\t"
235 MMI_SDXC1(%[ftmp6], %[addr0], %[
block], 0x00)
236 MMI_SDXC1(%[ftmp7], %[addr0], %[
block], 0x08)
237 PTR_ADDIU "%[addr0], %[addr0], 0x10 \n\t"
238 "bltz %[addr0], 1b \n\t"
239 : [ftmp0]
"=&f"(ftmp[0]), [ftmp1]
"=&f"(ftmp[1]),
240 [ftmp2]
"=&f"(ftmp[2]), [ftmp3]
"=&f"(ftmp[3]),
241 [ftmp4]
"=&f"(ftmp[4]), [ftmp5]
"=&f"(ftmp[5]),
242 [ftmp6]
"=&f"(ftmp[6]), [ftmp7]
"=&f"(ftmp[7]),
243 [ftmp8]
"=&f"(ftmp[8]), [ftmp9]
"=&f"(ftmp[9]),
247 [addr0]
"=&r"(addr[0])
250 [nCoeffs]
"r"((
mips_reg)(2*(-nCoeffs))),
262 const uint16_t *quant_matrix;
270 nCoeffs =
s->intra_scantable.raster_end[
s->block_last_index[n]] + 1;
271 quant_matrix =
s->inter_matrix;
274 "dli %[tmp0], 0x0f \n\t"
275 "pcmpeqh %[ftmp0], %[ftmp0], %[ftmp0] \n\t"
276 "dmtc1 %[tmp0], %[ftmp4] \n\t"
277 "dmtc1 %[qscale], %[ftmp1] \n\t"
278 "psrlh %[ftmp0], %[ftmp0], %[ftmp4] \n\t"
279 "packsswh %[ftmp1], %[ftmp1], %[ftmp1] \n\t"
280 "packsswh %[ftmp1], %[ftmp1], %[ftmp1] \n\t"
281 "or %[addr0], %[nCoeffs], $0 \n\t"
285 MMI_LDXC1(%[ftmp2], %[addr0], %[
block], 0x00)
286 MMI_LDXC1(%[ftmp3], %[addr0], %[
block], 0x08)
287 "mov.d %[ftmp4], %[ftmp2] \n\t"
288 "mov.d %[ftmp5], %[ftmp3] \n\t"
289 MMI_LDXC1(%[ftmp6], %[addr0], %[
quant], 0x00)
290 MMI_LDXC1(%[ftmp7], %[addr0], %[
quant], 0x08)
291 "pmullh %[ftmp6], %[ftmp6], %[ftmp1] \n\t"
292 "pmullh %[ftmp7], %[ftmp7], %[ftmp1] \n\t"
293 "pxor %[ftmp8], %[ftmp8], %[ftmp8] \n\t"
294 "pxor %[ftmp9], %[ftmp9], %[ftmp9] \n\t"
295 "pcmpgth %[ftmp8], %[ftmp8], %[ftmp2] \n\t"
296 "pcmpgth %[ftmp9], %[ftmp9], %[ftmp3] \n\t"
297 "pxor %[ftmp2], %[ftmp2], %[ftmp8] \n\t"
298 "pxor %[ftmp3], %[ftmp3], %[ftmp9] \n\t"
299 "psubh %[ftmp2], %[ftmp2], %[ftmp8] \n\t"
300 "psubh %[ftmp3], %[ftmp3], %[ftmp9] \n\t"
301 "paddh %[ftmp2], %[ftmp2], %[ftmp2] \n\t"
302 "paddh %[ftmp3], %[ftmp3], %[ftmp3] \n\t"
303 "paddh %[ftmp2], %[ftmp2], %[ftmp0] \n\t"
304 "paddh %[ftmp3], %[ftmp3], %[ftmp0] \n\t"
305 "pmullh %[ftmp2], %[ftmp2], %[ftmp6] \n\t"
306 "pmullh %[ftmp3], %[ftmp3], %[ftmp7] \n\t"
307 "pxor %[ftmp6], %[ftmp6], %[ftmp6] \n\t"
308 "pxor %[ftmp7], %[ftmp7], %[ftmp7] \n\t"
309 "pcmpeqh %[ftmp6], %[ftmp6], %[ftmp4] \n\t"
310 "dli %[tmp0], 0x04 \n\t"
311 "pcmpeqh %[ftmp7], %[ftmp7], %[ftmp5] \n\t"
312 "dmtc1 %[tmp0], %[ftmp4] \n\t"
313 "psrah %[ftmp2], %[ftmp2], %[ftmp4] \n\t"
314 "psrah %[ftmp3], %[ftmp3], %[ftmp4] \n\t"
315 "psubh %[ftmp2], %[ftmp2], %[ftmp0] \n\t"
316 "psubh %[ftmp3], %[ftmp3], %[ftmp0] \n\t"
317 "por %[ftmp2], %[ftmp2], %[ftmp0] \n\t"
318 "por %[ftmp3], %[ftmp3], %[ftmp0] \n\t"
319 "pxor %[ftmp2], %[ftmp2], %[ftmp8] \n\t"
320 "pxor %[ftmp3], %[ftmp3], %[ftmp9] \n\t"
321 "psubh %[ftmp2], %[ftmp2], %[ftmp8] \n\t"
322 "psubh %[ftmp3], %[ftmp3], %[ftmp9] \n\t"
323 "pandn %[ftmp6], %[ftmp6], %[ftmp2] \n\t"
324 "pandn %[ftmp7], %[ftmp7], %[ftmp3] \n\t"
325 MMI_SDXC1(%[ftmp6], %[addr0], %[
block], 0x00)
326 MMI_SDXC1(%[ftmp7], %[addr0], %[
block], 0x08)
327 PTR_ADDIU "%[addr0], %[addr0], 0x10 \n\t"
328 "bltz %[addr0], 1b \n\t"
329 : [ftmp0]
"=&f"(ftmp[0]), [ftmp1]
"=&f"(ftmp[1]),
330 [ftmp2]
"=&f"(ftmp[2]), [ftmp3]
"=&f"(ftmp[3]),
331 [ftmp4]
"=&f"(ftmp[4]), [ftmp5]
"=&f"(ftmp[5]),
332 [ftmp6]
"=&f"(ftmp[6]), [ftmp7]
"=&f"(ftmp[7]),
333 [ftmp8]
"=&f"(ftmp[8]), [ftmp9]
"=&f"(ftmp[9]),
337 [addr0]
"=&r"(addr[0])
340 [nCoeffs]
"r"((
mips_reg)(2*(-nCoeffs))),
350 const uint16_t *quant_matrix;
360 nCoeffs =
s->intra_scantable.raster_end[
s->block_last_index[n]];
363 block0 =
block[0] *
s->y_dc_scale;
365 block0 =
block[0] *
s->c_dc_scale;
367 quant_matrix =
s->intra_matrix;
370 "dli %[tmp0], 0x0f \n\t"
371 "pcmpeqh %[ftmp0], %[ftmp0], %[ftmp0] \n\t"
372 "mtc1 %[tmp0], %[ftmp3] \n\t"
373 "mtc1 %[qscale], %[ftmp9] \n\t"
374 "psrlh %[ftmp0], %[ftmp0], %[ftmp3] \n\t"
375 "packsswh %[ftmp9], %[ftmp9], %[ftmp9] \n\t"
376 "packsswh %[ftmp9], %[ftmp9], %[ftmp9] \n\t"
377 "or %[addr0], %[nCoeffs], $0 \n\t"
381 MMI_LDXC1(%[ftmp1], %[addr0], %[
block], 0x00)
382 MMI_LDXC1(%[ftmp2], %[addr0], %[
block], 0x08)
383 "mov.d %[ftmp3], %[ftmp1] \n\t"
384 "mov.d %[ftmp4], %[ftmp2] \n\t"
385 MMI_LDXC1(%[ftmp5], %[addr0], %[
quant], 0x00)
386 MMI_LDXC1(%[ftmp6], %[addr0], %[
quant], 0x08)
387 "pmullh %[ftmp5], %[ftmp5], %[ftmp9] \n\t"
388 "pmullh %[ftmp6], %[ftmp6], %[ftmp9] \n\t"
389 "pxor %[ftmp7], %[ftmp7], %[ftmp7] \n\t"
390 "pxor %[ftmp8], %[ftmp8], %[ftmp8] \n\t"
391 "pcmpgth %[ftmp7], %[ftmp7], %[ftmp1] \n\t"
392 "pcmpgth %[ftmp8], %[ftmp8], %[ftmp2] \n\t"
393 "pxor %[ftmp1], %[ftmp1], %[ftmp7] \n\t"
394 "pxor %[ftmp2], %[ftmp2], %[ftmp8] \n\t"
395 "psubh %[ftmp1], %[ftmp1], %[ftmp7] \n\t"
396 "psubh %[ftmp2], %[ftmp2], %[ftmp8] \n\t"
397 "pmullh %[ftmp1], %[ftmp1], %[ftmp5] \n\t"
398 "pmullh %[ftmp2], %[ftmp2], %[ftmp6] \n\t"
399 "pxor %[ftmp5], %[ftmp5], %[ftmp5] \n\t"
400 "pxor %[ftmp6], %[ftmp6], %[ftmp6] \n\t"
401 "pcmpeqh %[ftmp5], %[ftmp5], %[ftmp3] \n\t"
402 "dli %[tmp0], 0x03 \n\t"
403 "pcmpeqh %[ftmp6] , %[ftmp6], %[ftmp4] \n\t"
404 "mtc1 %[tmp0], %[ftmp3] \n\t"
405 "psrah %[ftmp1], %[ftmp1], %[ftmp3] \n\t"
406 "psrah %[ftmp2], %[ftmp2], %[ftmp3] \n\t"
407 "pxor %[ftmp1], %[ftmp1], %[ftmp7] \n\t"
408 "pxor %[ftmp2], %[ftmp2], %[ftmp8] \n\t"
409 "psubh %[ftmp1], %[ftmp1], %[ftmp7] \n\t"
410 "psubh %[ftmp2], %[ftmp2], %[ftmp8] \n\t"
411 "pandn %[ftmp5], %[ftmp5], %[ftmp1] \n\t"
412 "pandn %[ftmp6], %[ftmp6], %[ftmp2] \n\t"
413 MMI_SDXC1(%[ftmp5], %[addr0], %[
block], 0x00)
414 MMI_SDXC1(%[ftmp6], %[addr0], %[
block], 0x08)
415 PTR_ADDIU "%[addr0], %[addr0], 0x10 \n\t"
416 "blez %[addr0], 1b \n\t"
417 : [ftmp0]
"=&f"(ftmp[0]), [ftmp1]
"=&f"(ftmp[1]),
418 [ftmp2]
"=&f"(ftmp[2]), [ftmp3]
"=&f"(ftmp[3]),
419 [ftmp4]
"=&f"(ftmp[4]), [ftmp5]
"=&f"(ftmp[5]),
420 [ftmp6]
"=&f"(ftmp[6]), [ftmp7]
"=&f"(ftmp[7]),
421 [ftmp8]
"=&f"(ftmp[8]), [ftmp9]
"=&f"(ftmp[9]),
425 [addr0]
"=&r"(addr[0])
428 [nCoeffs]
"r"((
mips_reg)(2*(-nCoeffs))),
__asm__(".macro parse_r var r\n\t" "\\var = -1\n\t" _IFC_REG(0) _IFC_REG(1) _IFC_REG(2) _IFC_REG(3) _IFC_REG(4) _IFC_REG(5) _IFC_REG(6) _IFC_REG(7) _IFC_REG(8) _IFC_REG(9) _IFC_REG(10) _IFC_REG(11) _IFC_REG(12) _IFC_REG(13) _IFC_REG(14) _IFC_REG(15) _IFC_REG(16) _IFC_REG(17) _IFC_REG(18) _IFC_REG(19) _IFC_REG(20) _IFC_REG(21) _IFC_REG(22) _IFC_REG(23) _IFC_REG(24) _IFC_REG(25) _IFC_REG(26) _IFC_REG(27) _IFC_REG(28) _IFC_REG(29) _IFC_REG(30) _IFC_REG(31) ".iflt \\var\n\t" ".error \"Unable to parse register name \\r\"\n\t" ".endif\n\t" ".endm")
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
#define RESTRICT_ASM_ALL64
#define DECLARE_VAR_ADDRT
#define DECLARE_VAR_ALL64
#define RESTRICT_ASM_ADDRT
void ff_dct_unquantize_mpeg1_inter_mmi(const MPVContext *s, int16_t *block, int n, int qscale)
void ff_dct_unquantize_h263_inter_mmi(const MPVContext *s, int16_t *block, int n, int qscale)
void ff_dct_unquantize_h263_intra_mmi(const MPVContext *s, int16_t *block, int n, int qscale)
void ff_dct_unquantize_mpeg2_intra_mmi(const MPVContext *s, int16_t *block, int n, int qscale)
void ff_dct_unquantize_mpeg1_intra_mmi(const MPVContext *s, int16_t *block, int n, int qscale)
static const uint8_t quant[64]