diff options
author | Mashiat Sarker Shakkhar <shahriman_ams@yahoo.com> | 2011-11-10 13:42:10 +0600 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-11-11 03:30:50 +0100 |
commit | 9ef5d707e6c12ec5164e6612d547f845da9cbafc (patch) | |
tree | 6b4f6dafae97e3aebd76940dc833ada66a3d4707 /libavcodec/wmalosslessdec.c | |
parent | 144d8159129131e17748b91a678944b2390af06a (diff) | |
download | ffmpeg-9ef5d707e6c12ec5164e6612d547f845da9cbafc.tar.gz |
Implement use_high_update_speed() and use_normal_update_speed()
(cherry picked from commit 9ebc93fa4623791eca9efeee4de65b23dc015de1)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wmalosslessdec.c')
-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 8faa93efb3..7427cb873f 100644 --- a/libavcodec/wmalosslessdec.c +++ b/libavcodec/wmalosslessdec.c @@ -829,6 +829,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 |