1/******************************************************************************
2 *
3 * Copyright (C) 2015 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 *  ih264_trans_quant.h
24 *
25 * @brief
26 *  Contains declarations for forward and inverse transform paths for H264
27 *
28 * @author
29 *  Ittiam
30 *
31 * @remarks
32 *
33 *******************************************************************************
34 */
35
36#ifndef IH264_TRANS_QUANT_H_
37#define IH264_TRANS_QUANT_H_
38
39/*****************************************************************************/
40/* Extern Function Declarations                                              */
41/*****************************************************************************/
42
43
44typedef void ih264_resi_trans_dctrans_quant_ft(UWORD8*pu1_src,
45                                       UWORD8 *pu1_pred,
46                                       WORD16 *pi2_out,
47                                       WORD32 src_strd,
48                                       WORD32 pred_strd,
49                                       WORD32 dst_strd,
50                                       const UWORD16 *pu2_scale_mat,
51                                       const UWORD16 *pu2_thresh_mat,
52                                       UWORD32 u4_qbit,
53                                       UWORD32 u4_round_fact,
54                                       UWORD8 *pu1_nnz);
55
56typedef void ih264_idctrans_iquant_itrans_recon_ft(WORD16 *pi2_src,
57                                          UWORD8 *pu1_pred,
58                                          UWORD8 *pu1_out,
59                                          WORD32 src_strd,
60                                          WORD32 pred_strd,
61                                          WORD32 out_strd,
62                                          const UWORD16 *pu2_iscale_mat,
63                                          const UWORD16 *pu2_weigh_mat,
64                                          UWORD32 qp_div,
65                                          UWORD32 pi4_cntrl,
66                                          WORD32 *pi4_tmp);
67
68
69/*Function prototype declarations*/
70typedef void ih264_resi_trans_quant_ft(UWORD8*pu1_src,
71                                       UWORD8 *pu1_pred,
72                                       WORD16 *pi2_out,
73                                       WORD32 src_strd,
74                                       WORD32 pred_strd,
75                                       const UWORD16 *pu2_scale_mat,
76                                       const UWORD16 *pu2_thresh_mat,
77                                       UWORD32 u4_qbit,
78                                       UWORD32 u4_round_fact,
79                                       UWORD8 *pu1_nnz,
80                                       WORD16 *pi2_alt_dc_addr);
81
82typedef void ih264_luma_16x16_resi_trans_dctrans_quant_ft(UWORD8 *pu1_src,
83                                                          UWORD8 *pu1_pred,
84                                                          WORD16 *pi2_out,
85                                                          WORD32 src_strd,
86                                                          WORD32 pred_strd,
87                                                          WORD32 dst_strd,
88                                                          const UWORD16 *pu2_scale_matrix,
89                                                          const UWORD16 *pu2_threshold_matrix,
90                                                          UWORD32 u4_qbits,
91                                                          UWORD32 u4_round_factor,
92                                                          UWORD8 *pu1_nnz,
93                                                          UWORD32 u4_dc_flag);
94
95typedef void ih264_chroma_8x8_resi_trans_dctrans_quant_ft(UWORD8 *pu1_src,
96                                                          UWORD8 *pu1_pred,
97                                                          WORD16 *pi2_out,
98                                                          WORD32 src_strd,
99                                                          WORD32 pred_strd,
100                                                          WORD32 dst_strd,
101                                                          const UWORD16 *pu2_scale_matrix,
102                                                          const UWORD16 *pu2_threshold_matrix,
103                                                          UWORD32 u4_qbits,
104                                                          UWORD32 u4_round_factor,
105                                                          UWORD8 *pu1_nnz);
106
107typedef void ih264_iquant_itrans_recon_ft(WORD16 *pi2_src,
108                                          UWORD8 *pu1_pred,
109                                          UWORD8 *pu1_out,
110                                          WORD32 pred_strd,
111                                          WORD32 out_strd,
112                                          const UWORD16 *pu2_iscale_mat,
113                                          const UWORD16 *pu2_weigh_mat,
114                                          UWORD32 qp_div,
115                                          WORD16 *pi2_tmp,
116                                          WORD32 iq_start_idx,
117                                          WORD16 *pi2_dc_ld_addr);
118
119
120typedef void ih264_iquant_itrans_recon_chroma_ft(WORD16 *pi2_src,
121                                                 UWORD8 *pu1_pred,
122                                                 UWORD8 *pu1_out,
123                                                 WORD32 pred_strd,
124                                                 WORD32 out_strd,
125                                                 const UWORD16 *pu2_iscal_mat,
126                                                 const UWORD16 *pu2_weigh_mat,
127                                                 UWORD32 u4_qp_div_6,
128                                                 WORD16 *pi2_tmp,
129                                                 WORD16 *pi2_dc_src);
130
131
132typedef void ih264_luma_16x16_idctrans_iquant_itrans_recon_ft(WORD16 *pi2_src,
133                                                              UWORD8 *pu1_pred,
134                                                              UWORD8 *pu1_out,
135                                                              WORD32 src_strd,
136                                                              WORD32 pred_strd,
137                                                              WORD32 out_strd,
138                                                              const UWORD16 *pu2_iscale_mat,
139                                                              const UWORD16 *pu2_weigh_mat,
140                                                              UWORD32 qp_div,
141                                                              UWORD32 pi4_cntrl,
142                                                              UWORD32 u4_dc_trans_flag,
143                                                              WORD32 *pi4_tmp);
144
145typedef void ih264_chroma_8x8_idctrans_iquant_itrans_recon_ft(WORD16 *pi2_src,
146                                                              UWORD8 *pu1_pred,
147                                                              UWORD8 *pu1_out,
148                                                              WORD32 src_strd,
149                                                              WORD32 pred_strd,
150                                                              WORD32 out_strd,
151                                                              const UWORD16 *pu2_iscale_mat,
152                                                              const UWORD16 *pu2_weigh_mat,
153                                                              UWORD32 qp_div,
154                                                              UWORD32 pi4_cntrl,
155                                                              WORD32 *pi4_tmp);
156
157typedef void ih264_ihadamard_scaling_ft(WORD16* pi2_src,
158                                        WORD16* pi2_out,
159                                        const UWORD16 *pu2_iscal_mat,
160                                        const UWORD16 *pu2_weigh_mat,
161                                        UWORD32 u4_qp_div_6,
162                                        WORD32* pi4_tmp);
163
164typedef void ih264_hadamard_quant_ft(WORD16 *pi2_src, WORD16 *pi2_dst,
165                                    const UWORD16 *pu2_scale_matrix,
166                                    const UWORD16 *pu2_threshold_matrix, UWORD32 u4_qbits,
167                                    UWORD32 u4_round_factor,UWORD8  *pu1_nnz);
168
169ih264_resi_trans_quant_ft ih264_resi_trans_quant_4x4;
170ih264_resi_trans_quant_ft ih264_resi_trans_quant_chroma_4x4;
171ih264_resi_trans_quant_ft ih264_resi_trans_quant_8x8;
172ih264_iquant_itrans_recon_ft ih264_iquant_itrans_recon_4x4;
173ih264_iquant_itrans_recon_ft ih264_iquant_itrans_recon_8x8;
174ih264_iquant_itrans_recon_ft ih264_iquant_itrans_recon_4x4_dc;
175ih264_iquant_itrans_recon_ft ih264_iquant_itrans_recon_8x8_dc;
176ih264_iquant_itrans_recon_chroma_ft ih264_iquant_itrans_recon_chroma_4x4;
177ih264_iquant_itrans_recon_chroma_ft ih264_iquant_itrans_recon_chroma_4x4_dc;
178ih264_ihadamard_scaling_ft ih264_ihadamard_scaling_4x4;
179ih264_ihadamard_scaling_ft ih264_ihadamard_scaling_2x2_uv;
180ih264_hadamard_quant_ft ih264_hadamard_quant_4x4;
181ih264_hadamard_quant_ft ih264_hadamard_quant_2x2_uv;
182
183/*A9 Declarations*/
184ih264_resi_trans_quant_ft ih264_resi_trans_quant_4x4_a9;
185ih264_resi_trans_quant_ft ih264_resi_trans_quant_chroma_4x4_a9;
186ih264_iquant_itrans_recon_ft ih264_iquant_itrans_recon_4x4_a9;
187ih264_iquant_itrans_recon_ft ih264_iquant_itrans_recon_8x8_a9;
188ih264_iquant_itrans_recon_ft ih264_iquant_itrans_recon_4x4_dc_a9;
189ih264_iquant_itrans_recon_ft ih264_iquant_itrans_recon_8x8_dc_a9;
190ih264_iquant_itrans_recon_chroma_ft ih264_iquant_itrans_recon_chroma_4x4_a9;
191ih264_iquant_itrans_recon_chroma_ft ih264_iquant_itrans_recon_chroma_4x4_dc_a9;
192ih264_luma_16x16_resi_trans_dctrans_quant_ft ih264_luma_16x16_resi_trans_dctrans_quant_a9;
193ih264_chroma_8x8_resi_trans_dctrans_quant_ft ih264_chroma_8x8_resi_trans_dctrans_quant_a9;
194ih264_luma_16x16_idctrans_iquant_itrans_recon_ft ih264_luma_16x16_idctrans_iquant_itrans_recon_a9;
195ih264_chroma_8x8_idctrans_iquant_itrans_recon_ft ih264_chroma_8x8_idctrans_iquant_itrans_recon_a9;
196ih264_ihadamard_scaling_ft ih264_ihadamard_scaling_4x4_a9;
197ih264_ihadamard_scaling_ft ih264_ihadamard_scaling_2x2_uv_a9;
198ih264_hadamard_quant_ft ih264_hadamard_quant_4x4_a9;
199ih264_hadamard_quant_ft ih264_hadamard_quant_2x2_uv_a9;
200
201/*Av8 Declarations*/
202ih264_resi_trans_quant_ft ih264_resi_trans_quant_4x4_av8;
203ih264_resi_trans_quant_ft ih264_resi_trans_quant_chroma_4x4_av8;
204ih264_iquant_itrans_recon_ft ih264_iquant_itrans_recon_4x4_av8;
205ih264_iquant_itrans_recon_ft ih264_iquant_itrans_recon_8x8_av8;
206ih264_iquant_itrans_recon_ft ih264_iquant_itrans_recon_4x4_dc_av8;
207ih264_iquant_itrans_recon_ft ih264_iquant_itrans_recon_8x8_dc_av8;
208ih264_iquant_itrans_recon_chroma_ft ih264_iquant_itrans_recon_chroma_4x4_av8;
209ih264_iquant_itrans_recon_chroma_ft ih264_iquant_itrans_recon_chroma_4x4_dc_av8;
210ih264_ihadamard_scaling_ft ih264_ihadamard_scaling_4x4_av8;
211ih264_ihadamard_scaling_ft ih264_ihadamard_scaling_2x2_uv_av8;
212ih264_hadamard_quant_ft ih264_hadamard_quant_4x4_av8;
213ih264_hadamard_quant_ft ih264_hadamard_quant_2x2_uv_av8;
214
215/*SSSE3 Declarations*/
216ih264_iquant_itrans_recon_ft ih264_iquant_itrans_recon_4x4_ssse3;
217ih264_iquant_itrans_recon_ft ih264_iquant_itrans_recon_8x8_ssse3;
218ih264_iquant_itrans_recon_ft ih264_iquant_itrans_recon_4x4_dc_ssse3;
219ih264_iquant_itrans_recon_ft ih264_iquant_itrans_recon_8x8_dc_ssse3;
220ih264_iquant_itrans_recon_chroma_ft ih264_iquant_itrans_recon_chroma_4x4_dc_ssse3;
221ih264_ihadamard_scaling_ft ih264_ihadamard_scaling_4x4_ssse3;
222ih264_ihadamard_scaling_ft ih264_ihadamard_scaling_2x2_uv_ssse3;
223/*SSSE42 Declarations*/
224ih264_resi_trans_quant_ft ih264_resi_trans_quant_4x4_sse42;
225ih264_resi_trans_quant_ft ih264_resi_trans_quant_chroma_4x4_sse42;
226ih264_iquant_itrans_recon_ft ih264_iquant_itrans_recon_4x4_sse42;
227ih264_iquant_itrans_recon_chroma_ft ih264_iquant_itrans_recon_chroma_4x4_sse42;
228ih264_ihadamard_scaling_ft ih264_ihadamard_scaling_4x4_sse42;
229ih264_hadamard_quant_ft ih264_hadamard_quant_4x4_sse42;
230ih264_hadamard_quant_ft ih264_hadamard_quant_2x2_uv_sse42;
231
232#endif /* IH264_TRANS_QUANT_H_ */
233