xref: /aosp_15_r20/external/libavc/decoder/svc/isvcd_intra_resamp.h (revision 495ae853bb871d1e5a258cb02c2cc13cde8ddb9a)
1*495ae853SAndroid Build Coastguard Worker /******************************************************************************
2*495ae853SAndroid Build Coastguard Worker  *
3*495ae853SAndroid Build Coastguard Worker  * Copyright (C) 2022 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 /**
21*495ae853SAndroid Build Coastguard Worker  *******************************************************************************
22*495ae853SAndroid Build Coastguard Worker  * @file
23*495ae853SAndroid Build Coastguard Worker  *  isvcd_intra_resamp.h
24*495ae853SAndroid Build Coastguard Worker  *
25*495ae853SAndroid Build Coastguard Worker  * @brief
26*495ae853SAndroid Build Coastguard Worker  *  Contains routines that resample for SVC resampling
27*495ae853SAndroid Build Coastguard Worker  *
28*495ae853SAndroid Build Coastguard Worker  * @author
29*495ae853SAndroid Build Coastguard Worker  *  Kishore
30*495ae853SAndroid Build Coastguard Worker  *
31*495ae853SAndroid Build Coastguard Worker  * @remarks
32*495ae853SAndroid Build Coastguard Worker  *  None
33*495ae853SAndroid Build Coastguard Worker  *
34*495ae853SAndroid Build Coastguard Worker  *******************************************************************************
35*495ae853SAndroid Build Coastguard Worker  */
36*495ae853SAndroid Build Coastguard Worker 
37*495ae853SAndroid Build Coastguard Worker #ifndef _ISVCD_INTRA_RESAMPLE_H_
38*495ae853SAndroid Build Coastguard Worker #define _ISVCD_INTRA_RESAMPLE_H_
39*495ae853SAndroid Build Coastguard Worker 
40*495ae853SAndroid Build Coastguard Worker #include "ih264_typedefs.h"
41*495ae853SAndroid Build Coastguard Worker #include "ih264_macros.h"
42*495ae853SAndroid Build Coastguard Worker #include "ih264_platform_macros.h"
43*495ae853SAndroid Build Coastguard Worker #include "isvcd_structs.h"
44*495ae853SAndroid Build Coastguard Worker 
45*495ae853SAndroid Build Coastguard Worker #define SVCD_FALSE 0
46*495ae853SAndroid Build Coastguard Worker #define SVCD_TRUE 1
47*495ae853SAndroid Build Coastguard Worker 
48*495ae853SAndroid Build Coastguard Worker #define MAP_BUFF_WIDTH 48
49*495ae853SAndroid Build Coastguard Worker #define MAP_BUFF_HEIGHT 48
50*495ae853SAndroid Build Coastguard Worker #define INTERMEDIATE_BUFF_WIDTH 48
51*495ae853SAndroid Build Coastguard Worker #define INTERMEDIATE_BUFF_HEIGHT (MB_HEIGHT + 4)
52*495ae853SAndroid Build Coastguard Worker 
53*495ae853SAndroid Build Coastguard Worker #define MAX_REF_ARR_WD_HT 48
54*495ae853SAndroid Build Coastguard Worker 
55*495ae853SAndroid Build Coastguard Worker #define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
56*495ae853SAndroid Build Coastguard Worker #define DYADIC_REF_W_Y 20
57*495ae853SAndroid Build Coastguard Worker #define DYADIC_REF_H_Y 20
58*495ae853SAndroid Build Coastguard Worker #define DYADIC_REF_W_C 10
59*495ae853SAndroid Build Coastguard Worker #define DYADIC_REF_H_C 10
60*495ae853SAndroid Build Coastguard Worker 
61*495ae853SAndroid Build Coastguard Worker #define SUB_BLOCK_WIDTH 4
62*495ae853SAndroid Build Coastguard Worker #define SUB_BLOCK_HEIGHT 4
63*495ae853SAndroid Build Coastguard Worker #define SUB_BLOCK_SIZE (SUB_BLOCK_WIDTH * SUB_BLOCK_HEIGHT)
64*495ae853SAndroid Build Coastguard Worker #define BLOCK_WIDTH 8
65*495ae853SAndroid Build Coastguard Worker #define BLOCK_HEIGHT 8
66*495ae853SAndroid Build Coastguard Worker #define BLOCK_SIZE (BLOCK_WIDTH * BLOCK_HEIGHT)
67*495ae853SAndroid Build Coastguard Worker #define MB_WIDTH 16
68*495ae853SAndroid Build Coastguard Worker #define MB_HEIGHT 16
69*495ae853SAndroid Build Coastguard Worker #define CLIPUCHAR(x) CLIP3(0, 255, (x))
70*495ae853SAndroid Build Coastguard Worker #define MB_WIDTH_SHIFT 4
71*495ae853SAndroid Build Coastguard Worker #define MB_HEIGHT_SHIFT 4
72*495ae853SAndroid Build Coastguard Worker 
73*495ae853SAndroid Build Coastguard Worker #define REF_ARRAY_WIDTH 48
74*495ae853SAndroid Build Coastguard Worker #define REF_ARRAY_HEIGHT 48
75*495ae853SAndroid Build Coastguard Worker #define MAX_PIX_FILL_LUMA 4
76*495ae853SAndroid Build Coastguard Worker #define MAX_PIX_FILL_CHROMA 2
77*495ae853SAndroid Build Coastguard Worker 
78*495ae853SAndroid Build Coastguard Worker extern const WORD8 g_ai1_interp_filter_luma[64];
79*495ae853SAndroid Build Coastguard Worker extern const UWORD8 g_au1_interp_filter_chroma[32];
80*495ae853SAndroid Build Coastguard Worker extern WORD32 ref_pos_luma[4][16];
81*495ae853SAndroid Build Coastguard Worker extern WORD32 ref_pos_chroma[4][8];
82*495ae853SAndroid Build Coastguard Worker extern WORD32 phase_luma[3][16];
83*495ae853SAndroid Build Coastguard Worker extern UWORD8 phase_luma_u8[3][16];
84*495ae853SAndroid Build Coastguard Worker extern WORD8 phase_luma_x86[6][16];
85*495ae853SAndroid Build Coastguard Worker extern WORD32 phase_chroma[3][8];
86*495ae853SAndroid Build Coastguard Worker extern UWORD8 phase_chroma_u8[3][8];
87*495ae853SAndroid Build Coastguard Worker extern UWORD8 ref_pos_luma_mask_m48[8][16];
88*495ae853SAndroid Build Coastguard Worker extern UWORD8 ref_pos_luma_mask_m16[8][16];
89*495ae853SAndroid Build Coastguard Worker extern UWORD8 ref_pos_luma_mask_m32[8][16];
90*495ae853SAndroid Build Coastguard Worker extern UWORD8 ref_pos_chroma_mask_m24[2][16];
91*495ae853SAndroid Build Coastguard Worker extern UWORD8 ref_pos_chroma_mask_m8[2][16];
92*495ae853SAndroid Build Coastguard Worker extern UWORD8 ref_pos_chroma_mask_m16[2][16];
93*495ae853SAndroid Build Coastguard Worker 
94*495ae853SAndroid Build Coastguard Worker void isvcd_copy_data(UWORD8 *pu1_src, WORD32 i4_src_stride, UWORD8 *pu1_dst, WORD32 i4_dst_stride,
95*495ae853SAndroid Build Coastguard Worker                      WORD32 i4_num_bytes, WORD32 i4_num_lines);
96*495ae853SAndroid Build Coastguard Worker 
isvcd_left_most_bit_detect(UWORD32 u4_num)97*495ae853SAndroid Build Coastguard Worker static __inline int isvcd_left_most_bit_detect(UWORD32 u4_num)
98*495ae853SAndroid Build Coastguard Worker {
99*495ae853SAndroid Build Coastguard Worker     WORD32 i4_number = 0;
100*495ae853SAndroid Build Coastguard Worker     if(0xff == u4_num)
101*495ae853SAndroid Build Coastguard Worker     {
102*495ae853SAndroid Build Coastguard Worker         return 32;
103*495ae853SAndroid Build Coastguard Worker     }
104*495ae853SAndroid Build Coastguard Worker 
105*495ae853SAndroid Build Coastguard Worker     do
106*495ae853SAndroid Build Coastguard Worker     {
107*495ae853SAndroid Build Coastguard Worker         if(0 == (u4_num & 0x80000000))
108*495ae853SAndroid Build Coastguard Worker         {
109*495ae853SAndroid Build Coastguard Worker             return i4_number;
110*495ae853SAndroid Build Coastguard Worker         }
111*495ae853SAndroid Build Coastguard Worker         u4_num <<= 1;
112*495ae853SAndroid Build Coastguard Worker         i4_number++;
113*495ae853SAndroid Build Coastguard Worker     } while(1);
114*495ae853SAndroid Build Coastguard Worker }
115*495ae853SAndroid Build Coastguard Worker 
116*495ae853SAndroid Build Coastguard Worker typedef void i264_vert_interpol_chroma_dyadic(UWORD8 *pu1_inp_buf, WORD16 *pi2_tmp_filt_buf,
117*495ae853SAndroid Build Coastguard Worker                                               WORD32 i4_phase_0, WORD32 i4_phase_1);
118*495ae853SAndroid Build Coastguard Worker 
119*495ae853SAndroid Build Coastguard Worker typedef void i264_horz_interpol_chroma_dyadic(WORD16 *pi2_tmp_filt_buf, UWORD8 *pu1_out_buf,
120*495ae853SAndroid Build Coastguard Worker                                               WORD32 i4_out_stride, WORD32 i4_phase_0,
121*495ae853SAndroid Build Coastguard Worker                                               WORD32 i4_phase_1);
122*495ae853SAndroid Build Coastguard Worker 
123*495ae853SAndroid Build Coastguard Worker typedef void (*pf_vert_interpol_chroma_dyadic)(UWORD8 *pu1_inp_buf, WORD16 *pi2_tmp_filt_buf,
124*495ae853SAndroid Build Coastguard Worker                                                WORD32 i4_phase_0, WORD32 i4_phase_1);
125*495ae853SAndroid Build Coastguard Worker 
126*495ae853SAndroid Build Coastguard Worker typedef void (*pf_horz_interpol_chroma_dyadic)(WORD16 *pi2_tmp_filt_buf, UWORD8 *pu1_out_buf,
127*495ae853SAndroid Build Coastguard Worker                                                WORD32 i4_out_stride, WORD32 i4_phase_0,
128*495ae853SAndroid Build Coastguard Worker                                                WORD32 i4_phase_1);
129*495ae853SAndroid Build Coastguard Worker 
130*495ae853SAndroid Build Coastguard Worker typedef void(ftype_intra_samp_padding)(WORD32 i4_x, WORD32 i4_y, WORD8 i1_xd_index,
131*495ae853SAndroid Build Coastguard Worker                                        WORD8 i1_yd_index, UWORD8 u1_seg_wd, UWORD8 u1_seg_ht,
132*495ae853SAndroid Build Coastguard Worker                                        UWORD8 *pu1_refarray_1, UWORD8 *pu1_refarray_2,
133*495ae853SAndroid Build Coastguard Worker                                        WORD32 i4_refarray_stride, WORD32 i4_mb_adjoin_x,
134*495ae853SAndroid Build Coastguard Worker                                        WORD32 i4_mb_adjoin_y, WORD32 i4_corner_pixel_available);
135*495ae853SAndroid Build Coastguard Worker void isvcd_left_right_padding(WORD32 i4_x, WORD32 i4_y, WORD8 i1_xd_index, WORD8 i1_yd_index,
136*495ae853SAndroid Build Coastguard Worker                               UWORD8 u1_seg_wd, UWORD8 u1_seg_ht, UWORD8 *pu1_refarray_1,
137*495ae853SAndroid Build Coastguard Worker                               UWORD8 *pu1_refarray_2, WORD32 i4_refarray_stride,
138*495ae853SAndroid Build Coastguard Worker                               WORD32 i4_mb_adjoin_x, WORD32 i4_mb_adjoin_y,
139*495ae853SAndroid Build Coastguard Worker                               WORD32 i4_corner_pixel_available);
140*495ae853SAndroid Build Coastguard Worker 
141*495ae853SAndroid Build Coastguard Worker void isvcd_left_right_padding_chroma(WORD32 i4_x, WORD32 i4_y, WORD8 i1_xd_index, WORD8 i1_yd_index,
142*495ae853SAndroid Build Coastguard Worker                                      UWORD8 u1_seg_wd, UWORD8 u1_seg_ht, UWORD8 *pu1_refarray_1,
143*495ae853SAndroid Build Coastguard Worker                                      UWORD8 *pu1_refarray_2, WORD32 i4_refarray_stride,
144*495ae853SAndroid Build Coastguard Worker                                      WORD32 i4_mb_adjoin_x, WORD32 i4_mb_adjoin_y,
145*495ae853SAndroid Build Coastguard Worker                                      WORD32 i4_corner_pixel_available);
146*495ae853SAndroid Build Coastguard Worker 
147*495ae853SAndroid Build Coastguard Worker void isvcd_top_bot_padding(WORD32 i4_x, WORD32 i4_y, WORD8 i1_xd_index, WORD8 i1_yd_index,
148*495ae853SAndroid Build Coastguard Worker                            UWORD8 u1_seg_wd, UWORD8 u1_seg_ht, UWORD8 *pu1_refarray_1,
149*495ae853SAndroid Build Coastguard Worker                            UWORD8 *pu1_refarray_2, WORD32 i4_refarray_stride, WORD32 i4_mb_adjoin_x,
150*495ae853SAndroid Build Coastguard Worker                            WORD32 i4_mb_adjoin_y, WORD32 i4_corner_pixel_available);
151*495ae853SAndroid Build Coastguard Worker 
152*495ae853SAndroid Build Coastguard Worker void isvcd_top_bot_padding_chroma(WORD32 i4_x, WORD32 i4_y, WORD8 i1_xd_index, WORD8 i1_yd_index,
153*495ae853SAndroid Build Coastguard Worker                                   UWORD8 u1_seg_wd, UWORD8 u1_seg_ht, UWORD8 *pu1_refarray_1,
154*495ae853SAndroid Build Coastguard Worker                                   UWORD8 *pu1_refarray_2, WORD32 i4_refarray_stride,
155*495ae853SAndroid Build Coastguard Worker                                   WORD32 i4_mb_adjoin_x, WORD32 i4_mb_adjoin_y,
156*495ae853SAndroid Build Coastguard Worker                                   WORD32 i4_corner_pixel_available);
157*495ae853SAndroid Build Coastguard Worker 
158*495ae853SAndroid Build Coastguard Worker void isvcd_diag_padding(WORD32 i4_x, WORD32 i4_y, WORD8 i1_xd_index, WORD8 i1_yd_index,
159*495ae853SAndroid Build Coastguard Worker                         UWORD8 u1_seg_wd, UWORD8 u1_seg_ht, UWORD8 *pu1_refarray_1,
160*495ae853SAndroid Build Coastguard Worker                         UWORD8 *pu1_refarray_2, WORD32 i4_refarray_stride, WORD32 i4_mb_adjoin_x,
161*495ae853SAndroid Build Coastguard Worker                         WORD32 i4_mb_adjoin_y, WORD32 i4_corner_pixel_available);
162*495ae853SAndroid Build Coastguard Worker 
163*495ae853SAndroid Build Coastguard Worker void isvcd_diag_padding_chroma(WORD32 i4_x, WORD32 i4_y, WORD8 i1_xd_index, WORD8 i1_yd_index,
164*495ae853SAndroid Build Coastguard Worker                                UWORD8 u1_seg_wd, UWORD8 u1_seg_ht, UWORD8 *pu1_refarray_1,
165*495ae853SAndroid Build Coastguard Worker                                UWORD8 *pu1_refarray_2, WORD32 i4_refarray_stride,
166*495ae853SAndroid Build Coastguard Worker                                WORD32 i4_mb_adjoin_x, WORD32 i4_mb_adjoin_y,
167*495ae853SAndroid Build Coastguard Worker                                WORD32 i4_corner_pixel_available);
168*495ae853SAndroid Build Coastguard Worker 
169*495ae853SAndroid Build Coastguard Worker void isvcd_diag_reconstruction(WORD32 i4_x, WORD32 i4_y, WORD8 i1_xd_index, WORD8 i1_yd_index,
170*495ae853SAndroid Build Coastguard Worker                                UWORD8 u1_seg_wd, UWORD8 u1_seg_ht, UWORD8 *pu1_refarray_1,
171*495ae853SAndroid Build Coastguard Worker                                UWORD8 *pu1_refarray_2, WORD32 i4_refarray_stride,
172*495ae853SAndroid Build Coastguard Worker                                WORD32 i4_mb_adjoin_x, WORD32 i4_mb_adjoin_y,
173*495ae853SAndroid Build Coastguard Worker                                WORD32 i4_corner_pixel_available);
174*495ae853SAndroid Build Coastguard Worker 
175*495ae853SAndroid Build Coastguard Worker void isvcd_diag_reconstruction_chroma(WORD32 i4_x, WORD32 i4_y, WORD8 i1_xd_index,
176*495ae853SAndroid Build Coastguard Worker                                       WORD8 i1_yd_index, UWORD8 u1_seg_wd, UWORD8 u1_seg_ht,
177*495ae853SAndroid Build Coastguard Worker                                       UWORD8 *pu1_refarray_1, UWORD8 *pu1_refarray_2,
178*495ae853SAndroid Build Coastguard Worker                                       WORD32 i4_refarray_stride, WORD32 i4_mb_adjoin_x,
179*495ae853SAndroid Build Coastguard Worker                                       WORD32 i4_mb_adjoin_y, WORD32 i4_corner_pixel_available);
180*495ae853SAndroid Build Coastguard Worker 
181*495ae853SAndroid Build Coastguard Worker typedef void i264_interpolate_base_luma_dyadic(UWORD8 *pu1_inp_buf, WORD16 *pi2_tmp_filt_buf,
182*495ae853SAndroid Build Coastguard Worker                                                UWORD8 *pu1_out_buf, WORD32 i4_out_stride);
183*495ae853SAndroid Build Coastguard Worker 
184*495ae853SAndroid Build Coastguard Worker typedef void i264_interpolate_intra_base(void *pv_intra_samp_ctxt, UWORD8 *pu1_out,
185*495ae853SAndroid Build Coastguard Worker                                          WORD32 i4_out_stride, WORD32 i4_refarray_wd,
186*495ae853SAndroid Build Coastguard Worker                                          WORD32 u2_mb_x, WORD32 u2_mb_y, WORD32 i4_chroma_flag,
187*495ae853SAndroid Build Coastguard Worker                                          WORD32 i4_refarray_flag);
188*495ae853SAndroid Build Coastguard Worker 
189*495ae853SAndroid Build Coastguard Worker /*C Declarations*/
190*495ae853SAndroid Build Coastguard Worker i264_interpolate_base_luma_dyadic isvcd_interpolate_base_luma_dyadic;
191*495ae853SAndroid Build Coastguard Worker i264_vert_interpol_chroma_dyadic isvcd_vert_interpol_chroma_dyadic_1;
192*495ae853SAndroid Build Coastguard Worker i264_vert_interpol_chroma_dyadic isvcd_vert_interpol_chroma_dyadic_2;
193*495ae853SAndroid Build Coastguard Worker i264_vert_interpol_chroma_dyadic isvcd_vert_interpol_chroma_dyadic_3;
194*495ae853SAndroid Build Coastguard Worker i264_horz_interpol_chroma_dyadic isvcd_horz_interpol_chroma_dyadic_1;
195*495ae853SAndroid Build Coastguard Worker i264_horz_interpol_chroma_dyadic isvcd_horz_interpol_chroma_dyadic_2;
196*495ae853SAndroid Build Coastguard Worker 
197*495ae853SAndroid Build Coastguard Worker /*ARM Declarations*/
198*495ae853SAndroid Build Coastguard Worker i264_interpolate_base_luma_dyadic isvcd_interpolate_base_luma_dyadic_neonintr;
199*495ae853SAndroid Build Coastguard Worker i264_vert_interpol_chroma_dyadic isvcd_vert_interpol_chroma_dyadic_1_neonintr;
200*495ae853SAndroid Build Coastguard Worker i264_vert_interpol_chroma_dyadic isvcd_vert_interpol_chroma_dyadic_2_neonintr;
201*495ae853SAndroid Build Coastguard Worker i264_vert_interpol_chroma_dyadic isvcd_vert_interpol_chroma_dyadic_3_neonintr;
202*495ae853SAndroid Build Coastguard Worker i264_horz_interpol_chroma_dyadic isvcd_horz_interpol_chroma_dyadic_1_neonintr;
203*495ae853SAndroid Build Coastguard Worker i264_horz_interpol_chroma_dyadic isvcd_horz_interpol_chroma_dyadic_2_neonintr;
204*495ae853SAndroid Build Coastguard Worker 
205*495ae853SAndroid Build Coastguard Worker i264_interpolate_intra_base isvcd_interpolate_intra_base;
206*495ae853SAndroid Build Coastguard Worker i264_interpolate_intra_base isvcd_interpolate_intra_base_sse42;
207*495ae853SAndroid Build Coastguard Worker i264_interpolate_intra_base isvcd_interpolate_intra_base_neonintr;
208*495ae853SAndroid Build Coastguard Worker 
209*495ae853SAndroid Build Coastguard Worker /*x86 Declarations*/
210*495ae853SAndroid Build Coastguard Worker i264_interpolate_base_luma_dyadic isvcd_interpolate_base_luma_dyadic_sse42;
211*495ae853SAndroid Build Coastguard Worker i264_vert_interpol_chroma_dyadic isvcd_vert_interpol_chroma_dyadic_1_sse42;
212*495ae853SAndroid Build Coastguard Worker i264_vert_interpol_chroma_dyadic isvcd_vert_interpol_chroma_dyadic_2_sse42;
213*495ae853SAndroid Build Coastguard Worker i264_vert_interpol_chroma_dyadic isvcd_vert_interpol_chroma_dyadic_3_sse42;
214*495ae853SAndroid Build Coastguard Worker i264_horz_interpol_chroma_dyadic isvcd_horz_interpol_chroma_dyadic_1_sse42;
215*495ae853SAndroid Build Coastguard Worker i264_horz_interpol_chroma_dyadic isvcd_horz_interpol_chroma_dyadic_2_sse42;
216*495ae853SAndroid Build Coastguard Worker 
217*495ae853SAndroid Build Coastguard Worker typedef struct
218*495ae853SAndroid Build Coastguard Worker {
219*495ae853SAndroid Build Coastguard Worker     UWORD16 u2_mb_x; /*!< MB X of the MB which has to
220*495ae853SAndroid Build Coastguard Worker                           be processed
221*495ae853SAndroid Build Coastguard Worker                       */
222*495ae853SAndroid Build Coastguard Worker     UWORD16 u2_mb_y; /*!< MB Y of the MB which has to
223*495ae853SAndroid Build Coastguard Worker                           be processed
224*495ae853SAndroid Build Coastguard Worker                       */
225*495ae853SAndroid Build Coastguard Worker } mb_coord_t;
226*495ae853SAndroid Build Coastguard Worker 
227*495ae853SAndroid Build Coastguard Worker typedef struct
228*495ae853SAndroid Build Coastguard Worker {
229*495ae853SAndroid Build Coastguard Worker     void *pv_buffer;              /*!< Buffer pointer */
230*495ae853SAndroid Build Coastguard Worker     WORD32 i4_element_size;       /*!< size of the structure or unit */
231*495ae853SAndroid Build Coastguard Worker     WORD32 i4_num_element_stride; /*!< Stride of buffer in terms of number
232*495ae853SAndroid Build Coastguard Worker                                    of elements.                                 */
233*495ae853SAndroid Build Coastguard Worker } mem_element_t;
234*495ae853SAndroid Build Coastguard Worker 
235*495ae853SAndroid Build Coastguard Worker typedef struct
236*495ae853SAndroid Build Coastguard Worker {
237*495ae853SAndroid Build Coastguard Worker     void *pv_buffer1;             /*!< Buffer pointer */
238*495ae853SAndroid Build Coastguard Worker     void *pv_buffer2;             /*!< Buffer pointer */
239*495ae853SAndroid Build Coastguard Worker     WORD32 i4_element_size;       /*!< size of the structure or unit */
240*495ae853SAndroid Build Coastguard Worker     WORD32 i4_num_element_stride; /*!< Stride of buffer in terms of number
241*495ae853SAndroid Build Coastguard Worker                                    of elements.
242*495ae853SAndroid Build Coastguard Worker                                */
243*495ae853SAndroid Build Coastguard Worker } mem_element_2_t;
244*495ae853SAndroid Build Coastguard Worker typedef struct
245*495ae853SAndroid Build Coastguard Worker {
246*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_seg_dim;       /*!< describes segment dimension */
247*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_seg_off;       /*!< describes offset from start */
248*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_mb_adjoin;     /*!< describes whether mb is adjoining
249*495ae853SAndroid Build Coastguard Worker                                  the segment 0 => not adjoining
250*495ae853SAndroid Build Coastguard Worker                                              1 => adjoining    */
251*495ae853SAndroid Build Coastguard Worker 
252*495ae853SAndroid Build Coastguard Worker     WORD8 i1_dist_idx;       /*!< distance to nearest MB */
253*495ae853SAndroid Build Coastguard Worker 
254*495ae853SAndroid Build Coastguard Worker     WORD8 i1_nearst_mb_bdry; /*!< describes the nearest mb boundary
255*495ae853SAndroid Build Coastguard Worker                                  +1 => rightMB/bottomMB
256*495ae853SAndroid Build Coastguard Worker                                  -1 => leftMB/topMB    */
257*495ae853SAndroid Build Coastguard Worker } seg_description_t;
258*495ae853SAndroid Build Coastguard Worker 
259*495ae853SAndroid Build Coastguard Worker typedef struct
260*495ae853SAndroid Build Coastguard Worker {
261*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_num_segments;          /*!< place holder to store the number of
262*495ae853SAndroid Build Coastguard Worker                                      segments */
263*495ae853SAndroid Build Coastguard Worker 
264*495ae853SAndroid Build Coastguard Worker     UWORD8 u4_start_pos;             /*!< this variable indicates where is
265*495ae853SAndroid Build Coastguard Worker                                       start locatiion of the segment with
266*495ae853SAndroid Build Coastguard Worker                                       respect to less the block_width or
267*495ae853SAndroid Build Coastguard Worker                                       greater than block width            */
268*495ae853SAndroid Build Coastguard Worker 
269*495ae853SAndroid Build Coastguard Worker     seg_description_t s_segments[4]; /*!< place holder to store per segment
270*495ae853SAndroid Build Coastguard Worker                                            description    */
271*495ae853SAndroid Build Coastguard Worker } seg_lookup_desc_t;
272*495ae853SAndroid Build Coastguard Worker typedef struct
273*495ae853SAndroid Build Coastguard Worker {
274*495ae853SAndroid Build Coastguard Worker     WORD16 i2_min_pos; /*!< place holder to store the projected
275*495ae853SAndroid Build Coastguard Worker                            MIN referecne position for a MB in
276*495ae853SAndroid Build Coastguard Worker                            current layer. can be used to store
277*495ae853SAndroid Build Coastguard Worker                            either horizontal or vertical positions
278*495ae853SAndroid Build Coastguard Worker                        */
279*495ae853SAndroid Build Coastguard Worker     WORD16 i2_max_pos; /*!< place holder to store the projected
280*495ae853SAndroid Build Coastguard Worker                            MAX referecne position for a MB in
281*495ae853SAndroid Build Coastguard Worker                            current layer. can be used to store
282*495ae853SAndroid Build Coastguard Worker                            either horizontal or vertical positions
283*495ae853SAndroid Build Coastguard Worker                                   */
284*495ae853SAndroid Build Coastguard Worker } ref_min_max_map_t;
285*495ae853SAndroid Build Coastguard Worker 
286*495ae853SAndroid Build Coastguard Worker typedef struct
287*495ae853SAndroid Build Coastguard Worker {
288*495ae853SAndroid Build Coastguard Worker     WORD16 i2_left; /*!< Horizontal offset of upper left luma sample
289*495ae853SAndroid Build Coastguard Worker                        after resampling process on reference
290*495ae853SAndroid Build Coastguard Worker                        layer with respect to upper left luma
291*495ae853SAndroid Build Coastguard Worker                        sample of current layer.
292*495ae853SAndroid Build Coastguard Worker                    */
293*495ae853SAndroid Build Coastguard Worker     WORD16 i2_top;  /*!< Vertical offset of upper left luma pixel
294*495ae853SAndroid Build Coastguard Worker                        after resampling process on reference
295*495ae853SAndroid Build Coastguard Worker                        layer
296*495ae853SAndroid Build Coastguard Worker                    */
297*495ae853SAndroid Build Coastguard Worker     WORD16 i2_rt;   /*!< Horizontal offset of bottom right luma
298*495ae853SAndroid Build Coastguard Worker                        sample after resampling process on
299*495ae853SAndroid Build Coastguard Worker                        reference layer with respect to bottom
300*495ae853SAndroid Build Coastguard Worker                        right luma sample.
301*495ae853SAndroid Build Coastguard Worker                    */
302*495ae853SAndroid Build Coastguard Worker     WORD16 i2_bot;  /*!< Vertical offset of bottom right luma
303*495ae853SAndroid Build Coastguard Worker                        pixel after resampling process on
304*495ae853SAndroid Build Coastguard Worker                        reference layer
305*495ae853SAndroid Build Coastguard Worker                    */
306*495ae853SAndroid Build Coastguard Worker } ref_lyr_scaled_offset_t;
307*495ae853SAndroid Build Coastguard Worker 
308*495ae853SAndroid Build Coastguard Worker typedef struct
309*495ae853SAndroid Build Coastguard Worker {
310*495ae853SAndroid Build Coastguard Worker     UWORD8 i2_ref_pos; /*!<  place holder to store the projected
311*495ae853SAndroid Build Coastguard Worker                              referecne position for a pixel in
312*495ae853SAndroid Build Coastguard Worker                              current layer. can be used to store
313*495ae853SAndroid Build Coastguard Worker                              either horizontal or vertical positions
314*495ae853SAndroid Build Coastguard Worker                         */
315*495ae853SAndroid Build Coastguard Worker     UWORD8 i2_phase;   /*!<  place holder to store the projected
316*495ae853SAndroid Build Coastguard Worker                              phase for a pixel in current layer.
317*495ae853SAndroid Build Coastguard Worker                              can be used to store either
318*495ae853SAndroid Build Coastguard Worker                              horizontal or vertical phase
319*495ae853SAndroid Build Coastguard Worker                         */
320*495ae853SAndroid Build Coastguard Worker } ref_pixel_map_t;
321*495ae853SAndroid Build Coastguard Worker 
322*495ae853SAndroid Build Coastguard Worker typedef struct
323*495ae853SAndroid Build Coastguard Worker {
324*495ae853SAndroid Build Coastguard Worker     WORD16 i2_offset; /*!<  place holder to store the projected
325*495ae853SAndroid Build Coastguard Worker                             start point of reference window
326*495ae853SAndroid Build Coastguard Worker                             for each MB in current layer.can be
327*495ae853SAndroid Build Coastguard Worker                             used to store either horizontal or
328*495ae853SAndroid Build Coastguard Worker                             vertical offset
329*495ae853SAndroid Build Coastguard Worker                        */
330*495ae853SAndroid Build Coastguard Worker     WORD16 i2_length; /*!<  place holder to store reference array
331*495ae853SAndroid Build Coastguard Worker                             length of the reference window
332*495ae853SAndroid Build Coastguard Worker                             for each MB in current layer.can be
333*495ae853SAndroid Build Coastguard Worker                             used to store either horizontal width
334*495ae853SAndroid Build Coastguard Worker                             or vertical height
335*495ae853SAndroid Build Coastguard Worker                        */
336*495ae853SAndroid Build Coastguard Worker } ref_mb_map_t;
337*495ae853SAndroid Build Coastguard Worker 
338*495ae853SAndroid Build Coastguard Worker typedef struct
339*495ae853SAndroid Build Coastguard Worker {
340*495ae853SAndroid Build Coastguard Worker     WORD32 i4_res_width;                             /*!< Frame width of top most layer in the
341*495ae853SAndroid Build Coastguard Worker                                                           resolution. It's expressed in terms
342*495ae853SAndroid Build Coastguard Worker                                                           of luma samples.
343*495ae853SAndroid Build Coastguard Worker                                                       */
344*495ae853SAndroid Build Coastguard Worker     WORD32 i4_res_height;                            /*!< Frame height of top most layer in the
345*495ae853SAndroid Build Coastguard Worker                                                           resolution. It's expressed in terms
346*495ae853SAndroid Build Coastguard Worker                                                           of luma samples.
347*495ae853SAndroid Build Coastguard Worker                                                       */
348*495ae853SAndroid Build Coastguard Worker     ref_lyr_scaled_offset_t s_ref_lyr_scaled_offset; /*!< Scaled offset
349*495ae853SAndroid Build Coastguard Worker                                       parameters of reference layer considering
350*495ae853SAndroid Build Coastguard Worker                                       bottom most layer of the resolution as
351*495ae853SAndroid Build Coastguard Worker                                       current layer. Offsets are with respect
352*495ae853SAndroid Build Coastguard Worker                                       to upper left luma samples in top most
353*495ae853SAndroid Build Coastguard Worker                                       layer in the resolution.
354*495ae853SAndroid Build Coastguard Worker                                   */
355*495ae853SAndroid Build Coastguard Worker     UWORD16 u2_scaled_ref_width;                     /*!< Considering bottom most layer of the
356*495ae853SAndroid Build Coastguard Worker                                                        resolution as current layer, scaled
357*495ae853SAndroid Build Coastguard Worker                                                        width of reference layer in terms of
358*495ae853SAndroid Build Coastguard Worker                                                        luma pixels. It's inferred parameter
359*495ae853SAndroid Build Coastguard Worker                                                        based on reference layer offsets.
360*495ae853SAndroid Build Coastguard Worker                                                    */
361*495ae853SAndroid Build Coastguard Worker     UWORD16 u2_scaled_ref_height;                    /*!< Considering bottom most layer of the
362*495ae853SAndroid Build Coastguard Worker                                                       resolution as current layer, scaled
363*495ae853SAndroid Build Coastguard Worker                                                       height of reference layer in terms of
364*495ae853SAndroid Build Coastguard Worker                                                       luma pixels. It's inferred parameter
365*495ae853SAndroid Build Coastguard Worker                                                       based on reference layer offsets.
366*495ae853SAndroid Build Coastguard Worker                                                    */
367*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_rstrct_res_change_flag;                /*!< restrictedResolutionChangeFlag for
368*495ae853SAndroid Build Coastguard Worker                                                   bottom most layer of the resolution. It's
369*495ae853SAndroid Build Coastguard Worker                                                   a inferred parameter.
370*495ae853SAndroid Build Coastguard Worker                                                */
371*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_cropping_change_flag;                  /*!< croppingChangeFlag for bottom most
372*495ae853SAndroid Build Coastguard Worker                                                     layer of the resolution. It's a inferred
373*495ae853SAndroid Build Coastguard Worker                                                     parameter.
374*495ae853SAndroid Build Coastguard Worker                                                  */
375*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_disable_inter_lyr_dblk_filter_idc;     /*!< Mode of operation for
376*495ae853SAndroid Build Coastguard Worker                                          inter layer de-blocking. It shall be
377*495ae853SAndroid Build Coastguard Worker                                          set for bottom most layer of the top
378*495ae853SAndroid Build Coastguard Worker                                          resolution. By top resolution, it
379*495ae853SAndroid Build Coastguard Worker                                          referes to the resolution just above
380*495ae853SAndroid Build Coastguard Worker                                          the current spatial resolution. This
381*495ae853SAndroid Build Coastguard Worker                                          shall be valid for all resolutions
382*495ae853SAndroid Build Coastguard Worker                                          except target resolution.
383*495ae853SAndroid Build Coastguard Worker                                      */
384*495ae853SAndroid Build Coastguard Worker     WORD8 i1_inter_lyr_alpha_c0_offset;              /*!< specifies the offset used in
385*495ae853SAndroid Build Coastguard Worker                                                 accessing the alpha and tC0 deblocking
386*495ae853SAndroid Build Coastguard Worker                                                 filter tables for filtering operations
387*495ae853SAndroid Build Coastguard Worker                                                 in inter layer de-blocking. Applicable
388*495ae853SAndroid Build Coastguard Worker                                                 for bottom most layer of the top
389*495ae853SAndroid Build Coastguard Worker                                                 resolution. By top resolution, it referes
390*495ae853SAndroid Build Coastguard Worker                                                 to the resolution just above the current
391*495ae853SAndroid Build Coastguard Worker                                                 spatial resolution. This shall be valid
392*495ae853SAndroid Build Coastguard Worker                                                 for resolutions except target resolution.
393*495ae853SAndroid Build Coastguard Worker                                             */
394*495ae853SAndroid Build Coastguard Worker     WORD8 i1_inter_lyr_beta_offset;                  /*!< specifies the offset used in
395*495ae853SAndroid Build Coastguard Worker                                                     accessing the beta deblocking filter table
396*495ae853SAndroid Build Coastguard Worker                                                     for filtering operations in inter layer
397*495ae853SAndroid Build Coastguard Worker                                                     de-blocking. Applicable for bottom most
398*495ae853SAndroid Build Coastguard Worker                                                     layer of the top resolution. By top
399*495ae853SAndroid Build Coastguard Worker                                                     resolution, it referes to the resolution
400*495ae853SAndroid Build Coastguard Worker                                                     just above the current spatial resolution.
401*495ae853SAndroid Build Coastguard Worker                                                     This shall be valid for resolutions
402*495ae853SAndroid Build Coastguard Worker                                                     except target resolution.
403*495ae853SAndroid Build Coastguard Worker                                                 */
404*495ae853SAndroid Build Coastguard Worker     WORD8 i1_constrained_intra_rsmpl_flag;           /*!< Constrained intra resampling
405*495ae853SAndroid Build Coastguard Worker                                              flag. Range is [0,1].
406*495ae853SAndroid Build Coastguard Worker                                          */
407*495ae853SAndroid Build Coastguard Worker     WORD8 i1_ref_lyr_chroma_phase_x_plus1_flag;      /*!< specifies the horizontal
408*495ae853SAndroid Build Coastguard Worker                                          phase shift of the chroma components in
409*495ae853SAndroid Build Coastguard Worker                                         units of half luma samples of a layer
410*495ae853SAndroid Build Coastguard Worker                                         frame for the layer pictures that may be
411*495ae853SAndroid Build Coastguard Worker                                         used for inter-layer prediction
412*495ae853SAndroid Build Coastguard Worker                                     */
413*495ae853SAndroid Build Coastguard Worker 
414*495ae853SAndroid Build Coastguard Worker     WORD8 i1_ref_lyr_chroma_phase_y_plus1;           /*!< specifies the vertical phase
415*495ae853SAndroid Build Coastguard Worker                                               shift of the chroma components in units of
416*495ae853SAndroid Build Coastguard Worker                                               half luma samples of a layer frame for the
417*495ae853SAndroid Build Coastguard Worker                                               layer pictures that may be used for
418*495ae853SAndroid Build Coastguard Worker                                              inter-layer prediction
419*495ae853SAndroid Build Coastguard Worker                                          */
420*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_direct_8x8_inference_flag;             /*!< Direct 8x8 inference flag
421*495ae853SAndroid Build Coastguard Worker                                                       . Range is [0,1].
422*495ae853SAndroid Build Coastguard Worker                                             */
423*495ae853SAndroid Build Coastguard Worker 
424*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_remap_req_flag;                        /*!< this flag signifies to the
425*495ae853SAndroid Build Coastguard Worker                                                           upsampling modules whether the Map
426*495ae853SAndroid Build Coastguard Worker                                                           buffers have to recomputed for current
427*495ae853SAndroid Build Coastguard Worker                                                           access unit or to retain the previous
428*495ae853SAndroid Build Coastguard Worker                                                           access units values
429*495ae853SAndroid Build Coastguard Worker                                                           */
430*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_dyadic_flag;                           /*!< this flag signifies the scaling
431*495ae853SAndroid Build Coastguard Worker                                                           ratios are 2 in both directions
432*495ae853SAndroid Build Coastguard Worker                                                           and the cropping is MB aligned
433*495ae853SAndroid Build Coastguard Worker                                                         */
434*495ae853SAndroid Build Coastguard Worker } res_prms_t;
435*495ae853SAndroid Build Coastguard Worker 
436*495ae853SAndroid Build Coastguard Worker typedef struct
437*495ae853SAndroid Build Coastguard Worker {
438*495ae853SAndroid Build Coastguard Worker     ref_pixel_map_t *ps_x_pos_phase;  /*!< buffers to store the projected
439*495ae853SAndroid Build Coastguard Worker                                          referecne X and phase X for each
440*495ae853SAndroid Build Coastguard Worker                                          pixel in current layer in
441*495ae853SAndroid Build Coastguard Worker                                          horizontal direction
442*495ae853SAndroid Build Coastguard Worker                                       */
443*495ae853SAndroid Build Coastguard Worker     ref_pixel_map_t *ps_y_pos_phase;  /*!< buffers to store the projected
444*495ae853SAndroid Build Coastguard Worker                                          referecne Y and phase Y for each
445*495ae853SAndroid Build Coastguard Worker                                          pixel in current layer in
446*495ae853SAndroid Build Coastguard Worker                                          vertical direction
447*495ae853SAndroid Build Coastguard Worker                                       */
448*495ae853SAndroid Build Coastguard Worker     ref_mb_map_t *ps_x_offset_length; /*!< buffers to store the projected
449*495ae853SAndroid Build Coastguard Worker                                       start point of reference window and
450*495ae853SAndroid Build Coastguard Worker                                       reference array  width in
451*495ae853SAndroid Build Coastguard Worker                                       horizontal direction for each MB in
452*495ae853SAndroid Build Coastguard Worker                                       current layer
453*495ae853SAndroid Build Coastguard Worker                                   */
454*495ae853SAndroid Build Coastguard Worker     ref_mb_map_t *ps_y_offset_length; /*!< buffers to store the projected
455*495ae853SAndroid Build Coastguard Worker                                       start point of reference window and
456*495ae853SAndroid Build Coastguard Worker                                       reference array  height in
457*495ae853SAndroid Build Coastguard Worker                                       vertical direction for each MB in
458*495ae853SAndroid Build Coastguard Worker                                       current layer
459*495ae853SAndroid Build Coastguard Worker                                   */
460*495ae853SAndroid Build Coastguard Worker     ref_min_max_map_t *ps_x_min_max;
461*495ae853SAndroid Build Coastguard Worker     /*!< Buffer to store the projected
462*495ae853SAndroid Build Coastguard Worker                                            MIN and MAX referecne position for a
463*495ae853SAndroid Build Coastguard Worker                                            MB in current layer in
464*495ae853SAndroid Build Coastguard Worker                                            horizontal direction
465*495ae853SAndroid Build Coastguard Worker                                        */
466*495ae853SAndroid Build Coastguard Worker 
467*495ae853SAndroid Build Coastguard Worker     ref_min_max_map_t *ps_y_min_max;
468*495ae853SAndroid Build Coastguard Worker     /*!< Buffer to store the projected
469*495ae853SAndroid Build Coastguard Worker                                            MIN and MAX referecne position for a
470*495ae853SAndroid Build Coastguard Worker                                            MB in current layer in
471*495ae853SAndroid Build Coastguard Worker                                            Vertical direction
472*495ae853SAndroid Build Coastguard Worker                                        */
473*495ae853SAndroid Build Coastguard Worker 
474*495ae853SAndroid Build Coastguard Worker     WORD16 *pi2_xd_index;                  /*!< buffers to store the projected
475*495ae853SAndroid Build Coastguard Worker                                                  XD for each pixel in an MB
476*495ae853SAndroid Build Coastguard Worker                                             */
477*495ae853SAndroid Build Coastguard Worker     WORD16 *pi2_yd_index;                  /*!< buffers to store the projected
478*495ae853SAndroid Build Coastguard Worker                                                 YD for each pixel in an MB
479*495ae853SAndroid Build Coastguard Worker                                             */
480*495ae853SAndroid Build Coastguard Worker     WORD16 *pi2_ya_index;                  /*!< buffers to store the projected
481*495ae853SAndroid Build Coastguard Worker                                                 YA for each pixel in an MB
482*495ae853SAndroid Build Coastguard Worker                                           */
483*495ae853SAndroid Build Coastguard Worker 
484*495ae853SAndroid Build Coastguard Worker     seg_lookup_desc_t *ps_seg_lookup_horz; /*!< buffers to store lookup for
485*495ae853SAndroid Build Coastguard Worker                                           horizontal segment description  */
486*495ae853SAndroid Build Coastguard Worker 
487*495ae853SAndroid Build Coastguard Worker     seg_lookup_desc_t *ps_seg_lookup_vert; /*!< buffers to store lookup for
488*495ae853SAndroid Build Coastguard Worker                                           vertical segment description  */
489*495ae853SAndroid Build Coastguard Worker 
490*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_refarray_x_idx;            /*!< buffers to store lookup for
491*495ae853SAndroid Build Coastguard Worker                                           x indexes to get availability
492*495ae853SAndroid Build Coastguard Worker                                            from 4x4 availability grid */
493*495ae853SAndroid Build Coastguard Worker 
494*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_refarray_y_idx;            /*!< buffers to store lookup for
495*495ae853SAndroid Build Coastguard Worker                                           y indexes to get availability
496*495ae853SAndroid Build Coastguard Worker                                            from 4x4 availability grid */
497*495ae853SAndroid Build Coastguard Worker } intra_samp_map_ctxt_t;
498*495ae853SAndroid Build Coastguard Worker 
499*495ae853SAndroid Build Coastguard Worker typedef struct
500*495ae853SAndroid Build Coastguard Worker {
501*495ae853SAndroid Build Coastguard Worker     intra_samp_map_ctxt_t s_luma_map_ctxt;   /*!< map structure for luma
502*495ae853SAndroid Build Coastguard Worker                                                 projected locations
503*495ae853SAndroid Build Coastguard Worker                                                 for curr resolution layer
504*495ae853SAndroid Build Coastguard Worker                                               */
505*495ae853SAndroid Build Coastguard Worker     intra_samp_map_ctxt_t s_chroma_map_ctxt; /*!< map structure for chroma
506*495ae853SAndroid Build Coastguard Worker                                                 projected locations
507*495ae853SAndroid Build Coastguard Worker                                                 for curr resolution layer
508*495ae853SAndroid Build Coastguard Worker                                               */
509*495ae853SAndroid Build Coastguard Worker     WORD32 i4_ref_width;                     /*!< reference layer width in
510*495ae853SAndroid Build Coastguard Worker                                                   terms luma samples
511*495ae853SAndroid Build Coastguard Worker                                               */
512*495ae853SAndroid Build Coastguard Worker     WORD32 i4_ref_height;                    /*!< reference layer height in
513*495ae853SAndroid Build Coastguard Worker                                                   terms luma samples
514*495ae853SAndroid Build Coastguard Worker                                               */
515*495ae853SAndroid Build Coastguard Worker     WORD32 i4_curr_width;                    /*!< current layer width in
516*495ae853SAndroid Build Coastguard Worker                                                  terms luma samples
517*495ae853SAndroid Build Coastguard Worker                                              */
518*495ae853SAndroid Build Coastguard Worker     WORD32 i4_curr_height;                   /*!< current layer height in
519*495ae853SAndroid Build Coastguard Worker                                                  terms luma samples
520*495ae853SAndroid Build Coastguard Worker                                              */
521*495ae853SAndroid Build Coastguard Worker     WORD8 i1_constrained_intra_rsmpl_flag;   /*!< Constrained intra resampling
522*495ae853SAndroid Build Coastguard Worker                                                   flag. Range is [0,1].
523*495ae853SAndroid Build Coastguard Worker                                               */
524*495ae853SAndroid Build Coastguard Worker     WORD32 i4_x_phase_0;                     /*!< Chroma xPhase for even
525*495ae853SAndroid Build Coastguard Worker                                           values of x for dyadic cases
526*495ae853SAndroid Build Coastguard Worker                                           */
527*495ae853SAndroid Build Coastguard Worker     WORD32 i4_x_phase_1;                     /*!< Chroma xPhase for odd
528*495ae853SAndroid Build Coastguard Worker                                           values of x for dyadic cases
529*495ae853SAndroid Build Coastguard Worker                                           */
530*495ae853SAndroid Build Coastguard Worker     WORD32 i4_y_phase_0;                     /*!< Chroma yPhase for even
531*495ae853SAndroid Build Coastguard Worker                                           values of y for dyadic cases
532*495ae853SAndroid Build Coastguard Worker                                           */
533*495ae853SAndroid Build Coastguard Worker     WORD32 i4_y_phase_1;                     /*!< Chroma yPhase for odd
534*495ae853SAndroid Build Coastguard Worker                                           values of y for dyadic cases
535*495ae853SAndroid Build Coastguard Worker                                           */
536*495ae853SAndroid Build Coastguard Worker 
537*495ae853SAndroid Build Coastguard Worker     pf_vert_interpol_chroma_dyadic pf_vert_chroma_interpol;
538*495ae853SAndroid Build Coastguard Worker     /*!< Vertical interpolation
539*495ae853SAndroid Build Coastguard Worker     function for chroma
540*495ae853SAndroid Build Coastguard Worker     */
541*495ae853SAndroid Build Coastguard Worker     pf_horz_interpol_chroma_dyadic pf_horz_chroma_interpol;
542*495ae853SAndroid Build Coastguard Worker     /*!< Horizontal interpolation
543*495ae853SAndroid Build Coastguard Worker     function for chroma
544*495ae853SAndroid Build Coastguard Worker     */
545*495ae853SAndroid Build Coastguard Worker } intra_samp_lyr_ctxt;
546*495ae853SAndroid Build Coastguard Worker typedef struct
547*495ae853SAndroid Build Coastguard Worker {
548*495ae853SAndroid Build Coastguard Worker     intra_samp_lyr_ctxt as_res_lyrs[MAX_NUM_RES_LYRS]; /*!< Array of resolution
549*495ae853SAndroid Build Coastguard Worker                                                   layer ctxt.
550*495ae853SAndroid Build Coastguard Worker                                                   The first strcuture in the
551*495ae853SAndroid Build Coastguard Worker                                                   array will be used for storing
552*495ae853SAndroid Build Coastguard Worker                                                   the "second resolution" map in
553*495ae853SAndroid Build Coastguard Worker                                                   an access unit w.r.t to its
554*495ae853SAndroid Build Coastguard Worker                                                   base resolution, and for base
555*495ae853SAndroid Build Coastguard Worker                                                   resolution nothing will be
556*495ae853SAndroid Build Coastguard Worker                                                   computed or stored
557*495ae853SAndroid Build Coastguard Worker                                               */
558*495ae853SAndroid Build Coastguard Worker     void *ps_sps;                                      /*!< pointer to array of SPS
559*495ae853SAndroid Build Coastguard Worker                                                         */
560*495ae853SAndroid Build Coastguard Worker 
561*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_refarray_buffer;                       /*!< buffer to store the reference
562*495ae853SAndroid Build Coastguard Worker                                                            layer data before intra
563*495ae853SAndroid Build Coastguard Worker                                                            sampling
564*495ae853SAndroid Build Coastguard Worker                                                       */
565*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_refarray_cb;                           /*!< buffer to hold the reference
566*495ae853SAndroid Build Coastguard Worker                                                          layer Cb data before intra
567*495ae853SAndroid Build Coastguard Worker                                                          resampling (used for dyadic
568*495ae853SAndroid Build Coastguard Worker                                                          cases only)
569*495ae853SAndroid Build Coastguard Worker                                                     */
570*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_refarray_cr;                           /*!< buffer to hold the reference
571*495ae853SAndroid Build Coastguard Worker                                                          layer Cr data before intra
572*495ae853SAndroid Build Coastguard Worker                                                          resampling (used for dyadic
573*495ae853SAndroid Build Coastguard Worker                                                          cases only)
574*495ae853SAndroid Build Coastguard Worker                                                     */
575*495ae853SAndroid Build Coastguard Worker     WORD32 *pi4_temp_interpolation_buffer;             /*!< intermideate buffer
576*495ae853SAndroid Build Coastguard Worker                                                 for interpolation
577*495ae853SAndroid Build Coastguard Worker                                            */
578*495ae853SAndroid Build Coastguard Worker 
579*495ae853SAndroid Build Coastguard Worker     WORD32 i4_res_lyr_id;                              /*!< resolution id of the layer
580*495ae853SAndroid Build Coastguard Worker                                                             which is to be processed
581*495ae853SAndroid Build Coastguard Worker                                                         */
582*495ae853SAndroid Build Coastguard Worker     WORD32 i4_ref_width;                               /*!< reference layer width in
583*495ae853SAndroid Build Coastguard Worker                                                         terms luma samples
584*495ae853SAndroid Build Coastguard Worker                                                        */
585*495ae853SAndroid Build Coastguard Worker 
586*495ae853SAndroid Build Coastguard Worker     WORD32 i4_refarray_stride;                         /*!< reference layer width in
587*495ae853SAndroid Build Coastguard Worker                                                        terms luma samples
588*495ae853SAndroid Build Coastguard Worker                                                        */
589*495ae853SAndroid Build Coastguard Worker 
590*495ae853SAndroid Build Coastguard Worker     WORD32 i4_ref_height;                              /*!< reference layer height in
591*495ae853SAndroid Build Coastguard Worker                                                        terms luma samples
592*495ae853SAndroid Build Coastguard Worker                                                         */
593*495ae853SAndroid Build Coastguard Worker     res_prms_t *ps_res_prms;                           /*!< Current resolution params
594*495ae853SAndroid Build Coastguard Worker                                                         */
595*495ae853SAndroid Build Coastguard Worker 
596*495ae853SAndroid Build Coastguard Worker     i264_interpolate_base_luma_dyadic *pf_interpolate_base_luma_dyadic;
597*495ae853SAndroid Build Coastguard Worker     i264_interpolate_intra_base *pf_interpolate_intra_base;
598*495ae853SAndroid Build Coastguard Worker 
599*495ae853SAndroid Build Coastguard Worker     /*!< Vertical interpolation
600*495ae853SAndroid Build Coastguard Worker     function for chroma
601*495ae853SAndroid Build Coastguard Worker     */
602*495ae853SAndroid Build Coastguard Worker     i264_vert_interpol_chroma_dyadic *pf_vert_chroma_interpol[3];
603*495ae853SAndroid Build Coastguard Worker 
604*495ae853SAndroid Build Coastguard Worker     /*!< Horizontal interpolation
605*495ae853SAndroid Build Coastguard Worker     function for chroma
606*495ae853SAndroid Build Coastguard Worker     */
607*495ae853SAndroid Build Coastguard Worker     i264_horz_interpol_chroma_dyadic *pf_horz_chroma_interpol[2];
608*495ae853SAndroid Build Coastguard Worker 
609*495ae853SAndroid Build Coastguard Worker } intra_sampling_ctxt_t;
610*495ae853SAndroid Build Coastguard Worker 
611*495ae853SAndroid Build Coastguard Worker WORD32 isvcd_get_ceil_log2(WORD32 i4_x);
612*495ae853SAndroid Build Coastguard Worker 
613*495ae853SAndroid Build Coastguard Worker void isvcd_2d_memset(void *pv_buf, WORD32 i4_width, WORD32 i4_ht, WORD32 i4_stride, WORD32 i4_val);
614*495ae853SAndroid Build Coastguard Worker 
615*495ae853SAndroid Build Coastguard Worker WORD32 isvcd_intra_resamp_mb(void *pv_intra_samp_ctxt, mem_element_t *ps_ref_luma,
616*495ae853SAndroid Build Coastguard Worker                              mem_element_t *ps_ref_chroma, mem_element_t *ps_ref_mb_mode_map,
617*495ae853SAndroid Build Coastguard Worker                              mem_element_t *ps_curr_luma, mem_element_t *ps_curr_chroma,
618*495ae853SAndroid Build Coastguard Worker                              mb_coord_t *ps_mb_coord);
619*495ae853SAndroid Build Coastguard Worker 
620*495ae853SAndroid Build Coastguard Worker WORD32 isvcd_intra_resamp_mb_dyadic(void *pv_intra_samp_ctxt, mem_element_t *ps_ref_luma,
621*495ae853SAndroid Build Coastguard Worker                                     mem_element_t *ps_ref_chroma, mem_element_t *ps_ref_mb_mode_map,
622*495ae853SAndroid Build Coastguard Worker                                     mem_element_t *ps_curr_luma, mem_element_t *ps_curr_chroma,
623*495ae853SAndroid Build Coastguard Worker                                     mb_coord_t *ps_mb_coord, void *ps_svc_dec);
624*495ae853SAndroid Build Coastguard Worker 
625*495ae853SAndroid Build Coastguard Worker WORD32 isvcd_populate_res_prms(void *ps_svc_dec);
626*495ae853SAndroid Build Coastguard Worker 
627*495ae853SAndroid Build Coastguard Worker void isvcd_crop_wnd_flag_res_int(void *ps_svc_dec);
628*495ae853SAndroid Build Coastguard Worker 
629*495ae853SAndroid Build Coastguard Worker WORD32 isvcd_intra_resamp_res_init(void *ps_svc_dec);
630*495ae853SAndroid Build Coastguard Worker 
631*495ae853SAndroid Build Coastguard Worker void isvcd_intra_resamp_res_init_update_flags(void *ps_svc_dec);
632*495ae853SAndroid Build Coastguard Worker 
633*495ae853SAndroid Build Coastguard Worker #endif /* _ISVCD_INTRA_RESAMPLE_H_ */
634