Skip to content

Commit

Permalink
Remove variable no longer in use
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmf01 committed Oct 12, 2022
1 parent bb400ec commit 90d7fdb
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/libFLAC/stream_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -3727,16 +3727,15 @@ FLAC__bool process_subframe_(
if(max_lpc_order > 0) {
uint32_t a, b = 1, c = 0;
for (a = 0; a < encoder->protected_->num_apodizations;) {
uint32_t max_lpc_order_this_apodization = max_lpc_order;
if(b == 1){
/* window full subblock */
if(subframe_bps <= 32)
FLAC__lpc_window_data(integer_signal, encoder->private_->window[a], encoder->private_->windowed_signal, frame_header->blocksize);
else
FLAC__lpc_window_data_wide(integer_signal, encoder->private_->window[a], encoder->private_->windowed_signal, frame_header->blocksize);
encoder->private_->local_lpc_compute_autocorrelation(encoder->private_->windowed_signal, frame_header->blocksize, max_lpc_order_this_apodization+1, autoc);
encoder->private_->local_lpc_compute_autocorrelation(encoder->private_->windowed_signal, frame_header->blocksize, max_lpc_order+1, autoc);
if(encoder->protected_->apodizations[a].type == FLAC__APODIZATION_SUBDIVIDE_TUKEY){
for(uint32_t i = 0; i < max_lpc_order_this_apodization; i++)
for(uint32_t i = 0; i < max_lpc_order; i++)
autoc_root[i] = autoc[i];
b++;
}else{
Expand All @@ -3760,11 +3759,11 @@ FLAC__bool process_subframe_(
FLAC__lpc_window_data_partial(integer_signal, encoder->private_->window[a], encoder->private_->windowed_signal, frame_header->blocksize, frame_header->blocksize/b/2, (c/2*frame_header->blocksize)/b);
else
FLAC__lpc_window_data_partial(integer_signal, encoder->private_->window[a], encoder->private_->windowed_signal, frame_header->blocksize, frame_header->blocksize/b/2, (c/2*frame_header->blocksize)/b);
encoder->private_->local_lpc_compute_autocorrelation(encoder->private_->windowed_signal, frame_header->blocksize/b, max_lpc_order_this_apodization+1, autoc);
encoder->private_->local_lpc_compute_autocorrelation(encoder->private_->windowed_signal, frame_header->blocksize/b, max_lpc_order+1, autoc);
}else{
/* on uneven c, evaluate the root window (over the whole block) minus the previous partial window
* similar to tukey_punchout apodization but more efficient */
for(uint32_t i = 0; i < max_lpc_order_this_apodization; i++)
for(uint32_t i = 0; i < max_lpc_order; i++)
autoc[i] = autoc_root[i] - autoc[i];
}
/* Next function sets a, b and c appropriate for next iteration */
Expand All @@ -3773,27 +3772,27 @@ FLAC__bool process_subframe_(

/* if autoc[0] == 0.0, the signal is constant and we usually won't get here, but it can happen */
if(autoc[0] != 0.0) {
FLAC__lpc_compute_lp_coefficients(autoc, &max_lpc_order_this_apodization, encoder->private_->lp_coeff, lpc_error);
FLAC__lpc_compute_lp_coefficients(autoc, &max_lpc_order, encoder->private_->lp_coeff, lpc_error);
if(encoder->protected_->do_exhaustive_model_search) {
min_lpc_order = 1;
}
else {
const uint32_t guess_lpc_order =
FLAC__lpc_compute_best_order(
lpc_error,
max_lpc_order_this_apodization,
max_lpc_order,
frame_header->blocksize,
subframe_bps + (
encoder->protected_->do_qlp_coeff_prec_search?
FLAC__MIN_QLP_COEFF_PRECISION : /* have to guess; use the min possible size to avoid accidentally favoring lower orders */
encoder->protected_->qlp_coeff_precision
)
);
min_lpc_order = max_lpc_order_this_apodization = guess_lpc_order;
min_lpc_order = max_lpc_order = guess_lpc_order;
}
if(max_lpc_order_this_apodization >= frame_header->blocksize)
max_lpc_order_this_apodization = frame_header->blocksize - 1;
for(lpc_order = min_lpc_order; lpc_order <= max_lpc_order_this_apodization; lpc_order++) {
if(max_lpc_order >= frame_header->blocksize)
max_lpc_order = frame_header->blocksize - 1;
for(lpc_order = min_lpc_order; lpc_order <= max_lpc_order; lpc_order++) {
lpc_residual_bits_per_sample = FLAC__lpc_compute_expected_bits_per_residual_sample(lpc_error[lpc_order-1], frame_header->blocksize-lpc_order);
if(lpc_residual_bits_per_sample >= (double)subframe_bps)
continue; /* don't even try */
Expand Down

0 comments on commit 90d7fdb

Please sign in to comment.