comparison nellymoserdec.c @ 6614:d525255f5688 libavcodec

Move the *-1 to a more sane place as well.
author michael
date Wed, 16 Apr 2008 15:30:04 +0000
parents 54f88d1cee72
children 3496fac9ea8f
comparison
equal deleted inserted replaced
6613:54f88d1cee72 6614:d525255f5688
277 pptr = pows; 277 pptr = pows;
278 val = nelly_init_table[get_bits(&s->gb, 6)]; 278 val = nelly_init_table[get_bits(&s->gb, 6)];
279 for (i=0 ; i<NELLY_BANDS ; i++) { 279 for (i=0 ; i<NELLY_BANDS ; i++) {
280 if (i > 0) 280 if (i > 0)
281 val += nelly_delta_table[get_bits(&s->gb, 5)]; 281 val += nelly_delta_table[get_bits(&s->gb, 5)];
282 pval = pow(2, val/2048) * s->scale_bias; 282 pval = -pow(2, val/2048) * s->scale_bias;
283 for (j = 0; j < nelly_band_sizes_table[i]; j++) { 283 for (j = 0; j < nelly_band_sizes_table[i]; j++) {
284 *bptr++ = val; 284 *bptr++ = val;
285 *pptr++ = pval; 285 *pptr++ = pval;
286 } 286 }
287 287
296 skip_bits(&s->gb, NELLY_HEADER_BITS + i*NELLY_DETAIL_BITS); 296 skip_bits(&s->gb, NELLY_HEADER_BITS + i*NELLY_DETAIL_BITS);
297 297
298 for (j = 0; j < NELLY_FILL_LEN; j++) { 298 for (j = 0; j < NELLY_FILL_LEN; j++) {
299 if (bits[j] <= 0) { 299 if (bits[j] <= 0) {
300 aptr[j] = M_SQRT1_2*pows[j]; 300 aptr[j] = M_SQRT1_2*pows[j];
301 if (!(av_random(&s->random_state) & 1)) 301 if (av_random(&s->random_state) & 1)
302 aptr[j] *= -1.0; 302 aptr[j] *= -1.0;
303 } else { 303 } else {
304 v = get_bits(&s->gb, bits[j]); 304 v = get_bits(&s->gb, bits[j]);
305 aptr[j] = -dequantization_table[(1<<bits[j])-1+v]*pows[j]; 305 aptr[j] = dequantization_table[(1<<bits[j])-1+v]*pows[j];
306 } 306 }
307 } 307 }
308 memset(&aptr[NELLY_FILL_LEN], 0, 308 memset(&aptr[NELLY_FILL_LEN], 0,
309 (NELLY_BUF_LEN - NELLY_FILL_LEN) * sizeof(float)); 309 (NELLY_BUF_LEN - NELLY_FILL_LEN) * sizeof(float));
310 310