# HG changeset patch # User banan # Date 1173993730 0 # Node ID d4de8d9a278841a4c987e70ccd222efd53b4cb1b # Parent e7bc1cf41f9fb57a55c9f43acd47da11990380b2 subband_coef_noise -> subband_coef_sign Cosmetics patch by Ian Braithwaite ian .. braithwaite dot dk diff -r e7bc1cf41f9f -r d4de8d9a2788 cook.c --- a/cook.c Thu Mar 15 12:23:08 2007 +0000 +++ b/cook.c Thu Mar 15 21:22:10 2007 +0000 @@ -539,26 +539,26 @@ * @param band current subband * @param quant_value_table pointer to the array * @param subband_coef_index array of indexes to quant_centroid_tab - * @param subband_coef_noise use random noise instead of predetermined value + * @param subband_coef_sign signs of coefficients * @param mlt_buffer pointer to the mlt buffer */ static void scalar_dequant(COOKContext *q, int index, int band, float* quant_value_table, int* subband_coef_index, - int* subband_coef_noise, float* mlt_buffer){ + int* subband_coef_sign, float* mlt_buffer){ int i; float f1; for(i=0 ; irandom_state = q->random_state * 214013 + 2531011; //typical RNG numbers f1 = randsign[(q->random_state/0x1000000)&1] * dither_tab[index]; //>>31 } @@ -566,16 +566,16 @@ } } /** - * Unpack the subband_coef_index and subband_coef_noise vectors. + * Unpack the subband_coef_index and subband_coef_sign vectors. * * @param q pointer to the COOKContext * @param category pointer to the category array * @param subband_coef_index array of indexes to quant_centroid_tab - * @param subband_coef_noise use random noise instead of predetermined value + * @param subband_coef_sign signs of coefficients */ static int unpack_SQVH(COOKContext *q, int category, int* subband_coef_index, - int* subband_coef_noise) { + int* subband_coef_sign) { int i,j; int vlc, vd ,tmp, result; int ub; @@ -599,13 +599,13 @@ for(j=0 ; jgb) < q->bits_per_subpacket){ - subband_coef_noise[i*vd+j] = get_bits1(&q->gb); + subband_coef_sign[i*vd+j] = get_bits1(&q->gb); } else { result=1; - subband_coef_noise[i*vd+j]=0; + subband_coef_sign[i*vd+j]=0; } } else { - subband_coef_noise[i*vd+j]=0; + subband_coef_sign[i*vd+j]=0; } } } @@ -627,32 +627,32 @@ float* quant_value_table, float* mlt_buffer){ /* A zero in this table means that the subband coefficient is random noise coded. */ - int subband_coef_noise[SUBBAND_SIZE]; + int subband_coef_index[SUBBAND_SIZE]; /* A zero in this table means that the subband coefficient is a positive multiplicator. */ - int subband_coef_index[SUBBAND_SIZE]; + int subband_coef_sign[SUBBAND_SIZE]; int band, j; int index=0; for(band=0 ; bandtotal_subbands ; band++){ index = category[band]; if(category[band] < 7){ - if(unpack_SQVH(q, category[band], subband_coef_index, subband_coef_noise)){ + if(unpack_SQVH(q, category[band], subband_coef_index, subband_coef_sign)){ index=7; for(j=0 ; jtotal_subbands ; j++) category[band+j]=7; } } if(index==7) { memset(subband_coef_index, 0, sizeof(subband_coef_index)); - memset(subband_coef_noise, 0, sizeof(subband_coef_noise)); + memset(subband_coef_sign, 0, sizeof(subband_coef_sign)); } scalar_dequant(q, index, band, quant_value_table, subband_coef_index, - subband_coef_noise, mlt_buffer); + subband_coef_sign, mlt_buffer); } if(q->total_subbands*SUBBAND_SIZE >= q->samples_per_channel){ return; - } + } /* FIXME: should this be removed, or moved into loop above? */ }