Output converter: Limit extrapolation to only be trained on twice as many samples as the extrapolation order

CQTexperiment
Christopher Snowhill 2022-01-18 16:43:10 -08:00
parent ec8466e56c
commit c4c29be35a
1 changed files with 2 additions and 1 deletions

View File

@ -702,7 +702,8 @@ static void extrapolate(float *buffer, ssize_t channels, ssize_t frameSize, ssiz
float *chPcmBuf = buffer + ch + (backward ? frameSize : -1) * channels;
for (size_t i = 0; i < frameSize; i++) work[i] = *(chPcmBuf += delta);
vorbis_lpc_from_data(work, lpc, (int)(frameSize - size), extrapolate_order);
// Limit extrapolation source to two times the order size
vorbis_lpc_from_data(work + frameSize - extrapolate_order * 2, lpc, extrapolate_order * 2, extrapolate_order);
vorbis_lpc_predict(lpc, work + frameSize - size - extrapolate_order, extrapolate_order, work + frameSize - size, size, their_work);