From 965113ed5051d3e9e4b563b8da1f5523c5470a76 Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Sun, 5 Jun 2011 13:12:51 +0000 Subject: FS#12146: Fix libcook bugs introduced in r22055 by Sean Bartell. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29973 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libcook/cook_fixpoint.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'apps/codecs/libcook') diff --git a/apps/codecs/libcook/cook_fixpoint.h b/apps/codecs/libcook/cook_fixpoint.h index c8a17c6dc6..5c4a5d1a5a 100644 --- a/apps/codecs/libcook/cook_fixpoint.h +++ b/apps/codecs/libcook/cook_fixpoint.h @@ -36,7 +36,7 @@ */ #ifdef ROCKBOX -/* get definitions of MULT31, MULT31_SHIFT15, vect_add, from codelib */ +/* get definitions of MULT31, MULT31_SHIFT16, vect_add, from codelib */ #include "codeclib_misc.h" #include "codeclib.h" #endif @@ -68,7 +68,7 @@ static inline FIXP fixp_pow2(FIXP x, int i) * @param b fix point fraction, 0 <= b < 1 */ #ifdef ROCKBOX -#define fixp_mult_su(x,y) (MULT31_SHIFT15(x,y)) +#define fixp_mult_su(x,y) (MULT31_SHIFT16(x,y)) #else static inline FIXP fixp_mult_su(FIXP a, FIXPU b) { @@ -130,18 +130,18 @@ static void scalar_dequant_math(COOKContext *q, int index, int* subband_coef_sign, REAL_T *mlt_p) { /* Num. half bits to right shift */ - const int s = (33 - quant_index + av_log2(q->samples_per_channel)) >> 1; + const int s = 33 - quant_index + av_log2(q->samples_per_channel); const FIXP *table = quant_tables[s & 1][index]; FIXP f; int i; - if(s >= 32) + if(s >= 64) memset(mlt_p, 0, sizeof(REAL_T)*SUBBAND_SIZE); else { for(i=0 ; i>s; + f = (table[subband_coef_index[i]]) >> (s >> 1); /* noise coding if subband_coef_index[i] == 0 */ if (((subband_coef_index[i] == 0) && cook_random(q)) || ((subband_coef_index[i] != 0) && subband_coef_sign[i])) -- cgit v1.2.3