Hamsalekha S | 8d3d303 | 2015-03-13 21:24:58 +0530 | [diff] [blame^] | 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 | /** |
| 22 | ****************************************************************************** |
| 23 | * @file ih264_cabac_tables.h |
| 24 | * |
| 25 | * @brief |
| 26 | * This file contains enumerations, macros and extern declarations of H264 |
| 27 | * cabac tables |
| 28 | * |
| 29 | * @author |
| 30 | * Ittiam |
| 31 | * |
| 32 | * @remarks |
| 33 | * none |
| 34 | ****************************************************************************** |
| 35 | */ |
| 36 | |
| 37 | #ifndef IH264_CABAC_TABLES_H_ |
| 38 | #define IH264_CABAC_TABLES_H_ |
| 39 | |
| 40 | /*****************************************************************************/ |
| 41 | /* Constant Macros */ |
| 42 | /*****************************************************************************/ |
| 43 | |
| 44 | /** |
| 45 | ****************************************************************************** |
| 46 | * @brief maximum range of cabac_init_idc (0-2) |
| 47 | ****************************************************************************** |
| 48 | */ |
| 49 | #define IH264_NUM_CABAC_INIT_IDC_PLUS_ONE 4 |
| 50 | |
| 51 | /** |
| 52 | ****************************************************************************** |
| 53 | * @brief max range of qps in H264 (0-51) |
| 54 | ****************************************************************************** |
| 55 | */ |
| 56 | #define IH264_MAX_QP 52 |
| 57 | |
| 58 | /** |
| 59 | ****************************************************************************** |
| 60 | * @brief max range of cabac contexts in H264 (0-459) |
| 61 | ****************************************************************************** |
| 62 | */ |
| 63 | #define IH264_NUM_CABAC_CTXTS 460 |
| 64 | |
| 65 | /*****************************************************************************/ |
| 66 | /* Extern global declarations */ |
| 67 | /*****************************************************************************/ |
| 68 | |
| 69 | /** |
| 70 | ****************************************************************************** |
| 71 | * @breif Table for rangeTabLPS depending on pStateIdx and qCodIRangeIdx |
| 72 | * input : pStateIdx(0-63) and qCodIRangeIdx(0-3) [(Range >> 6) & 0x3] |
| 73 | * output : RLps |
| 74 | * |
| 75 | * @remarks See Table 9-35 of H264 spec for rangeTabLPS |
| 76 | ******************************************************************************* |
| 77 | */ |
| 78 | extern const UWORD8 gau1_ih264_cabac_rlps[64][4]; |
| 79 | |
| 80 | |
| 81 | /** |
| 82 | ****************************************************************************** |
| 83 | * @breif probability+MPS state transition tables based on cur State and bin |
| 84 | * input : curpState[bits7-2] | curMPS[bit1] | decodedBin[bit0] |
| 85 | * output : nextpState[bits6-1] | nextMPS[bit0] |
| 86 | * @remarks Modified form of Table-9-36 State Transition table in H264 spec |
| 87 | ****************************************************************************** |
| 88 | */ |
| 89 | extern const UWORD8 gau1_ih264_next_state[128*2]; |
| 90 | |
| 91 | |
| 92 | /** |
| 93 | ****************************************************************************** |
| 94 | * @brief Init context tables for all combinations of qp and cabac_init_idc |
| 95 | * @remarks Packing format MPS in lsb and pState in bits[1-6] |
| 96 | ****************************************************************************** |
| 97 | */ |
| 98 | extern const UWORD8 gau1_ih264_cab_ctxts[IH264_NUM_CABAC_INIT_IDC_PLUS_ONE][IH264_MAX_QP][IH264_NUM_CABAC_CTXTS]; |
| 99 | |
| 100 | |
| 101 | #endif /* IH264_CABAC_TABLES_H_ */ |