diff options
author | Mashiat Sarker Shakkhar <shahriman_ams@yahoo.com> | 2011-11-10 13:42:10 +0600 |
---|---|---|
committer | Mashiat Sarker Shakkhar <shahriman_ams@yahoo.com> | 2011-11-20 14:51:40 +0600 |
commit | 3f3d2b5f65b7d803cb1c2fef41b99a7b17e87117 (patch) | |
tree | ed506fed03aef656f9c7e3f9fbed849dd245a06e /libavcodec | |
parent | 1e0db1c52addb8f92cc0e40d3005dc76c0c842d9 (diff) | |
download | ffmpeg-3f3d2b5f65b7d803cb1c2fef41b99a7b17e87117.tar.gz |
Implement use_high_update_speed() and use_normal_update_speed()
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/wmalosslessdec.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c index 500576bf13..7aab5eebb7 100644 --- a/libavcodec/wmalosslessdec.c +++ b/libavcodec/wmalosslessdec.c @@ -826,6 +826,38 @@ static void lms_update(WmallDecodeCtx *s, int ich, int ilms, int32_t input, int3 } } +static void use_high_update_speed(WmallDecodeCtx *s, int ich) +{ + int ilms, recent, icoef; + s->update_speed[ich] = 16; + for (ilms = s->cdlms_ttl[ich]; ilms >= 0; ilms--) { + recent = s->cdlms[ich][ilms].recent; + if (s->bV3RTM) { + for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++) + s->cdlms[ich][ilms].lms_updates[icoef + recent] *= 2; + } else { + for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++) + s->cdlms[ich][ilms].lms_updates[icoef] *= 2; + } + } +} + +static void use_normal_update_speed(WmallDecodeCtx *s, int ich) +{ + int ilms, recent, icoef; + s->update_speed[ich] = 8; + for (ilms = s->cdlms_ttl[ich]; ilms >= 0; ilms--) { + recent = s->cdlms[ich][ilms].recent; + if (s->bV3RTM) { + for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++) + s->cdlms[ich][ilms].lms_updates[icoef + recent] /= 2; + } else { + for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++) + s->cdlms[ich][ilms].lms_updates[icoef] /= 2; + } + } +} + /** *@brief Decode a single subframe (block). *@param s codec context |