From d85c9b036e65afa05dcc8fbf37813ef4a05db1f3 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Tue, 12 Mar 2013 07:28:12 -0700 Subject: vp3/x86: use full transpose for all IDCTs. This way, the special IDCT permutations are no longer needed. Bfin code is disabled until someone updates it. This is similar to how H264 does it, and removes the dsputil dependency imposed by the scantable code. Signed-off-by: Michael Niedermayer --- libavcodec/vp3.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'libavcodec/vp3.c') diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index a77bf8fe59..5f5a3e3b22 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -140,6 +140,7 @@ typedef struct Vp3DecodeContext { ThreadFrame current_frame; int keyframe; uint8_t idct_permutation[64]; + uint8_t idct_scantable[64]; DSPContext dsp; VideoDSPContext vdsp; VP3DSPContext vp3dsp; @@ -177,8 +178,6 @@ typedef struct Vp3DecodeContext { int8_t (*motion_val[2])[2]; - ScanTable scantable; - /* tables */ uint16_t coded_dc_scale_factor[64]; uint32_t coded_ac_scale_factor[64]; @@ -1356,7 +1355,7 @@ static inline int vp3_dequant(Vp3DecodeContext *s, Vp3Fragment *frag, int plane, int inter, int16_t block[64]) { int16_t *dequantizer = s->qmat[frag->qpi][inter][plane]; - uint8_t *perm = s->scantable.permutated; + uint8_t *perm = s->idct_scantable; int i = 0; do { @@ -1699,8 +1698,12 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) ff_videodsp_init(&s->vdsp, 8); ff_vp3dsp_init(&s->vp3dsp, avctx->flags); - ff_init_scantable_permutation(s->idct_permutation, s->vp3dsp.idct_perm); - ff_init_scantable(s->idct_permutation, &s->scantable, ff_zigzag_direct); + for (i = 0; i < 64; i++) { +#define T(x) (x >> 3) | ((x & 7) << 3) + s->idct_permutation[i] = T(i); + s->idct_scantable[i] = T(ff_zigzag_direct[i]); +#undef T + } /* initialize to an impossible value which will force a recalculation * in the first frame decode */ -- cgit v1.2.3