[FFmpeg-cvslog] imc: use correct position for flcoeffs2 calculation
Andreas Cadhalpun
git at videolan.org
Thu Jul 23 02:17:07 CEST 2015
ffmpeg | branch: release/2.6 | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Fri Jul 10 21:50:50 2015 +0200| [088733414a65813633ec52aa94936302231e329c] | committer: Michael Niedermayer
imc: use correct position for flcoeffs2 calculation
flcoeffs2[pos] should be the log2 of flcoeffs1[pos].
flcoeffs1[0] can be 0 here, thus flcoeffs2[pos] gets set to -inf,
causing problems further down.
This seems to have been copied from imc_decode_level_coefficients in
commit 4eb4bb3 without updating the position.
Reviewed-by: Michael Niedermayer <michaelni at gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
(cherry picked from commit 75fd5ce4c1c0b2d96d71c74b650cefaaef519d27)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
(cherry picked from commit 27816fb9ef26af1fa820c434079491f155e67471)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=088733414a65813633ec52aa94936302231e329c
---
libavcodec/imc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/imc.c b/libavcodec/imc.c
index 2fa910a..d89d370 100644
--- a/libavcodec/imc.c
+++ b/libavcodec/imc.c
@@ -426,7 +426,7 @@ static void imc_decode_level_coefficients_raw(IMCContext *q, int *levlCoeffBuf,
pos = q->coef0_pos;
flcoeffs1[pos] = 20000.0 / pow (2, levlCoeffBuf[0] * 0.18945); // 0.18945 = log2(10) * 0.05703125
- flcoeffs2[pos] = log2f(flcoeffs1[0]);
+ flcoeffs2[pos] = log2f(flcoeffs1[pos]);
tmp = flcoeffs1[pos];
tmp2 = flcoeffs2[pos];
More information about the ffmpeg-cvslog
mailing list