summaryrefslogtreecommitdiff
path: root/libavcodec/wmv2.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2013-01-20 22:12:35 -0800
committerRonald S. Bultje <rsbultje@gmail.com>2013-01-20 22:12:35 -0800
commite6bc38fd49c94726b45d5d5cc2b756ad8ec49ee0 (patch)
tree372ff5d7a56c1ea732d01ee4051293bf0309162b /libavcodec/wmv2.c
parent8a4f26206d7914eaf2903954ce97cb7686933382 (diff)
wmv2: move IDCT to its own DSP context.
This allows us to remove FF_IDCT_WMV2, which serves no practical purpose other than to be able to select the WMV2 IDCT for MPEG (or vice versa) and get corrupt output. Fate tests for all wmv2-related tests change, because (for some obscure reason) they forced use of the MPEG IDCT. You would get the same changes previously by not using -idct simple in the fate test (or replacing it with -idct auto).
Diffstat (limited to 'libavcodec/wmv2.c')
-rw-r--r--libavcodec/wmv2.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/libavcodec/wmv2.c b/libavcodec/wmv2.c
index a3dcbb37ae..595630f2ca 100644
--- a/libavcodec/wmv2.c
+++ b/libavcodec/wmv2.c
@@ -28,8 +28,24 @@
av_cold void ff_wmv2_common_init(Wmv2Context * w){
MpegEncContext * const s= &w->s;
- ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[0], ff_wmv2_scantableA);
- ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[1], ff_wmv2_scantableB);
+ ff_wmv2dsp_init(&w->wdsp);
+ ff_init_scantable_permutation(s->dsp.idct_permutation,
+ w->wdsp.idct_perm);
+ ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[0],
+ ff_wmv2_scantableA);
+ ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[1],
+ ff_wmv2_scantableB);
+ ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable,
+ ff_wmv1_scantable[1]);
+ ff_init_scantable(s->dsp.idct_permutation, &s->intra_h_scantable,
+ ff_wmv1_scantable[2]);
+ ff_init_scantable(s->dsp.idct_permutation, &s->intra_v_scantable,
+ ff_wmv1_scantable[3]);
+ ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable,
+ ff_wmv1_scantable[0]);
+ s->dsp.idct_put = w->wdsp.idct_put;
+ s->dsp.idct_add = w->wdsp.idct_add;
+ s->dsp.idct = NULL;
}
static void wmv2_add_block(Wmv2Context *w, DCTELEM *block1, uint8_t *dst, int stride, int n){
@@ -38,7 +54,7 @@ static void wmv2_add_block(Wmv2Context *w, DCTELEM *block1, uint8_t *dst, int st
if (s->block_last_index[n] >= 0) {
switch(w->abt_type_table[n]){
case 0:
- s->dsp.idct_add (dst, stride, block1);
+ w->wdsp.idct_add(dst, stride, block1);
break;
case 1:
ff_simple_idct84_add(dst , stride, block1);