faac源碼分析之解碼參數配置

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用於將配置好的解碼參數設定到解碼器上去。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章