Mercurial > libavcodec.hg
annotate x86/h264_intrapred_init.c @ 12454:f4355cd85faa libavcodec
Port latest x264 deblock asm (before they moved to using NV12 as internal
format), LGPL'ed with permission from Jason and Loren. This includes mmx2
code, so remove inline asm from h264dsp_mmx.c accordingly.
author | rbultje |
---|---|
date | Fri, 03 Sep 2010 16:52:46 +0000 |
parents | 33ecda76b2f2 |
children | a5ddb39627fd |
rev | line source |
---|---|
8430 | 1 /* |
12438
33ecda76b2f2
Split intra prediction initialization (i.e. assigning of function pointers)
rbultje
parents:
12437
diff
changeset
|
2 * Copyright (c) 2010 Jason Garrett-Glaser |
8430 | 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 | |
11951
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
21 #include "libavcodec/h264pred.h" |
8430 | 22 |
11951
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
23 void ff_pred16x16_vertical_mmx (uint8_t *src, int stride); |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
24 void ff_pred16x16_vertical_sse (uint8_t *src, int stride); |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
25 void ff_pred16x16_horizontal_mmx (uint8_t *src, int stride); |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
26 void ff_pred16x16_horizontal_mmxext(uint8_t *src, int stride); |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
27 void ff_pred16x16_horizontal_ssse3 (uint8_t *src, int stride); |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
28 void ff_pred16x16_dc_mmxext (uint8_t *src, int stride); |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
29 void ff_pred16x16_dc_sse2 (uint8_t *src, int stride); |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
30 void ff_pred16x16_dc_ssse3 (uint8_t *src, int stride); |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
31 void ff_pred16x16_tm_vp8_mmx (uint8_t *src, int stride); |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
32 void ff_pred16x16_tm_vp8_mmxext (uint8_t *src, int stride); |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
33 void ff_pred16x16_tm_vp8_sse2 (uint8_t *src, int stride); |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
34 void ff_pred8x8_dc_rv40_mmxext (uint8_t *src, int stride); |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
35 void ff_pred8x8_vertical_mmx (uint8_t *src, int stride); |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
36 void ff_pred8x8_horizontal_mmx (uint8_t *src, int stride); |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
37 void ff_pred8x8_horizontal_mmxext (uint8_t *src, int stride); |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
38 void ff_pred8x8_horizontal_ssse3 (uint8_t *src, int stride); |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
39 void ff_pred8x8_tm_vp8_mmx (uint8_t *src, int stride); |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
40 void ff_pred8x8_tm_vp8_mmxext (uint8_t *src, int stride); |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
41 void ff_pred8x8_tm_vp8_sse2 (uint8_t *src, int stride); |
11953 | 42 void ff_pred8x8_tm_vp8_ssse3 (uint8_t *src, int stride); |
12001
953a0949c789
Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents:
11993
diff
changeset
|
43 void ff_pred4x4_dc_mmxext (uint8_t *src, const uint8_t *topright, int stride); |
12003
3b761226ea35
Add mmx/mmxext/ssse3 4x4 TM intra pred functions for vp8
darkshikari
parents:
12001
diff
changeset
|
44 void ff_pred4x4_tm_vp8_mmx (uint8_t *src, const uint8_t *topright, int stride); |
3b761226ea35
Add mmx/mmxext/ssse3 4x4 TM intra pred functions for vp8
darkshikari
parents:
12001
diff
changeset
|
45 void ff_pred4x4_tm_vp8_mmxext (uint8_t *src, const uint8_t *topright, int stride); |
3b761226ea35
Add mmx/mmxext/ssse3 4x4 TM intra pred functions for vp8
darkshikari
parents:
12001
diff
changeset
|
46 void ff_pred4x4_tm_vp8_ssse3 (uint8_t *src, const uint8_t *topright, int stride); |
12004 | 47 void ff_pred4x4_vertical_vp8_mmxext(uint8_t *src, const uint8_t *topright, int stride); |
11951
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
48 |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
49 void ff_h264_pred_init_x86(H264PredContext *h, int codec_id) |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
50 { |
12414 | 51 int mm_flags = mm_support(); |
12012
2d70a8b0ec8a
Add missing mm_support call toff_h264_pred_init_x86.
darkshikari
parents:
12004
diff
changeset
|
52 |
11951
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
53 #if HAVE_YASM |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
54 if (mm_flags & FF_MM_MMX) { |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
55 h->pred16x16[VERT_PRED8x8] = ff_pred16x16_vertical_mmx; |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
56 h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmx; |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
57 h->pred8x8 [VERT_PRED8x8] = ff_pred8x8_vertical_mmx; |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
58 h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmx; |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
59 if (codec_id == CODEC_ID_VP8) { |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
60 h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_mmx; |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
61 h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_mmx; |
12003
3b761226ea35
Add mmx/mmxext/ssse3 4x4 TM intra pred functions for vp8
darkshikari
parents:
12001
diff
changeset
|
62 h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_mmx; |
11951
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
63 } |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
64 } |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
65 |
11993 | 66 if (mm_flags & FF_MM_MMX2) { |
11951
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
67 h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmxext; |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
68 h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_mmxext; |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
69 h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmxext; |
12001
953a0949c789
Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents:
11993
diff
changeset
|
70 h->pred4x4 [DC_PRED ] = ff_pred4x4_dc_mmxext; |
11951
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
71 if (codec_id == CODEC_ID_VP8) { |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
72 h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_mmxext; |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
73 h->pred8x8 [DC_PRED8x8 ] = ff_pred8x8_dc_rv40_mmxext; |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
74 h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_mmxext; |
12003
3b761226ea35
Add mmx/mmxext/ssse3 4x4 TM intra pred functions for vp8
darkshikari
parents:
12001
diff
changeset
|
75 h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_mmxext; |
12004 | 76 h->pred4x4 [VERT_PRED ] = ff_pred4x4_vertical_vp8_mmxext; |
11951
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
77 } |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
78 } |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
79 |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
80 if (mm_flags & FF_MM_SSE) { |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
81 h->pred16x16[VERT_PRED8x8] = ff_pred16x16_vertical_sse; |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
82 } |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
83 |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
84 if (mm_flags & FF_MM_SSE2) { |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
85 h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_sse2; |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
86 if (codec_id == CODEC_ID_VP8) { |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
87 h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_sse2; |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
88 h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_sse2; |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
89 } |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
90 } |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
91 |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
92 if (mm_flags & FF_MM_SSSE3) { |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
93 h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_ssse3; |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
94 h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_ssse3; |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
95 h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_ssse3; |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
96 if (codec_id == CODEC_ID_VP8) { |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
97 h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_ssse3; |
12003
3b761226ea35
Add mmx/mmxext/ssse3 4x4 TM intra pred functions for vp8
darkshikari
parents:
12001
diff
changeset
|
98 h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_ssse3; |
11951
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
99 } |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
100 } |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
101 #endif |
afee30fe8c26
16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
11701
diff
changeset
|
102 } |