aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMashiat Sarker Shakkhar <shahriman_ams@yahoo.com>2011-11-05 02:19:35 +0600
committerMichael Niedermayer <michaelni@gmx.at>2011-11-11 03:26:05 +0100
commit91528664552939ee2c2f95a9a7bad2ee911ed404 (patch)
tree3f21d9617603b2af5eee6b165f690931f54229fa /libavcodec
parentfd9ea0402cfc9d68f5ec4be311772f5e46a96486 (diff)
downloadffmpeg-91528664552939ee2c2f95a9a7bad2ee911ed404.tar.gz
Implement clear_codec_buffers()
(cherry picked from commit d34e3cf342219e9825125d4f9327cf1feab15c79) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/wmalosslessdec.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index 65ae9562c5..1b1e7b9e63 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -719,6 +719,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).