summaryrefslogtreecommitdiff
path: root/libavcodec/wmalosslessdec.c
diff options
context:
space:
mode:
authorMashiat Sarker Shakkhar <shahriman_ams@yahoo.com>2011-11-12 16:07:12 +0600
committerMashiat Sarker Shakkhar <shahriman_ams@yahoo.com>2011-11-20 14:51:40 +0600
commitcaf9eb85b15c06ca48fe7aa8522bbe6d953eae47 (patch)
treea11f4f8bf9a3d3587a6327392b9aac1c847c079b /libavcodec/wmalosslessdec.c
parentd47782df26d23126d9b50c8819f152a478b0ef14 (diff)
Implement revert_cdlms()
Diffstat (limited to 'libavcodec/wmalosslessdec.c')
-rw-r--r--libavcodec/wmalosslessdec.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index 8d5202e732..869ed98295 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -873,6 +873,39 @@ static void use_normal_update_speed(WmallDecodeCtx *s, int ich)
}
}
+static void revert_cdlms(WmallDecodeCtx *s, int tile_size)
+{
+ int icoef, ich;
+ int32_t pred, channel_coeff;
+ int ilms, num_lms;
+
+ for (ich = 0; ich < s->num_channels; ich++) {
+ if (!s->is_channel_coded[ich])
+ continue;
+ for (icoef = 0; icoef < tile_size; icoef++) {
+ num_lms = s->cdlms_ttl[ich];
+ channel_coeff = s->channel_residues[ich][icoef];
+ if (icoef == s->transient_pos[ich]) {
+ s->transient[ich] = 1;
+ use_high_update_speed(s, ich);
+ }
+ for (ilms = num_lms; ilms >= 0; ilms--) {
+ pred = lms_predict(s, ich, ilms);
+ channel_coeff += pred;
+ lms_update(s, ich, ilms, channel_coeff, pred);
+ }
+ if (s->transient[ich]) {
+ --s->channel[ich].transient_counter;
+ if(!s->channel[ich].transient_counter)
+ use_normal_update_speed(s, ich);
+ }
+ s->channel_coeffs[ich][icoef] = channel_coeff;
+ }
+ }
+}
+
+
+
/**
*@brief Decode a single subframe (block).
*@param s codec context