summaryrefslogtreecommitdiff
path: root/apps/codecs/libcook/cook_fixpoint.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libcook/cook_fixpoint.h')
-rw-r--r--apps/codecs/libcook/cook_fixpoint.h10
1 files changed, 5 insertions, 5 deletions
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 @@
36 */ 36 */
37 37
38#ifdef ROCKBOX 38#ifdef ROCKBOX
39/* get definitions of MULT31, MULT31_SHIFT15, vect_add, from codelib */ 39/* get definitions of MULT31, MULT31_SHIFT16, vect_add, from codelib */
40#include "codeclib_misc.h" 40#include "codeclib_misc.h"
41#include "codeclib.h" 41#include "codeclib.h"
42#endif 42#endif
@@ -68,7 +68,7 @@ static inline FIXP fixp_pow2(FIXP x, int i)
68 * @param b fix point fraction, 0 <= b < 1 68 * @param b fix point fraction, 0 <= b < 1
69 */ 69 */
70#ifdef ROCKBOX 70#ifdef ROCKBOX
71#define fixp_mult_su(x,y) (MULT31_SHIFT15(x,y)) 71#define fixp_mult_su(x,y) (MULT31_SHIFT16(x,y))
72#else 72#else
73static inline FIXP fixp_mult_su(FIXP a, FIXPU b) 73static inline FIXP fixp_mult_su(FIXP a, FIXPU b)
74{ 74{
@@ -130,18 +130,18 @@ static void scalar_dequant_math(COOKContext *q, int index,
130 int* subband_coef_sign, REAL_T *mlt_p) 130 int* subband_coef_sign, REAL_T *mlt_p)
131{ 131{
132 /* Num. half bits to right shift */ 132 /* Num. half bits to right shift */
133 const int s = (33 - quant_index + av_log2(q->samples_per_channel)) >> 1; 133 const int s = 33 - quant_index + av_log2(q->samples_per_channel);
134 const FIXP *table = quant_tables[s & 1][index]; 134 const FIXP *table = quant_tables[s & 1][index];
135 FIXP f; 135 FIXP f;
136 int i; 136 int i;
137 137
138 138
139 if(s >= 32) 139 if(s >= 64)
140 memset(mlt_p, 0, sizeof(REAL_T)*SUBBAND_SIZE); 140 memset(mlt_p, 0, sizeof(REAL_T)*SUBBAND_SIZE);
141 else 141 else
142 { 142 {
143 for(i=0 ; i<SUBBAND_SIZE ; i++) { 143 for(i=0 ; i<SUBBAND_SIZE ; i++) {
144 f = (table[subband_coef_index[i]])>>s; 144 f = (table[subband_coef_index[i]]) >> (s >> 1);
145 /* noise coding if subband_coef_index[i] == 0 */ 145 /* noise coding if subband_coef_index[i] == 0 */
146 if (((subband_coef_index[i] == 0) && cook_random(q)) || 146 if (((subband_coef_index[i] == 0) && cook_random(q)) ||
147 ((subband_coef_index[i] != 0) && subband_coef_sign[i])) 147 ((subband_coef_index[i] != 0) && subband_coef_sign[i]))