annotate libmpcodecs/vf_fspp.c @ 18568:80628a6d0980

initial import of some missing German xml translation, review(s) pending Translation was done by Kurt Lettmaier (k . lettmaier @at@ onlinehome.de ), thank you!
author kraymer
date Mon, 05 Jun 2006 05:02:47 +0000
parents e83548b7bd3b
children 6334c14b38eb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1 /*
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2 Copyright (C) 2003 Michael Niedermayer <michaelni@gmx.at>
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
3 Copyright (C) 2005 Nikolaj Poroshin <porosh3@psu.ru>
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
4
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
5 This program is free software; you can redistribute it and/or modify
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
6 it under the terms of the GNU General Public License as published by
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
7 the Free Software Foundation; either version 2 of the License, or
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
8 (at your option) any later version.
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
9
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
13 GNU General Public License for more details.
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
14
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
16 along with this program; if not, write to the Free Software
17367
401b440a6d76 Update licensing information: The FSF changed postal address.
diego
parents: 17225
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
18 */
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
19
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
20 /*
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
21 * This implementation is based on an algorithm described in
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
22 * "Aria Nosratinia Embedded Post-Processing for
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
23 * Enhancement of Compressed Images (1999)"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
24 * (http://citeseer.nj.nec.com/nosratinia99embedded.html)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
25 * Futher, with splitting (i)dct into hor/ver passes, one of them can be
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
26 * performed once per block, not pixel. This allows for much better speed.
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
27 */
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
28
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
29 /*
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
30 Heavily optimized version of SPP filter by Nikolaj
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
31 */
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
32
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
33 #include <stdio.h>
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
34 #include <stdlib.h>
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
35 #include <string.h>
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
36 #include <inttypes.h>
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
37 #include <math.h>
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
38
17012
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 16018
diff changeset
39 #include "config.h"
18104
7b408d60de9e add support for intel mac. mp3lib is not fixed yet.
nplourde
parents: 17906
diff changeset
40 #include "asmalign.h"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
41
17012
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 16018
diff changeset
42 #include "mp_msg.h"
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 16018
diff changeset
43 #include "cpudetect.h"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
44
17012
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 16018
diff changeset
45 #include "libavcodec/avcodec.h"
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 16018
diff changeset
46 #include "libavcodec/dsputil.h"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
47
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
48 #ifdef HAVE_MALLOC_H
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
49 #include <malloc.h>
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
50 #endif
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
51
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
52 #include "img_format.h"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
53 #include "mp_image.h"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
54 #include "vf.h"
17012
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 16018
diff changeset
55 #include "libvo/fastmemcpy.h"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
56
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
57 //===========================================================================//
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
58 #define BLOCKSZ 12
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
59
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
60 static const short custom_threshold[64]=
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
61 // values (296) can't be too high
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
62 // -it causes too big quant dependence
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
63 // or maybe overflow(check), which results in some flashing
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
64 { 71, 296, 295, 237, 71, 40, 38, 19,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
65 245, 193, 185, 121, 102, 73, 53, 27,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
66 158, 129, 141, 107, 97, 73, 50, 26,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
67 102, 116, 109, 98, 82, 66, 45, 23,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
68 71, 94, 95, 81, 70, 56, 38, 20,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
69 56, 77, 74, 66, 56, 44, 30, 15,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
70 38, 53, 50, 45, 38, 30, 21, 11,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
71 20, 27, 26, 23, 20, 15, 11, 5
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
72 };
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
73
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
74 static const uint8_t __attribute__((aligned(32))) dither[8][8]={
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
75 { 0, 48, 12, 60, 3, 51, 15, 63, },
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
76 { 32, 16, 44, 28, 35, 19, 47, 31, },
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
77 { 8, 56, 4, 52, 11, 59, 7, 55, },
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
78 { 40, 24, 36, 20, 43, 27, 39, 23, },
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
79 { 2, 50, 14, 62, 1, 49, 13, 61, },
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
80 { 34, 18, 46, 30, 33, 17, 45, 29, },
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
81 { 10, 58, 6, 54, 9, 57, 5, 53, },
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
82 { 42, 26, 38, 22, 41, 25, 37, 21, },
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
83 };
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
84
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
85 struct vf_priv_s { //align 16 !
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
86 uint64_t threshold_mtx_noq[8*2];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
87 uint64_t threshold_mtx[8*2];//used in both C & MMX (& later SSE2) versions
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
88
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
89 int log2_count;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
90 int temp_stride;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
91 int qp;
17225
ec9888363742 reverse the H264 hack
henry
parents: 17223
diff changeset
92 int mpeg2;
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
93 int prev_q;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
94 uint8_t *src;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
95 int16_t *temp;
17225
ec9888363742 reverse the H264 hack
henry
parents: 17223
diff changeset
96 int bframes;
17133
a2b24e0d7772 prevent flicker on b-frames, trivial port from vf_spp
henry
parents: 17012
diff changeset
97 char *non_b_qp;
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
98 };
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
99
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
100
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
101 #ifndef HAVE_MMX
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
102
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
103 //This func reads from 1 slice, 1 and clears 0 & 1
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
104 static void store_slice_c(uint8_t *dst, int16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
105 {int y, x;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
106 #define STORE(pos) \
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
107 temp= (src[x + pos] + (d[pos]>>log2_scale))>>(6-log2_scale); \
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
108 src[x + pos]=src[x + pos - 8*src_stride]=0; \
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
109 if(temp & 0x100) temp= ~(temp>>31); \
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
110 dst[x + pos]= temp;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
111
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
112 for(y=0; y<height; y++){
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
113 const uint8_t *d= dither[y];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
114 for(x=0; x<width; x+=8){
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
115 int temp;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
116 STORE(0);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
117 STORE(1);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
118 STORE(2);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
119 STORE(3);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
120 STORE(4);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
121 STORE(5);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
122 STORE(6);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
123 STORE(7);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
124 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
125 src+=src_stride;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
126 dst+=dst_stride;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
127 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
128 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
129
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
130 //This func reads from 2 slices, 0 & 2 and clears 2-nd
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
131 static void store_slice2_c(uint8_t *dst, int16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
132 {int y, x;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
133 #define STORE2(pos) \
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
134 temp= (src[x + pos] + src[x + pos + 16*src_stride] + (d[pos]>>log2_scale))>>(6-log2_scale); \
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
135 src[x + pos + 16*src_stride]=0; \
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
136 if(temp & 0x100) temp= ~(temp>>31); \
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
137 dst[x + pos]= temp;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
138
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
139 for(y=0; y<height; y++){
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
140 const uint8_t *d= dither[y];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
141 for(x=0; x<width; x+=8){
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
142 int temp;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
143 STORE2(0);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
144 STORE2(1);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
145 STORE2(2);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
146 STORE2(3);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
147 STORE2(4);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
148 STORE2(5);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
149 STORE2(6);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
150 STORE2(7);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
151 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
152 src+=src_stride;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
153 dst+=dst_stride;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
154 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
155 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
156
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
157 static void mul_thrmat_c(struct vf_priv_s *p,int q)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
158 {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
159 int a;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
160 for(a=0;a<64;a++)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
161 ((short*)p->threshold_mtx)[a]=q * ((short*)p->threshold_mtx_noq)[a];//ints faster in C
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
162 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
163
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
164 static void column_fidct_c(int16_t* thr_adr, DCTELEM *data, DCTELEM *output, int cnt);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
165 static void row_idct_c(DCTELEM* workspace,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
166 int16_t* output_adr, int output_stride, int cnt);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
167 static void row_fdct_c(DCTELEM *data, const uint8_t *pixels, int line_size, int cnt);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
168
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
169 //this is rather ugly, but there is no need for function pointers
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
170 #define store_slice_s store_slice_c
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
171 #define store_slice2_s store_slice2_c
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
172 #define mul_thrmat_s mul_thrmat_c
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
173 #define column_fidct_s column_fidct_c
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
174 #define row_idct_s row_idct_c
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
175 #define row_fdct_s row_fdct_c
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
176
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
177 #else /* HAVE_MMX */
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
178
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
179 //This func reads from 1 slice, 1 and clears 0 & 1
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
180 static void store_slice_mmx(uint8_t *dst, int16_t *src, long dst_stride, long src_stride, long width, long height, long log2_scale)
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
181 {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
182 const uint8_t *od=&dither[0][0];
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
183 const uint8_t *end=&dither[height][0];
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
184 width = (width+7)&~7;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
185 dst_stride-=width;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
186 //src_stride=(src_stride-width)*2;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
187 asm volatile(
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
188 "mov %5, %%"REG_d" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
189 "mov %6, %%"REG_S" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
190 "mov %7, %%"REG_D" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
191 "mov %1, %%"REG_a" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
192 "movd %%"REG_d", %%mm5 \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
193 "xor $-1, %%"REG_d" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
194 "mov %%"REG_a", %%"REG_c" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
195 "add $7, %%"REG_d" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
196 "neg %%"REG_a" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
197 "sub %0, %%"REG_c" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
198 "add %%"REG_c", %%"REG_c" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
199 "movd %%"REG_d", %%mm2 \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
200 "mov %%"REG_c", %1 \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
201 "mov %2, %%"REG_d" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
202 "shl $4, %%"REG_a" \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
203
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
204 "2: \n\t"
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
205 "movq (%%"REG_d"), %%mm3 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
206 "movq %%mm3, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
207 "pxor %%mm7, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
208 "punpcklbw %%mm7, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
209 "punpckhbw %%mm7, %%mm4 \n\t"
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
210 "mov %0, %%"REG_c" \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
211 "psraw %%mm5, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
212 "psraw %%mm5, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
213 "1: \n\t"
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
214 "movq %%mm7, (%%"REG_S",%%"REG_a",) \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
215 "movq (%%"REG_S"), %%mm0 \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
216 "movq 8(%%"REG_S"), %%mm1 \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
217
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
218 "movq %%mm7, 8(%%"REG_S",%%"REG_a",) \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
219 "paddw %%mm3, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
220 "paddw %%mm4, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
221
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
222 "movq %%mm7, (%%"REG_S") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
223 "psraw %%mm2, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
224 "psraw %%mm2, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
225
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
226 "movq %%mm7, 8(%%"REG_S") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
227 "packuswb %%mm1, %%mm0 \n\t"
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
228 "add $16, %%"REG_S" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
229
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
230 "movq %%mm0, (%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
231 "add $8, %%"REG_D" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
232 "sub $8, %%"REG_c" \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
233 "jg 1b \n\t"
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
234 "add %1, %%"REG_S" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
235 "add $8, %%"REG_d" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
236 "add %3, %%"REG_D" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
237 "cmp %4, %%"REG_d" \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
238 "jl 2b \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
239
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
240 :
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
241 : "m" (width), "m" (src_stride), "g" (od), "m" (dst_stride), "g" (end),
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
242 "m" (log2_scale), "m" (src), "m" (dst) //input
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
243 : "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S, "%"REG_D
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
244 );
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
245 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
246
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
247 //This func reads from 2 slices, 0 & 2 and clears 2-nd
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
248 static void store_slice2_mmx(uint8_t *dst, int16_t *src, long dst_stride, long src_stride, long width, long height, long log2_scale)
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
249 {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
250 const uint8_t *od=&dither[0][0];
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
251 const uint8_t *end=&dither[height][0];
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
252 width = (width+7)&~7;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
253 dst_stride-=width;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
254 //src_stride=(src_stride-width)*2;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
255 asm volatile(
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
256 "mov %5, %%"REG_d" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
257 "mov %6, %%"REG_S" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
258 "mov %7, %%"REG_D" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
259 "mov %1, %%"REG_a" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
260 "movd %%"REG_d", %%mm5 \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
261 "xor $-1, %%"REG_d" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
262 "mov %%"REG_a", %%"REG_c" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
263 "add $7, %%"REG_d" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
264 "sub %0, %%"REG_c" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
265 "add %%"REG_c", %%"REG_c" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
266 "movd %%"REG_d", %%mm2 \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
267 "mov %%"REG_c", %1 \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
268 "mov %2, %%"REG_d" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
269 "shl $5, %%"REG_a" \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
270
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
271 "2: \n\t"
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
272 "movq (%%"REG_d"), %%mm3 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
273 "movq %%mm3, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
274 "pxor %%mm7, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
275 "punpcklbw %%mm7, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
276 "punpckhbw %%mm7, %%mm4 \n\t"
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
277 "mov %0, %%"REG_c" \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
278 "psraw %%mm5, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
279 "psraw %%mm5, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
280 "1: \n\t"
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
281 "movq (%%"REG_S"), %%mm0 \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
282 "movq 8(%%"REG_S"), %%mm1 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
283 "paddw %%mm3, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
284
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
285 "paddw (%%"REG_S",%%"REG_a",), %%mm0 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
286 "paddw %%mm4, %%mm1 \n\t"
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
287 "movq 8(%%"REG_S",%%"REG_a",), %%mm6 \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
288
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
289 "movq %%mm7, (%%"REG_S",%%"REG_a",) \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
290 "psraw %%mm2, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
291 "paddw %%mm6, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
292
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
293 "movq %%mm7, 8(%%"REG_S",%%"REG_a",) \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
294 "psraw %%mm2, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
295 "packuswb %%mm1, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
296
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
297 "movq %%mm0, (%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
298 "add $16, %%"REG_S" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
299 "add $8, %%"REG_D" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
300 "sub $8, %%"REG_c" \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
301 "jg 1b \n\t"
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
302 "add %1, %%"REG_S" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
303 "add $8, %%"REG_d" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
304 "add %3, %%"REG_D" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
305 "cmp %4, %%"REG_d" \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
306 "jl 2b \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
307
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
308 :
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
309 : "m" (width), "m" (src_stride), "g" (od), "m" (dst_stride), "g" (end),
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
310 "m" (log2_scale), "m" (src), "m" (dst) //input
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
311 : "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_D, "%"REG_S
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
312 );
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
313 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
314
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
315 static void mul_thrmat_mmx(struct vf_priv_s *p, int q)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
316 {
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
317 uint64_t *adr=&p->threshold_mtx_noq[0];
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
318 asm volatile(
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
319 "movd %0, %%mm7 \n\t"
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
320 "add $8*8*2, %%"REG_D" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
321 "movq 0*8(%%"REG_S"), %%mm0 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
322 "punpcklwd %%mm7, %%mm7 \n\t"
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
323 "movq 1*8(%%"REG_S"), %%mm1 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
324 "punpckldq %%mm7, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
325 "pmullw %%mm7, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
326
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
327 "movq 2*8(%%"REG_S"), %%mm2 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
328 "pmullw %%mm7, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
329
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
330 "movq 3*8(%%"REG_S"), %%mm3 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
331 "pmullw %%mm7, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
332
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
333 "movq %%mm0, 0*8(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
334 "movq 4*8(%%"REG_S"), %%mm4 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
335 "pmullw %%mm7, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
336
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
337 "movq %%mm1, 1*8(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
338 "movq 5*8(%%"REG_S"), %%mm5 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
339 "pmullw %%mm7, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
340
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
341 "movq %%mm2, 2*8(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
342 "movq 6*8(%%"REG_S"), %%mm6 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
343 "pmullw %%mm7, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
344
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
345 "movq %%mm3, 3*8(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
346 "movq 7*8+0*8(%%"REG_S"), %%mm0 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
347 "pmullw %%mm7, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
348
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
349 "movq %%mm4, 4*8(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
350 "movq 7*8+1*8(%%"REG_S"), %%mm1 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
351 "pmullw %%mm7, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
352
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
353 "movq %%mm5, 5*8(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
354 "movq 7*8+2*8(%%"REG_S"), %%mm2 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
355 "pmullw %%mm7, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
356
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
357 "movq %%mm6, 6*8(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
358 "movq 7*8+3*8(%%"REG_S"), %%mm3 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
359 "pmullw %%mm7, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
360
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
361 "movq %%mm0, 7*8+0*8(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
362 "movq 7*8+4*8(%%"REG_S"), %%mm4 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
363 "pmullw %%mm7, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
364
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
365 "movq %%mm1, 7*8+1*8(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
366 "movq 7*8+5*8(%%"REG_S"), %%mm5 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
367 "pmullw %%mm7, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
368
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
369 "movq %%mm2, 7*8+2*8(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
370 "movq 7*8+6*8(%%"REG_S"), %%mm6 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
371 "pmullw %%mm7, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
372
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
373 "movq %%mm3, 7*8+3*8(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
374 "movq 14*8+0*8(%%"REG_S"), %%mm0 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
375 "pmullw %%mm7, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
376
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
377 "movq %%mm4, 7*8+4*8(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
378 "movq 14*8+1*8(%%"REG_S"), %%mm1 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
379 "pmullw %%mm7, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
380
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
381 "movq %%mm5, 7*8+5*8(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
382 "pmullw %%mm7, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
383
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
384 "movq %%mm6, 7*8+6*8(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
385 "movq %%mm0, 14*8+0*8(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
386 "movq %%mm1, 14*8+1*8(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
387
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
388 : "+g" (q), "+S" (adr), "+D" (adr)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
389 :
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
390 );
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
391 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
392
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
393 static void column_fidct_mmx(int16_t* thr_adr, DCTELEM *data, DCTELEM *output, int cnt);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
394 static void row_idct_mmx(DCTELEM* workspace,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
395 int16_t* output_adr, int output_stride, int cnt);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
396 static void row_fdct_mmx(DCTELEM *data, const uint8_t *pixels, int line_size, int cnt);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
397
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
398 #define store_slice_s store_slice_mmx
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
399 #define store_slice2_s store_slice2_mmx
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
400 #define mul_thrmat_s mul_thrmat_mmx
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
401 #define column_fidct_s column_fidct_mmx
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
402 #define row_idct_s row_idct_mmx
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
403 #define row_fdct_s row_fdct_mmx
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
404 #endif // HAVE_MMX
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
405
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
406 static void filter(struct vf_priv_s *p, uint8_t *dst, uint8_t *src,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
407 int dst_stride, int src_stride,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
408 int width, int height,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
409 uint8_t *qp_store, int qp_stride, int is_luma)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
410 {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
411 int x, x0, y, es, qy, t;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
412 const int stride= is_luma ? p->temp_stride : (width+16);//((width+16+15)&(~15))
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
413 const int step=6-p->log2_count;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
414 const int qps= 3 + is_luma;
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
415 int32_t __attribute__((aligned(32))) block_align[4*8*BLOCKSZ+ 4*8*BLOCKSZ];
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
416 DCTELEM *block= (DCTELEM *)block_align;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
417 DCTELEM *block3=(DCTELEM *)(block_align+4*8*BLOCKSZ);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
418
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
419 memset(block3, 0, 4*8*BLOCKSZ);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
420
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
421 //p->src=src-src_stride*8-8;//!
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
422 if (!src || !dst) return; // HACK avoid crash for Y8 colourspace
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
423 for(y=0; y<height; y++){
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
424 int index= 8 + 8*stride + y*stride;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
425 memcpy(p->src + index, src + y*src_stride, width);//this line can be avoided by using DR & user fr.buffers
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
426 for(x=0; x<8; x++){
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
427 p->src[index - x - 1]= p->src[index + x ];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
428 p->src[index + width + x ]= p->src[index + width - x - 1];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
429 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
430 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
431 for(y=0; y<8; y++){
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
432 memcpy(p->src + ( 7-y)*stride, p->src + ( y+8)*stride, stride);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
433 memcpy(p->src + (height+8+y)*stride, p->src + (height-y+7)*stride, stride);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
434 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
435 //FIXME (try edge emu)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
436
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
437 for(y=8; y<24; y++)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
438 memset(p->temp+ 8 +y*stride, 0,width*sizeof(int16_t));
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
439
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
440 for(y=step; y<height+8; y+=step){ //step= 1,2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
441 qy=y-4;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
442 if (qy>height-1) qy=height-1;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
443 if (qy<0) qy=0;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
444 qy=(qy>>qps)*qp_stride;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
445 row_fdct_s(block, p->src + y*stride +2-(y&1), stride, 2);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
446 for(x0=0; x0<width+8-8*(BLOCKSZ-1); x0+=8*(BLOCKSZ-1)){
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
447 row_fdct_s(block+8*8, p->src + y*stride+8+x0 +2-(y&1), stride, 2*(BLOCKSZ-1));
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
448 if(p->qp)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
449 column_fidct_s((int16_t*)(&p->threshold_mtx[0]), block+0*8, block3+0*8, 8*(BLOCKSZ-1)); //yes, this is a HOTSPOT
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
450 else
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
451 for (x=0; x<8*(BLOCKSZ-1); x+=8) {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
452 t=x+x0-2; //correct t=x+x0-2-(y&1), but its the same
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
453 if (t<0) t=0;//t always < width-2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
454 t=qp_store[qy+(t>>qps)];
17225
ec9888363742 reverse the H264 hack
henry
parents: 17223
diff changeset
455 if(p->mpeg2) t>>=1; //copy p->mpeg2,prev_q to locals?
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
456 if (t!=p->prev_q) p->prev_q=t, mul_thrmat_s(p, t);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
457 column_fidct_s((int16_t*)(&p->threshold_mtx[0]), block+x*8, block3+x*8, 8); //yes, this is a HOTSPOT
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
458 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
459 row_idct_s(block3+0*8, p->temp + (y&15)*stride+x0+2-(y&1), stride, 2*(BLOCKSZ-1));
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
460 memcpy(block, block+(BLOCKSZ-1)*64, 8*8*sizeof(DCTELEM)); //cycling
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
461 memcpy(block3, block3+(BLOCKSZ-1)*64, 6*8*sizeof(DCTELEM));
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
462 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
463 //
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
464 es=width+8-x0; // 8, ...
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
465 if (es>8)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
466 row_fdct_s(block+8*8, p->src + y*stride+8+x0 +2-(y&1), stride, (es-4)>>2);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
467 column_fidct_s((int16_t*)(&p->threshold_mtx[0]), block, block3, es-0);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
468 row_idct_s(block3+0*8, p->temp + (y&15)*stride+x0+2-(y&1), stride, es>>2);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
469 {const int y1=y-8+step;//l5-7 l4-6
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
470 if (!(y1&7) && y1) {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
471 if (y1&8) store_slice_s(dst + (y1-8)*dst_stride, p->temp+ 8 +8*stride,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
472 dst_stride, stride, width, 8, 5-p->log2_count);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
473 else store_slice2_s(dst + (y1-8)*dst_stride, p->temp+ 8 +0*stride,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
474 dst_stride, stride, width, 8, 5-p->log2_count);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
475 } }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
476 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
477
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
478 if (y&7) { // == height & 7
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
479 if (y&8) store_slice_s(dst + ((y-8)&~7)*dst_stride, p->temp+ 8 +8*stride,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
480 dst_stride, stride, width, y&7, 5-p->log2_count);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
481 else store_slice2_s(dst + ((y-8)&~7)*dst_stride, p->temp+ 8 +0*stride,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
482 dst_stride, stride, width, y&7, 5-p->log2_count);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
483 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
484 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
485
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
486 static int config(struct vf_instance_s* vf,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
487 int width, int height, int d_width, int d_height,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
488 unsigned int flags, unsigned int outfmt)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
489 {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
490 int h= (height+16+15)&(~15);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
491
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
492 vf->priv->temp_stride= (width+16+15)&(~15);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
493 vf->priv->temp= (int16_t*)av_mallocz(vf->priv->temp_stride*3*8*sizeof(int16_t));
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
494 //this can also be avoided, see above
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
495 vf->priv->src = (uint8_t*)av_malloc(vf->priv->temp_stride*h*sizeof(uint8_t));
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
496
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
497 return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
498 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
499
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
500 static void get_image(struct vf_instance_s* vf, mp_image_t *mpi)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
501 {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
502 if(mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
503 // ok, we can do pp in-place (or pp disabled):
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
504 vf->dmpi=vf_get_image(vf->next,mpi->imgfmt,
16018
bdf1b4ecb906 use stored dimensions instead of visible one when (vf_)get_image is called
iive
parents: 15651
diff changeset
505 mpi->type, mpi->flags, mpi->width, mpi->height);
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
506 mpi->planes[0]=vf->dmpi->planes[0];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
507 mpi->stride[0]=vf->dmpi->stride[0];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
508 mpi->width=vf->dmpi->width;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
509 if(mpi->flags&MP_IMGFLAG_PLANAR){
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
510 mpi->planes[1]=vf->dmpi->planes[1];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
511 mpi->planes[2]=vf->dmpi->planes[2];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
512 mpi->stride[1]=vf->dmpi->stride[1];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
513 mpi->stride[2]=vf->dmpi->stride[2];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
514 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
515 mpi->flags|=MP_IMGFLAG_DIRECT;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
516 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
517
17906
20aca9baf5d8 passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents: 17523
diff changeset
518 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts)
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
519 {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
520 mp_image_t *dmpi;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
521 if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
522 // no DR, so get a new image! hope we'll get DR buffer:
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
523 dmpi=vf_get_image(vf->next,mpi->imgfmt,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
524 MP_IMGTYPE_TEMP,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
525 MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE,
16018
bdf1b4ecb906 use stored dimensions instead of visible one when (vf_)get_image is called
iive
parents: 15651
diff changeset
526 mpi->width,mpi->height);
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
527 vf_clone_mpi_attributes(dmpi, mpi);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
528 }else{
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
529 dmpi=vf->dmpi;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
530 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
531
17225
ec9888363742 reverse the H264 hack
henry
parents: 17223
diff changeset
532 vf->priv->mpeg2= mpi->qscale_type;
17133
a2b24e0d7772 prevent flicker on b-frames, trivial port from vf_spp
henry
parents: 17012
diff changeset
533 if(mpi->pict_type != 3 && mpi->qscale && !vf->priv->qp){
a2b24e0d7772 prevent flicker on b-frames, trivial port from vf_spp
henry
parents: 17012
diff changeset
534 if(!vf->priv->non_b_qp)
a2b24e0d7772 prevent flicker on b-frames, trivial port from vf_spp
henry
parents: 17012
diff changeset
535 vf->priv->non_b_qp= malloc(mpi->qstride * mpi->h);
a2b24e0d7772 prevent flicker on b-frames, trivial port from vf_spp
henry
parents: 17012
diff changeset
536 memcpy(vf->priv->non_b_qp, mpi->qscale, mpi->qstride * mpi->h);
a2b24e0d7772 prevent flicker on b-frames, trivial port from vf_spp
henry
parents: 17012
diff changeset
537 }
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
538 if(vf->priv->log2_count || !(mpi->flags&MP_IMGFLAG_DIRECT)){
17133
a2b24e0d7772 prevent flicker on b-frames, trivial port from vf_spp
henry
parents: 17012
diff changeset
539 char *qp_tab= vf->priv->non_b_qp;
17225
ec9888363742 reverse the H264 hack
henry
parents: 17223
diff changeset
540 if(vf->priv->bframes || !qp_tab)
17133
a2b24e0d7772 prevent flicker on b-frames, trivial port from vf_spp
henry
parents: 17012
diff changeset
541 qp_tab= mpi->qscale;
a2b24e0d7772 prevent flicker on b-frames, trivial port from vf_spp
henry
parents: 17012
diff changeset
542
17225
ec9888363742 reverse the H264 hack
henry
parents: 17223
diff changeset
543 if(qp_tab || vf->priv->qp){
17133
a2b24e0d7772 prevent flicker on b-frames, trivial port from vf_spp
henry
parents: 17012
diff changeset
544 filter(vf->priv, dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0],
a2b24e0d7772 prevent flicker on b-frames, trivial port from vf_spp
henry
parents: 17012
diff changeset
545 mpi->w, mpi->h, qp_tab, mpi->qstride, 1);
a2b24e0d7772 prevent flicker on b-frames, trivial port from vf_spp
henry
parents: 17012
diff changeset
546 filter(vf->priv, dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1],
a2b24e0d7772 prevent flicker on b-frames, trivial port from vf_spp
henry
parents: 17012
diff changeset
547 mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, qp_tab, mpi->qstride, 0);
a2b24e0d7772 prevent flicker on b-frames, trivial port from vf_spp
henry
parents: 17012
diff changeset
548 filter(vf->priv, dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2],
a2b24e0d7772 prevent flicker on b-frames, trivial port from vf_spp
henry
parents: 17012
diff changeset
549 mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, qp_tab, mpi->qstride, 0);
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
550 }else{
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
551 memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h, dmpi->stride[0], mpi->stride[0]);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
552 memcpy_pic(dmpi->planes[1], mpi->planes[1], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[1], mpi->stride[1]);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
553 memcpy_pic(dmpi->planes[2], mpi->planes[2], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[2], mpi->stride[2]);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
554 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
555 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
556
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
557 #ifdef HAVE_MMX
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
558 if(gCpuCaps.hasMMX) asm volatile ("emms\n\t");
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
559 #endif
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
560 #ifdef HAVE_MMX2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
561 if(gCpuCaps.hasMMX2) asm volatile ("sfence\n\t");
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
562 #endif
17906
20aca9baf5d8 passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents: 17523
diff changeset
563 return vf_next_put_image(vf,dmpi, pts);
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
564 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
565
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
566 static void uninit(struct vf_instance_s* vf)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
567 {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
568 if(!vf->priv) return;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
569
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
570 if(vf->priv->temp) av_free(vf->priv->temp);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
571 vf->priv->temp= NULL;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
572 if(vf->priv->src) av_free(vf->priv->src);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
573 vf->priv->src= NULL;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
574 //if(vf->priv->avctx) free(vf->priv->avctx);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
575 //vf->priv->avctx= NULL;
17133
a2b24e0d7772 prevent flicker on b-frames, trivial port from vf_spp
henry
parents: 17012
diff changeset
576 if(vf->priv->non_b_qp) free(vf->priv->non_b_qp);
a2b24e0d7772 prevent flicker on b-frames, trivial port from vf_spp
henry
parents: 17012
diff changeset
577 vf->priv->non_b_qp= NULL;
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
578
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
579 av_free(vf->priv);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
580 vf->priv=NULL;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
581 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
582
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
583 //===========================================================================//
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
584
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
585 static int query_format(struct vf_instance_s* vf, unsigned int fmt)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
586 {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
587 switch(fmt){
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
588 case IMGFMT_YVU9:
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
589 case IMGFMT_IF09:
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
590 case IMGFMT_YV12:
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
591 case IMGFMT_I420:
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
592 case IMGFMT_IYUV:
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
593 case IMGFMT_CLPL:
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
594 case IMGFMT_Y800:
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
595 case IMGFMT_Y8:
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
596 case IMGFMT_444P:
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
597 case IMGFMT_422P:
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
598 case IMGFMT_411P:
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
599 return vf_next_query_format(vf,fmt);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
600 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
601 return 0;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
602 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
603
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
604 /*
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
605 static unsigned int fmt_list[]={
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
606 IMGFMT_YVU9,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
607 IMGFMT_IF09,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
608 IMGFMT_YV12,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
609 IMGFMT_I420,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
610 IMGFMT_IYUV,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
611 IMGFMT_CLPL,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
612 IMGFMT_Y800,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
613 IMGFMT_Y8,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
614 IMGFMT_444P,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
615 IMGFMT_422P,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
616 IMGFMT_411P,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
617 0
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
618 };
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
619 */
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
620
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
621 static int control(struct vf_instance_s* vf, int request, void* data)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
622 {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
623 switch(request){
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
624 case VFCTRL_QUERY_MAX_PP_LEVEL:
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
625 return 5;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
626 case VFCTRL_SET_PP_LEVEL:
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
627 vf->priv->log2_count= *((unsigned int*)data);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
628 if (vf->priv->log2_count < 4) vf->priv->log2_count=4;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
629 return CONTROL_TRUE;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
630 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
631 return vf_next_control(vf,request,data);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
632 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
633
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
634 static int open(vf_instance_t *vf, char* args)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
635 {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
636 int i=0, bias;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
637 int custom_threshold_m[64];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
638 int log2c=-1;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
639
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
640 vf->config=config;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
641 vf->put_image=put_image;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
642 vf->get_image=get_image;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
643 vf->query_format=query_format;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
644 vf->uninit=uninit;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
645 vf->control= control;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
646 vf->priv=av_mallocz(sizeof(struct vf_priv_s));//assumes align 16 !
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
647
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
648 avcodec_init();
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
649
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
650 //vf->priv->avctx= avcodec_alloc_context();
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
651 //dsputil_init(&vf->priv->dsp, vf->priv->avctx);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
652
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
653 vf->priv->log2_count= 4;
17225
ec9888363742 reverse the H264 hack
henry
parents: 17223
diff changeset
654 vf->priv->bframes = 0;
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
655
17225
ec9888363742 reverse the H264 hack
henry
parents: 17223
diff changeset
656 if (args) sscanf(args, "%d:%d:%d:%d", &log2c, &vf->priv->qp, &i, &vf->priv->bframes);
ec9888363742 reverse the H264 hack
henry
parents: 17223
diff changeset
657
ec9888363742 reverse the H264 hack
henry
parents: 17223
diff changeset
658 if( log2c >=4 && log2c <=5 )
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
659 vf->priv->log2_count = log2c;
15651
6a0494e09435 sanity checks for options; treat quality > 5 as 5, not 4
henry
parents: 15634
diff changeset
660 else if( log2c >= 6 )
6a0494e09435 sanity checks for options; treat quality > 5 as 5, not 4
henry
parents: 15634
diff changeset
661 vf->priv->log2_count = 5;
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
662
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
663 if(vf->priv->qp < 0)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
664 vf->priv->qp = 0;
15651
6a0494e09435 sanity checks for options; treat quality > 5 as 5, not 4
henry
parents: 15634
diff changeset
665
6a0494e09435 sanity checks for options; treat quality > 5 as 5, not 4
henry
parents: 15634
diff changeset
666 if (i < -15) i = -15;
6a0494e09435 sanity checks for options; treat quality > 5 as 5, not 4
henry
parents: 15634
diff changeset
667 if (i > 32) i = 32;
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
668
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
669 bias= (1<<4)+i; //regulable
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
670 vf->priv->prev_q=0;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
671 //
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
672 for(i=0;i<64;i++) //FIXME: tune custom_threshold[] and remove this !
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
673 custom_threshold_m[i]=(int)(custom_threshold[i]*(bias/71.)+ 0.5);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
674 for(i=0;i<8;i++){
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
675 vf->priv->threshold_mtx_noq[2*i]=(uint64_t)custom_threshold_m[i*8+2]
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
676 |(((uint64_t)custom_threshold_m[i*8+6])<<16)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
677 |(((uint64_t)custom_threshold_m[i*8+0])<<32)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
678 |(((uint64_t)custom_threshold_m[i*8+4])<<48);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
679 vf->priv->threshold_mtx_noq[2*i+1]=(uint64_t)custom_threshold_m[i*8+5]
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
680 |(((uint64_t)custom_threshold_m[i*8+3])<<16)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
681 |(((uint64_t)custom_threshold_m[i*8+1])<<32)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
682 |(((uint64_t)custom_threshold_m[i*8+7])<<48);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
683 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
684
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
685 if (vf->priv->qp) vf->priv->prev_q=vf->priv->qp, mul_thrmat_s(vf->priv, vf->priv->qp);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
686
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
687 return 1;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
688 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
689
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
690 vf_info_t vf_info_fspp = {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
691 "fast simple postprocess",
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
692 "fspp",
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
693 "Michael Niedermayer, Nikolaj Poroshin",
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
694 "",
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
695 open,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
696 NULL
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
697 };
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
698
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
699 //====================================================================
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
700 //Specific spp's dct, idct and threshold functions
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
701 //I'd prefer to have them in the separate file.
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
702
17012
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 16018
diff changeset
703 #include "mangle.h"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
704 //#define MANGLE(a) #a
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
705
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
706 //typedef int16_t DCTELEM; //! only int16_t
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
707
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
708 #define DCTSIZE 8
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
709 #define DCTSIZE_S "8"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
710
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
711 #define FIX(x,s) ((int) ((x) * (1<<s) + 0.5)&0xffff)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
712 #define C64(x) ((uint64_t)((x)|(x)<<16))<<32 | (uint64_t)(x) | (uint64_t)(x)<<16
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
713 #define FIX64(x,s) C64(FIX(x,s))
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
714
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
715 #define MULTIPLY16H(x,k) (((x)*(k))>>16)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
716 #define THRESHOLD(r,x,t) if(((unsigned)((x)+t))>t*2) r=(x);else r=0;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
717 #define DESCALE(x,n) (((x) + (1 << ((n)-1))) >> n)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
718
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
719 #ifdef HAVE_MMX
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
720
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
721 static uint64_t attribute_used __attribute__((aligned(8))) temps[4];//!!
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
722
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
723 static uint64_t attribute_used __attribute__((aligned(8))) MM_FIX_0_382683433=FIX64(0.382683433, 14);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
724 static uint64_t attribute_used __attribute__((aligned(8))) MM_FIX_0_541196100=FIX64(0.541196100, 14);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
725 static uint64_t attribute_used __attribute__((aligned(8))) MM_FIX_0_707106781=FIX64(0.707106781, 14);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
726 static uint64_t attribute_used __attribute__((aligned(8))) MM_FIX_1_306562965=FIX64(1.306562965, 14);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
727
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
728 static uint64_t attribute_used __attribute__((aligned(8))) MM_FIX_1_414213562_A=FIX64(1.414213562, 14);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
729
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
730 static uint64_t attribute_used __attribute__((aligned(8))) MM_FIX_1_847759065=FIX64(1.847759065, 13);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
731 static uint64_t attribute_used __attribute__((aligned(8))) MM_FIX_2_613125930=FIX64(-2.613125930, 13); //-
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
732 static uint64_t attribute_used __attribute__((aligned(8))) MM_FIX_1_414213562=FIX64(1.414213562, 13);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
733 static uint64_t attribute_used __attribute__((aligned(8))) MM_FIX_1_082392200=FIX64(1.082392200, 13);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
734 //for t3,t5,t7 == 0 shortcut
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
735 static uint64_t attribute_used __attribute__((aligned(8))) MM_FIX_0_847759065=FIX64(0.847759065, 14);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
736 static uint64_t attribute_used __attribute__((aligned(8))) MM_FIX_0_566454497=FIX64(0.566454497, 14);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
737 static uint64_t attribute_used __attribute__((aligned(8))) MM_FIX_0_198912367=FIX64(0.198912367, 14);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
738
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
739 static uint64_t attribute_used __attribute__((aligned(8))) MM_DESCALE_RND=C64(4);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
740 static uint64_t attribute_used __attribute__((aligned(8))) MM_2=C64(2);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
741
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
742 #else /* !HAVE_MMX */
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
743
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
744 typedef int32_t int_simd16_t;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
745 static int16_t FIX_0_382683433=FIX(0.382683433, 14);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
746 static int16_t FIX_0_541196100=FIX(0.541196100, 14);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
747 static int16_t FIX_0_707106781=FIX(0.707106781, 14);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
748 static int16_t FIX_1_306562965=FIX(1.306562965, 14);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
749 static int16_t FIX_1_414213562_A=FIX(1.414213562, 14);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
750 static int16_t FIX_1_847759065=FIX(1.847759065, 13);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
751 static int16_t FIX_2_613125930=FIX(-2.613125930, 13); //-
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
752 static int16_t FIX_1_414213562=FIX(1.414213562, 13);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
753 static int16_t FIX_1_082392200=FIX(1.082392200, 13);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
754
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
755 #endif
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
756
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
757 #ifndef HAVE_MMX
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
758
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
759 static void column_fidct_c(int16_t* thr_adr, DCTELEM *data, DCTELEM *output, int cnt)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
760 {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
761 int_simd16_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
762 int_simd16_t tmp10, tmp11, tmp12, tmp13;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
763 int_simd16_t z1,z2,z3,z4,z5, z10, z11, z12, z13;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
764 int_simd16_t d0, d1, d2, d3, d4, d5, d6, d7;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
765
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
766 DCTELEM* dataptr;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
767 DCTELEM* wsptr;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
768 int16_t *threshold;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
769 int ctr;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
770
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
771 dataptr = data;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
772 wsptr = output;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
773
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
774 for (; cnt > 0; cnt-=2) { //start positions
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
775 threshold=(int16_t*)thr_adr;//threshold_mtx
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
776 for (ctr = DCTSIZE; ctr > 0; ctr--) {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
777 // Process columns from input, add to output.
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
778 tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
779 tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
780
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
781 tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
782 tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
783
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
784 tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
785 tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
786
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
787 tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
788 tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
789
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
790 // Even part of FDCT
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
791
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
792 tmp10 = tmp0 + tmp3;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
793 tmp13 = tmp0 - tmp3;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
794 tmp11 = tmp1 + tmp2;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
795 tmp12 = tmp1 - tmp2;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
796
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
797 d0 = tmp10 + tmp11;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
798 d4 = tmp10 - tmp11;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
799
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
800 z1 = MULTIPLY16H((tmp12 + tmp13) <<2, FIX_0_707106781);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
801 d2 = tmp13 + z1;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
802 d6 = tmp13 - z1;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
803
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
804 // Even part of IDCT
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
805
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
806 THRESHOLD(tmp0, d0, threshold[0*8]);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
807 THRESHOLD(tmp1, d2, threshold[2*8]);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
808 THRESHOLD(tmp2, d4, threshold[4*8]);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
809 THRESHOLD(tmp3, d6, threshold[6*8]);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
810 tmp0+=2;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
811 tmp10 = (tmp0 + tmp2)>>2;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
812 tmp11 = (tmp0 - tmp2)>>2;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
813
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
814 tmp13 = (tmp1 + tmp3)>>2; //+2 ! (psnr decides)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
815 tmp12 = MULTIPLY16H((tmp1 - tmp3), FIX_1_414213562_A) - tmp13; //<<2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
816
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
817 tmp0 = tmp10 + tmp13; //->temps
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
818 tmp3 = tmp10 - tmp13; //->temps
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
819 tmp1 = tmp11 + tmp12; //->temps
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
820 tmp2 = tmp11 - tmp12; //->temps
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
821
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
822 // Odd part of FDCT
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
823
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
824 tmp10 = tmp4 + tmp5;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
825 tmp11 = tmp5 + tmp6;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
826 tmp12 = tmp6 + tmp7;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
827
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
828 z5 = MULTIPLY16H((tmp10 - tmp12)<<2, FIX_0_382683433);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
829 z2 = MULTIPLY16H(tmp10 <<2, FIX_0_541196100) + z5;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
830 z4 = MULTIPLY16H(tmp12 <<2, FIX_1_306562965) + z5;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
831 z3 = MULTIPLY16H(tmp11 <<2, FIX_0_707106781);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
832
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
833 z11 = tmp7 + z3;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
834 z13 = tmp7 - z3;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
835
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
836 d5 = z13 + z2;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
837 d3 = z13 - z2;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
838 d1 = z11 + z4;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
839 d7 = z11 - z4;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
840
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
841 // Odd part of IDCT
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
842
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
843 THRESHOLD(tmp4, d1, threshold[1*8]);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
844 THRESHOLD(tmp5, d3, threshold[3*8]);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
845 THRESHOLD(tmp6, d5, threshold[5*8]);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
846 THRESHOLD(tmp7, d7, threshold[7*8]);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
847
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
848 //Simd version uses here a shortcut for the tmp5,tmp6,tmp7 == 0
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
849 z13 = tmp6 + tmp5;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
850 z10 = (tmp6 - tmp5)<<1;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
851 z11 = tmp4 + tmp7;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
852 z12 = (tmp4 - tmp7)<<1;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
853
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
854 tmp7 = (z11 + z13)>>2; //+2 !
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
855 tmp11 = MULTIPLY16H((z11 - z13)<<1, FIX_1_414213562);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
856 z5 = MULTIPLY16H(z10 + z12, FIX_1_847759065);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
857 tmp10 = MULTIPLY16H(z12, FIX_1_082392200) - z5;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
858 tmp12 = MULTIPLY16H(z10, FIX_2_613125930) + z5; // - !!
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
859
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
860 tmp6 = tmp12 - tmp7;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
861 tmp5 = tmp11 - tmp6;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
862 tmp4 = tmp10 + tmp5;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
863
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
864 wsptr[DCTSIZE*0]+= (tmp0 + tmp7);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
865 wsptr[DCTSIZE*1]+= (tmp1 + tmp6);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
866 wsptr[DCTSIZE*2]+= (tmp2 + tmp5);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
867 wsptr[DCTSIZE*3]+= (tmp3 - tmp4);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
868 wsptr[DCTSIZE*4]+= (tmp3 + tmp4);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
869 wsptr[DCTSIZE*5]+= (tmp2 - tmp5);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
870 wsptr[DCTSIZE*6]= (tmp1 - tmp6);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
871 wsptr[DCTSIZE*7]= (tmp0 - tmp7);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
872 //
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
873 dataptr++; //next column
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
874 wsptr++;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
875 threshold++;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
876 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
877 dataptr+=8; //skip each second start pos
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
878 wsptr +=8;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
879 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
880 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
881
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
882 #else /* HAVE_MMX */
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
883
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
884 static void column_fidct_mmx(int16_t* thr_adr, DCTELEM *data, DCTELEM *output, int cnt)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
885 {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
886 asm volatile(
18104
7b408d60de9e add support for intel mac. mp3lib is not fixed yet.
nplourde
parents: 17906
diff changeset
887 ASMALIGN16
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
888 "1: \n\t"
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
889 "movq "DCTSIZE_S"*0*2(%%"REG_S"), %%mm1 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
890 //
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
891 "movq "DCTSIZE_S"*3*2(%%"REG_S"), %%mm7 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
892 "movq %%mm1, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
893
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
894 "paddw "DCTSIZE_S"*7*2(%%"REG_S"), %%mm1 \n\t" //t0
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
895 "movq %%mm7, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
896
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
897 "paddw "DCTSIZE_S"*4*2(%%"REG_S"), %%mm7 \n\t" //t3
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
898 "movq %%mm1, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
899
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
900 "movq "DCTSIZE_S"*1*2(%%"REG_S"), %%mm6 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
901 "psubw %%mm7, %%mm1 \n\t" //t13
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
902
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
903 "movq "DCTSIZE_S"*2*2(%%"REG_S"), %%mm2 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
904 "movq %%mm6, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
905
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
906 "paddw "DCTSIZE_S"*6*2(%%"REG_S"), %%mm6 \n\t" //t1
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
907 "paddw %%mm7, %%mm5 \n\t" //t10
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
908
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
909 "paddw "DCTSIZE_S"*5*2(%%"REG_S"), %%mm2 \n\t" //t2
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
910 "movq %%mm6, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
911
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
912 "paddw %%mm2, %%mm6 \n\t" //t11
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
913 "psubw %%mm2, %%mm7 \n\t" //t12
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
914
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
915 "movq %%mm5, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
916 "paddw %%mm6, %%mm5 \n\t" //d0
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
917 // i0 t13 t12 i3 i1 d0 - d4
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
918 "psubw %%mm6, %%mm2 \n\t" //d4
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
919 "paddw %%mm1, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
920
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
921 "movq 4*16(%%"REG_d"), %%mm6 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
922 "psllw $2, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
923
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
924 "psubw 0*16(%%"REG_d"), %%mm5 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
925 "psubw %%mm6, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
926
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
927 "paddusw 0*16(%%"REG_d"), %%mm5 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
928 "paddusw %%mm6, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
929
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
930 "pmulhw "MANGLE(MM_FIX_0_707106781)", %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
931 //
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
932 "paddw 0*16(%%"REG_d"), %%mm5 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
933 "paddw %%mm6, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
934
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
935 "psubusw 0*16(%%"REG_d"), %%mm5 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
936 "psubusw %%mm6, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
937
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
938 //This func is totally compute-bound, operates at huge speed. So, DC shortcut
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
939 // at this place isn't worthwhile due to BTB miss penalty (checked on Pent. 3).
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
940 //However, typical numbers: nondc - 29%%, dc - 46%%, zero - 25%%. All <> 0 case is very rare.
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
941 "paddw "MANGLE(MM_2)", %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
942 "movq %%mm2, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
943
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
944 "paddw %%mm5, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
945 "psubw %%mm6, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
946
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
947 "movq %%mm1, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
948 "paddw %%mm7, %%mm1 \n\t" //d2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
949
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
950 "psubw 2*16(%%"REG_d"), %%mm1 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
951 "psubw %%mm7, %%mm6 \n\t" //d6
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
952
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
953 "movq 6*16(%%"REG_d"), %%mm7 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
954 "psraw $2, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
955
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
956 "paddusw 2*16(%%"REG_d"), %%mm1 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
957 "psubw %%mm7, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
958 // t7 d2 /t11 t4 t6 - d6 /t10
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
959
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
960 "paddw 2*16(%%"REG_d"), %%mm1 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
961 "paddusw %%mm7, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
962
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
963 "psubusw 2*16(%%"REG_d"), %%mm1 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
964 "paddw %%mm7, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
965
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
966 "psubw "DCTSIZE_S"*4*2(%%"REG_S"), %%mm3 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
967 "psubusw %%mm7, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
968
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
969 //movq [edi+"DCTSIZE_S"*2*2], mm1
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
970 //movq [edi+"DCTSIZE_S"*6*2], mm6
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
971 "movq %%mm1, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
972 "psraw $2, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
973
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
974 "psubw "DCTSIZE_S"*6*2(%%"REG_S"), %%mm4 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
975 "psubw %%mm6, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
976
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
977 "psubw "DCTSIZE_S"*7*2(%%"REG_S"), %%mm0 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
978 "paddw %%mm7, %%mm6 \n\t" //'t13
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
979
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
980 "psraw $2, %%mm6 \n\t" //paddw mm6, MM_2 !! ---
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
981 "movq %%mm2, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
982
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
983 "pmulhw "MANGLE(MM_FIX_1_414213562_A)", %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
984 "paddw %%mm6, %%mm2 \n\t" //'t0
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
985
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
986 "movq %%mm2, "MANGLE(temps)"+0*8 \n\t" //!
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
987 "psubw %%mm6, %%mm7 \n\t" //'t3
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
988
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
989 "movq "DCTSIZE_S"*2*2(%%"REG_S"), %%mm2 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
990 "psubw %%mm6, %%mm1 \n\t" //'t12
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
991
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
992 "psubw "DCTSIZE_S"*5*2(%%"REG_S"), %%mm2 \n\t" //t5
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
993 "movq %%mm5, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
994
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
995 "movq %%mm7, "MANGLE(temps)"+3*8 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
996 "paddw %%mm2, %%mm3 \n\t" //t10
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
997
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
998 "paddw %%mm4, %%mm2 \n\t" //t11
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
999 "paddw %%mm0, %%mm4 \n\t" //t12
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1000
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1001 "movq %%mm3, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1002 "psubw %%mm4, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1003
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1004 "psllw $2, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1005 "psllw $2, %%mm7 \n\t" //opt for P6
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1006
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1007 "pmulhw "MANGLE(MM_FIX_0_382683433)", %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1008 "psllw $2, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1009
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1010 "pmulhw "MANGLE(MM_FIX_0_541196100)", %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1011 "psllw $2, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1012
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1013 "pmulhw "MANGLE(MM_FIX_1_306562965)", %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1014 "paddw %%mm1, %%mm5 \n\t" //'t1
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1015
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1016 "pmulhw "MANGLE(MM_FIX_0_707106781)", %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1017 "psubw %%mm1, %%mm6 \n\t" //'t2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1018 // t7 't12 't11 t4 t6 - 't13 't10 ---
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1019
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1020 "paddw %%mm3, %%mm7 \n\t" //z2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1021
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1022 "movq %%mm5, "MANGLE(temps)"+1*8 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1023 "paddw %%mm3, %%mm4 \n\t" //z4
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1024
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1025 "movq 3*16(%%"REG_d"), %%mm3 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1026 "movq %%mm0, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1027
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1028 "movq %%mm6, "MANGLE(temps)"+2*8 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1029 "psubw %%mm2, %%mm1 \n\t" //z13
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1030
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1031 //===
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1032 "paddw %%mm2, %%mm0 \n\t" //z11
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1033 "movq %%mm1, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1034
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1035 "movq 5*16(%%"REG_d"), %%mm2 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1036 "psubw %%mm7, %%mm1 \n\t" //d3
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1037
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1038 "paddw %%mm7, %%mm5 \n\t" //d5
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1039 "psubw %%mm3, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1040
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1041 "movq 1*16(%%"REG_d"), %%mm7 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1042 "psubw %%mm2, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1043
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1044 "movq %%mm0, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1045 "paddw %%mm4, %%mm0 \n\t" //d1
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1046
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1047 "paddusw %%mm3, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1048 "psubw %%mm4, %%mm6 \n\t" //d7
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1049
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1050 // d1 d3 - - - d5 d7 -
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1051 "movq 7*16(%%"REG_d"), %%mm4 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1052 "psubw %%mm7, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1053
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1054 "psubw %%mm4, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1055 "paddusw %%mm2, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1056
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1057 "paddusw %%mm4, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1058 "paddw %%mm3, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1059
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1060 "paddw %%mm2, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1061 "paddw %%mm4, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1062
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1063 "psubusw %%mm3, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1064 "psubusw %%mm2, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1065
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1066 "psubusw %%mm4, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1067 "movq %%mm1, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1068
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1069 "por %%mm5, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1070 "paddusw %%mm7, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1071
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1072 "por %%mm6, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1073 "paddw %%mm7, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1074
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1075 "packssdw %%mm4, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1076 "psubusw %%mm7, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1077
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1078 "movd %%mm4, %%"REG_a" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1079 "or %%"REG_a", %%"REG_a" \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1080 "jnz 2f \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1081 //movq [edi+"DCTSIZE_S"*3*2], mm1
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1082 //movq [edi+"DCTSIZE_S"*5*2], mm5
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1083 //movq [edi+"DCTSIZE_S"*1*2], mm0
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1084 //movq [edi+"DCTSIZE_S"*7*2], mm6
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1085 // t4 t5 - - - t6 t7 -
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1086 //--- t4 (mm0) may be <>0; mm1, mm5, mm6 == 0
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1087 //Typical numbers: nondc - 19%%, dc - 26%%, zero - 55%%. zero case alone isn't worthwhile
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1088 "movq "MANGLE(temps)"+0*8, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1089 "movq %%mm0, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1090
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1091 "pmulhw "MANGLE(MM_FIX_0_847759065)", %%mm0 \n\t" //tmp6
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1092 "movq %%mm1, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1093
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1094 "movq "DCTSIZE_S"*0*2(%%"REG_D"), %%mm5 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1095 "movq %%mm2, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1096
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1097 "pmulhw "MANGLE(MM_FIX_0_566454497)", %%mm1 \n\t" //tmp5
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1098 "paddw %%mm4, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1099
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1100 "movq "MANGLE(temps)"+1*8, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1101 //paddw mm3, MM_2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1102 "psraw $2, %%mm3 \n\t" //tmp7
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1103
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1104 "pmulhw "MANGLE(MM_FIX_0_198912367)", %%mm2 \n\t" //-tmp4
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1105 "psubw %%mm3, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1106
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1107 "movq "DCTSIZE_S"*1*2(%%"REG_D"), %%mm7 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1108 "paddw %%mm3, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1109
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1110 "movq %%mm4, "DCTSIZE_S"*7*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1111 "paddw %%mm6, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1112
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1113 "movq "MANGLE(temps)"+2*8, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1114 "psubw %%mm0, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1115
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1116 "movq "DCTSIZE_S"*2*2(%%"REG_D"), %%mm4 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1117 "paddw %%mm0, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1118
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1119 "movq %%mm5, "DCTSIZE_S"*0*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1120 "paddw %%mm3, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1121
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1122 "movq %%mm6, "DCTSIZE_S"*6*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1123 "psubw %%mm1, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1124
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1125 "movq "DCTSIZE_S"*5*2(%%"REG_D"), %%mm5 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1126 "paddw %%mm1, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1127
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1128 "movq "DCTSIZE_S"*3*2(%%"REG_D"), %%mm6 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1129 "paddw %%mm3, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1130
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1131 "movq "MANGLE(temps)"+3*8, %%mm0 \n\t"
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1132 "add $8, %%"REG_S" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1133
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1134 "movq %%mm7, "DCTSIZE_S"*1*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1135 "paddw %%mm0, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1136
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1137 "movq %%mm4, "DCTSIZE_S"*2*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1138 "psubw %%mm2, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1139
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1140 "movq "DCTSIZE_S"*4*2(%%"REG_D"), %%mm7 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1141 "paddw %%mm2, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1142
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1143 "movq %%mm5, "DCTSIZE_S"*5*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1144 "paddw %%mm0, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1145
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1146 "movq %%mm6, "DCTSIZE_S"*3*2(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1147
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1148 "movq %%mm7, "DCTSIZE_S"*4*2(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1149 "add $8, %%"REG_D" \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1150 "jmp 4f \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1151
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1152 "2: \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1153 //--- non DC2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1154 //psraw mm1, 2 w/o it -> offset. thr1, thr1, thr1 (actually thr1, thr1, thr1-1)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1155 //psraw mm5, 2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1156 //psraw mm0, 2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1157 //psraw mm6, 2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1158 "movq %%mm5, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1159 "psubw %%mm1, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1160
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1161 "psllw $1, %%mm5 \n\t" //'z10
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1162 "paddw %%mm1, %%mm3 \n\t" //'z13
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1163
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1164 "movq %%mm0, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1165 "psubw %%mm6, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1166
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1167 "movq %%mm5, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1168 "psllw $1, %%mm0 \n\t" //'z12
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1169
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1170 "pmulhw "MANGLE(MM_FIX_2_613125930)", %%mm1 \n\t" //-
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1171 "paddw %%mm0, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1172
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1173 "pmulhw "MANGLE(MM_FIX_1_847759065)", %%mm5 \n\t" //'z5
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1174 "paddw %%mm6, %%mm2 \n\t" //'z11
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1175
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1176 "pmulhw "MANGLE(MM_FIX_1_082392200)", %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1177 "movq %%mm2, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1178
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1179 //---
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1180 "movq "MANGLE(temps)"+0*8, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1181 "psubw %%mm3, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1182
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1183 "psllw $1, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1184 "paddw %%mm3, %%mm7 \n\t" //'t7
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1185
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1186 "pmulhw "MANGLE(MM_FIX_1_414213562)", %%mm2 \n\t" //'t11
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1187 "movq %%mm4, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1188 //paddw mm7, MM_2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1189 "psraw $2, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1190
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1191 "paddw "DCTSIZE_S"*0*2(%%"REG_D"), %%mm4 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1192 "psubw %%mm7, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1193
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1194 "movq "MANGLE(temps)"+1*8, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1195 "paddw %%mm7, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1196
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1197 "movq %%mm6, "DCTSIZE_S"*7*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1198 "paddw %%mm5, %%mm1 \n\t" //'t12
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1199
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1200 "movq %%mm4, "DCTSIZE_S"*0*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1201 "psubw %%mm7, %%mm1 \n\t" //'t6
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1202
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1203 "movq "MANGLE(temps)"+2*8, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1204 "psubw %%mm5, %%mm0 \n\t" //'t10
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1205
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1206 "movq "MANGLE(temps)"+3*8, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1207 "movq %%mm3, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1208
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1209 "paddw "DCTSIZE_S"*1*2(%%"REG_D"), %%mm3 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1210 "psubw %%mm1, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1211
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1212 "psubw %%mm1, %%mm2 \n\t" //'t5
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1213 "paddw %%mm1, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1214
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1215 "movq %%mm5, "DCTSIZE_S"*6*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1216 "movq %%mm7, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1217
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1218 "paddw "DCTSIZE_S"*2*2(%%"REG_D"), %%mm7 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1219 "psubw %%mm2, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1220
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1221 "paddw "DCTSIZE_S"*5*2(%%"REG_D"), %%mm4 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1222 "paddw %%mm2, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1223
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1224 "movq %%mm3, "DCTSIZE_S"*1*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1225 "paddw %%mm2, %%mm0 \n\t" //'t4
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1226
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1227 // 't4 't6 't5 - - - - 't7
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1228 "movq %%mm7, "DCTSIZE_S"*2*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1229 "movq %%mm6, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1230
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1231 "paddw "DCTSIZE_S"*4*2(%%"REG_D"), %%mm6 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1232 "psubw %%mm0, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1233
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1234 "paddw "DCTSIZE_S"*3*2(%%"REG_D"), %%mm1 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1235 "paddw %%mm0, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1236
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1237 "movq %%mm4, "DCTSIZE_S"*5*2(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1238 "add $8, %%"REG_S" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1239
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1240 "movq %%mm6, "DCTSIZE_S"*4*2(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1241
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1242 "movq %%mm1, "DCTSIZE_S"*3*2(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1243 "add $8, %%"REG_D" \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1244
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1245 "4: \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1246 //=part 2 (the same)===========================================================
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1247 "movq "DCTSIZE_S"*0*2(%%"REG_S"), %%mm1 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1248 //
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1249 "movq "DCTSIZE_S"*3*2(%%"REG_S"), %%mm7 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1250 "movq %%mm1, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1251
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1252 "paddw "DCTSIZE_S"*7*2(%%"REG_S"), %%mm1 \n\t" //t0
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1253 "movq %%mm7, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1254
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1255 "paddw "DCTSIZE_S"*4*2(%%"REG_S"), %%mm7 \n\t" //t3
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1256 "movq %%mm1, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1257
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1258 "movq "DCTSIZE_S"*1*2(%%"REG_S"), %%mm6 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1259 "psubw %%mm7, %%mm1 \n\t" //t13
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1260
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1261 "movq "DCTSIZE_S"*2*2(%%"REG_S"), %%mm2 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1262 "movq %%mm6, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1263
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1264 "paddw "DCTSIZE_S"*6*2(%%"REG_S"), %%mm6 \n\t" //t1
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1265 "paddw %%mm7, %%mm5 \n\t" //t10
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1266
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1267 "paddw "DCTSIZE_S"*5*2(%%"REG_S"), %%mm2 \n\t" //t2
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1268 "movq %%mm6, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1269
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1270 "paddw %%mm2, %%mm6 \n\t" //t11
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1271 "psubw %%mm2, %%mm7 \n\t" //t12
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1272
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1273 "movq %%mm5, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1274 "paddw %%mm6, %%mm5 \n\t" //d0
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1275 // i0 t13 t12 i3 i1 d0 - d4
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1276 "psubw %%mm6, %%mm2 \n\t" //d4
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1277 "paddw %%mm1, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1278
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1279 "movq 1*8+4*16(%%"REG_d"), %%mm6 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1280 "psllw $2, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1281
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1282 "psubw 1*8+0*16(%%"REG_d"), %%mm5 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1283 "psubw %%mm6, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1284
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1285 "paddusw 1*8+0*16(%%"REG_d"), %%mm5 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1286 "paddusw %%mm6, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1287
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1288 "pmulhw "MANGLE(MM_FIX_0_707106781)", %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1289 //
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1290 "paddw 1*8+0*16(%%"REG_d"), %%mm5 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1291 "paddw %%mm6, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1292
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1293 "psubusw 1*8+0*16(%%"REG_d"), %%mm5 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1294 "psubusw %%mm6, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1295
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1296 //This func is totally compute-bound, operates at huge speed. So, DC shortcut
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1297 // at this place isn't worthwhile due to BTB miss penalty (checked on Pent. 3).
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1298 //However, typical numbers: nondc - 29%%, dc - 46%%, zero - 25%%. All <> 0 case is very rare.
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1299 "paddw "MANGLE(MM_2)", %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1300 "movq %%mm2, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1301
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1302 "paddw %%mm5, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1303 "psubw %%mm6, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1304
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1305 "movq %%mm1, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1306 "paddw %%mm7, %%mm1 \n\t" //d2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1307
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1308 "psubw 1*8+2*16(%%"REG_d"), %%mm1 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1309 "psubw %%mm7, %%mm6 \n\t" //d6
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1310
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1311 "movq 1*8+6*16(%%"REG_d"), %%mm7 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1312 "psraw $2, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1313
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1314 "paddusw 1*8+2*16(%%"REG_d"), %%mm1 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1315 "psubw %%mm7, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1316 // t7 d2 /t11 t4 t6 - d6 /t10
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1317
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1318 "paddw 1*8+2*16(%%"REG_d"), %%mm1 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1319 "paddusw %%mm7, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1320
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1321 "psubusw 1*8+2*16(%%"REG_d"), %%mm1 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1322 "paddw %%mm7, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1323
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1324 "psubw "DCTSIZE_S"*4*2(%%"REG_S"), %%mm3 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1325 "psubusw %%mm7, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1326
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1327 //movq [edi+"DCTSIZE_S"*2*2], mm1
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1328 //movq [edi+"DCTSIZE_S"*6*2], mm6
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1329 "movq %%mm1, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1330 "psraw $2, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1331
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1332 "psubw "DCTSIZE_S"*6*2(%%"REG_S"), %%mm4 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1333 "psubw %%mm6, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1334
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1335 "psubw "DCTSIZE_S"*7*2(%%"REG_S"), %%mm0 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1336 "paddw %%mm7, %%mm6 \n\t" //'t13
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1337
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1338 "psraw $2, %%mm6 \n\t" //paddw mm6, MM_2 !! ---
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1339 "movq %%mm2, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1340
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1341 "pmulhw "MANGLE(MM_FIX_1_414213562_A)", %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1342 "paddw %%mm6, %%mm2 \n\t" //'t0
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1343
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1344 "movq %%mm2, "MANGLE(temps)"+0*8 \n\t" //!
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1345 "psubw %%mm6, %%mm7 \n\t" //'t3
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1346
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1347 "movq "DCTSIZE_S"*2*2(%%"REG_S"), %%mm2 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1348 "psubw %%mm6, %%mm1 \n\t" //'t12
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1349
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1350 "psubw "DCTSIZE_S"*5*2(%%"REG_S"), %%mm2 \n\t" //t5
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1351 "movq %%mm5, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1352
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1353 "movq %%mm7, "MANGLE(temps)"+3*8 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1354 "paddw %%mm2, %%mm3 \n\t" //t10
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1355
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1356 "paddw %%mm4, %%mm2 \n\t" //t11
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1357 "paddw %%mm0, %%mm4 \n\t" //t12
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1358
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1359 "movq %%mm3, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1360 "psubw %%mm4, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1361
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1362 "psllw $2, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1363 "psllw $2, %%mm7 \n\t" //opt for P6
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1364
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1365 "pmulhw "MANGLE(MM_FIX_0_382683433)", %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1366 "psllw $2, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1367
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1368 "pmulhw "MANGLE(MM_FIX_0_541196100)", %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1369 "psllw $2, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1370
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1371 "pmulhw "MANGLE(MM_FIX_1_306562965)", %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1372 "paddw %%mm1, %%mm5 \n\t" //'t1
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1373
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1374 "pmulhw "MANGLE(MM_FIX_0_707106781)", %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1375 "psubw %%mm1, %%mm6 \n\t" //'t2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1376 // t7 't12 't11 t4 t6 - 't13 't10 ---
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1377
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1378 "paddw %%mm3, %%mm7 \n\t" //z2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1379
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1380 "movq %%mm5, "MANGLE(temps)"+1*8 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1381 "paddw %%mm3, %%mm4 \n\t" //z4
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1382
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1383 "movq 1*8+3*16(%%"REG_d"), %%mm3 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1384 "movq %%mm0, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1385
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1386 "movq %%mm6, "MANGLE(temps)"+2*8 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1387 "psubw %%mm2, %%mm1 \n\t" //z13
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1388
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1389 //===
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1390 "paddw %%mm2, %%mm0 \n\t" //z11
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1391 "movq %%mm1, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1392
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1393 "movq 1*8+5*16(%%"REG_d"), %%mm2 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1394 "psubw %%mm7, %%mm1 \n\t" //d3
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1395
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1396 "paddw %%mm7, %%mm5 \n\t" //d5
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1397 "psubw %%mm3, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1398
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1399 "movq 1*8+1*16(%%"REG_d"), %%mm7 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1400 "psubw %%mm2, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1401
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1402 "movq %%mm0, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1403 "paddw %%mm4, %%mm0 \n\t" //d1
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1404
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1405 "paddusw %%mm3, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1406 "psubw %%mm4, %%mm6 \n\t" //d7
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1407
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1408 // d1 d3 - - - d5 d7 -
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1409 "movq 1*8+7*16(%%"REG_d"), %%mm4 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1410 "psubw %%mm7, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1411
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1412 "psubw %%mm4, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1413 "paddusw %%mm2, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1414
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1415 "paddusw %%mm4, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1416 "paddw %%mm3, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1417
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1418 "paddw %%mm2, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1419 "paddw %%mm4, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1420
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1421 "psubusw %%mm3, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1422 "psubusw %%mm2, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1423
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1424 "psubusw %%mm4, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1425 "movq %%mm1, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1426
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1427 "por %%mm5, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1428 "paddusw %%mm7, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1429
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1430 "por %%mm6, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1431 "paddw %%mm7, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1432
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1433 "packssdw %%mm4, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1434 "psubusw %%mm7, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1435
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1436 "movd %%mm4, %%"REG_a" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1437 "or %%"REG_a", %%"REG_a" \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1438 "jnz 3f \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1439 //movq [edi+"DCTSIZE_S"*3*2], mm1
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1440 //movq [edi+"DCTSIZE_S"*5*2], mm5
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1441 //movq [edi+"DCTSIZE_S"*1*2], mm0
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1442 //movq [edi+"DCTSIZE_S"*7*2], mm6
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1443 // t4 t5 - - - t6 t7 -
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1444 //--- t4 (mm0) may be <>0; mm1, mm5, mm6 == 0
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1445 //Typical numbers: nondc - 19%%, dc - 26%%, zero - 55%%. zero case alone isn't worthwhile
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1446 "movq "MANGLE(temps)"+0*8, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1447 "movq %%mm0, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1448
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1449 "pmulhw "MANGLE(MM_FIX_0_847759065)", %%mm0 \n\t" //tmp6
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1450 "movq %%mm1, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1451
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1452 "movq "DCTSIZE_S"*0*2(%%"REG_D"), %%mm5 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1453 "movq %%mm2, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1454
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1455 "pmulhw "MANGLE(MM_FIX_0_566454497)", %%mm1 \n\t" //tmp5
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1456 "paddw %%mm4, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1457
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1458 "movq "MANGLE(temps)"+1*8, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1459 //paddw mm3, MM_2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1460 "psraw $2, %%mm3 \n\t" //tmp7
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1461
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1462 "pmulhw "MANGLE(MM_FIX_0_198912367)", %%mm2 \n\t" //-tmp4
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1463 "psubw %%mm3, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1464
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1465 "movq "DCTSIZE_S"*1*2(%%"REG_D"), %%mm7 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1466 "paddw %%mm3, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1467
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1468 "movq %%mm4, "DCTSIZE_S"*7*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1469 "paddw %%mm6, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1470
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1471 "movq "MANGLE(temps)"+2*8, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1472 "psubw %%mm0, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1473
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1474 "movq "DCTSIZE_S"*2*2(%%"REG_D"), %%mm4 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1475 "paddw %%mm0, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1476
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1477 "movq %%mm5, "DCTSIZE_S"*0*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1478 "paddw %%mm3, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1479
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1480 "movq %%mm6, "DCTSIZE_S"*6*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1481 "psubw %%mm1, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1482
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1483 "movq "DCTSIZE_S"*5*2(%%"REG_D"), %%mm5 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1484 "paddw %%mm1, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1485
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1486 "movq "DCTSIZE_S"*3*2(%%"REG_D"), %%mm6 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1487 "paddw %%mm3, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1488
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1489 "movq "MANGLE(temps)"+3*8, %%mm0 \n\t"
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1490 "add $24, %%"REG_S" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1491
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1492 "movq %%mm7, "DCTSIZE_S"*1*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1493 "paddw %%mm0, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1494
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1495 "movq %%mm4, "DCTSIZE_S"*2*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1496 "psubw %%mm2, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1497
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1498 "movq "DCTSIZE_S"*4*2(%%"REG_D"), %%mm7 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1499 "paddw %%mm2, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1500
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1501 "movq %%mm5, "DCTSIZE_S"*5*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1502 "paddw %%mm0, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1503
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1504 "movq %%mm6, "DCTSIZE_S"*3*2(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1505
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1506 "movq %%mm7, "DCTSIZE_S"*4*2(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1507 "add $24, %%"REG_D" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1508 "sub $2, %%"REG_c" \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1509 "jnz 1b \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1510 "jmp 5f \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1511
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1512 "3: \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1513 //--- non DC2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1514 //psraw mm1, 2 w/o it -> offset. thr1, thr1, thr1 (actually thr1, thr1, thr1-1)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1515 //psraw mm5, 2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1516 //psraw mm0, 2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1517 //psraw mm6, 2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1518 "movq %%mm5, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1519 "psubw %%mm1, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1520
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1521 "psllw $1, %%mm5 \n\t" //'z10
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1522 "paddw %%mm1, %%mm3 \n\t" //'z13
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1523
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1524 "movq %%mm0, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1525 "psubw %%mm6, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1526
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1527 "movq %%mm5, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1528 "psllw $1, %%mm0 \n\t" //'z12
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1529
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1530 "pmulhw "MANGLE(MM_FIX_2_613125930)", %%mm1 \n\t" //-
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1531 "paddw %%mm0, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1532
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1533 "pmulhw "MANGLE(MM_FIX_1_847759065)", %%mm5 \n\t" //'z5
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1534 "paddw %%mm6, %%mm2 \n\t" //'z11
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1535
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1536 "pmulhw "MANGLE(MM_FIX_1_082392200)", %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1537 "movq %%mm2, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1538
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1539 //---
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1540 "movq "MANGLE(temps)"+0*8, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1541 "psubw %%mm3, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1542
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1543 "psllw $1, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1544 "paddw %%mm3, %%mm7 \n\t" //'t7
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1545
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1546 "pmulhw "MANGLE(MM_FIX_1_414213562)", %%mm2 \n\t" //'t11
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1547 "movq %%mm4, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1548 //paddw mm7, MM_2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1549 "psraw $2, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1550
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1551 "paddw "DCTSIZE_S"*0*2(%%"REG_D"), %%mm4 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1552 "psubw %%mm7, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1553
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1554 "movq "MANGLE(temps)"+1*8, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1555 "paddw %%mm7, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1556
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1557 "movq %%mm6, "DCTSIZE_S"*7*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1558 "paddw %%mm5, %%mm1 \n\t" //'t12
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1559
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1560 "movq %%mm4, "DCTSIZE_S"*0*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1561 "psubw %%mm7, %%mm1 \n\t" //'t6
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1562
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1563 "movq "MANGLE(temps)"+2*8, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1564 "psubw %%mm5, %%mm0 \n\t" //'t10
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1565
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1566 "movq "MANGLE(temps)"+3*8, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1567 "movq %%mm3, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1568
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1569 "paddw "DCTSIZE_S"*1*2(%%"REG_D"), %%mm3 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1570 "psubw %%mm1, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1571
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1572 "psubw %%mm1, %%mm2 \n\t" //'t5
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1573 "paddw %%mm1, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1574
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1575 "movq %%mm5, "DCTSIZE_S"*6*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1576 "movq %%mm7, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1577
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1578 "paddw "DCTSIZE_S"*2*2(%%"REG_D"), %%mm7 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1579 "psubw %%mm2, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1580
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1581 "paddw "DCTSIZE_S"*5*2(%%"REG_D"), %%mm4 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1582 "paddw %%mm2, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1583
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1584 "movq %%mm3, "DCTSIZE_S"*1*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1585 "paddw %%mm2, %%mm0 \n\t" //'t4
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1586
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1587 // 't4 't6 't5 - - - - 't7
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1588 "movq %%mm7, "DCTSIZE_S"*2*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1589 "movq %%mm6, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1590
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1591 "paddw "DCTSIZE_S"*4*2(%%"REG_D"), %%mm6 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1592 "psubw %%mm0, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1593
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1594 "paddw "DCTSIZE_S"*3*2(%%"REG_D"), %%mm1 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1595 "paddw %%mm0, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1596
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1597 "movq %%mm4, "DCTSIZE_S"*5*2(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1598 "add $24, %%"REG_S" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1599
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1600 "movq %%mm6, "DCTSIZE_S"*4*2(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1601
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1602 "movq %%mm1, "DCTSIZE_S"*3*2(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1603 "add $24, %%"REG_D" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1604 "sub $2, %%"REG_c" \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1605 "jnz 1b \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1606 "5: \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1607
15632
e813a3e431a8 move unchanged registers back to input spec
henry
parents: 15631
diff changeset
1608 : "+S"(data), "+D"(output), "+c"(cnt)// input regs
e813a3e431a8 move unchanged registers back to input spec
henry
parents: 15631
diff changeset
1609 : "d"(thr_adr)
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1610 : "%"REG_a
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1611 );
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1612 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1613
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1614 #endif // HAVE_MMX
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1615
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1616 #ifndef HAVE_MMX
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1617
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1618 static void row_idct_c(DCTELEM* workspace,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1619 int16_t* output_adr, int output_stride, int cnt)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1620 {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1621 int_simd16_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1622 int_simd16_t tmp10, tmp11, tmp12, tmp13;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1623 int_simd16_t z5, z10, z11, z12, z13;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1624 int16_t* outptr;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1625 DCTELEM* wsptr;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1626
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1627 cnt*=4;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1628 wsptr = workspace;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1629 outptr = output_adr;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1630 for (; cnt > 0; cnt--) {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1631 // Even part
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1632 //Simd version reads 4x4 block and transposes it
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1633 tmp10 = ( wsptr[2] + wsptr[3]);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1634 tmp11 = ( wsptr[2] - wsptr[3]);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1635
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1636 tmp13 = ( wsptr[0] + wsptr[1]);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1637 tmp12 = (MULTIPLY16H( wsptr[0] - wsptr[1], FIX_1_414213562_A)<<2) - tmp13;//this shift order to avoid overflow
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1638
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1639 tmp0 = tmp10 + tmp13; //->temps
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1640 tmp3 = tmp10 - tmp13; //->temps
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1641 tmp1 = tmp11 + tmp12;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1642 tmp2 = tmp11 - tmp12;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1643
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1644 // Odd part
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1645 //Also transpose, with previous:
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1646 // ---- ---- ||||
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1647 // ---- ---- idct ||||
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1648 // ---- ---- ---> ||||
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1649 // ---- ---- ||||
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1650 z13 = wsptr[4] + wsptr[5];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1651 z10 = wsptr[4] - wsptr[5];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1652 z11 = wsptr[6] + wsptr[7];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1653 z12 = wsptr[6] - wsptr[7];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1654
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1655 tmp7 = z11 + z13;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1656 tmp11 = MULTIPLY16H(z11 - z13, FIX_1_414213562);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1657
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1658 z5 = MULTIPLY16H(z10 + z12, FIX_1_847759065);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1659 tmp10 = MULTIPLY16H(z12, FIX_1_082392200) - z5;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1660 tmp12 = MULTIPLY16H(z10, FIX_2_613125930) + z5; // - FIX_
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1661
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1662 tmp6 = (tmp12<<3) - tmp7;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1663 tmp5 = (tmp11<<3) - tmp6;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1664 tmp4 = (tmp10<<3) + tmp5;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1665
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1666 // Final output stage: descale and write column
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1667 outptr[0*output_stride]+= DESCALE(tmp0 + tmp7, 3);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1668 outptr[1*output_stride]+= DESCALE(tmp1 + tmp6, 3);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1669 outptr[2*output_stride]+= DESCALE(tmp2 + tmp5, 3);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1670 outptr[3*output_stride]+= DESCALE(tmp3 - tmp4, 3);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1671 outptr[4*output_stride]+= DESCALE(tmp3 + tmp4, 3);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1672 outptr[5*output_stride]+= DESCALE(tmp2 - tmp5, 3);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1673 outptr[6*output_stride]+= DESCALE(tmp1 - tmp6, 3); //no += ?
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1674 outptr[7*output_stride]+= DESCALE(tmp0 - tmp7, 3); //no += ?
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1675 outptr++;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1676
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1677 wsptr += DCTSIZE; // advance pointer to next row
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1678 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1679 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1680
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1681 #else /* HAVE_MMX */
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1682
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1683 static void row_idct_mmx (DCTELEM* workspace,
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1684 int16_t* output_adr, int output_stride, int cnt)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1685 {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1686 asm volatile(
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1687 "lea (%%"REG_a",%%"REG_a",2), %%"REG_d" \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1688 "1: \n\t"
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1689 "movq "DCTSIZE_S"*0*2(%%"REG_S"), %%mm0 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1690 //
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1691
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1692 "movq "DCTSIZE_S"*1*2(%%"REG_S"), %%mm1 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1693 "movq %%mm0, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1694
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1695 "movq "DCTSIZE_S"*2*2(%%"REG_S"), %%mm2 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1696 "punpcklwd %%mm1, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1697
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1698 "movq "DCTSIZE_S"*3*2(%%"REG_S"), %%mm3 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1699 "punpckhwd %%mm1, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1700
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1701 //transpose 4x4
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1702 "movq %%mm2, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1703 "punpcklwd %%mm3, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1704
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1705 "movq %%mm0, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1706 "punpckldq %%mm2, %%mm0 \n\t" //0
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1707
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1708 "punpckhdq %%mm2, %%mm6 \n\t" //1
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1709 "movq %%mm0, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1710
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1711 "punpckhwd %%mm3, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1712 "psubw %%mm6, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1713
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1714 "pmulhw "MANGLE(MM_FIX_1_414213562_A)", %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1715 "movq %%mm4, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1716
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1717 "punpckldq %%mm7, %%mm4 \n\t" //2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1718 "paddw %%mm6, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1719
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1720 "punpckhdq %%mm7, %%mm2 \n\t" //3
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1721 "movq %%mm4, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1722
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1723 "psllw $2, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1724 "paddw %%mm2, %%mm4 \n\t" //t10
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1725
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1726 "movq "DCTSIZE_S"*0*2+"DCTSIZE_S"(%%"REG_S"), %%mm3 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1727 "psubw %%mm2, %%mm1 \n\t" //t11
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1728
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1729 "movq "DCTSIZE_S"*1*2+"DCTSIZE_S"(%%"REG_S"), %%mm2 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1730 "psubw %%mm5, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1731
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1732 "movq %%mm4, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1733 "paddw %%mm5, %%mm4 \n\t" //t0
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1734
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1735 "psubw %%mm5, %%mm6 \n\t" //t3
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1736 "movq %%mm1, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1737
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1738 "movq "DCTSIZE_S"*2*2+"DCTSIZE_S"(%%"REG_S"), %%mm5 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1739 "paddw %%mm0, %%mm1 \n\t" //t1
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1740
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1741 "movq %%mm4, "MANGLE(temps)"+0*8 \n\t" //t0
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1742 "movq %%mm3, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1743
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1744 "movq %%mm6, "MANGLE(temps)"+1*8 \n\t" //t3
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1745 "punpcklwd %%mm2, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1746
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1747 //transpose 4x4
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1748 "movq "DCTSIZE_S"*3*2+"DCTSIZE_S"(%%"REG_S"), %%mm6 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1749 "punpckhwd %%mm2, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1750
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1751 "movq %%mm5, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1752 "punpcklwd %%mm6, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1753
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1754 "psubw %%mm0, %%mm7 \n\t" //t2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1755 "punpckhwd %%mm6, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1756
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1757 "movq %%mm3, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1758 "punpckldq %%mm5, %%mm3 \n\t" //4
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1759
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1760 "punpckhdq %%mm5, %%mm0 \n\t" //5
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1761 "movq %%mm4, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1762
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1763 //
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1764 "movq %%mm3, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1765 "punpckldq %%mm2, %%mm4 \n\t" //6
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1766
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1767 "psubw %%mm0, %%mm3 \n\t" //z10
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1768 "punpckhdq %%mm2, %%mm5 \n\t" //7
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1769
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1770 "paddw %%mm0, %%mm6 \n\t" //z13
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1771 "movq %%mm4, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1772
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1773 "movq %%mm3, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1774 "psubw %%mm5, %%mm4 \n\t" //z12
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1775
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1776 "pmulhw "MANGLE(MM_FIX_2_613125930)", %%mm0 \n\t" //-
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1777 "paddw %%mm4, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1778
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1779 "pmulhw "MANGLE(MM_FIX_1_847759065)", %%mm3 \n\t" //z5
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1780 "paddw %%mm5, %%mm2 \n\t" //z11 >
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1781
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1782 "pmulhw "MANGLE(MM_FIX_1_082392200)", %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1783 "movq %%mm2, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1784
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1785 "psubw %%mm6, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1786 "paddw %%mm6, %%mm5 \n\t" //t7
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1787
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1788 "pmulhw "MANGLE(MM_FIX_1_414213562)", %%mm2 \n\t" //t11
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1789 "paddw %%mm3, %%mm0 \n\t" //t12
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1790
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1791 "psllw $3, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1792 "psubw %%mm3, %%mm4 \n\t" //t10
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1793
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1794 "movq "MANGLE(temps)"+0*8, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1795 "movq %%mm1, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1796
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1797 "psllw $3, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1798 "psubw %%mm5, %%mm0 \n\t" //t6
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1799
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1800 "psllw $3, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1801 "paddw %%mm0, %%mm1 \n\t" //d1
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1802
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1803 "psubw %%mm0, %%mm2 \n\t" //t5
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1804 "psubw %%mm0, %%mm3 \n\t" //d6
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1805
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1806 "paddw %%mm2, %%mm4 \n\t" //t4
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1807 "movq %%mm7, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1808
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1809 "paddw %%mm2, %%mm7 \n\t" //d2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1810 "psubw %%mm2, %%mm0 \n\t" //d5
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1811
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1812 "movq "MANGLE(MM_DESCALE_RND)", %%mm2 \n\t" //4
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1813 "psubw %%mm5, %%mm6 \n\t" //d7
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1814
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1815 "paddw "MANGLE(temps)"+0*8, %%mm5 \n\t" //d0
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1816 "paddw %%mm2, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1817
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1818 "paddw %%mm2, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1819 "psraw $3, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1820
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1821 "paddw %%mm2, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1822 "psraw $3, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1823
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1824 "paddw (%%"REG_D"), %%mm5 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1825 "psraw $3, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1826
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1827 "paddw (%%"REG_D",%%"REG_a",), %%mm1 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1828 "paddw %%mm2, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1829
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1830 "paddw (%%"REG_D",%%"REG_a",2), %%mm7 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1831 "paddw %%mm2, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1832
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1833 "movq %%mm5, (%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1834 "paddw %%mm2, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1835
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1836 "movq %%mm1, (%%"REG_D",%%"REG_a",) \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1837 "psraw $3, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1838
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1839 "movq %%mm7, (%%"REG_D",%%"REG_a",2) \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1840 "add %%"REG_d", %%"REG_D" \n\t" //3*ls
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1841
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1842 "movq "MANGLE(temps)"+1*8, %%mm5 \n\t" //t3
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1843 "psraw $3, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1844
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1845 "paddw (%%"REG_D",%%"REG_a",2), %%mm0 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1846 "psubw %%mm4, %%mm5 \n\t" //d3
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1847
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1848 "paddw (%%"REG_D",%%"REG_d",), %%mm3 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1849 "psraw $3, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1850
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1851 "paddw "MANGLE(temps)"+1*8, %%mm4 \n\t" //d4
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1852 "paddw %%mm2, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1853
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1854 "paddw (%%"REG_D",%%"REG_a",4), %%mm6 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1855 "paddw %%mm2, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1856
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1857 "movq %%mm0, (%%"REG_D",%%"REG_a",2) \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1858 "psraw $3, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1859
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1860 "paddw (%%"REG_D"), %%mm5 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1861 "psraw $3, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1862
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1863 "paddw (%%"REG_D",%%"REG_a",), %%mm4 \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1864 "add $"DCTSIZE_S"*2*4, %%"REG_S" \n\t" //4 rows
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1865
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1866 "movq %%mm3, (%%"REG_D",%%"REG_d",) \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1867 "movq %%mm6, (%%"REG_D",%%"REG_a",4) \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1868 "movq %%mm5, (%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1869 "movq %%mm4, (%%"REG_D",%%"REG_a",) \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1870
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1871 "sub %%"REG_d", %%"REG_D" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1872 "add $8, %%"REG_D" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1873 "dec %%"REG_c" \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1874 "jnz 1b \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1875
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1876 : "+S"(workspace), "+D"(output_adr), "+c"(cnt) //input regs
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1877 : "a"(output_stride*sizeof(short))
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1878 : "%"REG_d
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1879 );
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1880 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1881
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1882 #endif // HAVE_MMX
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1883
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1884 #ifndef HAVE_MMX
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1885
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1886 static void row_fdct_c(DCTELEM *data, const uint8_t *pixels, int line_size, int cnt)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1887 {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1888 int_simd16_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1889 int_simd16_t tmp10, tmp11, tmp12, tmp13;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1890 int_simd16_t z1, z2, z3, z4, z5, z11, z13;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1891 DCTELEM *dataptr;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1892
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1893 cnt*=4;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1894 // Pass 1: process rows.
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1895
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1896 dataptr = data;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1897 for (; cnt > 0; cnt--) {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1898 tmp0 = pixels[line_size*0] + pixels[line_size*7];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1899 tmp7 = pixels[line_size*0] - pixels[line_size*7];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1900 tmp1 = pixels[line_size*1] + pixels[line_size*6];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1901 tmp6 = pixels[line_size*1] - pixels[line_size*6];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1902 tmp2 = pixels[line_size*2] + pixels[line_size*5];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1903 tmp5 = pixels[line_size*2] - pixels[line_size*5];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1904 tmp3 = pixels[line_size*3] + pixels[line_size*4];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1905 tmp4 = pixels[line_size*3] - pixels[line_size*4];
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1906
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1907 // Even part
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1908
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1909 tmp10 = tmp0 + tmp3;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1910 tmp13 = tmp0 - tmp3;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1911 tmp11 = tmp1 + tmp2;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1912 tmp12 = tmp1 - tmp2;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1913 //Even columns are written first, this leads to different order of columns
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1914 //in column_fidct(), but they are processed independently, so all ok.
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1915 //Later in the row_idct() columns readed at the same order.
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1916 dataptr[2] = tmp10 + tmp11;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1917 dataptr[3] = tmp10 - tmp11;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1918
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1919 z1 = MULTIPLY16H((tmp12 + tmp13)<<2, FIX_0_707106781);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1920 dataptr[0] = tmp13 + z1;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1921 dataptr[1] = tmp13 - z1;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1922
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1923 // Odd part
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1924
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1925 tmp10 = (tmp4 + tmp5) <<2;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1926 tmp11 = (tmp5 + tmp6) <<2;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1927 tmp12 = (tmp6 + tmp7) <<2;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1928
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1929 z5 = MULTIPLY16H(tmp10 - tmp12, FIX_0_382683433);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1930 z2 = MULTIPLY16H(tmp10, FIX_0_541196100) + z5;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1931 z4 = MULTIPLY16H(tmp12, FIX_1_306562965) + z5;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1932 z3 = MULTIPLY16H(tmp11, FIX_0_707106781);
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1933
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1934 z11 = tmp7 + z3;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1935 z13 = tmp7 - z3;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1936
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1937 dataptr[4] = z13 + z2;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1938 dataptr[5] = z13 - z2;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1939 dataptr[6] = z11 + z4;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1940 dataptr[7] = z11 - z4;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1941
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1942 pixels++; // advance pointer to next column
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1943 dataptr += DCTSIZE;
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1944 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1945 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1946
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1947 #else /* HAVE_MMX */
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1948
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1949 static void row_fdct_mmx(DCTELEM *data, const uint8_t *pixels, int line_size, int cnt)
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1950 {
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1951 asm volatile(
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1952 "lea (%%"REG_a",%%"REG_a",2), %%"REG_d" \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1953 "6: \n\t"
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1954 "movd (%%"REG_S"), %%mm0 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1955 "pxor %%mm7, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1956
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1957 "movd (%%"REG_S",%%"REG_a",), %%mm1 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1958 "punpcklbw %%mm7, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1959
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1960 "movd (%%"REG_S",%%"REG_a",2), %%mm2 \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1961 "punpcklbw %%mm7, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1962
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1963 "punpcklbw %%mm7, %%mm2 \n\t"
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1964 "add %%"REG_d", %%"REG_S" \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1965
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1966 "movq %%mm0, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1967 //
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1968
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1969 "movd (%%"REG_S",%%"REG_a",4), %%mm3 \n\t" //7 ;prefetch!
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1970 "movq %%mm1, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1971
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1972 "movd (%%"REG_S",%%"REG_d",), %%mm4 \n\t" //6
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1973 "punpcklbw %%mm7, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1974
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1975 "psubw %%mm3, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1976 "punpcklbw %%mm7, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1977
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1978 "paddw %%mm3, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1979 "psubw %%mm4, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1980
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1981 "movd (%%"REG_S",%%"REG_a",2), %%mm3 \n\t" //5
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1982 "paddw %%mm4, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1983
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1984 "movq %%mm5, "MANGLE(temps)"+0*8 \n\t" //t7
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1985 "punpcklbw %%mm7, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1986
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1987 "movq %%mm6, "MANGLE(temps)"+1*8 \n\t" //t6
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1988 "movq %%mm2, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1989
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1990 "movd (%%"REG_S"), %%mm5 \n\t" //3
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1991 "paddw %%mm3, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1992
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
1993 "movd (%%"REG_S",%%"REG_a",), %%mm6 \n\t" //4
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1994 "punpcklbw %%mm7, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1995
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1996 "psubw %%mm3, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1997 "punpcklbw %%mm7, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1998
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
1999 "movq %%mm5, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2000 "paddw %%mm6, %%mm5 \n\t" //t3
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2001
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2002 "psubw %%mm6, %%mm3 \n\t" //t4 ; t0 t1 t2 t4 t5 t3 - -
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2003 "movq %%mm0, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2004
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2005 "movq %%mm1, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2006 "psubw %%mm5, %%mm0 \n\t" //t13
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2007
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2008 "psubw %%mm2, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2009 "paddw %%mm2, %%mm7 \n\t" //t11
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2010
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2011 "paddw %%mm0, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2012 "movq %%mm7, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2013
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2014 "psllw $2, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2015 "paddw %%mm5, %%mm6 \n\t" //t10
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2016
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2017 "pmulhw "MANGLE(MM_FIX_0_707106781)", %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2018 "paddw %%mm6, %%mm7 \n\t" //d2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2019
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2020 "psubw %%mm2, %%mm6 \n\t" //d3
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2021 "movq %%mm0, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2022
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2023 //transpose 4x4
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2024 "movq %%mm7, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2025 "punpcklwd %%mm6, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2026
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2027 "paddw %%mm1, %%mm0 \n\t" //d0
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2028 "punpckhwd %%mm6, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2029
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2030 "psubw %%mm1, %%mm5 \n\t" //d1
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2031 "movq %%mm0, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2032
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2033 "movq "MANGLE(temps)"+1*8, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2034 "punpcklwd %%mm5, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2035
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2036 "punpckhwd %%mm5, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2037 "movq %%mm0, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2038
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2039 "punpckldq %%mm7, %%mm0 \n\t" //0
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2040 "paddw %%mm4, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2041
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2042 "punpckhdq %%mm7, %%mm5 \n\t" //1
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2043 "movq %%mm6, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2044
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
2045 "movq %%mm0, "DCTSIZE_S"*0*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2046 "punpckldq %%mm2, %%mm6 \n\t" //2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2047
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
2048 "movq %%mm5, "DCTSIZE_S"*1*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2049 "punpckhdq %%mm2, %%mm7 \n\t" //3
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2050
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
2051 "movq %%mm6, "DCTSIZE_S"*2*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2052 "paddw %%mm1, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2053
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
2054 "movq %%mm7, "DCTSIZE_S"*3*2(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2055 "psllw $2, %%mm3 \n\t" //t10
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2056
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2057 "movq "MANGLE(temps)"+0*8, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2058 "psllw $2, %%mm4 \n\t" //t11
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2059
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2060 "pmulhw "MANGLE(MM_FIX_0_707106781)", %%mm4 \n\t" //z3
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2061 "paddw %%mm2, %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2062
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2063 "psllw $2, %%mm1 \n\t" //t12
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2064 "movq %%mm3, %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2065
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2066 "pmulhw "MANGLE(MM_FIX_0_541196100)", %%mm0 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2067 "psubw %%mm1, %%mm3 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2068
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2069 "pmulhw "MANGLE(MM_FIX_0_382683433)", %%mm3 \n\t" //z5
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2070 "movq %%mm2, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2071
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2072 "pmulhw "MANGLE(MM_FIX_1_306562965)", %%mm1 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2073 "psubw %%mm4, %%mm2 \n\t" //z13
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2074
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2075 "paddw %%mm4, %%mm5 \n\t" //z11
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2076 "movq %%mm2, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2077
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2078 "paddw %%mm3, %%mm0 \n\t" //z2
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2079 "movq %%mm5, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2080
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2081 "paddw %%mm0, %%mm2 \n\t" //d4
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2082 "psubw %%mm0, %%mm6 \n\t" //d5
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2083
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2084 "movq %%mm2, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2085 "paddw %%mm3, %%mm1 \n\t" //z4
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2086
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2087 //transpose 4x4
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2088 "punpcklwd %%mm6, %%mm2 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2089 "paddw %%mm1, %%mm5 \n\t" //d6
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2090
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2091 "punpckhwd %%mm6, %%mm4 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2092 "psubw %%mm1, %%mm7 \n\t" //d7
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2093
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2094 "movq %%mm5, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2095 "punpcklwd %%mm7, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2096
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2097 "punpckhwd %%mm7, %%mm6 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2098 "movq %%mm2, %%mm7 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2099
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2100 "punpckldq %%mm5, %%mm2 \n\t" //4
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
2101 "sub %%"REG_d", %%"REG_S" \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2102
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2103 "punpckhdq %%mm5, %%mm7 \n\t" //5
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2104 "movq %%mm4, %%mm5 \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2105
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
2106 "movq %%mm2, "DCTSIZE_S"*0*2+"DCTSIZE_S"(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2107 "punpckldq %%mm6, %%mm4 \n\t" //6
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2108
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
2109 "movq %%mm7, "DCTSIZE_S"*1*2+"DCTSIZE_S"(%%"REG_D") \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2110 "punpckhdq %%mm6, %%mm5 \n\t" //7
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2111
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
2112 "movq %%mm4, "DCTSIZE_S"*2*2+"DCTSIZE_S"(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
2113 "add $4, %%"REG_S" \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
2114
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
2115 "movq %%mm5, "DCTSIZE_S"*3*2+"DCTSIZE_S"(%%"REG_D") \n\t"
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
2116 "add $"DCTSIZE_S"*2*4, %%"REG_D" \n\t" //4 rows
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
2117 "dec %%"REG_c" \n\t"
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2118 "jnz 6b \n\t"
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2119
15632
e813a3e431a8 move unchanged registers back to input spec
henry
parents: 15631
diff changeset
2120 : "+S"(pixels), "+D"(data), "+c"(cnt) //input regs
e813a3e431a8 move unchanged registers back to input spec
henry
parents: 15631
diff changeset
2121 : "a"(line_size)
15634
7eddcf69a5fd x86-64 fixes by Reimar
henry
parents: 15633
diff changeset
2122 : "%"REG_d);
15631
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2123 }
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2124
d5a95e6f5f07 faster spp filter by Nikolaj Poroshin <porosh3 at psu ru>
henry
parents:
diff changeset
2125 #endif // HAVE_MMX