Mercurial > libavcodec.hg
comparison i386/mpegvideo_mmx.c @ 1092:f59c3f66363b libavcodec
MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
bitexact cleanup
author | michaelni |
---|---|
date | Mon, 03 Mar 2003 14:54:00 +0000 |
parents | b32afefe7d33 |
children | 362947395f5c |
comparison
equal
deleted
inserted
replaced
1091:03df246fb06b | 1092:f59c3f66363b |
---|---|
21 */ | 21 */ |
22 | 22 |
23 #include "../dsputil.h" | 23 #include "../dsputil.h" |
24 #include "../mpegvideo.h" | 24 #include "../mpegvideo.h" |
25 #include "../avcodec.h" | 25 #include "../avcodec.h" |
26 #include "../simple_idct.h" | |
27 | 26 |
28 extern uint8_t zigzag_direct_noperm[64]; | 27 extern uint8_t zigzag_direct_noperm[64]; |
29 extern uint16_t inv_zigzag_direct16[64]; | 28 extern uint16_t inv_zigzag_direct16[64]; |
30 extern uint32_t inverse[256]; | 29 extern uint32_t inverse[256]; |
31 | 30 |
497 #define HAVE_MMX2 | 496 #define HAVE_MMX2 |
498 #undef RENAME | 497 #undef RENAME |
499 #define RENAME(a) a ## _MMX2 | 498 #define RENAME(a) a ## _MMX2 |
500 #include "mpegvideo_mmx_template.c" | 499 #include "mpegvideo_mmx_template.c" |
501 | 500 |
502 /* external functions, from idct_mmx.c */ | |
503 void ff_mmx_idct(DCTELEM *block); | |
504 void ff_mmxext_idct(DCTELEM *block); | |
505 | |
506 /* XXX: those functions should be suppressed ASAP when all IDCTs are | |
507 converted */ | |
508 static void ff_libmpeg2mmx_idct_put(uint8_t *dest, int line_size, DCTELEM *block) | |
509 { | |
510 ff_mmx_idct (block); | |
511 put_pixels_clamped_mmx(block, dest, line_size); | |
512 } | |
513 static void ff_libmpeg2mmx_idct_add(uint8_t *dest, int line_size, DCTELEM *block) | |
514 { | |
515 ff_mmx_idct (block); | |
516 add_pixels_clamped_mmx(block, dest, line_size); | |
517 } | |
518 static void ff_libmpeg2mmx2_idct_put(uint8_t *dest, int line_size, DCTELEM *block) | |
519 { | |
520 ff_mmxext_idct (block); | |
521 put_pixels_clamped_mmx(block, dest, line_size); | |
522 } | |
523 static void ff_libmpeg2mmx2_idct_add(uint8_t *dest, int line_size, DCTELEM *block) | |
524 { | |
525 ff_mmxext_idct (block); | |
526 add_pixels_clamped_mmx(block, dest, line_size); | |
527 } | |
528 | |
529 void MPV_common_init_mmx(MpegEncContext *s) | 501 void MPV_common_init_mmx(MpegEncContext *s) |
530 { | 502 { |
531 if (mm_flags & MM_MMX) { | 503 if (mm_flags & MM_MMX) { |
532 const int dct_algo = s->avctx->dct_algo; | 504 const int dct_algo = s->avctx->dct_algo; |
533 const int idct_algo= s->avctx->idct_algo; | |
534 | 505 |
535 s->dct_unquantize_h263 = dct_unquantize_h263_mmx; | 506 s->dct_unquantize_h263 = dct_unquantize_h263_mmx; |
536 s->dct_unquantize_mpeg1 = dct_unquantize_mpeg1_mmx; | 507 s->dct_unquantize_mpeg1 = dct_unquantize_mpeg1_mmx; |
537 s->dct_unquantize_mpeg2 = dct_unquantize_mpeg2_mmx; | 508 s->dct_unquantize_mpeg2 = dct_unquantize_mpeg2_mmx; |
538 | 509 |
539 draw_edges = draw_edges_mmx; | 510 draw_edges = draw_edges_mmx; |
540 | 511 |
541 if(dct_algo==FF_DCT_AUTO || dct_algo==FF_DCT_MMX){ | 512 if(dct_algo==FF_DCT_AUTO || dct_algo==FF_DCT_MMX){ |
542 s->fdct = ff_fdct_mmx; | |
543 | |
544 if(mm_flags & MM_MMXEXT){ | 513 if(mm_flags & MM_MMXEXT){ |
545 s->dct_quantize= dct_quantize_MMX2; | 514 s->dct_quantize= dct_quantize_MMX2; |
546 } else { | 515 } else { |
547 s->dct_quantize= dct_quantize_MMX; | 516 s->dct_quantize= dct_quantize_MMX; |
548 } | 517 } |
549 } | 518 } |
550 | |
551 if(idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_SIMPLEMMX){ | |
552 s->idct_put= ff_simple_idct_put_mmx; | |
553 s->idct_add= ff_simple_idct_add_mmx; | |
554 s->idct_permutation_type= FF_SIMPLE_IDCT_PERM; | |
555 }else if(idct_algo==FF_IDCT_LIBMPEG2MMX){ | |
556 if(mm_flags & MM_MMXEXT){ | |
557 s->idct_put= ff_libmpeg2mmx2_idct_put; | |
558 s->idct_add= ff_libmpeg2mmx2_idct_add; | |
559 }else{ | |
560 s->idct_put= ff_libmpeg2mmx_idct_put; | |
561 s->idct_add= ff_libmpeg2mmx_idct_add; | |
562 } | |
563 s->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM; | |
564 } | |
565 } | 519 } |
566 } | 520 } |