FreeCalypso > hg > gsm-codec-lib
comparison libtwamr/dhf_subst.c @ 431:f0496507d409
libtwamr: implement amr_dhf_subst_efr()
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 08 May 2024 00:27:51 +0000 |
parents | libtwamr/dhf_check.c@9beb01439a90 |
children |
comparison
equal
deleted
inserted
replaced
430:edbbbf1c4ab1 | 431:f0496507d409 |
---|---|
1 /* | |
2 * The function implemented in this module is an aid for AMR-EFR interworking: | |
3 * it is meant to be invoked directly after amr_encode_frame(), it checks | |
4 * the encoder output for MR122 DHF, and if the generated frame exactly | |
5 * matches MR122 DHF, it is changed to GSM-EFR DHF. | |
6 */ | |
7 | |
8 #include <stdint.h> | |
9 #include <string.h> | |
10 #include "tw_amr.h" | |
11 | |
12 void amr_dhf_subst_efr(struct amr_param_frame *frame) | |
13 { | |
14 if (frame->type != TX_SPEECH_GOOD) | |
15 return; | |
16 if (frame->mode != MR122) | |
17 return; | |
18 if (memcmp(frame->param, amr_dhf_mr122, AMR_MAX_PRM * sizeof(int16_t))) | |
19 return; | |
20 memcpy(frame->param, amr_dhf_gsmefr, AMR_MAX_PRM * sizeof(int16_t)); | |
21 } |