xref: /aosp_15_r20/external/libxaac/README_dec.md (revision 15dc779a375ca8b5125643b829a8aa4b70d7f451)
1*15dc779aSAndroid Build Coastguard Worker
2*15dc779aSAndroid Build Coastguard Worker
3*15dc779aSAndroid Build Coastguard Worker# Introduction to libxaac decoder APIs
4*15dc779aSAndroid Build Coastguard Worker
5*15dc779aSAndroid Build Coastguard Worker## Decoder APIs
6*15dc779aSAndroid Build Coastguard Worker
7*15dc779aSAndroid Build Coastguard WorkerA single API is used to get and set configurations and execute the decode thread, based on command index passed.
8*15dc779aSAndroid Build Coastguard Worker* ia_xheaacd_dec_api
9*15dc779aSAndroid Build Coastguard Worker
10*15dc779aSAndroid Build Coastguard Worker| **API Command** | **API Sub Command** | **Description** |
11*15dc779aSAndroid Build Coastguard Worker|------|------|------|
12*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_LIB_ID_STRINGS | IA_CMD_TYPE_LIB_NAME | Gets the decoder library name |
13*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_LIB_ID_STRINGS | IA_CMD_TYPE_LIB_VERSION | Gets the decoder version |
14*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_API_SIZE | 0 | Gets the memory requirements size of the API |
15*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_API_PRE_CONFIG_PARAMS | Sets the configuration parameters of the libxaac decoder to default values |
16*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_API_POST_CONFIG_PARAMS | Sets the attributes(size, priority, alignment) of all memory types required by the application onto the memory structure |
17*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_PROCESS | Search for the valid header, does header decode to get the parameters and initializes state and configuration structure |
18*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_DONE_QUERY | Checks if the initialization process has completed |
19*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_PCM_WDSZ | Sets the bit width of the output PCM samples. The value has to be 16 |
20*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_SAMP_FREQ | Sets the core AAC sampling frequency for RAW header decoding |
21*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_EFFECT_TYPE | Sets the value of DRC effect type |
22*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_TARGET_LOUDNESS | Sets the value of DRC target loudness |
23*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DOWNMIX | Sets the parameter whether the output needs to be down-mix to mono(1) or not(0) |
24*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_TOSTEREO | Sets the flag to disable interleave mono to stereo |
25*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DSAMPLE | Sets the parameter whether the output needs to be downsampled(1) or not(0) |
26*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_ISMP4 | Sets the flag to 0 or 1 to indicate whether given test vector is an mp4 file or not |
27*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_MAX_CHANNEL | Sets the maximum number of channels present. Its maximum value is 2 for stereo library and 8 for multichannel library |
28*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_COUP_CHANNEL | Sets the number of coupling channels to be used for coupling. It can take values from 0 to 16. This command is supported only if the library has multichannel support |
29*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DOWNMIX_STEREO | Sets the flag of downmixing n number of channels to stereo. Can be 0 or 1. This command is supported only if the library has multichannel support |
30*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_DISABLE_SYNC | Sets the flag of ADTS syncing or not ADTS syncing as 0 or 1 |
31*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_AUTO_SBR_UPSAMPLE | Sets the parameter auto SBR upsample to 0 or 1. Used in case of stream changing from SBR present to SBR not present |
32*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_CUT | Sets the value of DRC cut factor |
33*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_BOOST | Sets the value of DRC boost factor |
34*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_HEAVY_COMP | Sets the parameter to either enable/disable DRC heavy compression |
35*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_FRAMESIZE | Sets the parameter whether decoder should decode for frame length 480 or 512 |
36*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_LD_TESTING | Sets the flag to enable LD testing in decoder |
37*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_HQ_ESBR | Sets the flag to enable/disable high quality eSBR |
38*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_PS_ENABLE | Sets the flag to indicate the presence of PS data in eSBR bit stream |
39*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_PEAK_LIMITER | Sets the flag to disable/enable peak limiter |
40*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_FRAMELENGTH_FLAG | Sets to flag to indicate whether decoder should decode for frame length 960 or 1024 |
41*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_XHEAAC_DEC_CONFIG_PARAM_DRC_TARGET_LEVEL | Sets the value of DRC target level |
42*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_XHEAAC_DEC_CONFIG_ERROR_CONCEALMENT | Sets to flag to disable/enable error concealment |
43*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_XHEAAC_DEC_CONFIG_PARAM_ESBR | Sets to flag to disable/enable eSBR |
44*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_N_MEMTABS | 0 | Gets the number of memory types |
45*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_N_TABLES | 0 | Gets the number of tables |
46*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_MEM_INFO_SIZE | 0 | Gets the size of the memory type being referred to by the index |
47*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_MEM_INFO_ALIGNMENT | 0 | Gets the alignment information of the memory-type being referred to by the index |
48*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_MEM_INFO_TYPE | 0 | Gets the type of memory being referred to by the index |
49*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_MEM_PTR | 0 | Sets the pointer to the memory being referred to by the index to the input value |
50*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_TABLE_INFO_SIZE | 0 | Gets the size of the memory type being referred to by the index |
51*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_TABLE_INFO_ALIGNMENT | 0 | Gets the alignment information of the memory-type being referred to by the index |
52*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_TABLE_PTR | 0 | Gets the address of the current location of the table |
53*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_TABLE_PTR | 0 | Sets the relocated table address |
54*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_MEMTABS_SIZE | 0 | Gets the size of the memory structures |
55*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_MEMTABS_PTR | 0 | Sets the memory structure pointer in the library to the allocated value |
56*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_INPUT_OVER | 0 | Signals the end of bit-stream to the library |
57*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_INPUT_BYTES | 0 | Sets the number of bytes available in the input buffer for initialization |
58*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_CURIDX_INPUT_BUF | 0 | Gets the number of input buffer bytes consumed by the last initialization |
59*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_PCM_WDSZ | Gets the output PCM word size |
60*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_SAMP_FREQ | Gets the sampling frequency |
61*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_NUM_CHANNELS | Gets the output number of channels |
62*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_CHANNEL_MASK | Gets the channel mask |
63*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_CHANNEL_MODE | Gets the channel mode. (Mono or PS/Stereo/Dual-mono) |
64*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_SBR_MODE | Gets the SBR mode (Present/ Not Present) |
65*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_EFFECT_TYPE | Gets the value of DRC effect type |
66*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_TARGET_LOUDNESS | Gets the value of DRC target loudness |
67*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_LOUD_NORM | Gets the value of DRC loudness normalization level |
68*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_AOT | Gets the value of audio object type |
69*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_EXT_ELE_PTR | Gets the extension element pointer |
70*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_EXT_ELE_BUF_SIZES | Gets the extension element buffer sizes |
71*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_NUM_ELE | Gets the number of configuration elements |
72*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_NUM_CONFIG_EXT | Gets the number of extension elements |
73*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_GAIN_PAYLOAD_LEN | Gets the gain payload length |
74*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_GAIN_PAYLOAD_BUF | Gets the gain payload buffer |
75*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_GET_NUM_PRE_ROLL_FRAMES | Gets the number of preroll frames |
76*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_DRC_IS_CONFIG_CHANGED | Gets the value of DRC config change flag |
77*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_DRC_APPLY_CROSSFADE | Gets the value of DRC crossfade flag |
78*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_EXECUTE | IA_CMD_TYPE_DO_EXECUTE | Executes the decode thread |
79*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_EXECUTE | IA_CMD_TYPE_DONE_QUERY | Checks if the end of decode has been reached |
80*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_OUTPUT_BYTES | 0 | Gets the number of bytes output by the decoder in the last frame |
81*15dc779aSAndroid Build Coastguard Worker
82*15dc779aSAndroid Build Coastguard Worker### Aliases for some of the macros exist as XHEAAC
83*15dc779aSAndroid Build Coastguard Worker
84*15dc779aSAndroid Build Coastguard Worker| **Macro** | **Alias** |
85*15dc779aSAndroid Build Coastguard Worker|------|------|
86*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_PCM_WDSZ | IA_XHEAAC_DEC_CONFIG_PARAM_PCM_WDSZ |
87*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_SAMP_FREQ | IA_XHEAAC_DEC_CONFIG_PARAM_SAMP_FREQ |
88*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_NUM_CHANNELS | IA_XHEAAC_DEC_CONFIG_PARAM_NUM_CHANNELS |
89*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_CHANNEL_MASK | IA_XHEAAC_DEC_CONFIG_PARAM_CHANNEL_MASK |
90*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_CHANNEL_MODE | IA_XHEAAC_DEC_CONFIG_PARAM_CHANNEL_MODE |
91*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_SBR_MODE | IA_XHEAAC_DEC_CONFIG_PARAM_SBR_MODE |
92*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_EFFECT_TYPE | IA_XHEAAC_DEC_CONFIG_PARAM_DRC_EFFECT_TYPE |
93*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_TARGET_LOUDNESS | IA_XHEAAC_DEC_CONFIG_PARAM_DRC_TARGET_LOUDNESS |
94*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_LOUD_NORM | IA_XHEAAC_DEC_CONFIG_PARAM_DRC_LOUD_NORM |
95*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_DOWNMIX | IA_XHEAAC_DEC_CONFIG_PARAM_DOWNMIX |
96*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_TOSTEREO | IA_XHEAAC_DEC_CONFIG_PARAM_TOSTEREO |
97*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_DSAMPLE | IA_XHEAAC_DEC_CONFIG_PARAM_DSAMPLE |
98*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_ISMP4 | IA_XHEAAC_DEC_CONFIG_PARAM_MP4FLAG |
99*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_MAX_CHANNEL | IA_XHEAAC_DEC_CONFIG_PARAM_MAX_CHANNEL |
100*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_COUP_CHANNEL | IA_XHEAAC_DEC_CONFIG_PARAM_COUP_CHANNEL |
101*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_DOWNMIX_STEREO | IA_XHEAAC_DEC_CONFIG_PARAM_DOWNMIX_STEREO |
102*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_DISABLE_SYNC | IA_XHEAAC_DEC_CONFIG_DISABLE_SYNC |
103*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_AUTO_SBR_UPSAMPLE | IA_XHEAAC_DEC_CONFIG_PARAM_AUTO_SBR_UPSAMPLE |
104*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_CUT | IA_XHEAAC_DEC_CONFIG_PARAM_DRC_CUT |
105*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_BOOST | IA_XHEAAC_DEC_CONFIG_PARAM_DRC_BOOST |
106*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_HEAVY_COMP | IA_XHEAAC_DEC_CONFIG_PARAM_DRC_HEAVY_COMP |
107*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_FRAMESIZE | IA_XHEAAC_DEC_CONFIG_PARAM_FRAMESIZE |
108*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_LD_TESTING | IA_XHEAAC_DEC_CONFIG_PARAM_LD_TESTING |
109*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_HQ_ESBR | IA_XHEAAC_DEC_CONFIG_PARAM_HQ_ESBR |
110*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_PS_ENABLE | IA_XHEAAC_DEC_CONFIG_PARAM_PS_ENABLE |
111*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_AOT | IA_XHEAAC_DEC_CONFIG_PARAM_AOT |
112*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_PEAK_LIMITER | IA_XHEAAC_DEC_CONFIG_PARAM_PEAK_LIMITER |
113*15dc779aSAndroid Build Coastguard Worker|IA_ENHAACPLUS_DEC_CONFIG_PARAM_FRAMELENGTH_FLAG | IA_XHEAAC_DEC_CONFIG_PARAM_FRAMELENGTH_FLAG |
114*15dc779aSAndroid Build Coastguard Worker
115*15dc779aSAndroid Build Coastguard Worker## DRC APIs
116*15dc779aSAndroid Build Coastguard Worker
117*15dc779aSAndroid Build Coastguard WorkerA single API is used to get and set configurations and execute the decode thread, based on command index passed.
118*15dc779aSAndroid Build Coastguard Worker* ia_drc_dec_api
119*15dc779aSAndroid Build Coastguard Worker
120*15dc779aSAndroid Build Coastguard Worker| **API Command** | **API Sub Command** | **Description** |
121*15dc779aSAndroid Build Coastguard Worker|------|------|------|
122*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_API_SIZE | 0 | Gets the memory requirements size of the API |
123*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_API_PRE_CONFIG_PARAMS | Sets the configuration parameters of the libxaac decoder to default values |
124*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_API_POST_CONFIG_PARAMS | Sets the attributes(size, priority, alignment) of all memory types required by the application onto the memory structure |
125*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_PROCESS | Search for the valid header, does header decode to get the parameters and initializes state and configuration structure |
126*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_CPY_BSF_BUFF | Sets the bitstream split format buffer |
127*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_CPY_IC_BSF_BUFF | Sets the configuration bitstream split format buffer |
128*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_CPY_IL_BSF_BUFF | Sets the loudness bitstream split format buffer |
129*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_CPY_IN_BSF_BUFF | Sets the interface bitstream split format buffer |
130*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_SET_BUFF_PTR | Sets the input buffer pointer |
131*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_PARAM_SAMP_FREQ | Sets the sampling frequency of the input stream/data |
132*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_PARAM_NUM_CHANNELS | Sets the number of channels in the input stream/data |
133*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_PARAM_PCM_WDSZ | Sets the PCM word size of the input data |
134*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_PARAM_BITS_FORMAT | Sets the bit stream format |
135*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_PARAM_INT_PRESENT | Sets the DRC decoder�s interface present flag to 1 or 0 |
136*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_PARAM_FRAME_SIZE | Sets the frame size |
137*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_DRC_EFFECT_TYPE | Sets the value of DRC effect type |
138*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_DRC_TARGET_LOUDNESS | Sets the value of DRC target loudness |
139*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_DRC_LOUD_NORM | Sets the value of DRC loudness normalization level |
140*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_PARAM_APPLY_CROSSFADE | Sets the value of DRC crossfade flag |
141*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_PARAM_CONFIG_CHANGED | Sets the value of DRC config change flag |
142*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_MEM_INFO_SIZE | 0 | Gets the size of the memory type being referred to by the index |
143*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_MEMTABS_SIZE | 0 | Gets the size of the memory structures |
144*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_MEMTABS_PTR | 0 | Sets the memory structure pointer in the library to the allocated value |
145*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_N_MEMTABS | 0 | Gets the number of memory types |
146*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_INPUT_BYTES | 0 | Sets the number of bytes available in the input buffer for initialization |
147*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_MEM_INFO_ALIGNMENT | 0 | Gets the alignment information of the memory-type being referred to by the index |
148*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_MEM_INFO_TYPE | 0 | Gets the type of memory being referred to by the index |
149*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_MEM_PTR | 0 | Sets the pointer to the memory being referred to by the index to the input value |
150*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_INPUT_BYTES_BS | 0 | Sets the number of bytes to be processed in bitstream split format |
151*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_INPUT_BYTES_IC_BS | 0 | Sets the number of bytes to be processed in configuration bitstream split format |
152*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_SET_INPUT_BYTES_IL_BS | 0 | Sets the number of bytes to be processed in loudness bitstream split format |
153*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_GET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_PARAM_NUM_CHANNELS | Gets the output number of channels |
154*15dc779aSAndroid Build Coastguard Worker|IA_API_CMD_EXECUTE | IA_CMD_TYPE_DO_EXECUTE | Executes the decode thread |
155*15dc779aSAndroid Build Coastguard Worker
156*15dc779aSAndroid Build Coastguard Worker## Flowchart of calling sequence
157*15dc779aSAndroid Build Coastguard Worker
158*15dc779aSAndroid Build Coastguard Worker![API Flowchart](docs/Api_flowchart_dec.png)
159*15dc779aSAndroid Build Coastguard Worker
160*15dc779aSAndroid Build Coastguard Worker# Running the libxaac decoder
161*15dc779aSAndroid Build Coastguard Worker
162*15dc779aSAndroid Build Coastguard WorkerThe libxaac decoder can be run by providing command-line parameters(CLI options) directly or by providing a parameter file as a command line argument.
163*15dc779aSAndroid Build Coastguard Worker
164*15dc779aSAndroid Build Coastguard WorkerCommand line usage :
165*15dc779aSAndroid Build Coastguard Worker```
166*15dc779aSAndroid Build Coastguard Worker<executable> -ifile:<input_file> -imeta:<meta_data_file> -ofile:<output_file> [options]
167*15dc779aSAndroid Build Coastguard Worker
168*15dc779aSAndroid Build Coastguard Worker[options] can be,
169*15dc779aSAndroid Build Coastguard Worker[-mp4:<mp4_flag>]
170*15dc779aSAndroid Build Coastguard Worker[-pcmsz:<pcmwordsize>]
171*15dc779aSAndroid Build Coastguard Worker[-dmix:<down_mix>]
172*15dc779aSAndroid Build Coastguard Worker[-esbr_hq:<esbr_hq_flag>]
173*15dc779aSAndroid Build Coastguard Worker[-esbr_ps:<esbr_ps_flag>]
174*15dc779aSAndroid Build Coastguard Worker[-tostereo:<interleave_to_stereo>]
175*15dc779aSAndroid Build Coastguard Worker[-dsample:<down_sample_sbr>]
176*15dc779aSAndroid Build Coastguard Worker[-drc_cut_fac:<drc_cut_factor>]
177*15dc779aSAndroid Build Coastguard Worker[-drc_boost_fac:<drc_boost_factor>]
178*15dc779aSAndroid Build Coastguard Worker[-drc_target_level:<drc_target_level>]
179*15dc779aSAndroid Build Coastguard Worker[-drc_heavy_comp:<drc_heavy_compression>]
180*15dc779aSAndroid Build Coastguard Worker[-effect:<effect_type>]
181*15dc779aSAndroid Build Coastguard Worker[-target_loudness:<target_loudness>]
182*15dc779aSAndroid Build Coastguard Worker[-nosync:<disable_sync>]
183*15dc779aSAndroid Build Coastguard Worker[-sbrup:<auto_sbr_upsample>]
184*15dc779aSAndroid Build Coastguard Worker[-flflag:<framelength_flag>}
185*15dc779aSAndroid Build Coastguard Worker[-fs:<RAW_sample_rate>]
186*15dc779aSAndroid Build Coastguard Worker[-maxchannel:<maximum_num_channels>]
187*15dc779aSAndroid Build Coastguard Worker[-coupchannel:<coupling_channel>]
188*15dc779aSAndroid Build Coastguard Worker[-downmix:<down_mix_stereo>]
189*15dc779aSAndroid Build Coastguard Worker[-fs480:<ld_frame_size>]
190*15dc779aSAndroid Build Coastguard Worker[-ld_testing:<ld_testing_flag>]
191*15dc779aSAndroid Build Coastguard Worker[-peak_limiter_off:<peak_limiter_off_flag>]
192*15dc779aSAndroid Build Coastguard Worker[-err_conceal:<error_concealment_flag>]
193*15dc779aSAndroid Build Coastguard Worker[-esbr:<esbr_flag>]
194*15dc779aSAndroid Build Coastguard Worker
195*15dc779aSAndroid Build Coastguard Workerwhere,
196*15dc779aSAndroid Build Coastguard Worker  <input_file>             is the input AAC-LC/HE-AACv1/HE-AACv2/AAC-LD/AAC-ELD/AAC-ELDv2/USAC file name.
197*15dc779aSAndroid Build Coastguard Worker  <meta_data_file>         is a text file which contains metadata. To be given when -mp4:1 is enabled.
198*15dc779aSAndroid Build Coastguard Worker  <output_file>            is the output file name.
199*15dc779aSAndroid Build Coastguard Worker  <mp4_flag>               is a flag that should be set to 1 when passing raw stream along with meta data text file.
200*15dc779aSAndroid Build Coastguard Worker  <pcmwordsize>            is the bits per sample info. value can be 16 or 24.
201*15dc779aSAndroid Build Coastguard Worker  <down_mix>               is to enable/disable always mono output. Default 1.
202*15dc779aSAndroid Build Coastguard Worker  <esbr_hq_flag>           is to enable/disable high quality eSBR. Default 0.
203*15dc779aSAndroid Build Coastguard Worker  <esbr_ps_flag>           is to indicate eSBR with PS. Default 0.
204*15dc779aSAndroid Build Coastguard Worker  <interleave_to_stereo>   is to enable/disable always interleaved to stereo output. Default 1.
205*15dc779aSAndroid Build Coastguard Worker  <down_sample_sbr>        is to enable/disable down-sampled SBR output. Default auto identification from header.
206*15dc779aSAndroid Build Coastguard Worker  <drc_cut_factor>         is to set DRC cut factor value. Default value is 0.
207*15dc779aSAndroid Build Coastguard Worker  <drc_boost_factor>       is to set DRC boost factor. Default value is 0.
208*15dc779aSAndroid Build Coastguard Worker  <drc_target_level>       is to set DRC target reference level. Default value is 108.
209*15dc779aSAndroid Build Coastguard Worker  <drc_heavy_compression>  is to enable/disable DRC heavy compression. Default value is 0.
210*15dc779aSAndroid Build Coastguard Worker  <effect_type>            is to set DRC effect type. Default value is 0.
211*15dc779aSAndroid Build Coastguard Worker  <target_loudness>        is to set target loudness level. Default value is -24.
212*15dc779aSAndroid Build Coastguard Worker  <disable_sync>           is to disable the ADTS/ADIF sync search i.e when enabled the decoder expects the header to be at the start of input buffer. Default 0.
213*15dc779aSAndroid Build Coastguard Worker  <auto_sbr_upsample>      is to enable(1) or disable(0) auto SBR upsample in case of stream changing from SBR present to SBR not present. Default 1.
214*15dc779aSAndroid Build Coastguard Worker  <framelength_flag>       is flag for decoding framelength of 1024 or 960. 1 to decode 960 frame length, 0 to decode 1024 frame length.
215*15dc779aSAndroid Build Coastguard Worker                           Frame length value in the GA header will override this option. Default 0.
216*15dc779aSAndroid Build Coastguard Worker  <RAW_sample_rate>        is to indicate the core AAC sample rate for a RAW stream. If this is specified no other file format headers are searched for.
217*15dc779aSAndroid Build Coastguard Worker  <maximum_num_channels>   is the number of maxiumum channels the input may have. Default is 6 for multichannel libraries and 2 for stereo libraries.
218*15dc779aSAndroid Build Coastguard Worker  <coupling_channel>       is element instance tag of independent coupling channel to be mixed. Default is 0.
219*15dc779aSAndroid Build Coastguard Worker  <down_mix_stereo>        is flag for Downmix. Give 1 to get stereo (downmix) output. Default is 0.
220*15dc779aSAndroid Build Coastguard Worker  <ld_frame_size>          is to indicate ld frame size. 0 is for 512 frame length, 1 is for 480 frame length. Default value is 512 (0).
221*15dc779aSAndroid Build Coastguard Worker  <ld_testing_flag>        is to enable/disable ld decoder testing. Default value is 0.
222*15dc779aSAndroid Build Coastguard Worker  <peak_limiter_off_flag>  is to enable/disable peak limiter. Default value is 0.
223*15dc779aSAndroid Build Coastguard Worker  <error_concealment_flag> is to enable/disable error concealment. Default value is 0.
224*15dc779aSAndroid Build Coastguard Worker  <esbr_flag>              is to enable/disable eSBR. Default value is 1.
225*15dc779aSAndroid Build Coastguard Worker
226*15dc779aSAndroid Build Coastguard Worker```
227*15dc779aSAndroid Build Coastguard WorkerSample CLI:
228*15dc779aSAndroid Build Coastguard Worker```
229*15dc779aSAndroid Build Coastguard Worker<xaac_dec_exe> -ifile:in_file.aac -ofile:out_file.wav -pcmsz:16
230*15dc779aSAndroid Build Coastguard Worker```
231*15dc779aSAndroid Build Coastguard Worker
232*15dc779aSAndroid Build Coastguard Worker# Validating the libxaac decoder
233*15dc779aSAndroid Build Coastguard Worker
234*15dc779aSAndroid Build Coastguard WorkerConformance testing for AAC/HE-AACv1/HE-AACv2 mainly involves comparing
235*15dc779aSAndroid Build Coastguard Workerdecoder under test output with the ISO and 3GPP reference decoded output.
236*15dc779aSAndroid Build Coastguard Worker
237*15dc779aSAndroid Build Coastguard WorkerTesting for USAC is done using encoded streams generated using ISO USAC
238*15dc779aSAndroid Build Coastguard Workerreference encoder. The output generated by libxaac USAC decoder is
239*15dc779aSAndroid Build Coastguard Workercompared against the output generated by ISO USAC decoder for 16-bit
240*15dc779aSAndroid Build Coastguard Workerconformance on the respective(ARMv7, ARMv8, X86_32, X86_64) platforms.
241*15dc779aSAndroid Build Coastguard Worker
242