lavc/g729dec: Cosmetics, fix indentation after last commit.

This commit is contained in:
Carl Eugen Hoyos 2018-12-15 00:55:18 +01:00
parent 641d52152f
commit 011c9112a0
1 changed files with 288 additions and 285 deletions

View File

@ -272,8 +272,7 @@ static void g729d_get_new_exc(
ff_celp_convolve_circ(fc_new, fc_cur, phase_filter[dstate], subframe_size);
for(i=0; i<subframe_size; i++)
{
for (i = 0; i < subframe_size; i++) {
out[i] = in[i];
out[i] -= (gain_code * fc_cur[i] + 0x2000) >> 14;
out[i] += (gain_code * fc_new[i] + 0x2000) >> 14;
@ -291,7 +290,7 @@ static int g729d_onset_decision(int past_onset, const int16_t* past_gain_code)
{
if ((past_gain_code[0] >> 1) > past_gain_code[1])
return 2;
else
return FFMAX(past_onset-1, 0);
}
@ -307,12 +306,13 @@ static int16_t g729d_voice_decision(int onset, int prev_voice_decision, const in
{
int i, low_gain_pitch_cnt, voice_decision;
if(past_gain_pitch[0] >= 14745) // 0.9
if (past_gain_pitch[0] >= 14745) { // 0.9
voice_decision = DECISION_VOICE;
else if (past_gain_pitch[0] <= 9830) // 0.6
} else if (past_gain_pitch[0] <= 9830) { // 0.6
voice_decision = DECISION_NOISE;
else
} else {
voice_decision = DECISION_INTERMEDIATE;
}
for (i = 0, low_gain_pitch_cnt = 0; i < 6; i++)
if (past_gain_pitch[i] < 9830)
@ -457,10 +457,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
quantizer_2nd_lo = get_bits(&gb, VQ_2ND_BITS);
quantizer_2nd_hi = get_bits(&gb, VQ_2ND_BITS);
if(frame_erasure)
if (frame_erasure) {
lsf_restore_from_previous(ctx->lsfq, ctx->past_quantizer_outputs,
ctx->ma_predictor_prev);
else {
} else {
lsf_decode(ctx->lsfq, ctx->past_quantizer_outputs,
ma_predictor,
quantizer_1st, quantizer_2nd_lo, quantizer_2nd_hi);
@ -495,22 +495,24 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
gc_1st_index = get_bits(&gb, format->gc_1st_index_bits);
gc_2nd_index = get_bits(&gb, format->gc_2nd_index_bits);
if (frame_erasure)
if (frame_erasure) {
pitch_delay_3x = 3 * ctx->pitch_delay_int_prev;
else if(!i) {
if (bad_pitch)
} else if (!i) {
if (bad_pitch) {
pitch_delay_3x = 3 * ctx->pitch_delay_int_prev;
else
} else {
pitch_delay_3x = ff_acelp_decode_8bit_to_1st_delay3(ac_index);
}
} else {
int pitch_delay_min = av_clip(ctx->pitch_delay_int_prev - 5,
PITCH_DELAY_MIN, PITCH_DELAY_MAX - 9);
if(packet_type == FORMAT_G729D_6K4)
if (packet_type == FORMAT_G729D_6K4) {
pitch_delay_3x = ff_acelp_decode_4bit_to_2nd_delay3(ac_index, pitch_delay_min);
else
} else {
pitch_delay_3x = ff_acelp_decode_5_6_bit_to_2nd_delay3(ac_index, pitch_delay_min);
}
}
/* Round pitch delay to nearest (used everywhere except ff_acelp_interpolate). */
pitch_delay_int[i] = (pitch_delay_3x + 1) / 3;
@ -700,10 +702,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
SUBFRAME_SIZE,
ctx->gain_coeff);
if (frame_erasure)
if (frame_erasure) {
ctx->pitch_delay_int_prev = FFMIN(ctx->pitch_delay_int_prev + 1, PITCH_DELAY_MAX);
else
} else {
ctx->pitch_delay_int_prev = pitch_delay_int[i];
}
memcpy(synth+8, ctx->hpf_z, 2*sizeof(int16_t));
ff_acelp_high_pass_filter(