[FFmpeg-cvslog] qdm2: initialize coeff_per_sb_select from bit_rate
Roberto Togni
git at videolan.org
Sun Apr 21 02:38:20 CEST 2013
ffmpeg | branch: master | Roberto Togni <rxt at rtogni.it> | Sat Apr 20 23:57:18 2013 +0200| [8017683647f5afaea0251eb0e01ec533f2a48d33] | committer: Michael Niedermayer
qdm2: initialize coeff_per_sb_select from bit_rate
The value of coeff_per_sb_select depends on the bit rate, not on
sub_sampling.
Also remove the calculation of tmp, no longer needed.
Fixes tickets #1868 and #742 (only audio part)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8017683647f5afaea0251eb0e01ec533f2a48d33
---
libavcodec/qdm2.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index 5482e9b..daf127e 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -1862,18 +1862,9 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx)
if ((tmp * 2240) < avctx->bit_rate) tmp_val = 4;
s->cm_table_select = tmp_val;
- if (s->sub_sampling == 0)
- tmp = 7999;
- else
- tmp = ((-(s->sub_sampling -1)) & 8000) + 20000;
- /*
- 0: 7999 -> 0
- 1: 20000 -> 2
- 2: 28000 -> 2
- */
- if (tmp < 8000)
+ if (avctx->bit_rate <= 8000)
s->coeff_per_sb_select = 0;
- else if (tmp <= 16000)
+ else if (avctx->bit_rate < 16000)
s->coeff_per_sb_select = 1;
else
s->coeff_per_sb_select = 2;
More information about the ffmpeg-cvslog
mailing list