mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-09 14:14:39 +02:00
Move scale_bias to a more sane place. I am starting to wonder how this
trash got into svn ... Originally committed as revision 12856 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
687550d35e
commit
5d32325a7b
@ -96,7 +96,7 @@ typedef struct NellyMoserDecodeContext {
|
|||||||
AVRandomState random_state;
|
AVRandomState random_state;
|
||||||
GetBitContext gb;
|
GetBitContext gb;
|
||||||
int add_bias;
|
int add_bias;
|
||||||
int scale_bias;
|
float scale_bias;
|
||||||
DSPContext dsp;
|
DSPContext dsp;
|
||||||
MDCTContext imdct_ctx;
|
MDCTContext imdct_ctx;
|
||||||
DECLARE_ALIGNED_16(float,imdct_tmp[NELLY_BUF_LEN]);
|
DECLARE_ALIGNED_16(float,imdct_tmp[NELLY_BUF_LEN]);
|
||||||
@ -120,7 +120,7 @@ static void overlap_and_window(NellyMoserDecodeContext *s, float *state, float *
|
|||||||
top = NELLY_BUF_LEN-1;
|
top = NELLY_BUF_LEN-1;
|
||||||
|
|
||||||
while (bot < NELLY_BUF_LEN) {
|
while (bot < NELLY_BUF_LEN) {
|
||||||
audio[bot] = ( a_in[bot]*sine_window[bot]+state[bot]*sine_window[top])/s->scale_bias + s->add_bias;
|
audio[bot] = a_in[bot]*sine_window[bot]+state[bot]*sine_window[top] + s->add_bias;
|
||||||
|
|
||||||
bot++;
|
bot++;
|
||||||
top--;
|
top--;
|
||||||
@ -279,7 +279,7 @@ void nelly_decode_block(NellyMoserDecodeContext *s, const unsigned char block[NE
|
|||||||
for (i=0 ; i<NELLY_BANDS ; i++) {
|
for (i=0 ; i<NELLY_BANDS ; i++) {
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
val += nelly_delta_table[get_bits(&s->gb, 5)];
|
val += nelly_delta_table[get_bits(&s->gb, 5)];
|
||||||
pval = pow(2, val/2048);
|
pval = pow(2, val/2048) * s->scale_bias;
|
||||||
for (j = 0; j < nelly_band_sizes_table[i]; j++) {
|
for (j = 0; j < nelly_band_sizes_table[i]; j++) {
|
||||||
*bptr++ = val;
|
*bptr++ = val;
|
||||||
*pptr++ = pval;
|
*pptr++ = pval;
|
||||||
@ -328,10 +328,10 @@ static av_cold int decode_init(AVCodecContext * avctx) {
|
|||||||
|
|
||||||
if(s->dsp.float_to_int16 == ff_float_to_int16_c) {
|
if(s->dsp.float_to_int16 == ff_float_to_int16_c) {
|
||||||
s->add_bias = 385;
|
s->add_bias = 385;
|
||||||
s->scale_bias = 8*32768;
|
s->scale_bias = 1.0/(8*32768);
|
||||||
} else {
|
} else {
|
||||||
s->add_bias = 0;
|
s->add_bias = 0;
|
||||||
s->scale_bias = 1*8;
|
s->scale_bias = 1.0/(1*8);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Generate overlap window */
|
/* Generate overlap window */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user