Mercurial > libavcodec.hg
comparison nellymoserdec.c @ 6609:f9aaf7429477 libavcodec
do the -1 outside of the transform
author | michael |
---|---|
date | Wed, 16 Apr 2008 14:49:10 +0000 |
parents | 29a73b30ded0 |
children | 675f6d8e3f64 |
comparison
equal
deleted
inserted
replaced
6608:29a73b30ded0 | 6609:f9aaf7429477 |
---|---|
118 | 118 |
119 bot = 0; | 119 bot = 0; |
120 top = NELLY_BUF_LEN-1; | 120 top = NELLY_BUF_LEN-1; |
121 | 121 |
122 while (bot < NELLY_BUF_LEN/2) { | 122 while (bot < NELLY_BUF_LEN/2) { |
123 audio[bot] = (- a_in[bot]*sine_window[bot]-state[bot]*sine_window[top])/s->scale_bias + s->add_bias; | 123 audio[bot] = ( a_in[bot]*sine_window[bot]+state[bot]*sine_window[top])/s->scale_bias + s->add_bias; |
124 audio[top] = (-state[bot]*sine_window[bot]- a_in[top]*sine_window[top])/s->scale_bias + s->add_bias; | 124 audio[top] = (state[bot]*sine_window[bot]+ a_in[top]*sine_window[top])/s->scale_bias + s->add_bias; |
125 state[bot] = a_in[bot + NELLY_BUF_LEN]; | 125 state[bot] = a_in[bot + NELLY_BUF_LEN]; |
126 | 126 |
127 bot++; | 127 bot++; |
128 top--; | 128 top--; |
129 } | 129 } |
297 skip_bits(&s->gb, NELLY_HEADER_BITS + i*NELLY_DETAIL_BITS); | 297 skip_bits(&s->gb, NELLY_HEADER_BITS + i*NELLY_DETAIL_BITS); |
298 | 298 |
299 for (j = 0; j < NELLY_FILL_LEN; j++) { | 299 for (j = 0; j < NELLY_FILL_LEN; j++) { |
300 if (bits[j] <= 0) { | 300 if (bits[j] <= 0) { |
301 aptr[j] = M_SQRT1_2*pows[j]; | 301 aptr[j] = M_SQRT1_2*pows[j]; |
302 if (av_random(&s->random_state) & 1) | 302 if (!(av_random(&s->random_state) & 1)) |
303 aptr[j] *= -1.0; | 303 aptr[j] *= -1.0; |
304 } else { | 304 } else { |
305 v = get_bits(&s->gb, bits[j]); | 305 v = get_bits(&s->gb, bits[j]); |
306 aptr[j] = dequantization_table[(1<<bits[j])-1+v]*pows[j]; | 306 aptr[j] = -dequantization_table[(1<<bits[j])-1+v]*pows[j]; |
307 } | 307 } |
308 } | 308 } |
309 memset(&aptr[NELLY_FILL_LEN], 0, | 309 memset(&aptr[NELLY_FILL_LEN], 0, |
310 (NELLY_BUF_LEN - NELLY_FILL_LEN) * sizeof(float)); | 310 (NELLY_BUF_LEN - NELLY_FILL_LEN) * sizeof(float)); |
311 | 311 |