annotate x86/h264dsp_mmx.c @ 12530:63edd10ad4bc libavcodec tip

Try to fix crashes introduced by r25218 r25218 made assumptions about the existence of past reference frames that weren't necessarily true.
author darkshikari
date Tue, 28 Sep 2010 09:06:22 +0000
parents 58bd8cb86f5d
children
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;
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
27
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
28 /***********************************/
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
29 /* IDCT */
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
30
12492
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
31 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
32 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
33 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
34 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
35 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
36
12492
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
37 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
38 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
39 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
40 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
41 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
42 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
43 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
44 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
45 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
46 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
47 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
48 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
49 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
50 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
51 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
52 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
53 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
54 DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
55
12492
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
56 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
57 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
58 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
59 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
60 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
61 int stride, const uint8_t nnzc[6*8]);
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
62
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
63 /***********************************/
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
64 /* deblocking */
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
65
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
66 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
67 int bidir, int edges, int step, int mask_mv0, int mask_mv1, int field ) {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
68 int dir;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
69 __asm__ volatile(
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
70 "movq %0, %%mm7 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
71 "movq %1, %%mm6 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
72 ::"m"(ff_pb_1), "m"(ff_pb_3)
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
73 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
74 if(field)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
75 __asm__ volatile(
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
76 "movq %0, %%mm6 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
77 ::"m"(ff_pb_3_1)
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
78 );
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
79 __asm__ volatile(
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
80 "movq %%mm6, %%mm5 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
81 "paddb %%mm5, %%mm5 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
82 :);
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
83
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
84 // 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
85 // average filter time by 1.2%
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
86 for( dir=1; dir>=0; dir-- ) {
10953
eb9a2581f50e Attempt to fix asm compilation failure.
michael
parents: 10943
diff changeset
87 const x86_reg d_idx = dir ? -8 : -1;
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
88 const int mask_mv = dir ? mask_mv1 : mask_mv0;
11369
98970e51365a Remove DECLARE_ALIGNED_{8,16} macros
mru
parents: 11017
diff changeset
89 DECLARE_ALIGNED(8, const uint64_t, mask_dir) = dir ? 0 : 0xffffffffffffffffULL;
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
90 int b_idx, edge;
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
91 for( b_idx=12, edge=0; edge<edges; edge+=step, b_idx+=8*step ) {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
92 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
93 "pand %0, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
94 ::"m"(mask_dir)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
95 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
96 if(!(mask_mv & edge)) {
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
97 if(bidir) {
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
98 __asm__ volatile(
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
99 "movd (%1,%0), %%mm2 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
100 "punpckldq 40(%1,%0), %%mm2 \n" // { ref0[bn], ref1[bn] }
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
101 "pshufw $0x44, (%1), %%mm0 \n" // { ref0[b], ref0[b] }
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
102 "pshufw $0x44, 40(%1), %%mm1 \n" // { ref1[b], ref1[b] }
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
103 "pshufw $0x4E, %%mm2, %%mm3 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
104 "psubb %%mm2, %%mm0 \n" // { ref0[b]!=ref0[bn], ref0[b]!=ref1[bn] }
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
105 "psubb %%mm3, %%mm1 \n" // { ref1[b]!=ref1[bn], ref1[b]!=ref0[bn] }
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
106 "1: \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
107 "por %%mm1, %%mm0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
108 "movq (%2,%0,4), %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
109 "movq 8(%2,%0,4), %%mm2 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
110 "movq %%mm1, %%mm3 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
111 "movq %%mm2, %%mm4 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
112 "psubw (%2), %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
113 "psubw 8(%2), %%mm2 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
114 "psubw 160(%2), %%mm3 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
115 "psubw 168(%2), %%mm4 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
116 "packsswb %%mm2, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
117 "packsswb %%mm4, %%mm3 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
118 "paddb %%mm6, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
119 "paddb %%mm6, %%mm3 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
120 "psubusb %%mm5, %%mm1 \n" // abs(mv[b] - mv[bn]) >= limit
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
121 "psubusb %%mm5, %%mm3 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
122 "packsswb %%mm3, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
123 "add $40, %0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
124 "cmp $40, %0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
125 "jl 1b \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
126 "sub $80, %0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
127 "pshufw $0x4E, %%mm1, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
128 "por %%mm1, %%mm0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
129 "pshufw $0x4E, %%mm0, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
130 "pminub %%mm1, %%mm0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
131 ::"r"(d_idx),
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
132 "r"(ref[0]+b_idx),
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
133 "r"(mv[0]+b_idx)
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
134 );
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
135 } else {
10938
2a50b786b888 Fix h264_loop_filter_strength_mmx2() so it works with b frames.
michael
parents: 10937
diff changeset
136 __asm__ volatile(
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
137 "movd (%1), %%mm0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
138 "psubb (%1,%0), %%mm0 \n" // ref[b] != ref[bn]
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
139 "movq (%2), %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
140 "movq 8(%2), %%mm2 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
141 "psubw (%2,%0,4), %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
142 "psubw 8(%2,%0,4), %%mm2 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
143 "packsswb %%mm2, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
144 "paddb %%mm6, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
145 "psubusb %%mm5, %%mm1 \n" // abs(mv[b] - mv[bn]) >= limit
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
146 "packsswb %%mm1, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
147 "por %%mm1, %%mm0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
148 ::"r"(d_idx),
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
149 "r"(ref[0]+b_idx),
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
150 "r"(mv[0]+b_idx)
10938
2a50b786b888 Fix h264_loop_filter_strength_mmx2() so it works with b frames.
michael
parents: 10937
diff changeset
151 );
2a50b786b888 Fix h264_loop_filter_strength_mmx2() so it works with b frames.
michael
parents: 10937
diff changeset
152 }
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
153 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
154 __asm__ volatile(
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
155 "movd %0, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
156 "por %1, %%mm1 \n" // nnz[b] || nnz[bn]
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
157 ::"m"(nnz[b_idx]),
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
158 "m"(nnz[b_idx+d_idx])
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
159 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
160 __asm__ volatile(
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
161 "pminub %%mm7, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
162 "pminub %%mm7, %%mm0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
163 "psllw $1, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
164 "pxor %%mm2, %%mm2 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
165 "pmaxub %%mm0, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
166 "punpcklbw %%mm2, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
167 "movq %%mm1, %0 \n"
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
168 :"=m"(*bS[dir][edge])
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
169 ::"memory"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
170 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
171 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
172 edges = 4;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
173 step = 1;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
174 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
175 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
176 "movq (%0), %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
177 "movq 8(%0), %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
178 "movq 16(%0), %%mm2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
179 "movq 24(%0), %%mm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
180 TRANSPOSE4(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
181 "movq %%mm0, (%0) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
182 "movq %%mm3, 8(%0) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
183 "movq %%mm4, 16(%0) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
184 "movq %%mm2, 24(%0) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
185 ::"r"(bS[0])
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
186 :"memory"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
187 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
188 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
189
12454
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
190 #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
191 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
192 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
193 #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
194 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
195 int alpha, int beta);
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
196
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
197 LF_FUNC (h, chroma, mmxext)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
198 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
199 LF_FUNC (v, chroma, mmxext)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
200 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
201
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
202 LF_FUNC (h, luma, mmxext)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
203 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
204 #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
205 LF_FUNC (v8, luma, mmxext)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
206 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
207 {
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
208 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
209 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
210 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
211 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
212 }
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
213 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
214 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
215 {
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
216 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
217 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
218 }
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
219 #endif
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
220
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
221 LF_FUNC (h, luma, sse2)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
222 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
223 LF_FUNC (v, luma, sse2)
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
224 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
225
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
226 /***********************************/
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
227 /* weighted prediction */
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
228
12451
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
229 #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
230 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
231 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
232
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
233 #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
234 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
235 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
236 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
237
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
238 #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
239 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
240 H264_BIWEIGHT(W, H, mmx2)
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
241
12451
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
242 #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
243 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
244 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
245 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
246 H264_BIWEIGHT (W, H, ssse3)
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
247
12451
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
248 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
249 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
250 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
251 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
252 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
253 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
254 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
255 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
256
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
257 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
258 {
12475
9fef0a8ddd63 Move mm_support() from libavcodec to libavutil, make it a public
stefano
parents: 12456
diff changeset
259 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
260
12492
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
261 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
262 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
263 }
58a960d6e34c Rename h264_idct_sse2.asm to h264_idct.asm; move inline IDCT asm from
rbultje
parents: 12480
diff changeset
264 #if HAVE_YASM
12456
a5ddb39627fd Rename FF_MM_ symbols related to CPU features flags as AV_CPU_FLAG_
stefano
parents: 12454
diff changeset
265 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
266 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
267 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
268 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
269 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
270
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
271 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
272 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
273 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
274 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
275
12456
a5ddb39627fd Rename FF_MM_ symbols related to CPU features flags as AV_CPU_FLAG_
stefano
parents: 12454
diff changeset
276 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
277 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
278 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
279 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
280 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
281 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
282 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
283
12454
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
284 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
285 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
286 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
287 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
288 #if ARCH_X86_32
12454
f4355cd85faa Port latest x264 deblock asm (before they moved to using NV12 as internal
rbultje
parents: 12451
diff changeset
289 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
290 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
291 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
292 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
293 #endif
12450
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
294 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
295 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
296 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
297 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
298 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
299 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
300 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
301 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
302
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
303 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
304 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
305 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
306 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
307 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
308 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
309 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
310 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
311
12456
a5ddb39627fd Rename FF_MM_ symbols related to CPU features flags as AV_CPU_FLAG_
stefano
parents: 12454
diff changeset
312 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
313 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
314 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
315
12451
4c3e6ff1237e Rename h264_weight_sse2.asm to h264_weight.asm; add 16x8/8x16/8x4 non-square
rbultje
parents: 12450
diff changeset
316 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
317 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
318 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
319 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
320 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
321
12450
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
322 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
323 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
324 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
325 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
326 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
327
12505
b2d560458a72 x86: disable SSE functions using stack when stack is not aligned
mru
parents: 12502
diff changeset
328 #if HAVE_ALIGNED_STACK
12450
3941687b4fa9 Split h264dsp_mmx.c (which was #included in dsputil_mmx.c) in h264_qpel_mmx.c,
rbultje
parents: 12438
diff changeset
329 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
330 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
331 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
332 c->h264_h_loop_filter_luma_intra = ff_x264_deblock_h_luma_intra_sse2;
12505
b2d560458a72 x86: disable SSE functions using stack when stack is not aligned
mru
parents: 12502
diff changeset
333 #endif
12502
6bc14239edfb x86: remove hack disabling sse2 h264 loop filter with 32-bit icc
mru
parents: 12492
diff changeset
334
12450
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 }