annotate i386/fdct_mmx.c @ 4016:29ea06410ce7 libavcodec

simplify escape decoding
author michael
date Fri, 13 Oct 2006 16:19:15 +0000
parents c8c591fe26f8
children 608e2dfcb86e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
1 /*
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
2 * MMX optimized forward DCT
429
718a22dc121f license/copyright change
glantau
parents: 72
diff changeset
3 * The gcc porting is Copyright (c) 2001 Fabrice Bellard.
1739
07a484280a82 copyright year update of the files i touched and remembered, things look annoyingly unmaintained otherwise
michael
parents: 1575
diff changeset
4 * cleanup/optimizations are Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
1765
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
5 * SSE2 optimization is Copyright (c) 2004 Denes Balatoni.
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
6 *
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
7 * from fdctam32.c - AP922 MMX(3D-Now) forward-DCT
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
8 *
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
9 * Intel Application Note AP-922 - fast, precise implementation of DCT
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
10 * http://developer.intel.com/vtune/cbts/appnotes.htm
1765
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
11 *
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
12 * Also of inspiration:
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
13 * a page about fdct at http://www.geocities.com/ssavekar/dct.htm
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
14 * Skal's fdct at http://skal.planet-d.net/coding/dct.html
3699
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 3588
diff changeset
15 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3699
diff changeset
16 * This file is part of FFmpeg.
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3699
diff changeset
17 *
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3699
diff changeset
18 * FFmpeg is free software; you can redistribute it and/or
3699
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 3588
diff changeset
19 * modify it under the terms of the GNU Lesser General Public
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 3588
diff changeset
20 * License as published by the Free Software Foundation; either
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3699
diff changeset
21 * version 2.1 of the License, or (at your option) any later version.
3699
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 3588
diff changeset
22 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3699
diff changeset
23 * FFmpeg is distributed in the hope that it will be useful,
3699
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 3588
diff changeset
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 3588
diff changeset
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 3588
diff changeset
26 * Lesser General Public License for more details.
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 3588
diff changeset
27 *
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 3588
diff changeset
28 * You should have received a copy of the GNU Lesser General Public
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3699
diff changeset
29 * License along with FFmpeg; if not, write to the Free Software
3699
c537a97eec66 Add official LGPL license headers to the files that were missing them.
diego
parents: 3588
diff changeset
30 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
31 */
2817
b128802eb77b libavutil: Utility code from libavcodec moved to a separate library.
al
parents: 2293
diff changeset
32 #include "common.h"
2024
f65d87bfdd5a some of the warning fixes by (Michael Roitzsch <mroi at users dot sourceforge dot net>)
michael
parents: 1998
diff changeset
33 #include "../dsputil.h"
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
34 #include "mmx.h"
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
35
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
36 #define ATTR_ALIGN(align) __attribute__ ((__aligned__ (align)))
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
37
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
38 //////////////////////////////////////////////////////////////////////
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
39 //
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
40 // constants for the forward DCT
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
41 // -----------------------------
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
42 //
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
43 // Be sure to check that your compiler is aligning all constants to QWORD
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
44 // (8-byte) memory boundaries! Otherwise the unaligned memory access will
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
45 // severely stall MMX execution.
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
46 //
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
47 //////////////////////////////////////////////////////////////////////
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
48
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
49 #define BITS_FRW_ACC 3 //; 2 or 3 for accuracy
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
50 #define SHIFT_FRW_COL BITS_FRW_ACC
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
51 #define SHIFT_FRW_ROW (BITS_FRW_ACC + 17 - 3)
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
52 #define RND_FRW_ROW (1 << (SHIFT_FRW_ROW-1))
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
53 //#define RND_FRW_COL (1 << (SHIFT_FRW_COL-1))
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
54
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
55 //concatenated table, for forward DCT transformation
839
b7e2b8129211 cleanup
michaelni
parents: 687
diff changeset
56 static const int16_t fdct_tg_all_16[] ATTR_ALIGN(8) = {
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
57 13036, 13036, 13036, 13036, // tg * (2<<16) + 0.5
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
58 27146, 27146, 27146, 27146, // tg * (2<<16) + 0.5
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
59 -21746, -21746, -21746, -21746, // tg * (2<<16) + 0.5
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
60 };
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
61
839
b7e2b8129211 cleanup
michaelni
parents: 687
diff changeset
62 static const int16_t ocos_4_16[4] ATTR_ALIGN(8) = {
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
63 23170, 23170, 23170, 23170, //cos * (2<<15) + 0.5
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
64 };
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
65
2293
15cfba1b97b5 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents: 2024
diff changeset
66 static const int64_t fdct_one_corr ATTR_ALIGN(8) = 0x0001000100010001LL;
1765
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
67
2293
15cfba1b97b5 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents: 2024
diff changeset
68 static const int32_t fdct_r_row[2] ATTR_ALIGN(8) = {RND_FRW_ROW, RND_FRW_ROW };
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
69
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
70 struct
1933
12408a3bf741 fixing alignment problems -> SSE2 support enabled again in libavcodec (from ffdshow / milan_cutka)
michael
parents: 1765
diff changeset
71 {
2293
15cfba1b97b5 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents: 2024
diff changeset
72 const int32_t fdct_r_row_sse2[4] ATTR_ALIGN(16);
1933
12408a3bf741 fixing alignment problems -> SSE2 support enabled again in libavcodec (from ffdshow / milan_cutka)
michael
parents: 1765
diff changeset
73 } fdct_r_row_sse2 ATTR_ALIGN(16)=
12408a3bf741 fixing alignment problems -> SSE2 support enabled again in libavcodec (from ffdshow / milan_cutka)
michael
parents: 1765
diff changeset
74 {{
12408a3bf741 fixing alignment problems -> SSE2 support enabled again in libavcodec (from ffdshow / milan_cutka)
michael
parents: 1765
diff changeset
75 RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW
12408a3bf741 fixing alignment problems -> SSE2 support enabled again in libavcodec (from ffdshow / milan_cutka)
michael
parents: 1765
diff changeset
76 }};
12408a3bf741 fixing alignment problems -> SSE2 support enabled again in libavcodec (from ffdshow / milan_cutka)
michael
parents: 1765
diff changeset
77 //static const long fdct_r_row_sse2[4] ATTR_ALIGN(16) = {RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW};
1765
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
78
839
b7e2b8129211 cleanup
michaelni
parents: 687
diff changeset
79 static const int16_t tab_frw_01234567[] ATTR_ALIGN(8) = { // forward_dct coeff table
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
80 16384, 16384, 22725, 19266,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
81 16384, 16384, 12873, 4520,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
82 21407, 8867, 19266, -4520,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
83 -8867, -21407, -22725, -12873,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
84 16384, -16384, 12873, -22725,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
85 -16384, 16384, 4520, 19266,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
86 8867, -21407, 4520, -12873,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
87 21407, -8867, 19266, -22725,
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
88
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
89 22725, 22725, 31521, 26722,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
90 22725, 22725, 17855, 6270,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
91 29692, 12299, 26722, -6270,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
92 -12299, -29692, -31521, -17855,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
93 22725, -22725, 17855, -31521,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
94 -22725, 22725, 6270, 26722,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
95 12299, -29692, 6270, -17855,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
96 29692, -12299, 26722, -31521,
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
97
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
98 21407, 21407, 29692, 25172,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
99 21407, 21407, 16819, 5906,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
100 27969, 11585, 25172, -5906,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
101 -11585, -27969, -29692, -16819,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
102 21407, -21407, 16819, -29692,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
103 -21407, 21407, 5906, 25172,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
104 11585, -27969, 5906, -16819,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
105 27969, -11585, 25172, -29692,
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
106
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
107 19266, 19266, 26722, 22654,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
108 19266, 19266, 15137, 5315,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
109 25172, 10426, 22654, -5315,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
110 -10426, -25172, -26722, -15137,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
111 19266, -19266, 15137, -26722,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
112 -19266, 19266, 5315, 22654,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
113 10426, -25172, 5315, -15137,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
114 25172, -10426, 22654, -26722,
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
115
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
116 16384, 16384, 22725, 19266,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
117 16384, 16384, 12873, 4520,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
118 21407, 8867, 19266, -4520,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
119 -8867, -21407, -22725, -12873,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
120 16384, -16384, 12873, -22725,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
121 -16384, 16384, 4520, 19266,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
122 8867, -21407, 4520, -12873,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
123 21407, -8867, 19266, -22725,
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
124
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
125 19266, 19266, 26722, 22654,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
126 19266, 19266, 15137, 5315,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
127 25172, 10426, 22654, -5315,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
128 -10426, -25172, -26722, -15137,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
129 19266, -19266, 15137, -26722,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
130 -19266, 19266, 5315, 22654,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
131 10426, -25172, 5315, -15137,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
132 25172, -10426, 22654, -26722,
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
133
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
134 21407, 21407, 29692, 25172,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
135 21407, 21407, 16819, 5906,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
136 27969, 11585, 25172, -5906,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
137 -11585, -27969, -29692, -16819,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
138 21407, -21407, 16819, -29692,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
139 -21407, 21407, 5906, 25172,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
140 11585, -27969, 5906, -16819,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
141 27969, -11585, 25172, -29692,
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
142
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
143 22725, 22725, 31521, 26722,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
144 22725, 22725, 17855, 6270,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
145 29692, 12299, 26722, -6270,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
146 -12299, -29692, -31521, -17855,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
147 22725, -22725, 17855, -31521,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
148 -22725, 22725, 6270, 26722,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
149 12299, -29692, 6270, -17855,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
150 29692, -12299, 26722, -31521,
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
151 };
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
152
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
153 struct
1933
12408a3bf741 fixing alignment problems -> SSE2 support enabled again in libavcodec (from ffdshow / milan_cutka)
michael
parents: 1765
diff changeset
154 {
12408a3bf741 fixing alignment problems -> SSE2 support enabled again in libavcodec (from ffdshow / milan_cutka)
michael
parents: 1765
diff changeset
155 const int16_t tab_frw_01234567_sse2[256] ATTR_ALIGN(16);
12408a3bf741 fixing alignment problems -> SSE2 support enabled again in libavcodec (from ffdshow / milan_cutka)
michael
parents: 1765
diff changeset
156 } tab_frw_01234567_sse2 ATTR_ALIGN(16) =
12408a3bf741 fixing alignment problems -> SSE2 support enabled again in libavcodec (from ffdshow / milan_cutka)
michael
parents: 1765
diff changeset
157 {{
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
158 //static const int16_t tab_frw_01234567_sse2[] ATTR_ALIGN(16) = { // forward_dct coeff table
1765
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
159 #define TABLE_SSE2 C4, C4, C1, C3, -C6, -C2, -C1, -C5, \
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
160 C4, C4, C5, C7, C2, C6, C3, -C7, \
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
161 -C4, C4, C7, C3, C6, -C2, C7, -C5, \
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
162 C4, -C4, C5, -C1, C2, -C6, C3, -C1,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
163 // c1..c7 * cos(pi/4) * 2^15
1765
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
164 #define C1 22725
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
165 #define C2 21407
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
166 #define C3 19266
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
167 #define C4 16384
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
168 #define C5 12873
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
169 #define C6 8867
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
170 #define C7 4520
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
171 TABLE_SSE2
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
172
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
173 #undef C1
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
174 #undef C2
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
175 #undef C3
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
176 #undef C4
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
177 #undef C5
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
178 #undef C6
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
179 #undef C7
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
180 #define C1 31521
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
181 #define C2 29692
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
182 #define C3 26722
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
183 #define C4 22725
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
184 #define C5 17855
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
185 #define C6 12299
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
186 #define C7 6270
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
187 TABLE_SSE2
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
188
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
189 #undef C1
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
190 #undef C2
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
191 #undef C3
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
192 #undef C4
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
193 #undef C5
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
194 #undef C6
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
195 #undef C7
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
196 #define C1 29692
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
197 #define C2 27969
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
198 #define C3 25172
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
199 #define C4 21407
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
200 #define C5 16819
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
201 #define C6 11585
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
202 #define C7 5906
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
203 TABLE_SSE2
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
204
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
205 #undef C1
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
206 #undef C2
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
207 #undef C3
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
208 #undef C4
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
209 #undef C5
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
210 #undef C6
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
211 #undef C7
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
212 #define C1 26722
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
213 #define C2 25172
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
214 #define C3 22654
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
215 #define C4 19266
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
216 #define C5 15137
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
217 #define C6 10426
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
218 #define C7 5315
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
219 TABLE_SSE2
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
220
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
221 #undef C1
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
222 #undef C2
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
223 #undef C3
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
224 #undef C4
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
225 #undef C5
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
226 #undef C6
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
227 #undef C7
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
228 #define C1 22725
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
229 #define C2 21407
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
230 #define C3 19266
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
231 #define C4 16384
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
232 #define C5 12873
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
233 #define C6 8867
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
234 #define C7 4520
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
235 TABLE_SSE2
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
236
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
237 #undef C1
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
238 #undef C2
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
239 #undef C3
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
240 #undef C4
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
241 #undef C5
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
242 #undef C6
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
243 #undef C7
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
244 #define C1 26722
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
245 #define C2 25172
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
246 #define C3 22654
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
247 #define C4 19266
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
248 #define C5 15137
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
249 #define C6 10426
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
250 #define C7 5315
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
251 TABLE_SSE2
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
252
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
253 #undef C1
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
254 #undef C2
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
255 #undef C3
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
256 #undef C4
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
257 #undef C5
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
258 #undef C6
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
259 #undef C7
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
260 #define C1 29692
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
261 #define C2 27969
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
262 #define C3 25172
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
263 #define C4 21407
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
264 #define C5 16819
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
265 #define C6 11585
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
266 #define C7 5906
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
267 TABLE_SSE2
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
268
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
269 #undef C1
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
270 #undef C2
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
271 #undef C3
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
272 #undef C4
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
273 #undef C5
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
274 #undef C6
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
275 #undef C7
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
276 #define C1 31521
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
277 #define C2 29692
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
278 #define C3 26722
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
279 #define C4 22725
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
280 #define C5 17855
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
281 #define C6 12299
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
282 #define C7 6270
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
283 TABLE_SSE2
1933
12408a3bf741 fixing alignment problems -> SSE2 support enabled again in libavcodec (from ffdshow / milan_cutka)
michael
parents: 1765
diff changeset
284 }};
12408a3bf741 fixing alignment problems -> SSE2 support enabled again in libavcodec (from ffdshow / milan_cutka)
michael
parents: 1765
diff changeset
285
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
286
1564
b6b7d080f1a1 inline -> always_inline (842 -> 690 cpu cycles for dct_quantize() difference for the dct itself should be even bigger)
michael
parents: 839
diff changeset
287 static always_inline void fdct_col(const int16_t *in, int16_t *out, int offset)
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
288 {
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
289 movq_m2r(*(in + offset + 1 * 8), mm0);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
290 movq_m2r(*(in + offset + 6 * 8), mm1);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
291 movq_r2r(mm0, mm2);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
292 movq_m2r(*(in + offset + 2 * 8), mm3);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
293 paddsw_r2r(mm1, mm0);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
294 movq_m2r(*(in + offset + 5 * 8), mm4);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
295 psllw_i2r(SHIFT_FRW_COL, mm0);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
296 movq_m2r(*(in + offset + 0 * 8), mm5);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
297 paddsw_r2r(mm3, mm4);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
298 paddsw_m2r(*(in + offset + 7 * 8), mm5);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
299 psllw_i2r(SHIFT_FRW_COL, mm4);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
300 movq_r2r(mm0, mm6);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
301 psubsw_r2r(mm1, mm2);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
302 movq_m2r(*(fdct_tg_all_16 + 4), mm1);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
303 psubsw_r2r(mm4, mm0);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
304 movq_m2r(*(in + offset + 3 * 8), mm7);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
305 pmulhw_r2r(mm0, mm1);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
306 paddsw_m2r(*(in + offset + 4 * 8), mm7);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
307 psllw_i2r(SHIFT_FRW_COL, mm5);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
308 paddsw_r2r(mm4, mm6);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
309 psllw_i2r(SHIFT_FRW_COL, mm7);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
310 movq_r2r(mm5, mm4);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
311 psubsw_r2r(mm7, mm5);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
312 paddsw_r2r(mm5, mm1);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
313 paddsw_r2r(mm7, mm4);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
314 por_m2r(fdct_one_corr, mm1);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
315 psllw_i2r(SHIFT_FRW_COL + 1, mm2);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
316 pmulhw_m2r(*(fdct_tg_all_16 + 4), mm5);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
317 movq_r2r(mm4, mm7);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
318 psubsw_m2r(*(in + offset + 5 * 8), mm3);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
319 psubsw_r2r(mm6, mm4);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
320 movq_r2m(mm1, *(out + offset + 2 * 8));
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
321 paddsw_r2r(mm6, mm7);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
322 movq_m2r(*(in + offset + 3 * 8), mm1);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
323 psllw_i2r(SHIFT_FRW_COL + 1, mm3);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
324 psubsw_m2r(*(in + offset + 4 * 8), mm1);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
325 movq_r2r(mm2, mm6);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
326 movq_r2m(mm4, *(out + offset + 4 * 8));
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
327 paddsw_r2r(mm3, mm2);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
328 pmulhw_m2r(*ocos_4_16, mm2);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
329 psubsw_r2r(mm3, mm6);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
330 pmulhw_m2r(*ocos_4_16, mm6);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
331 psubsw_r2r(mm0, mm5);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
332 por_m2r(fdct_one_corr, mm5);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
333 psllw_i2r(SHIFT_FRW_COL, mm1);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
334 por_m2r(fdct_one_corr, mm2);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
335 movq_r2r(mm1, mm4);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
336 movq_m2r(*(in + offset + 0 * 8), mm3);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
337 paddsw_r2r(mm6, mm1);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
338 psubsw_m2r(*(in + offset + 7 * 8), mm3);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
339 psubsw_r2r(mm6, mm4);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
340 movq_m2r(*(fdct_tg_all_16 + 0), mm0);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
341 psllw_i2r(SHIFT_FRW_COL, mm3);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
342 movq_m2r(*(fdct_tg_all_16 + 8), mm6);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
343 pmulhw_r2r(mm1, mm0);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
344 movq_r2m(mm7, *(out + offset + 0 * 8));
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
345 pmulhw_r2r(mm4, mm6);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
346 movq_r2m(mm5, *(out + offset + 6 * 8));
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
347 movq_r2r(mm3, mm7);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
348 movq_m2r(*(fdct_tg_all_16 + 8), mm5);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
349 psubsw_r2r(mm2, mm7);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
350 paddsw_r2r(mm2, mm3);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
351 pmulhw_r2r(mm7, mm5);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
352 paddsw_r2r(mm3, mm0);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
353 paddsw_r2r(mm4, mm6);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
354 pmulhw_m2r(*(fdct_tg_all_16 + 0), mm3);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
355 por_m2r(fdct_one_corr, mm0);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
356 paddsw_r2r(mm7, mm5);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
357 psubsw_r2r(mm6, mm7);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
358 movq_r2m(mm0, *(out + offset + 1 * 8));
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
359 paddsw_r2r(mm4, mm5);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
360 movq_r2m(mm7, *(out + offset + 3 * 8));
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
361 psubsw_r2r(mm1, mm3);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
362 movq_r2m(mm5, *(out + offset + 5 * 8));
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
363 movq_r2m(mm3, *(out + offset + 7 * 8));
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
364 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
365
1765
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
366
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
367 static always_inline void fdct_row_sse2(const int16_t *in, int16_t *out)
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
368 {
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
369 asm volatile(
3564
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
370 #define FDCT_ROW_SSE2_H1(i,t) \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
371 "movq " #i "(%0), %%xmm2 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
372 "movq " #i "+8(%0), %%xmm0 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
373 "movdqa " #t "+32(%1), %%xmm3 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
374 "movdqa " #t "+48(%1), %%xmm7 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
375 "movdqa " #t "(%1), %%xmm4 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
376 "movdqa " #t "+16(%1), %%xmm5 \n\t"
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
377
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
378 #define FDCT_ROW_SSE2_H2(i,t) \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
379 "movq " #i "(%0), %%xmm2 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
380 "movq " #i "+8(%0), %%xmm0 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
381 "movdqa " #t "+32(%1), %%xmm3 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
382 "movdqa " #t "+48(%1), %%xmm7 \n\t"
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
383
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
384 #define FDCT_ROW_SSE2(i) \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
385 "movq %%xmm2, %%xmm1 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
386 "pshuflw $27, %%xmm0, %%xmm0 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
387 "paddsw %%xmm0, %%xmm1 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
388 "psubsw %%xmm0, %%xmm2 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
389 "punpckldq %%xmm2, %%xmm1 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
390 "pshufd $78, %%xmm1, %%xmm2 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
391 "pmaddwd %%xmm2, %%xmm3 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
392 "pmaddwd %%xmm1, %%xmm7 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
393 "pmaddwd %%xmm5, %%xmm2 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
394 "pmaddwd %%xmm4, %%xmm1 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
395 "paddd %%xmm7, %%xmm3 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
396 "paddd %%xmm2, %%xmm1 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
397 "paddd %%xmm6, %%xmm3 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
398 "paddd %%xmm6, %%xmm1 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
399 "psrad %3, %%xmm3 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
400 "psrad %3, %%xmm1 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
401 "packssdw %%xmm3, %%xmm1 \n\t" \
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
402 "movdqa %%xmm1, " #i "(%4) \n\t"
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
403
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
404 "movdqa (%2), %%xmm6 \n\t"
3564
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
405 FDCT_ROW_SSE2_H1(0,0)
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
406 FDCT_ROW_SSE2(0)
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
407 FDCT_ROW_SSE2_H2(64,0)
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
408 FDCT_ROW_SSE2(64)
1765
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
409
3564
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
410 FDCT_ROW_SSE2_H1(16,64)
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
411 FDCT_ROW_SSE2(16)
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
412 FDCT_ROW_SSE2_H2(112,64)
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
413 FDCT_ROW_SSE2(112)
1765
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
414
3564
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
415 FDCT_ROW_SSE2_H1(32,128)
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
416 FDCT_ROW_SSE2(32)
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
417 FDCT_ROW_SSE2_H2(96,128)
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
418 FDCT_ROW_SSE2(96)
1765
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
419
3564
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
420 FDCT_ROW_SSE2_H1(48,192)
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
421 FDCT_ROW_SSE2(48)
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
422 FDCT_ROW_SSE2_H2(80,192)
96f9bd6a9ea9 Add support for Mac OS X Intel part 2: Assembler macros in fdct_mmx.c
gpoirier
parents: 2979
diff changeset
423 FDCT_ROW_SSE2(80)
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
424 :
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
425 : "r" (in), "r" (tab_frw_01234567_sse2.tab_frw_01234567_sse2), "r" (fdct_r_row_sse2.fdct_r_row_sse2), "i" (SHIFT_FRW_ROW), "r" (out)
1765
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
426 );
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
427 }
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
428
1570
9a9c14e87ebf optimizing
michael
parents: 1565
diff changeset
429 static always_inline void fdct_row_mmx2(const int16_t *in, int16_t *out, const int16_t *table)
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
430 {
1565
1a9a63f59849 minor mmx2 optimization if the dct
michael
parents: 1564
diff changeset
431 pshufw_m2r(*(in + 4), mm5, 0x1B);
1a9a63f59849 minor mmx2 optimization if the dct
michael
parents: 1564
diff changeset
432 movq_m2r(*(in + 0), mm0);
1998
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
433 movq_r2r(mm0, mm1);
1570
9a9c14e87ebf optimizing
michael
parents: 1565
diff changeset
434 paddsw_r2r(mm5, mm0);
9a9c14e87ebf optimizing
michael
parents: 1565
diff changeset
435 psubsw_r2r(mm5, mm1);
1998
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
436 movq_r2r(mm0, mm2);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
437 punpckldq_r2r(mm1, mm0);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
438 punpckhdq_r2r(mm1, mm2);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
439 movq_m2r(*(table + 0), mm1);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
440 movq_m2r(*(table + 4), mm3);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
441 movq_m2r(*(table + 8), mm4);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
442 movq_m2r(*(table + 12), mm5);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
443 movq_m2r(*(table + 16), mm6);
1570
9a9c14e87ebf optimizing
michael
parents: 1565
diff changeset
444 movq_m2r(*(table + 20), mm7);
1998
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
445 pmaddwd_r2r(mm0, mm1);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
446 pmaddwd_r2r(mm2, mm3);
1575
f16ae8e69bd9 reorder table instead of wasting instructions to reorder the input to match the table
michael
parents: 1574
diff changeset
447 pmaddwd_r2r(mm0, mm4);
1998
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
448 pmaddwd_r2r(mm2, mm5);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
449 pmaddwd_r2r(mm0, mm6);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
450 pmaddwd_r2r(mm2, mm7);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
451 pmaddwd_m2r(*(table + 24), mm0);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
452 pmaddwd_m2r(*(table + 28), mm2);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
453 paddd_r2r(mm1, mm3);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
454 paddd_r2r(mm4, mm5);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
455 paddd_r2r(mm6, mm7);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
456 paddd_r2r(mm0, mm2);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
457 movq_m2r(*fdct_r_row, mm0);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
458 paddd_r2r(mm0, mm3);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
459 paddd_r2r(mm0, mm5);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
460 paddd_r2r(mm0, mm7);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
461 paddd_r2r(mm0, mm2);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
462 psrad_i2r(SHIFT_FRW_ROW, mm3);
1570
9a9c14e87ebf optimizing
michael
parents: 1565
diff changeset
463 psrad_i2r(SHIFT_FRW_ROW, mm5);
1998
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
464 psrad_i2r(SHIFT_FRW_ROW, mm7);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
465 psrad_i2r(SHIFT_FRW_ROW, mm2);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
466 packssdw_r2r(mm5, mm3);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
467 packssdw_r2r(mm2, mm7);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
468 movq_r2m(mm3, *(out + 0));
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
469 movq_r2m(mm7, *(out + 4));
1570
9a9c14e87ebf optimizing
michael
parents: 1565
diff changeset
470 }
9a9c14e87ebf optimizing
michael
parents: 1565
diff changeset
471
9a9c14e87ebf optimizing
michael
parents: 1565
diff changeset
472 static always_inline void fdct_row_mmx(const int16_t *in, int16_t *out, const int16_t *table)
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
473 {
1998
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
474 //FIXME reorder (i dont have a old mmx only cpu here to benchmark ...)
1575
f16ae8e69bd9 reorder table instead of wasting instructions to reorder the input to match the table
michael
parents: 1574
diff changeset
475 movd_m2r(*(in + 6), mm1);
f16ae8e69bd9 reorder table instead of wasting instructions to reorder the input to match the table
michael
parents: 1574
diff changeset
476 punpcklwd_m2r(*(in + 4), mm1);
f16ae8e69bd9 reorder table instead of wasting instructions to reorder the input to match the table
michael
parents: 1574
diff changeset
477 movq_r2r(mm1, mm2);
f16ae8e69bd9 reorder table instead of wasting instructions to reorder the input to match the table
michael
parents: 1574
diff changeset
478 psrlq_i2r(0x20, mm1);
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
479 movq_m2r(*(in + 0), mm0);
1575
f16ae8e69bd9 reorder table instead of wasting instructions to reorder the input to match the table
michael
parents: 1574
diff changeset
480 punpcklwd_r2r(mm2, mm1);
1998
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
481 movq_r2r(mm0, mm5);
1575
f16ae8e69bd9 reorder table instead of wasting instructions to reorder the input to match the table
michael
parents: 1574
diff changeset
482 paddsw_r2r(mm1, mm0);
f16ae8e69bd9 reorder table instead of wasting instructions to reorder the input to match the table
michael
parents: 1574
diff changeset
483 psubsw_r2r(mm1, mm5);
1998
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
484 movq_r2r(mm0, mm2);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
485 punpckldq_r2r(mm5, mm0);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
486 punpckhdq_r2r(mm5, mm2);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
487 movq_m2r(*(table + 0), mm1);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
488 movq_m2r(*(table + 4), mm3);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
489 movq_m2r(*(table + 8), mm4);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
490 movq_m2r(*(table + 12), mm5);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
491 movq_m2r(*(table + 16), mm6);
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
492 movq_m2r(*(table + 20), mm7);
1998
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
493 pmaddwd_r2r(mm0, mm1);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
494 pmaddwd_r2r(mm2, mm3);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
495 pmaddwd_r2r(mm0, mm4);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
496 pmaddwd_r2r(mm2, mm5);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
497 pmaddwd_r2r(mm0, mm6);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
498 pmaddwd_r2r(mm2, mm7);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
499 pmaddwd_m2r(*(table + 24), mm0);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
500 pmaddwd_m2r(*(table + 28), mm2);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
501 paddd_r2r(mm1, mm3);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
502 paddd_r2r(mm4, mm5);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
503 paddd_r2r(mm6, mm7);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
504 paddd_r2r(mm0, mm2);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
505 movq_m2r(*fdct_r_row, mm0);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
506 paddd_r2r(mm0, mm3);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
507 paddd_r2r(mm0, mm5);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
508 paddd_r2r(mm0, mm7);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
509 paddd_r2r(mm0, mm2);
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
510 psrad_i2r(SHIFT_FRW_ROW, mm3);
1998
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
511 psrad_i2r(SHIFT_FRW_ROW, mm5);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
512 psrad_i2r(SHIFT_FRW_ROW, mm7);
1570
9a9c14e87ebf optimizing
michael
parents: 1565
diff changeset
513 psrad_i2r(SHIFT_FRW_ROW, mm2);
1998
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
514 packssdw_r2r(mm5, mm3);
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
515 packssdw_r2r(mm2, mm7);
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
516 movq_r2m(mm3, *(out + 0));
1998
5bc1a9ad6c33 mmx dct optimization
michael
parents: 1933
diff changeset
517 movq_r2m(mm7, *(out + 4));
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
518 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
519
687
9abb13c21fbe fdct_mmx -> ff_fdct_mmx (renamed to avoid namespace conflict with xvid)
arpi_esp
parents: 635
diff changeset
520 void ff_fdct_mmx(int16_t *block)
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
521 {
839
b7e2b8129211 cleanup
michaelni
parents: 687
diff changeset
522 int64_t align_tmp[16] ATTR_ALIGN(8);
3588
6717ead176fd simplify
michael
parents: 3584
diff changeset
523 int16_t * block1= (int16_t*)align_tmp;
6717ead176fd simplify
michael
parents: 3584
diff changeset
524 const int16_t *table= tab_frw_01234567;
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
525 int i;
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
526
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
527 fdct_col(block, block1, 0);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
528 fdct_col(block, block1, 4);
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
529
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
530 for(i=8;i>0;i--) {
3588
6717ead176fd simplify
michael
parents: 3584
diff changeset
531 fdct_row_mmx(block1, block, table);
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
532 block1 += 8;
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
533 table += 32;
3588
6717ead176fd simplify
michael
parents: 3584
diff changeset
534 block += 8;
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
535 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
536 }
1565
1a9a63f59849 minor mmx2 optimization if the dct
michael
parents: 1564
diff changeset
537
1a9a63f59849 minor mmx2 optimization if the dct
michael
parents: 1564
diff changeset
538 void ff_fdct_mmx2(int16_t *block)
1a9a63f59849 minor mmx2 optimization if the dct
michael
parents: 1564
diff changeset
539 {
1a9a63f59849 minor mmx2 optimization if the dct
michael
parents: 1564
diff changeset
540 int64_t align_tmp[16] ATTR_ALIGN(8);
3588
6717ead176fd simplify
michael
parents: 3584
diff changeset
541 int16_t *block1= (int16_t*)align_tmp;
6717ead176fd simplify
michael
parents: 3584
diff changeset
542 const int16_t *table= tab_frw_01234567;
1565
1a9a63f59849 minor mmx2 optimization if the dct
michael
parents: 1564
diff changeset
543 int i;
1a9a63f59849 minor mmx2 optimization if the dct
michael
parents: 1564
diff changeset
544
1a9a63f59849 minor mmx2 optimization if the dct
michael
parents: 1564
diff changeset
545 fdct_col(block, block1, 0);
1a9a63f59849 minor mmx2 optimization if the dct
michael
parents: 1564
diff changeset
546 fdct_col(block, block1, 4);
1a9a63f59849 minor mmx2 optimization if the dct
michael
parents: 1564
diff changeset
547
1a9a63f59849 minor mmx2 optimization if the dct
michael
parents: 1564
diff changeset
548 for(i=8;i>0;i--) {
3588
6717ead176fd simplify
michael
parents: 3584
diff changeset
549 fdct_row_mmx2(block1, block, table);
1565
1a9a63f59849 minor mmx2 optimization if the dct
michael
parents: 1564
diff changeset
550 block1 += 8;
1a9a63f59849 minor mmx2 optimization if the dct
michael
parents: 1564
diff changeset
551 table += 32;
3588
6717ead176fd simplify
michael
parents: 3584
diff changeset
552 block += 8;
1565
1a9a63f59849 minor mmx2 optimization if the dct
michael
parents: 1564
diff changeset
553 }
1a9a63f59849 minor mmx2 optimization if the dct
michael
parents: 1564
diff changeset
554 }
1765
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
555
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2817
diff changeset
556 void ff_fdct_sse2(int16_t *block)
1765
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
557 {
3584
8a62cb7e8d0f insufficient alignment
michael
parents: 3564
diff changeset
558 int64_t align_tmp[16] ATTR_ALIGN(16);
3588
6717ead176fd simplify
michael
parents: 3584
diff changeset
559 int16_t * const block1= (int16_t*)align_tmp;
1765
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
560
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
561 fdct_col(block, block1, 0);
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
562 fdct_col(block, block1, 4);
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
563
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
564 fdct_row_sse2(block1, block);
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
565 }
e31754bc5b65 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents: 1739
diff changeset
566