This code implements both an AMR-NarrowBand (AMR-NB) and an AMR-WideBand (AMR-WB) audio encoder/decoder through external reference code from http://www.3gpp.org/. The license of the code from 3gpp is unclear so you have to download the code separately. Two versions exists: One fixed-point and one floating-point. For some reason the float encoder is significantly faster at least on a P4 1.5GHz (0.9s instead of 9.9s on a 30s audio clip at MR102). Both float and fixed point are supported for AMR-NB, but only float for AMR-WB.
Definition in file libamr.c.
Go to the source code of this file.
| static int getBitrateMode | ( | int | bitrate | ) | [static] |
| static void amr_decode_fix_avctx | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 122 of file libamr.c.
Referenced by amr_nb_decode_init(), and amr_wb_decode_init().
| static int amr_nb_decode_init | ( | AVCodecContext * | avctx | ) | [static] |
| static int amr_nb_encode_init | ( | AVCodecContext * | avctx | ) | [static] |
| static int amr_nb_encode_close | ( | AVCodecContext * | avctx | ) | [static] |
| static int amr_nb_decode_close | ( | AVCodecContext * | avctx | ) | [static] |
| static int amr_nb_decode_frame | ( | AVCodecContext * | avctx, | |
| void * | data, | |||
| int * | data_size, | |||
| uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
| static int amr_nb_encode_frame | ( | AVCodecContext * | avctx, | |
| unsigned char * | frame, | |||
| int | buf_size, | |||
| void * | data | |||
| ) | [static] |
| static int getWBBitrateMode | ( | int | bitrate | ) | [static] |
Definition at line 541 of file libamr.c.
Referenced by amr_wb_encode_frame(), and amr_wb_encode_init().
| static int amr_wb_encode_init | ( | AVCodecContext * | avctx | ) | [static] |
| static int amr_wb_encode_close | ( | AVCodecContext * | avctx | ) | [static] |
| static int amr_wb_encode_frame | ( | AVCodecContext * | avctx, | |
| unsigned char * | frame, | |||
| int | buf_size, | |||
| void * | data | |||
| ) | [static] |
| static int amr_wb_decode_init | ( | AVCodecContext * | avctx | ) | [static] |
| static int amr_wb_decode_frame | ( | AVCodecContext * | avctx, | |
| void * | data, | |||
| int * | data_size, | |||
| uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
| static int amr_wb_decode_close | ( | AVCodecContext * | avctx | ) | [static] |
const char* nb_bitrate_unsupported [static] |
Initial value:
"bitrate not supported: use one of 4.75k, 5.15k, 5.9k, 6.7k, 7.4k, 7.95k, 10.2k or 12.2k\n"
Definition at line 84 of file libamr.c.
Referenced by amr_nb_encode_init().
const char* wb_bitrate_unsupported [static] |
Initial value:
"bitrate not supported: use one of 6.6k, 8.85k, 12.65k, 14.25k, 15.85k, 18.25k, 19.85k, 23.05k, or 23.85k\n"
Definition at line 86 of file libamr.c.
Referenced by amr_wb_encode_frame(), and amr_wb_encode_init().
Initial value:
{
"libamr_nb",
CODEC_TYPE_AUDIO,
CODEC_ID_AMR_NB,
sizeof(AMRContext),
amr_nb_decode_init,
NULL,
amr_nb_decode_close,
amr_nb_decode_frame,
}
Initial value:
{
"libamr_nb",
CODEC_TYPE_AUDIO,
CODEC_ID_AMR_NB,
sizeof(AMRContext),
amr_nb_encode_init,
amr_nb_encode_frame,
amr_nb_encode_close,
NULL,
}
Initial value:
{
"libamr_wb",
CODEC_TYPE_AUDIO,
CODEC_ID_AMR_WB,
sizeof(AMRWBContext),
amr_wb_decode_init,
NULL,
amr_wb_decode_close,
amr_wb_decode_frame,
}
Initial value:
{
"libamr_wb",
CODEC_TYPE_AUDIO,
CODEC_ID_AMR_WB,
sizeof(AMRWBContext),
amr_wb_encode_init,
amr_wb_encode_frame,
amr_wb_encode_close,
NULL,
}
1.5.5