diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2013-03-12 18:28:12 +0400 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2013-04-15 13:32:05 +0400 |
commit | 015821229f96bf7e677f2a711a58dbea3009f574 (patch) | |
tree | 2247f2d16c077a1f887656b8859b164eca6b84df /libavcodec/vp3.c | |
parent | 5941978e71d2c3a8e2a7e87951e081e0b2e77da9 (diff) |
vp3: Use full transpose for all IDCTs
This way, the special IDCT permutations are no longer needed. This
is similar to how H264 does it, and removes the dsputil dependency
imposed by the scantable code.
Also remove the unused type == 0 cases from the plain C version
of the idct.
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/vp3.c')
-rw-r--r-- | libavcodec/vp3.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 18b9cb89bf..7c26609b09 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -136,6 +136,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; @@ -173,8 +174,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]; @@ -1351,7 +1350,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 { @@ -1700,8 +1699,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 */ |