faac源码分析之解码参数配置

49 篇文章 1 订阅
FAAC定义了一个结构体用来定义解码器的工作解码参数,该结构体的定义如下所示:
typedef struct faacEncConfiguration
{
    /* config version */
    int version;
    /* library version */
    char *name;
    /* copyright string */
    char *copyright;
    /* MPEG version, 2 or 4 */
    unsigned int mpegVersion;
    /* AAC object type */
    unsigned int aacObjectType;
    /* Allow mid/side coding */
    unsigned int allowMidside;
    /* Use one of the channels as LFE channel */
	/* LFE(low-frequencyeffects) */
    unsigned int useLfe;
    /* Use Temporal Noise Shaping */
    unsigned int useTns;
    /* bitrate / channel of AAC file */
    unsigned long bitRate;
    /* AAC file frequency bandwidth */
    unsigned int bandWidth;
    /* Quantizer quality */
	/* 默认100,值越大音质越高 */
    unsigned long quantqual;
    /* Bitstream output format (0 = Raw; 1 = ADTS) */
    unsigned int outputFormat;
    /* psychoacoustic model list */
    psymodellist_t *psymodellist;
    /* selected index in psymodellist */
    unsigned int psymodelidx;
    /*
	PCM Sample Input Format
	0 FAAC_INPUT_NULL	 invalid, signifies a misconfigured config
	1 FAAC_INPUT_16BIT native endian 16bit
	2 FAAC_INPUT_24BIT native endian 24bit in 24 bits(not implemented)
	3 FAAC_INPUT_32BIT native endian 24bit in 32 bits (DEFAULT)
	4 FAAC_INPUT_FLOAT 32bit floating point
    */
    unsigned int inputFormat;
    /* block type enforcing 
     * (SHORTCTL_NORMAL/SHORTCTL_NOSHORT/SHORTCTL_NOLONG) 
     */
    int shortctl;
	/*
		Channel Remapping
		Default			0, 1, 2, 3 ... 63  (64 is MAX_CHANNELS in coder.h)
		WAVE 4.0		2, 0, 1, 3
		WAVE 5.0		2, 0, 1, 3, 4
		WAVE 5.1		2, 0, 1, 4, 5, 3
		AIFF 5.1		2, 0, 3, 1, 4, 5 
	*/
	int channel_map[64];	
} faacEncConfiguration, *faacEncConfigurationPtr;
主要的参数配置如下所示:
# 2-MPEG2 4-MPEG4
mpegVersion=4
# 1-MAIN 2-LOW 3-SSR 4-LTP
aacObjectType=2
# 0-NO 1-YES
allowMidside=0
# 0-NO 1-YES
useLfe=0
# 0-NO 1-YES
useTns=0
bitRate=48000
bandWidth=64000
# Default=100 LOWER<100 HIGHER>100
quantqua=100
# 0=RAW 1=ADTS
outputFormat=1
函数faacEncGetCurrentConfiguration用于获取解码器的参数配置,而faacEncSetConfiguration用于将配置好的解码参数设定到解码器上去。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值