1 /******************************************************************************
2  *
3  * Copyright (C) 2015 The Android Open Source Project
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at:
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *****************************************************************************
18  * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
19 */
20 
21 #ifndef _IH264D_ERROR_HANDLER_H_
22 #define _IH264D_ERROR_HANDLER_H_
23 
24 /*!
25  *************************************************************************
26  * \file ih264d_error_handler.h
27  *
28  * \brief
29  *    Contains declaration of ih264d_global_error_handler function
30  *
31  * \date
32  *    21/11/2002
33  *
34  * \author  AI
35  *************************************************************************
36  */
37 
38 #include "ih264_typedefs.h"
39 #include "ih264_macros.h"
40 #include "ih264_platform_macros.h"
41 #include "ih264d_structs.h"
42 
43 typedef enum
44 {
45 
46     ERROR_MEM_ALLOC_ISRAM_T = 0x50,
47     ERROR_MEM_ALLOC_SDRAM_T = 0x51,
48     ERROR_BUF_MGR = 0x52,
49     ERROR_DBP_MANAGER_T = 0x53,
50     ERROR_GAPS_IN_FRM_NUM = 0x54,
51     ERROR_UNKNOWN_NAL = 0x55,
52     ERROR_INV_MB_SLC_GRP_T = 0x56,
53     ERROR_MULTIPLE_SLC_GRP_T = 0x57,
54     ERROR_UNKNOWN_LEVEL = 0x58,
55     ERROR_FEATURE_UNAVAIL = 0x59,
56     ERROR_NOT_SUPP_RESOLUTION = 0x5A,
57     ERROR_INVALID_PIC_PARAM = 0x5B,
58     ERROR_INVALID_SEQ_PARAM = 0x5C,
59     ERROR_EGC_EXCEED_32_1_T = 0x5D,
60     ERROR_EGC_EXCEED_32_2_T = 0x5E,
61     ERROR_INV_RANGE_TEV_T = 0x5F,
62     ERROR_INV_SLC_TYPE_T = 0x60,
63     ERROR_UNAVAIL_PICBUF_T = 0x61,
64     ERROR_UNAVAIL_MVBUF_T = 0x62,
65     ERROR_UNAVAIL_DISPBUF_T = 0x63,
66     ERROR_INV_POC_TYPE_T = 0x64,
67     ERROR_PIC1_NOT_FOUND_T = 0x65,
68     ERROR_PIC0_NOT_FOUND_T = 0x66,
69     ERROR_NUM_REF = 0x67,
70     ERROR_REFIDX_ORDER_T = 0x68,
71     ERROR_EOB_FLUSHBITS_T = 0x69,
72     ERROR_EOB_GETBITS_T = 0x6A,
73     ERROR_EOB_GETBIT_T = 0x6B,
74     ERROR_EOB_BYPASS_T = 0x6C,
75     ERROR_EOB_DECISION_T = 0x6D,
76     ERROR_EOB_TERMINATE_T = 0x6E,
77     ERROR_EOB_READCOEFF4X4CAB_T = 0x6F,
78     ERROR_INV_RANGE_QP_T = 0x70,
79     ERROR_END_OF_FRAME_EXPECTED_T = 0x71,
80     ERROR_MB_TYPE = 0x72,
81     ERROR_SUB_MB_TYPE = 0x73,
82     ERROR_CBP = 0x74,
83     ERROR_REF_IDX = 0x75,
84     ERROR_NUM_MV = 0x76,
85     ERROR_CHROMA_PRED_MODE = 0x77,
86     ERROR_INTRAPRED = 0x78,
87     ERROR_NEXT_MB_ADDRESS_T = 0x79,
88     ERROR_MB_ADDRESS_T = 0x7A,
89     ERROR_MB_GROUP_ASSGN_T = 0x7B,
90     ERROR_CAVLC_NUM_COEFF_T = 0x7C,
91     ERROR_CAVLC_SCAN_POS_T = 0x7D,
92     ERROR_CABAC_RENORM_T = 0x7E,
93     ERROR_CABAC_SIG_COEFF1_T = 0x7F,
94     ERROR_CABAC_SIG_COEFF2_T = 0x80,
95     ERROR_CABAC_ENCODE_COEFF_T = 0x81,
96     ERROR_INV_SPS_PPS_T = 0x82,
97     ERROR_INV_SLICE_HDR_T = 0x83,
98     ERROR_PRED_WEIGHT_TABLE_T = 0x84,
99     IH264D_VERS_BUF_INSUFFICIENT = 0x85,
100     ERROR_ACTUAL_LEVEL_GREATER_THAN_INIT = 0x86,
101     ERROR_CORRUPTED_SLICE = 0x87,
102     ERROR_FRAME_LIMIT_OVER = 0x88,
103     ERROR_ACTUAL_RESOLUTION_GREATER_THAN_INIT = 0x89,
104     ERROR_PROFILE_NOT_SUPPORTED = 0x8A,
105     ERROR_DISP_WIDTH_RESET_TO_PIC_WIDTH = 0x8B,
106     ERROR_DISP_WIDTH_INVALID = 0x8C,
107     ERROR_DANGLING_FIELD_IN_PIC = 0x8D,
108     ERROR_DYNAMIC_RESOLUTION_NOT_SUPPORTED = 0x8E,
109     ERROR_INIT_NOT_DONE = 0x8F,
110     ERROR_LEVEL_UNSUPPORTED = 0x90,
111     ERROR_START_CODE_NOT_FOUND = 0x91,
112     ERROR_PIC_NUM_IS_REPEATED = 0x92,
113     ERROR_IN_LAST_SLICE_OF_PIC = 0x93,
114     ERROR_NEW_FRAME_EXPECTED = 0x94,
115     ERROR_INCOMPLETE_FRAME = 0x95
116 
117 } h264_decoder_error_code_t;
118 
119 WORD32 ih264d_mark_err_slice_skip(dec_struct_t * ps_dec,
120                                   WORD32 num_mb_skip,
121                                   UWORD8 u1_is_idr_slice,
122                                   UWORD16 u2_frame_num,
123                                   pocstruct_t *ps_cur_poc,
124                                   WORD32 prev_slice_err);
125 
126 void ih264d_err_pic_dispbuf_mgr(dec_struct_t *ps_dec);
127 #endif /* _IH264D_ERROR_HANDLER_H_ */
128