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 Name         : c_coding_example.h                                   */
23 /*                                                                           */
24 /*  Description       : This file contains all the necessary examples to     */
25 /*                      establish a consistent use of Ittiam C coding        */
26 /*                      standards (based on Indian Hill C Standards)         */
27 /*                                                                           */
28 /*  List of Functions : <List the functions defined in this file>            */
29 /*                                                                           */
30 /*  Issues / Problems : None                                                 */
31 /*                                                                           */
32 /*  Revision History  :                                                      */
33 /*                                                                           */
34 /*         DD MM YYYY   Author(s)       Changes (Describe the changes made)  */
35 /*         10 01 2005   Ittiam          Draft                                */
36 /*                                                                           */
37 /*****************************************************************************/
38 #ifndef __IMPEG2D_DEBUG_H__
39 #define __IMPEG2D_DEBUG_H__
40 
41 
42 /*************************************************************************/
43 /* DEBUG                                                                 */
44 /*************************************************************************/
45 #define DEBUG_MB        0
46 
47 
48 #if DEBUG_MB
49 void impeg2d_trace_mb_start(UWORD32 mb_x, UWORD32 mb_y);
50 void impeg2d_frm_num_set(void);
51 UWORD32 impeg2d_frm_num_get(void);
52 
53 #define IMPEG2D_TRACE_MB_START(mb_x, mb_y) void impeg2d_trace_mb_start(UWORD32 mb_x, UWORD32 mb_y);
54 #define IMPEG2D_FRM_NUM_SET()              void impeg2d_frm_num_set(void);
55 #define IMPEG2D_FRM_NUM_GET()              UWORD32 impeg2d_frm_num_get(void);
56 #else
57 #define IMPEG2D_TRACE_MB_START(mb_x, mb_y)
58 #define IMPEG2D_FRM_NUM_SET()
59 #define IMPEG2D_FRM_NUM_GET()
60 #endif
61 
62 
63 #define STATISTICS  0
64 
65 #if STATISTICS
66 void impeg2d_idct_inp_statistics(WORD16 *pi2_idct_inp, WORD32 non_zero_cols, WORD32 non_zero_rows);
67 void impeg2d_iqnt_inp_statistics(WORD16 *pi2_iqnt_inp, WORD32 non_zero_cols, WORD32 non_zero_rows);
68 void impeg2d_print_statistics(void);
69 #define IMPEG2D_IDCT_INP_STATISTICS(pi2_idct_inp, non_zero_cols, non_zero_rows)  impeg2d_idct_inp_statistics(pi2_idct_inp, non_zero_cols, non_zero_rows)
70 #define IMPEG2D_IQNT_INP_STATISTICS(pi2_iqnt_inp, non_zero_cols, non_zero_rows)  impeg2d_iqnt_inp_statistics(pi2_iqnt_inp, non_zero_cols, non_zero_rows)
71 #define IMPEG2D_PRINT_STATISTICS()            impeg2d_print_statistics()
72 #else
73 #define IMPEG2D_IDCT_INP_STATISTICS(pi2_idct_inp, non_zero_cols, non_zero_rows)
74 #define IMPEG2D_IQNT_INP_STATISTICS(pi2_iqnt_inp, non_zero_cols, non_zero_rows)
75 #define IMPEG2D_PRINT_STATISTICS()
76 #endif
77 
78 
79 #if 0
80 #define PROFILE_DIS_SKIP_MB
81 #define PROFILE_DIS_MC
82 #define PROFILE_DIS_INVQUANT
83 #define PROFILE_DIS_IDCT
84 #define PROFILE_DIS_MEMSET_RESBUF
85 #endif
86 
87 
88 #ifdef PROFILE_DIS_SKIP_MB
89 #define PROFILE_DISABLE_SKIP_MB() return;
90 #else
91 #define PROFILE_DISABLE_SKIP_MB()
92 #endif
93 
94 #ifdef PROFILE_DIS_MC
95 #define PROFILE_DISABLE_MC_IF0 if(0)
96 #define PROFILE_DISABLE_MC_RETURN return;
97 #else
98 #define PROFILE_DISABLE_MC_IF0
99 #define PROFILE_DISABLE_MC_RETURN
100 #endif
101 
102 #ifdef PROFILE_DIS_INVQUANT
103 #define PROFILE_DISABLE_INVQUANT_IF0 if(0)
104 #else
105 #define PROFILE_DISABLE_INVQUANT_IF0
106 #endif
107 
108 #ifdef PROFILE_DIS_IDCT
109 #define PROFILE_DISABLE_IDCT_IF0 if(0)
110 #else
111 #define PROFILE_DISABLE_IDCT_IF0
112 #endif
113 
114 #ifdef PROFILE_DIS_MEMSET_RESBUF
115 #define PROFILE_DISABLE_MEMSET_RESBUF_IF0 if(0)
116 #else
117 #define PROFILE_DISABLE_MEMSET_RESBUF_IF0
118 #endif
119 
120 
121 #endif /* __IMPEG2D_DEBUG_H__ */
122