xref: /aosp_15_r20/external/libavc/decoder/ih264d_deblocking.h (revision 495ae853bb871d1e5a258cb02c2cc13cde8ddb9a)
1*495ae853SAndroid Build Coastguard Worker /******************************************************************************
2*495ae853SAndroid Build Coastguard Worker  *
3*495ae853SAndroid Build Coastguard Worker  * Copyright (C) 2015 The Android Open Source Project
4*495ae853SAndroid Build Coastguard Worker  *
5*495ae853SAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
6*495ae853SAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
7*495ae853SAndroid Build Coastguard Worker  * You may obtain a copy of the License at:
8*495ae853SAndroid Build Coastguard Worker  *
9*495ae853SAndroid Build Coastguard Worker  * http://www.apache.org/licenses/LICENSE-2.0
10*495ae853SAndroid Build Coastguard Worker  *
11*495ae853SAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
12*495ae853SAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
13*495ae853SAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14*495ae853SAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
15*495ae853SAndroid Build Coastguard Worker  * limitations under the License.
16*495ae853SAndroid Build Coastguard Worker  *
17*495ae853SAndroid Build Coastguard Worker  *****************************************************************************
18*495ae853SAndroid Build Coastguard Worker  * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
19*495ae853SAndroid Build Coastguard Worker */
20*495ae853SAndroid Build Coastguard Worker #ifndef  _IH264D_DEBLOCKING_H_
21*495ae853SAndroid Build Coastguard Worker #define  _IH264D_DEBLOCKING_H_
22*495ae853SAndroid Build Coastguard Worker /*!
23*495ae853SAndroid Build Coastguard Worker  **************************************************************************
24*495ae853SAndroid Build Coastguard Worker  * \file ih264d_deblocking.h
25*495ae853SAndroid Build Coastguard Worker  *
26*495ae853SAndroid Build Coastguard Worker  * \brief
27*495ae853SAndroid Build Coastguard Worker  *    Declarations of deblocking functions
28*495ae853SAndroid Build Coastguard Worker  *
29*495ae853SAndroid Build Coastguard Worker  * \date
30*495ae853SAndroid Build Coastguard Worker  *    23/11/2002
31*495ae853SAndroid Build Coastguard Worker  *
32*495ae853SAndroid Build Coastguard Worker  * \author  AI
33*495ae853SAndroid Build Coastguard Worker  **************************************************************************
34*495ae853SAndroid Build Coastguard Worker  */
35*495ae853SAndroid Build Coastguard Worker #include "ih264_typedefs.h"
36*495ae853SAndroid Build Coastguard Worker #include "ih264_macros.h"
37*495ae853SAndroid Build Coastguard Worker #include "ih264_platform_macros.h"
38*495ae853SAndroid Build Coastguard Worker #include "ih264d_structs.h"
39*495ae853SAndroid Build Coastguard Worker 
40*495ae853SAndroid Build Coastguard Worker WORD8 ih264d_set_deblocking_parameters(deblk_mb_t * ps_cur_deblk_mb,
41*495ae853SAndroid Build Coastguard Worker                                        dec_slice_params_t * ps_slice,
42*495ae853SAndroid Build Coastguard Worker                                        UWORD8 u1_mb_ngbr_availablity,
43*495ae853SAndroid Build Coastguard Worker                                        UWORD8 u1_mb_field_decoding_flag);
44*495ae853SAndroid Build Coastguard Worker 
45*495ae853SAndroid Build Coastguard Worker void ih264d_copy_intra_pred_line(dec_struct_t *ps_dec,
46*495ae853SAndroid Build Coastguard Worker                                  dec_mb_info_t *ps_cur_mb_info,
47*495ae853SAndroid Build Coastguard Worker                                  UWORD32 nmb_index);
48*495ae853SAndroid Build Coastguard Worker 
49*495ae853SAndroid Build Coastguard Worker void FilterBoundaryLeft(tfr_ctxt_t * const ps_tfr_cxt,
50*495ae853SAndroid Build Coastguard Worker                         const WORD8 i1_cb_qp_idx_ofst,
51*495ae853SAndroid Build Coastguard Worker                         const WORD8 i1_cr_qp_idx_ofst,
52*495ae853SAndroid Build Coastguard Worker                         deblk_mb_t * const ps_cur_mb,
53*495ae853SAndroid Build Coastguard Worker                         UWORD16 u2_strd_y,
54*495ae853SAndroid Build Coastguard Worker                         UWORD16 u2_strd_uv,
55*495ae853SAndroid Build Coastguard Worker                         deblk_mb_t * const ps_left_mb,
56*495ae853SAndroid Build Coastguard Worker                         const UWORD32 pu4_bs_tab[],
57*495ae853SAndroid Build Coastguard Worker                         const UWORD8 u1_cur_fld);
58*495ae853SAndroid Build Coastguard Worker void FilterBoundaryTop(tfr_ctxt_t * const ps_tfr_cxt,
59*495ae853SAndroid Build Coastguard Worker                        const WORD8 i1_cb_qp_idx_ofst,
60*495ae853SAndroid Build Coastguard Worker                        const WORD8 i1_cr_qp_idx_ofst,
61*495ae853SAndroid Build Coastguard Worker                        deblk_mb_t * const ps_cur_mb,
62*495ae853SAndroid Build Coastguard Worker                        const UWORD16 u2_strd_y,
63*495ae853SAndroid Build Coastguard Worker                        const UWORD16 u2_strd_uv,
64*495ae853SAndroid Build Coastguard Worker                        deblk_mb_t * const ps_top_mb,
65*495ae853SAndroid Build Coastguard Worker                        const UWORD32 u4_bs);
66*495ae853SAndroid Build Coastguard Worker void deblock_mb(tfr_ctxt_t * const ps_tfr_cxt,
67*495ae853SAndroid Build Coastguard Worker                 const WORD8 i1_cb_qp_idx_ofst,
68*495ae853SAndroid Build Coastguard Worker                 const WORD8 i1_cr_qp_idx_ofst,
69*495ae853SAndroid Build Coastguard Worker                 deblk_mb_t * const ps_cur_mb,
70*495ae853SAndroid Build Coastguard Worker                 WORD32 i4_strd_y,
71*495ae853SAndroid Build Coastguard Worker                 WORD32 i4_strd_uv,
72*495ae853SAndroid Build Coastguard Worker                 deblk_mb_t * const ps_top_mb,
73*495ae853SAndroid Build Coastguard Worker                 deblk_mb_t * const ps_left_mb,
74*495ae853SAndroid Build Coastguard Worker                 const UWORD8 u1_cur_fld,
75*495ae853SAndroid Build Coastguard Worker                 const UWORD8 u1_extra_top_edge);
76*495ae853SAndroid Build Coastguard Worker void ih264d_deblock_mb_mbaff(dec_struct_t *ps_dec,
77*495ae853SAndroid Build Coastguard Worker                              tfr_ctxt_t * const ps_tfr_cxt,
78*495ae853SAndroid Build Coastguard Worker                              const WORD8 i1_cb_qp_idx_ofst,
79*495ae853SAndroid Build Coastguard Worker                              const WORD8 i1_cr_qp_idx_ofst,
80*495ae853SAndroid Build Coastguard Worker                              deblk_mb_t * const ps_cur_mb,
81*495ae853SAndroid Build Coastguard Worker                              WORD32 i4_strd_y,
82*495ae853SAndroid Build Coastguard Worker                              WORD32 i4_strd_uv,
83*495ae853SAndroid Build Coastguard Worker                              deblk_mb_t * const ps_top_mb,
84*495ae853SAndroid Build Coastguard Worker                              deblk_mb_t * const ps_left_mb,
85*495ae853SAndroid Build Coastguard Worker                              const UWORD8 u1_cur_fld,
86*495ae853SAndroid Build Coastguard Worker                              const UWORD8 u1_extra_top_edge);
87*495ae853SAndroid Build Coastguard Worker 
88*495ae853SAndroid Build Coastguard Worker void ih264d_deblock_picture_mbaff(dec_struct_t * const ps_dec);
89*495ae853SAndroid Build Coastguard Worker 
90*495ae853SAndroid Build Coastguard Worker void ih264d_deblock_picture_non_mbaff(dec_struct_t * const ps_dec);
91*495ae853SAndroid Build Coastguard Worker 
92*495ae853SAndroid Build Coastguard Worker void ih264d_deblock_picture_progressive(dec_struct_t * const ps_dec);
93*495ae853SAndroid Build Coastguard Worker 
94*495ae853SAndroid Build Coastguard Worker void ih264d_compute_bs_mbaff(dec_struct_t * ps_dec,
95*495ae853SAndroid Build Coastguard Worker                              dec_mb_info_t * ps_cur_mb_info,
96*495ae853SAndroid Build Coastguard Worker                              const UWORD16 u2_mbxn_mb);
97*495ae853SAndroid Build Coastguard Worker void ih264d_compute_bs_non_mbaff(dec_struct_t * ps_dec,
98*495ae853SAndroid Build Coastguard Worker                                  dec_mb_info_t * ps_cur_mb_info,
99*495ae853SAndroid Build Coastguard Worker                                  const UWORD16 u2_mbxn_mb);
100*495ae853SAndroid Build Coastguard Worker 
101*495ae853SAndroid Build Coastguard Worker void ih264d_fill_bs_mbedge_2(dec_struct_t * ps_dec,
102*495ae853SAndroid Build Coastguard Worker                              dec_mb_info_t * ps_cur_mb_info,
103*495ae853SAndroid Build Coastguard Worker                              const UWORD16 u2_mbxn_mb);
104*495ae853SAndroid Build Coastguard Worker 
105*495ae853SAndroid Build Coastguard Worker void ih264d_fill_bs_mbedge_4(dec_struct_t * ps_dec,
106*495ae853SAndroid Build Coastguard Worker                              dec_mb_info_t * ps_cur_mb_info,
107*495ae853SAndroid Build Coastguard Worker                              const UWORD16 u2_mbxn_mb);
108*495ae853SAndroid Build Coastguard Worker 
109*495ae853SAndroid Build Coastguard Worker void ih264d_fill_bs1_16x16mb_pslice(mv_pred_t *ps_cur_mv_pred,
110*495ae853SAndroid Build Coastguard Worker                                     mv_pred_t *ps_top_mv_pred,
111*495ae853SAndroid Build Coastguard Worker                                     void **ppv_map_ref_idx_to_poc,
112*495ae853SAndroid Build Coastguard Worker                                     UWORD32 *pu4_bs_table,
113*495ae853SAndroid Build Coastguard Worker                                     mv_pred_t *ps_leftmost_mv_pred,
114*495ae853SAndroid Build Coastguard Worker                                     neighbouradd_t *ps_left_addr,
115*495ae853SAndroid Build Coastguard Worker                                     void **u4_pic_addrress,
116*495ae853SAndroid Build Coastguard Worker                                     WORD32 i4_ver_mvlimit);
117*495ae853SAndroid Build Coastguard Worker 
118*495ae853SAndroid Build Coastguard Worker void ih264d_fill_bs1_non16x16mb_pslice(mv_pred_t *ps_cur_mv_pred,
119*495ae853SAndroid Build Coastguard Worker                                        mv_pred_t *ps_top_mv_pred,
120*495ae853SAndroid Build Coastguard Worker                                        void **ppv_map_ref_idx_to_poc,
121*495ae853SAndroid Build Coastguard Worker                                        UWORD32 *pu4_bs_table,
122*495ae853SAndroid Build Coastguard Worker                                        mv_pred_t *ps_leftmost_mv_pred,
123*495ae853SAndroid Build Coastguard Worker                                        neighbouradd_t *ps_left_addr,
124*495ae853SAndroid Build Coastguard Worker                                        void **u4_pic_addrress,
125*495ae853SAndroid Build Coastguard Worker                                        WORD32 i4_ver_mvlimit);
126*495ae853SAndroid Build Coastguard Worker 
127*495ae853SAndroid Build Coastguard Worker void ih264d_fill_bs1_16x16mb_bslice(mv_pred_t *ps_cur_mv_pred,
128*495ae853SAndroid Build Coastguard Worker                                     mv_pred_t *ps_top_mv_pred,
129*495ae853SAndroid Build Coastguard Worker                                     void **ppv_map_ref_idx_to_poc,
130*495ae853SAndroid Build Coastguard Worker                                     UWORD32 *pu4_bs_table,
131*495ae853SAndroid Build Coastguard Worker                                     mv_pred_t *ps_leftmost_mv_pred,
132*495ae853SAndroid Build Coastguard Worker                                     neighbouradd_t *ps_left_addr,
133*495ae853SAndroid Build Coastguard Worker                                     void **u4_pic_addrress,
134*495ae853SAndroid Build Coastguard Worker                                     WORD32 i4_ver_mvlimit);
135*495ae853SAndroid Build Coastguard Worker 
136*495ae853SAndroid Build Coastguard Worker void ih264d_fill_bs1_non16x16mb_bslice(mv_pred_t *ps_cur_mv_pred,
137*495ae853SAndroid Build Coastguard Worker                                        mv_pred_t *ps_top_mv_pred,
138*495ae853SAndroid Build Coastguard Worker                                        void **ppv_map_ref_idx_to_poc,
139*495ae853SAndroid Build Coastguard Worker                                        UWORD32 *pu4_bs_table,
140*495ae853SAndroid Build Coastguard Worker                                        mv_pred_t *ps_leftmost_mv_pred,
141*495ae853SAndroid Build Coastguard Worker                                        neighbouradd_t *ps_left_addr,
142*495ae853SAndroid Build Coastguard Worker                                        void **u4_pic_addrress,
143*495ae853SAndroid Build Coastguard Worker                                        WORD32 i4_ver_mvlimit);
144*495ae853SAndroid Build Coastguard Worker 
145*495ae853SAndroid Build Coastguard Worker void ih264d_fill_bs_xtra_left_edge_cur_fld(UWORD32 *pu4_bs,
146*495ae853SAndroid Build Coastguard Worker                                            WORD32 u4_left_mb_t_csbp,
147*495ae853SAndroid Build Coastguard Worker                                            WORD32 u4_left_mb_b_csbp,
148*495ae853SAndroid Build Coastguard Worker                                            WORD32 u4_cur_mb_csbp,
149*495ae853SAndroid Build Coastguard Worker                                            UWORD32 u4_cur_mb_top);
150*495ae853SAndroid Build Coastguard Worker 
151*495ae853SAndroid Build Coastguard Worker void ih264d_fill_bs_xtra_left_edge_cur_frm(UWORD32 *pu4_bs,
152*495ae853SAndroid Build Coastguard Worker                                            WORD32 u4_left_mb_t_csbp,
153*495ae853SAndroid Build Coastguard Worker                                            WORD32 u4_left_mb_b_csbp,
154*495ae853SAndroid Build Coastguard Worker                                            WORD32 u4_cur_mb_csbp,
155*495ae853SAndroid Build Coastguard Worker                                            UWORD32 u4_cur_mb_top);
156*495ae853SAndroid Build Coastguard Worker 
157*495ae853SAndroid Build Coastguard Worker void ih264d_deblock_mb_nonmbaff(dec_struct_t *ps_dec,
158*495ae853SAndroid Build Coastguard Worker                                 tfr_ctxt_t * const ps_tfr_cxt,
159*495ae853SAndroid Build Coastguard Worker                                 const WORD8 i1_cb_qp_idx_ofst,
160*495ae853SAndroid Build Coastguard Worker                                 const WORD8 i1_cr_qp_idx_ofst,
161*495ae853SAndroid Build Coastguard Worker                                 WORD32 i4_strd_y,
162*495ae853SAndroid Build Coastguard Worker                                 WORD32 i4_strd_uv);
163*495ae853SAndroid Build Coastguard Worker 
164*495ae853SAndroid Build Coastguard Worker void ih264d_init_deblk_tfr_ctxt(dec_struct_t * ps_dec,
165*495ae853SAndroid Build Coastguard Worker                                 pad_mgr_t *ps_pad_mgr,
166*495ae853SAndroid Build Coastguard Worker                                 tfr_ctxt_t *ps_tfr_cxt,
167*495ae853SAndroid Build Coastguard Worker                                 UWORD16 u2_image_wd_mb,
168*495ae853SAndroid Build Coastguard Worker                                 UWORD8 u1_mbaff);
169*495ae853SAndroid Build Coastguard Worker 
170*495ae853SAndroid Build Coastguard Worker void ih264d_deblock_mb_level(dec_struct_t *ps_dec,
171*495ae853SAndroid Build Coastguard Worker                              dec_mb_info_t *ps_cur_mb_info,
172*495ae853SAndroid Build Coastguard Worker                              UWORD32 nmb_index);
173*495ae853SAndroid Build Coastguard Worker 
174*495ae853SAndroid Build Coastguard Worker #endif /* _IH264D_DEBLOCKING_H_ */
175