aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/x86
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2013-12-01 05:05:23 +0100
committerDiego Biurrun <diego@biurrun.de>2013-12-02 04:05:18 +0100
commit7ffaa195704a7805a4342e58406904e6de17fef5 (patch)
tree4ae1db7873e44225851bd4eeb984c930a4451b1c /libavcodec/x86
parent7b05845b1523a10c458b5b59645cde8e6dc6c231 (diff)
downloadffmpeg-7ffaa195704a7805a4342e58406904e6de17fef5.tar.gz
dsputil: x86: Move ff_inv_zigzag_direct16 table init to mpegvideo
The table is MMX-specific and used nowhere else.
Diffstat (limited to 'libavcodec/x86')
-rw-r--r--libavcodec/x86/mpegvideoenc.c7
-rw-r--r--libavcodec/x86/mpegvideoenc_template.c4
2 files changed, 8 insertions, 3 deletions
diff --git a/libavcodec/x86/mpegvideoenc.c b/libavcodec/x86/mpegvideoenc.c
index ca39a3bd95..3167ea602b 100644
--- a/libavcodec/x86/mpegvideoenc.c
+++ b/libavcodec/x86/mpegvideoenc.c
@@ -28,7 +28,8 @@
#include "libavcodec/mpegvideo.h"
#include "dsputil_x86.h"
-extern uint16_t ff_inv_zigzag_direct16[64];
+/* not permutated inverse zigzag_direct + 1 for MMX quantizer */
+DECLARE_ALIGNED(16, static uint16_t, inv_zigzag_direct16)[64];
#if HAVE_MMX_INLINE
#define COMPILE_TEMPLATE_MMXEXT 0
@@ -84,6 +85,10 @@ extern uint16_t ff_inv_zigzag_direct16[64];
av_cold void ff_MPV_encode_init_x86(MpegEncContext *s)
{
const int dct_algo = s->avctx->dct_algo;
+ int i;
+
+ for (i = 0; i < 64; i++)
+ inv_zigzag_direct16[ff_zigzag_direct[i]] = i + 1;
if (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX) {
#if HAVE_MMX_INLINE
diff --git a/libavcodec/x86/mpegvideoenc_template.c b/libavcodec/x86/mpegvideoenc_template.c
index 4d3fb7445b..a8d2a2cf8a 100644
--- a/libavcodec/x86/mpegvideoenc_template.c
+++ b/libavcodec/x86/mpegvideoenc_template.c
@@ -168,7 +168,7 @@ static int RENAME(dct_quantize)(MpegEncContext *s,
"movzb %%al, %%"REG_a" \n\t" // last_non_zero_p1
: "+a" (last_non_zero_p1)
: "r" (block+64), "r" (qmat), "r" (bias),
- "r" (ff_inv_zigzag_direct16+64), "r" (temp_block+64)
+ "r" (inv_zigzag_direct16 + 64), "r" (temp_block + 64)
XMM_CLOBBERS_ONLY("%xmm0", "%xmm1", "%xmm2", "%xmm3",
"%xmm4", "%xmm5", "%xmm6", "%xmm7")
);
@@ -202,7 +202,7 @@ static int RENAME(dct_quantize)(MpegEncContext *s,
"movzb %%al, %%"REG_a" \n\t" // last_non_zero_p1
: "+a" (last_non_zero_p1)
: "r" (block+64), "r" (qmat+64), "r" (bias+64),
- "r" (ff_inv_zigzag_direct16+64), "r" (temp_block+64)
+ "r" (inv_zigzag_direct16 + 64), "r" (temp_block + 64)
XMM_CLOBBERS_ONLY("%xmm0", "%xmm1", "%xmm2", "%xmm3",
"%xmm4", "%xmm5", "%xmm6", "%xmm7")
);