1 /******************************************************************************
2 *
3 * Copyright (C) 2012 Ittiam Systems Pvt Ltd, Bangalore
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 /**
19 *******************************************************************************
20 * @file
21 *  ihevc_intra_pred.h
22 *
23 * @brief
24 *  Declarations for the fucntions defined in  ihevc_intra_pred_filters
25 *
26 * @author
27 *  Mamatha
28 *
29 *
30 * @remarks
31 *  None
32 *
33 *******************************************************************************
34 */
35 
36 #ifndef IHEVC_INTRA_PRED_H_
37 #define IHEVC_INTRA_PRED_H_
38 
39 
40 /*****************************************************************************/
41 /* Macro definitions                                                         */
42 /*****************************************************************************/
43 #define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
44 
45 #define GET_BIT(y,x) ((y) & (1 << (x)))
46 
47 /*****************************************************************************/
48 /* Function Declarations                                                     */
49 /*****************************************************************************/
50 typedef void ihevc_intra_pred_luma_planar_ft(
51                 UWORD8 *pu1_ref,
52                 WORD32 src_strd,
53                 UWORD8 *pu1_dst,
54                 WORD32 dst_strd,
55                 WORD32 nt,
56                 WORD32 mode);
57 
58 
59 
60 typedef void ihevc_intra_pred_luma_dc_ft(
61                 UWORD8 *pu1_ref,
62                 WORD32 src_strd,
63                 UWORD8 *pu1_dst,
64                 WORD32 dst_strd,
65                 WORD32 nt,
66                 WORD32 mode);
67 
68 typedef void ihevc_intra_pred_luma_horz_ft(
69                 UWORD8 *pu1_ref,
70                 WORD32 src_strd,
71                 UWORD8 *pu1_dst,
72                 WORD32 dst_strd,
73                 WORD32 nt,
74                 WORD32 mode);
75 
76 
77 typedef void ihevc_intra_pred_luma_ver_ft(
78                 UWORD8 *pu1_ref,
79                 WORD32 src_strd,
80                 UWORD8 *pu1_dst,
81                 WORD32 dst_strd,
82                 WORD32 nt,
83                 WORD32 mode);
84 
85 
86 typedef void ihevc_intra_pred_luma_mode2_ft(
87                 UWORD8 *pu1_ref,
88                 WORD32 src_strd,
89                 UWORD8 *pu1_dst,
90                 WORD32 dst_strd,
91                 WORD32 nt,
92                 WORD32 mode);
93 
94 
95 typedef void ihevc_intra_pred_luma_mode_18_34_ft(
96                 UWORD8 *pu1_ref,
97                 WORD32 src_strd,
98                 UWORD8 *pu1_dst,
99                 WORD32 dst_strd,
100                 WORD32 nt,
101                 WORD32 mode);
102 
103 
104 typedef void ihevc_intra_pred_luma_mode_3_to_9_ft(
105                 UWORD8 *pu1_ref,
106                 WORD32 src_strd,
107                 UWORD8 *pu1_dst,
108                 WORD32 dst_strd,
109                 WORD32 nt,
110                 WORD32 mode);
111 
112 
113 typedef void ihevc_intra_pred_luma_mode_11_to_17_ft(
114                 UWORD8 *pu1_ref,
115                 WORD32 src_strd,
116                 UWORD8 *pu1_dst,
117                 WORD32 dst_strd,
118                 WORD32 nt,
119                 WORD32 mode);
120 
121 
122 typedef void ihevc_intra_pred_luma_mode_19_to_25_ft(
123                 UWORD8 *pu1_ref,
124                 WORD32 src_strd,
125                 UWORD8 *pu1_dst,
126                 WORD32 dst_strd,
127                 WORD32 nt,
128                 WORD32 mode);
129 
130 
131 typedef void ihevc_intra_pred_luma_mode_27_to_33_ft(
132                 UWORD8 *pu1_ref,
133                 WORD32 src_strd,
134                 UWORD8 *pu1_dst,
135                 WORD32 dst_strd,
136                 WORD32 nt,
137                 WORD32 mode);
138 
139 typedef void ihevc_intra_pred_luma_ref_substitution_ft(UWORD8 *pu1_top_left,
140                                                        UWORD8 *pu1_top,
141                                                        UWORD8 *pu1_left,
142                                                        WORD32 src_strd,
143                                                        WORD32 nt,
144                                                        WORD32 nbr_flags,
145                                                        UWORD8 *pu1_dst,
146                                                        WORD32 dst_strd);
147 
148 
149 typedef void ihevc_intra_pred_luma_ref_subst_all_avlble_ft(UWORD8 *pu1_top_left,
150                                                            UWORD8 *pu1_top,
151                                                            UWORD8 *pu1_left,
152                                                            WORD32 src_strd,
153                                                            WORD32 nt,
154                                                            WORD32 nbr_flags,
155                                                            UWORD8 *pu1_dst,
156                                                            WORD32 dst_strd);
157 
158 typedef void ihevc_intra_pred_ref_filtering_ft(UWORD8 *pu1_src,
159                                                WORD32 nt,
160                                                UWORD8 *pu1_dst,
161                                                WORD32 mode,
162                                                WORD32 strong_intra_smoothing_enable_flag);
163 
164 typedef void ihevc_hbd_intra_pred_luma_planar_ft(
165                 UWORD16 *pu2_ref,
166                 WORD32 src_strd,
167                 UWORD16 *pu2_dst,
168                 WORD32 dst_strd,
169                 WORD32 nt,
170                 WORD32 mode,
171                 UWORD8 bit_depth);
172 
173 
174 typedef void ihevc_hbd_intra_pred_luma_dc_ft(
175                 UWORD16 *pu2_ref,
176                 WORD32 src_strd,
177                 UWORD16 *pu2_dst,
178                 WORD32 dst_strd,
179                 WORD32 nt,
180                 WORD32 mode,
181                 UWORD8 bit_depth);
182 
183 
184 typedef void ihevc_hbd_intra_pred_luma_horz_ft(
185                 UWORD16 *pu2_ref,
186                 WORD32 src_strd,
187                 UWORD16 *pu2_dst,
188                 WORD32 dst_strd,
189                 WORD32 nt,
190                 WORD32 mode,
191                 UWORD8 bit_depth);
192 
193 
194 typedef void ihevc_hbd_intra_pred_luma_ver_ft(
195                 UWORD16 *pu2_ref,
196                 WORD32 src_strd,
197                 UWORD16 *pu2_dst,
198                 WORD32 dst_strd,
199                 WORD32 nt,
200                 WORD32 mode,
201                 UWORD8 bit_depth);
202 
203 
204 typedef void ihevc_hbd_intra_pred_luma_mode2_ft(
205                 UWORD16 *pu2_ref,
206                 WORD32 src_strd,
207                 UWORD16 *pu2_dst,
208                 WORD32 dst_strd,
209                 WORD32 nt,
210                 WORD32 mode,
211                 UWORD8 bit_depth);
212 
213 
214 typedef void ihevc_hbd_intra_pred_luma_mode_18_34_ft(
215                 UWORD16 *pu2_ref,
216                 WORD32 src_strd,
217                 UWORD16 *pu2_dst,
218                 WORD32 dst_strd,
219                 WORD32 nt,
220                 WORD32 mode,
221                 UWORD8 bit_depth);
222 
223 
224 typedef void ihevc_hbd_intra_pred_luma_mode_3_to_9_ft(
225                 UWORD16 *pu2_ref,
226                 WORD32 src_strd,
227                 UWORD16 *pu2_dst,
228                 WORD32 dst_strd,
229                 WORD32 nt,
230                 WORD32 mode,
231                 UWORD8 bit_depth);
232 
233 
234 typedef void ihevc_hbd_intra_pred_luma_mode_11_to_17_ft(
235                 UWORD16 *pu2_ref,
236                 WORD32 src_strd,
237                 UWORD16 *pu2_dst,
238                 WORD32 dst_strd,
239                 WORD32 nt,
240                 WORD32 mode,
241                 UWORD8 bit_depth);
242 
243 typedef void ihevc_hbd_intra_pred_luma_mode_19_to_25_ft(
244                 UWORD16 *pu2_ref,
245                 WORD32 src_strd,
246                 UWORD16 *pu2_dst,
247                 WORD32 dst_strd,
248                 WORD32 nt,
249                 WORD32 mode,
250                 UWORD8 bit_depth);
251 
252 
253 
254 typedef void ihevc_hbd_intra_pred_luma_mode_27_to_33_ft(
255                 UWORD16 *pu2_ref,
256                 WORD32 src_strd,
257                 UWORD16 *pu2_dst,
258                 WORD32 dst_strd,
259                 WORD32 nt,
260                 WORD32 mode,
261                 UWORD8 bit_depth);
262 
263 typedef void ihevc_hbd_intra_pred_luma_ref_substitution_ft(UWORD16 *pu2_top_left,
264                                                            UWORD16 *pu2_top,
265                                                            UWORD16 *pu2_left,
266                                                            WORD32 src_strd,
267                                                            WORD32 nt,
268                                                            WORD32 nbr_flags,
269                                                            UWORD16 *pu2_dst,
270                                                            WORD32 dst_strd,
271                                                            UWORD8 bit_depth);
272 
273 
274 
275 typedef void ihevc_hbd_intra_pred_ref_filtering_ft(UWORD16 *pu2_src,
276                                                    WORD32 nt,
277                                                    UWORD16 *pu2_dst,
278                                                    WORD32 mode,
279                                                    WORD32 strong_intra_smoothing_enable_flag,
280                                                    UWORD8 bit_depth);
281 
282 /* C function declarations */
283 ihevc_intra_pred_luma_planar_ft ihevc_intra_pred_luma_planar;
284 ihevc_intra_pred_luma_dc_ft ihevc_intra_pred_luma_dc;
285 ihevc_intra_pred_luma_horz_ft ihevc_intra_pred_luma_horz;
286 ihevc_intra_pred_luma_ver_ft ihevc_intra_pred_luma_ver;
287 ihevc_intra_pred_luma_mode2_ft ihevc_intra_pred_luma_mode2;
288 ihevc_intra_pred_luma_mode_18_34_ft ihevc_intra_pred_luma_mode_18_34;
289 ihevc_intra_pred_luma_mode_3_to_9_ft ihevc_intra_pred_luma_mode_3_to_9;
290 ihevc_intra_pred_luma_mode_11_to_17_ft ihevc_intra_pred_luma_mode_11_to_17;
291 ihevc_intra_pred_luma_mode_19_to_25_ft ihevc_intra_pred_luma_mode_19_to_25;
292 ihevc_intra_pred_luma_mode_27_to_33_ft ihevc_intra_pred_luma_mode_27_to_33;
293 ihevc_intra_pred_luma_ref_substitution_ft ihevc_intra_pred_luma_ref_substitution;
294 ihevc_intra_pred_luma_ref_subst_all_avlble_ft ihevc_intra_pred_luma_ref_subst_all_avlble;
295 ihevc_intra_pred_ref_filtering_ft ihevc_intra_pred_ref_filtering;
296 
297 ihevc_hbd_intra_pred_luma_planar_ft ihevc_hbd_intra_pred_luma_planar;
298 ihevc_hbd_intra_pred_luma_dc_ft ihevc_hbd_intra_pred_luma_dc;
299 ihevc_hbd_intra_pred_luma_horz_ft ihevc_hbd_intra_pred_luma_horz;
300 ihevc_hbd_intra_pred_luma_ver_ft ihevc_hbd_intra_pred_luma_ver;
301 ihevc_hbd_intra_pred_luma_mode2_ft ihevc_hbd_intra_pred_luma_mode2;
302 ihevc_hbd_intra_pred_luma_mode_18_34_ft ihevc_hbd_intra_pred_luma_mode_18_34;
303 ihevc_hbd_intra_pred_luma_mode_3_to_9_ft ihevc_hbd_intra_pred_luma_mode_3_to_9;
304 ihevc_hbd_intra_pred_luma_mode_11_to_17_ft ihevc_hbd_intra_pred_luma_mode_11_to_17;
305 ihevc_hbd_intra_pred_luma_mode_19_to_25_ft ihevc_hbd_intra_pred_luma_mode_19_to_25;
306 ihevc_hbd_intra_pred_luma_mode_27_to_33_ft ihevc_hbd_intra_pred_luma_mode_27_to_33;
307 ihevc_hbd_intra_pred_luma_ref_substitution_ft ihevc_hbd_intra_pred_luma_ref_substitution;
308 ihevc_hbd_intra_pred_ref_filtering_ft ihevc_hbd_intra_pred_ref_filtering;
309 
310 
311 /* A9Q function declarations */
312 ihevc_intra_pred_luma_planar_ft ihevc_intra_pred_luma_planar_a9q;
313 ihevc_intra_pred_luma_dc_ft ihevc_intra_pred_luma_dc_a9q;
314 ihevc_intra_pred_luma_horz_ft ihevc_intra_pred_luma_horz_a9q;
315 ihevc_intra_pred_luma_ver_ft ihevc_intra_pred_luma_ver_a9q;
316 ihevc_intra_pred_luma_mode2_ft ihevc_intra_pred_luma_mode2_a9q;
317 ihevc_intra_pred_luma_mode_18_34_ft ihevc_intra_pred_luma_mode_18_34_a9q;
318 ihevc_intra_pred_luma_mode_3_to_9_ft ihevc_intra_pred_luma_mode_3_to_9_a9q;
319 ihevc_intra_pred_luma_mode_11_to_17_ft ihevc_intra_pred_luma_mode_11_to_17_a9q;
320 ihevc_intra_pred_luma_mode_19_to_25_ft ihevc_intra_pred_luma_mode_19_to_25_a9q;
321 ihevc_intra_pred_luma_mode_27_to_33_ft ihevc_intra_pred_luma_mode_27_to_33_a9q;
322 ihevc_intra_pred_luma_ref_substitution_ft ihevc_intra_pred_luma_ref_substitution_a9q;
323 ihevc_intra_pred_ref_filtering_ft ihevc_intra_pred_ref_filtering_a9q;
324 
325 /* A9 A function declarations */
326 ihevc_intra_pred_luma_planar_ft ihevc_intra_pred_luma_planar_a9a;
327 ihevc_intra_pred_luma_dc_ft ihevc_intra_pred_luma_dc_a9a;
328 ihevc_intra_pred_luma_horz_ft ihevc_intra_pred_luma_horz_a9a;
329 ihevc_intra_pred_luma_ver_ft ihevc_intra_pred_luma_ver_a9a;
330 ihevc_intra_pred_luma_mode2_ft ihevc_intra_pred_luma_mode2_a9a;
331 ihevc_intra_pred_luma_mode_18_34_ft ihevc_intra_pred_luma_mode_18_34_a9a;
332 ihevc_intra_pred_luma_mode_3_to_9_ft ihevc_intra_pred_luma_mode_3_to_9_a9a;
333 ihevc_intra_pred_luma_mode_11_to_17_ft ihevc_intra_pred_luma_mode_11_to_17_a9a;
334 ihevc_intra_pred_luma_mode_19_to_25_ft ihevc_intra_pred_luma_mode_19_to_25_a9a;
335 ihevc_intra_pred_luma_mode_27_to_33_ft ihevc_intra_pred_luma_mode_27_to_33_a9a;
336 ihevc_intra_pred_luma_ref_substitution_ft ihevc_intra_pred_luma_ref_substitution_a9a;
337 ihevc_intra_pred_ref_filtering_ft ihevc_intra_pred_ref_filtering_a9a;
338 
339 /* NEONINTR function declarations */
340 ihevc_intra_pred_luma_planar_ft ihevc_intra_pred_luma_planar_neonintr;
341 ihevc_intra_pred_luma_dc_ft ihevc_intra_pred_luma_dc_neonintr;
342 ihevc_intra_pred_luma_horz_ft ihevc_intra_pred_luma_horz_neonintr;
343 ihevc_intra_pred_luma_ver_ft ihevc_intra_pred_luma_ver_neonintr;
344 ihevc_intra_pred_luma_mode2_ft ihevc_intra_pred_luma_mode2_neonintr;
345 ihevc_intra_pred_luma_mode_18_34_ft ihevc_intra_pred_luma_mode_18_34_neonintr;
346 ihevc_intra_pred_luma_mode_3_to_9_ft ihevc_intra_pred_luma_mode_3_to_9_neonintr;
347 ihevc_intra_pred_luma_mode_11_to_17_ft ihevc_intra_pred_luma_mode_11_to_17_neonintr;
348 ihevc_intra_pred_luma_mode_19_to_25_ft ihevc_intra_pred_luma_mode_19_to_25_neonintr;
349 ihevc_intra_pred_luma_mode_27_to_33_ft ihevc_intra_pred_luma_mode_27_to_33_neonintr;
350 ihevc_intra_pred_luma_ref_substitution_ft ihevc_intra_pred_luma_ref_substitution_neonintr;
351 ihevc_intra_pred_ref_filtering_ft ihevc_intra_pred_ref_filtering_neonintr;
352 
353 /* SSSE31 function declarations */
354 ihevc_intra_pred_luma_planar_ft ihevc_intra_pred_luma_planar_ssse3;
355 ihevc_intra_pred_luma_dc_ft ihevc_intra_pred_luma_dc_ssse3;
356 ihevc_intra_pred_luma_horz_ft ihevc_intra_pred_luma_horz_ssse3;
357 ihevc_intra_pred_luma_ver_ft ihevc_intra_pred_luma_ver_ssse3;
358 ihevc_intra_pred_luma_mode2_ft ihevc_intra_pred_luma_mode2_ssse3;
359 ihevc_intra_pred_luma_mode_18_34_ft ihevc_intra_pred_luma_mode_18_34_ssse3;
360 ihevc_intra_pred_luma_mode_3_to_9_ft ihevc_intra_pred_luma_mode_3_to_9_ssse3;
361 ihevc_intra_pred_luma_mode_11_to_17_ft ihevc_intra_pred_luma_mode_11_to_17_ssse3;
362 ihevc_intra_pred_luma_mode_19_to_25_ft ihevc_intra_pred_luma_mode_19_to_25_ssse3;
363 ihevc_intra_pred_luma_mode_27_to_33_ft ihevc_intra_pred_luma_mode_27_to_33_ssse3;
364 ihevc_intra_pred_luma_ref_substitution_ft ihevc_intra_pred_luma_ref_substitution_ssse3;
365 ihevc_intra_pred_ref_filtering_ft ihevc_intra_pred_ref_filtering_ssse3;
366 
367 /* SSE42 function declarations */
368 ihevc_intra_pred_luma_dc_ft ihevc_intra_pred_luma_dc_sse42;
369 ihevc_intra_pred_luma_horz_ft ihevc_intra_pred_luma_horz_sse42;
370 ihevc_intra_pred_luma_ver_ft ihevc_intra_pred_luma_ver_sse42;
371 ihevc_intra_pred_luma_mode_3_to_9_ft ihevc_intra_pred_luma_mode_3_to_9_sse42;
372 ihevc_intra_pred_luma_mode_11_to_17_ft ihevc_intra_pred_luma_mode_11_to_17_sse42;
373 ihevc_intra_pred_luma_mode_19_to_25_ft ihevc_intra_pred_luma_mode_19_to_25_sse42;
374 ihevc_intra_pred_luma_mode_27_to_33_ft ihevc_intra_pred_luma_mode_27_to_33_sse42;
375 ihevc_intra_pred_ref_filtering_ft ihevc_intra_pred_ref_filtering_sse42;
376 ihevc_hbd_intra_pred_luma_planar_ft ihevc_hbd_intra_pred_luma_planar_sse42;
377 ihevc_hbd_intra_pred_luma_dc_ft ihevc_hbd_intra_pred_luma_dc_sse42;
378 ihevc_hbd_intra_pred_luma_horz_ft ihevc_hbd_intra_pred_luma_horz_sse42;
379 ihevc_hbd_intra_pred_luma_ver_ft ihevc_hbd_intra_pred_luma_ver_sse42;
380 ihevc_hbd_intra_pred_luma_mode2_ft ihevc_hbd_intra_pred_luma_mode2_sse42;
381 ihevc_hbd_intra_pred_luma_mode_18_34_ft ihevc_hbd_intra_pred_luma_mode_18_34_sse42;
382 ihevc_hbd_intra_pred_luma_mode_3_to_9_ft ihevc_hbd_intra_pred_luma_mode_3_to_9_sse42;
383 ihevc_hbd_intra_pred_luma_mode_11_to_17_ft ihevc_hbd_intra_pred_luma_mode_11_to_17_sse42;
384 ihevc_hbd_intra_pred_luma_mode_19_to_25_ft ihevc_hbd_intra_pred_luma_mode_19_to_25_sse42;
385 ihevc_hbd_intra_pred_luma_mode_27_to_33_ft ihevc_hbd_intra_pred_luma_mode_27_to_33_sse42;
386 ihevc_hbd_intra_pred_luma_ref_substitution_ft ihevc_hbd_intra_pred_luma_ref_substitution_sse42;
387 ihevc_hbd_intra_pred_ref_filtering_ft ihevc_hbd_intra_pred_ref_filtering_sse42;
388 
389 /* AVX function declaration*/
390 ihevc_intra_pred_luma_dc_ft ihevc_intra_pred_luma_dc_avx;
391 ihevc_intra_pred_luma_mode_18_34_ft ihevc_intra_pred_luma_mode_18_34_avx;
392 ihevc_intra_pred_luma_ver_ft ihevc_intra_pred_luma_ver_avx;
393 
394 ihevc_hbd_intra_pred_luma_dc_ft ihevc_hbd_intra_pred_luma_dc_avx;
395 ihevc_hbd_intra_pred_luma_mode_18_34_ft ihevc_hbd_intra_pred_luma_mode_18_34_avx;
396 ihevc_hbd_intra_pred_luma_ver_ft ihevc_hbd_intra_pred_luma_ver_avx;
397 ihevc_hbd_intra_pred_ref_filtering_ft ihevc_hbd_intra_pred_ref_filtering_avx;
398 
399 /* armv8 function declarations */
400 ihevc_intra_pred_luma_planar_ft ihevc_intra_pred_luma_planar_av8;
401 ihevc_intra_pred_luma_dc_ft ihevc_intra_pred_luma_dc_av8;
402 ihevc_intra_pred_luma_horz_ft ihevc_intra_pred_luma_horz_av8;
403 ihevc_intra_pred_luma_ver_ft ihevc_intra_pred_luma_ver_av8;
404 ihevc_intra_pred_luma_mode2_ft ihevc_intra_pred_luma_mode2_av8;
405 ihevc_intra_pred_luma_mode_18_34_ft ihevc_intra_pred_luma_mode_18_34_av8;
406 ihevc_intra_pred_luma_mode_3_to_9_ft ihevc_intra_pred_luma_mode_3_to_9_av8;
407 ihevc_intra_pred_luma_mode_11_to_17_ft ihevc_intra_pred_luma_mode_11_to_17_av8;
408 ihevc_intra_pred_luma_mode_19_to_25_ft ihevc_intra_pred_luma_mode_19_to_25_av8;
409 ihevc_intra_pred_luma_mode_27_to_33_ft ihevc_intra_pred_luma_mode_27_to_33_av8;
410 ihevc_intra_pred_luma_ref_substitution_ft ihevc_intra_pred_luma_ref_substitution_av8;
411 ihevc_intra_pred_ref_filtering_ft ihevc_intra_pred_ref_filtering_av8;
412 #endif /* IHEVC_INTRA_PRED_H_ */
413