diff 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
line wrap: on
line diff
--- a/src/decoder.c	Wed Apr 03 05:55:51 2024 +0000
+++ b/src/decoder.c	Wed Apr 03 06:09:10 2024 +0000
@@ -32,6 +32,10 @@
 #include "cnst.h"
 #include "d_homing.h"
 
+#ifdef EFR2_VARIANT
+#include "post_pro.h"
+#endif
+
 
 /* These constants define the number of consecutive parameters
    that function decoder_homing_frame_test() checks */
@@ -180,12 +184,20 @@
             fwc ();             /* function worst case */
 #endif
 
+#ifdef EFR2_VARIANT
+            Post_Process(synth, L_FRAME);
+#endif
+
             for (i = 0; i < L_FRAME; i++) 
                 /* Upscale the 15 bit linear PCM to 16 bits,
                    then truncate to 13 bits */
             {
+#ifndef EFR2_VARIANT
                 temp = shl (synth[i], 1);
                 synth[i] = temp & 0xfff8;       logic16 (); move16 (); 
+#else
+                synth[i] &= 0xfff8;
+#endif
             }
 
 #if (WMOPS)