FreeCalypso > hg > fc-magnetite
annotate src/cs/layer1/audio_cfile/l1audio_func.c @ 516:1ed9de6c90bd
src/g23m-gsm/sms/sms_for.c: bogus malloc removed
The new error handling code that was not present in TCS211 blob version
contains a malloc call that is bogus for 3 reasons:
1) The memory allocation in question is not needed in the first place;
2) libc malloc is used instead of one of the firmware's proper ways;
3) The memory allocation is made inside a function and then never freed,
i.e., a memory leak.
This bug was caught in gcc-built FreeCalypso fw projects (Citrine
and Selenite) because our gcc environment does not allow any use of
libc malloc (any reference to malloc produces a link failure),
but this code from TCS3.2 is wrong even for Magnetite: if this code
path is executed repeatedly over a long time, the many small allocations
made by this malloc call without a subsequent free will eventually
exhaust the malloc heap provided by the TMS470 environment, malloc will
start returning NULL, and the bogus code will treat it as an error.
Because the memory allocation in question is not needed at all,
the fix entails simply removing it.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 22 Jul 2018 06:04:49 +0000 |
parents | b870b6a44d31 |
children |
rev | line source |
---|---|
234
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /************* Revision Controle System Header ************* |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * GSM Layer 1 software |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * L1AUDIO_FUNC.C |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 * Filename l1audio_func.c |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 * Copyright 2003 (C) Texas Instruments |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 * |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 ************* Revision Controle System Header *************/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 /************************************/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 /* Include files... */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 /************************************/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 #include "nucleus.h" //omaps00090550 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 #include "l1_macro.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 #include "l1_macro.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 #include "l1_confg.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 //#include "l1audio_defty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 #if (AUDIO_TASK == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 #include "l1_types.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 #include "sys_types.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 #if (CODE_VERSION == SIMULATION) && (AUDIO_SIMULATION) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 #include <stdlib.h> |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 #include <string.h> |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 #include "iq.h" // Debug / Init hardware ("eva3.lib") |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 #include "l1_ver.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 #include "l1_const.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 #include "l1_signa.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 #if TESTMODE |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 #include "l1tm_defty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 #include "l1audio_const.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 #include "l1audio_cust.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 #include "l1audio_signa.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 #include "l1audio_defty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 #include "l1audio_msgty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 #include "l1audio_abb.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 #include "l1audio_btapi.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 #if (L1_GTT == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 #include "l1gtt_const.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 #include "l1gtt_defty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 //added here from e-sample for AAC |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 #if (L1_DYN_DSP_DWNLD == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 #include "l1_dyn_dwl_const.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 #include "l1_dyn_dwl_defty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 #if (L1_MP3 == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 #include "l1mp3_defty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 #if (L1_MIDI == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 #include "l1midi_defty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 //added here from e-sample for AAC |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 #if (L1_AAC == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 #include "l1aac_defty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 #include "l1_defty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 #include "cust_os.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 #include "l1_msgty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 #include "l1_varex.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 #include "l1_mftab.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 #include "l1_tabs.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 #include "l1_ctl.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 #include "l1_time.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 #include "l1_scen.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 #if TESTMODE |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 #include "l1tm_msgty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 #include "l1tm_signa.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 #include "l1tm_varex.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 #endif // TESTMODE |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 #if (L1_STEREOPATH == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 #include "sys_dma.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 #include "sys_inth.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 #include "abb.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 #include "l1audio_stereo.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 #else |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 // Layer1 and debug include files. |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 #include <ctype.h> |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 #include <math.h> |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 #include "l1_ver.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 #include "l1_const.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 #include "l1_signa.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 #if TESTMODE |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 #include "l1tm_defty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 #include "l1audio_const.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 #include "l1audio_cust.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 #include "l1audio_signa.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 #include "l1audio_defty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 #include "l1audio_msgty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 #include "l1audio_abb.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 #if (L1_GTT == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116 #include "l1gtt_const.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 #include "l1gtt_defty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 //added here from e-sample for AAC |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 #if (L1_DYN_DSP_DWNLD == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 #include "l1_dyn_dwl_const.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
122 #include "l1_dyn_dwl_defty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 #if (L1_MP3 == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 #include "l1mp3_defty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 #include"l1mp3_const.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
128 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
129 #if (L1_MIDI == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
130 #include "l1midi_defty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
131 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 //added here from e-sample for AAC |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
133 #if (L1_AAC == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
134 #include "l1aac_defty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 #include"l1aac_const.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
136 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
138 #include "l1_defty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
139 #include "cust_os.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
140 #include "l1_msgty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
141 #include "tpudrv.h" // TPU drivers. ("eva3.lib") |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
142 #include "l1_varex.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
143 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
144 #include "l1_proto.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
145 #include "l1_mftab.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
146 #include "l1_tabs.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
147 #include "mem.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
148 #include "armio.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
149 #include "timer.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
150 #include "timer1.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
151 #include "dma.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
152 #include "inth.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
153 #include "ulpd.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
154 #include "rhea_arm.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
155 #include "clkm.h" // Clockm ("eva3.lib") |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
156 #include "l1_ctl.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
157 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
158 #if TESTMODE |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
159 #include "l1tm_msgty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
160 #include "l1tm_signa.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
161 #include "l1tm_varex.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
162 #endif // TESTMODE |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
163 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
164 #if (L1_STEREOPATH == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
165 #include "sys_dma.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
166 #include "sys_inth.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
167 #include "abb.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
168 #include "l1audio_stereo.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
169 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
170 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
171 #include "l1_time.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
172 #if L2_L3_SIMUL |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
173 #include "l1_scen.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
174 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
175 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
176 #if (OP_RIV_AUDIO == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
177 #include "rv_general.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
178 #include "audio_api.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
179 #include "audio_structs_i.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
180 #include "audio_var_i.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
181 #include "audio_macro_i.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
182 #include "audio_const_i.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
183 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
184 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
185 #include "l1audio_macro.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
186 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
187 /**************************************/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
188 /* Prototypes for L1S audio function */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
189 /**************************************/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
190 UWORD8 copy_data_from_buffer (UWORD8 session_id, UWORD16 *buffer_size, UWORD16 **ptr_buf, UWORD16 data_size, API *ptr_dst); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
191 UWORD8 copy_data_to_buffer (UWORD8 session_id, UWORD16 *buffer_size, UWORD16 **ptr_buf, UWORD16 data_size, API *ptr_src); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
192 #if (MELODY_E2) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
193 UWORD16 audio_twentyms_to_TDMA_convertion(UWORD16 twentyms_value); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
194 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
195 #if (MELODY_E2) || (L1_VOICE_MEMO_AMR) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
196 UWORD8 copy_byte_data_from_buffer (UWORD8 session_id, UWORD16 *buffer_size, UWORD8 **ptr_buf, UWORD16 data_size, UWORD8 *ptr_dst); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
197 UWORD8 copy_byte_data_to_buffer (UWORD8 session_id, UWORD16 *buffer_size, UWORD8 **ptr_buf, UWORD16 data_size, UWORD8 *ptr_src); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
198 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
199 #if (L1_VOICE_MEMO_AMR) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
200 UWORD8 copy_byte_data_le_from_buffer (UWORD8 session_id, UWORD16 *buffer_size, UWORD8 **ptr_buf, UWORD16 data_size, API *ptr_dst); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
201 UWORD8 copy_byte_data_le_to_buffer (UWORD8 session_id, UWORD16 *buffer_size, UWORD8 **ptr_buf, UWORD16 data_size, API *ptr_src); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
202 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
203 #if (L1_EXT_AUDIO_MGT == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
204 void l1_ext_audio_mgt_dma_handler(SYS_UWORD16 dma_status); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
205 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
206 #if (L1_IIR == 2) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
207 void l1_audio_iir4x_copy_params(); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
208 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
209 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
210 #if (L1_AGC_UL== 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
211 void l1_audio_agc_ul_copy_params(); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
212 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
213 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
214 #if (L1_AGC_DL== 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
215 void l1_audio_agc_dl_copy_params(); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
216 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
217 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
218 #if (L1_DRC == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
219 void l1_audio_drc1x_copy_params(); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
220 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
221 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
222 #if(L1_BT_AUDIO ==1)||(L1_WCM ==1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
223 void l1_audio_manager(UWORD8 *src, UWORD16 size); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
224 void l1_audio_bt_init(UINT16 media_buf_size); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
225 extern void l1mp3_dma_it_handler(SYS_UWORD16 d_dma_channel_it_status); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
226 extern void l1aac_dma_it_handler(SYS_UWORD16 d_dma_channel_it_status); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
227 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
228 #if(L1_BT_AUDIO ==1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
229 T_L1_BT_AUDIO bt_audio; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
230 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
231 extern T_MP3_DMA_PARAM *mp3_dma; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
232 extern T_AAC_DMA_PARAM *aac_dma; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
233 extern void l1a_bt_audio_noti_process(); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
234 extern UWORD16 pending_dec_req; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
235 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
236 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
237 /**************************************/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
238 /* External prototypes */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
239 /**************************************/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
240 extern UWORD8 Cust_get_pointer (UWORD16 **ptr, UWORD16 *buffer_size, UWORD8 session_id); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
241 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
242 #if ((L1_STEREOPATH == 1) && (OP_L1_STANDALONE == 1)) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
243 extern void l1tm_stereopath_DMA_handler(SYS_UWORD16 dma_status); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
244 #if TESTMODE |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
245 extern T_STP_DRV_MCU_DSP *stp_drv_ndb; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
246 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
247 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
248 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
249 #if (L1_EXT_AUDIO_MGT == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
250 extern NU_HISR EXT_AUDIO_MGT_hisr; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
251 extern T_MIDI_DMA_PARAM midi_buf; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
252 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
253 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
254 #if (L1_DRC == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
255 extern T_DRC_MCU_DSP *drc_ndb; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
256 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
257 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
258 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
259 /* copy_data_from_buffer() */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
260 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
261 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
262 /* Parameters : session_id */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
263 /* buffer_size */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
264 /* data_size */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
265 /* ptr_dst */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
266 /* ptr_src */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
267 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
268 /* Return : error_id */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
269 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
270 /* Description : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
271 /* This function copies the data from the buffer */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
272 /* (buffer size: buffer_size, start address: ptr_buf) to */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
273 /* the destination indicated by ptr_dst. The size of the */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
274 /* data to download is data_size. The session_id */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
275 /* indicates to the custom flash manager the type of */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
276 /* data. */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
277 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
278 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
279 UWORD8 copy_data_from_buffer (UWORD8 session_id, UWORD16 *buffer_size, UWORD16 **ptr_buf, UWORD16 data_size, API *ptr_dst) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
280 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
281 UWORD8 error_id = 0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
282 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
283 while (data_size != 0) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
284 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
285 while( (data_size !=0) && (*buffer_size != 0) ) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
286 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
287 *ptr_dst++ = *(*ptr_buf)++; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
288 data_size--; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
289 (*buffer_size)--; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
290 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
291 // A new buffer is requested in order to finish to copy the data |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
292 if ( data_size != 0) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
293 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
294 *buffer_size = data_size; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
295 error_id = Cust_get_pointer( ptr_buf, buffer_size, session_id); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
296 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
297 // An error is occured |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
298 if (error_id) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
299 return(error_id); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
300 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
301 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
302 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
303 return(error_id); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
304 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
305 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
306 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
307 /* copy_data_to_buffer() */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
308 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
309 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
310 /* Parameters : session_id */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
311 /* buffer_size */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
312 /* data_size */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
313 /* ptr_dst */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
314 /* ptr_src */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
315 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
316 /* Return : error_id */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
317 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
318 /* Description : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
319 /* This function copies the data to the buffer */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
320 /* (buffer size: buffer_size, start address: ptr_buf) */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
321 /* from the source indicated by ptr_src. The size of the */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
322 /* data to save is data_size. The session_id */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
323 /* indicates to the custom flash manager the type of */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
324 /* data. */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
325 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
326 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
327 UWORD8 copy_data_to_buffer (UWORD8 session_id, UWORD16 *buffer_size, UWORD16 **ptr_buf, UWORD16 data_size, API *ptr_src) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
328 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
329 UWORD8 error_id = 0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
330 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
331 while (data_size != 0) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
332 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
333 while( (data_size !=0) && (*buffer_size != 0) ) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
334 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
335 *(*ptr_buf)++ = *ptr_src++; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
336 data_size--; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
337 (*buffer_size)--; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
338 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
339 // A new buffer is requested in order to finish to copy the data |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
340 if (data_size != 0) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
341 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
342 *buffer_size = data_size; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
343 error_id = Cust_get_pointer(ptr_buf, buffer_size, session_id); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
344 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
345 // An error is occured |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
346 if (error_id) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
347 return(error_id); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
348 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
349 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
350 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
351 return(error_id); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
352 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
353 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
354 #if (MELODY_E2) || (L1_VOICE_MEMO_AMR) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
355 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
356 /* copy_byte_data_from_buffer() */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
357 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
358 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
359 /* Parameters : session_id */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
360 /* buffer_size */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
361 /* data_size */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
362 /* ptr_dst */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
363 /* ptr_src */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
364 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
365 /* Return : error_id */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
366 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
367 /* Description : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
368 /* This function copies byte per byte the data from */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
369 /* the buffer (buffer size (in byte): buffer_size, */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
370 /* start address: ptr_buf) to the destination indicated */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
371 /* by ptr_dst. The size of the data to download is */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
372 /* data_size(in byte). The session_id indicates to the */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
373 /* custom flash manager the type of data. */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
374 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
375 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
376 UWORD8 copy_byte_data_from_buffer (UWORD8 session_id, UWORD16 *buffer_size, UWORD8 **ptr_buf, UWORD16 data_size, UWORD8 *ptr_dst) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
377 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
378 UWORD8 error_id = 0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
379 UWORD16 requested_size; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
380 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
381 while (data_size != 0) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
382 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
383 while( (data_size !=0) && (*buffer_size != 0) ) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
384 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
385 *ptr_dst++ = *(*ptr_buf)++; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
386 data_size--; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
387 (*buffer_size)--; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
388 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
389 // A new buffer is requested in order to finish to copy the data |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
390 if ( data_size != 0) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
391 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
392 // Calculate the size of the data to request in 16-bit word |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
393 if (*buffer_size & 0x0001) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
394 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
395 // The size is a odd value |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
396 requested_size = (data_size >> 1) + 1; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
397 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
398 else |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
399 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
400 // the size is an even value |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
401 requested_size = (data_size >> 1); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
402 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
403 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
404 error_id = Cust_get_pointer( (UWORD16 **)ptr_buf, &requested_size, session_id); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
405 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
406 // An error is occured |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
407 if (error_id) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
408 return(error_id); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
409 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
410 *buffer_size = (requested_size << 1); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
411 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
412 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
413 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
414 return(error_id); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
415 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
416 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
417 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
418 /* copy_data_to_buffer() */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
419 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
420 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
421 /* Parameters : session_id */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
422 /* buffer_size */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
423 /* data_size */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
424 /* ptr_dst */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
425 /* ptr_src */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
426 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
427 /* Return : error_id */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
428 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
429 /* Description : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
430 /* This function copies byte per byte the data to the */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
431 /* buffer (buffer size in byte: buffer_size, start */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
432 /* address: ptr_buf) from the source indicated by */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
433 /* ptr_src. The size in byte of the data to save is */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
434 /* data_size. The session_id indicates to the custom */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
435 /* flash manager the type of data. */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
436 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
437 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
438 UWORD8 copy_byte_data_to_buffer (UWORD8 session_id, UWORD16 *buffer_size, UWORD8 **ptr_buf, UWORD16 data_size, UWORD8 *ptr_src) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
439 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
440 UWORD8 error_id = 0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
441 UWORD16 requested_size; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
442 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
443 while (data_size != 0) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
444 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
445 while( (data_size !=0) && (*buffer_size != 0) ) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
446 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
447 *(*ptr_buf)++ = *ptr_src++; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
448 data_size--; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
449 (*buffer_size)--; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
450 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
451 // A new buffer is requested in order to finish to copy the data |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
452 if (data_size != 0) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
453 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
454 // Calculate the size of the data to request in 16-bit word |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
455 if (*buffer_size & 0x0001) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
456 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
457 // The size is a odd value |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
458 requested_size = (data_size >> 1) + 1; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
459 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
460 else |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
461 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
462 // the size is an even value |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
463 requested_size = (data_size >> 1); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
464 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
465 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
466 error_id = Cust_get_pointer((UWORD16 **)ptr_buf, &requested_size, session_id); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
467 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
468 // An error is occured |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
469 if (error_id) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
470 return(error_id); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
471 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
472 *buffer_size = (requested_size << 1); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
473 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
474 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
475 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
476 return(error_id); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
477 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
478 #endif //#if (MELODY_E2) || (L1_VOICE_MEMO_AMR) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
479 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
480 #if (MELODY_E2) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
481 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
482 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
483 /* audio_twentyms_to_TDMA_convertion() */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
484 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
485 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
486 /* Parameters : 20ms value */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
487 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
488 /* Return : TDMA value */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
489 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
490 /* Description : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
491 /* This function convert a duration from 20ms unit to */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
492 /* TDMA unit. */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
493 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
494 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
495 UWORD16 audio_twentyms_to_TDMA_convertion(UWORD16 twentyms_value) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
496 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
497 UWORD16 TDMA_value; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
498 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
499 // 20ms # 4 TDMA |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
500 TDMA_value = twentyms_value << 2; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
501 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
502 // Compensation factor: 1 TDMA each 60ms. |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
503 TDMA_value += (twentyms_value/3); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
504 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
505 return(TDMA_value); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
506 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
507 #endif // MELODY_E2 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
508 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
509 #if (L1_VOICE_MEMO_AMR) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
510 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
511 /* copy_byte_data_le_from_buffer() */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
512 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
513 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
514 /* Parameters : session_id */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
515 /* buffer_size */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
516 /* data_size */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
517 /* ptr_dst */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
518 /* ptr_src */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
519 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
520 /* Return : error_id */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
521 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
522 /* Description : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
523 /* This function copies byte per byte the data from */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
524 /* the buffer (buffer size (in byte): buffer_size, */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
525 /* start address: ptr_buf) to the destination indicated */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
526 /* by ptr_dst. The size of the data to download is */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
527 /* data_size(in byte). The session_id indicates to the */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
528 /* custom flash manager the type of data. */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
529 /* Data in buffer is expected to be big-endian and will */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
530 /* be copied in order to retrieve little-endian order in */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
531 /* ptr_dst */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
532 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
533 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
534 UWORD8 copy_byte_data_le_from_buffer (UWORD8 session_id, UWORD16 *buffer_size, UWORD8 **ptr_buf, UWORD16 data_size, API *ptr_dst) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
535 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
536 UWORD8 error_id = 0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
537 UWORD16 requested_size; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
538 UWORD16 data_size_inv = 0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
539 UWORD16 temp_uword16; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
540 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
541 while (data_size_inv != data_size) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
542 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
543 /* we go from 0 to data_size copying to MSB (even numbers) then LSB (odd numbers) of DSP */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
544 while( (data_size_inv != data_size) && (*buffer_size != 0) ) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
545 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
546 if (data_size_inv & 0x0001) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
547 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
548 temp_uword16 |= *(*ptr_buf)++; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
549 *(ptr_dst)++ = temp_uword16; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
550 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
551 else |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
552 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
553 temp_uword16 = (*(*ptr_buf)++ << 8); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
554 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
555 data_size_inv++; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
556 (*buffer_size)--; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
557 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
558 // A new buffer is requested in order to finish to copy the data |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
559 if ( data_size_inv != data_size) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
560 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
561 // Calculate the size of the data to request in 16-bit word |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
562 if ((data_size - data_size_inv) & 0x0001) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
563 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
564 // The size is an odd value |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
565 requested_size = ((data_size - data_size_inv) >> 1) + 1; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
566 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
567 else |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
568 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
569 // the size is an even value |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
570 requested_size = ((data_size - data_size_inv) >> 1); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
571 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
572 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
573 error_id = Cust_get_pointer((UWORD16 **)ptr_buf, &requested_size, session_id); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
574 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
575 // An error is occured |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
576 if (error_id) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
577 return(error_id); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
578 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
579 *buffer_size = (requested_size << 1); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
580 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
581 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
582 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
583 if (data_size & 0x0001) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
584 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
585 *(ptr_dst)++ = temp_uword16; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
586 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
587 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
588 return(error_id); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
589 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
590 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
591 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
592 /* copy_byte_data_le_to_buffer() */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
593 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
594 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
595 /* Parameters : session_id */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
596 /* buffer_size */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
597 /* data_size */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
598 /* ptr_dst */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
599 /* ptr_src */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
600 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
601 /* Return : error_id */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
602 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
603 /* Description : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
604 /* This function copies byte per byte the data to the */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
605 /* buffer (buffer size in byte: buffer_size, start */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
606 /* address: ptr_buf) from the source indicated by */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
607 /* ptr_src. The size in byte of the data to save is */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
608 /* data_size. The session_id indicates to the custom */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
609 /* flash manager the type of data. */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
610 /* Data is expected to be little-endian in ptr_src and */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
611 /* will be copied in order to retrieve big-endian */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
612 /* order in buffer */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
613 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
614 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
615 UWORD8 copy_byte_data_le_to_buffer (UWORD8 session_id, UWORD16 *buffer_size, UWORD8 **ptr_buf, UWORD16 data_size, API *ptr_src) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
616 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
617 UWORD8 error_id = 0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
618 UWORD8 data_size_inv = 0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
619 UWORD16 requested_size; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
620 UWORD16 temp_uword16; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
621 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
622 /* we go from 0 to data_size copying MSB (even numbers) then LSB (odd numbers) from DSP */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
623 while (data_size_inv != data_size) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
624 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
625 while( (data_size_inv != data_size) && (*buffer_size != 0) ) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
626 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
627 /* if data_size_inv is odd, we need the LSB of the DSP word */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
628 if (data_size_inv & 0x0001) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
629 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
630 *(*ptr_buf)++ = (UWORD8)(temp_uword16 & 0x00FF); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
631 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
632 /* if data_size_inv is even, we need the MSB of the DSP word */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
633 else |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
634 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
635 temp_uword16 = *(ptr_src)++; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
636 *(*ptr_buf)++ = (UWORD8)(temp_uword16 >> 8); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
637 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
638 data_size_inv++; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
639 (*buffer_size)--; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
640 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
641 // A new buffer is requested in order to finish to copy the data |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
642 if ( data_size_inv != data_size) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
643 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
644 // Calculate the size of the data to request in 16-bit word |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
645 if ((data_size - data_size_inv) & 0x0001) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
646 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
647 // The size is a odd value |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
648 requested_size = ((data_size - data_size_inv) >> 1) + 1; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
649 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
650 else |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
651 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
652 // the size is an even value |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
653 requested_size = ((data_size - data_size_inv) >> 1); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
654 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
655 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
656 error_id = Cust_get_pointer((UWORD16 **)ptr_buf, &requested_size, session_id); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
657 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
658 // An error occured |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
659 if (error_id) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
660 return(error_id); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
661 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
662 *buffer_size = (requested_size << 1); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
663 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
664 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
665 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
666 return(error_id); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
667 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
668 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
669 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
670 #if (L1_STEREOPATH == 1) && (CODE_VERSION == NOT_SIMULATION) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
671 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
672 /* l1_audio_api_handler() */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
673 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
674 /* Parameters : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
675 /* Return : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
676 /* Functionality : API int management */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
677 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
678 void l1_audio_api_handler(void) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
679 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
680 UWORD16 rootcause; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
681 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
682 if (l1a_l1s_com.stereopath_drv_task.parameters.feature_identifier == AUDIO_SP_TESTS_ID) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
683 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
684 #if (TESTMODE && (OP_L1_STANDALONE == 1)) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
685 rootcause = stp_drv_ndb->d_cport_api_dma_rootcause; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
686 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
687 l1tm_stereopath_DMA_handler((SYS_UWORD16) rootcause); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
688 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
689 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
690 } /* l1_audio_api_handler() */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
691 #endif // (L1_STEREOPATH == 1) && (CODE_VERSION == NOT_SIMULATION) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
692 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
693 #if (L1_EXT_AUDIO_MGT == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
694 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
695 /* l1_ext_audio_mgt_dma_handler() */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
696 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
697 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
698 /* Parameters : dma_status */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
699 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
700 /* Return : none */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
701 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
702 /* Description : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
703 /* This function is used to handle a DMA interrupt */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
704 /* that will notify to the external midi play process */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
705 /* that a new buffer is needed. */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
706 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
707 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
708 void l1_ext_audio_mgt_dma_handler(SYS_UWORD16 dma_status) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
709 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
710 NU_Activate_HISR(&EXT_AUDIO_MGT_hisr); // activate external MIDI HISR |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
711 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
712 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
713 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
714 #if (L1_LIMITER == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
715 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
716 /* l1_audio_lim_update_mul_low_high() */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
717 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
718 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
719 /* Parameters : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
720 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
721 /* Return : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
722 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
723 /* Description : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
724 /* ------------- */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
725 /* This function is used to update mul_low and mul_high */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
726 /* Limiter parameters in function to volume gain (Q15) */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
727 /* First the function read the last controlled volume */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
728 /* in the MCU/DSP API then it processed mul_low[0/1] */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
729 /* and mul_high[0/1] according to following equations: */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
730 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
731 /* thr_low = - thr_low_slope x volume + thr_low_0 */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
732 /* thr_high = - thr_high_slope x volume + thr_high_0 */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
733 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
734 /* mul_low[0] = 32767 / thr_low */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
735 /* mul_low[1] = 32767 x thr_low */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
736 /* mul_high[0] = 32767 / thr_high */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
737 /* mul_high[1] = 32767 x thr_high */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
738 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
739 void l1_audio_lim_update_mul_low_high() |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
740 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
741 #if (CODE_VERSION != SIMULATION) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
742 #if (ANLG_FAM == 3) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
743 WORD16 volume_q15 = ABB_Read_DLGain(); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
744 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
745 #if (ANLG_FAM == 11) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
746 WORD16 volume_q15 = (WORD16)(l1_audio_abb_Read_DLGain()); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
747 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
748 #else |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
749 WORD16 volume_q15 = 0x4000; // -6 dB for example in simulation |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
750 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
751 WORD16 thr_low, thr_high; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
752 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
753 /* Process Thr_low */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
754 thr_low = (- (l1a_l1s_com.limiter_task.parameters.thr_low_slope * volume_q15)>>15) + |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
755 l1a_l1s_com.limiter_task.parameters.thr_low_0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
756 // if (thr_low > 32767) //OMAPS00090550 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
757 // thr_low = 32767; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
758 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
759 /* Process Thr_high */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
760 thr_high = (- (l1a_l1s_com.limiter_task.parameters.thr_high_slope * volume_q15)>>15) + |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
761 l1a_l1s_com.limiter_task.parameters.thr_high_0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
762 // if (thr_high > 32767) //OMAPS00090550 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
763 // thr_high = 32767; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
764 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
765 /* Process amd store mul_low[0/1] */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
766 if (thr_low != 0) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
767 l1s_dsp_com.dsp_ndb_ptr->a_lim_mul_low[0] = 32767 / thr_low; // Q0 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
768 else |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
769 l1s_dsp_com.dsp_ndb_ptr->a_lim_mul_low[0] = 32767; // should never happen |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
770 l1s_dsp_com.dsp_ndb_ptr->a_lim_mul_low[1] = thr_low; // Q15 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
771 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
772 /* Process and store mul_high[0/1] */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
773 if (thr_high != 0) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
774 l1s_dsp_com.dsp_ndb_ptr->a_lim_mul_high[0] = 32767 / thr_high; // Q0 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
775 else |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
776 l1s_dsp_com.dsp_ndb_ptr->a_lim_mul_high[0] = 32767; // should never happen |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
777 l1s_dsp_com.dsp_ndb_ptr->a_lim_mul_high[1] = thr_high; // Q15 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
778 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
779 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
780 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
781 /* l1_audio_lim_update_mul_low_high() */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
782 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
783 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
784 /* Parameters : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
785 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
786 /* Return : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
787 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
788 /* Description : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
789 /* ------------- */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
790 /* This function MUST be called at each volume change in */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
791 /* order to request a limiter partial update. */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
792 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
793 void l1_audio_lim_partial_update() |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
794 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
795 // Set partial update command |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
796 l1a_l1s_com.limiter_task.command.partial_update = TRUE; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
797 // Force L1S execution |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
798 l1a_l1s_com.time_to_next_l1s_task = 0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
799 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
800 #endif // L1_LIMITER == 1 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
801 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
802 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
803 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
804 #if (L1_AGC_UL == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
805 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
806 /* l1_audio_agc_ul_copy_params */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
807 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
808 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
809 /* Parameters : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
810 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
811 /* Return : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
812 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
813 /* Description : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
814 /* ------------- */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
815 /* This function is used to copy the AGC UL 1x parameter */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
816 /* to API memory using a pointer */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
817 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
818 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
819 void l1_audio_agc_ul_copy_params() |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
820 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
821 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
822 l1s_dsp_com.dsp_ndb_ptr->d_agc_ul_control = l1a_l1s_com.agc_ul_task.parameters.control; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
823 l1s_dsp_com.dsp_ndb_ptr->d_agc_ul_frame_size = l1a_l1s_com.agc_ul_task.parameters.frame_size; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
824 l1s_dsp_com.dsp_ndb_ptr->d_agc_ul_targeted_level = l1a_l1s_com.agc_ul_task.parameters.targeted_level; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
825 l1s_dsp_com.dsp_ndb_ptr->d_agc_ul_signal_up = l1a_l1s_com.agc_ul_task.parameters.signal_up; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
826 l1s_dsp_com.dsp_ndb_ptr->d_agc_ul_signal_down = l1a_l1s_com.agc_ul_task.parameters.signal_down; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
827 l1s_dsp_com.dsp_ndb_ptr->d_agc_ul_max_scale = l1a_l1s_com.agc_ul_task.parameters.max_scale; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
828 l1s_dsp_com.dsp_ndb_ptr->d_agc_ul_gain_smooth_alpha = l1a_l1s_com.agc_ul_task.parameters.gain_smooth_alpha; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
829 l1s_dsp_com.dsp_ndb_ptr->d_agc_ul_gain_smooth_alpha_fast = l1a_l1s_com.agc_ul_task.parameters.gain_smooth_alpha_fast; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
830 l1s_dsp_com.dsp_ndb_ptr->d_agc_ul_gain_smooth_beta = l1a_l1s_com.agc_ul_task.parameters.gain_smooth_beta; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
831 l1s_dsp_com.dsp_ndb_ptr->d_agc_ul_gain_smooth_beta_fast = l1a_l1s_com.agc_ul_task.parameters.gain_smooth_beta_fast; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
832 l1s_dsp_com.dsp_ndb_ptr->d_agc_ul_gain_intp_flag = l1a_l1s_com.agc_ul_task.parameters.gain_intp_flag; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
833 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
834 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
835 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
836 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
837 #if (L1_AGC_DL == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
838 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
839 /* l1_audio_agc_dl_copy_params */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
840 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
841 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
842 /* Parameters : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
843 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
844 /* Return : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
845 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
846 /* Description : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
847 /* ------------- */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
848 /* This function is used to copy the AGC DL 1x parameter */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
849 /* to API memory using a pointer */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
850 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
851 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
852 void l1_audio_agc_dl_copy_params() |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
853 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
854 l1s_dsp_com.dsp_ndb_ptr->d_agc_dl_control = l1a_l1s_com.agc_dl_task.parameters.control; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
855 l1s_dsp_com.dsp_ndb_ptr->d_agc_dl_frame_size = l1a_l1s_com.agc_dl_task.parameters.frame_size; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
856 l1s_dsp_com.dsp_ndb_ptr->d_agc_dl_targeted_level = l1a_l1s_com.agc_dl_task.parameters.targeted_level; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
857 l1s_dsp_com.dsp_ndb_ptr->d_agc_dl_signal_up = l1a_l1s_com.agc_dl_task.parameters.signal_up; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
858 l1s_dsp_com.dsp_ndb_ptr->d_agc_dl_signal_down = l1a_l1s_com.agc_dl_task.parameters.signal_down; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
859 l1s_dsp_com.dsp_ndb_ptr->d_agc_dl_max_scale = l1a_l1s_com.agc_dl_task.parameters.max_scale; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
860 l1s_dsp_com.dsp_ndb_ptr->d_agc_dl_gain_smooth_alpha = l1a_l1s_com.agc_dl_task.parameters.gain_smooth_alpha; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
861 l1s_dsp_com.dsp_ndb_ptr->d_agc_dl_gain_smooth_alpha_fast = l1a_l1s_com.agc_dl_task.parameters.gain_smooth_alpha_fast; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
862 l1s_dsp_com.dsp_ndb_ptr->d_agc_dl_gain_smooth_beta = l1a_l1s_com.agc_dl_task.parameters.gain_smooth_beta; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
863 l1s_dsp_com.dsp_ndb_ptr->d_agc_dl_gain_smooth_beta_fast = l1a_l1s_com.agc_dl_task.parameters.gain_smooth_beta_fast; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
864 l1s_dsp_com.dsp_ndb_ptr->d_agc_dl_gain_intp_flag = l1a_l1s_com.agc_dl_task.parameters.gain_intp_flag; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
865 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
866 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
867 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
868 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
869 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
870 #if (L1_IIR == 2) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
871 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
872 /* l1_audio_iir4x_copy_params */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
873 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
874 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
875 /* Parameters : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
876 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
877 /* Return : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
878 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
879 /* Description : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
880 /* ------------- */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
881 /* This function is used to copy the IIR 4x parameter */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
882 /* to API memory using a pointer */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
883 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
884 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
885 void l1_audio_iir4x_copy_params() |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
886 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
887 UWORD8 i; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
888 UWORD8 j; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
889 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
890 // Set IIR parameters |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
891 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_control = l1a_l1s_com.iir_task.parameters->parameters.control; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
892 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_frame_size = l1a_l1s_com.iir_task.parameters->parameters.frame_size; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
893 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_fir_swap = l1a_l1s_com.iir_task.parameters->parameters.fir_swap; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
894 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
895 // Set parameter os FIR part |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
896 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_fir_enable = l1a_l1s_com.iir_task.parameters->parameters.fir_filter.fir_enable; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
897 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_fir_length = l1a_l1s_com.iir_task.parameters->parameters.fir_filter.fir_length; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
898 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_fir_shift = l1a_l1s_com.iir_task.parameters->parameters.fir_filter.fir_shift; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
899 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
900 for (i=0; i < (l1a_l1s_com.iir_task.parameters->parameters.fir_filter.fir_length); i++) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
901 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
902 l1s_dsp_com.dsp_ndb_ptr->a_iir4x_fir_taps[i] = l1a_l1s_com.iir_task.parameters->parameters.fir_filter.fir_taps[i]; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
903 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
904 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
905 // Set parameters for IIR part |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
906 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_sos_enable = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_enable; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
907 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_sos_number = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_number; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
908 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
909 // Set parameters for IIR part - SOS 1 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
910 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_sos_fact_1 = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[0].sos_fact; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
911 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_sos_fact_form_1 = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[0].sos_fact_form; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
912 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
913 for (j=0; j < IIR_4X_ORDER_OF_SECTION; j++) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
914 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
915 l1s_dsp_com.dsp_ndb_ptr->a_iir4x_sos_den_1[j] = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[0].sos_den[j]; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
916 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
917 for (j=0; j < (IIR_4X_ORDER_OF_SECTION + 1); j++) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
918 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
919 l1s_dsp_com.dsp_ndb_ptr->a_iir4x_sos_num_1[j] = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[0].sos_num[j]; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
920 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
921 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_sos_num_form_1 = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[0].sos_num_form; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
922 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
923 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
924 // Set parameters for IIR part - SOS 2 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
925 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_sos_fact_2 = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[1].sos_fact; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
926 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_sos_fact_form_2 = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[1].sos_fact_form; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
927 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
928 for (j=0; j < IIR_4X_ORDER_OF_SECTION; j++) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
929 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
930 l1s_dsp_com.dsp_ndb_ptr->a_iir4x_sos_den_2[j] = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[1].sos_den[j]; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
931 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
932 for (j=0; j < (IIR_4X_ORDER_OF_SECTION + 1); j++) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
933 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
934 l1s_dsp_com.dsp_ndb_ptr->a_iir4x_sos_num_2[j] = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[1].sos_num[j]; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
935 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
936 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_sos_num_form_2 = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[1].sos_num_form; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
937 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
938 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
939 // Set parameters for IIR part - SOS 3 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
940 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_sos_fact_3 = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[2].sos_fact; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
941 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_sos_fact_form_3 = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[2].sos_fact_form; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
942 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
943 for (j=0; j < IIR_4X_ORDER_OF_SECTION; j++) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
944 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
945 l1s_dsp_com.dsp_ndb_ptr->a_iir4x_sos_den_3[j] = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[2].sos_den[j]; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
946 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
947 for (j=0; j < (IIR_4X_ORDER_OF_SECTION + 1); j++) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
948 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
949 l1s_dsp_com.dsp_ndb_ptr->a_iir4x_sos_num_3[j] = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[2].sos_num[j]; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
950 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
951 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_sos_num_form_3 = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[2].sos_num_form; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
952 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
953 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
954 // Set parameters for IIR part - SOS 4 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
955 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_sos_fact_4 = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[3].sos_fact; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
956 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_sos_fact_form_4 = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[3].sos_fact_form; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
957 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
958 for (j=0; j < IIR_4X_ORDER_OF_SECTION; j++) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
959 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
960 l1s_dsp_com.dsp_ndb_ptr->a_iir4x_sos_den_4[j] = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[3].sos_den[j]; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
961 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
962 for (j=0; j < (IIR_4X_ORDER_OF_SECTION + 1); j++) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
963 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
964 l1s_dsp_com.dsp_ndb_ptr->a_iir4x_sos_num_4[j] = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[3].sos_num[j]; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
965 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
966 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_sos_num_form_4 = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[3].sos_num_form; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
967 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
968 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
969 // Set parameters for IIR part - SOS 5 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
970 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_sos_fact_5 = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[4].sos_fact; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
971 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_sos_fact_form_5 = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[4].sos_fact_form; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
972 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
973 for (j=0; j < IIR_4X_ORDER_OF_SECTION; j++) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
974 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
975 l1s_dsp_com.dsp_ndb_ptr->a_iir4x_sos_den_5[j] = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[4].sos_den[j]; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
976 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
977 for (j=0; j < (IIR_4X_ORDER_OF_SECTION + 1); j++) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
978 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
979 l1s_dsp_com.dsp_ndb_ptr->a_iir4x_sos_num_5[j] = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[4].sos_num[j]; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
980 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
981 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_sos_num_form_5 = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[4].sos_num_form; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
982 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
983 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
984 // Set parameters for IIR part - SOS 6 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
985 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_sos_fact_6 = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[5].sos_fact; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
986 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_sos_fact_form_6 = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[5].sos_fact_form; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
987 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
988 for (j=0; j < IIR_4X_ORDER_OF_SECTION; j++) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
989 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
990 l1s_dsp_com.dsp_ndb_ptr->a_iir4x_sos_den_6[j] = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[5].sos_den[j]; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
991 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
992 for (j=0; j < (IIR_4X_ORDER_OF_SECTION + 1); j++) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
993 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
994 l1s_dsp_com.dsp_ndb_ptr->a_iir4x_sos_num_6[j] = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[5].sos_num[j]; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
995 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
996 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_sos_num_form_6 = l1a_l1s_com.iir_task.parameters->parameters.sos_filter.sos_filter[5].sos_num_form; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
997 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
998 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
999 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1000 l1s_dsp_com.dsp_ndb_ptr->d_iir4x_gain = l1a_l1s_com.iir_task.parameters->parameters.gain; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1001 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1002 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1003 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1004 #endif // L1_IIR == 2 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1005 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1006 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1007 #if (L1_DRC == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1008 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1009 /* l1_audio_drc1x_copy_params */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1010 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1011 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1012 /* Parameters : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1013 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1014 /* Return : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1015 /* */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1016 /* Description : */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1017 /* ------------- */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1018 /* This function is used to copy the DRC 1x parameter */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1019 /* to API memory using a pointer */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1020 /*-------------------------------------------------------*/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1021 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1022 void l1_audio_drc1x_copy_params() |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1023 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1024 UWORD8 i; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1025 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1026 // Set DRC parameters |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1027 drc_ndb->d_drc_speech_mode_samp_f = l1a_l1s_com.drc_task.parameters->parameters.speech_mode_samp_f; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1028 drc_ndb->d_drc_num_subbands = l1a_l1s_com.drc_task.parameters->parameters.num_subbands; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1029 drc_ndb->d_drc_frame_len = l1a_l1s_com.drc_task.parameters->parameters.frame_len; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1030 drc_ndb->d_drc_expansion_knee_fb_bs = l1a_l1s_com.drc_task.parameters->parameters.expansion_knee_fb_bs; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1031 drc_ndb->d_drc_expansion_knee_md_hg = l1a_l1s_com.drc_task.parameters->parameters.expansion_knee_md_hg; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1032 drc_ndb->d_drc_expansion_ratio_fb_bs = l1a_l1s_com.drc_task.parameters->parameters.expansion_ratio_fb_bs; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1033 drc_ndb->d_drc_expansion_ratio_md_hg = l1a_l1s_com.drc_task.parameters->parameters.expansion_ratio_md_hg; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1034 drc_ndb->d_drc_max_amplification_fb_bs = l1a_l1s_com.drc_task.parameters->parameters.max_amplification_fb_bs; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1035 drc_ndb->d_drc_max_amplification_md_hg = l1a_l1s_com.drc_task.parameters->parameters.max_amplification_md_hg; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1036 drc_ndb->d_drc_compression_knee_fb_bs = l1a_l1s_com.drc_task.parameters->parameters.compression_knee_fb_bs; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1037 drc_ndb->d_drc_compression_knee_md_hg = l1a_l1s_com.drc_task.parameters->parameters.compression_knee_md_hg; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1038 drc_ndb->d_drc_compression_ratio_fb_bs = l1a_l1s_com.drc_task.parameters->parameters.compression_ratio_fb_bs; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1039 drc_ndb->d_drc_compression_ratio_md_hg = l1a_l1s_com.drc_task.parameters->parameters.compression_ratio_md_hg; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1040 drc_ndb->d_drc_energy_limiting_th_fb_bs = l1a_l1s_com.drc_task.parameters->parameters.energy_limiting_th_fb_bs; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1041 drc_ndb->d_drc_energy_limiting_th_md_hg = l1a_l1s_com.drc_task.parameters->parameters.energy_limiting_th_md_hg; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1042 drc_ndb->d_drc_limiter_threshold_fb = l1a_l1s_com.drc_task.parameters->parameters.limiter_threshold_fb; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1043 drc_ndb->d_drc_limiter_threshold_bs = l1a_l1s_com.drc_task.parameters->parameters.limiter_threshold_bs; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1044 drc_ndb->d_drc_limiter_threshold_md = l1a_l1s_com.drc_task.parameters->parameters.limiter_threshold_md; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1045 drc_ndb->d_drc_limiter_threshold_hg = l1a_l1s_com.drc_task.parameters->parameters.limiter_threshold_hg; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1046 drc_ndb->d_drc_limiter_hangover_spect_preserve = l1a_l1s_com.drc_task.parameters->parameters.limiter_hangover_spect_preserve; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1047 drc_ndb->d_drc_limiter_release_fb_bs = l1a_l1s_com.drc_task.parameters->parameters.limiter_release_fb_bs; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1048 drc_ndb->d_drc_limiter_release_md_hg = l1a_l1s_com.drc_task.parameters->parameters.limiter_release_md_hg; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1049 drc_ndb->d_drc_gain_track_fb_bs = l1a_l1s_com.drc_task.parameters->parameters.gain_track_fb_bs; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1050 drc_ndb->d_drc_gain_track_md_hg = l1a_l1s_com.drc_task.parameters->parameters.gain_track_md_hg; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1051 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1052 for (i=0; i < DRC_LPF_LENGTH; i++) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1053 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1054 drc_ndb->a_drc_low_pass_filter[i] = l1a_l1s_com.drc_task.parameters->parameters.low_pass_filter[i]; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1055 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1056 for (i=0; i < DRC_BPF_LENGTH; i++) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1057 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1058 drc_ndb->a_drc_mid_band_filter[i] = l1a_l1s_com.drc_task.parameters->parameters.mid_band_filter[i]; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1059 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1060 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1061 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1062 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1063 #endif // L1_DRC == 1 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1064 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1065 #if(L1_BT_AUDIO == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1066 BOOL L1Audio_InformBtAudioPathState (BOOL connected) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1067 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1068 if(connected==bt_audio.connected_status) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1069 return BT_STATUS_OK; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1070 else |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1071 return BT_STATUS_ERROR; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1072 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1073 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1074 void L1Audio_RegisterBthal (L1AudioPcmCallback pcmCallback, L1AudioConfigureCallback configCallback) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1075 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1076 bt_audio.audio_configure_callback=configCallback; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1077 bt_audio.audio_pcmblock_callback=pcmCallback; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1078 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1079 UWORD8 bt_flag=1; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1080 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1081 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1082 L1AudioPcmStatus L1Audio_PullPcmBlock (L1AudioPcmBlock *pcmBlock) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1083 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1084 UWORD8 status=0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1085 if(bt_flag == 0) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1086 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1087 AUDIO_SEND_TRACE("pull back bef init",RV_TRACE_LEVEL_ERROR); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1088 bt_audio.pcm_data_ready = 0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1089 // return L1_PCM_PENDING; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1090 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1091 // AUDIO_SEND_TRACE("pull back called",RV_TRACE_LEVEL_ERROR); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1092 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1093 if(bt_audio.pcm_data_end == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1094 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1095 AUDIO_SEND_TRACE("abnormal BT request mp3/aac",RV_TRACE_LEVEL_ERROR); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1096 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1097 if(bt_audio.pcmblock.lengthInBytes==2*C_MP3_OUTPUT_BUFFER_SIZE) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1098 l1mp3_dma_it_handler(0); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1099 else if(bt_audio.pcmblock.lengthInBytes==2*C_AAC_OUTPUT_BUFFER_SIZE) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1100 l1aac_dma_it_handler(0); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1101 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1102 bt_audio.pcm_data_end = 0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1103 bt_audio.pcm_data_ready = 0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1104 bt_flag = 0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1105 return L1_PCM_MEDIA_ENDED; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1106 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1107 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1108 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1109 if(bt_audio.pcm_data_failed==0) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1110 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1111 if(bt_audio.pcm_data_ready>0) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1112 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1113 //AUDIO_SEND_TRACE("Data ready for BT-Pull event",RV_TRACE_LEVEL_ERROR); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1114 pcmBlock->pcmBuffer= bt_audio.pcmblock.pcmBuffer; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1115 pcmBlock->lengthInBytes=bt_audio.pcmblock.lengthInBytes; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1116 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1117 bt_audio.pcm_data_ready=0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1118 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1119 if( bt_audio.pcm_data_end==1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1120 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1121 AUDIO_SEND_TRACE("Data ended for BT-Pull event",RV_TRACE_LEVEL_ERROR); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1122 return L1_PCM_MEDIA_ENDED; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1123 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1124 else |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1125 if(bt_audio.pcmblock.lengthInBytes==2*AUDIO_EXT_MIDI_BUFFER_SIZE) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1126 return L1_PCM_READY; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1127 else |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1128 status= L1_PCM_READY; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1129 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1130 else |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1131 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1132 if( bt_audio.pcm_data_end==1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1133 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1134 AUDIO_SEND_TRACE("Data ended for BT-Pull event",RV_TRACE_LEVEL_ERROR); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1135 return L1_PCM_MEDIA_ENDED; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1136 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1137 // AUDIO_SEND_TRACE("Data pending for BT-Pull event",RV_TRACE_LEVEL_ERROR); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1138 bt_audio.pcm_data_pending=1; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1139 status= L1_PCM_PENDING; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1140 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1141 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1142 else |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1143 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1144 AUDIO_SEND_TRACE("Data failed for BT-Pull event",RV_TRACE_LEVEL_ERROR); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1145 return L1_PCM_FAILED; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1146 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1147 if((bt_audio.pcmblock.lengthInBytes==2*C_MP3_OUTPUT_BUFFER_SIZE)&& bt_flag==1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1148 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1149 if(l1a_apihisr_com.mp3.command.stop==TRUE) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1150 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1151 bt_flag=0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1152 l1mp3_dma_it_handler(0); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1153 bt_audio.pcm_data_end = 0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1154 return L1_PCM_MEDIA_ENDED; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1155 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1156 else |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1157 l1mp3_dma_it_handler(0); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1158 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1159 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1160 else if(bt_audio.pcmblock.lengthInBytes==2*C_AAC_OUTPUT_BUFFER_SIZE&& bt_flag==1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1161 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1162 if(l1a_apihisr_com.aac.command.stop==TRUE) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1163 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1164 bt_flag=0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1165 AUDIO_SEND_TRACE("Media ended for BT-Pull event",RV_TRACE_LEVEL_ERROR); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1166 l1aac_dma_it_handler(0); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1167 bt_audio.pcm_data_end = 0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1168 return L1_PCM_MEDIA_ENDED; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1169 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1170 else |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1171 l1aac_dma_it_handler(0); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1172 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1173 else if(bt_audio.pcmblock.lengthInBytes==2*AUDIO_EXT_MIDI_BUFFER_SIZE && bt_flag==1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1174 if( bt_audio.pcm_data_end==1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1175 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1176 bt_flag=0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1177 return L1_PCM_MEDIA_ENDED; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1178 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1179 else |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1180 l1a_bt_audio_noti_process(); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1181 return status; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1182 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1183 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1184 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1185 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1186 void l1_audio_bt_init(UINT16 media_buf_size) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1187 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1188 bt_audio.pcm_data_pending =0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1189 bt_audio.pcm_data_end =0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1190 bt_audio.pcm_data_ready =1; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1191 bt_audio.pcm_data_failed =0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1192 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1193 bt_flag=1; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1194 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1195 if(media_buf_size==C_MP3_OUTPUT_BUFFER_SIZE) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1196 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1197 bt_audio.pcmblock.pcmBuffer=(UWORD8 *)&mp3_dma->a_mp3_dma_input_buffer[0][0]; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1198 bt_audio.pcmblock.lengthInBytes=2*media_buf_size; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1199 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1200 else if(media_buf_size==C_AAC_OUTPUT_BUFFER_SIZE) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1201 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1202 bt_audio.pcmblock.pcmBuffer=(UWORD8 *)&aac_dma->a_aac_dma_input_buffer[0][0]; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1203 bt_audio.pcmblock.lengthInBytes=2*media_buf_size; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1204 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1205 else if(media_buf_size==AUDIO_EXT_MIDI_BUFFER_SIZE) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1206 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1207 bt_audio.pcmblock.pcmBuffer=(UWORD8 *)&midi_buf.audio_play_buffer[0]; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1208 bt_audio.pcmblock.lengthInBytes=2*media_buf_size; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1209 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1210 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1211 #endif//L1_BT_AUDIO == 1 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1212 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1213 #if(L1_BT_AUDIO==1) ||(L1_WCM==1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1214 void l1_audio_manager(UWORD8 *src, UWORD16 size) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1215 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1216 UWORD16 i ; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1217 #if(L1_BT_AUDIO==1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1218 bt_audio.pcmblock.pcmBuffer=src; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1219 bt_audio.pcmblock.lengthInBytes=2*size; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1220 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1221 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1222 #if (OP_L1_STANDALONE == 0) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1223 #if 0 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1224 // l1_audio_wcm(src,size); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1225 if( wcm_enable == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1226 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1227 switch(size) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1228 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1229 case 2048: |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1230 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1231 arm_wcm_module( AAC, (T_SINT16 *)src , &wcm_output[0]); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1232 break; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1233 case 1152: |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1234 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1235 arm_wcm_module( MP3, (T_SINT16 *)src , &wcm_output[0]); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1236 break; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1237 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1238 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1239 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1240 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1241 for (i=0 ; i< size ; i++) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1242 while(size>0) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1243 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1244 *src++=(API)*wcm_output++; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1245 size--; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1246 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1247 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1248 /* for (i=0 ; i< size ; i++) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1249 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1250 *src++ = (UINT8 )wcm_output[i]&0x00ff; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1251 *src++ = (UINT8 )(wcm_output[i] & 0xff00) >> 8; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1252 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1253 */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1254 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1255 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1256 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1257 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1258 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1259 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1260 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1261 #if(L1_BT_AUDIO==1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1262 if(bt_audio.connected_status==TRUE) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1263 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1264 if(bt_audio.pcm_data_pending>0) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1265 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1266 bt_audio.pcm_data_pending = 0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1267 AUDIO_SEND_TRACE("Pending callback",RV_TRACE_LEVEL_ERROR); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1268 bt_audio.audio_pcmblock_callback(&bt_audio.pcmblock); |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1269 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1270 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1271 else |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1272 bt_audio.pcm_data_ready = 1; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1273 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1274 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1275 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1276 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1277 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1278 #if 0 /* FreeCalypso: LoCosto function not present in TCS211 */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1279 UWORD16 l1_ext_audio_get_frequencyrate(UWORD16 frequency_index) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1280 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1281 UWORD16 sampling_frequency=0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1282 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1283 switch(frequency_index) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1284 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1285 case 1: |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1286 sampling_frequency=8000; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1287 break; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1288 case 2: |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1289 sampling_frequency=11025; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1290 break; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1291 case 3: |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1292 sampling_frequency=16000; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1293 break; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1294 case 4: |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1295 sampling_frequency=22050; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1296 break; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1297 case 5: |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1298 sampling_frequency=32000; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1299 break; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1300 case 6: |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1301 sampling_frequency=44100; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1302 break; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1303 case 7: |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1304 sampling_frequency=48000; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1305 break; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1306 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1307 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1308 // Sampling frequency should never be zero |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1309 return sampling_frequency; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1310 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1311 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1312 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1313 #endif // AUDIO_TASK |