[FFmpeg-cvslog] Implement clear_codec_buffers()

Mashiat Sarker Shakkhar git at videolan.org
Sun Nov 20 16:01:41 CET 2011


ffmpeg | branch: master | Mashiat Sarker Shakkhar <shahriman_ams at yahoo.com> | Sat Nov  5 02:19:35 2011 +0600| [87b9c23b9a10f9a6feb9226b44e797f2ff1d1be5] | committer: Mashiat Sarker Shakkhar

Implement clear_codec_buffers()

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

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

diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index 22116ea..0642c9c 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -716,6 +716,27 @@ decode_lpc(WmallDecodeCtx *s)
 }
 
 
+static void clear_codec_buffers(WmallDecodeCtx *s)
+{
+    int ich, ilms;
+
+    memset(s->acfilter_coeffs, 0,     16 * sizeof(int));
+    memset(s->lpc_coefs      , 0, 40 * 2 * sizeof(int));
+
+    memset(s->mclms_coeffs    , 0, 128 * sizeof(int16_t));
+    memset(s->mclms_coeffs_cur, 0,   4 * sizeof(int16_t));
+    memset(s->mclms_prevvalues, 0,  64 * sizeof(int));
+    memset(s->mclms_updates   , 0,  64 * sizeof(int16_t));
+
+    for (ich = 0; ich < s->num_channels; ich++) {
+        for (ilms = 0; ilms < s->cdlms_ttl[ich]; ilms++) {
+            memset(s->cdlms[ich][ilms].coefs         , 0, 256 * sizeof(int16_t));
+            memset(s->cdlms[ich][ilms].lms_prevvalues, 0, 512 * sizeof(int));
+            memset(s->cdlms[ich][ilms].lms_updates   , 0, 512 * sizeof(int16_t));
+        }
+        s->ave_sum[ich] = 0;
+    }
+}
 
 /**
  *@brief Decode a single subframe (block).



More information about the ffmpeg-cvslog mailing list