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 ******************************************************************************
23 * @file ih264e_distortion_metrics.h
24 *
25 * @brief
26 *  This file contains declarations of routines that compute distortion
27 *  between two macro/sub blocks of identical dimensions
28 *
29 * @author
30 *  Ittiam
31 *
32 * @remarks
33 *  None
34 *
35 *******************************************************************************
36 */
37 
38 #ifndef IME_DISTORTION_METRICS_H_
39 #define IME_DISTORTION_METRICS_H_
40 
41 
42 /*****************************************************************************/
43 /* Type definitions for function prototypes                                  */
44 /*****************************************************************************/
45 
46 typedef void ime_compute_sad_ft(UWORD8 *pu1_src,
47                                 UWORD8 *pu1_est,
48                                 WORD32 src_strd,
49                                 WORD32 est_strd,
50                                 WORD32 i4_max_sad,
51                                 WORD32 *pi4_mb_distortion);
52 
53 typedef void ime_compute_sad4_diamond(UWORD8 *pu1_ref,
54                                       UWORD8 *pu1_src,
55                                       WORD32 ref_strd,
56                                       WORD32 src_strd,
57                                       WORD32 *pi4_sad);
58 
59 typedef void ime_compute_sad3_diamond(UWORD8 *pu1_ref1,
60                                       UWORD8 *pu1_ref2,
61                                       UWORD8 *pu1_ref3,
62                                       UWORD8 *pu1_src,
63                                       WORD32 ref_strd,
64                                       WORD32 src_strd,
65                                       WORD32 *pi4_sad);
66 
67 typedef void ime_compute_sad2_diamond(UWORD8 *pu1_ref1,
68                                       UWORD8 *pu1_ref2,
69                                       UWORD8 *pu1_src,
70                                       WORD32 ref_strd,
71                                       WORD32 src_strd,
72                                       WORD32 *pi4_sad);
73 
74 typedef void ime_sub_pel_compute_sad_16x16_ft(UWORD8 *pu1_src,
75                                               UWORD8 *pu1_ref_half_x,
76                                               UWORD8 *pu1_ref_half_y,
77                                               UWORD8 *pu1_ref_half_xy,
78                                               WORD32 src_strd,
79                                               WORD32 ref_strd,
80                                               WORD32 *pi4_sad);
81 
82 typedef void ime_compute_sad_stat(UWORD8 *pu1_src,
83                                   UWORD8 *pu1_est,
84                                   WORD32 src_strd,
85                                   WORD32 est_strd,
86                                   UWORD16 *pu2_thrsh,
87                                   WORD32 *pi4_mb_distortion,
88                                   UWORD32 *pu4_is_zero);
89 
90 typedef void ime_compute_satqd_16x16_lumainter_ft(UWORD8 *pu1_src,
91                                          UWORD8 *pu1_est,
92                                          WORD32 src_strd,
93                                          WORD32 est_strd,
94                                          UWORD16 *pu2_thrsh,
95                                          WORD32 *pi4_mb_distortion,
96                                          UWORD32 *pu4_is_zero);
97 
98 typedef void ime_compute_satqd_8x16_chroma_ft(UWORD8 *pu1_src,
99                                      UWORD8 *pu1_est,
100                                      WORD32 src_strd,
101                                      WORD32 est_strd,
102                                      WORD32 i4_max_sad,
103                                      UWORD16 *thrsh);
104 
105 typedef void ime_compute_satqd_16x16_lumaintra_ft(UWORD8 *pu1_src,
106                                          UWORD8 *pu1_est,
107                                          WORD32 src_strd,
108                                          WORD32 est_strd,
109                                          WORD32 i4_max_sad,
110                                          UWORD16 *thrsh,
111                                          WORD32 *pi4_mb_distortion,
112                                          UWORD8 *sig_nz_sad);
113 
114 /*****************************************************************************/
115 /* Extern Function Declarations                                              */
116 /*****************************************************************************/
117 
118 ime_compute_sad_ft ime_compute_sad_16x16;
119 ime_compute_sad_ft ime_compute_sad_16x16_fast;
120 ime_compute_sad_ft ime_compute_sad_16x8;
121 ime_compute_sad_ft ime_compute_sad_16x16_ea8;
122 ime_compute_sad_ft ime_compute_sad_8x8;
123 ime_compute_sad_ft ime_compute_sad_4x4;
124 ime_compute_sad4_diamond ime_calculate_sad4_prog;
125 ime_compute_sad3_diamond ime_calculate_sad3_prog;
126 ime_compute_sad2_diamond ime_calculate_sad2_prog;
127 ime_sub_pel_compute_sad_16x16_ft ime_sub_pel_compute_sad_16x16;
128 ime_compute_sad_stat ime_compute_16x16_sad_stat;
129 ime_compute_satqd_16x16_lumainter_ft ime_compute_satqd_16x16_lumainter;
130 ime_compute_satqd_8x16_chroma_ft ime_compute_satqd_8x16_chroma;
131 ime_compute_satqd_16x16_lumaintra_ft ime_compute_satqd_16x16_lumaintra;
132 
133 
134 /*SSE4.2 Declarations*/
135 ime_compute_sad_ft ime_compute_sad_16x16_sse42;
136 ime_compute_sad_ft ime_compute_sad_16x16_fast_sse42;
137 ime_compute_sad_ft ime_compute_sad_16x8_sse42;
138 ime_compute_sad_ft ime_compute_sad_16x16_ea8_sse42;
139 ime_sub_pel_compute_sad_16x16_ft ime_sub_pel_compute_sad_16x16_sse42;
140 ime_compute_sad4_diamond ime_calculate_sad4_prog_sse42;
141 ime_compute_satqd_16x16_lumainter_ft ime_compute_satqd_16x16_lumainter_sse42;
142 
143 /* assembly */
144 ime_compute_sad_ft ime_compute_sad_16x16_a9q;
145 ime_compute_sad_ft ime_compute_sad_16x16_fast_a9q;
146 ime_compute_sad_ft ime_compute_sad_16x8_a9q;
147 ime_compute_sad_ft ime_compute_sad_16x16_ea8_a9q;
148 ime_compute_sad4_diamond ime_calculate_sad4_prog_a9q;
149 ime_compute_sad3_diamond ime_calculate_sad3_prog_a9q;
150 ime_compute_sad2_diamond ime_calculate_sad2_prog_a9q;
151 ime_sub_pel_compute_sad_16x16_ft ime_sub_pel_compute_sad_16x16_a9q;
152 ime_compute_sad_stat ime_compute_16x16_sad_stat_a9;
153 ime_compute_satqd_16x16_lumainter_ft ime_compute_satqd_16x16_lumainter_a9q;
154 
155 
156 /* assembly - AV8 declarations */
157 ime_compute_sad_ft ime_compute_sad_16x16_av8;
158 ime_compute_sad_ft ime_compute_sad_16x16_fast_av8;
159 ime_compute_sad_ft ime_compute_sad_16x8_av8;
160 ime_compute_sad_ft ime_compute_sad_16x16_ea8_av8;
161 ime_compute_sad4_diamond ime_calculate_sad4_prog_av8;
162 ime_compute_sad3_diamond ime_calculate_sad3_prog_av8;
163 ime_compute_sad2_diamond ime_calculate_sad2_prog_av8;
164 ime_sub_pel_compute_sad_16x16_ft ime_sub_pel_compute_sad_16x16_av8;
165 ime_compute_sad_stat ime_compute_16x16_sad_stat_av8;
166 ime_compute_satqd_16x16_lumainter_ft ime_compute_satqd_16x16_lumainter_av8;
167 
168 #endif /* IME_DISTORTION_METRICS_H_ */
169 
170 
171