Commit 0c474826 authored by Lisa Nguyen's avatar Lisa Nguyen Committed by Greg Kroah-Hartman

staging: echo: Fixed camel-case variable names

Fixed camel-case variable names in echo.c and echo.h.
Signed-off-by: default avatarLisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ff451370
...@@ -267,13 +267,13 @@ struct oslec_state *oslec_create(int len, int adaption_mode) ...@@ -267,13 +267,13 @@ struct oslec_state *oslec_create(int len, int adaption_mode)
goto error_snap; goto error_snap;
ec->cond_met = 0; ec->cond_met = 0;
ec->Pstates = 0; ec->pstates = 0;
ec->Ltxacc = ec->Lrxacc = ec->Lcleanacc = ec->Lclean_bgacc = 0; ec->ltxacc = ec->lrxacc = ec->lcleanacc = ec->lclean_bgacc = 0;
ec->Ltx = ec->Lrx = ec->Lclean = ec->Lclean_bg = 0; ec->ltx = ec->lrx = ec->lclean = ec->lclean_bg = 0;
ec->tx_1 = ec->tx_2 = ec->rx_1 = ec->rx_2 = 0; ec->tx_1 = ec->tx_2 = ec->rx_1 = ec->rx_2 = 0;
ec->Lbgn = ec->Lbgn_acc = 0; ec->lbgn = ec->lbgn_acc = 0;
ec->Lbgn_upper = 200; ec->lbgn_upper = 200;
ec->Lbgn_upper_acc = ec->Lbgn_upper << 13; ec->lbgn_upper_acc = ec->lbgn_upper << 13;
return ec; return ec;
...@@ -314,13 +314,13 @@ void oslec_flush(struct oslec_state *ec) ...@@ -314,13 +314,13 @@ void oslec_flush(struct oslec_state *ec)
{ {
int i; int i;
ec->Ltxacc = ec->Lrxacc = ec->Lcleanacc = ec->Lclean_bgacc = 0; ec->ltxacc = ec->lrxacc = ec->lcleanacc = ec->lclean_bgacc = 0;
ec->Ltx = ec->Lrx = ec->Lclean = ec->Lclean_bg = 0; ec->ltx = ec->lrx = ec->lclean = ec->lclean_bg = 0;
ec->tx_1 = ec->tx_2 = ec->rx_1 = ec->rx_2 = 0; ec->tx_1 = ec->tx_2 = ec->rx_1 = ec->rx_2 = 0;
ec->Lbgn = ec->Lbgn_acc = 0; ec->lbgn = ec->lbgn_acc = 0;
ec->Lbgn_upper = 200; ec->lbgn_upper = 200;
ec->Lbgn_upper_acc = ec->Lbgn_upper << 13; ec->lbgn_upper_acc = ec->lbgn_upper << 13;
ec->nonupdate_dwell = 0; ec->nonupdate_dwell = 0;
...@@ -332,7 +332,7 @@ void oslec_flush(struct oslec_state *ec) ...@@ -332,7 +332,7 @@ void oslec_flush(struct oslec_state *ec)
memset(ec->fir_taps16[i], 0, ec->taps * sizeof(int16_t)); memset(ec->fir_taps16[i], 0, ec->taps * sizeof(int16_t));
ec->curr_pos = ec->taps - 1; ec->curr_pos = ec->taps - 1;
ec->Pstates = 0; ec->pstates = 0;
} }
EXPORT_SYMBOL_GPL(oslec_flush); EXPORT_SYMBOL_GPL(oslec_flush);
...@@ -418,33 +418,33 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx) ...@@ -418,33 +418,33 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx)
new = (int)tx * (int)tx; new = (int)tx * (int)tx;
old = (int)ec->fir_state.history[ec->fir_state.curr_pos] * old = (int)ec->fir_state.history[ec->fir_state.curr_pos] *
(int)ec->fir_state.history[ec->fir_state.curr_pos]; (int)ec->fir_state.history[ec->fir_state.curr_pos];
ec->Pstates += ec->pstates +=
((new - old) + (1 << (ec->log2taps - 1))) >> ec->log2taps; ((new - old) + (1 << (ec->log2taps - 1))) >> ec->log2taps;
if (ec->Pstates < 0) if (ec->pstates < 0)
ec->Pstates = 0; ec->pstates = 0;
} }
/* Calculate short term average levels using simple single pole IIRs */ /* Calculate short term average levels using simple single pole IIRs */
ec->Ltxacc += abs(tx) - ec->Ltx; ec->ltxacc += abs(tx) - ec->ltx;
ec->Ltx = (ec->Ltxacc + (1 << 4)) >> 5; ec->ltx = (ec->ltxacc + (1 << 4)) >> 5;
ec->Lrxacc += abs(rx) - ec->Lrx; ec->lrxacc += abs(rx) - ec->lrx;
ec->Lrx = (ec->Lrxacc + (1 << 4)) >> 5; ec->lrx = (ec->lrxacc + (1 << 4)) >> 5;
/* Foreground filter */ /* Foreground filter */
ec->fir_state.coeffs = ec->fir_taps16[0]; ec->fir_state.coeffs = ec->fir_taps16[0];
echo_value = fir16(&ec->fir_state, tx); echo_value = fir16(&ec->fir_state, tx);
ec->clean = rx - echo_value; ec->clean = rx - echo_value;
ec->Lcleanacc += abs(ec->clean) - ec->Lclean; ec->lcleanacc += abs(ec->clean) - ec->lclean;
ec->Lclean = (ec->Lcleanacc + (1 << 4)) >> 5; ec->lclean = (ec->lcleanacc + (1 << 4)) >> 5;
/* Background filter */ /* Background filter */
echo_value = fir16(&ec->fir_state_bg, tx); echo_value = fir16(&ec->fir_state_bg, tx);
clean_bg = rx - echo_value; clean_bg = rx - echo_value;
ec->Lclean_bgacc += abs(clean_bg) - ec->Lclean_bg; ec->lclean_bgacc += abs(clean_bg) - ec->lclean_bg;
ec->Lclean_bg = (ec->Lclean_bgacc + (1 << 4)) >> 5; ec->lclean_bg = (ec->lclean_bgacc + (1 << 4)) >> 5;
/* Background Filter adaption */ /* Background Filter adaption */
...@@ -455,7 +455,7 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx) ...@@ -455,7 +455,7 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx)
ec->factor = 0; ec->factor = 0;
ec->shift = 0; ec->shift = 0;
if ((ec->nonupdate_dwell == 0)) { if ((ec->nonupdate_dwell == 0)) {
int P, logP, shift; int p, logp, shift;
/* Determine: /* Determine:
...@@ -490,9 +490,9 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx) ...@@ -490,9 +490,9 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx)
for a divide versus a top_bit() implementation. for a divide versus a top_bit() implementation.
*/ */
P = MIN_TX_POWER_FOR_ADAPTION + ec->Pstates; p = MIN_TX_POWER_FOR_ADAPTION + ec->pstates;
logP = top_bit(P) + ec->log2taps; logp = top_bit(p) + ec->log2taps;
shift = 30 - 2 - logP; shift = 30 - 2 - logp;
ec->shift = shift; ec->shift = shift;
lms_adapt_bg(ec, clean_bg, shift); lms_adapt_bg(ec, clean_bg, shift);
...@@ -502,7 +502,7 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx) ...@@ -502,7 +502,7 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx)
near end speech */ near end speech */
ec->adapt = 0; ec->adapt = 0;
if ((ec->Lrx > MIN_RX_POWER_FOR_ADAPTION) && (ec->Lrx > ec->Ltx)) if ((ec->lrx > MIN_RX_POWER_FOR_ADAPTION) && (ec->lrx > ec->ltx))
ec->nonupdate_dwell = DTD_HANGOVER; ec->nonupdate_dwell = DTD_HANGOVER;
if (ec->nonupdate_dwell) if (ec->nonupdate_dwell)
ec->nonupdate_dwell--; ec->nonupdate_dwell--;
...@@ -515,9 +515,9 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx) ...@@ -515,9 +515,9 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx)
if ((ec->adaption_mode & ECHO_CAN_USE_ADAPTION) && if ((ec->adaption_mode & ECHO_CAN_USE_ADAPTION) &&
(ec->nonupdate_dwell == 0) && (ec->nonupdate_dwell == 0) &&
/* (ec->Lclean_bg < 0.875*ec->Lclean) */ /* (ec->Lclean_bg < 0.875*ec->Lclean) */
(8 * ec->Lclean_bg < 7 * ec->Lclean) && (8 * ec->lclean_bg < 7 * ec->lclean) &&
/* (ec->Lclean_bg < 0.125*ec->Ltx) */ /* (ec->Lclean_bg < 0.125*ec->Ltx) */
(8 * ec->Lclean_bg < ec->Ltx)) { (8 * ec->lclean_bg < ec->ltx)) {
if (ec->cond_met == 6) { if (ec->cond_met == 6) {
/* /*
* BG filter has had better results for 6 consecutive * BG filter has had better results for 6 consecutive
...@@ -541,14 +541,14 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx) ...@@ -541,14 +541,14 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx)
* non-linearity in the channel.". * non-linearity in the channel.".
*/ */
if ((16 * ec->Lclean < ec->Ltx)) { if ((16 * ec->lclean < ec->ltx)) {
/* /*
* Our e/c has improved echo by at least 24 dB (each * Our e/c has improved echo by at least 24 dB (each
* factor of 2 is 6dB, so 2*2*2*2=16 is the same as * factor of 2 is 6dB, so 2*2*2*2=16 is the same as
* 6+6+6+6=24dB) * 6+6+6+6=24dB)
*/ */
if (ec->adaption_mode & ECHO_CAN_USE_CNG) { if (ec->adaption_mode & ECHO_CAN_USE_CNG) {
ec->cng_level = ec->Lbgn; ec->cng_level = ec->lbgn;
/* /*
* Very elementary comfort noise generation. * Very elementary comfort noise generation.
...@@ -571,10 +571,10 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx) ...@@ -571,10 +571,10 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx)
} else if (ec->adaption_mode & ECHO_CAN_USE_CLIP) { } else if (ec->adaption_mode & ECHO_CAN_USE_CLIP) {
/* This sounds much better than CNG */ /* This sounds much better than CNG */
if (ec->clean_nlp > ec->Lbgn) if (ec->clean_nlp > ec->lbgn)
ec->clean_nlp = ec->Lbgn; ec->clean_nlp = ec->lbgn;
if (ec->clean_nlp < -ec->Lbgn) if (ec->clean_nlp < -ec->lbgn)
ec->clean_nlp = -ec->Lbgn; ec->clean_nlp = -ec->lbgn;
} else { } else {
/* /*
* just mute the residual, doesn't sound very * just mute the residual, doesn't sound very
...@@ -593,9 +593,9 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx) ...@@ -593,9 +593,9 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx)
* level signals like near end speech. When combined * level signals like near end speech. When combined
* with CNG or especially CLIP seems to work OK. * with CNG or especially CLIP seems to work OK.
*/ */
if (ec->Lclean < 40) { if (ec->lclean < 40) {
ec->Lbgn_acc += abs(ec->clean) - ec->Lbgn; ec->lbgn_acc += abs(ec->clean) - ec->lbgn;
ec->Lbgn = (ec->Lbgn_acc + (1 << 11)) >> 12; ec->lbgn = (ec->lbgn_acc + (1 << 11)) >> 12;
} }
} }
} }
......
...@@ -139,24 +139,24 @@ struct oslec_state { ...@@ -139,24 +139,24 @@ struct oslec_state {
int adaption_mode; int adaption_mode;
int cond_met; int cond_met;
int32_t Pstates; int32_t pstates;
int16_t adapt; int16_t adapt;
int32_t factor; int32_t factor;
int16_t shift; int16_t shift;
/* Average levels and averaging filter states */ /* Average levels and averaging filter states */
int Ltxacc; int ltxacc;
int Lrxacc; int lrxacc;
int Lcleanacc; int lcleanacc;
int Lclean_bgacc; int lclean_bgacc;
int Ltx; int ltx;
int Lrx; int lrx;
int Lclean; int lclean;
int Lclean_bg; int lclean_bg;
int Lbgn; int lbgn;
int Lbgn_acc; int lbgn_acc;
int Lbgn_upper; int lbgn_upper;
int Lbgn_upper_acc; int lbgn_upper_acc;
/* foreground and background filter states */ /* foreground and background filter states */
struct fir16_state_t fir_state; struct fir16_state_t fir_state;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment