comparison src/decoder.c @ 5:799b56cbccb6

EFR2 decoder: add post-processing step from AMR
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 03 Apr 2024 06:09:10 +0000
parents 56410792419a
children
comparison
equal deleted inserted replaced
4:5d7a6bc6960f 5:799b56cbccb6
30 #include "count.h" 30 #include "count.h"
31 #include "codec.h" 31 #include "codec.h"
32 #include "cnst.h" 32 #include "cnst.h"
33 #include "d_homing.h" 33 #include "d_homing.h"
34 34
35 #ifdef EFR2_VARIANT
36 #include "post_pro.h"
37 #endif
38
35 39
36 /* These constants define the number of consecutive parameters 40 /* These constants define the number of consecutive parameters
37 that function decoder_homing_frame_test() checks */ 41 that function decoder_homing_frame_test() checks */
38 42
39 #define WHOLE_FRAME 57 43 #define WHOLE_FRAME 57
178 Post_Filter (synth, Az_dec); /* Post-filter */ 182 Post_Filter (synth, Az_dec); /* Post-filter */
179 #if (WMOPS) 183 #if (WMOPS)
180 fwc (); /* function worst case */ 184 fwc (); /* function worst case */
181 #endif 185 #endif
182 186
187 #ifdef EFR2_VARIANT
188 Post_Process(synth, L_FRAME);
189 #endif
190
183 for (i = 0; i < L_FRAME; i++) 191 for (i = 0; i < L_FRAME; i++)
184 /* Upscale the 15 bit linear PCM to 16 bits, 192 /* Upscale the 15 bit linear PCM to 16 bits,
185 then truncate to 13 bits */ 193 then truncate to 13 bits */
186 { 194 {
195 #ifndef EFR2_VARIANT
187 temp = shl (synth[i], 1); 196 temp = shl (synth[i], 1);
188 synth[i] = temp & 0xfff8; logic16 (); move16 (); 197 synth[i] = temp & 0xfff8; logic16 (); move16 ();
198 #else
199 synth[i] &= 0xfff8;
200 #endif
189 } 201 }
190 202
191 #if (WMOPS) 203 #if (WMOPS)
192 fwc (); /* function worst case */ 204 fwc (); /* function worst case */
193 #endif 205 #endif