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 24 * ih264_deblk_tables.c 25 * 26 * @brief 27 * Contains tables used for deblocking 28 * 29 * @author 30 * ittiam 31 * 32 * @remarks 33 * none 34 * 35 ******************************************************************************* 36 */ 37 38 /*****************************************************************************/ 39 /* File Includes */ 40 /*****************************************************************************/ 41 42 /* System include files */ 43 #include <stdio.h> 44 45 /* User include files */ 46 #include "ih264_typedefs.h" 47 #include "ih264_deblk_tables.h" 48 49 /*****************************************************************************/ 50 /* Extern global definitions */ 51 /*****************************************************************************/ 52 53 /** 54 ****************************************************************************** 55 * @brief alpha & beta tables for deblocking 56 * input : indexA [0-51] & indexB [0-51] 57 * output : alpha & beta 58 * 59 * @remarks Table 8-16 - in H264 Specification, 60 * Derivation of offset dependent threshold variables 61 * alpha and beta from indexA and indexB 62 ****************************************************************************** 63 */ 64 const UWORD8 gu1_ih264_alpha_table[52] = 65 { 66 /* indexA :: 0-51 inclusive */ 67 0, 0, 0, 0, 0, 0, 0, 0, 68 0, 0, 0, 0, 0, 0, 0, 0, 69 4, 4, 5, 6, 7, 8, 9, 10, 70 12, 13, 15, 17, 20, 22, 25, 28, 71 32, 36, 40, 45, 50, 56, 63, 71, 72 80, 90, 101, 113, 127, 144, 162, 182, 73 203, 226, 255, 255, 74 }; 75 76 const UWORD8 gu1_ih264_beta_table[52] = 77 { 78 /* indexB :: 0-51 inclusive */ 79 0, 0, 0, 0, 0, 0, 0, 0, 80 0, 0, 0, 0, 0, 0, 0, 0, 81 2, 2, 2, 3, 3, 3, 3, 4, 82 4, 4, 6, 6, 7, 7, 8, 8, 83 9, 9, 10, 10, 11, 11, 12, 12, 84 13, 13, 14, 14, 15, 15, 16, 16, 85 17, 17, 18, 18, 86 }; 87 88 /** 89 ****************************************************************************** 90 * @brief t'C0 table for deblocking 91 * input : indexA [0-51] and bS [1,3] 92 * output : t'C0 93 * 94 * @remarks Table 8-17 - in H264 Specification, 95 * Value of variable t'C0 as a function of indexA and bS 96 ****************************************************************************** 97 */ 98 const UWORD8 gu1_ih264_clip_table[52][4] = 99 { 100 /* indexA :: 0-51 inclusive */ 101 { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 102 { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 103 { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 104 { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 105 { 0, 0, 0, 0}, { 0, 0, 0, 1}, { 0, 0, 0, 1}, { 0, 0, 0, 1}, 106 { 0, 0, 0, 1}, { 0, 0, 1, 1}, { 0, 0, 1, 1}, { 0, 1, 1, 1}, 107 { 0, 1, 1, 1}, { 0, 1, 1, 1}, { 0, 1, 1, 1}, { 0, 1, 1, 2}, 108 { 0, 1, 1, 2}, { 0, 1, 1, 2}, { 0, 1, 1, 2}, { 0, 1, 2, 3}, 109 { 0, 1, 2, 3}, { 0, 2, 2, 3}, { 0, 2, 2, 4}, { 0, 2, 3, 4}, 110 { 0, 2, 3, 4}, { 0, 3, 3, 5}, { 0, 3, 4, 6}, { 0, 3, 4, 6}, 111 { 0, 4, 5, 7}, { 0, 4, 5, 8}, { 0, 4, 6, 9}, { 0, 5, 7,10}, 112 { 0, 6, 8,11}, { 0, 6, 8,13}, { 0, 7,10,14}, { 0, 8,11,16}, 113 { 0, 9,12,18}, { 0,10,13,20}, { 0,11,15,23}, { 0,13,17,25}, 114 }; 115