/******************************************************************************
 *                                                                            *
 * 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_ENHAACPLUS_DEC_API_NONFATAL_NO_ERROR 0x00000000
#define IA_ENHAACPLUS_DEC_API_NONFATAL_CMD_NOT_SUPPORTED 0x00000001
#define IA_ENHAACPLUS_DEC_API_NONFATAL_CMD_TYPE_NOT_SUPPORTED 0x00000002
/* Fatal Errors */
#define IA_ENHAACPLUS_DEC_API_FATAL_INVALID_MEMTAB_INDEX 0xFFFF8000
#define IA_ENHAACPLUS_DEC_API_FATAL_INVALID_LIB_ID_STRINGS_IDX 0xFFFF8001
#define IA_ENHAACPLUS_DEC_API_FATAL_MEM_ALLOC 0xFFFF8002
#define IA_ENHAACPLUS_DEC_API_FATAL_INVALID_CONFIG_PARAM 0xFFFF8003
#define IA_ENHAACPLUS_DEC_API_FATAL_INVALID_EXECUTE_TYPE 0xFFFF8004
#define IA_ENHAACPLUS_DEC_API_FATAL_INVALID_CMD 0xFFFF8005
#define IA_ENHAACPLUS_DEC_API_FATAL_MEM_ALIGN 0xFFFF8006
/*****************************************************************************/
/* Class 1: Configuration Errors                                             */
/*****************************************************************************/
/* Non Fatal Errors */
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_PCM_WDSZ 0x00000800
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_DOWNMIX 0x00000801
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_OUT08KHZ 0x00000802
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_OUT16KHZ 0x00000803
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_TOSTEREO 0x00000804
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_DSAMPLE 0x00000805
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_FRAMEOK 0x00000806
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_MP4FLAG 0x00000807
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_MAX_CHANNEL 0x00000808
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_COUP_CHANNEL 0x00000809
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_FEATURE_NOT_SUPPORTED 0x0000080A
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_SYNCFLAG 0x0000080B
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_SBRUPFLAG 0x0000080C

#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_LOASFLAG 0x0000080D

#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_DRCFLAG 0x0000080E
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_DRC_CUT 0x0000080F
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_DRC_BOOST 0x00000810
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_DRC_TARGET 0x00000811
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_FRAMSZ 0x00000812
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_ELDSBR 0x00000813
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_LD_CONFIG 0x00000814
#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_DELAY_MODE 0x00000815
#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_DECODE_TYPE 0x00000816
#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_PEAK_LIM_FLAG 0x00000817
#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_CTRL_PARAM_IDX 0x00000818
#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_GAIN_DELAY 0x00000819
#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_CONST_DELAY_MODE 0x0000081A
#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_EFFECT_TYPE 0x0000081B
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_TARGET_LOUDNESS 0x0000081C

// Fatal Errors
#define IA_ENHAACPLUS_DEC_CONFIG_FATAL_INVALID_SAMPLE_RATE 0xFFFF8800

// Class 2: Initialization Errors

// Non Fatal Errors
#define IA_ENHAACPLUS_DEC_INIT_NONFATAL_BOTH_16AND08OUT 0x00001000
#define IA_ENHAACPLUS_DEC_INIT_NONFATAL_NO_UPSAMPLING 0x00001001
#define IA_ENHAACPLUS_DEC_INIT_NONFATAL_HEADER_NOT_AT_START 0x00001002

// Fatal Errors
#define IA_ENHAACPLUS_DEC_INIT_FATAL_DEC_INIT_FAIL 0xFFFF9000
#define IA_ENHAACPLUS_DEC_INIT_FATAL_EO_INPUT_REACHED 0xFFFF9001
#define IA_ENHAACPLUS_DEC_INIT_FATAL_STREAM_CHAN_GT_MAX 0xFFFF9002
#define IA_ENHAACPLUS_DEC_INIT_FATAL_AUDIOOBJECTTYPE_NOT_SUPPORTED 0xFFFF9003

// Class 3: Execution Errors

// Non Fatal Errors
#define IA_ENHAACPLUS_DEC_EXE_NONFATAL_ADTS_SYNC_LOST 0x00001800
#define IA_ENHAACPLUS_DEC_EXE_NONFATAL_SBR_TURNED_OFF 0x00001801
#define IA_ENHAACPLUS_DEC_EXE_NONFATAL_SBR_TURNED_ON 0x00001802
#define IA_ENHAACPLUS_DEC_EXE_NONFATAL_ADTS_HDR_CRC_FAIL 0x00001803
#define IA_ENHAACPLUS_DEC_EXE_NONFATAL_INSUFFICIENT_INPUT_BYTES 0x00001804

#define IA_ENHAACPLUS_DEC_EXE_NONFATAL_ELE_INSTANCE_TAG_NOT_FOUND 0x00001805
#define IA_ENHAACPLUS_DEC_EXE_NONFATAL_EXCEEDS_MAX_HUFFDEC_VAL 0x00001806
#define IA_ENHAACPLUS_DEC_EXE_NONFATAL_DECODE_FRAME_ERROR 0x00001807
#define IA_ENHAACPLUS_DEC_EXE_NONFATAL_EXCEEDS_SFB_TRANSMITTED 0x00001808
#define IA_ENHAACPLUS_DEC_EXE_NONFATAL_GAIN_CONTROL_DATA_PRESENT 0x00001809
#define IA_ENHAACPLUS_DEC_EXE_NONFATAL_TNS_ORDER_ERROR 0x0000180A
#define IA_ENHAACPLUS_DEC_EXE_NONFATAL_PREDICTION_DATA_PRESENT 0x0000180B
#define IA_ENHAACPLUS_DEC_EXE_NONFATAL_CHANGED_ADTS_SF 0x0000180C
#define IA_ENHAACPLUS_DEC_EXE_NONFATAL_PULSEDATA_ERROR 0x0000180D
#define IA_ENHAACPLUS_DEC_EXE_NONFATAL_INVALID_CODE_BOOK 0x0000180E

// Fatal Errors
#define IA_ENHAACPLUS_DEC_EXE_FATAL_UNIMPLEMENTED_CCE 0xFFFF9800
#define IA_ENHAACPLUS_DEC_EXE_FATAL_TNS_RANGE_ERROR 0xFFFF9801
#define IA_ENHAACPLUS_DEC_EXE_FATAL_INVALID_LOAS_HEADER 0xFFFF9802
#define IA_AACLD_DEC_EXE_FATAL_ER_PROFILE_UNSUPPORTED 0xFFFF9803
#define IA_ENHAACPLUS_DEC_EXE_FATAL_INVALID_DRC_DATA 0xFFFF9804

#endif /* IXHEAACD_ERROR_CODES_H */
