annotate x86/h264dsp_mmx.c @ 12494:94eaea836bf4 libavcodec

Check avctx width/height more thoroughly (e.g. all values 0 except width would have been accepted before). Also do not fail if they are invalid but instead override them to 0. This allows decoding e.g. MPEG video when only the container values are corrupted. For encoding a value of 0,0 of course makes no sense, but was allowed through before and will be caught by an extra check in the encode function.
author reimar
date Wed, 15 Sep 2010 04:46:55 +0000
parents 58a960d6e34c
children 6bc14239edfb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1 /*
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2 * Copyright (c) 2004-2005 Michael Niedermayer, Loren Merritt
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
3 *
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
4 * This file is part of FFmpeg.
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
5 *
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
6 * FFmpeg is free software; you can redistribute it and/or
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
9 * version 2.1 of the License, or (at your option) any later version.
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
10 *
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
11 * FFmpeg is distributed in the hope that it will be useful,
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
14 * Lesser General Public License for more details.
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
15 *
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
17 * License along with FFmpeg; if not, write to the Free Software
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
19 */
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
20
12475
9fef0a8ddd63 Move mm_support() from libavcodec to libavutil, make it a public
stefano
parents: 12456
diff changeset
21 #include "libavutil/cpu.h"
12450
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
22 #include "libavutil/x86_cpu.h"
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
23 #include "libavcodec/h264dsp.h"
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
24 #include "dsputil_mmx.h"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
25
11369
98970e51365a Remove DECLARE_ALIGNED_{8,16} macros
mru
parents: 11017
diff changeset
26 DECLARE_ALIGNED(8, static const uint64_t, ff_pb_3_1 ) = 0x0103010301030103ULL;
98970e51365a Remove DECLARE_ALIGNED_{8,16} macros
mru
parents: 11017
diff changeset
27 DECLARE_ALIGNED(8, static const uint64_t, ff_pb_7_3 ) = 0x0307030703070307ULL;
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
28
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
29 /***********************************/
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
30 /* IDCT */
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
31
12492
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
32 void ff_h264_idct_add_mmx (uint8_t *dst, int16_t *block, int stride);
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
33 void ff_h264_idct8_add_mmx (uint8_t *dst, int16_t *block, int stride);
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
34 void ff_h264_idct8_add_sse2 (uint8_t *dst, int16_t *block, int stride);
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
35 void ff_h264_idct_dc_add_mmx2 (uint8_t *dst, int16_t *block, int stride);
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
36 void ff_h264_idct8_dc_add_mmx2(uint8_t *dst, int16_t *block, int stride);
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
37
12492
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
38 void ff_h264_idct_add16_mmx (uint8_t *dst, const int *block_offset,
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
39 DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
40 void ff_h264_idct8_add4_mmx (uint8_t *dst, const int *block_offset,
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
41 DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
42 void ff_h264_idct_add16_mmx2 (uint8_t *dst, const int *block_offset,
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
43 DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
44 void ff_h264_idct_add16intra_mmx (uint8_t *dst, const int *block_offset,
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
45 DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
46 void ff_h264_idct_add16intra_mmx2(uint8_t *dst, const int *block_offset,
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
47 DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
48 void ff_h264_idct8_add4_mmx2 (uint8_t *dst, const int *block_offset,
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
49 DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
50 void ff_h264_idct8_add4_sse2 (uint8_t *dst, const int *block_offset,
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
51 DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
52 void ff_h264_idct_add8_mmx (uint8_t **dest, const int *block_offset,
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
53 DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
54 void ff_h264_idct_add8_mmx2 (uint8_t **dest, const int *block_offset,
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
55 DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
56
12492
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
57 void ff_h264_idct_add16_sse2 (uint8_t *dst, const int *block_offset, DCTELEM *block,
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
58 int stride, const uint8_t nnzc[6*8]);
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
59 void ff_h264_idct_add16intra_sse2(uint8_t *dst, const int *block_offset, DCTELEM *block,
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
60 int stride, const uint8_t nnzc[6*8]);
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
61 void ff_h264_idct_add8_sse2 (uint8_t **dest, const int *block_offset, DCTELEM *block,
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
62 int stride, const uint8_t nnzc[6*8]);
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
63
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
64 /***********************************/
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
65 /* deblocking */
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
66
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
67 static void h264_loop_filter_strength_mmx2( int16_t bS[2][4][4], uint8_t nnz[40], int8_t ref[2][40], int16_t mv[2][40][2],
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
68 int bidir, int edges, int step, int mask_mv0, int mask_mv1, int field ) {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
69 int dir;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
70 __asm__ volatile(
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
71 "movq %0, %%mm7 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
72 "movq %1, %%mm6 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
73 ::"m"(ff_pb_1), "m"(ff_pb_3)
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
74 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
75 if(field)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
76 __asm__ volatile(
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
77 "movq %0, %%mm6 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
78 ::"m"(ff_pb_3_1)
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
79 );
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
80 __asm__ volatile(
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
81 "movq %%mm6, %%mm5 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
82 "paddb %%mm5, %%mm5 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
83 :);
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
84
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
85 // could do a special case for dir==0 && edges==1, but it only reduces the
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
86 // average filter time by 1.2%
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
87 for( dir=1; dir>=0; dir-- ) {
10953
eb9a2581f50e Attempt to fix asm compilation failure.
michael
parents: 10943
diff changeset
88 const x86_reg d_idx = dir ? -8 : -1;
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
89 const int mask_mv = dir ? mask_mv1 : mask_mv0;
11369
98970e51365a Remove DECLARE_ALIGNED_{8,16} macros
mru
parents: 11017
diff changeset
90 DECLARE_ALIGNED(8, const uint64_t, mask_dir) = dir ? 0 : 0xffffffffffffffffULL;
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
91 int b_idx, edge;
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
92 for( b_idx=12, edge=0; edge<edges; edge+=step, b_idx+=8*step ) {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
93 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
94 "pand %0, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
95 ::"m"(mask_dir)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
96 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
97 if(!(mask_mv & edge)) {
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
98 if(bidir) {
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
99 __asm__ volatile(
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
100 "movd (%1,%0), %%mm2 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
101 "punpckldq 40(%1,%0), %%mm2 \n" // { ref0[bn], ref1[bn] }
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
102 "pshufw $0x44, (%1), %%mm0 \n" // { ref0[b], ref0[b] }
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
103 "pshufw $0x44, 40(%1), %%mm1 \n" // { ref1[b], ref1[b] }
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
104 "pshufw $0x4E, %%mm2, %%mm3 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
105 "psubb %%mm2, %%mm0 \n" // { ref0[b]!=ref0[bn], ref0[b]!=ref1[bn] }
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
106 "psubb %%mm3, %%mm1 \n" // { ref1[b]!=ref1[bn], ref1[b]!=ref0[bn] }
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
107 "1: \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
108 "por %%mm1, %%mm0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
109 "movq (%2,%0,4), %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
110 "movq 8(%2,%0,4), %%mm2 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
111 "movq %%mm1, %%mm3 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
112 "movq %%mm2, %%mm4 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
113 "psubw (%2), %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
114 "psubw 8(%2), %%mm2 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
115 "psubw 160(%2), %%mm3 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
116 "psubw 168(%2), %%mm4 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
117 "packsswb %%mm2, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
118 "packsswb %%mm4, %%mm3 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
119 "paddb %%mm6, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
120 "paddb %%mm6, %%mm3 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
121 "psubusb %%mm5, %%mm1 \n" // abs(mv[b] - mv[bn]) >= limit
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
122 "psubusb %%mm5, %%mm3 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
123 "packsswb %%mm3, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
124 "add $40, %0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
125 "cmp $40, %0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
126 "jl 1b \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
127 "sub $80, %0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
128 "pshufw $0x4E, %%mm1, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
129 "por %%mm1, %%mm0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
130 "pshufw $0x4E, %%mm0, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
131 "pminub %%mm1, %%mm0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
132 ::"r"(d_idx),
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
133 "r"(ref[0]+b_idx),
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
134 "r"(mv[0]+b_idx)
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
135 );
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
136 } else {
10938
2a50b786b888 Fix h264_loop_filter_strength_mmx2() so it works with b frames.
michael
parents: 10937
diff changeset
137 __asm__ volatile(
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
138 "movd (%1), %%mm0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
139 "psubb (%1,%0), %%mm0 \n" // ref[b] != ref[bn]
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
140 "movq (%2), %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
141 "movq 8(%2), %%mm2 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
142 "psubw (%2,%0,4), %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
143 "psubw 8(%2,%0,4), %%mm2 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
144 "packsswb %%mm2, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
145 "paddb %%mm6, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
146 "psubusb %%mm5, %%mm1 \n" // abs(mv[b] - mv[bn]) >= limit
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
147 "packsswb %%mm1, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
148 "por %%mm1, %%mm0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
149 ::"r"(d_idx),
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
150 "r"(ref[0]+b_idx),
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
151 "r"(mv[0]+b_idx)
10938
2a50b786b888 Fix h264_loop_filter_strength_mmx2() so it works with b frames.
michael
parents: 10937
diff changeset
152 );
2a50b786b888 Fix h264_loop_filter_strength_mmx2() so it works with b frames.
michael
parents: 10937
diff changeset
153 }
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
154 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
155 __asm__ volatile(
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
156 "movd %0, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
157 "por %1, %%mm1 \n" // nnz[b] || nnz[bn]
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
158 ::"m"(nnz[b_idx]),
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
159 "m"(nnz[b_idx+d_idx])
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
160 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
161 __asm__ volatile(
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
162 "pminub %%mm7, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
163 "pminub %%mm7, %%mm0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
164 "psllw $1, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
165 "pxor %%mm2, %%mm2 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
166 "pmaxub %%mm0, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
167 "punpcklbw %%mm2, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
168 "movq %%mm1, %0 \n"
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
169 :"=m"(*bS[dir][edge])
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
170 ::"memory"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
171 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
172 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
173 edges = 4;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
174 step = 1;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
175 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
176 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
177 "movq (%0), %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
178 "movq 8(%0), %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
179 "movq 16(%0), %%mm2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
180 "movq 24(%0), %%mm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
181 TRANSPOSE4(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
182 "movq %%mm0, (%0) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
183 "movq %%mm3, 8(%0) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
184 "movq %%mm4, 16(%0) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
185 "movq %%mm2, 24(%0) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
186 ::"r"(bS[0])
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
187 :"memory"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
188 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
189 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
190
12454
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
191 #define LF_FUNC(DIR, TYPE, OPT) \
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
192 void ff_x264_deblock_ ## DIR ## _ ## TYPE ## _ ## OPT (uint8_t *pix, int stride, \
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
193 int alpha, int beta, int8_t *tc0);
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
194 #define LF_IFUNC(DIR, TYPE, OPT) \
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
195 void ff_x264_deblock_ ## DIR ## _ ## TYPE ## _ ## OPT (uint8_t *pix, int stride, \
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
196 int alpha, int beta);
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
197
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
198 LF_FUNC (h, chroma, mmxext)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
199 LF_IFUNC(h, chroma_intra, mmxext)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
200 LF_FUNC (v, chroma, mmxext)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
201 LF_IFUNC(v, chroma_intra, mmxext)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
202
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
203 LF_FUNC (h, luma, mmxext)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
204 LF_IFUNC(h, luma_intra, mmxext)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
205 #if HAVE_YASM && ARCH_X86_32
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
206 LF_FUNC (v8, luma, mmxext)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
207 static void ff_x264_deblock_v_luma_mmxext(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
208 {
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
209 if((tc0[0] & tc0[1]) >= 0)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
210 ff_x264_deblock_v8_luma_mmxext(pix+0, stride, alpha, beta, tc0);
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
211 if((tc0[2] & tc0[3]) >= 0)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
212 ff_x264_deblock_v8_luma_mmxext(pix+8, stride, alpha, beta, tc0+2);
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
213 }
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
214 LF_IFUNC(v8, luma_intra, mmxext)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
215 static void ff_x264_deblock_v_luma_intra_mmxext(uint8_t *pix, int stride, int alpha, int beta)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
216 {
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
217 ff_x264_deblock_v8_luma_intra_mmxext(pix+0, stride, alpha, beta);
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
218 ff_x264_deblock_v8_luma_intra_mmxext(pix+8, stride, alpha, beta);
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
219 }
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
220 #endif
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
221
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
222 LF_FUNC (h, luma, sse2)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
223 LF_IFUNC(h, luma_intra, sse2)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
224 LF_FUNC (v, luma, sse2)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
225 LF_IFUNC(v, luma_intra, sse2)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
226
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
227 /***********************************/
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
228 /* weighted prediction */
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
229
12451
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
230 #define H264_WEIGHT(W, H, OPT) \
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
231 void ff_h264_weight_ ## W ## x ## H ## _ ## OPT(uint8_t *dst, \
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
232 int stride, int log2_denom, int weight, int offset);
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
233
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
234 #define H264_BIWEIGHT(W, H, OPT) \
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
235 void ff_h264_biweight_ ## W ## x ## H ## _ ## OPT(uint8_t *dst, \
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
236 uint8_t *src, int stride, int log2_denom, int weightd, \
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
237 int weights, int offset);
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
238
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
239 #define H264_BIWEIGHT_MMX(W,H) \
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
240 H264_WEIGHT (W, H, mmx2) \
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
241 H264_BIWEIGHT(W, H, mmx2)
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
242
12451
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
243 #define H264_BIWEIGHT_MMX_SSE(W,H) \
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
244 H264_BIWEIGHT_MMX(W, H) \
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
245 H264_WEIGHT (W, H, sse2) \
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
246 H264_BIWEIGHT (W, H, sse2) \
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
247 H264_BIWEIGHT (W, H, ssse3)
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
248
12451
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
249 H264_BIWEIGHT_MMX_SSE(16, 16)
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
250 H264_BIWEIGHT_MMX_SSE(16, 8)
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
251 H264_BIWEIGHT_MMX_SSE( 8, 16)
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
252 H264_BIWEIGHT_MMX_SSE( 8, 8)
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
253 H264_BIWEIGHT_MMX_SSE( 8, 4)
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
254 H264_BIWEIGHT_MMX ( 4, 8)
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
255 H264_BIWEIGHT_MMX ( 4, 4)
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
256 H264_BIWEIGHT_MMX ( 4, 2)
12450
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
257
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
258 void ff_h264dsp_init_x86(H264DSPContext *c)
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
259 {
12475
9fef0a8ddd63 Move mm_support() from libavcodec to libavutil, make it a public
stefano
parents: 12456
diff changeset
260 int mm_flags = av_get_cpu_flags();
12450
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
261
12492
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
262 if (mm_flags & AV_CPU_FLAG_MMX2) {
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
263 c->h264_loop_filter_strength= h264_loop_filter_strength_mmx2;
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
264 }
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
265 #if HAVE_YASM
12456
a5ddb39627fd Rename FF_MM_ symbols related to CPU features flags as AV_CPU_FLAG_
stefano
parents: 12454
diff changeset
266 if (mm_flags & AV_CPU_FLAG_MMX) {
12450
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
267 c->h264_idct_dc_add=
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
268 c->h264_idct_add= ff_h264_idct_add_mmx;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
269 c->h264_idct8_dc_add=
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
270 c->h264_idct8_add= ff_h264_idct8_add_mmx;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
271
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
272 c->h264_idct_add16 = ff_h264_idct_add16_mmx;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
273 c->h264_idct8_add4 = ff_h264_idct8_add4_mmx;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
274 c->h264_idct_add8 = ff_h264_idct_add8_mmx;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
275 c->h264_idct_add16intra= ff_h264_idct_add16intra_mmx;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
276
12456
a5ddb39627fd Rename FF_MM_ symbols related to CPU features flags as AV_CPU_FLAG_
stefano
parents: 12454
diff changeset
277 if (mm_flags & AV_CPU_FLAG_MMX2) {
12450
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
278 c->h264_idct_dc_add= ff_h264_idct_dc_add_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
279 c->h264_idct8_dc_add= ff_h264_idct8_dc_add_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
280 c->h264_idct_add16 = ff_h264_idct_add16_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
281 c->h264_idct8_add4 = ff_h264_idct8_add4_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
282 c->h264_idct_add8 = ff_h264_idct_add8_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
283 c->h264_idct_add16intra= ff_h264_idct_add16intra_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
284
12454
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
285 c->h264_v_loop_filter_chroma= ff_x264_deblock_v_chroma_mmxext;
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
286 c->h264_h_loop_filter_chroma= ff_x264_deblock_h_chroma_mmxext;
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
287 c->h264_v_loop_filter_chroma_intra= ff_x264_deblock_v_chroma_intra_mmxext;
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
288 c->h264_h_loop_filter_chroma_intra= ff_x264_deblock_h_chroma_intra_mmxext;
12451
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
289 #if ARCH_X86_32
12454
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
290 c->h264_v_loop_filter_luma= ff_x264_deblock_v_luma_mmxext;
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
291 c->h264_h_loop_filter_luma= ff_x264_deblock_h_luma_mmxext;
12451
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
292 c->h264_v_loop_filter_luma_intra = ff_x264_deblock_v_luma_intra_mmxext;
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
293 c->h264_h_loop_filter_luma_intra = ff_x264_deblock_h_luma_intra_mmxext;
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
294 #endif
12450
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
295 c->weight_h264_pixels_tab[0]= ff_h264_weight_16x16_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
296 c->weight_h264_pixels_tab[1]= ff_h264_weight_16x8_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
297 c->weight_h264_pixels_tab[2]= ff_h264_weight_8x16_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
298 c->weight_h264_pixels_tab[3]= ff_h264_weight_8x8_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
299 c->weight_h264_pixels_tab[4]= ff_h264_weight_8x4_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
300 c->weight_h264_pixels_tab[5]= ff_h264_weight_4x8_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
301 c->weight_h264_pixels_tab[6]= ff_h264_weight_4x4_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
302 c->weight_h264_pixels_tab[7]= ff_h264_weight_4x2_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
303
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
304 c->biweight_h264_pixels_tab[0]= ff_h264_biweight_16x16_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
305 c->biweight_h264_pixels_tab[1]= ff_h264_biweight_16x8_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
306 c->biweight_h264_pixels_tab[2]= ff_h264_biweight_8x16_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
307 c->biweight_h264_pixels_tab[3]= ff_h264_biweight_8x8_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
308 c->biweight_h264_pixels_tab[4]= ff_h264_biweight_8x4_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
309 c->biweight_h264_pixels_tab[5]= ff_h264_biweight_4x8_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
310 c->biweight_h264_pixels_tab[6]= ff_h264_biweight_4x4_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
311 c->biweight_h264_pixels_tab[7]= ff_h264_biweight_4x2_mmx2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
312
12456
a5ddb39627fd Rename FF_MM_ symbols related to CPU features flags as AV_CPU_FLAG_
stefano
parents: 12454
diff changeset
313 if (mm_flags&AV_CPU_FLAG_SSE2) {
12492
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
314 c->h264_idct8_add = ff_h264_idct8_add_sse2;
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
315 c->h264_idct8_add4= ff_h264_idct8_add4_sse2;
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
316
12451
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
317 c->weight_h264_pixels_tab[0]= ff_h264_weight_16x16_sse2;
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
318 c->weight_h264_pixels_tab[1]= ff_h264_weight_16x8_sse2;
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
319 c->weight_h264_pixels_tab[2]= ff_h264_weight_8x16_sse2;
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
320 c->weight_h264_pixels_tab[3]= ff_h264_weight_8x8_sse2;
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
321 c->weight_h264_pixels_tab[4]= ff_h264_weight_8x4_sse2;
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
322
12450
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
323 c->biweight_h264_pixels_tab[0]= ff_h264_biweight_16x16_sse2;
12451
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
324 c->biweight_h264_pixels_tab[1]= ff_h264_biweight_16x8_sse2;
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
325 c->biweight_h264_pixels_tab[2]= ff_h264_biweight_8x16_sse2;
12450
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
326 c->biweight_h264_pixels_tab[3]= ff_h264_biweight_8x8_sse2;
12451
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
327 c->biweight_h264_pixels_tab[4]= ff_h264_biweight_8x4_sse2;
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
328
12450
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
329 #if ARCH_X86_64 || !defined(__ICC) || __ICC > 1110
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
330 c->h264_v_loop_filter_luma = ff_x264_deblock_v_luma_sse2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
331 c->h264_h_loop_filter_luma = ff_x264_deblock_h_luma_sse2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
332 c->h264_v_loop_filter_luma_intra = ff_x264_deblock_v_luma_intra_sse2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
333 c->h264_h_loop_filter_luma_intra = ff_x264_deblock_h_luma_intra_sse2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
334 #endif
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
335 c->h264_idct_add16 = ff_h264_idct_add16_sse2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
336 c->h264_idct_add8 = ff_h264_idct_add8_sse2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
337 c->h264_idct_add16intra = ff_h264_idct_add16intra_sse2;
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
338 }
12456
a5ddb39627fd Rename FF_MM_ symbols related to CPU features flags as AV_CPU_FLAG_
stefano
parents: 12454
diff changeset
339 if (mm_flags&AV_CPU_FLAG_SSSE3) {
12450
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
340 c->biweight_h264_pixels_tab[0]= ff_h264_biweight_16x16_ssse3;
12451
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
341 c->biweight_h264_pixels_tab[1]= ff_h264_biweight_16x8_ssse3;
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
342 c->biweight_h264_pixels_tab[2]= ff_h264_biweight_8x16_ssse3;
12450
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
343 c->biweight_h264_pixels_tab[3]= ff_h264_biweight_8x8_ssse3;
12451
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
344 c->biweight_h264_pixels_tab[4]= ff_h264_biweight_8x4_ssse3;
12450
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
345 }
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
346 }
12492
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
347 }
12450
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
348 #endif
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
349 }