mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Implement lms_predict()
(cherry picked from commit 83e31db195b9d0a07b0526eab5780817d8ce9444) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
f12f189638
commit
afd930dca2
@ -757,6 +757,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
|
||||
|
Loading…
Reference in New Issue
Block a user