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 * @file 23 * ih264_size_defs.h 24 * 25 * @brief 26 * Contains declaration of global variables for H264 transform , quant and inverse quant 27 * 28 * @author 29 * Ittiam 30 * 31 * @remarks 32 * 33 ********************************************************************************/ 34 35 #ifndef IH264_SIZE_DEFS_H_ 36 #define IH264_SIZE_DEFS_H_ 37 38 /*****************************************************************************/ 39 /* Constant Macros */ 40 /*****************************************************************************/ 41 42 /*-----------------------Primary defs--------------------------*/ 43 44 /*Width of a 4x4 block*/ 45 #define SUB_BLK_WIDTH_4x4 4 46 47 #define SUB_BLK_HEIGHT_4x4 4 48 49 /*Width of an 8x8 block*/ 50 #define SUB_BLK_WIDTH_8x8 8 51 52 /*Number of chroma blocks in a row of coffs*/ 53 #define SUB_BLK_COUNT_CHROMA_4x4_420 2 54 55 /*Number of luma blocks in a row of coffs*/ 56 #define SUB_BLK_COUNT_LUMA_4x4 4 57 58 /*Numbr of chroma planes*/ 59 #define NUM_CHROMA_PLANES 2 60 61 /*Constant bit shifts*/ 62 #define QP_BITS_h264_4x4 15 63 #define QP_BITS_h264_8x8 16 64 65 66 /*---------------------------Derived defs------------------------*/ 67 68 /*Number of coefficients ina 4x4 block*/ 69 #define COFF_CNT_SUB_BLK_4x4 SUB_BLK_WIDTH_4x4*SUB_BLK_WIDTH_4x4; 70 71 /*Number of luma blocks in a row of coffs*/ 72 #define SUB_BLK_LUMA_4X4_CNT_MB SUB_BLK_COUNT_LUMA_4x4 * SUB_BLK_COUNT_LUMA_4x4 73 74 /*Number of chroma coffs in an MB*/ 75 #define SUB_BLK_CHROMA_4X4_CNT_MB SUB_BLK_COUNT_CHROMA_4x4_420 * SUB_BLK_COUNT_CHROMA_4x4_420 76 #define SUB_BLK_CHROMA_4X4_CNT_MB_BIPLANE SUB_BLK_CHROMA_4X4_CNT_MB*NUM_CHROMA_PLANES 77 78 /*Size of trans buff = 4x4 for DC block + 4x4 * coffs for 4x4 ac blocks*/ 79 #define SIZE_TRANS_BUFF (SUB_BLK_WIDTH_4x4*SUB_BLK_WIDTH_4x4*+ \ 80 SUB_BLK_WIDTH_4x4*SUB_BLK_WIDTH_4x4* \ 81 SUB_BLK_COUNT_LUMA_4x4*SUB_BLK_COUNT_LUMA_4x4) 82 83 /*memory size = memory size of 4x4 block of resi coff + 4x4 for DC coff block */ 84 #define SIZE_TMP_BUFF_ITRANS ((SUB_BLK_WIDTH_4x4*SUB_BLK_WIDTH_4x4) +\ 85 (SUB_BLK_WIDTH_4x4*SUB_BLK_WIDTH_4x4)) 86 87 #endif /* IH264_DEFS_H_ */ 88