3GPP-AMR-NB With ETSI-EFR Implementation on the StarCore™ SC140/SC1400 Cores, Rev. 1
4 Freescale Semiconductor
Implementation Phases
2 Implementation Phases
Table 3 presents the main phases of the methodology used to implement AMR-NB on the SC140 core. A full
description and examples for each step are provided in [1]. Tab le 3 includes an additional phase necessary for our
application: EFR integration. In the EFR integration phase, some functions or pieces of code, tables, channel data,
and constants from the EFR reference code are included in the AMR-NB vocoder to achieve bit-exact EFR
functionality.
Table 3. Methodology Phases
Development Phase Description
Porting AMR-NB to the SC140
core
Data type definitions, introduction of intrinsic functions,
StarCore adaptations.
EFR integration Integration of ETSI-EFR code within the AMR-NB code
Project-level optimizations Inlining fast 32-bit DPF operations, data alignment
Algorithm changes Platform-independent and platform-dependent changes in
algorithms
Function-level C optimizations C optimization techniques (multisample, loop unrolling, split
summation), and better use of intrinsic functions
Function implementation in
assembly
Implementation of selected functions in assembly for best
optimization
As discussed in Section 1, there are differences between the bitstream formats of the AMR-NB encoder and
decoder and ETSI EFR encoder and decoder. Therefore, in addition to the reference code, a wrapper interface
feeds each of the two vocoders with the correct data stream.
Code Listing 1 presents the API for the AMR-NB
with EFR implementation.
Example 1. AMR-NB with EFR API
void MDCR_AMR750_amrefr_enc
(
INT16 *input_buf, /* input speech data, 160 words */
INT16 *output_buf, /* output data, 245 words */
AMREFR_ENC_CTRL_PTR *ctrl_ptr,
AMREFR_ENC_STATUS_PTR *status_ptr
);
typedef struct {
UINT32 temp_2: 24; /* place holders */
UINT32 mode: 4; /* AMR rate place holder */
UINT32 temp_1: 1; /* place holder */
UINT32 dtx: 1; /* 1 - Enable */
UINT32 coder: 1; /* 0 - AMR, 1 - EFR */
UINT32 init: 1; /* 1 - initialize */
UINT8 *static_ptr; /* static channel data, 3072 bytes */
UINT8 *scratch_ptr; /* scratch space, 4096 bytes */
} AMREFR_ENC_CTRL_PTR;
typedef struct {
UINT8 used_mode; /* Unused for EFR */
UINT8 sp_flag;
UINT8 vad_flag;
} AMREFR_ENC_STATUS_PTR;