x86: dsputil: Only compile motion_est code when encoders are enabled
[ffmpeg.git] / libavcodec / x86 / h264_intrapred_init.c
1 /*
2  * Copyright (c) 2010 Jason Garrett-Glaser
3  *
4  * This file is part of Libav.
5  *
6  * Libav is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * Libav is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with Libav; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20
21 #include "libavutil/cpu.h"
22 #include "libavutil/x86/cpu.h"
23 #include "libavcodec/h264pred.h"
24
25 #define PRED4x4(TYPE, DEPTH, OPT) \
26 void ff_pred4x4_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, const uint8_t *topright, int stride);
27
28 PRED4x4(dc, 10, mmxext)
29 PRED4x4(down_left, 10, sse2)
30 PRED4x4(down_left, 10, avx)
31 PRED4x4(down_right, 10, sse2)
32 PRED4x4(down_right, 10, ssse3)
33 PRED4x4(down_right, 10, avx)
34 PRED4x4(vertical_left, 10, sse2)
35 PRED4x4(vertical_left, 10, avx)
36 PRED4x4(vertical_right, 10, sse2)
37 PRED4x4(vertical_right, 10, ssse3)
38 PRED4x4(vertical_right, 10, avx)
39 PRED4x4(horizontal_up, 10, mmxext)
40 PRED4x4(horizontal_down, 10, sse2)
41 PRED4x4(horizontal_down, 10, ssse3)
42 PRED4x4(horizontal_down, 10, avx)
43
44 #define PRED8x8(TYPE, DEPTH, OPT) \
45 void ff_pred8x8_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, int stride);
46
47 PRED8x8(dc, 10, mmxext)
48 PRED8x8(dc, 10, sse2)
49 PRED8x8(top_dc, 10, sse2)
50 PRED8x8(plane, 10, sse2)
51 PRED8x8(vertical, 10, sse2)
52 PRED8x8(horizontal, 10, sse2)
53
54 #define PRED8x8L(TYPE, DEPTH, OPT)\
55 void ff_pred8x8l_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, int has_topleft, int has_topright, int stride);
56
57 PRED8x8L(dc, 10, sse2)
58 PRED8x8L(dc, 10, avx)
59 PRED8x8L(128_dc, 10, mmxext)
60 PRED8x8L(128_dc, 10, sse2)
61 PRED8x8L(top_dc, 10, sse2)
62 PRED8x8L(top_dc, 10, avx)
63 PRED8x8L(vertical, 10, sse2)
64 PRED8x8L(vertical, 10, avx)
65 PRED8x8L(horizontal, 10, sse2)
66 PRED8x8L(horizontal, 10, ssse3)
67 PRED8x8L(horizontal, 10, avx)
68 PRED8x8L(down_left, 10, sse2)
69 PRED8x8L(down_left, 10, ssse3)
70 PRED8x8L(down_left, 10, avx)
71 PRED8x8L(down_right, 10, sse2)
72 PRED8x8L(down_right, 10, ssse3)
73 PRED8x8L(down_right, 10, avx)
74 PRED8x8L(vertical_right, 10, sse2)
75 PRED8x8L(vertical_right, 10, ssse3)
76 PRED8x8L(vertical_right, 10, avx)
77 PRED8x8L(horizontal_up, 10, sse2)
78 PRED8x8L(horizontal_up, 10, ssse3)
79 PRED8x8L(horizontal_up, 10, avx)
80
81 #define PRED16x16(TYPE, DEPTH, OPT)\
82 void ff_pred16x16_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, int stride);
83
84 PRED16x16(dc, 10, mmxext)
85 PRED16x16(dc, 10, sse2)
86 PRED16x16(top_dc, 10, mmxext)
87 PRED16x16(top_dc, 10, sse2)
88 PRED16x16(128_dc, 10, mmxext)
89 PRED16x16(128_dc, 10, sse2)
90 PRED16x16(left_dc, 10, mmxext)
91 PRED16x16(left_dc, 10, sse2)
92 PRED16x16(vertical, 10, mmxext)
93 PRED16x16(vertical, 10, sse2)
94 PRED16x16(horizontal, 10, mmxext)
95 PRED16x16(horizontal, 10, sse2)
96
97 void ff_pred16x16_vertical_mmx     (uint8_t *src, int stride);
98 void ff_pred16x16_vertical_sse     (uint8_t *src, int stride);
99 void ff_pred16x16_horizontal_mmx   (uint8_t *src, int stride);
100 void ff_pred16x16_horizontal_mmx2  (uint8_t *src, int stride);
101 void ff_pred16x16_horizontal_ssse3 (uint8_t *src, int stride);
102 void ff_pred16x16_dc_mmx2          (uint8_t *src, int stride);
103 void ff_pred16x16_dc_sse2          (uint8_t *src, int stride);
104 void ff_pred16x16_dc_ssse3         (uint8_t *src, int stride);
105 void ff_pred16x16_plane_h264_mmx   (uint8_t *src, int stride);
106 void ff_pred16x16_plane_h264_mmx2  (uint8_t *src, int stride);
107 void ff_pred16x16_plane_h264_sse2  (uint8_t *src, int stride);
108 void ff_pred16x16_plane_h264_ssse3 (uint8_t *src, int stride);
109 void ff_pred16x16_plane_rv40_mmx   (uint8_t *src, int stride);
110 void ff_pred16x16_plane_rv40_mmx2  (uint8_t *src, int stride);
111 void ff_pred16x16_plane_rv40_sse2  (uint8_t *src, int stride);
112 void ff_pred16x16_plane_rv40_ssse3 (uint8_t *src, int stride);
113 void ff_pred16x16_plane_svq3_mmx   (uint8_t *src, int stride);
114 void ff_pred16x16_plane_svq3_mmx2  (uint8_t *src, int stride);
115 void ff_pred16x16_plane_svq3_sse2  (uint8_t *src, int stride);
116 void ff_pred16x16_plane_svq3_ssse3 (uint8_t *src, int stride);
117 void ff_pred16x16_tm_vp8_mmx       (uint8_t *src, int stride);
118 void ff_pred16x16_tm_vp8_mmx2      (uint8_t *src, int stride);
119 void ff_pred16x16_tm_vp8_sse2      (uint8_t *src, int stride);
120 void ff_pred8x8_top_dc_mmxext      (uint8_t *src, int stride);
121 void ff_pred8x8_dc_rv40_mmxext     (uint8_t *src, int stride);
122 void ff_pred8x8_dc_mmxext          (uint8_t *src, int stride);
123 void ff_pred8x8_vertical_mmx       (uint8_t *src, int stride);
124 void ff_pred8x8_horizontal_mmx     (uint8_t *src, int stride);
125 void ff_pred8x8_horizontal_mmx2    (uint8_t *src, int stride);
126 void ff_pred8x8_horizontal_ssse3   (uint8_t *src, int stride);
127 void ff_pred8x8_plane_mmx          (uint8_t *src, int stride);
128 void ff_pred8x8_plane_mmx2         (uint8_t *src, int stride);
129 void ff_pred8x8_plane_sse2         (uint8_t *src, int stride);
130 void ff_pred8x8_plane_ssse3        (uint8_t *src, int stride);
131 void ff_pred8x8_tm_vp8_mmx         (uint8_t *src, int stride);
132 void ff_pred8x8_tm_vp8_mmx2        (uint8_t *src, int stride);
133 void ff_pred8x8_tm_vp8_sse2        (uint8_t *src, int stride);
134 void ff_pred8x8_tm_vp8_ssse3       (uint8_t *src, int stride);
135 void ff_pred8x8l_top_dc_mmxext     (uint8_t *src, int has_topleft, int has_topright, int stride);
136 void ff_pred8x8l_top_dc_ssse3      (uint8_t *src, int has_topleft, int has_topright, int stride);
137 void ff_pred8x8l_dc_mmxext         (uint8_t *src, int has_topleft, int has_topright, int stride);
138 void ff_pred8x8l_dc_ssse3          (uint8_t *src, int has_topleft, int has_topright, int stride);
139 void ff_pred8x8l_horizontal_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride);
140 void ff_pred8x8l_horizontal_ssse3  (uint8_t *src, int has_topleft, int has_topright, int stride);
141 void ff_pred8x8l_vertical_mmxext   (uint8_t *src, int has_topleft, int has_topright, int stride);
142 void ff_pred8x8l_vertical_ssse3    (uint8_t *src, int has_topleft, int has_topright, int stride);
143 void ff_pred8x8l_down_left_mmxext  (uint8_t *src, int has_topleft, int has_topright, int stride);
144 void ff_pred8x8l_down_left_sse2    (uint8_t *src, int has_topleft, int has_topright, int stride);
145 void ff_pred8x8l_down_left_ssse3   (uint8_t *src, int has_topleft, int has_topright, int stride);
146 void ff_pred8x8l_down_right_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride);
147 void ff_pred8x8l_down_right_sse2   (uint8_t *src, int has_topleft, int has_topright, int stride);
148 void ff_pred8x8l_down_right_ssse3  (uint8_t *src, int has_topleft, int has_topright, int stride);
149 void ff_pred8x8l_vertical_right_mmxext(uint8_t *src, int has_topleft, int has_topright, int stride);
150 void ff_pred8x8l_vertical_right_sse2(uint8_t *src, int has_topleft, int has_topright, int stride);
151 void ff_pred8x8l_vertical_right_ssse3(uint8_t *src, int has_topleft, int has_topright, int stride);
152 void ff_pred8x8l_vertical_left_sse2(uint8_t *src, int has_topleft, int has_topright, int stride);
153 void ff_pred8x8l_vertical_left_ssse3(uint8_t *src, int has_topleft, int has_topright, int stride);
154 void ff_pred8x8l_horizontal_up_mmxext(uint8_t *src, int has_topleft, int has_topright, int stride);
155 void ff_pred8x8l_horizontal_up_ssse3(uint8_t *src, int has_topleft, int has_topright, int stride);
156 void ff_pred8x8l_horizontal_down_mmxext(uint8_t *src, int has_topleft, int has_topright, int stride);
157 void ff_pred8x8l_horizontal_down_sse2(uint8_t *src, int has_topleft, int has_topright, int stride);
158 void ff_pred8x8l_horizontal_down_ssse3(uint8_t *src, int has_topleft, int has_topright, int stride);
159 void ff_pred4x4_dc_mmxext          (uint8_t *src, const uint8_t *topright, int stride);
160 void ff_pred4x4_down_left_mmxext   (uint8_t *src, const uint8_t *topright, int stride);
161 void ff_pred4x4_down_right_mmxext  (uint8_t *src, const uint8_t *topright, int stride);
162 void ff_pred4x4_vertical_left_mmxext(uint8_t *src, const uint8_t *topright, int stride);
163 void ff_pred4x4_vertical_right_mmxext(uint8_t *src, const uint8_t *topright, int stride);
164 void ff_pred4x4_horizontal_up_mmxext(uint8_t *src, const uint8_t *topright, int stride);
165 void ff_pred4x4_horizontal_down_mmxext(uint8_t *src, const uint8_t *topright, int stride);
166 void ff_pred4x4_tm_vp8_mmx         (uint8_t *src, const uint8_t *topright, int stride);
167 void ff_pred4x4_tm_vp8_mmx2        (uint8_t *src, const uint8_t *topright, int stride);
168 void ff_pred4x4_tm_vp8_ssse3       (uint8_t *src, const uint8_t *topright, int stride);
169 void ff_pred4x4_vertical_vp8_mmxext(uint8_t *src, const uint8_t *topright, int stride);
170
171 void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int bit_depth, const int chroma_format_idc)
172 {
173     int mm_flags = av_get_cpu_flags();
174
175     if (bit_depth == 8) {
176         if (EXTERNAL_MMX(mm_flags)) {
177             h->pred16x16[VERT_PRED8x8         ] = ff_pred16x16_vertical_mmx;
178             h->pred16x16[HOR_PRED8x8          ] = ff_pred16x16_horizontal_mmx;
179             if (chroma_format_idc == 1) {
180                 h->pred8x8  [VERT_PRED8x8     ] = ff_pred8x8_vertical_mmx;
181                 h->pred8x8  [HOR_PRED8x8      ] = ff_pred8x8_horizontal_mmx;
182             }
183             if (codec_id == AV_CODEC_ID_VP8) {
184                 h->pred16x16[PLANE_PRED8x8    ] = ff_pred16x16_tm_vp8_mmx;
185                 h->pred8x8  [PLANE_PRED8x8    ] = ff_pred8x8_tm_vp8_mmx;
186                 h->pred4x4  [TM_VP8_PRED      ] = ff_pred4x4_tm_vp8_mmx;
187             } else {
188                 if (chroma_format_idc == 1)
189                     h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_plane_mmx;
190                 if (codec_id == AV_CODEC_ID_SVQ3) {
191                     if (mm_flags & AV_CPU_FLAG_CMOV)
192                         h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_mmx;
193                 } else if (codec_id == AV_CODEC_ID_RV40) {
194                     h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_mmx;
195                 } else {
196                     h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_mmx;
197                 }
198             }
199         }
200
201         if (EXTERNAL_MMXEXT(mm_flags)) {
202             h->pred16x16[HOR_PRED8x8            ] = ff_pred16x16_horizontal_mmx2;
203             h->pred16x16[DC_PRED8x8             ] = ff_pred16x16_dc_mmx2;
204             if (chroma_format_idc == 1)
205                 h->pred8x8[HOR_PRED8x8          ] = ff_pred8x8_horizontal_mmx2;
206             h->pred8x8l [TOP_DC_PRED            ] = ff_pred8x8l_top_dc_mmxext;
207             h->pred8x8l [DC_PRED                ] = ff_pred8x8l_dc_mmxext;
208             h->pred8x8l [HOR_PRED               ] = ff_pred8x8l_horizontal_mmxext;
209             h->pred8x8l [VERT_PRED              ] = ff_pred8x8l_vertical_mmxext;
210             h->pred8x8l [DIAG_DOWN_RIGHT_PRED   ] = ff_pred8x8l_down_right_mmxext;
211             h->pred8x8l [VERT_RIGHT_PRED        ] = ff_pred8x8l_vertical_right_mmxext;
212             h->pred8x8l [HOR_UP_PRED            ] = ff_pred8x8l_horizontal_up_mmxext;
213             h->pred8x8l [DIAG_DOWN_LEFT_PRED    ] = ff_pred8x8l_down_left_mmxext;
214             h->pred8x8l [HOR_DOWN_PRED          ] = ff_pred8x8l_horizontal_down_mmxext;
215             h->pred4x4  [DIAG_DOWN_RIGHT_PRED   ] = ff_pred4x4_down_right_mmxext;
216             h->pred4x4  [VERT_RIGHT_PRED        ] = ff_pred4x4_vertical_right_mmxext;
217             h->pred4x4  [HOR_DOWN_PRED          ] = ff_pred4x4_horizontal_down_mmxext;
218             h->pred4x4  [DC_PRED                ] = ff_pred4x4_dc_mmxext;
219             if (codec_id == AV_CODEC_ID_VP8 || codec_id == AV_CODEC_ID_H264) {
220                 h->pred4x4  [DIAG_DOWN_LEFT_PRED] = ff_pred4x4_down_left_mmxext;
221             }
222             if (codec_id == AV_CODEC_ID_SVQ3 || codec_id == AV_CODEC_ID_H264) {
223                 h->pred4x4  [VERT_LEFT_PRED     ] = ff_pred4x4_vertical_left_mmxext;
224             }
225             if (codec_id != AV_CODEC_ID_RV40) {
226                 h->pred4x4  [HOR_UP_PRED        ] = ff_pred4x4_horizontal_up_mmxext;
227             }
228             if (codec_id == AV_CODEC_ID_SVQ3 || codec_id == AV_CODEC_ID_H264) {
229                 if (chroma_format_idc == 1) {
230                     h->pred8x8[TOP_DC_PRED8x8   ] = ff_pred8x8_top_dc_mmxext;
231                     h->pred8x8[DC_PRED8x8       ] = ff_pred8x8_dc_mmxext;
232                 }
233             }
234             if (codec_id == AV_CODEC_ID_VP8) {
235                 h->pred16x16[PLANE_PRED8x8      ] = ff_pred16x16_tm_vp8_mmx2;
236                 h->pred8x8  [DC_PRED8x8         ] = ff_pred8x8_dc_rv40_mmxext;
237                 h->pred8x8  [PLANE_PRED8x8      ] = ff_pred8x8_tm_vp8_mmx2;
238                 h->pred4x4  [TM_VP8_PRED        ] = ff_pred4x4_tm_vp8_mmx2;
239                 h->pred4x4  [VERT_PRED          ] = ff_pred4x4_vertical_vp8_mmxext;
240             } else {
241                 if (chroma_format_idc == 1)
242                     h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_plane_mmx2;
243                 if (codec_id == AV_CODEC_ID_SVQ3) {
244                     h->pred16x16[PLANE_PRED8x8  ] = ff_pred16x16_plane_svq3_mmx2;
245                 } else if (codec_id == AV_CODEC_ID_RV40) {
246                     h->pred16x16[PLANE_PRED8x8  ] = ff_pred16x16_plane_rv40_mmx2;
247                 } else {
248                     h->pred16x16[PLANE_PRED8x8  ] = ff_pred16x16_plane_h264_mmx2;
249                 }
250             }
251         }
252
253         if (EXTERNAL_SSE(mm_flags)) {
254             h->pred16x16[VERT_PRED8x8] = ff_pred16x16_vertical_sse;
255         }
256
257         if (EXTERNAL_SSE2(mm_flags)) {
258             h->pred16x16[DC_PRED8x8           ] = ff_pred16x16_dc_sse2;
259             h->pred8x8l [DIAG_DOWN_LEFT_PRED  ] = ff_pred8x8l_down_left_sse2;
260             h->pred8x8l [DIAG_DOWN_RIGHT_PRED ] = ff_pred8x8l_down_right_sse2;
261             h->pred8x8l [VERT_RIGHT_PRED      ] = ff_pred8x8l_vertical_right_sse2;
262             h->pred8x8l [VERT_LEFT_PRED       ] = ff_pred8x8l_vertical_left_sse2;
263             h->pred8x8l [HOR_DOWN_PRED        ] = ff_pred8x8l_horizontal_down_sse2;
264             if (codec_id == AV_CODEC_ID_VP8) {
265                 h->pred16x16[PLANE_PRED8x8    ] = ff_pred16x16_tm_vp8_sse2;
266                 h->pred8x8  [PLANE_PRED8x8    ] = ff_pred8x8_tm_vp8_sse2;
267             } else {
268                 if (chroma_format_idc == 1)
269                     h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_plane_sse2;
270                 if (codec_id == AV_CODEC_ID_SVQ3) {
271                     h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_sse2;
272                 } else if (codec_id == AV_CODEC_ID_RV40) {
273                     h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_sse2;
274                 } else {
275                     h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_sse2;
276                 }
277             }
278         }
279
280         if (EXTERNAL_SSSE3(mm_flags)) {
281             h->pred16x16[HOR_PRED8x8          ] = ff_pred16x16_horizontal_ssse3;
282             h->pred16x16[DC_PRED8x8           ] = ff_pred16x16_dc_ssse3;
283             if (chroma_format_idc == 1)
284                 h->pred8x8  [HOR_PRED8x8      ] = ff_pred8x8_horizontal_ssse3;
285             h->pred8x8l [TOP_DC_PRED          ] = ff_pred8x8l_top_dc_ssse3;
286             h->pred8x8l [DC_PRED              ] = ff_pred8x8l_dc_ssse3;
287             h->pred8x8l [HOR_PRED             ] = ff_pred8x8l_horizontal_ssse3;
288             h->pred8x8l [VERT_PRED            ] = ff_pred8x8l_vertical_ssse3;
289             h->pred8x8l [DIAG_DOWN_LEFT_PRED  ] = ff_pred8x8l_down_left_ssse3;
290             h->pred8x8l [DIAG_DOWN_RIGHT_PRED ] = ff_pred8x8l_down_right_ssse3;
291             h->pred8x8l [VERT_RIGHT_PRED      ] = ff_pred8x8l_vertical_right_ssse3;
292             h->pred8x8l [VERT_LEFT_PRED       ] = ff_pred8x8l_vertical_left_ssse3;
293             h->pred8x8l [HOR_UP_PRED          ] = ff_pred8x8l_horizontal_up_ssse3;
294             h->pred8x8l [HOR_DOWN_PRED        ] = ff_pred8x8l_horizontal_down_ssse3;
295             if (codec_id == AV_CODEC_ID_VP8) {
296                 h->pred8x8  [PLANE_PRED8x8    ] = ff_pred8x8_tm_vp8_ssse3;
297                 h->pred4x4  [TM_VP8_PRED      ] = ff_pred4x4_tm_vp8_ssse3;
298             } else {
299                 if (chroma_format_idc == 1)
300                     h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_plane_ssse3;
301                 if (codec_id == AV_CODEC_ID_SVQ3) {
302                     h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_ssse3;
303                 } else if (codec_id == AV_CODEC_ID_RV40) {
304                     h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_ssse3;
305                 } else {
306                     h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_ssse3;
307                 }
308             }
309         }
310     } else if (bit_depth == 10) {
311         if (EXTERNAL_MMXEXT(mm_flags)) {
312             h->pred4x4[DC_PRED             ] = ff_pred4x4_dc_10_mmxext;
313             h->pred4x4[HOR_UP_PRED         ] = ff_pred4x4_horizontal_up_10_mmxext;
314
315             if (chroma_format_idc == 1)
316                 h->pred8x8[DC_PRED8x8      ] = ff_pred8x8_dc_10_mmxext;
317
318             h->pred8x8l[DC_128_PRED        ] = ff_pred8x8l_128_dc_10_mmxext;
319
320             h->pred16x16[DC_PRED8x8        ] = ff_pred16x16_dc_10_mmxext;
321             h->pred16x16[TOP_DC_PRED8x8    ] = ff_pred16x16_top_dc_10_mmxext;
322             h->pred16x16[DC_128_PRED8x8    ] = ff_pred16x16_128_dc_10_mmxext;
323             h->pred16x16[LEFT_DC_PRED8x8   ] = ff_pred16x16_left_dc_10_mmxext;
324             h->pred16x16[VERT_PRED8x8      ] = ff_pred16x16_vertical_10_mmxext;
325             h->pred16x16[HOR_PRED8x8       ] = ff_pred16x16_horizontal_10_mmxext;
326         }
327         if (EXTERNAL_SSE2(mm_flags)) {
328             h->pred4x4[DIAG_DOWN_LEFT_PRED ] = ff_pred4x4_down_left_10_sse2;
329             h->pred4x4[DIAG_DOWN_RIGHT_PRED] = ff_pred4x4_down_right_10_sse2;
330             h->pred4x4[VERT_LEFT_PRED      ] = ff_pred4x4_vertical_left_10_sse2;
331             h->pred4x4[VERT_RIGHT_PRED     ] = ff_pred4x4_vertical_right_10_sse2;
332             h->pred4x4[HOR_DOWN_PRED       ] = ff_pred4x4_horizontal_down_10_sse2;
333
334             if (chroma_format_idc == 1) {
335                 h->pred8x8[DC_PRED8x8      ] = ff_pred8x8_dc_10_sse2;
336                 h->pred8x8[TOP_DC_PRED8x8  ] = ff_pred8x8_top_dc_10_sse2;
337                 h->pred8x8[PLANE_PRED8x8   ] = ff_pred8x8_plane_10_sse2;
338                 h->pred8x8[VERT_PRED8x8    ] = ff_pred8x8_vertical_10_sse2;
339                 h->pred8x8[HOR_PRED8x8     ] = ff_pred8x8_horizontal_10_sse2;
340             }
341
342             h->pred8x8l[VERT_PRED           ] = ff_pred8x8l_vertical_10_sse2;
343             h->pred8x8l[HOR_PRED            ] = ff_pred8x8l_horizontal_10_sse2;
344             h->pred8x8l[DC_PRED             ] = ff_pred8x8l_dc_10_sse2;
345             h->pred8x8l[DC_128_PRED         ] = ff_pred8x8l_128_dc_10_sse2;
346             h->pred8x8l[TOP_DC_PRED         ] = ff_pred8x8l_top_dc_10_sse2;
347             h->pred8x8l[DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_10_sse2;
348             h->pred8x8l[DIAG_DOWN_RIGHT_PRED] = ff_pred8x8l_down_right_10_sse2;
349             h->pred8x8l[VERT_RIGHT_PRED     ] = ff_pred8x8l_vertical_right_10_sse2;
350             h->pred8x8l[HOR_UP_PRED         ] = ff_pred8x8l_horizontal_up_10_sse2;
351
352             h->pred16x16[DC_PRED8x8        ] = ff_pred16x16_dc_10_sse2;
353             h->pred16x16[TOP_DC_PRED8x8    ] = ff_pred16x16_top_dc_10_sse2;
354             h->pred16x16[DC_128_PRED8x8    ] = ff_pred16x16_128_dc_10_sse2;
355             h->pred16x16[LEFT_DC_PRED8x8   ] = ff_pred16x16_left_dc_10_sse2;
356             h->pred16x16[VERT_PRED8x8      ] = ff_pred16x16_vertical_10_sse2;
357             h->pred16x16[HOR_PRED8x8       ] = ff_pred16x16_horizontal_10_sse2;
358         }
359         if (EXTERNAL_SSSE3(mm_flags)) {
360             h->pred4x4[DIAG_DOWN_RIGHT_PRED] = ff_pred4x4_down_right_10_ssse3;
361             h->pred4x4[VERT_RIGHT_PRED     ] = ff_pred4x4_vertical_right_10_ssse3;
362             h->pred4x4[HOR_DOWN_PRED       ] = ff_pred4x4_horizontal_down_10_ssse3;
363
364             h->pred8x8l[HOR_PRED            ] = ff_pred8x8l_horizontal_10_ssse3;
365             h->pred8x8l[DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_10_ssse3;
366             h->pred8x8l[DIAG_DOWN_RIGHT_PRED] = ff_pred8x8l_down_right_10_ssse3;
367             h->pred8x8l[VERT_RIGHT_PRED     ] = ff_pred8x8l_vertical_right_10_ssse3;
368             h->pred8x8l[HOR_UP_PRED         ] = ff_pred8x8l_horizontal_up_10_ssse3;
369         }
370         if (EXTERNAL_AVX(mm_flags)) {
371             h->pred4x4[DIAG_DOWN_LEFT_PRED ] = ff_pred4x4_down_left_10_avx;
372             h->pred4x4[DIAG_DOWN_RIGHT_PRED] = ff_pred4x4_down_right_10_avx;
373             h->pred4x4[VERT_LEFT_PRED      ] = ff_pred4x4_vertical_left_10_avx;
374             h->pred4x4[VERT_RIGHT_PRED     ] = ff_pred4x4_vertical_right_10_avx;
375             h->pred4x4[HOR_DOWN_PRED       ] = ff_pred4x4_horizontal_down_10_avx;
376
377             h->pred8x8l[VERT_PRED           ] = ff_pred8x8l_vertical_10_avx;
378             h->pred8x8l[HOR_PRED            ] = ff_pred8x8l_horizontal_10_avx;
379             h->pred8x8l[DC_PRED             ] = ff_pred8x8l_dc_10_avx;
380             h->pred8x8l[TOP_DC_PRED         ] = ff_pred8x8l_top_dc_10_avx;
381             h->pred8x8l[DIAG_DOWN_RIGHT_PRED] = ff_pred8x8l_down_right_10_avx;
382             h->pred8x8l[DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_10_avx;
383             h->pred8x8l[VERT_RIGHT_PRED     ] = ff_pred8x8l_vertical_right_10_avx;
384             h->pred8x8l[HOR_UP_PRED         ] = ff_pred8x8l_horizontal_up_10_avx;
385         }
386     }
387 }