Mercurial > libavcodec.hg
diff i386/mpegvideo_mmx.c @ 220:0b234715e205 libavcodec
(commit by michael)
mmx & mmx2 quantizer
c dct permutation bugfix
dont copy input on intra only encodings if it can be avoided
dont draw edges on intra only stuff
author | arpi_esp |
---|---|
date | Sun, 27 Jan 2002 13:30:18 +0000 |
parents | 994aa8623443 |
children | 56ee684c48bb |
line wrap: on
line diff
--- a/i386/mpegvideo_mmx.c Sat Jan 26 00:22:25 2002 +0000 +++ b/i386/mpegvideo_mmx.c Sun Jan 27 13:30:18 2002 +0000 @@ -22,9 +22,16 @@ #include "../dsputil.h" #include "../mpegvideo.h" +#include "../avcodec.h" +#include "../mangle.h" extern UINT8 zigzag_end[64]; extern void (*draw_edges)(UINT8 *buf, int wrap, int width, int height, int w); +extern int (*dct_quantize)(MpegEncContext *s, DCTELEM *block, int n, int qscale); + +extern UINT8 zigzag_direct_noperm[64]; +extern UINT16 inv_zigzag_direct16[64]; +extern UINT32 inverse[256]; #if 0 @@ -252,7 +259,7 @@ } } else { i = 0; - unquant_even: +// unquant_even: quant_matrix = s->non_intra_matrix; /* Align on 4 elements boundary */ while(i&7) @@ -411,6 +418,20 @@ } } +static volatile int esp_temp; + +void unused_var_warning_killer(){ + esp_temp++; +} + +#undef HAVE_MMX2 +#define RENAME(a) a ## _MMX +#include "mpegvideo_mmx_template.c" + +#define HAVE_MMX2 +#undef RENAME +#define RENAME(a) a ## _MMX2 +#include "mpegvideo_mmx_template.c" void MPV_common_init_mmx(MpegEncContext *s) { @@ -421,5 +442,11 @@ s->dct_unquantize = dct_unquantize_mpeg1_mmx; draw_edges = draw_edges_mmx; + + if(mm_flags & MM_MMXEXT){ + dct_quantize= dct_quantize_MMX2; + }else{ + dct_quantize= dct_quantize_MMX; + } } }