summaryrefslogtreecommitdiff
path: root/libavcodec/vp3.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2013-03-09 09:08:36 -0800
committerMichael Niedermayer <michaelni@gmx.at>2013-03-10 02:51:05 +0100
commitd5efa84f13d349e1bd852c94fcd171f3488dee0c (patch)
tree27f5638861bf000609c9e35f8bf0019a6d4615e4 /libavcodec/vp3.c
parent96e4b00d62ac12bf16f40d00c1b36670503231a5 (diff)
vp3: embed idct_permutation array directly in VP3DecoderContext.
This makes the vp3 decoder less dependent on dsputil, and will aid in making it (eventually) dsputil-independent. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vp3.c')
-rw-r--r--libavcodec/vp3.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 00a77e9e78..686683d56d 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -139,6 +139,7 @@ typedef struct Vp3DecodeContext {
AVFrame last_frame;
AVFrame current_frame;
int keyframe;
+ uint8_t idct_permutation[64];
DSPContext dsp;
VideoDSPContext vdsp;
VP3DSPContext vp3dsp;
@@ -384,7 +385,7 @@ static void init_dequantizer(Vp3DecodeContext *s, int qpi)
int qmin= 8<<(inter + !i);
int qscale= i ? ac_scale_factor : dc_scale_factor;
- s->qmat[qpi][inter][plane][s->dsp.idct_permutation[i]]= av_clip((qscale * coeff)/100 * 4, qmin, 4096);
+ s->qmat[qpi][inter][plane][s->idct_permutation[i]]= av_clip((qscale * coeff)/100 * 4, qmin, 4096);
}
// all DC coefficients use the same quant so as not to interfere with DC prediction
s->qmat[qpi][inter][plane][0] = s->qmat[0][inter][plane][0];
@@ -1680,8 +1681,8 @@ 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->dsp.idct_permutation, s->vp3dsp.idct_perm);
- ff_init_scantable(s->dsp.idct_permutation, &s->scantable, ff_zigzag_direct);
+ ff_init_scantable_permutation(s->idct_permutation, s->vp3dsp.idct_perm);
+ ff_init_scantable(s->idct_permutation, &s->scantable, ff_zigzag_direct);
/* initialize to an impossible value which will force a recalculation
* in the first frame decode */
@@ -1886,7 +1887,7 @@ static int vp3_update_thread_context(AVCodecContext *dst, const AVCodecContext *
}
// copy previous frame data
- copy_fields(s, s1, golden_frame, dsp);
+ copy_fields(s, s1, golden_frame, idct_permutation);
// copy qscale data if necessary
for (i = 0; i < 3; i++) {