123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
-
- #include "cbsearch.h"
- const char cbsearch_id[] = "@(#)$Id $" cbsearch_h;
-
- #include <stdlib.h>
- #include <stdio.h>
- #include "typedef.h"
- #include "c2_9pf.h"
- #include "c2_11pf.h"
- #include "c3_14pf.h"
- #include "c4_17pf.h"
- #include "c8_31pf.h"
- #include "c1035pf.h"
- #include "mode.h"
- #include "basic_op.h"
- #include "count.h"
- #include "cnst.h"
- int cbsearch(Word16 x[],
- Word16 h[],
-
-
- Word16 T0,
- Word16 pitch_sharp,
- Word16 gain_pit,
- Word16 res2[],
- Word16 code[],
- Word16 y[],
- Word16 **anap,
- enum Mode mode,
- Word16 subNr)
- {
- Word16 index;
- Word16 i, temp, pit_sharpTmp;
-
-
-
- test (); test ();
- if ((sub_ex (mode, MR475) == 0) || (sub_ex (mode, MR515) == 0))
- { move16 ();
- *(*anap)++ = code_2i40_9bits(subNr, x, h, T0, pitch_sharp,
- code, y, &index);
- *(*anap)++ = index; move16 ();
- }
- else if (sub_ex (mode, MR59) == 0)
- {
- test (); move16 ();
- *(*anap)++ = code_2i40_11bits(x, h, T0, pitch_sharp, code, y, &index);
- *(*anap)++ = index; move16 ();
- }
- else if (sub_ex (mode, MR67) == 0)
- {
- test (); test (); move16 ();
- *(*anap)++ = code_3i40_14bits(x, h, T0, pitch_sharp, code, y, &index);
- *(*anap)++ = index; move16 ();
- }
- else if (sub_ex (mode, MR74) == 0 || sub_ex (mode, MR795) == 0)
- {
- test (); test (); test (); move16 ();
- *(*anap)++ = code_4i40_17bits(x, h, T0, pitch_sharp, code, y, &index);
- *(*anap)++ = index; move16 ();
- }
- else if (sub_ex (mode, MR102) == 0)
- {
- test (); test (); test ();
-
-
-
- pit_sharpTmp = shl_ex (pitch_sharp, 1);
- for (i = T0; i < L_SUBFR; i++)
- {
- temp = mult_ex(h[i - T0], pit_sharpTmp);
- h[i] = add_ex(h[i], temp); move16 ();
- }
-
- code_8i40_31bits (x, res2, h, code, y, *anap);
- *anap += 7; add_ex(0,0);
-
-
- for (i = T0; i < L_SUBFR; i++)
- {
- temp = mult_ex (code[i - T0], pit_sharpTmp);
- code[i] = add_ex (code[i], temp); move16 ();
- }
- }
- else
- {
-
- test (); test (); test ();
-
-
-
- pit_sharpTmp = shl_ex (gain_pit, 1);
-
- for (i = T0; i < L_SUBFR; i++)
- {
- temp = mult_ex(h[i - T0], pit_sharpTmp);
- h[i] = add_ex(h[i], temp); move16 ();
- }
-
-
- code_10i40_35bits (x, res2, h, code, y, *anap);
- *anap += 10; add_ex(0,0);
-
-
-
- for (i = T0; i < L_SUBFR; i++)
- {
- temp = mult_ex (code[i - T0], pit_sharpTmp);
- code[i] = add_ex (code[i], temp); move16 ();
- }
- }
- return 0;
- }
|