On Mon, 21 Jan 2013, Ronald S. Bultje  wrote:

Module: libav
Branch: master
Commit: e6bc38fd49c94726b45d5d5cc2b756ad8ec49ee0

Author:    Ronald S. Bultje <[email protected]>
Committer: Ronald S. Bultje <[email protected]>
Date:      Sun Jan 20 22:12:35 2013 -0800

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).

---

libavcodec/Makefile           |    4 +-
libavcodec/dsputil.c          |   89 -------------------------
libavcodec/dsputil.h          |    1 -
libavcodec/wmv2.c             |   22 ++++++-
libavcodec/wmv2.h             |    2 +
libavcodec/wmv2dec.c          |    4 -
libavcodec/wmv2dsp.c          |  145 +++++++++++++++++++++++++++++++++++++++++
libavcodec/wmv2dsp.h          |   34 ++++++++++
tests/ref/seek/vsynth2-wmv2   |   28 ++++----
tests/ref/vsynth/vsynth1-wmv2 |    8 +-
tests/ref/vsynth/vsynth2-wmv2 |    6 +-
11 files changed, 223 insertions(+), 120 deletions(-)


diff --git a/libavcodec/wmv2.c b/libavcodec/wmv2.c
index a3dcbb3..595630f 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;
}

This broke wmv2 encoding pretty severly. Try "avconv -i <foo> -an -vcodec wmv2 foo.asf" and play it back; before this it played back fine, now the pixels within macroblocks are pretty badly scrambled.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to