cdf7d55d96ea56b17b3c7907cf3a0ae9a0011e11
[ffmpeg.git] / libavcodec / x86 / h264_intrapred_init.c
1 /*
2  * Copyright (c) 2010 Jason Garrett-Glaser
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg 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  * FFmpeg 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 FFmpeg; 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 "libavcodec/h264pred.h"
23
24 #define PRED4x4(TYPE, DEPTH, OPT) \
25 void ff_pred4x4_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, const uint8_t *topright, int stride);
26
27 PRED4x4(dc, 10, mmxext)
28 PRED4x4(down_left, 10, sse2)
29 PRED4x4(down_left, 10, avx)
30 PRED4x4(down_right, 10, sse2)
31 PRED4x4(down_right, 10, ssse3)
32 PRED4x4(down_right, 10, avx)
33 PRED4x4(vertical_left, 10, sse2)
34 PRED4x4(vertical_left, 10, avx)
35 PRED4x4(vertical_right, 10, sse2)
36 PRED4x4(vertical_right, 10, ssse3)
37 PRED4x4(vertical_right, 10, avx)
38 PRED4x4(horizontal_up, 10, mmxext)
39 PRED4x4(horizontal_down, 10, sse2)
40 PRED4x4(horizontal_down, 10, ssse3)
41 PRED4x4(horizontal_down, 10, avx)
42
43 #define PRED8x8(TYPE, DEPTH, OPT) \
44 void ff_pred8x8_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, int stride);
45
46 PRED8x8(dc, 10, mmxext)
47 PRED8x8(dc, 10, sse2)
48 PRED8x8(top_dc, 10, sse2)
49 PRED8x8(plane, 10, sse2)
50 PRED8x8(vertical, 10, sse2)
51 PRED8x8(horizontal, 10, sse2)
52
53 #define PRED8x8L(TYPE, DEPTH, OPT)\
54 void ff_pred8x8l_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, int has_topleft, int has_topright, int stride);
55
56 PRED8x8L(dc, 10, sse2)
57 PRED8x8L(dc, 10, avx)
58 PRED8x8L(128_dc, 10, mmxext)
59 PRED8x8L(128_dc, 10, sse2)
60 PRED8x8L(top_dc, 10, sse2)
61 PRED8x8L(top_dc, 10, avx)
62 PRED8x8L(vertical, 10, sse2)
63 PRED8x8L(vertical, 10, avx)
64 PRED8x8L(horizontal, 10, sse2)
65 PRED8x8L(horizontal, 10, ssse3)
66 PRED8x8L(horizontal, 10, avx)
67 PRED8x8L(down_left, 10, sse2)
68 PRED8x8L(down_left, 10, ssse3)
69 PRED8x8L(down_left, 10, avx)
70 PRED8x8L(down_right, 10, sse2)
71 PRED8x8L(down_right, 10, ssse3)
72 PRED8x8L(down_right, 10, avx)
73 PRED8x8L(vertical_right, 10, sse2)
74 PRED8x8L(vertical_right, 10, ssse3)
75 PRED8x8L(vertical_right, 10, avx)
76 PRED8x8L(horizontal_up, 10, sse2)
77 PRED8x8L(horizontal_up, 10, ssse3)
78 PRED8x8L(horizontal_up, 10, avx)
79
80 #define PRED16x16(TYPE, DEPTH, OPT)\
81 void ff_pred16x16_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, int stride);
82
83 PRED16x16(dc, 10, mmxext)
84 PRED16x16(dc, 10, sse2)
85 PRED16x16(top_dc, 10, mmxext)
86 PRED16x16(top_dc, 10, sse2)
87 PRED16x16(128_dc, 10, mmxext)
88 PRED16x16(128_dc, 10, sse2)
89 PRED16x16(left_dc, 10, mmxext)
90 PRED16x16(left_dc, 10, sse2)
91 PRED16x16(vertical, 10, mmxext)
92 PRED16x16(vertical, 10, sse2)
93 PRED16x16(horizontal, 10, mmxext)
94 PRED16x16(horizontal, 10, sse2)
95
96 void ff_pred16x16_vertical_mmx     (uint8_t *src, int stride);
97 void ff_pred16x16_vertical_sse     (uint8_t *src, int stride);
98 void ff_pred16x16_horizontal_mmx   (uint8_t *src, int stride);
99 void ff_pred16x16_horizontal_mmxext(uint8_t *src, int stride);
100 void ff_pred16x16_horizontal_ssse3 (uint8_t *src, int stride);
101 void ff_pred16x16_dc_mmxext        (uint8_t *src, int stride);
102 void ff_pred16x16_dc_sse2          (uint8_t *src, int stride);
103 void ff_pred16x16_dc_ssse3         (uint8_t *src, int stride);
104 void ff_pred16x16_plane_h264_mmx   (uint8_t *src, int stride);
105 void ff_pred16x16_plane_h264_mmx2  (uint8_t *src, int stride);
106 void ff_pred16x16_plane_h264_sse2  (uint8_t *src, int stride);
107 void ff_pred16x16_plane_h264_ssse3 (uint8_t *src, int stride);
108 void ff_pred16x16_plane_rv40_mmx   (uint8_t *src, int stride);
109 void ff_pred16x16_plane_rv40_mmx2  (uint8_t *src, int stride);
110 void ff_pred16x16_plane_rv40_sse2  (uint8_t *src, int stride);
111 void ff_pred16x16_plane_rv40_ssse3 (uint8_t *src, int stride);
112 void ff_pred16x16_plane_svq3_mmx   (uint8_t *src, int stride);
113 void ff_pred16x16_plane_svq3_mmx2  (uint8_t *src, int stride);
114 void ff_pred16x16_plane_svq3_sse2  (uint8_t *src, int stride);
115 void ff_pred16x16_plane_svq3_ssse3 (uint8_t *src, int stride);
116 void ff_pred16x16_tm_vp8_mmx       (uint8_t *src, int stride);
117 void ff_pred16x16_tm_vp8_mmxext    (uint8_t *src, int stride);
118 void ff_pred16x16_tm_vp8_sse2      (uint8_t *src, int stride);
119 void ff_pred8x8_top_dc_mmxext      (uint8_t *src, int stride);
120 void ff_pred8x8_dc_rv40_mmxext     (uint8_t *src, int stride);
121 void ff_pred8x8_dc_mmxext          (uint8_t *src, int stride);
122 void ff_pred8x8_vertical_mmx       (uint8_t *src, int stride);
123 void ff_pred8x8_horizontal_mmx     (uint8_t *src, int stride);
124 void ff_pred8x8_horizontal_mmxext  (uint8_t *src, int stride);
125 void ff_pred8x8_horizontal_ssse3   (uint8_t *src, int stride);
126 void ff_pred8x8_plane_mmx          (uint8_t *src, int stride);
127 void ff_pred8x8_plane_mmx2         (uint8_t *src, int stride);
128 void ff_pred8x8_plane_sse2         (uint8_t *src, int stride);
129 void ff_pred8x8_plane_ssse3        (uint8_t *src, int stride);
130 void ff_pred8x8_tm_vp8_mmx         (uint8_t *src, int stride);
131 void ff_pred8x8_tm_vp8_mmxext      (uint8_t *src, int stride);
132 void ff_pred8x8_tm_vp8_sse2        (uint8_t *src, int stride);
133 void ff_pred8x8_tm_vp8_ssse3       (uint8_t *src, int stride);
134 void ff_pred8x8l_top_dc_mmxext     (uint8_t *src, int has_topleft, int has_topright, int stride);
135 void ff_pred8x8l_top_dc_ssse3      (uint8_t *src, int has_topleft, int has_topright, int stride);
136 void ff_pred8x8l_dc_mmxext         (uint8_t *src, int has_topleft, int has_topright, int stride);
137 void ff_pred8x8l_dc_ssse3          (uint8_t *src, int has_topleft, int has_topright, int stride);
138 void ff_pred8x8l_horizontal_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride);
139 void ff_pred8x8l_horizontal_ssse3  (uint8_t *src, int has_topleft, int has_topright, int stride);
140 void ff_pred8x8l_vertical_mmxext   (uint8_t *src, int has_topleft, int has_topright, int stride);
141 void ff_pred8x8l_vertical_ssse3    (uint8_t *src, int has_topleft, int has_topright, int stride);
142 void ff_pred8x8l_down_left_mmxext  (uint8_t *src, int has_topleft, int has_topright, int stride);
143 void ff_pred8x8l_down_left_sse2    (uint8_t *src, int has_topleft, int has_topright, int stride);
144 void ff_pred8x8l_down_left_ssse3   (uint8_t *src, int has_topleft, int has_topright, int stride);
145 void ff_pred8x8l_down_right_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride);
146 void ff_pred8x8l_down_right_sse2   (uint8_t *src, int has_topleft, int has_topright, int stride);
147 void ff_pred8x8l_down_right_ssse3  (uint8_t *src, int has_topleft, int has_topright, int stride);
148 void ff_pred8x8l_vertical_right_mmxext(uint8_t *src, int has_topleft, int has_topright, int stride);
149 void ff_pred8x8l_vertical_right_sse2(uint8_t *src, int has_topleft, int has_topright, int stride);
150 void ff_pred8x8l_vertical_right_ssse3(uint8_t *src, int has_topleft, int has_topright, int stride);
151 void ff_pred8x8l_vertical_left_sse2(uint8_t *src, int has_topleft, int has_topright, int stride);
152 void ff_pred8x8l_vertical_left_ssse3(uint8_t *src, int has_topleft, int has_topright, int stride);
153 void ff_pred8x8l_horizontal_up_mmxext(uint8_t *src, int has_topleft, int has_topright, int stride);
154 void ff_pred8x8l_horizontal_up_ssse3(uint8_t *src, int has_topleft, int has_topright, int stride);
155 void ff_pred8x8l_horizontal_down_mmxext(uint8_t *src, int has_topleft, int has_topright, int stride);
156 void ff_pred8x8l_horizontal_down_sse2(uint8_t *src, int has_topleft, int has_topright, int stride);
157 void ff_pred8x8l_horizontal_down_ssse3(uint8_t *src, int has_topleft, int has_topright, int stride);
158 void ff_pred4x4_dc_mmxext          (uint8_t *src, const uint8_t *topright, int stride);
159 void ff_pred4x4_down_left_mmxext   (uint8_t *src, const uint8_t *topright, int stride);
160 void ff_pred4x4_down_right_mmxext  (uint8_t *src, const uint8_t *topright, int stride);
161 void ff_pred4x4_vertical_left_mmxext(uint8_t *src, const uint8_t *topright, int stride);
162 void ff_pred4x4_vertical_right_mmxext(uint8_t *src, const uint8_t *topright, int stride);
163 void ff_pred4x4_horizontal_up_mmxext(uint8_t *src, const uint8_t *topright, int stride);
164 void ff_pred4x4_horizontal_down_mmxext(uint8_t *src, const uint8_t *topright, int stride);
165 void ff_pred4x4_tm_vp8_mmx         (uint8_t *src, const uint8_t *topright, int stride);
166 void ff_pred4x4_tm_vp8_mmxext      (uint8_t *src, const uint8_t *topright, int stride);
167 void ff_pred4x4_tm_vp8_ssse3       (uint8_t *src, const uint8_t *topright, int stride);
168 void ff_pred4x4_vertical_vp8_mmxext(uint8_t *src, const uint8_t *topright, int stride);
169
170 void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int bit_depth, const int chroma_format_idc)
171 {
172     int mm_flags = av_get_cpu_flags();
173
174 #if HAVE_YASM
175     if (bit_depth == 8) {
176         if (mm_flags & AV_CPU_FLAG_MMX) {
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 == 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 == CODEC_ID_SVQ3) {
191                     h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_mmx;
192                 } else if (codec_id == CODEC_ID_RV40) {
193                     h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_mmx;
194                 } else {
195                     h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_mmx;
196                 }
197             }
198         }
199
200         if (mm_flags & AV_CPU_FLAG_MMX2) {
201             h->pred16x16[HOR_PRED8x8            ] = ff_pred16x16_horizontal_mmxext;
202             h->pred16x16[DC_PRED8x8             ] = ff_pred16x16_dc_mmxext;
203             if (chroma_format_idc == 1)
204                 h->pred8x8[HOR_PRED8x8          ] = ff_pred8x8_horizontal_mmxext;
205             h->pred8x8l [TOP_DC_PRED            ] = ff_pred8x8l_top_dc_mmxext;
206             h->pred8x8l [DC_PRED                ] = ff_pred8x8l_dc_mmxext;
207             h->pred8x8l [HOR_PRED               ] = ff_pred8x8l_horizontal_mmxext;
208             h->pred8x8l [VERT_PRED              ] = ff_pred8x8l_vertical_mmxext;
209             h->pred8x8l [DIAG_DOWN_RIGHT_PRED   ] = ff_pred8x8l_down_right_mmxext;
210             h->pred8x8l [VERT_RIGHT_PRED        ] = ff_pred8x8l_vertical_right_mmxext;
211             h->pred8x8l [HOR_UP_PRED            ] = ff_pred8x8l_horizontal_up_mmxext;
212             h->pred8x8l [DIAG_DOWN_LEFT_PRED    ] = ff_pred8x8l_down_left_mmxext;
213             h->pred8x8l [HOR_DOWN_PRED          ] = ff_pred8x8l_horizontal_down_mmxext;
214             h->pred4x4  [DIAG_DOWN_RIGHT_PRED   ] = ff_pred4x4_down_right_mmxext;
215             h->pred4x4  [VERT_RIGHT_PRED        ] = ff_pred4x4_vertical_right_mmxext;
216             h->pred4x4  [HOR_DOWN_PRED          ] = ff_pred4x4_horizontal_down_mmxext;
217             h->pred4x4  [DC_PRED                ] = ff_pred4x4_dc_mmxext;
218             if (codec_id == CODEC_ID_VP8 || codec_id == CODEC_ID_H264) {
219                 h->pred4x4  [DIAG_DOWN_LEFT_PRED] = ff_pred4x4_down_left_mmxext;
220             }
221             if (codec_id == CODEC_ID_SVQ3 || codec_id == CODEC_ID_H264) {
222                 h->pred4x4  [VERT_LEFT_PRED     ] = ff_pred4x4_vertical_left_mmxext;
223             }
224             if (codec_id != CODEC_ID_RV40) {
225                 h->pred4x4  [HOR_UP_PRED        ] = ff_pred4x4_horizontal_up_mmxext;
226             }
227             if (codec_id == CODEC_ID_SVQ3 || codec_id == CODEC_ID_H264) {
228                 if (chroma_format_idc == 1) {
229                     h->pred8x8[TOP_DC_PRED8x8   ] = ff_pred8x8_top_dc_mmxext;
230                     h->pred8x8[DC_PRED8x8       ] = ff_pred8x8_dc_mmxext;
231                 }
232             }
233             if (codec_id == CODEC_ID_VP8) {
234                 h->pred16x16[PLANE_PRED8x8      ] = ff_pred16x16_tm_vp8_mmxext;
235                 h->pred8x8  [DC_PRED8x8         ] = ff_pred8x8_dc_rv40_mmxext;
236                 h->pred8x8  [PLANE_PRED8x8      ] = ff_pred8x8_tm_vp8_mmxext;
237                 h->pred4x4  [TM_VP8_PRED        ] = ff_pred4x4_tm_vp8_mmxext;
238                 h->pred4x4  [VERT_PRED          ] = ff_pred4x4_vertical_vp8_mmxext;
239             } else {
240                 if (chroma_format_idc == 1)
241                     h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_plane_mmx2;
242                 if (codec_id == CODEC_ID_SVQ3) {
243                     h->pred16x16[PLANE_PRED8x8  ] = ff_pred16x16_plane_svq3_mmx2;
244                 } else if (codec_id == CODEC_ID_RV40) {
245                     h->pred16x16[PLANE_PRED8x8  ] = ff_pred16x16_plane_rv40_mmx2;
246                 } else {
247                     h->pred16x16[PLANE_PRED8x8  ] = ff_pred16x16_plane_h264_mmx2;
248                 }
249             }
250         }
251
252         if (mm_flags & AV_CPU_FLAG_SSE) {
253             h->pred16x16[VERT_PRED8x8] = ff_pred16x16_vertical_sse;
254         }
255
256         if (mm_flags & AV_CPU_FLAG_SSE2) {
257             h->pred16x16[DC_PRED8x8           ] = ff_pred16x16_dc_sse2;
258             h->pred8x8l [DIAG_DOWN_LEFT_PRED  ] = ff_pred8x8l_down_left_sse2;
259             h->pred8x8l [DIAG_DOWN_RIGHT_PRED ] = ff_pred8x8l_down_right_sse2;
260             h->pred8x8l [VERT_RIGHT_PRED      ] = ff_pred8x8l_vertical_right_sse2;
261             h->pred8x8l [VERT_LEFT_PRED       ] = ff_pred8x8l_vertical_left_sse2;
262             h->pred8x8l [HOR_DOWN_PRED        ] = ff_pred8x8l_horizontal_down_sse2;
263             if (codec_id == CODEC_ID_VP8) {
264                 h->pred16x16[PLANE_PRED8x8    ] = ff_pred16x16_tm_vp8_sse2;
265                 h->pred8x8  [PLANE_PRED8x8    ] = ff_pred8x8_tm_vp8_sse2;
266             } else {
267                 if (chroma_format_idc == 1)
268                     h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_plane_sse2;
269                 if (codec_id == CODEC_ID_SVQ3) {
270                     h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_sse2;
271                 } else if (codec_id == CODEC_ID_RV40) {
272                     h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_sse2;
273                 } else {
274                     h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_sse2;
275                 }
276             }
277         }
278
279         if (mm_flags & AV_CPU_FLAG_SSSE3) {
280             h->pred16x16[HOR_PRED8x8          ] = ff_pred16x16_horizontal_ssse3;
281             h->pred16x16[DC_PRED8x8           ] = ff_pred16x16_dc_ssse3;
282             if (chroma_format_idc == 1)
283                 h->pred8x8  [HOR_PRED8x8      ] = ff_pred8x8_horizontal_ssse3;
284             h->pred8x8l [TOP_DC_PRED          ] = ff_pred8x8l_top_dc_ssse3;
285             h->pred8x8l [DC_PRED              ] = ff_pred8x8l_dc_ssse3;
286             h->pred8x8l [HOR_PRED             ] = ff_pred8x8l_horizontal_ssse3;
287             h->pred8x8l [VERT_PRED            ] = ff_pred8x8l_vertical_ssse3;
288             h->pred8x8l [DIAG_DOWN_LEFT_PRED  ] = ff_pred8x8l_down_left_ssse3;
289             h->pred8x8l [DIAG_DOWN_RIGHT_PRED ] = ff_pred8x8l_down_right_ssse3;
290             h->pred8x8l [VERT_RIGHT_PRED      ] = ff_pred8x8l_vertical_right_ssse3;
291             h->pred8x8l [VERT_LEFT_PRED       ] = ff_pred8x8l_vertical_left_ssse3;
292             h->pred8x8l [HOR_UP_PRED          ] = ff_pred8x8l_horizontal_up_ssse3;
293             h->pred8x8l [HOR_DOWN_PRED        ] = ff_pred8x8l_horizontal_down_ssse3;
294             if (codec_id == CODEC_ID_VP8) {
295                 h->pred8x8  [PLANE_PRED8x8    ] = ff_pred8x8_tm_vp8_ssse3;
296                 h->pred4x4  [TM_VP8_PRED      ] = ff_pred4x4_tm_vp8_ssse3;
297             } else {
298                 if (chroma_format_idc == 1)
299                     h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_plane_ssse3;
300                 if (codec_id == CODEC_ID_SVQ3) {
301                     h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_ssse3;
302                 } else if (codec_id == CODEC_ID_RV40) {
303                     h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_ssse3;
304                 } else {
305                     h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_ssse3;
306                 }
307             }
308         }
309     } else if (bit_depth == 10) {
310         if (mm_flags & AV_CPU_FLAG_MMX2) {
311             h->pred4x4[DC_PRED             ] = ff_pred4x4_dc_10_mmxext;
312             h->pred4x4[HOR_UP_PRED         ] = ff_pred4x4_horizontal_up_10_mmxext;
313
314             if (chroma_format_idc == 1)
315                 h->pred8x8[DC_PRED8x8      ] = ff_pred8x8_dc_10_mmxext;
316
317             h->pred8x8l[DC_128_PRED        ] = ff_pred8x8l_128_dc_10_mmxext;
318
319             h->pred16x16[DC_PRED8x8        ] = ff_pred16x16_dc_10_mmxext;
320             h->pred16x16[TOP_DC_PRED8x8    ] = ff_pred16x16_top_dc_10_mmxext;
321             h->pred16x16[DC_128_PRED8x8    ] = ff_pred16x16_128_dc_10_mmxext;
322             h->pred16x16[LEFT_DC_PRED8x8   ] = ff_pred16x16_left_dc_10_mmxext;
323             h->pred16x16[VERT_PRED8x8      ] = ff_pred16x16_vertical_10_mmxext;
324             h->pred16x16[HOR_PRED8x8       ] = ff_pred16x16_horizontal_10_mmxext;
325         }
326         if (mm_flags & AV_CPU_FLAG_SSE2) {
327             h->pred4x4[DIAG_DOWN_LEFT_PRED ] = ff_pred4x4_down_left_10_sse2;
328             h->pred4x4[DIAG_DOWN_RIGHT_PRED] = ff_pred4x4_down_right_10_sse2;
329             h->pred4x4[VERT_LEFT_PRED      ] = ff_pred4x4_vertical_left_10_sse2;
330             h->pred4x4[VERT_RIGHT_PRED     ] = ff_pred4x4_vertical_right_10_sse2;
331             h->pred4x4[HOR_DOWN_PRED       ] = ff_pred4x4_horizontal_down_10_sse2;
332
333             if (chroma_format_idc == 1) {
334                 h->pred8x8[DC_PRED8x8      ] = ff_pred8x8_dc_10_sse2;
335                 h->pred8x8[TOP_DC_PRED8x8  ] = ff_pred8x8_top_dc_10_sse2;
336                 h->pred8x8[PLANE_PRED8x8   ] = ff_pred8x8_plane_10_sse2;
337                 h->pred8x8[VERT_PRED8x8    ] = ff_pred8x8_vertical_10_sse2;
338                 h->pred8x8[HOR_PRED8x8     ] = ff_pred8x8_horizontal_10_sse2;
339             }
340
341             h->pred8x8l[VERT_PRED           ] = ff_pred8x8l_vertical_10_sse2;
342             h->pred8x8l[HOR_PRED            ] = ff_pred8x8l_horizontal_10_sse2;
343             h->pred8x8l[DC_PRED             ] = ff_pred8x8l_dc_10_sse2;
344             h->pred8x8l[DC_128_PRED         ] = ff_pred8x8l_128_dc_10_sse2;
345             h->pred8x8l[TOP_DC_PRED         ] = ff_pred8x8l_top_dc_10_sse2;
346             h->pred8x8l[DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_10_sse2;
347             h->pred8x8l[DIAG_DOWN_RIGHT_PRED] = ff_pred8x8l_down_right_10_sse2;
348             h->pred8x8l[VERT_RIGHT_PRED     ] = ff_pred8x8l_vertical_right_10_sse2;
349             h->pred8x8l[HOR_UP_PRED         ] = ff_pred8x8l_horizontal_up_10_sse2;
350
351             h->pred16x16[DC_PRED8x8        ] = ff_pred16x16_dc_10_sse2;
352             h->pred16x16[TOP_DC_PRED8x8    ] = ff_pred16x16_top_dc_10_sse2;
353             h->pred16x16[DC_128_PRED8x8    ] = ff_pred16x16_128_dc_10_sse2;
354             h->pred16x16[LEFT_DC_PRED8x8   ] = ff_pred16x16_left_dc_10_sse2;
355             h->pred16x16[VERT_PRED8x8      ] = ff_pred16x16_vertical_10_sse2;
356             h->pred16x16[HOR_PRED8x8       ] = ff_pred16x16_horizontal_10_sse2;
357         }
358         if (mm_flags & AV_CPU_FLAG_SSSE3) {
359             h->pred4x4[DIAG_DOWN_RIGHT_PRED] = ff_pred4x4_down_right_10_ssse3;
360             h->pred4x4[VERT_RIGHT_PRED     ] = ff_pred4x4_vertical_right_10_ssse3;
361             h->pred4x4[HOR_DOWN_PRED       ] = ff_pred4x4_horizontal_down_10_ssse3;
362
363             h->pred8x8l[HOR_PRED            ] = ff_pred8x8l_horizontal_10_ssse3;
364             h->pred8x8l[DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_10_ssse3;
365             h->pred8x8l[DIAG_DOWN_RIGHT_PRED] = ff_pred8x8l_down_right_10_ssse3;
366             h->pred8x8l[VERT_RIGHT_PRED     ] = ff_pred8x8l_vertical_right_10_ssse3;
367             h->pred8x8l[HOR_UP_PRED         ] = ff_pred8x8l_horizontal_up_10_ssse3;
368         }
369 #if HAVE_AVX
370         if (mm_flags & AV_CPU_FLAG_AVX) {
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 #endif /* HAVE_AVX */
387     }
388 #endif /* HAVE_YASM */
389 }