/******************************************************************************
 *                                                                            *
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *****************************************************************************
 * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
*/
#ifndef IXHEAACD_ERROR_CODES_H
#define IXHEAACD_ERROR_CODES_H

/*****************************************************************************/
/* Class 0: API Errors                                                       */
/*****************************************************************************/
/* Non Fatal Errors */
#define IA_XHEAAC_DEC_API_NONFATAL_NO_ERROR 0x00000000
#define IA_XHEAAC_DEC_API_NONFATAL_CMD_NOT_SUPPORTED 0x00000001
#define IA_XHEAAC_DEC_API_NONFATAL_CMD_TYPE_NOT_SUPPORTED 0x00000002
/* Fatal Errors */
#define IA_XHEAAC_DEC_API_FATAL_INVALID_MEMTAB_INDEX 0xFFFF8000
#define IA_XHEAAC_DEC_API_FATAL_INVALID_LIB_ID_STRINGS_IDX 0xFFFF8001
#define IA_XHEAAC_DEC_API_FATAL_MEM_ALLOC 0xFFFF8002
#define IA_XHEAAC_DEC_API_FATAL_INVALID_CONFIG_PARAM 0xFFFF8003
#define IA_XHEAAC_DEC_API_FATAL_INVALID_EXECUTE_TYPE 0xFFFF8004
#define IA_XHEAAC_DEC_API_FATAL_INVALID_CMD 0xFFFF8005
#define IA_XHEAAC_DEC_API_FATAL_MEM_ALIGN 0xFFFF8006
/*****************************************************************************/
/* Class 1: Configuration Errors                                             */
/*****************************************************************************/
/* Non Fatal Errors */
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_PCM_WDSZ 0x00000800
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_DOWNMIX 0x00000801
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_ESBR_PS_FLAG 0x00000802
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_DOWNMIX_STEREO 0x00000803
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_TOSTEREO 0x00000804
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_DSAMPLE 0x00000805
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_PEAK_LIM_FLAG_TYPE 0x00000806
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_MP4FLAG 0x00000807
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_MAX_CHANNEL 0x00000808
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_COUP_CHANNEL 0x00000809
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_ERR_CONCEAL_FLAG_TYPE 0x0000080A
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_SYNCFLAG 0x0000080B
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_SBRUPFLAG 0x0000080C
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_DRCFLAG 0x0000080D
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_DRC_CUT 0x0000080E
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_DRC_BOOST 0x0000080F
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_DRC_TARGET 0x00000810
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_FRAMSZ 0x00000811
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_LD_CONFIG 0x00000812
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_EFFECT_TYPE 0x00000813
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_TARGET_LOUDNESS 0x00000814
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_ESBR_HQ_FLAG 0x00000815
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_FRAMELENGTHFLAG 0x00000816
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_ESBR_FLAG 0x00000817
#ifdef LOUDNESS_LEVELING_SUPPORT
#define IA_XHEAAC_DEC_CONFIG_NONFATAL_INVALID_LOUDNESS_LEVELING_FLAG 0x00000818
#endif
/* Fatal Errors */
#define IA_XHEAAC_DEC_CONFIG_FATAL_INVALID_SAMPLE_RATE 0xFFFF8800

/*****************************************************************************/
/* Class 2: Initialization Errors                                            */
/*****************************************************************************/
/* Non Fatal Errors */
#define IA_XHEAAC_DEC_INIT_NONFATAL_HEADER_NOT_AT_START 0x00001000
#define IA_XHEAAC_MPS_DEC_INIT_NONFATAL_INVALID_QMF_BAND 0x00001001
#define IA_XHEAAC_DEC_INIT_NONFATAL_EC_INIT_FAIL 0x00001002
#define IA_XHEAAC_DEC_INIT_NONFATAL_INSUFFICIENT_INPUT_BYTES 0x00001003
#define IA_XHEAAC_DEC_INIT_NONFATAL_DECODE_FRAME_ERROR 0x00001004
#define IA_XHEAAC_DEC_INIT_NONFATAL_MAX_INSTRUCTIONS_ERROR 0x00001005
/* Fatal Errors */
#define IA_XHEAAC_DEC_INIT_FATAL_DEC_INIT_FAIL 0xFFFF9000
#define IA_XHEAAC_DEC_INIT_FATAL_EO_INPUT_REACHED 0xFFFF9001
#define IA_XHEAAC_DEC_INIT_FATAL_STREAM_CHAN_GT_MAX 0xFFFF9002
#define IA_XHEAAC_DEC_INIT_FATAL_AUDIOOBJECTTYPE_NOT_SUPPORTED 0xFFFF9003
#define IA_XHEAAC_DEC_INIT_FATAL_EC_INIT_FAIL 0xFFFF9004
#define IA_XHEAAC_DEC_INIT_FATAL_UNIMPLEMENTED_CCE 0xFFFF9005

/*****************************************************************************/
/* Class 3: Execution Errors                                                 */
/*****************************************************************************/
/* Non Fatal Errors */
#define IA_XHEAAC_DEC_EXE_NONFATAL_ADTS_SYNC_LOST 0x00001800
#define IA_XHEAAC_DEC_EXE_NONFATAL_SBR_TURNED_OFF 0x00001801
#define IA_XHEAAC_DEC_EXE_NONFATAL_SBR_TURNED_ON 0x00001802
#define IA_XHEAAC_DEC_EXE_NONFATAL_ADTS_HDR_CRC_FAIL 0x00001803
#define IA_XHEAAC_DEC_EXE_NONFATAL_INSUFFICIENT_INPUT_BYTES 0x00001804

#define IA_XHEAAC_DEC_EXE_NONFATAL_ELE_INSTANCE_TAG_NOT_FOUND 0x00001805
#define IA_XHEAAC_DEC_EXE_NONFATAL_EXCEEDS_MAX_HUFFDEC_VAL 0x00001806
#define IA_XHEAAC_DEC_EXE_NONFATAL_DECODE_FRAME_ERROR 0x00001807
#define IA_XHEAAC_DEC_EXE_NONFATAL_EXCEEDS_SFB_TRANSMITTED 0x00001808
#define IA_XHEAAC_DEC_EXE_NONFATAL_GAIN_CONTROL_DATA_PRESENT 0x00001809
#define IA_XHEAAC_DEC_EXE_NONFATAL_TNS_ORDER_ERROR 0x0000180A
#define IA_XHEAAC_DEC_EXE_NONFATAL_PREDICTION_DATA_PRESENT 0x0000180B
#define IA_XHEAAC_DEC_EXE_NONFATAL_CHANGED_ADTS_SF 0x0000180C
#define IA_XHEAAC_DEC_EXE_NONFATAL_PULSEDATA_ERROR 0x0000180D
#define IA_XHEAAC_DEC_EXE_NONFATAL_INVALID_CODE_BOOK 0x0000180E
#define IA_XHEAAC_MPS_DEC_EXE_NONFATAL_INVALID_CHANNEL_INDEX 0x0000180F
#define IA_XHEAAC_MPS_DEC_EXE_NONFATAL_INVALID_SMOOTH_MODE 0x00001810
#define IA_XHEAAC_MPS_DEC_EXE_NONFATAL_INVALID_SMGTIME 0x00001811
#define IA_XHEAAC_MPS_DEC_EXE_NONFATAL_INVALID_EXTENSION_TYPE 0x00001812
#define IA_XHEAAC_MPS_DEC_EXE_NONFATAL_INVALID_QMF_UPDATE 0x00001813
#define IA_XHEAAC_MPS_DEC_EXE_NONFATAL_INVALID_WINDOW_TYPE 0x00001814
#define IA_XHEAAC_MPS_DEC_EXE_NONFATAL_INVALID_SIN_PARAM 0x00001815
#define IA_XHEAAC_DEC_EXE_NONFATAL_SBR_PARSE_ERROR 0x00001816
/* Fatal Errors */
#define IA_XHEAAC_DEC_EXE_FATAL_UNIMPLEMENTED_CCE 0xFFFF9800
#define IA_XHEAAC_DEC_EXE_FATAL_TNS_RANGE_ERROR 0xFFFF9801
#define IA_XHEAAC_DEC_EXE_FATAL_INVALID_LOAS_HEADER 0xFFFF9802
#define IA_XHEAAC_DEC_EXE_FATAL_INVALID_DRC_DATA 0xFFFF9803
#define IA_XHEAAC_MPS_DEC_EXE_FATAL_INVALID_RESHAPE_INPUT 0xFFFF9804
#define IA_XHEAAC_MPS_DEC_EXE_FATAL_UNSUPPRORTED_TREE_CONFIG 0xFFFF9805
#define IA_XHEAAC_MPS_DEC_EXE_FATAL_INVALID_TIMESLOTS 0xFFFF9806
#define IA_XHEAAC_MPS_DEC_EXE_FATAL_INVALID_DEQUANT_PARAM 0xFFFF9807
#define IA_XHEAAC_MPS_DEC_EXE_FATAL_INVALID_QUANT_MODE 0xFFFF9808
#define IA_XHEAAC_MPS_DEC_EXE_FATAL_INVALID_INPUT_CHANNEL 0xFFFF9809
#define IA_XHEAAC_MPS_DEC_EXE_FATAL_NONZERO_BIT 0xFFFF980A
#define IA_XHEAAC_MPS_DEC_EXE_FATAL_INVALID_WINDOW_SEQUENCE 0xFFFF980B
#define IA_XHEAAC_MPS_DEC_EXE_FATAL_INVALID_TEMPORAL_SHAPING_CONFIG 0xFFFF980C
#define IA_XHEAAC_MPS_DEC_EXE_FATAL_INVALID_HRTF_SET 0xFFFF980D
#define IA_XHEAAC_MPS_DEC_EXE_FATAL_INVALID_TTT_MODE 0xFFFF980E
#define IA_XHEAAC_MPS_DEC_EXE_FATAL_INVALID_OTT_BOXES 0xFFFF980F
#define IA_XHEAAC_MPS_DEC_EXE_FATAL_INVALID_PARAMETER_SETS 0xFFFF9810
#define IA_XHEAAC_MPS_DEC_EXE_FATAL_INVALID_MPS_PARAM 0xFFFF9811
#define IA_XHEAAC_MPS_DEC_EXE_FATAL_INVALID_PARAMETER_BANDS 0xFFFF9812

#endif /* IXHEAACD_ERROR_CODES_H */
