资源简介
AMR NB 音频编码解码 源代码 C语言源码
VS2008直接创建项目覆盖,生成DLL编译即可使用.
代码片段和文件信息
/*
* ===================================================================
* TS 26.104
* R99 V3.5.0 2003-03
* REL-4 V4.4.0 2003-03
* REL-5 V5.1.0 2003-03
* 3GPP AMR Floating-point Speech Codec
* ===================================================================
*
*/
/*
* interf_dec.c
*
*
* Project:
* AMR Floating-Point Codec
*
* Contains:
* This module provides means to conversion from 3GPP or ETSI
* bitstream to AMR parameters
*/
/*
* include files
*/
#include
#include
#include
#include “typedef.h“
#include “sp_dec.h“
#include “interf_rom.h“
#include “rom_dec.h“
/*
* definition of constants
*/
#define EHF_MASK 0x0008 /* encoder homing frame pattern */
typedef
struct
{
int reset_flag_old; /* previous was homing frame */
enum RXframeType prev_ft; /* previous frame type */
enum Mode prev_mode; /* previous mode */
void *decoder_State; /* Points decoder state */
}dec_interface_State;
#ifdef ETSI
/*
* Bin2Int
*
*
* Parameters:
* no_of_bits I: number of bits associated with value
* bits O: address where bits are written
*
* Function:
* Read nuber of bits from the array and convert to integer.
*
* Returns:
* value
*/
static Word16 Bin2Int( Word16 no_of_bits Word16 *bitstream )
{
Word32 value i bit;
value = 0;
for ( i = 0; i < no_of_bits; i++ ) {
value = value << 1;
bit = *bitstream++;
if ( bit == 0x1 )
value = value + 1;
}
return( Word16 )( value );
}
/*
* Bits2Prm
*
*
* Parameters:
* mode I: AMR mode
* bits I: serial bits
* param O: AMR parameters
*
* Function:
* Retrieves the vector of encoder parameters from
* the received serial bits in a frame.
*
* Returns:
* void
*/
static void Bits2Prm( enum Mode mode Word16 bits[] Word16 prm[] )
{
Word32 i;
switch ( mode ) {
case MR122:
for ( i = 0; i < PRMNO_MR122; i++ ) {
prm[i] = Bin2Int( bitno_MR122[i] bits );
bits += bitno_MR122[i];
}
break;
case MR102:
for ( i = 0; i < PRMNO_MR102; i++ ) {
prm[i] = Bin2Int( bitno_MR102[i] bits );
bits += bitno_MR102[i];
}
break;
case MR795:
for ( i = 0; i < PRMNO_MR795; i++ ) {
prm[i] = Bin2Int( bitno_MR795[i] bits );
bits += bitno_MR795[i];
}
break;
case MR74:
for ( i = 0; i < PRMNO_MR74; i++ ) {
prm[i] = Bin2Int( bitno_MR74[i] bits );
bits += bitno_MR74[i];
}
break;
case MR67:
for ( i = 0; i < PRMNO_MR67; i++ ) {
prm[i] = Bin2Int( bitno_MR67[i] bits );
bits += bitno_MR67[i];
}
break;
case MR59:
for ( i = 0; i < PRMNO_MR59; i++ ) {
prm[i] = Bin2Int( bitno_MR59[i] bits );
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 17356 2011-04-23 14:30 interf_enc.c
文件 1090 2011-04-23 14:28 interf_enc.h
文件 23566 2006-07-02 00:21 interf_rom.h
文件 129931 2006-07-30 21:04 rom_dec.h
文件 208869 2006-07-02 00:21 rom_enc.h
文件 154866 2011-04-23 10:25 sp_dec.c
文件 1601 2006-07-02 00:21 sp_dec.h
文件 311388 2011-04-23 10:25 sp_enc.c
文件 1448 2006-07-02 00:21 sp_enc.h
文件 497 2006-07-02 00:21 typedef.h
文件 4469 2011-04-27 08:33 AMRNB.vcproj
文件 18735 2011-04-23 14:29 interf_dec.c
文件 982 2011-04-23 14:09 interf_dec.h
----------- --------- ---------- ----- ----
874798 13
评论
共有 条评论