123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
-
-
- #include "d_plsf.h"
- const char d_plsf_5_id[] = "@(#)$Id $" d_plsf_h;
-
- #include <stdlib.h>
- #include <stdio.h>
- #include "typedef.h"
- #include "basic_op.h"
- #include "count.h"
- #include "lsp_lsf.h"
- #include "reorder.h"
- #include "cnst.h"
- #include "copy.h"
- #include "q_plsf_5.tab"
- #define ALPHA 31128
- #define ONE_ALPHA 1639
-
- int D_plsf_5 (
- D_plsfState *st,
- Word16 bfi,
-
- Word16 *indice,
- Word16 *lsp1_q,
- Word16 *lsp2_q
- )
- {
- Word16 i;
- const Word16 *p_dico;
- Word16 temp, sign;
- Word16 lsf1_r[M], lsf2_r[M];
- Word16 lsf1_q[M], lsf2_q[M];
- test ();
- if (bfi != 0)
- {
-
- for (i = 0; i < M; i++)
- {
-
- lsf1_q[i] = add_ex (mult_ex (st->past_lsf_q[i], ALPHA),
- mult_ex (mean_lsf[i], ONE_ALPHA));
- move16 ();
- lsf2_q[i] = lsf1_q[i]; move16 ();
- }
-
- for (i = 0; i < M; i++)
- {
-
- temp = add_ex (mean_lsf[i], mult_ex (st->past_r_q[i],
- LSP_PRED_FAC_MR122));
- st->past_r_q[i] = sub_ex (lsf2_q[i], temp);
- move16 ();
- }
- }
- else
-
- {
-
- p_dico = &dico1_lsf[shl_ex (indice[0], 2)];move16 ();
- lsf1_r[0] = *p_dico++; move16 ();
- lsf1_r[1] = *p_dico++; move16 ();
- lsf2_r[0] = *p_dico++; move16 ();
- lsf2_r[1] = *p_dico++; move16 ();
- p_dico = &dico2_lsf[shl_ex (indice[1], 2)];move16 ();
- lsf1_r[2] = *p_dico++; move16 ();
- lsf1_r[3] = *p_dico++; move16 ();
- lsf2_r[2] = *p_dico++; move16 ();
- lsf2_r[3] = *p_dico++; move16 ();
- sign = indice[2] & 1; logic16 ();
- i = shr_ex (indice[2], 1);
- p_dico = &dico3_lsf[shl_ex (i, 2)]; move16 ();
- test ();
- if (sign == 0)
- {
- lsf1_r[4] = *p_dico++; move16 ();
- lsf1_r[5] = *p_dico++; move16 ();
- lsf2_r[4] = *p_dico++; move16 ();
- lsf2_r[5] = *p_dico++; move16 ();
- }
- else
- {
- lsf1_r[4] = negate_ex (*p_dico++); move16 ();
- lsf1_r[5] = negate_ex (*p_dico++); move16 ();
- lsf2_r[4] = negate_ex (*p_dico++); move16 ();
- lsf2_r[5] = negate_ex (*p_dico++); move16 ();
- }
- p_dico = &dico4_lsf[shl_ex (indice[3], 2)];move16 ();
- lsf1_r[6] = *p_dico++; move16 ();
- lsf1_r[7] = *p_dico++; move16 ();
- lsf2_r[6] = *p_dico++; move16 ();
- lsf2_r[7] = *p_dico++; move16 ();
- p_dico = &dico5_lsf[shl_ex (indice[4], 2)];move16 ();
- lsf1_r[8] = *p_dico++; move16 ();
- lsf1_r[9] = *p_dico++; move16 ();
- lsf2_r[8] = *p_dico++; move16 ();
- lsf2_r[9] = *p_dico++; move16 ();
-
- for (i = 0; i < M; i++)
- {
- temp = add_ex (mean_lsf[i], mult_ex (st->past_r_q[i],
- LSP_PRED_FAC_MR122));
- lsf1_q[i] = add_ex (lsf1_r[i], temp);
- move16 ();
- lsf2_q[i] = add_ex (lsf2_r[i], temp);
- move16 ();
- st->past_r_q[i] = lsf2_r[i]; move16 ();
- }
- }
-
- Reorder_lsf (lsf1_q, LSF_GAP, M);
- Reorder_lsf (lsf2_q, LSF_GAP, M);
- Copy (lsf2_q, st->past_lsf_q, M);
-
- Lsf_lsp (lsf1_q, lsp1_q, M);
- Lsf_lsp (lsf2_q, lsp2_q, M);
- return 0;
- }
|