Mercurial > libavcodec.hg
comparison i386/mpegvideo_mmx.c @ 8031:eebc7209c47f libavcodec
Convert asm keyword into __asm__.
Neither the asm() nor the __asm__() keyword is part of the C99
standard, but while GCC accepts the former in C89 syntax, it is not
accepted in C99 unless GNU extensions are turned on (with -fasm). The
latter form is accepted in any syntax as an extension (without
requiring further command-line options).
Sun Studio C99 compiler also does not accept asm() while accepting
__asm__(), albeit reporting warnings that it's not valid C99 syntax.
author | flameeyes |
---|---|
date | Thu, 16 Oct 2008 13:34:09 +0000 |
parents | c4e4df98b703 |
children | 0d108ec85620 |
comparison
equal
deleted
inserted
replaced
8030:a512ac8fa540 | 8031:eebc7209c47f |
---|---|
53 if(s->ac_pred) | 53 if(s->ac_pred) |
54 nCoeffs=63; | 54 nCoeffs=63; |
55 else | 55 else |
56 nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ]; | 56 nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ]; |
57 //printf("%d %d ", qmul, qadd); | 57 //printf("%d %d ", qmul, qadd); |
58 asm volatile( | 58 __asm__ volatile( |
59 "movd %1, %%mm6 \n\t" //qmul | 59 "movd %1, %%mm6 \n\t" //qmul |
60 "packssdw %%mm6, %%mm6 \n\t" | 60 "packssdw %%mm6, %%mm6 \n\t" |
61 "packssdw %%mm6, %%mm6 \n\t" | 61 "packssdw %%mm6, %%mm6 \n\t" |
62 "movd %2, %%mm5 \n\t" //qadd | 62 "movd %2, %%mm5 \n\t" //qadd |
63 "pxor %%mm7, %%mm7 \n\t" | 63 "pxor %%mm7, %%mm7 \n\t" |
116 | 116 |
117 assert(s->block_last_index[n]>=0 || s->h263_aic); | 117 assert(s->block_last_index[n]>=0 || s->h263_aic); |
118 | 118 |
119 nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ]; | 119 nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ]; |
120 //printf("%d %d ", qmul, qadd); | 120 //printf("%d %d ", qmul, qadd); |
121 asm volatile( | 121 __asm__ volatile( |
122 "movd %1, %%mm6 \n\t" //qmul | 122 "movd %1, %%mm6 \n\t" //qmul |
123 "packssdw %%mm6, %%mm6 \n\t" | 123 "packssdw %%mm6, %%mm6 \n\t" |
124 "packssdw %%mm6, %%mm6 \n\t" | 124 "packssdw %%mm6, %%mm6 \n\t" |
125 "movd %2, %%mm5 \n\t" //qadd | 125 "movd %2, %%mm5 \n\t" //qadd |
126 "pxor %%mm7, %%mm7 \n\t" | 126 "pxor %%mm7, %%mm7 \n\t" |
212 block0 = block[0] * s->y_dc_scale; | 212 block0 = block[0] * s->y_dc_scale; |
213 else | 213 else |
214 block0 = block[0] * s->c_dc_scale; | 214 block0 = block[0] * s->c_dc_scale; |
215 /* XXX: only mpeg1 */ | 215 /* XXX: only mpeg1 */ |
216 quant_matrix = s->intra_matrix; | 216 quant_matrix = s->intra_matrix; |
217 asm volatile( | 217 __asm__ volatile( |
218 "pcmpeqw %%mm7, %%mm7 \n\t" | 218 "pcmpeqw %%mm7, %%mm7 \n\t" |
219 "psrlw $15, %%mm7 \n\t" | 219 "psrlw $15, %%mm7 \n\t" |
220 "movd %2, %%mm6 \n\t" | 220 "movd %2, %%mm6 \n\t" |
221 "packssdw %%mm6, %%mm6 \n\t" | 221 "packssdw %%mm6, %%mm6 \n\t" |
222 "packssdw %%mm6, %%mm6 \n\t" | 222 "packssdw %%mm6, %%mm6 \n\t" |
275 assert(s->block_last_index[n]>=0); | 275 assert(s->block_last_index[n]>=0); |
276 | 276 |
277 nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ]+1; | 277 nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ]+1; |
278 | 278 |
279 quant_matrix = s->inter_matrix; | 279 quant_matrix = s->inter_matrix; |
280 asm volatile( | 280 __asm__ volatile( |
281 "pcmpeqw %%mm7, %%mm7 \n\t" | 281 "pcmpeqw %%mm7, %%mm7 \n\t" |
282 "psrlw $15, %%mm7 \n\t" | 282 "psrlw $15, %%mm7 \n\t" |
283 "movd %2, %%mm6 \n\t" | 283 "movd %2, %%mm6 \n\t" |
284 "packssdw %%mm6, %%mm6 \n\t" | 284 "packssdw %%mm6, %%mm6 \n\t" |
285 "packssdw %%mm6, %%mm6 \n\t" | 285 "packssdw %%mm6, %%mm6 \n\t" |
347 if (n < 4) | 347 if (n < 4) |
348 block0 = block[0] * s->y_dc_scale; | 348 block0 = block[0] * s->y_dc_scale; |
349 else | 349 else |
350 block0 = block[0] * s->c_dc_scale; | 350 block0 = block[0] * s->c_dc_scale; |
351 quant_matrix = s->intra_matrix; | 351 quant_matrix = s->intra_matrix; |
352 asm volatile( | 352 __asm__ volatile( |
353 "pcmpeqw %%mm7, %%mm7 \n\t" | 353 "pcmpeqw %%mm7, %%mm7 \n\t" |
354 "psrlw $15, %%mm7 \n\t" | 354 "psrlw $15, %%mm7 \n\t" |
355 "movd %2, %%mm6 \n\t" | 355 "movd %2, %%mm6 \n\t" |
356 "packssdw %%mm6, %%mm6 \n\t" | 356 "packssdw %%mm6, %%mm6 \n\t" |
357 "packssdw %%mm6, %%mm6 \n\t" | 357 "packssdw %%mm6, %%mm6 \n\t" |
408 | 408 |
409 if(s->alternate_scan) nCoeffs= 63; //FIXME | 409 if(s->alternate_scan) nCoeffs= 63; //FIXME |
410 else nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ]; | 410 else nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ]; |
411 | 411 |
412 quant_matrix = s->inter_matrix; | 412 quant_matrix = s->inter_matrix; |
413 asm volatile( | 413 __asm__ volatile( |
414 "pcmpeqw %%mm7, %%mm7 \n\t" | 414 "pcmpeqw %%mm7, %%mm7 \n\t" |
415 "psrlq $48, %%mm7 \n\t" | 415 "psrlq $48, %%mm7 \n\t" |
416 "movd %2, %%mm6 \n\t" | 416 "movd %2, %%mm6 \n\t" |
417 "packssdw %%mm6, %%mm6 \n\t" | 417 "packssdw %%mm6, %%mm6 \n\t" |
418 "packssdw %%mm6, %%mm6 \n\t" | 418 "packssdw %%mm6, %%mm6 \n\t" |
480 int *sum= s->dct_error_sum[intra]; | 480 int *sum= s->dct_error_sum[intra]; |
481 uint16_t *offset= s->dct_offset[intra]; | 481 uint16_t *offset= s->dct_offset[intra]; |
482 | 482 |
483 s->dct_count[intra]++; | 483 s->dct_count[intra]++; |
484 | 484 |
485 asm volatile( | 485 __asm__ volatile( |
486 "pxor %%mm7, %%mm7 \n\t" | 486 "pxor %%mm7, %%mm7 \n\t" |
487 "1: \n\t" | 487 "1: \n\t" |
488 "pxor %%mm0, %%mm0 \n\t" | 488 "pxor %%mm0, %%mm0 \n\t" |
489 "pxor %%mm1, %%mm1 \n\t" | 489 "pxor %%mm1, %%mm1 \n\t" |
490 "movq (%0), %%mm2 \n\t" | 490 "movq (%0), %%mm2 \n\t" |
534 int *sum= s->dct_error_sum[intra]; | 534 int *sum= s->dct_error_sum[intra]; |
535 uint16_t *offset= s->dct_offset[intra]; | 535 uint16_t *offset= s->dct_offset[intra]; |
536 | 536 |
537 s->dct_count[intra]++; | 537 s->dct_count[intra]++; |
538 | 538 |
539 asm volatile( | 539 __asm__ volatile( |
540 "pxor %%xmm7, %%xmm7 \n\t" | 540 "pxor %%xmm7, %%xmm7 \n\t" |
541 "1: \n\t" | 541 "1: \n\t" |
542 "pxor %%xmm0, %%xmm0 \n\t" | 542 "pxor %%xmm0, %%xmm0 \n\t" |
543 "pxor %%xmm1, %%xmm1 \n\t" | 543 "pxor %%xmm1, %%xmm1 \n\t" |
544 "movdqa (%0), %%xmm2 \n\t" | 544 "movdqa (%0), %%xmm2 \n\t" |