1 /****************************************************************************** 2 * 3 * Copyright (C) 2018 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 * \file ihevce_decomp_pre_intra_pass.h 23 * 24 * \brief 25 * This file contains declarations related to frame decomposition done during 26 * pre intra processing 27 * 28 * \date 29 * 18/09/2012 30 * 31 * \author 32 * Ittiam 33 * 34 ****************************************************************************** 35 */ 36 37 #ifndef _IHEVCE_DECOMP_PRE_INTRA_PASS_H_ 38 #define _IHEVCE_DECOMP_PRE_INTRA_PASS_H_ 39 40 /*****************************************************************************/ 41 /* Typedefs */ 42 /*****************************************************************************/ 43 44 /*****************************************************************************/ 45 /* Globals */ 46 /*****************************************************************************/ 47 extern WORD32 g_i4_ip_funcs[MAX_NUM_IP_MODES]; 48 49 /*****************************************************************************/ 50 /* Extern Function Declarations */ 51 /*****************************************************************************/ 52 void ihevce_ed_4x4_find_best_modes( 53 UWORD8 *pu1_src, 54 WORD32 src_stride, 55 UWORD8 *pu1_nbr, 56 UWORD16 *pu2_mode_bits_cost, 57 UWORD8 *pu1_best_modes, 58 WORD32 *pu1_best_sad_costs, 59 WORD32 u1_low_resol, 60 FT_SAD_COMPUTER *pf_4x4_sad_computer); 61 62 WORD32 ihevce_decomp_pre_intra_get_num_mem_recs(void); 63 64 WORD32 ihevce_decomp_pre_intra_get_mem_recs( 65 iv_mem_rec_t *ps_mem_tab, WORD32 i4_num_proc_thrds, WORD32 i4_mem_space); 66 67 void *ihevce_decomp_pre_intra_init( 68 iv_mem_rec_t *ps_mem_tab, 69 ihevce_static_cfg_params_t *ps_init_prms, 70 WORD32 i4_num_proc_thrds, 71 func_selector_t *ps_func_selector, 72 WORD32 i4_resolution_id, 73 UWORD8 u1_is_popcnt_available); 74 75 void ihevce_decomp_pre_intra_process( 76 void *pv_ctxt, 77 ihevce_lap_output_params_t *ps_lap_out_prms, 78 frm_ctb_ctxt_t *ps_frm_ctb_prms, 79 void *pv_multi_thrd_ctxt, 80 WORD32 thrd_id, 81 WORD32 i4_ping_pong); 82 83 void ihevce_decomp_pre_intra_frame_init( 84 void *pv_ctxt, 85 UWORD8 **ppu1_decomp_lyr_bufs, 86 WORD32 *pi4_lyr_buf_stride, 87 ihevce_ed_blk_t *ps_layer1_buf, 88 ihevce_ed_blk_t *ps_layer2_buf, 89 ihevce_ed_ctb_l1_t *ps_ed_ctb_l1, 90 WORD32 i4_ol_sad_lambda_qf, 91 ctb_analyse_t *ps_ctb_analyse); 92 93 void ihevce_decomp_pre_intra_curr_frame_pre_intra_deinit( 94 void *pv_pre_intra_ctxt, 95 pre_enc_me_ctxt_t *ps_curr_out, 96 frm_ctb_ctxt_t *ps_frm_ctb_prms); 97 98 void ihevce_scale_by_2( 99 UWORD8 *pu1_src, 100 WORD32 src_stride, 101 UWORD8 *pu1_dst, 102 WORD32 dst_stride, 103 WORD32 wd, 104 WORD32 ht, 105 UWORD8 *pu1_wkg_mem, 106 WORD32 ht_offset, 107 WORD32 block_ht, 108 WORD32 wd_offset, 109 WORD32 block_wd, 110 FT_COPY_2D *pf_copy_2d, 111 FT_SCALING_FILTER_BY_2 *pf_scaling_filter_mxn); 112 113 void ihevce_ed_frame_init(void *pv_ed_ctxt, WORD32 i4_layer_no); 114 115 float fast_log2(float val); 116 117 WORD32 ihevce_cu_level_qp_mod( 118 WORD32 frm_qscale, 119 WORD32 cu_satd, 120 long double frm_avg_activity, 121 float f_mod_strength, 122 WORD32 *pi4_act_factor, 123 WORD32 *pi4_q_scale_mod, 124 rc_quant_t *rc_quant_ctxt); 125 126 LWORD64 ihevce_decomp_pre_intra_get_frame_satd(void *pv_ctxt, WORD32 *wd, WORD32 *ht); 127 128 LWORD64 ihevce_decomp_pre_intra_get_frame_satd_squared(void *pv_ctxt, WORD32 *wd, WORD32 *ht); 129 130 #endif 131