comparison x86/h264dsp_mmx.c @ 11951:afee30fe8c26 libavcodec

16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
author darkshikari
date Fri, 25 Jun 2010 18:25:49 +0000
parents 953d0c2d2c0a
children 65470eea7561
comparison
equal deleted inserted replaced
11950:56aba5a9761c 11951:afee30fe8c26
17 * License along with FFmpeg; if not, write to the Free Software 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 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */ 19 */
20 20
21 #include "dsputil_mmx.h" 21 #include "dsputil_mmx.h"
22 #include "libavcodec/h264pred.h"
22 23
23 DECLARE_ALIGNED(8, static const uint64_t, ff_pb_3_1 ) = 0x0103010301030103ULL; 24 DECLARE_ALIGNED(8, static const uint64_t, ff_pb_3_1 ) = 0x0103010301030103ULL;
24 DECLARE_ALIGNED(8, static const uint64_t, ff_pb_7_3 ) = 0x0307030703070307ULL; 25 DECLARE_ALIGNED(8, static const uint64_t, ff_pb_7_3 ) = 0x0307030703070307ULL;
25 26
26 /***********************************/ 27 /***********************************/
2320 H264_WEIGHT( 8, 4) 2321 H264_WEIGHT( 8, 4)
2321 H264_WEIGHT( 4, 8) 2322 H264_WEIGHT( 4, 8)
2322 H264_WEIGHT( 4, 4) 2323 H264_WEIGHT( 4, 4)
2323 H264_WEIGHT( 4, 2) 2324 H264_WEIGHT( 4, 2)
2324 2325
2326 void ff_pred16x16_vertical_mmx (uint8_t *src, int stride);
2327 void ff_pred16x16_vertical_sse (uint8_t *src, int stride);
2328 void ff_pred16x16_horizontal_mmx (uint8_t *src, int stride);
2329 void ff_pred16x16_horizontal_mmxext(uint8_t *src, int stride);
2330 void ff_pred16x16_horizontal_ssse3 (uint8_t *src, int stride);
2331 void ff_pred16x16_dc_mmx (uint8_t *src, int stride);
2332 void ff_pred16x16_dc_mmxext (uint8_t *src, int stride);
2333 void ff_pred16x16_dc_sse (uint8_t *src, int stride);
2334 void ff_pred16x16_dc_sse2 (uint8_t *src, int stride);
2335 void ff_pred16x16_dc_ssse3 (uint8_t *src, int stride);
2336 void ff_pred16x16_tm_vp8_mmx (uint8_t *src, int stride);
2337 void ff_pred16x16_tm_vp8_mmxext (uint8_t *src, int stride);
2338 void ff_pred16x16_tm_vp8_sse2 (uint8_t *src, int stride);
2339 void ff_pred8x8_dc_rv40_mmx (uint8_t *src, int stride);
2340 void ff_pred8x8_dc_rv40_mmxext (uint8_t *src, int stride);
2341 void ff_pred8x8_vertical_mmx (uint8_t *src, int stride);
2342 void ff_pred8x8_horizontal_mmx (uint8_t *src, int stride);
2343 void ff_pred8x8_horizontal_mmxext (uint8_t *src, int stride);
2344 void ff_pred8x8_horizontal_ssse3 (uint8_t *src, int stride);
2345 void ff_pred8x8_tm_vp8_mmx (uint8_t *src, int stride);
2346 void ff_pred8x8_tm_vp8_mmxext (uint8_t *src, int stride);
2347 void ff_pred8x8_tm_vp8_sse2 (uint8_t *src, int stride);
2348 void ff_pred8x8_tm_vp8_ssse3 (uint8_t *src, int stride);
2349
2350 void ff_h264_pred_init_x86(H264PredContext *h, int codec_id)
2351 {
2352 #if HAVE_YASM
2353 if (mm_flags & FF_MM_MMX) {
2354 h->pred16x16[VERT_PRED8x8] = ff_pred16x16_vertical_mmx;
2355 h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmx;
2356 h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_mmx;
2357 h->pred8x8 [VERT_PRED8x8] = ff_pred8x8_vertical_mmx;
2358 h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmx;
2359 if (codec_id == CODEC_ID_VP8) {
2360 h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_mmx;
2361 h->pred8x8 [DC_PRED8x8 ] = ff_pred8x8_dc_rv40_mmx;
2362 h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_mmx;
2363 }
2364 }
2365
2366 if (mm_flags & FF_MM_MMXEXT) {
2367 h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmxext;
2368 h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_mmxext;
2369 h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmxext;
2370 if (codec_id == CODEC_ID_VP8) {
2371 h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_mmxext;
2372 h->pred8x8 [DC_PRED8x8 ] = ff_pred8x8_dc_rv40_mmxext;
2373 h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_mmxext;
2374 }
2375 }
2376
2377 if (mm_flags & FF_MM_SSE) {
2378 h->pred16x16[VERT_PRED8x8] = ff_pred16x16_vertical_sse;
2379 h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_sse;
2380 }
2381
2382 if (mm_flags & FF_MM_SSE2) {
2383 h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_sse2;
2384 if (codec_id == CODEC_ID_VP8) {
2385 h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_sse2;
2386 h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_sse2;
2387 }
2388 }
2389
2390 if (mm_flags & FF_MM_SSSE3) {
2391 h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_ssse3;
2392 h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_ssse3;
2393 h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_ssse3;
2394 if (codec_id == CODEC_ID_VP8) {
2395 h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_ssse3;
2396 }
2397 }
2398 #endif
2399 }