Revision de1c253b

View differences:

libavcodec/x86/Makefile
12 12
                                          x86/h264_weight_sse2.o        \
13 13

  
14 14
YASM-OBJS-$(CONFIG_H264PRED)           += x86/h264_intrapred.o
15
MMX-OBJS-$(CONFIG_H264PRED)            += x86/h264_intrapred_init.o
15 16

  
16 17
YASM-OBJS-$(CONFIG_VC1_DECODER)        += x86/vc1dsp_yasm.o
17 18

  
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 "libavcodec/h264pred.h"
22

  
23
void ff_pred16x16_vertical_mmx     (uint8_t *src, int stride);
24
void ff_pred16x16_vertical_sse     (uint8_t *src, int stride);
25
void ff_pred16x16_horizontal_mmx   (uint8_t *src, int stride);
26
void ff_pred16x16_horizontal_mmxext(uint8_t *src, int stride);
27
void ff_pred16x16_horizontal_ssse3 (uint8_t *src, int stride);
28
void ff_pred16x16_dc_mmxext        (uint8_t *src, int stride);
29
void ff_pred16x16_dc_sse2          (uint8_t *src, int stride);
30
void ff_pred16x16_dc_ssse3         (uint8_t *src, int stride);
31
void ff_pred16x16_tm_vp8_mmx       (uint8_t *src, int stride);
32
void ff_pred16x16_tm_vp8_mmxext    (uint8_t *src, int stride);
33
void ff_pred16x16_tm_vp8_sse2      (uint8_t *src, int stride);
34
void ff_pred8x8_dc_rv40_mmxext     (uint8_t *src, int stride);
35
void ff_pred8x8_vertical_mmx       (uint8_t *src, int stride);
36
void ff_pred8x8_horizontal_mmx     (uint8_t *src, int stride);
37
void ff_pred8x8_horizontal_mmxext  (uint8_t *src, int stride);
38
void ff_pred8x8_horizontal_ssse3   (uint8_t *src, int stride);
39
void ff_pred8x8_tm_vp8_mmx         (uint8_t *src, int stride);
40
void ff_pred8x8_tm_vp8_mmxext      (uint8_t *src, int stride);
41
void ff_pred8x8_tm_vp8_sse2        (uint8_t *src, int stride);
42
void ff_pred8x8_tm_vp8_ssse3       (uint8_t *src, int stride);
43
void ff_pred4x4_dc_mmxext          (uint8_t *src, const uint8_t *topright, int stride);
44
void ff_pred4x4_tm_vp8_mmx         (uint8_t *src, const uint8_t *topright, int stride);
45
void ff_pred4x4_tm_vp8_mmxext      (uint8_t *src, const uint8_t *topright, int stride);
46
void ff_pred4x4_tm_vp8_ssse3       (uint8_t *src, const uint8_t *topright, int stride);
47
void ff_pred4x4_vertical_vp8_mmxext(uint8_t *src, const uint8_t *topright, int stride);
48

  
49
void ff_h264_pred_init_x86(H264PredContext *h, int codec_id)
50
{
51
    int mm_flags = mm_support();
52

  
53
#if HAVE_YASM
54
    if (mm_flags & FF_MM_MMX) {
55
        h->pred16x16[VERT_PRED8x8] = ff_pred16x16_vertical_mmx;
56
        h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmx;
57
        h->pred8x8  [VERT_PRED8x8] = ff_pred8x8_vertical_mmx;
58
        h->pred8x8  [HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmx;
59
        if (codec_id == CODEC_ID_VP8) {
60
            h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_mmx;
61
            h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_mmx;
62
            h->pred4x4  [TM_VP8_PRED  ] = ff_pred4x4_tm_vp8_mmx;
63
        }
64
    }
65

  
66
    if (mm_flags & FF_MM_MMX2) {
67
        h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmxext;
68
        h->pred16x16[DC_PRED8x8  ] = ff_pred16x16_dc_mmxext;
69
        h->pred8x8  [HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmxext;
70
        h->pred4x4  [DC_PRED     ] = ff_pred4x4_dc_mmxext;
71
        if (codec_id == CODEC_ID_VP8) {
72
            h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_mmxext;
73
            h->pred8x8  [DC_PRED8x8   ] = ff_pred8x8_dc_rv40_mmxext;
74
            h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_mmxext;
75
            h->pred4x4  [TM_VP8_PRED  ] = ff_pred4x4_tm_vp8_mmxext;
76
            h->pred4x4  [VERT_PRED    ] = ff_pred4x4_vertical_vp8_mmxext;
77
        }
78
    }
79

  
80
    if (mm_flags & FF_MM_SSE) {
81
        h->pred16x16[VERT_PRED8x8] = ff_pred16x16_vertical_sse;
82
    }
83

  
84
    if (mm_flags & FF_MM_SSE2) {
85
        h->pred16x16[DC_PRED8x8  ] = ff_pred16x16_dc_sse2;
86
        if (codec_id == CODEC_ID_VP8) {
87
            h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_sse2;
88
            h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_sse2;
89
        }
90
    }
91

  
92
    if (mm_flags & FF_MM_SSSE3) {
93
        h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_ssse3;
94
        h->pred16x16[DC_PRED8x8  ] = ff_pred16x16_dc_ssse3;
95
        h->pred8x8  [HOR_PRED8x8 ] = ff_pred8x8_horizontal_ssse3;
96
        if (codec_id == CODEC_ID_VP8) {
97
            h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_ssse3;
98
            h->pred4x4  [TM_VP8_PRED  ] = ff_pred4x4_tm_vp8_ssse3;
99
        }
100
    }
101
#endif
102
}
libavcodec/x86/h264dsp_mmx.c
2217 2217
void ff_h264_biweight_16x16_ssse3(uint8_t *dst, uint8_t *src, int stride,
2218 2218
                                  int log2_denom, int weightd, int weights,
2219 2219
                                  int offset);
2220

  
2221
void ff_pred16x16_vertical_mmx     (uint8_t *src, int stride);
2222
void ff_pred16x16_vertical_sse     (uint8_t *src, int stride);
2223
void ff_pred16x16_horizontal_mmx   (uint8_t *src, int stride);
2224
void ff_pred16x16_horizontal_mmxext(uint8_t *src, int stride);
2225
void ff_pred16x16_horizontal_ssse3 (uint8_t *src, int stride);
2226
void ff_pred16x16_dc_mmxext        (uint8_t *src, int stride);
2227
void ff_pred16x16_dc_sse2          (uint8_t *src, int stride);
2228
void ff_pred16x16_dc_ssse3         (uint8_t *src, int stride);
2229
void ff_pred16x16_tm_vp8_mmx       (uint8_t *src, int stride);
2230
void ff_pred16x16_tm_vp8_mmxext    (uint8_t *src, int stride);
2231
void ff_pred16x16_tm_vp8_sse2      (uint8_t *src, int stride);
2232
void ff_pred8x8_dc_rv40_mmxext     (uint8_t *src, int stride);
2233
void ff_pred8x8_vertical_mmx       (uint8_t *src, int stride);
2234
void ff_pred8x8_horizontal_mmx     (uint8_t *src, int stride);
2235
void ff_pred8x8_horizontal_mmxext  (uint8_t *src, int stride);
2236
void ff_pred8x8_horizontal_ssse3   (uint8_t *src, int stride);
2237
void ff_pred8x8_tm_vp8_mmx         (uint8_t *src, int stride);
2238
void ff_pred8x8_tm_vp8_mmxext      (uint8_t *src, int stride);
2239
void ff_pred8x8_tm_vp8_sse2        (uint8_t *src, int stride);
2240
void ff_pred8x8_tm_vp8_ssse3       (uint8_t *src, int stride);
2241
void ff_pred4x4_dc_mmxext          (uint8_t *src, const uint8_t *topright, int stride);
2242
void ff_pred4x4_tm_vp8_mmx         (uint8_t *src, const uint8_t *topright, int stride);
2243
void ff_pred4x4_tm_vp8_mmxext      (uint8_t *src, const uint8_t *topright, int stride);
2244
void ff_pred4x4_tm_vp8_ssse3       (uint8_t *src, const uint8_t *topright, int stride);
2245
void ff_pred4x4_vertical_vp8_mmxext(uint8_t *src, const uint8_t *topright, int stride);
2246

  
2247
#if CONFIG_H264PRED
2248
void ff_h264_pred_init_x86(H264PredContext *h, int codec_id)
2249
{
2250
    int mm_flags = mm_support();
2251

  
2252
#if HAVE_YASM
2253
    if (mm_flags & FF_MM_MMX) {
2254
        h->pred16x16[VERT_PRED8x8] = ff_pred16x16_vertical_mmx;
2255
        h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmx;
2256
        h->pred8x8  [VERT_PRED8x8] = ff_pred8x8_vertical_mmx;
2257
        h->pred8x8  [HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmx;
2258
        if (codec_id == CODEC_ID_VP8) {
2259
            h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_mmx;
2260
            h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_mmx;
2261
            h->pred4x4  [TM_VP8_PRED  ] = ff_pred4x4_tm_vp8_mmx;
2262
        }
2263
    }
2264

  
2265
    if (mm_flags & FF_MM_MMX2) {
2266
        h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmxext;
2267
        h->pred16x16[DC_PRED8x8  ] = ff_pred16x16_dc_mmxext;
2268
        h->pred8x8  [HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmxext;
2269
        h->pred4x4  [DC_PRED     ] = ff_pred4x4_dc_mmxext;
2270
        if (codec_id == CODEC_ID_VP8) {
2271
            h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_mmxext;
2272
            h->pred8x8  [DC_PRED8x8   ] = ff_pred8x8_dc_rv40_mmxext;
2273
            h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_mmxext;
2274
            h->pred4x4  [TM_VP8_PRED  ] = ff_pred4x4_tm_vp8_mmxext;
2275
            h->pred4x4  [VERT_PRED    ] = ff_pred4x4_vertical_vp8_mmxext;
2276
        }
2277
    }
2278

  
2279
    if (mm_flags & FF_MM_SSE) {
2280
        h->pred16x16[VERT_PRED8x8] = ff_pred16x16_vertical_sse;
2281
    }
2282

  
2283
    if (mm_flags & FF_MM_SSE2) {
2284
        h->pred16x16[DC_PRED8x8  ] = ff_pred16x16_dc_sse2;
2285
        if (codec_id == CODEC_ID_VP8) {
2286
            h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_sse2;
2287
            h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_sse2;
2288
        }
2289
    }
2290

  
2291
    if (mm_flags & FF_MM_SSSE3) {
2292
        h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_ssse3;
2293
        h->pred16x16[DC_PRED8x8  ] = ff_pred16x16_dc_ssse3;
2294
        h->pred8x8  [HOR_PRED8x8 ] = ff_pred8x8_horizontal_ssse3;
2295
        if (codec_id == CODEC_ID_VP8) {
2296
            h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_ssse3;
2297
            h->pred4x4  [TM_VP8_PRED  ] = ff_pred4x4_tm_vp8_ssse3;
2298
        }
2299
    }
2300
#endif
2301
}
2302
#endif

Also available in: Unified diff