Home | History | Annotate | Download | only in decoder
      1 /******************************************************************************
      2 *
      3 * Copyright (C) 2012 Ittiam Systems Pvt Ltd, Bangalore
      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 /**
     19 *******************************************************************************
     20 * @file
     21 *  ihevcd_debug.h
     22 *
     23 * @brief
     24 *  Debug defs
     25 *
     26 * @author
     27 *  Naveen S R
     28 *
     29 * @par List of Functions:
     30 *
     31 * @remarks
     32 *  None
     33 *
     34 *******************************************************************************
     35 */
     36 
     37 #ifndef _IHEVCD_DEBUG_H_
     38 #define _IHEVCD_DEBUG_H_
     39 
     40 #define DEBUG_REF_LIST 0
     41 #define DEBUG_PADDED_REGION 0
     42 #define DEBUG_DUMP_PRE_ILF 0
     43 #define DEBUG_PRINT_IQ_IT_RECON 0
     44 #define DEBUG_PRINT_MV 0
     45 #define DEBUG_DEBLK_LEAF_LEVEL 0
     46 #define DEBUG_NAL_TYPE 0
     47 #define DEBUG_SAO_TMP_BUF 0
     48 #define DEBUG_BREAK_AFTER_SLICE_NAL 0
     49 #define DEBUG_DUMP_FRAME_BUFFERS_INFO 0
     50 #define DEBUG_DUMP_FRAME_PU_INFO 0
     51 #define DEBUG_MV_MAP 0
     52 
     53 #if (DEBUG_REF_LIST||DEBUG_PADDED_REGION||DEBUG_DUMP_PRE_ILF||DEBUG_PRINT_IQ_IT_RECON||DEBUG_PRINT_MV||DEBUG_DEBLK_LEAF_LEVEL||DEBUG_NAL_TYPE||DEBUG_SAO_TMP_BUF||DEBUG_BREAK_AFTER_SLICE_NAL || DEBUG_DUMP_FRAME_BUFFERS_INFO || DEBUG_DUMP_FRAME_PU_INFO)
     54 #define DEBUG_CODE 1
     55 #else
     56 #define DEBUG_CODE 0
     57 #endif
     58 
     59 
     60 #if DEBUG_DUMP_FRAME_PU_INFO
     61 #define DEBUG_DUMP_PIC_PU(ps_codec) ihevcd_debug_dump_pic_pu(ps_codec);
     62 #else
     63 #define DEBUG_DUMP_PIC_PU(ps_codec)
     64 #endif
     65 
     66 
     67 #if DEBUG_DUMP_FRAME_BUFFERS_INFO
     68 UWORD8 au1_pic_avail_ctb_flags[MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE];
     69 UWORD32 au4_pic_ctb_slice_xy[MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE];
     70 
     71 #define DEBUG_DUMP_PIC_BUFFERS(ps_codec) ihevcd_debug_dump_pic_buffers(ps_codec);
     72 #else
     73 #define DEBUG_DUMP_PIC_BUFFERS(ps_codec)
     74 #endif
     75 
     76 #if DEBUG_BREAK_AFTER_SLICE_NAL
     77 #define BREAK_AFTER_SLICE_NAL()                 \
     78                 if(ps_codec->i4_header_done)    \
     79                     break;
     80 #else
     81 #define BREAK_AFTER_SLICE_NAL()     ;
     82 #endif
     83 
     84 
     85 #if DEBUG_SAO_TMP_BUF
     86 #define DEBUG_INIT_TMP_BUF(pu1_buf_luma, pu1_buf_chroma) ihevcd_debug_init_tmp_buf(pu1_buf_luma, pu1_buf_chroma)
     87 #define DEBUG_PROCESS_TMP_BUF(pu1_buf_luma, pu1_buf_chroma) ihevcd_debug_process_tmp_buf(pu1_buf_luma, pu1_buf_chroma)
     88 #else
     89 #define DEBUG_INIT_TMP_BUF(pu1_buf_luma, pu1_buf_chroma)
     90 #define DEBUG_PROCESS_TMP_BUF(pu1_buf_luma, pu1_buf_chroma)
     91 #endif
     92 
     93 #if DEBUG_NAL_TYPE
     94 
     95 #define DEBUG_PRINT_NAL_INFO(ps_codec, nal_type) ihevcd_debug_print_nal_info(ps_codec, nal_type); \
     96     break;
     97 #define RETURN_IF_NAL_INFO return;
     98 
     99 #else
    100 
    101 #define DEBUG_PRINT_NAL_INFO(ps_codec, nal_type)
    102 #define RETURN_IF_NAL_INFO
    103 
    104 #endif
    105 
    106 #if DEBUG_REF_LIST
    107 
    108 #define DEBUG_PRINT_REF_LIST_POCS(i4_pic_order_cnt_val, ps_slice_hdr, ps_dpb_mgr, u4_num_st_curr_before, u4_num_st_curr_after, u4_num_st_foll, u4_num_lt_curr, u4_num_lt_foll, ai4_poc_st_curr_before, ai4_poc_st_curr_after, ai4_poc_st_foll, ai4_poc_lt_curr, ai4_poc_lt_foll)  \
    109     ihevcd_debug_print_ref_list_pocs(i4_pic_order_cnt_val, ps_slice_hdr, ps_dpb_mgr, u4_num_st_curr_before, u4_num_st_curr_after, u4_num_st_foll, u4_num_lt_curr, u4_num_lt_foll, ai4_poc_st_curr_before, ai4_poc_st_curr_after, ai4_poc_st_foll, ai4_poc_lt_curr, ai4_poc_lt_foll);
    110 
    111 #else
    112 
    113 #define DEBUG_PRINT_REF_LIST_POCS(i4_pic_order_cnt_val, ps_slice_hdr, ps_dpb_mgr, u4_num_st_curr_before, u4_num_st_curr_after, u4_num_st_foll, u4_num_lt_curr, u4_num_lt_foll, ai4_poc_st_curr_before, ai4_poc_st_curr_after, ai4_poc_st_foll, ai4_poc_lt_curr, ai4_poc_lt_foll)
    114 
    115 #endif
    116 
    117 #if DEBUG_PADDED_REGION
    118 
    119 #define DEBUG_VALIDATE_PADDED_REGION(ps_proc) ihevcd_debug_validate_padded_region(ps_proc);
    120 
    121 #else
    122 
    123 #define DEBUG_VALIDATE_PADDED_REGION(ps_proc)
    124 
    125 #endif
    126 
    127 #if DEBUG_DUMP_PRE_ILF
    128 
    129 #define DUMP_PRE_ILF(pu1_cur_pic_luma, pu1_cur_pic_chroma, pic_wd, pic_ht, pic_strd) ihevcd_debug_dump_pic(pu1_cur_pic_luma, pu1_cur_pic_chroma, pic_wd, pic_ht, pic_strd)
    130 #define DUMP_BS(pu4_pic_vert_bs, pu4_pic_horz_bs, vert_size_in_bytes, horz_size_in_bytes) ihevcd_debug_dump_bs(pu4_pic_vert_bs, pu4_pic_horz_bs, vert_size_in_bytes, horz_size_in_bytes)
    131 #define DUMP_QP(pu1_qp, size_in_bytes) ihevcd_debug_dump_qp(pu1_qp, size_in_bytes)
    132 #define DUMP_QP_CONST_IN_CTB(pu1_qp_const_in_ctb, size_in_bytes) ihevcs_dump_qp_const_in_ctb(pu1_qp_const_in_ctb, size_in_bytes)
    133 #define DUMP_NO_LOOP_FILTER(pu1_pic_no_loop_filter, size_in_bytes) ihevcd_debug_dump_no_loop_filter(pu1_pic_no_loop_filter, size_in_bytes)
    134 #define DUMP_OFFSETS(beta_offset_div_2, tc_offset_div_2, qp_offset_u, qp_offset_v) ihevcd_debug_dump_offsets(beta_offset_div_2, tc_offset_div_2, qp_offset_u, qp_offset_v)
    135 
    136 #else
    137 
    138 #define DUMP_PRE_ILF(pu1_cur_pic_luma, pu1_cur_pic_chroma, pic_wd, pic_ht, pic_strd)
    139 #define DUMP_BS(pu4_pic_vert_bs, pu4_pic_horz_bs, vert_size_in_bytes, horz_size_in_bytes)
    140 #define DUMP_QP(pu1_qp, size_in_bytes)
    141 #define DUMP_QP_CONST_IN_CTB(pu1_qp_const_in_ctb, size_in_bytes)
    142 #define DUMP_NO_LOOP_FILTER(pu1_pic_no_loop_filter, size_in_bytes)
    143 #define DUMP_OFFSETS(beta_offset_div_2, tc_offset_div_2, qp_offset_u, qp_offset_v)
    144 
    145 #endif
    146 
    147 
    148 #if DEBUG_DEBLK_LEAF_LEVEL
    149 
    150 #define DUMP_DEBLK_LUMA_VERT(pu1_src, src_strd, u4_bs, qp_p, qp_q, beta_offset_div2, tc_offset_div2, filter_p, filter_q) ihevcd_debug_deblk_luma_vert(pu1_src, src_strd, u4_bs, qp_p, qp_q, beta_offset_div2, tc_offset_div2, filter_p, filter_q);
    151 #define DUMP_DEBLK_LUMA_HORZ(pu1_src, src_strd, u4_bs, qp_p, qp_q, beta_offset_div2, tc_offset_div2, filter_p, filter_q) ihevcd_debug_deblk_luma_horz(pu1_src, src_strd, u4_bs, qp_p, qp_q, beta_offset_div2, tc_offset_div2, filter_p, filter_q);
    152 #define DUMP_DEBLK_CHROMA_VERT(pu1_src, src_strd, u4_bs, qp_p, qp_q, qp_offset_u, qp_offset_v, tc_offset_div2, filter_p, filter_q) ihevcd_debug_deblk_chroma_vert(pu1_src, src_strd, u4_bs, qp_p, qp_q, qp_offset_u, qp_offset_v, tc_offset_div2, filter_p, filter_q)
    153 #define DUMP_DEBLK_CHROMA_HORZ(pu1_src, src_strd, u4_bs, qp_p, qp_q, qp_offset_u, qp_offset_v, tc_offset_div2, filter_p, filter_q) ihevcd_debug_deblk_chroma_horz(pu1_src, src_strd, u4_bs, qp_p, qp_q, qp_offset_u, qp_offset_v, tc_offset_div2, filter_p, filter_q)
    154 
    155 #else
    156 
    157 #define DUMP_DEBLK_LUMA_VERT(pu1_src, src_strd, u4_bs3, qp_p, qp_q, beta_offset_div2, tc_offset_div2, filter_p, filter_q)
    158 #define DUMP_DEBLK_LUMA_HORZ(pu1_src, src_strd, u4_bs3, qp_p, qp_q, beta_offset_div2, tc_offset_div2, filter_p, filter_q)
    159 #define DUMP_DEBLK_CHROMA_VERT(pu1_src, src_strd, u4_bs, qp_p, qp_q, qp_offset_u, qp_offset_v, tc_offset_div2, filter_p, filter_q)
    160 #define DUMP_DEBLK_CHROMA_HORZ(pu1_src, src_strd, u4_bs, qp_p, qp_q, qp_offset_u, qp_offset_v, tc_offset_div2, filter_p, filter_q)
    161 
    162 #endif
    163 
    164 #if DEBUG_MV_MAP
    165 #define DEBUG_DUMP_MV_MAP(ps_codec) ihevcd_debug_dump_mv_map(ps_codec);
    166 #else
    167 #define DEBUG_DUMP_MV_MAP(ps_codec)
    168 #endif
    169 void print_coeff(WORD16 *pi2_tu_coeff, WORD32 trans_size);
    170 
    171 void print_dst(UWORD8 *pu1_dst,
    172                WORD32 dst_strd,
    173                WORD32 trans_size,
    174                WORD32 is_luma);
    175 
    176 #endif /* _IHEVCD_DEBUG_H_ */
    177