Restructuring in quant_band()
This commit is contained in:
parent
293b9f1977
commit
a18c75e55a
1 changed files with 82 additions and 76 deletions
|
@ -532,6 +532,8 @@ static void quant_band(int encode, const CELTMode *m, int i, celt_norm *X, celt_
|
|||
return;
|
||||
}
|
||||
|
||||
if (!stereo && level == 0)
|
||||
{
|
||||
/* Band recombining to increase frequency resolution */
|
||||
if (!stereo && B > 1 && level == 0 && tf_change>0)
|
||||
{
|
||||
|
@ -576,6 +578,7 @@ static void quant_band(int encode, const CELTMode *m, int i, celt_norm *X, celt_
|
|||
if (lowband)
|
||||
deinterleave_vector(lowband, N_B, B0);
|
||||
}
|
||||
}
|
||||
|
||||
/* If we need more than 32 bits, try splitting the band in two. */
|
||||
if (!stereo && LM != -1 && b > 32<<BITRES && N>2)
|
||||
|
@ -801,11 +804,16 @@ static void quant_band(int encode, const CELTMode *m, int i, celt_norm *X, celt_
|
|||
|
||||
/* This code is used by the decoder and by the resynthesis-enabled encoder */
|
||||
if (resynth)
|
||||
{
|
||||
if (stereo)
|
||||
{
|
||||
stereo_merge(X, Y, mid, side, N);
|
||||
} else if (level == 0)
|
||||
{
|
||||
int k;
|
||||
|
||||
/* Undo the sample reorganization going from time order to frequency order */
|
||||
if (!stereo && B0>1 && level==0)
|
||||
if (B0>1)
|
||||
{
|
||||
interleave_vector(X, N_B, B0);
|
||||
if (lowband)
|
||||
|
@ -834,7 +842,7 @@ static void quant_band(int encode, const CELTMode *m, int i, celt_norm *X, celt_
|
|||
}
|
||||
|
||||
/* Scale output for later folding */
|
||||
if (lowband_out && !stereo)
|
||||
if (lowband_out)
|
||||
{
|
||||
int j;
|
||||
celt_word16 n;
|
||||
|
@ -842,9 +850,7 @@ static void quant_band(int encode, const CELTMode *m, int i, celt_norm *X, celt_
|
|||
for (j=0;j<N0;j++)
|
||||
lowband_out[j] = MULT16_16_Q15(n,X[j]);
|
||||
}
|
||||
|
||||
if (stereo)
|
||||
stereo_merge(X, Y, mid, side, N);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue