summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2001-07-30 23:28:35 +0000
committerFabrice Bellard <fabrice@bellard.org>2001-07-30 23:28:35 +0000
commit35b2a786f5ab1c116ce76f0c3e59b231962c6177 (patch)
tree959b91e9cd944b1288f12586a7f02a20cf368cb2 /libavcodec
parent21af69f7876d7708ee59fcb94384ab1d2f7ff14f (diff)
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
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/i386/mpegvideo_mmx.c (renamed from libavcodec/i386/mpegvideo.c)46
1 files changed, 17 insertions, 29 deletions
diff --git a/libavcodec/i386/mpegvideo.c b/libavcodec/i386/mpegvideo_mmx.c
index d9e5e5c114..549d019f48 100644
--- a/libavcodec/i386/mpegvideo.c
+++ b/libavcodec/i386/mpegvideo_mmx.c
@@ -19,6 +19,14 @@
* 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)
{
if (s->pict_type == B_TYPE) {
@@ -52,10 +60,8 @@ void MPV_frame_start(MpegEncContext *s)
:"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_wone __attribute__ ((aligned(8))) = 0x0001000100010001ULL;
@@ -88,13 +94,8 @@ static const unsigned long long int mm_wone __attribute__ ((aligned(8))) = 0x000
high3:low3 = low1*low2
high3 += tlow1
*/
-#ifdef BIN_PORTABILITY
-static void dct_unquantize_mmx
-#else
-#define HAVE_DCT_UNQUANTIZE 1
-static void dct_unquantize
-#endif
-(MpegEncContext *s,DCTELEM *block, int n, int qscale)
+static void dct_unquantize_mpeg1_mmx(MpegEncContext *s,
+ DCTELEM *block, int n, int qscale)
{
int i, level;
const UINT16 *quant_matrix;
@@ -216,24 +217,11 @@ static void dct_unquantize
}
}
-#ifdef BIN_PORTABILITY
-static void (*dct_unquantize_ptr)(MpegEncContext *s,
- DCTELEM *block, int n, int qscale);
-
-void MPV_common_init_mmx(void)
+void MPV_common_init_mmx(MpegEncContext *s)
{
- int mm_flags;
- mm_flags = mm_support();
- if (mm_flags & MM_MMX) {
- dct_unquantize_ptr = dct_unquantize_mmx;
- }
- else {
- dct_unquantize_ptr = dct_unquantize;
- }
+ if (mm_flags & MM_MMX) {
+ /* XXX: should include h263 optimization too. It would go even
+ faster! */
+ s->dct_unquantize = dct_unquantize_mpeg1_mmx;
+ }
}
-
-#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 */