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

来源:互联网 发布:会声会影软件 编辑:程序博客网 时间:2024/05/24 05:34
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 Format0 FAAC_INPUT_NULL invalid, signifies a misconfigured config1 FAAC_INPUT_16BIT native endian 16bit2 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 RemappingDefault0, 1, 2, 3 ... 63  (64 is MAX_CHANNELS in coder.h)WAVE 4.02, 0, 1, 3WAVE 5.02, 0, 1, 3, 4WAVE 5.12, 0, 1, 4, 5, 3AIFF 5.12, 0, 3, 1, 4, 5 */int channel_map[64];} faacEncConfiguration, *faacEncConfigurationPtr;
主要的参数配置如下所示:
# 2-MPEG2 4-MPEG4mpegVersion=4# 1-MAIN 2-LOW 3-SSR 4-LTPaacObjectType=2# 0-NO 1-YESallowMidside=0# 0-NO 1-YESuseLfe=0# 0-NO 1-YESuseTns=0bitRate=48000bandWidth=64000# Default=100 LOWER<100 HIGHER>100quantqua=100# 0=RAW 1=ADTSoutputFormat=1
函数faacEncGetCurrentConfiguration用于获取解码器的参数配置,而faacEncSetConfiguration用于将配置好的解码参数设定到解码器上去。
0 0
原创粉丝点击