blob: 88af4ec9ec85885601fe71d2bd57667441d8ebba [file] [log] [blame]
Hamsalekha S8d3d3032015-03-13 21:24:58 +05301/******************************************************************************
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_TABLES_H_
22#define _IH264D_TABLES_H_
23
24/**
25 **************************************************************************
26 * \file ih264d_tables.h
27 *
28 * \brief
29 * Declaration of all tables used by h264 decoder
30 *
31 * \date
32 * 17/09/2004
33 *
34 * \author MA
35 **************************************************************************
36 */
37#include "ih264_typedefs.h"
38#include "ih264_macros.h"
39#include "ih264_platform_macros.h"
40#include "ih264d_cabac.h"
41
42/*Deblocking Table declaration*/
43extern const UWORD8 gau1_ih264d_qp_scale_cr[];
44extern const UWORD8 gau1_ih264d_alpha_table[];
45extern const UWORD8 gau1_ih264d_clip_table_deblock[];
46extern const UWORD8 gau1_ih264d_beta_table[];
47extern const UWORD8 gau1_ih264d_clip_table[][4];
48
49/*Parsing Table declaration*/
50extern const UWORD8 gau1_ih264d_cbp_tab[6];
Marco Nelissen8ef4c3f2015-06-03 07:26:32 -070051extern const UWORD32 gau4_ih264d_packed_bs2[32];
Hamsalekha S8d3d3032015-03-13 21:24:58 +053052extern const UWORD16 gau2_ih264d_4x4_v2h_reorder[16];
53extern const UWORD8 gau1_ih264d_subblk_offset[16];
54extern const UWORD8 gau1_ih264d_cbp_table[48][2];
55
56/*Decode Slice Table declaration*/
57extern const UWORD8 gau1_ih264d_inv_scan[16];
58extern const UWORD8 gau1_ih264d_inv_scan_fld[16];
59extern const UWORD8 gau1_ih264d_dequant_matrix[6][16];
60extern const UWORD16 gau2_ih264_iquant_scale_4x4[6][16];
61extern const UWORD8 gau1_ih264d_dequant8x8_zigzag_cavlc[4][6][16];
62extern const UWORD16 gau1_ih264d_dequant8x8_cavlc[6][64];
63
64extern const UWORD8 gau1_ih264d_inv_scan_prog8x8_cavlc[4][16];
65extern const UWORD8 gau1_ih264d_inv_scan_int8x8_cavlc[4][16];
66extern const UWORD8 gau1_ih264d_inv_scan_prog8x8_cabac[64];
67extern const UWORD8 gau1_ih264d_inv_scan_int8x8_cabac[64];
68
69extern const UWORD8 gau1_ih264d_lastcoeff_context_inc[64];
70extern const UWORD8 gau1_ih264d_sigcoeff_context_inc_frame[64];
71extern const UWORD8 gau1_ih264d_sigcoeff_context_inc_field[64];
72
73/* scaling related table declaration */
74extern const WORD16 gai2_ih264d_default_intra4x4[16];
75extern const WORD16 gai2_ih264d_default_inter4x4[16];
76extern const WORD16 gai2_ih264d_default_intra8x8[64];
77extern const WORD16 gai2_ih264d_default_inter8x8[64];
78extern const WORD16 gai2_ih264d_flat_4x4[16];
79extern const WORD16 gai2_ih264d_flat_8x8[64];
80
81/*Decode MV Table declaration*/
82extern const WORD8 gau1_ih264d_mv_pred_condition[];
83
84/** Number of subMbs for the 8x8 prediction mode */
85extern const UWORD8 gau1_ih264d_num_submb_part[];
86
87/** Width of the 8x8 prediction mode in terms of subMbs */
88extern const UWORD8 gau1_ih264d_submb_partw[];
89
90/** Height of the 8x8 prediction mode in terms of subMbs */
91extern const UWORD8 gau1_ih264d_submb_parth[];
92
93/** Number of MB partitions for the MB prediction mode */
94extern const UWORD8 gau1_ih264d_num_mb_part[];
95
96/** Width of the MB partition in terms of subMbs */
97extern const UWORD8 gau1_ih264d_mb_partw[];
98
99/** Height of the MB partition in terms of subMbs */
100extern const UWORD8 gau1_ih264d_mb_parth[];
101
102/** MB partition information is packed into a UWORD32 {0,number,width,height} */
103extern const UWORD32 gau4_ih264d_submb_part[];
104
105extern const UWORD8 gau1_ih264d_submb_indx_mod[];
106
107/** This table is used to assign CBPs to Inter MBs. */
108extern const UWORD8 gau1_ih264d_cbp_inter[];
109
110/** Motion comp modes for P followed by B,
111 0 to 4 : P Mbs
112 5 to 27 : B Mbs
113 28 to 30 : DIRECT */
114extern const UWORD8 gau1_ih264d_mb_mc_mode[];
115
116extern const UWORD8 gau1_ih264d_submb_mc_mode[];
117
118/** Sub MB pred modes for B slice */
119extern const UWORD8 gau1_ih264d_submb_pred_modes[];
120
121/** MB pred modes for P and B slice */
122extern const WORD8 gau1_ih264d_mb_pred_modes[2][32];
123
124/*Decode CAVLC Table declaration*/
125extern const UWORD8 gau1_ih264d_table_total_zero_2to10[9][64];
126extern const UWORD8 gau1_ih264d_table_total_zero_11to15[5][16];
127extern const UWORD8 gau1_ih264d_table_run_before[64];
128extern const UWORD16 gau2_ih264d_code_gx[304];
129extern const UWORD8 gau1_ih264d_cav_chromdc_vld[256];
130extern const UWORD16 gau2_ih264d_offset_num_vlc_tab[9];
131extern const UWORD8 gau1_ih264d_total_coeff_fn_ptr_offset[16];
132extern const WORD16 gai2_ih264d_trailing_one_level[14][3];
133
134/*Decode CABAC Table declaration*/
Marco Nelissen8ef4c3f2015-06-03 07:26:32 -0700135extern const UWORD32 gau4_ih264d_cabac_table[128][4];
Hamsalekha S8d3d3032015-03-13 21:24:58 +0530136
137/****************************************************************************/
138/* For error detection in intra pred4x4 modes */
139/****************************************************************************/
140extern const UWORD8 gau1_ih264d_intra_pred_err_code[9];
141
142/*****************************************************************************/
143/* Cabac tables for context initialization depending upon type of Slice, */
144/* cabac init Idc value and Qp. */
145/*****************************************************************************/
146extern const UWORD8 gau1_ih264d_cabac_ctxt_init_table[NUM_CAB_INIT_IDC_PLUS_ONE][QP_RANGE][NUM_CABAC_CTXTS];
147
148/*****************************************************************************/
149/* SEI tables for field usge and which field first */
150/*****************************************************************************/
151extern const UWORD8 gau1_ih264d_sei_fld_usage[9][3];
152
153
154extern const UWORD8 gau1_ih264d_top_left_mb_part_indx_mod[];
155extern const UWORD8 gau1_ih264d_submb_indx_mod_sp_drct[];
156
157#endif /*TABLES_H*/