[FFmpeg-cvslog] wmall: fix reconstructing audio with uncoded channels

Kostya Shishkov git at videolan.org
Thu May 3 21:28:03 CEST 2012


ffmpeg | branch: master | Kostya Shishkov <kostya.shishkov at gmail.com> | Tue May  1 16:09:51 2012 +0200| [0e23b508214611659fc459ed6e5d6704b907694b] | committer: Kostya Shishkov

wmall: fix reconstructing audio with uncoded channels

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0e23b508214611659fc459ed6e5d6704b907694b
---

 libavcodec/wmalosslessdec.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index e2e2997..ff63083 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -654,8 +654,6 @@ static void mclms_predict(WmallDecodeCtx *s, int icoef, int *pred)
     int num_channels = s->num_channels;
 
     for (ich = 0; ich < num_channels; ich++) {
-        if (!s->is_channel_coded[ich])
-            continue;
         pred[ich] = 0;
         for (i = 0; i < order * num_channels; i++)
             pred[ich] += s->mclms_prevvalues[i + s->mclms_recent] *
@@ -789,7 +787,7 @@ static void revert_inter_ch_decorr(WmallDecodeCtx *s, int tile_size)
 {
     if (s->num_channels != 2)
         return;
-    else if (s->is_channel_coded[0] && s->is_channel_coded[1]) {
+    else if (s->is_channel_coded[0] || s->is_channel_coded[1]) {
         int icoef;
         for (icoef = 0; icoef < tile_size; icoef++) {
             s->channel_residues[0][icoef] -= s->channel_residues[1][icoef] >> 1;
@@ -955,6 +953,8 @@ static int decode_subframe(WmallDecodeCtx *s)
                 else
                     use_normal_update_speed(s, i);
                 revert_cdlms(s, i, 0, subframe_len);
+            } else {
+                memset(s->channel_residues[i], 0, sizeof(**s->channel_residues) * subframe_len);
             }
     }
     if (s->do_mclms)



More information about the ffmpeg-cvslog mailing list