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 /*Width of an 8x8 block*/
48 #define SUB_BLK_WIDTH_8x8                   8
49 
50 /*Number of chroma blocks in a row of coffs*/
51 #define SUB_BLK_COUNT_CHROMA_4x4_420        2
52 
53 /*Number of luma blocks in a row of coffs*/
54 #define SUB_BLK_COUNT_LUMA_4x4              4
55 
56 /*Numbr of chroma planes*/
57 #define NUM_CHROMA_PLANES                   2
58 
59 /*Constant bit shifts*/
60 #define QP_BITS_h264_4x4                    15
61 #define QP_BITS_h264_8x8                    16
62 
63 
64 /*---------------------------Derived defs------------------------*/
65 
66 /*Number of coefficients ina 4x4 block*/
67 #define COFF_CNT_SUB_BLK_4x4                SUB_BLK_WIDTH_4x4*SUB_BLK_WIDTH_4x4;
68 
69 /*Number of luma blocks in a row of coffs*/
70 #define SUB_BLK_LUMA_4X4_CNT_MB             SUB_BLK_COUNT_LUMA_4x4 * SUB_BLK_COUNT_LUMA_4x4
71 
72 /*Number of chroma coffs in an MB*/
73 #define SUB_BLK_CHROMA_4X4_CNT_MB           SUB_BLK_COUNT_CHROMA_4x4_420 * SUB_BLK_COUNT_CHROMA_4x4_420
74 #define SUB_BLK_CHROMA_4X4_CNT_MB_BIPLANE   SUB_BLK_CHROMA_4X4_CNT_MB*NUM_CHROMA_PLANES
75 
76 /*Size of trans buff = 4x4 for DC block +  4x4 * coffs for 4x4 ac blocks*/
77 #define SIZE_TRANS_BUFF                     (SUB_BLK_WIDTH_4x4*SUB_BLK_WIDTH_4x4*+ \
78                                             SUB_BLK_WIDTH_4x4*SUB_BLK_WIDTH_4x4*   \
79                                             SUB_BLK_COUNT_LUMA_4x4*SUB_BLK_COUNT_LUMA_4x4)
80 
81 /*memory size = memory size of 4x4 block of resi coff + 4x4 for DC coff block                          */
82 #define SIZE_TMP_BUFF_ITRANS                ((SUB_BLK_WIDTH_4x4*SUB_BLK_WIDTH_4x4) +\
83                                              (SUB_BLK_WIDTH_4x4*SUB_BLK_WIDTH_4x4))
84 
85 #endif /* IH264_DEFS_H_ */
86