Prevents a folding artefact due to "folding the folding"
This commit is contained in:
parent
94491653e0
commit
fd54a99e2d
1 changed files with 10 additions and 2 deletions
|
@ -927,6 +927,7 @@ void quant_all_bands(int encode, const CELTMode *m, int start, int end, celt_nor
|
||||||
int b;
|
int b;
|
||||||
int N;
|
int N;
|
||||||
int curr_balance;
|
int curr_balance;
|
||||||
|
celt_norm *effective_lowband=NULL;
|
||||||
celt_norm * restrict X, * restrict Y;
|
celt_norm * restrict X, * restrict Y;
|
||||||
int tf_change=0;
|
int tf_change=0;
|
||||||
|
|
||||||
|
@ -962,7 +963,7 @@ void quant_all_bands(int encode, const CELTMode *m, int start, int end, celt_nor
|
||||||
b = C*16*N<<BITRES;
|
b = C*16*N<<BITRES;
|
||||||
|
|
||||||
if (M*eBands[i]-N >= M*eBands[start] && (update_lowband || lowband==NULL))
|
if (M*eBands[i]-N >= M*eBands[start] && (update_lowband || lowband==NULL))
|
||||||
lowband = norm+M*eBands[i]-N;
|
lowband = norm+M*eBands[i];
|
||||||
|
|
||||||
tf_change = tf_res[i];
|
tf_change = tf_res[i];
|
||||||
if (i>=m->effEBands)
|
if (i>=m->effEBands)
|
||||||
|
@ -972,8 +973,15 @@ void quant_all_bands(int encode, const CELTMode *m, int start, int end, celt_nor
|
||||||
Y = norm;
|
Y = norm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* This ensures we never repeat spectral content within one band */
|
||||||
|
if (lowband != NULL)
|
||||||
|
{
|
||||||
|
effective_lowband = lowband-N;
|
||||||
|
if (effective_lowband < norm+M*eBands[start])
|
||||||
|
effective_lowband = norm+M*eBands[start];
|
||||||
|
}
|
||||||
quant_band(encode, m, i, X, Y, N, b, fold, B, tf_change,
|
quant_band(encode, m, i, X, Y, N, b, fold, B, tf_change,
|
||||||
lowband, resynth, ec, &remaining_bits, LM,
|
effective_lowband, resynth, ec, &remaining_bits, LM,
|
||||||
norm+M*eBands[i], bandE, 0, &seed, Q15ONE, lowband_scratch);
|
norm+M*eBands[i], bandE, 0, &seed, Q15ONE, lowband_scratch);
|
||||||
|
|
||||||
balance += pulses[i] + tell;
|
balance += pulses[i] + tell;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue