xref: /aosp_15_r20/external/libavc/encoder/svc/isvce_ibl_eval.h (revision 495ae853bb871d1e5a258cb02c2cc13cde8ddb9a)
1 /******************************************************************************
2  *
3  * Copyright (C) 2022 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 *******************************************************************************
23 * @file
24 *  isvce_intra_pred.h
25 *
26 * @brief
27 *  Contains function declarations for function declared in
28 *isvce_intra_pred.c
29 *
30 * @author
31 *  ittiam
32 *
33 * @remarks
34 *  None
35 *
36 *******************************************************************************
37 */
38 #ifndef _ISVCE_IBL_EVAL_H_
39 #define _ISVCE_IBL_EVAL_H_
40 
41 #include "ih264_typedefs.h"
42 #include "isvc_macros.h"
43 #include "ih264_debug.h"
44 #include "isvc_defs.h"
45 #include "isvc_structs.h"
46 #include "isvc_intra_resample.h"
47 #include "isvce_structs.h"
48 #include "isvce_structs.h"
49 
50 #define TEMP_BUF_SIZE_LUMA (REF_ARRAY_WIDTH * REF_ARRAY_WIDTH)
51 #define TEMP_BUF_SIZE_CB (REF_ARRAY_WIDTH * REF_ARRAY_WIDTH)
52 #define TEMP_BUF_SIZE_CR (DYADIC_REF_W_C * DYADIC_REF_H_C)
53 
54 #define INTERMEDIATE_BUFF_WIDTH 48
55 #define INTERMEDIATE_BUFF_HEIGHT (MB_SIZE + 4)
56 #define TEMP_INTERPOLATION_BUF_SIZE (INTERMEDIATE_BUFF_WIDTH * INTERMEDIATE_BUFF_HEIGHT)
57 
58 /* Structs */
59 typedef struct intra_pred_constants_t
60 {
61     void *pv_state;
62 } intra_pred_constants_t;
63 
64 typedef struct intra_pred_outputs_t
65 {
66     yuv_buf_props_t s_pred_buf;
67 } intra_pred_outputs_t;
68 
69 typedef struct intra_pred_variables_t
70 {
71     svc_ilp_data_t *ps_svc_ilp_data;
72 
73     coordinates_t s_mb_pos;
74 
75     UWORD8 u1_spatial_layer_id;
76 } intra_pred_variables_t;
77 
78 typedef struct svc_intra_pred_ctxt_t
79 {
80     intra_pred_constants_t s_intra_pred_constants;
81 
82     intra_pred_variables_t s_intra_pred_variables;
83 
84     intra_pred_outputs_t s_intra_pred_outputs;
85 
86 } svc_intra_pred_ctxt_t;
87 
88 extern UWORD32 isvce_get_svc_intra_pred_ctxt_size(UWORD8 u1_num_spatial_layers,
89                                                   DOUBLE d_spatial_res_ratio, UWORD32 u4_wd,
90                                                   UWORD32 u4_ht);
91 
92 extern void isvce_intra_pred_ctxt_init(isvce_codec_t *ps_codec, iv_mem_rec_t *ps_mem_rec);
93 
94 extern void isvce_update_ibl_info(svc_intra_pred_ctxt_t *ps_intra_pred_ctxt,
95                                   UWORD8 u1_num_spatial_layers, UWORD8 u1_spatial_layer_id,
96                                   UWORD16 u2_mb_type, WORD32 i4_mb_x, WORD32 i4_mb_y,
97                                   WORD8 u1_base_mode_flag);
98 
99 extern void isvce_evaluate_IBL_mode(isvce_process_ctxt_t *ps_proc);
100 
101 extern void isvce_pad_mb_mode_buf(svc_intra_pred_ctxt_t *ps_intra_pred_ctxt,
102                                   UWORD8 u1_spatial_layer_id, UWORD8 u1_num_spatial_layers,
103                                   DOUBLE d_spatial_res_ratio, UWORD32 u4_wd, UWORD32 u4_ht);
104 
105 #endif
106