[FFmpeg-cvslog] Implement lms_predict()
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> | Sun Nov 6 03:02:11 2011 +0600| [0faae518e927b791e86f5a43b919a5c6e882d9b5] | committer: Mashiat Sarker Shakkhar
Implement lms_predict()
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0faae518e927b791e86f5a43b919a5c6e882d9b5
---
libavcodec/wmalosslessdec.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index 5c6eed1..eafe145 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -754,6 +754,23 @@ static void reset_codec(WmallDecodeCtx *s)
+static int lms_predict(WmallDecodeCtx *s, int ich, int ilms)
+{
+ int32_t pred, icoef;
+ int recent = s->cdlms[ich][ilms].recent;
+
+ for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++)
+ pred += s->cdlms[ich][ilms].coefs[icoef] *
+ s->cdlms[ich][ilms].lms_prevvalues[icoef + recent];
+
+ pred += (1 << (s->cdlms[ich][ilms].scaling - 1));
+ /* XXX: Table 29 has:
+ iPred >= cdlms[iCh][ilms].scaling;
+ seems to me like a missing > */
+ pred >>= s->cdlms[ich][ilms].scaling;
+ return pred;
+}
+
/**
*@brief Decode a single subframe (block).
*@param s codec context
More information about the ffmpeg-cvslog
mailing list