提交 35b2a786 编写于 作者: F Fabrice Bellard

renamed - use of s->dct_unquantize function pointer - SHOULD add faster h263...

renamed - use of s->dct_unquantize function pointer - SHOULD add faster h263 mmx specific unquantization stuff


Originally committed as revision 23 to svn://svn.ffmpeg.org/ffmpeg/trunk
上级 21af69f7
...@@ -19,6 +19,14 @@ ...@@ -19,6 +19,14 @@
* Optimized for ia32 cpus by Nick Kurshev <nickols_k@mail.ru> * Optimized for ia32 cpus by Nick Kurshev <nickols_k@mail.ru>
*/ */
#include "../dsputil.h"
#include "../mpegvideo.h"
#if 0
/* XXX: GL: I don't understand why this function needs optimization
(it is called only once per frame!), so I disabled it */
void MPV_frame_start(MpegEncContext *s) void MPV_frame_start(MpegEncContext *s)
{ {
if (s->pict_type == B_TYPE) { if (s->pict_type == B_TYPE) {
...@@ -52,10 +60,8 @@ void MPV_frame_start(MpegEncContext *s) ...@@ -52,10 +60,8 @@ void MPV_frame_start(MpegEncContext *s)
:"eax","edx","ecx","memory"); :"eax","edx","ecx","memory");
} }
} }
#endif
static void dct_unquantize(MpegEncContext *s, DCTELEM *block, int n, int qscale);
#ifdef HAVE_MMX
static const unsigned long long int mm_wabs __attribute__ ((aligned(8))) = 0xffffffffffffffffULL; static const unsigned long long int mm_wabs __attribute__ ((aligned(8))) = 0xffffffffffffffffULL;
static const unsigned long long int mm_wone __attribute__ ((aligned(8))) = 0x0001000100010001ULL; static const unsigned long long int mm_wone __attribute__ ((aligned(8))) = 0x0001000100010001ULL;
...@@ -88,13 +94,8 @@ static const unsigned long long int mm_wone __attribute__ ((aligned(8))) = 0x000 ...@@ -88,13 +94,8 @@ static const unsigned long long int mm_wone __attribute__ ((aligned(8))) = 0x000
high3:low3 = low1*low2 high3:low3 = low1*low2
high3 += tlow1 high3 += tlow1
*/ */
#ifdef BIN_PORTABILITY static void dct_unquantize_mpeg1_mmx(MpegEncContext *s,
static void dct_unquantize_mmx DCTELEM *block, int n, int qscale)
#else
#define HAVE_DCT_UNQUANTIZE 1
static void dct_unquantize
#endif
(MpegEncContext *s,DCTELEM *block, int n, int qscale)
{ {
int i, level; int i, level;
const UINT16 *quant_matrix; const UINT16 *quant_matrix;
...@@ -216,24 +217,11 @@ static void dct_unquantize ...@@ -216,24 +217,11 @@ static void dct_unquantize
} }
} }
#ifdef BIN_PORTABILITY void MPV_common_init_mmx(MpegEncContext *s)
static void (*dct_unquantize_ptr)(MpegEncContext *s,
DCTELEM *block, int n, int qscale);
void MPV_common_init_mmx(void)
{ {
int mm_flags; if (mm_flags & MM_MMX) {
mm_flags = mm_support(); /* XXX: should include h263 optimization too. It would go even
if (mm_flags & MM_MMX) { faster! */
dct_unquantize_ptr = dct_unquantize_mmx; s->dct_unquantize = dct_unquantize_mpeg1_mmx;
} }
else {
dct_unquantize_ptr = dct_unquantize;
}
} }
#define DCT_UNQUANTIZE(a,b,c,d) (*dct_unquantize_ptr)(a,b,c,d)
#else
#define DCT_UNQUANTIZE(a,b,c,d) dct_unquantize(a,b,c,d)
#endif /* BIN_PORTABILITY */
#endif /* HAVE_MMX */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册