⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 g722codec.h

📁 音频编解码库的具体实现,分析流程清晰,编译测试通过
💻 H
字号:
/*
	ITU-T G722.1 decoder for PC

*/

#ifndef G722_1_CODEC_H
#define G722_1_CODEC_H

#include "defs.h"
#include "typedefs.h"

#define DebugPrint printf
#define ALIGN_SIZE(x) ((x+16) & 0x00fffff0)
#define BYTES_PER_SAMPLE	2	//add by lgl;
/************************************************************************************
 Constant definitions                                                    
*************************************************************************************/
#define G722_SAMPLE_RATE     16000					//信号源为16KHz采样的PCM码
//G722.1 以20ms(320 samples)为一帧作编码
#define FRAMESIZE       (G722_SAMPLE_RATE/50)		//20ms, 320 samples, 640 bytes

typedef struct _tagG722DecoderPara{
    Word16 number_of_bits_per_frame;
	Word16 number_of_16bit_words_per_frame;
    Word16 old_mag_shift;
    Word16 old_decoder_mlt_coefs[DCT_LENGTH];
    Word16 old_samples[DCT_LENGTH>>1];
	char *	buffer;
	int	buffer_size;
	int buffer_offset;
    Rand_Obj randobj;
	void (*rmlt_coefs_to_samples)(Word16 *coefs, Word16 *old_samples, Word16 *out_samples, Word16 mag_shift);
}G722_DEC_HANDLE;

typedef struct {
    int number_of_bits_per_frame;
	int number_of_16bit_words_per_frame;
	char *	buffer;
	int	buffer_size;
	int buffer_offset;
    short history[FRAMESIZE];
	//执行函数指针
	Word16  (*samples_to_rmlt_coefs)(Word16 *new_samples,Word16 *history,Word16 *coefs);
}G722_ENC_HANDLE;

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -