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_residual_pred.h 25 * 26 * @brief 27 * Contains function declarations for function declared in 28 *isvce_residual_pred.c 29 * 30 * @author 31 * ittiam 32 * 33 * @remarks 34 * None 35 * 36 ******************************************************************************* 37 */ 38 39 #ifndef _ISVCE_RESIDUAL_PRED_H_ 40 #define _ISVCE_RESIDUAL_PRED_H_ 41 42 #include "ih264_typedefs.h" 43 #include "isvc_macros.h" 44 #include "ih264_debug.h" 45 #include "isvc_defs.h" 46 #include "isvc_structs.h" 47 #include "isvce_structs.h" 48 #include "isvce_structs.h" 49 50 /* Structs */ 51 typedef struct res_pred_constants_t 52 { 53 void *pv_state; 54 } res_pred_constants_t; 55 56 typedef struct res_pred_outputs_t 57 { 58 yuv_buf_props_t s_res_pred; 59 } res_pred_outputs_t; 60 61 typedef struct res_pred_variables_t 62 { 63 svc_ilp_data_t *ps_svc_ilp_data; 64 65 coordinates_t s_mb_pos; 66 67 UWORD8 u1_spatial_layer_id; 68 } res_pred_variables_t; 69 70 typedef struct svc_res_pred_ctxt_t 71 { 72 res_pred_constants_t s_res_pred_constants; 73 74 res_pred_variables_t s_res_pred_variables; 75 76 res_pred_outputs_t s_res_pred_outputs; 77 78 } svc_res_pred_ctxt_t; 79 80 extern UWORD32 isvce_get_svc_res_pred_ctxt_size(UWORD8 u1_num_spatial_layers, 81 DOUBLE d_spatial_res_ratio, UWORD32 u4_wd, 82 UWORD32 u4_ht); 83 84 extern void isvce_svc_res_pred_ctxt_init(isvce_codec_t *ps_codec, iv_mem_rec_t *ps_mem_rec); 85 86 extern void isvce_get_mb_residual_pred(svc_res_pred_ctxt_t *ps_res_pred_ctxt); 87 88 extern void isvce_get_mb_residual_pred_non_dyadic(svc_res_pred_ctxt_t *ps_res_pred_ctxt); 89 90 extern void isvce_residual_pred_eval(svc_res_pred_ctxt_t *ps_res_pred_ctxt, yuv_buf_props_t *ps_src, 91 yuv_buf_props_t *ps_pred, yuv_buf_props_t *ps_res, 92 UWORD32 *pu4_res_pred_sad, 93 UWORD8 *pu1_residual_prediction_flag, UWORD32 u4_winning_sad); 94 95 extern void isvce_update_res_pred_info(isvce_process_ctxt_t *ps_proc); 96 97 #endif 98