Home | History | Annotate | Download | only in common
      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
     23 *  ihevc_quant_iquant_ssd.h
     24 *
     25 * @brief
     26 *  Functions declarations for quantization, followed by Inverse
     27 *  quantization to find transform domain SSD
     28 *
     29 * @author
     30 *  Ittiam
     31 *
     32 * @remarks
     33 *  None
     34 *
     35 *******************************************************************************
     36 */
     37 
     38 
     39 #ifndef _IHEVC_QUANT_IQUANT_SSD_H_
     40 #define _IHEVC_QUANT_IQUANT_SSD_H_
     41 
     42 typedef WORD32 ihevc_quant_iquant_ssd_ft
     43     (
     44     WORD16 *pi2_coeffs,
     45     WORD16 *pi2_quant_coeff,
     46     WORD16 *pi2_q_dst,
     47     WORD16 *pi2_iq_dst,
     48     WORD32  trans_size,
     49     WORD32 qp_div,/* qpscaled / 6 */
     50     WORD32 qp_rem,/* qpscaled % 6 */
     51     WORD32 q_add,
     52     WORD32 *pi4_quant_round_factor_0_1,
     53     WORD32 *pi4_quant_round_factor_1_2,
     54     WORD32 src_strd,
     55     WORD32 dst_q_strd,
     56     WORD32 dst_iq_strd,
     57     UWORD8 *csbf,
     58     WORD32 csbf_strd,
     59     WORD32 *zero_col,
     60     WORD32 *zero_row,
     61     WORD16 *pi2_dequant_coeff,
     62     LWORD64 *pi8_cost
     63     );
     64 
     65 typedef ihevc_quant_iquant_ssd_ft ihevc_quant_iquant_ssd_rdoq_ft;
     66 
     67 typedef ihevc_quant_iquant_ssd_ft ihevc_quant_iquant_ssd_flat_scale_mat_ft;
     68 
     69 typedef ihevc_quant_iquant_ssd_ft ihevc_quant_iquant_ssd_flat_scale_mat_rdoq_ft;
     70 
     71 typedef ihevc_quant_iquant_ssd_ft ihevc_q_iq_ssd_flat_scale_mat_var_rnd_fact_ft;
     72 
     73 typedef ihevc_quant_iquant_ssd_ft ihevc_q_iq_ssd_var_rnd_fact_ft;
     74 
     75 typedef WORD32 ihevc_hbd_quant_iquant_ssd_ft
     76     (
     77     WORD16 *pi2_coeffs,
     78     WORD16 *pi2_quant_coeff,
     79     WORD16 *pi2_q_dst,
     80     WORD16 *pi2_iq_dst,
     81     WORD32  trans_size,
     82     WORD32 qp_div,/* qpscaled / 6 */
     83     WORD32 qp_rem,/* qpscaled % 6 */
     84     WORD32 q_add,
     85     WORD32 *pi4_quant_round_factor_0_1,
     86     WORD32 *pi4_quant_round_factor_1_2,
     87     WORD32 src_strd,
     88     WORD32 dst_q_strd,
     89     WORD32 dst_iq_strd,
     90     UWORD8 *csbf,
     91     WORD32 csbf_strd,
     92     WORD32 *zero_col,
     93     WORD32 *zero_row,
     94     WORD16 *pi2_dequant_coeff,
     95     LWORD64 *pi8_cost,
     96     WORD32 i4_bit_depth
     97     );
     98 
     99 
    100 typedef ihevc_hbd_quant_iquant_ssd_ft ihevc_hbd_quant_iquant_ssd_rdoq_ft;
    101 
    102 typedef ihevc_hbd_quant_iquant_ssd_ft ihevc_hbd_quant_iquant_ssd_flat_scale_mat_ft;
    103 
    104 typedef ihevc_hbd_quant_iquant_ssd_ft ihevc_hbd_quant_iquant_ssd_flat_scale_mat_rdoq_ft;
    105 
    106 typedef ihevc_hbd_quant_iquant_ssd_ft ihevc_hbd_q_iq_ssd_flat_scale_mat_var_rnd_fact_ft;
    107 
    108 typedef ihevc_hbd_quant_iquant_ssd_ft ihevc_hbd_q_iq_ssd_var_rnd_fact_ft;
    109 
    110 /* C function declarations */
    111 ihevc_quant_iquant_ssd_ft ihevc_quant_iquant_ssd;
    112 ihevc_quant_iquant_ssd_rdoq_ft ihevc_quant_iquant_ssd_rdoq;
    113 ihevc_quant_iquant_ssd_flat_scale_mat_ft ihevc_quant_iquant_ssd_flat_scale_mat;
    114 ihevc_quant_iquant_ssd_flat_scale_mat_rdoq_ft ihevc_quant_iquant_ssd_flat_scale_mat_rdoq;
    115 ihevc_q_iq_ssd_var_rnd_fact_ft ihevc_q_iq_ssd_var_rnd_fact;
    116 ihevc_q_iq_ssd_flat_scale_mat_var_rnd_fact_ft ihevc_q_iq_ssd_flat_scale_mat_var_rnd_fact;
    117 
    118 ihevc_hbd_quant_iquant_ssd_ft ihevc_hbd_quant_iquant_ssd;
    119 ihevc_hbd_quant_iquant_ssd_rdoq_ft ihevc_hbd_quant_iquant_ssd_rdoq;
    120 ihevc_hbd_quant_iquant_ssd_flat_scale_mat_ft ihevc_hbd_quant_iquant_ssd_flat_scale_mat;
    121 ihevc_hbd_quant_iquant_ssd_flat_scale_mat_rdoq_ft ihevc_hbd_quant_iquant_ssd_flat_scale_mat_rdoq;
    122 ihevc_hbd_q_iq_ssd_var_rnd_fact_ft ihevc_hbd_q_iq_ssd_var_rnd_fact;
    123 ihevc_hbd_q_iq_ssd_flat_scale_mat_var_rnd_fact_ft ihevc_hbd_q_iq_ssd_flat_scale_mat_var_rnd_fact;
    124 
    125 ihevc_quant_iquant_ssd_ft ihevc_quant_iquant;
    126 ihevc_quant_iquant_ssd_rdoq_ft ihevc_quant_iquant_rdoq;
    127 ihevc_quant_iquant_ssd_flat_scale_mat_ft ihevc_quant_iquant_flat_scale_mat;
    128 ihevc_quant_iquant_ssd_flat_scale_mat_rdoq_ft ihevc_quant_iquant_flat_scale_mat_rdoq;
    129 ihevc_q_iq_ssd_var_rnd_fact_ft ihevc_q_iq_var_rnd_fact;
    130 ihevc_q_iq_ssd_flat_scale_mat_var_rnd_fact_ft ihevc_q_iq_flat_scale_mat_var_rnd_fact;
    131 
    132 ihevc_hbd_quant_iquant_ssd_ft ihevc_hbd_quant_iquant;
    133 ihevc_hbd_quant_iquant_ssd_rdoq_ft ihevc_hbd_quant_iquant_rdoq;
    134 ihevc_hbd_quant_iquant_ssd_flat_scale_mat_ft ihevc_hbd_quant_iquant_flat_scale_mat;
    135 ihevc_hbd_quant_iquant_ssd_flat_scale_mat_rdoq_ft ihevc_hbd_quant_iquant_flat_scale_mat_rdoq;
    136 ihevc_hbd_q_iq_ssd_var_rnd_fact_ft ihevc_hbd_q_iq_var_rnd_fact;
    137 ihevc_hbd_q_iq_ssd_flat_scale_mat_var_rnd_fact_ft ihevc_hbd_q_iq_flat_scale_mat_var_rnd_fact;
    138 
    139 /* SSE42 function declarations */
    140 ihevc_quant_iquant_ssd_flat_scale_mat_ft ihevc_quant_iquant_ssd_flat_scale_mat_sse42;
    141 ihevc_quant_iquant_ssd_flat_scale_mat_rdoq_ft ihevc_quant_iquant_ssd_flat_scale_mat_rdoq_sse42;
    142 ihevc_q_iq_ssd_flat_scale_mat_var_rnd_fact_ft ihevc_q_iq_ssd_flat_scale_mat_var_rnd_fact_sse42;
    143 
    144 ihevc_quant_iquant_ssd_flat_scale_mat_ft ihevc_quant_iquant_flat_scale_mat_sse42;
    145 ihevc_quant_iquant_ssd_flat_scale_mat_rdoq_ft ihevc_quant_iquant_flat_scale_mat_rdoq_sse42;
    146 ihevc_q_iq_ssd_flat_scale_mat_var_rnd_fact_ft ihevc_q_iq_flat_scale_mat_var_rnd_fact_sse42;
    147 
    148 ihevc_hbd_quant_iquant_ssd_flat_scale_mat_ft ihevc_hbd_quant_iquant_ssd_flat_scale_mat_sse42;
    149 ihevc_hbd_quant_iquant_ssd_flat_scale_mat_rdoq_ft ihevc_hbd_quant_iquant_ssd_flat_scale_mat_rdoq_sse42;
    150 ihevc_hbd_q_iq_ssd_flat_scale_mat_var_rnd_fact_ft ihevc_hbd_q_iq_ssd_flat_scale_mat_var_rnd_fact_sse42;
    151 
    152 ihevc_hbd_quant_iquant_ssd_flat_scale_mat_ft ihevc_hbd_quant_iquant_flat_scale_mat_sse42;
    153 ihevc_hbd_quant_iquant_ssd_flat_scale_mat_rdoq_ft ihevc_hbd_quant_iquant_flat_scale_mat_rdoq_sse42;
    154 ihevc_hbd_q_iq_ssd_flat_scale_mat_var_rnd_fact_ft ihevc_hbd_q_iq_flat_scale_mat_var_rnd_fact_sse42;
    155 
    156 /* AVX function declarations */
    157 ihevc_quant_iquant_ssd_flat_scale_mat_ft ihevc_quant_iquant_ssd_flat_scale_mat_avx;
    158 ihevc_quant_iquant_ssd_flat_scale_mat_rdoq_ft ihevc_quant_iquant_ssd_flat_scale_mat_rdoq_avx;
    159 ihevc_q_iq_ssd_flat_scale_mat_var_rnd_fact_ft ihevc_q_iq_ssd_flat_scale_mat_var_rnd_fact_avx;
    160 ihevc_quant_iquant_ssd_flat_scale_mat_ft ihevc_quant_iquant_flat_scale_mat_avx;
    161 ihevc_quant_iquant_ssd_flat_scale_mat_rdoq_ft ihevc_quant_iquant_flat_scale_mat_rdoq_avx;
    162 ihevc_q_iq_ssd_flat_scale_mat_var_rnd_fact_ft ihevc_q_iq_flat_scale_mat_var_rnd_fact_avx;
    163 
    164 ihevc_hbd_quant_iquant_ssd_flat_scale_mat_ft ihevc_hbd_quant_iquant_ssd_flat_scale_mat_avx;
    165 ihevc_hbd_quant_iquant_ssd_flat_scale_mat_rdoq_ft ihevc_hbd_quant_iquant_ssd_flat_scale_mat_rdoq_avx;
    166 ihevc_hbd_q_iq_ssd_flat_scale_mat_var_rnd_fact_ft ihevc_hbd_q_iq_ssd_flat_scale_mat_var_rnd_fact_avx;
    167 
    168 ihevc_hbd_quant_iquant_ssd_flat_scale_mat_ft ihevc_hbd_quant_iquant_flat_scale_mat_avx;
    169 ihevc_hbd_quant_iquant_ssd_flat_scale_mat_rdoq_ft ihevc_hbd_quant_iquant_flat_scale_mat_rdoq_avx;
    170 ihevc_hbd_q_iq_ssd_flat_scale_mat_var_rnd_fact_ft ihevc_hbd_q_iq_flat_scale_mat_var_rnd_fact_avx;
    171 
    172 #ifndef DISABLE_AVX2
    173 /* AVX2 function declarations */
    174 ihevc_quant_iquant_ssd_flat_scale_mat_ft ihevc_quant_iquant_ssd_flat_scale_mat_avx2;
    175 ihevc_quant_iquant_ssd_flat_scale_mat_rdoq_ft ihevc_quant_iquant_ssd_flat_scale_mat_rdoq_avx2;
    176 
    177 ihevc_quant_iquant_ssd_flat_scale_mat_ft ihevc_quant_iquant_flat_scale_mat_avx2;
    178 ihevc_quant_iquant_ssd_flat_scale_mat_rdoq_ft ihevc_quant_iquant_flat_scale_mat_rdoq_avx2;
    179 
    180 ihevc_hbd_quant_iquant_ssd_flat_scale_mat_ft ihevc_hbd_quant_iquant_ssd_flat_scale_mat_avx2;
    181 #endif
    182 
    183 /* Neon function declarations */
    184 ihevc_quant_iquant_ssd_flat_scale_mat_ft ihevc_quant_iquant_ssd_flat_scale_mat_neon;
    185 ihevc_q_iq_ssd_flat_scale_mat_var_rnd_fact_ft ihevc_q_iq_ssd_flat_scale_mat_var_rnd_fact_neon;
    186 
    187 #endif /*_IHEVC_QUANT_IQUANT_SSD_H_*/
    188