annotate libmpcodecs/native/rtjpegn.c @ 30408:9e0db8b6957b

glXSwapIntervalEXT is defined to take different arguments from glXSwapIntervalSGI, so do not try to use it. Patch by Stephen Warren [swarren nvidia com]
author reimar
date Thu, 28 Jan 2010 18:01:19 +0000
parents 0f1b5b68af32
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1 /*
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2 RTjpeg (C) Justin Schoeman 1998 (justin@suntiger.ee.up.ac.za)
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
3
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
4 With modifications by:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
5 (c) 1998, 1999 by Joerg Walter <trouble@moes.pmnet.uni-oldenburg.de>
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
6 and
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
7 (c) 1999 by Wim Taymans <wim.taymans@tvd.be>
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
8
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
9 This program is free software; you can redistribute it and/or modify
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
10 it under the terms of the GNU General Public License as published by
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
11 the Free Software Foundation; either version 2 of the License, or
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
12 (at your option) any later version.
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
14 This program is distributed in the hope that it will be useful,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
17 GNU General Public License for more details.
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
18
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
19 You should have received a copy of the GNU General Public License
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
20 along with this program; if not, write to the Free Software
21977
cea0eb833758 Fix FSF address and otherwise broken license headers.
diego
parents: 21507
diff changeset
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
22 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
23
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
24 #include <stdio.h>
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
25 #include <stdlib.h>
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
26 #include <string.h>
3805
07d5beff8793 enabling mmx support if capable
alex
parents: 3802
diff changeset
27
07d5beff8793 enabling mmx support if capable
alex
parents: 3802
diff changeset
28 #include "config.h"
07d5beff8793 enabling mmx support if capable
alex
parents: 3802
diff changeset
29
21507
fa99b3d31d13 Hack around libavutil/bswap.h compilation problems due to always_inline undefined.
reimar
parents: 21372
diff changeset
30 #include "mpbswap.h"
26304
5f526e8e3988 Rename RTJPEG files so that filenames consist of lowercase name only.
diego
parents: 26280
diff changeset
31 #include "rtjpegn.h"
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
32
28298
a7124a264ea6 Completely get rid of MMX define, use HAVE_MMX define instead.
gpoirier
parents: 28296
diff changeset
33 #if HAVE_MMX
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
34 #include "mmx.h"
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
35 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
36
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
37 //#define SHOWBLOCK 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
38 #define BETTERCOMPRESSION 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
39
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
40 static const unsigned char RTjpeg_ZZ[64]={
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
41 0,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
42 8, 1,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
43 2, 9, 16,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
44 24, 17, 10, 3,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
45 4, 11, 18, 25, 32,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
46 40, 33, 26, 19, 12, 5,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
47 6, 13, 20, 27, 34, 41, 48,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
48 56, 49, 42, 35, 28, 21, 14, 7,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
49 15, 22, 29, 36, 43, 50, 57,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
50 58, 51, 44, 37, 30, 23,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
51 31, 38, 45, 52, 59,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
52 60, 53, 46, 39,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
53 47, 54, 61,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
54 62, 55,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
55 63 };
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
56
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
57 static const __u64 RTjpeg_aan_tab[64]={
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
58 4294967296ULL, 5957222912ULL, 5611718144ULL, 5050464768ULL, 4294967296ULL, 3374581504ULL, 2324432128ULL, 1184891264ULL,
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
59 5957222912ULL, 8263040512ULL, 7783580160ULL, 7005009920ULL, 5957222912ULL, 4680582144ULL, 3224107520ULL, 1643641088ULL,
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
60 5611718144ULL, 7783580160ULL, 7331904512ULL, 6598688768ULL, 5611718144ULL, 4408998912ULL, 3036936960ULL, 1548224000ULL,
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
61 5050464768ULL, 7005009920ULL, 6598688768ULL, 5938608128ULL, 5050464768ULL, 3968072960ULL, 2733115392ULL, 1393296000ULL,
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
62 4294967296ULL, 5957222912ULL, 5611718144ULL, 5050464768ULL, 4294967296ULL, 3374581504ULL, 2324432128ULL, 1184891264ULL,
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
63 3374581504ULL, 4680582144ULL, 4408998912ULL, 3968072960ULL, 3374581504ULL, 2651326208ULL, 1826357504ULL, 931136000ULL,
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
64 2324432128ULL, 3224107520ULL, 3036936960ULL, 2733115392ULL, 2324432128ULL, 1826357504ULL, 1258030336ULL, 641204288ULL,
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
65 1184891264ULL, 1643641088ULL, 1548224000ULL, 1393296000ULL, 1184891264ULL, 931136000ULL, 641204288ULL, 326894240ULL,
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
66 };
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
67
28298
a7124a264ea6 Completely get rid of MMX define, use HAVE_MMX define instead.
gpoirier
parents: 28296
diff changeset
68 #if !HAVE_MMX
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
69 static __s32 RTjpeg_ws[64+31];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
70 #endif
28849
87b59e8d3c26 Mark everything not used outside the file as "static"
reimar
parents: 28298
diff changeset
71 static __u8 RTjpeg_alldata[2*64+4*64+4*64+4*64+4*64+32];
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
72
3835
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
73 static __s16 *block; // rh
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
74 static __s16 *RTjpeg_block;
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
75 static __s32 *RTjpeg_lqt;
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
76 static __s32 *RTjpeg_cqt;
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
77 static __u32 *RTjpeg_liqt;
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
78 static __u32 *RTjpeg_ciqt;
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
79
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
80 static unsigned char RTjpeg_lb8;
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
81 static unsigned char RTjpeg_cb8;
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
82 static int RTjpeg_width, RTjpeg_height;
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
83 static int RTjpeg_Ywidth, RTjpeg_Cwidth;
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
84 static int RTjpeg_Ysize, RTjpeg_Csize;
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
85
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
86 static __s16 *RTjpeg_old=NULL;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
87
28298
a7124a264ea6 Completely get rid of MMX define, use HAVE_MMX define instead.
gpoirier
parents: 28296
diff changeset
88 #if HAVE_MMX
28849
87b59e8d3c26 Mark everything not used outside the file as "static"
reimar
parents: 28298
diff changeset
89 static mmx_t RTjpeg_lmask;
87b59e8d3c26 Mark everything not used outside the file as "static"
reimar
parents: 28298
diff changeset
90 static mmx_t RTjpeg_cmask;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
91 #else
28849
87b59e8d3c26 Mark everything not used outside the file as "static"
reimar
parents: 28298
diff changeset
92 static __u16 RTjpeg_lmask;
87b59e8d3c26 Mark everything not used outside the file as "static"
reimar
parents: 28298
diff changeset
93 static __u16 RTjpeg_cmask;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
94 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
95
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
96 static const unsigned char RTjpeg_lum_quant_tbl[64] = {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
97 16, 11, 10, 16, 24, 40, 51, 61,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
98 12, 12, 14, 19, 26, 58, 60, 55,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
99 14, 13, 16, 24, 40, 57, 69, 56,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
100 14, 17, 22, 29, 51, 87, 80, 62,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
101 18, 22, 37, 56, 68, 109, 103, 77,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
102 24, 35, 55, 64, 81, 104, 113, 92,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
103 49, 64, 78, 87, 103, 121, 120, 101,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
104 72, 92, 95, 98, 112, 100, 103, 99
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
105 };
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
106
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
107 static const unsigned char RTjpeg_chrom_quant_tbl[64] = {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
108 17, 18, 24, 47, 99, 99, 99, 99,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
109 18, 21, 26, 66, 99, 99, 99, 99,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
110 24, 26, 56, 99, 99, 99, 99, 99,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
111 47, 66, 99, 99, 99, 99, 99, 99,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
112 99, 99, 99, 99, 99, 99, 99, 99,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
113 99, 99, 99, 99, 99, 99, 99, 99,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
114 99, 99, 99, 99, 99, 99, 99, 99,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
115 99, 99, 99, 99, 99, 99, 99, 99
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
116 };
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
117
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
118 #ifdef BETTERCOMPRESSION
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
119
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
120 /*--------------------------------------------------*/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
121 /* better encoding, but needs a lot more cpu time */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
122 /* seems to be more effective than old method +lzo */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
123 /* with this encoding lzo isn't efficient anymore */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
124 /* there is still more potential for better */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
125 /* encoding but that would need even more cputime */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
126 /* anyway your mileage may vary */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
127 /* */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
128 /* written by Martin BIELY and Roman HOCHLEITNER */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
129 /*--------------------------------------------------*/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
130
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
131 /* +++++++++++++++++++++++++++++++++++++++++++++++++++*/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
132 /* Block to Stream (encoding) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
133 /* */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
134
28849
87b59e8d3c26 Mark everything not used outside the file as "static"
reimar
parents: 28298
diff changeset
135 static int RTjpeg_b2s(__s16 *data, __s8 *strm, __u8 bt8)
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
136 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
137 register int ci, co=1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
138 register __s16 ZZvalue;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
139 register unsigned char bitten;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
140 register unsigned char bitoff;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
141
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
142 #ifdef SHOWBLOCK
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
143
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
144 int ii;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
145 for (ii=0; ii < 64; ii++) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
146 fprintf(stdout, "%d ", data[RTjpeg_ZZ[ii]]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
147 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
148 fprintf(stdout, "\n\n");
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
149
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
150 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
151
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
152 // first byte allways written
12378
649f596054e0 more lvalue casts, ugly this time
rfelker
parents: 9763
diff changeset
153 ((__u8*)strm)[0]=
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
154 (__u8)(data[RTjpeg_ZZ[0]]>254) ? 254:((data[RTjpeg_ZZ[0]]<0)?0:data[RTjpeg_ZZ[0]]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
155
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
156
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
157 ci=63;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
158 while (data[RTjpeg_ZZ[ci]]==0 && ci>0) ci--;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
159
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
160 bitten = ((unsigned char)ci) << 2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
161
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
162 if (ci==0) {
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
163 ((__u8*)strm)[1]= bitten;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
164 co = 2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
165 return (int)co;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
166 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
167
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
168 /* bitoff=0 because the high 6bit contain first non zero position */
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
169 bitoff = 0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
170 co = 1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
171
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
172 for(; ci>0; ci--) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
173
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
174 ZZvalue = data[RTjpeg_ZZ[ci]];
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
175
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
176 switch(ZZvalue) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
177 case 0:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
178 break;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
179 case 1:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
180 bitten |= (0x01<<bitoff);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
181 break;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
182 case -1:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
183 bitten |= (0x03<<bitoff);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
184 break;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
185 default:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
186 bitten |= (0x02<<bitoff);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
187 goto HERZWEH;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
188 break;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
189 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
190
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
191 if( bitoff == 0 ) {
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
192 ((__u8*)strm)[co]= bitten;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
193 bitten = 0;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
194 bitoff = 8;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
195 co++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
196 } /* "fall through" */
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
197 bitoff-=2;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
198
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
199 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
200
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
201 /* ci must be 0 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
202 if(bitoff != 6) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
203
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
204 ((__u8*)strm)[co]= bitten;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
205 co++;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
206
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
207 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
208 goto BAUCHWEH;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
209
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
210 HERZWEH:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
211 /* ci cannot be 0 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
212 /* correct bitoff to nibble boundaries */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
213
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
214 switch(bitoff){
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
215 case 4:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
216 case 6:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
217 bitoff = 0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
218 break;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
219 case 2:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
220 case 0:
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
221 ((__u8*)strm)[co]= bitten;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
222 bitoff = 4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
223 co++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
224 bitten = 0; // clear half nibble values in bitten
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
225 break;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
226 default:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
227 break;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
228 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
229
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
230 for(; ci>0; ci--) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
231
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
232 ZZvalue = data[RTjpeg_ZZ[ci]];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
233
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
234 if( (ZZvalue > 7) || (ZZvalue < -7) ) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
235 bitten |= (0x08<<bitoff);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
236 goto HIRNWEH;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
237 }
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
238
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
239 bitten |= (ZZvalue&0xf)<<bitoff;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
240
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
241 if( bitoff == 0 ) {
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
242 ((__u8*)strm)[co]= bitten;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
243 bitten = 0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
244 bitoff = 8;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
245 co++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
246 } /* "fall thru" */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
247 bitoff-=4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
248 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
249
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
250 /* ci must be 0 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
251 if( bitoff == 0 ) {
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
252 ((__u8*)strm)[co]= bitten;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
253 co++;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
254 }
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
255 goto BAUCHWEH;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
256
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
257 HIRNWEH:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
258
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
259 ((__u8*)strm)[co]= bitten;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
260 co++;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
261
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
262
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
263 /* bitting is over now we bite */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
264 for(; ci>0; ci--) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
265
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
266 ZZvalue = data[RTjpeg_ZZ[ci]];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
267
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
268 if(ZZvalue>0)
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
269 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
270 strm[co++]=(__s8)(ZZvalue>127)?127:ZZvalue;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
271 }
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
272 else
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
273 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
274 strm[co++]=(__s8)(ZZvalue<-128)?-128:ZZvalue;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
275 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
276
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
277 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
278
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
279
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
280 BAUCHWEH:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
281 /* we gotoo much now we are ill */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
282 #ifdef SHOWBLOCK
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
283 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
284 int i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
285 fprintf(stdout, "\nco = '%d'\n", co);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
286 for (i=0; i < co+2; i++) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
287 fprintf(stdout, "%d ", strm[i]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
288 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
289 fprintf(stdout, "\n\n");
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
290 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
291 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
292
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
293 return (int)co;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
294 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
295
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
296 #else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
297
28849
87b59e8d3c26 Mark everything not used outside the file as "static"
reimar
parents: 28298
diff changeset
298 static int RTjpeg_b2s(__s16 *data, __s8 *strm, __u8 bt8)
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
299 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
300 register int ci, co=1, tmp;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
301 register __s16 ZZvalue;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
302
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
303 #ifdef SHOWBLOCK
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
304
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
305 int ii;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
306 for (ii=0; ii < 64; ii++) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
307 fprintf(stdout, "%d ", data[RTjpeg_ZZ[ii]]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
308 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
309 fprintf(stdout, "\n\n");
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
310
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
311 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
312
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
313 (__u8)strm[0]=(__u8)(data[RTjpeg_ZZ[0]]>254) ? 254:((data[RTjpeg_ZZ[0]]<0)?0:data[RTjpeg_ZZ[0]]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
314
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
315 for(ci=1; ci<=bt8; ci++)
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
316 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
317 ZZvalue = data[RTjpeg_ZZ[ci]];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
318
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
319 if(ZZvalue>0)
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
320 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
321 strm[co++]=(__s8)(ZZvalue>127)?127:ZZvalue;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
322 }
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
323 else
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
324 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
325 strm[co++]=(__s8)(ZZvalue<-128)?-128:ZZvalue;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
326 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
327 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
328
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
329 for(; ci<64; ci++)
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
330 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
331 ZZvalue = data[RTjpeg_ZZ[ci]];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
332
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
333 if(ZZvalue>0)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
334 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
335 strm[co++]=(__s8)(ZZvalue>63)?63:ZZvalue;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
336 }
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
337 else if(ZZvalue<0)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
338 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
339 strm[co++]=(__s8)(ZZvalue<-64)?-64:ZZvalue;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
340 }
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
341 else /* compress zeros */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
342 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
343 tmp=ci;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
344 do
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
345 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
346 ci++;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
347 }
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
348 while((ci<64)&&(data[RTjpeg_ZZ[ci]]==0));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
349
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
350 strm[co++]=(__s8)(63+(ci-tmp));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
351 ci--;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
352 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
353 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
354 return (int)co;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
355 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
356
28849
87b59e8d3c26 Mark everything not used outside the file as "static"
reimar
parents: 28298
diff changeset
357 static int RTjpeg_s2b(__s16 *data, __s8 *strm, __u8 bt8, __u32 *qtbl)
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
358 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
359 int ci=1, co=1, tmp;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
360 register int i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
361
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
362 i=RTjpeg_ZZ[0];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
363 data[i]=((__u8)strm[0])*qtbl[i];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
364
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
365 for(co=1; co<=bt8; co++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
366 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
367 i=RTjpeg_ZZ[co];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
368 data[i]=strm[ci++]*qtbl[i];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
369 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
370
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
371 for(; co<64; co++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
372 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
373 if(strm[ci]>63)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
374 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
375 tmp=co+strm[ci]-63;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
376 for(; co<tmp; co++)data[RTjpeg_ZZ[co]]=0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
377 co--;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
378 } else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
379 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
380 i=RTjpeg_ZZ[co];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
381 data[i]=strm[ci]*qtbl[i];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
382 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
383 ci++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
384 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
385 return (int)ci;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
386 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
387 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
388
28298
a7124a264ea6 Completely get rid of MMX define, use HAVE_MMX define instead.
gpoirier
parents: 28296
diff changeset
389 #if HAVE_MMX
28849
87b59e8d3c26 Mark everything not used outside the file as "static"
reimar
parents: 28298
diff changeset
390 static void RTjpeg_quant_init(void)
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
391 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
392 int i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
393 __s16 *qtbl;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
394
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
395 qtbl=(__s16 *)RTjpeg_lqt;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
396 for(i=0; i<64; i++)qtbl[i]=(__s16)RTjpeg_lqt[i];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
397
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
398 qtbl=(__s16 *)RTjpeg_cqt;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
399 for(i=0; i<64; i++)qtbl[i]=(__s16)RTjpeg_cqt[i];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
400 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
401
12928
bc760f3f129e ICC 8.0 compilation fixes
atmos4
parents: 12378
diff changeset
402 static mmx_t RTjpeg_ones={0x0001000100010001LL};
bc760f3f129e ICC 8.0 compilation fixes
atmos4
parents: 12378
diff changeset
403 static mmx_t RTjpeg_half={0x7fff7fff7fff7fffLL};
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
404
28849
87b59e8d3c26 Mark everything not used outside the file as "static"
reimar
parents: 28298
diff changeset
405 static void RTjpeg_quant(__s16 *block, __s32 *qtbl)
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
406 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
407 int i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
408 mmx_t *bl, *ql;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
409
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
410 ql=(mmx_t *)qtbl;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
411 bl=(mmx_t *)block;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
412
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
413 movq_m2r(RTjpeg_ones, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
414 movq_m2r(RTjpeg_half, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
415
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
416 for(i=16; i; i--)
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
417 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
418 movq_m2r(*(ql++), mm0); /* quant vals (4) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
419 movq_m2r(*bl, mm2); /* block vals (4) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
420 movq_r2r(mm0, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
421 movq_r2r(mm2, mm3);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
422
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
423 punpcklwd_r2r(mm6, mm0); /* 1 qb 1 qa */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
424 punpckhwd_r2r(mm6, mm1); /* 1 qd 1 qc */
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
425
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
426 punpcklwd_r2r(mm7, mm2); /* 32767 bb 32767 ba */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
427 punpckhwd_r2r(mm7, mm3); /* 32767 bd 32767 bc */
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
428
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
429 pmaddwd_r2r(mm2, mm0); /* 32767+bb*qb 32767+ba*qa */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
430 pmaddwd_r2r(mm3, mm1); /* 32767+bd*qd 32767+bc*qc */
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
431
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
432 psrad_i2r(16, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
433 psrad_i2r(16, mm1);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
434
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
435 packssdw_r2r(mm1, mm0);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
436
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
437 movq_r2m(mm0, *(bl++));
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
438
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
439 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
440 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
441 #else
28849
87b59e8d3c26 Mark everything not used outside the file as "static"
reimar
parents: 28298
diff changeset
442 static void RTjpeg_quant_init(void)
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
443 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
444 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
445
28849
87b59e8d3c26 Mark everything not used outside the file as "static"
reimar
parents: 28298
diff changeset
446 static void RTjpeg_quant(__s16 *block, __s32 *qtbl)
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
447 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
448 int i;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
449
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
450 for(i=0; i<64; i++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
451 block[i]=(__s16)((block[i]*qtbl[i]+32767)>>16);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
452 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
453 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
454
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
455 /*
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
456 * Perform the forward DCT on one block of samples.
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
457 */
28298
a7124a264ea6 Completely get rid of MMX define, use HAVE_MMX define instead.
gpoirier
parents: 28296
diff changeset
458 #if HAVE_MMX
12928
bc760f3f129e ICC 8.0 compilation fixes
atmos4
parents: 12378
diff changeset
459 static mmx_t RTjpeg_C4 ={0x2D412D412D412D41LL};
bc760f3f129e ICC 8.0 compilation fixes
atmos4
parents: 12378
diff changeset
460 static mmx_t RTjpeg_C6 ={0x187E187E187E187ELL};
bc760f3f129e ICC 8.0 compilation fixes
atmos4
parents: 12378
diff changeset
461 static mmx_t RTjpeg_C2mC6={0x22A322A322A322A3LL};
bc760f3f129e ICC 8.0 compilation fixes
atmos4
parents: 12378
diff changeset
462 static mmx_t RTjpeg_C2pC6={0x539F539F539F539FLL};
bc760f3f129e ICC 8.0 compilation fixes
atmos4
parents: 12378
diff changeset
463 static mmx_t RTjpeg_zero ={0x0000000000000000LL};
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
464
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
465 #else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
466
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
467 #define FIX_0_382683433 ((__s32) 98) /* FIX(0.382683433) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
468 #define FIX_0_541196100 ((__s32) 139) /* FIX(0.541196100) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
469 #define FIX_0_707106781 ((__s32) 181) /* FIX(0.707106781) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
470 #define FIX_1_306562965 ((__s32) 334) /* FIX(1.306562965) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
471
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
472 #define DESCALE10(x) (__s16)( ((x)+128) >> 8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
473 #define DESCALE20(x) (__s16)(((x)+32768) >> 16)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
474 #define D_MULTIPLY(var,const) ((__s32) ((var) * (const)))
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
475 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
476
28849
87b59e8d3c26 Mark everything not used outside the file as "static"
reimar
parents: 28298
diff changeset
477 static void RTjpeg_dct_init(void)
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
478 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
479 int i;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
480
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
481 for(i=0; i<64; i++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
482 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
483 RTjpeg_lqt[i]=(((__u64)RTjpeg_lqt[i]<<32)/RTjpeg_aan_tab[i]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
484 RTjpeg_cqt[i]=(((__u64)RTjpeg_cqt[i]<<32)/RTjpeg_aan_tab[i]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
485 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
486 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
487
28849
87b59e8d3c26 Mark everything not used outside the file as "static"
reimar
parents: 28298
diff changeset
488 static void RTjpeg_dctY(__u8 *idata, __s16 *odata, int rskip)
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
489 {
28298
a7124a264ea6 Completely get rid of MMX define, use HAVE_MMX define instead.
gpoirier
parents: 28296
diff changeset
490 #if !HAVE_MMX
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
491 __s32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
492 __s32 tmp10, tmp11, tmp12, tmp13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
493 __s32 z1, z2, z3, z4, z5, z11, z13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
494 __u8 *idataptr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
495 __s16 *odataptr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
496 __s32 *wsptr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
497 int ctr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
498
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
499 idataptr = idata;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
500 wsptr = RTjpeg_ws;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
501 for (ctr = 7; ctr >= 0; ctr--) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
502 tmp0 = idataptr[0] + idataptr[7];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
503 tmp7 = idataptr[0] - idataptr[7];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
504 tmp1 = idataptr[1] + idataptr[6];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
505 tmp6 = idataptr[1] - idataptr[6];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
506 tmp2 = idataptr[2] + idataptr[5];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
507 tmp5 = idataptr[2] - idataptr[5];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
508 tmp3 = idataptr[3] + idataptr[4];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
509 tmp4 = idataptr[3] - idataptr[4];
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
510
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
511 tmp10 = (tmp0 + tmp3); /* phase 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
512 tmp13 = tmp0 - tmp3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
513 tmp11 = (tmp1 + tmp2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
514 tmp12 = tmp1 - tmp2;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
515
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
516 wsptr[0] = (tmp10 + tmp11)<<8; /* phase 3 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
517 wsptr[4] = (tmp10 - tmp11)<<8;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
518
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
519 z1 = D_MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
520 wsptr[2] = (tmp13<<8) + z1; /* phase 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
521 wsptr[6] = (tmp13<<8) - z1;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
522
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
523 tmp10 = tmp4 + tmp5; /* phase 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
524 tmp11 = tmp5 + tmp6;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
525 tmp12 = tmp6 + tmp7;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
526
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
527 z5 = D_MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
528 z2 = D_MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
529 z4 = D_MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
530 z3 = D_MULTIPLY(tmp11, FIX_0_707106781); /* c4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
531
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
532 z11 = (tmp7<<8) + z3; /* phase 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
533 z13 = (tmp7<<8) - z3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
534
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
535 wsptr[5] = z13 + z2; /* phase 6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
536 wsptr[3] = z13 - z2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
537 wsptr[1] = z11 + z4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
538 wsptr[7] = z11 - z4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
539
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
540 idataptr += rskip<<3; /* advance pointer to next row */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
541 wsptr += 8;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
542 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
543
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
544 wsptr = RTjpeg_ws;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
545 odataptr=odata;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
546 for (ctr = 7; ctr >= 0; ctr--) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
547 tmp0 = wsptr[0] + wsptr[56];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
548 tmp7 = wsptr[0] - wsptr[56];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
549 tmp1 = wsptr[8] + wsptr[48];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
550 tmp6 = wsptr[8] - wsptr[48];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
551 tmp2 = wsptr[16] + wsptr[40];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
552 tmp5 = wsptr[16] - wsptr[40];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
553 tmp3 = wsptr[24] + wsptr[32];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
554 tmp4 = wsptr[24] - wsptr[32];
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
555
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
556 tmp10 = tmp0 + tmp3; /* phase 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
557 tmp13 = tmp0 - tmp3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
558 tmp11 = tmp1 + tmp2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
559 tmp12 = tmp1 - tmp2;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
560
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
561 odataptr[0] = DESCALE10(tmp10 + tmp11); /* phase 3 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
562 odataptr[32] = DESCALE10(tmp10 - tmp11);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
563
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
564 z1 = D_MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
565 odataptr[16] = DESCALE20((tmp13<<8) + z1); /* phase 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
566 odataptr[48] = DESCALE20((tmp13<<8) - z1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
567
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
568 tmp10 = tmp4 + tmp5; /* phase 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
569 tmp11 = tmp5 + tmp6;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
570 tmp12 = tmp6 + tmp7;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
571
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
572 z5 = D_MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
573 z2 = D_MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
574 z4 = D_MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
575 z3 = D_MULTIPLY(tmp11, FIX_0_707106781); /* c4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
576
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
577 z11 = (tmp7<<8) + z3; /* phase 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
578 z13 = (tmp7<<8) - z3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
579
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
580 odataptr[40] = DESCALE20(z13 + z2); /* phase 6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
581 odataptr[24] = DESCALE20(z13 - z2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
582 odataptr[8] = DESCALE20(z11 + z4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
583 odataptr[56] = DESCALE20(z11 - z4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
584
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
585 odataptr++; /* advance pointer to next column */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
586 wsptr++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
587 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
588 #else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
589 volatile mmx_t tmp6, tmp7;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
590 register mmx_t *dataptr = (mmx_t *)odata;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
591 mmx_t *idata2 = (mmx_t *)idata;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
592
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
593 // first copy the input 8 bit to the destination 16 bits
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
594
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
595 movq_m2r(RTjpeg_zero, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
596
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
597
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
598 movq_m2r(*idata2, mm0);
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
599 movq_r2r(mm0, mm1);
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
600
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
601 punpcklbw_r2r(mm2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
602 movq_r2m(mm0, *(dataptr));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
603
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
604 punpckhbw_r2r(mm2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
605 movq_r2m(mm1, *(dataptr+1));
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
606
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
607 idata2 += rskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
608
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
609 movq_m2r(*idata2, mm0);
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
610 movq_r2r(mm0, mm1);
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
611
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
612 punpcklbw_r2r(mm2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
613 movq_r2m(mm0, *(dataptr+2));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
614
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
615 punpckhbw_r2r(mm2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
616 movq_r2m(mm1, *(dataptr+3));
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
617
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
618 idata2 += rskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
619
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
620 movq_m2r(*idata2, mm0);
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
621 movq_r2r(mm0, mm1);
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
622
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
623 punpcklbw_r2r(mm2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
624 movq_r2m(mm0, *(dataptr+4));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
625
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
626 punpckhbw_r2r(mm2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
627 movq_r2m(mm1, *(dataptr+5));
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
628
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
629 idata2 += rskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
630
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
631 movq_m2r(*idata2, mm0);
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
632 movq_r2r(mm0, mm1);
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
633
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
634 punpcklbw_r2r(mm2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
635 movq_r2m(mm0, *(dataptr+6));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
636
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
637 punpckhbw_r2r(mm2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
638 movq_r2m(mm1, *(dataptr+7));
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
639
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
640 idata2 += rskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
641
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
642 movq_m2r(*idata2, mm0);
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
643 movq_r2r(mm0, mm1);
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
644
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
645 punpcklbw_r2r(mm2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
646 movq_r2m(mm0, *(dataptr+8));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
647
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
648 punpckhbw_r2r(mm2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
649 movq_r2m(mm1, *(dataptr+9));
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
650
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
651 idata2 += rskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
652
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
653 movq_m2r(*idata2, mm0);
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
654 movq_r2r(mm0, mm1);
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
655
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
656 punpcklbw_r2r(mm2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
657 movq_r2m(mm0, *(dataptr+10));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
658
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
659 punpckhbw_r2r(mm2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
660 movq_r2m(mm1, *(dataptr+11));
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
661
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
662 idata2 += rskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
663
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
664 movq_m2r(*idata2, mm0);
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
665 movq_r2r(mm0, mm1);
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
666
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
667 punpcklbw_r2r(mm2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
668 movq_r2m(mm0, *(dataptr+12));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
669
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
670 punpckhbw_r2r(mm2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
671 movq_r2m(mm1, *(dataptr+13));
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
672
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
673 idata2 += rskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
674
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
675 movq_m2r(*idata2, mm0);
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
676 movq_r2r(mm0, mm1);
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
677
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
678 punpcklbw_r2r(mm2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
679 movq_r2m(mm0, *(dataptr+14));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
680
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
681 punpckhbw_r2r(mm2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
682 movq_r2m(mm1, *(dataptr+15));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
683
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
684 /* Start Transpose to do calculations on rows */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
685
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
686 movq_m2r(*(dataptr+9), mm7); // m03:m02|m01:m00 - first line (line 4)and copy into m5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
687
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
688 movq_m2r(*(dataptr+13), mm6); // m23:m22|m21:m20 - third line (line 6)and copy into m2
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
689 movq_r2r(mm7, mm5);
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
690
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
691 punpcklwd_m2r(*(dataptr+11), mm7); // m11:m01|m10:m00 - interleave first and second lines
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
692 movq_r2r(mm6, mm2);
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
693
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
694 punpcklwd_m2r(*(dataptr+15), mm6); // m31:m21|m30:m20 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
695 movq_r2r(mm7, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
696
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
697 movq_m2r(*(dataptr+11), mm3); // m13:m13|m11:m10 - second line
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
698 punpckldq_r2r(mm6, mm7); // m30:m20|m10:m00 - interleave to produce result 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
699
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
700 movq_m2r(*(dataptr+15), mm0); // m13:m13|m11:m10 - fourth line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
701 punpckhdq_r2r(mm6, mm1); // m31:m21|m11:m01 - interleave to produce result 2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
702
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
703 movq_r2m(mm7,*(dataptr+9)); // write result 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
704 punpckhwd_r2r(mm3, mm5); // m13:m03|m12:m02 - interleave first and second lines
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
705
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
706 movq_r2m(mm1,*(dataptr+11)); // write result 2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
707 punpckhwd_r2r(mm0, mm2); // m33:m23|m32:m22 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
708
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
709 movq_r2r(mm5, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
710 punpckldq_r2r(mm2, mm5); // m32:m22|m12:m02 - interleave to produce result 3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
711
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
712 movq_m2r(*(dataptr+1), mm0); // m03:m02|m01:m00 - first line, 4x4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
713 punpckhdq_r2r(mm2, mm1); // m33:m23|m13:m03 - interleave to produce result 4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
714
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
715 movq_r2m(mm5,*(dataptr+13)); // write result 3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
716
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
717 // last 4x4 done
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
718
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
719 movq_r2m(mm1, *(dataptr+15)); // write result 4, last 4x4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
720
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
721 movq_m2r(*(dataptr+5), mm2); // m23:m22|m21:m20 - third line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
722 movq_r2r(mm0, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
723
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
724 punpcklwd_m2r(*(dataptr+3), mm0); // m11:m01|m10:m00 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
725 movq_r2r(mm2, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
726
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
727 punpcklwd_m2r(*(dataptr+7), mm2); // m31:m21|m30:m20 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
728 movq_r2r(mm0, mm4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
729
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
730 //
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
731 movq_m2r(*(dataptr+8), mm1); // n03:n02|n01:n00 - first line
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
732 punpckldq_r2r(mm2, mm0); // m30:m20|m10:m00 - interleave to produce first result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
733
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
734 movq_m2r(*(dataptr+12), mm3); // n23:n22|n21:n20 - third line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
735 punpckhdq_r2r(mm2, mm4); // m31:m21|m11:m01 - interleave to produce second result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
736
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
737 punpckhwd_m2r(*(dataptr+3), mm6); // m13:m03|m12:m02 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
738 movq_r2r(mm1, mm2); // copy first line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
739
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
740 punpckhwd_m2r(*(dataptr+7), mm7); // m33:m23|m32:m22 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
741 movq_r2r(mm6, mm5); // copy first intermediate result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
742
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
743 movq_r2m(mm0, *(dataptr+8)); // write result 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
744 punpckhdq_r2r(mm7, mm5); // m33:m23|m13:m03 - produce third result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
745
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
746 punpcklwd_m2r(*(dataptr+10), mm1); // n11:n01|n10:n00 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
747 movq_r2r(mm3, mm0); // copy third line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
748
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
749 punpckhwd_m2r(*(dataptr+10), mm2); // n13:n03|n12:n02 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
750
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
751 movq_r2m(mm4, *(dataptr+10)); // write result 2 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
752 punpckldq_r2r(mm7, mm6); // m32:m22|m12:m02 - produce fourth result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
753
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
754 punpcklwd_m2r(*(dataptr+14), mm3); // n31:n21|n30:n20 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
755 movq_r2r(mm1, mm4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
756
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
757 movq_r2m(mm6, *(dataptr+12)); // write result 3 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
758 punpckldq_r2r(mm3, mm1); // n30:n20|n10:n00 - produce first result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
759
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
760 punpckhwd_m2r(*(dataptr+14), mm0); // n33:n23|n32:n22 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
761 movq_r2r(mm2, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
762
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
763 movq_r2m(mm5, *(dataptr+14)); // write result 4 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
764 punpckhdq_r2r(mm3, mm4); // n31:n21|n11:n01- produce second result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
765
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
766 movq_r2m(mm1, *(dataptr+1)); // write result 5 out - (first result for other 4 x 4 block)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
767 punpckldq_r2r(mm0, mm2); // n32:n22|n12:n02- produce third result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
768
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
769 movq_r2m(mm4, *(dataptr+3)); // write result 6 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
770 punpckhdq_r2r(mm0, mm6); // n33:n23|n13:n03 - produce fourth result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
771
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
772 movq_r2m(mm2, *(dataptr+5)); // write result 7 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
773
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
774 movq_m2r(*dataptr, mm0); // m03:m02|m01:m00 - first line, first 4x4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
775
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
776 movq_r2m(mm6, *(dataptr+7)); // write result 8 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
777
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
778
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
779 // Do first 4x4 quadrant, which is used in the beginning of the DCT:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
780
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
781 movq_m2r(*(dataptr+4), mm7); // m23:m22|m21:m20 - third line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
782 movq_r2r(mm0, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
783
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
784 punpcklwd_m2r(*(dataptr+2), mm0); // m11:m01|m10:m00 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
785 movq_r2r(mm7, mm4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
786
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
787 punpcklwd_m2r(*(dataptr+6), mm7); // m31:m21|m30:m20 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
788 movq_r2r(mm0, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
789
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
790 movq_m2r(*(dataptr+2), mm6); // m13:m12|m11:m10 - second line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
791 punpckldq_r2r(mm7, mm0); // m30:m20|m10:m00 - interleave to produce result 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
792
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
793 movq_m2r(*(dataptr+6), mm5); // m33:m32|m31:m30 - fourth line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
794 punpckhdq_r2r(mm7, mm1); // m31:m21|m11:m01 - interleave to produce result 2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
795
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
796 movq_r2r(mm0, mm7); // write result 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
797 punpckhwd_r2r(mm6, mm2); // m13:m03|m12:m02 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
798
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
799 psubw_m2r(*(dataptr+14), mm7); // tmp07=x0-x7 /* Stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
800 movq_r2r(mm1, mm6); // write result 2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
801
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
802 paddw_m2r(*(dataptr+14), mm0); // tmp00=x0+x7 /* Stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
803 punpckhwd_r2r(mm5, mm4); // m33:m23|m32:m22 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
804
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
805 paddw_m2r(*(dataptr+12), mm1); // tmp01=x1+x6 /* Stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
806 movq_r2r(mm2, mm3); // copy first intermediate result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
807
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
808 psubw_m2r(*(dataptr+12), mm6); // tmp06=x1-x6 /* Stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
809 punpckldq_r2r(mm4, mm2); // m32:m22|m12:m02 - interleave to produce result 3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
810
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
811 movq_r2m(mm7, tmp7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
812 movq_r2r(mm2, mm5); // write result 3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
813
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
814 movq_r2m(mm6, tmp6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
815 punpckhdq_r2r(mm4, mm3); // m33:m23|m13:m03 - interleave to produce result 4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
816
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
817 paddw_m2r(*(dataptr+10), mm2); // tmp02=x2+5 /* Stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
818 movq_r2r(mm3, mm4); // write result 4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
819
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
820 /************************************************************************************************
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
821 End of Transpose
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
822 ************************************************************************************************/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
823
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
824
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
825 paddw_m2r(*(dataptr+8), mm3); // tmp03=x3+x4 /* stage 1*/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
826 movq_r2r(mm0, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
827
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
828 psubw_m2r(*(dataptr+8), mm4); // tmp04=x3-x4 /* stage 1*/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
829 movq_r2r(mm1, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
830
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
831 paddw_r2r(mm3, mm0); // tmp10 = tmp00 + tmp03 /* even 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
832 psubw_r2r(mm3, mm7); // tmp13 = tmp00 - tmp03 /* even 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
833
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
834 psubw_r2r(mm2, mm6); // tmp12 = tmp01 - tmp02 /* even 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
835 paddw_r2r(mm2, mm1); // tmp11 = tmp01 + tmp02 /* even 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
836
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
837 psubw_m2r(*(dataptr+10), mm5); // tmp05=x2-x5 /* stage 1*/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
838 paddw_r2r(mm7, mm6); // tmp12 + tmp13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
839
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
840 /* stage 3 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
841
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
842 movq_m2r(tmp6, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
843 movq_r2r(mm0, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
844
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
845 psllw_i2r(2, mm6); // m8 * 2^2
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
846 paddw_r2r(mm1, mm0);
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
847
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
848 pmulhw_m2r(RTjpeg_C4, mm6); // z1
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
849 psubw_r2r(mm1, mm3);
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
850
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
851 movq_r2m(mm0, *dataptr);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
852 movq_r2r(mm7, mm0);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
853
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
854 /* Odd part */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
855 movq_r2m(mm3, *(dataptr+8));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
856 paddw_r2r(mm5, mm4); // tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
857
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
858 movq_m2r(tmp7, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
859 paddw_r2r(mm6, mm0); // tmp32
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
860
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
861 paddw_r2r(mm2, mm5); // tmp11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
862 psubw_r2r(mm6, mm7); // tmp33
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
863
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
864 movq_r2m(mm0, *(dataptr+4));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
865 paddw_r2r(mm3, mm2); // tmp12
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
866
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
867 /* stage 4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
868
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
869 movq_r2m(mm7, *(dataptr+12));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
870 movq_r2r(mm4, mm1); // copy of tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
871
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
872 psubw_r2r(mm2, mm1); // tmp10 - tmp12
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
873 psllw_i2r(2, mm4); // m8 * 2^2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
874
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
875 movq_m2r(RTjpeg_C2mC6, mm0);
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
876 psllw_i2r(2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
877
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
878 pmulhw_m2r(RTjpeg_C6, mm1); // z5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
879 psllw_i2r(2, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
880
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
881 pmulhw_r2r(mm0, mm4); // z5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
882
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
883 /* stage 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
884
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
885 pmulhw_m2r(RTjpeg_C2pC6, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
886 psllw_i2r(2, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
887
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
888 pmulhw_m2r(RTjpeg_C4, mm5); // z3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
889 movq_r2r(mm3, mm0); // copy tmp7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
890
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
891 movq_m2r(*(dataptr+1), mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
892 paddw_r2r(mm1, mm4); // z2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
893
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
894 paddw_r2r(mm1, mm2); // z4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
895
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
896 paddw_r2r(mm5, mm0); // z11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
897 psubw_r2r(mm5, mm3); // z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
898
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
899 /* stage 6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
900
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
901 movq_r2r(mm3, mm5); // copy z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
902 psubw_r2r(mm4, mm3); // y3=z13 - z2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
903
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
904 paddw_r2r(mm4, mm5); // y5=z13 + z2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
905 movq_r2r(mm0, mm6); // copy z11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
906
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
907 movq_r2m(mm3, *(dataptr+6)); //save y3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
908 psubw_r2r(mm2, mm0); // y7=z11 - z4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
909
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
910 movq_r2m(mm5, *(dataptr+10)); //save y5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
911 paddw_r2r(mm2, mm6); // y1=z11 + z4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
912
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
913 movq_r2m(mm0, *(dataptr+14)); //save y7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
914
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
915 /************************************************
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
916 * End of 1st 4 rows
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
917 ************************************************/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
918
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
919 movq_m2r(*(dataptr+3), mm1); // load x1 /* stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
920 movq_r2r(mm7, mm0); // copy x0
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
921
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
922 movq_r2m(mm6, *(dataptr+2)); //save y1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
923
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
924 movq_m2r(*(dataptr+5), mm2); // load x2 /* stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
925 movq_r2r(mm1, mm6); // copy x1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
926
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
927 paddw_m2r(*(dataptr+15), mm0); // tmp00 = x0 + x7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
928
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
929 movq_m2r(*(dataptr+7), mm3); // load x3 /* stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
930 movq_r2r(mm2, mm5); // copy x2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
931
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
932 psubw_m2r(*(dataptr+15), mm7); // tmp07 = x0 - x7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
933 movq_r2r(mm3, mm4); // copy x3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
934
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
935 paddw_m2r(*(dataptr+13), mm1); // tmp01 = x1 + x6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
936
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
937 movq_r2m(mm7, tmp7); // save tmp07
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
938 movq_r2r(mm0, mm7); // copy tmp00
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
939
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
940 psubw_m2r(*(dataptr+13), mm6); // tmp06 = x1 - x6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
941
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
942 /* stage 2, Even Part */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
943
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
944 paddw_m2r(*(dataptr+9), mm3); // tmp03 = x3 + x4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
945
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
946 movq_r2m(mm6, tmp6); // save tmp07
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
947 movq_r2r(mm1, mm6); // copy tmp01
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
948
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
949 paddw_m2r(*(dataptr+11), mm2); // tmp02 = x2 + x5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
950 paddw_r2r(mm3, mm0); // tmp10 = tmp00 + tmp03
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
951
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
952 psubw_r2r(mm3, mm7); // tmp13 = tmp00 - tmp03
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
953
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
954 psubw_m2r(*(dataptr+9), mm4); // tmp04 = x3 - x4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
955 psubw_r2r(mm2, mm6); // tmp12 = tmp01 - tmp02
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
956
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
957 paddw_r2r(mm2, mm1); // tmp11 = tmp01 + tmp02
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
958
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
959 psubw_m2r(*(dataptr+11), mm5); // tmp05 = x2 - x5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
960 paddw_r2r(mm7, mm6); // tmp12 + tmp13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
961
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
962 /* stage 3, Even and stage 4 & 5 even */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
963
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
964 movq_m2r(tmp6, mm2); // load tmp6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
965 movq_r2r(mm0, mm3); // copy tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
966
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
967 psllw_i2r(2, mm6); // shift z1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
968 paddw_r2r(mm1, mm0); // y0=tmp10 + tmp11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
969
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
970 pmulhw_m2r(RTjpeg_C4, mm6); // z1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
971 psubw_r2r(mm1, mm3); // y4=tmp10 - tmp11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
972
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
973 movq_r2m(mm0, *(dataptr+1)); //save y0
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
974 movq_r2r(mm7, mm0); // copy tmp13
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
975
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
976 /* odd part */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
977
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
978 movq_r2m(mm3, *(dataptr+9)); //save y4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
979 paddw_r2r(mm5, mm4); // tmp10 = tmp4 + tmp5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
980
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
981 movq_m2r(tmp7, mm3); // load tmp7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
982 paddw_r2r(mm6, mm0); // tmp32 = tmp13 + z1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
983
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
984 paddw_r2r(mm2, mm5); // tmp11 = tmp5 + tmp6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
985 psubw_r2r(mm6, mm7); // tmp33 = tmp13 - z1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
986
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
987 movq_r2m(mm0, *(dataptr+5)); //save y2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
988 paddw_r2r(mm3, mm2); // tmp12 = tmp6 + tmp7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
989
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
990 /* stage 4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
991
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
992 movq_r2m(mm7, *(dataptr+13)); //save y6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
993 movq_r2r(mm4, mm1); // copy tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
994
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
995 psubw_r2r(mm2, mm1); // tmp10 - tmp12
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
996 psllw_i2r(2, mm4); // shift tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
997
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
998 movq_m2r(RTjpeg_C2mC6, mm0); // load C2mC6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
999 psllw_i2r(2, mm1); // shift (tmp10-tmp12)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1000
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1001 pmulhw_m2r(RTjpeg_C6, mm1); // z5
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1002 psllw_i2r(2, mm5); // prepare for multiply
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1003
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1004 pmulhw_r2r(mm0, mm4); // multiply by converted real
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1005
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1006 /* stage 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1007
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1008 pmulhw_m2r(RTjpeg_C4, mm5); // z3
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1009 psllw_i2r(2, mm2); // prepare for multiply
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1010
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1011 pmulhw_m2r(RTjpeg_C2pC6, mm2); // multiply
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1012 movq_r2r(mm3, mm0); // copy tmp7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1013
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1014 movq_m2r(*(dataptr+9), mm7); // m03:m02|m01:m00 - first line (line 4)and copy into mm7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1015 paddw_r2r(mm1, mm4); // z2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1016
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1017 paddw_r2r(mm5, mm0); // z11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1018 psubw_r2r(mm5, mm3); // z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1019
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1020 /* stage 6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1021
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1022 movq_r2r(mm3, mm5); // copy z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1023 paddw_r2r(mm1, mm2); // z4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1024
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1025 movq_r2r(mm0, mm6); // copy z11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1026 psubw_r2r(mm4, mm5); // y3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1027
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1028 paddw_r2r(mm2, mm6); // y1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1029 paddw_r2r(mm4, mm3); // y5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1030
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1031 movq_r2m(mm5, *(dataptr+7)); //save y3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1032
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1033 movq_r2m(mm6, *(dataptr+3)); //save y1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1034 psubw_r2r(mm2, mm0); // y7
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1035
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1036 /************************************************************************************************
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1037 Start of Transpose
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1038 ************************************************************************************************/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1039
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1040 movq_m2r(*(dataptr+13), mm6); // m23:m22|m21:m20 - third line (line 6)and copy into m2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1041 movq_r2r(mm7, mm5); // copy first line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1042
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1043 punpcklwd_r2r(mm3, mm7); // m11:m01|m10:m00 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1044 movq_r2r(mm6, mm2); // copy third line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1045
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1046 punpcklwd_r2r(mm0, mm6); // m31:m21|m30:m20 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1047 movq_r2r(mm7, mm1); // copy first intermediate result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1048
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1049 punpckldq_r2r(mm6, mm7); // m30:m20|m10:m00 - interleave to produce result 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1050
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1051 punpckhdq_r2r(mm6, mm1); // m31:m21|m11:m01 - interleave to produce result 2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1052
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1053 movq_r2m(mm7, *(dataptr+9)); // write result 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1054 punpckhwd_r2r(mm3, mm5); // m13:m03|m12:m02 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1055
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1056 movq_r2m(mm1, *(dataptr+11)); // write result 2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1057 punpckhwd_r2r(mm0, mm2); // m33:m23|m32:m22 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1058
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1059 movq_r2r(mm5, mm1); // copy first intermediate result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1060 punpckldq_r2r(mm2, mm5); // m32:m22|m12:m02 - interleave to produce result 3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1061
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1062 movq_m2r(*(dataptr+1), mm0); // m03:m02|m01:m00 - first line, 4x4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1063 punpckhdq_r2r(mm2, mm1); // m33:m23|m13:m03 - interleave to produce result 4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1064
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1065 movq_r2m(mm5, *(dataptr+13)); // write result 3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1066
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1067 /****** last 4x4 done */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1068
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1069 movq_r2m(mm1, *(dataptr+15)); // write result 4, last 4x4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1070
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1071 movq_m2r(*(dataptr+5), mm2); // m23:m22|m21:m20 - third line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1072 movq_r2r(mm0, mm6); // copy first line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1073
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1074 punpcklwd_m2r(*(dataptr+3), mm0); // m11:m01|m10:m00 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1075 movq_r2r(mm2, mm7); // copy third line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1076
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1077 punpcklwd_m2r(*(dataptr+7), mm2); // m31:m21|m30:m20 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1078 movq_r2r(mm0, mm4); // copy first intermediate result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1079
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1080
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1081
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1082 movq_m2r(*(dataptr+8), mm1); // n03:n02|n01:n00 - first line
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1083 punpckldq_r2r(mm2, mm0); // m30:m20|m10:m00 - interleave to produce first result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1084
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1085 movq_m2r(*(dataptr+12), mm3); // n23:n22|n21:n20 - third line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1086 punpckhdq_r2r(mm2, mm4); // m31:m21|m11:m01 - interleave to produce second result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1087
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1088 punpckhwd_m2r(*(dataptr+3), mm6); // m13:m03|m12:m02 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1089 movq_r2r(mm1, mm2); // copy first line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1090
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1091 punpckhwd_m2r(*(dataptr+7), mm7); // m33:m23|m32:m22 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1092 movq_r2r(mm6, mm5); // copy first intermediate result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1093
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1094 movq_r2m(mm0, *(dataptr+8)); // write result 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1095 punpckhdq_r2r(mm7, mm5); // m33:m23|m13:m03 - produce third result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1096
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1097 punpcklwd_m2r(*(dataptr+10), mm1); // n11:n01|n10:n00 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1098 movq_r2r(mm3, mm0); // copy third line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1099
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1100 punpckhwd_m2r(*(dataptr+10), mm2); // n13:n03|n12:n02 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1101
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1102 movq_r2m(mm4, *(dataptr+10)); // write result 2 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1103 punpckldq_r2r(mm7, mm6); // m32:m22|m12:m02 - produce fourth result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1104
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1105 punpcklwd_m2r(*(dataptr+14), mm3); // n33:n23|n32:n22 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1106 movq_r2r(mm1, mm4); // copy second intermediate result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1107
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1108 movq_r2m(mm6, *(dataptr+12)); // write result 3 out
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1109 punpckldq_r2r(mm3, mm1); //
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1110
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1111 punpckhwd_m2r(*(dataptr+14), mm0); // n33:n23|n32:n22 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1112 movq_r2r(mm2, mm6); // copy second intermediate result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1113
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1114 movq_r2m(mm5, *(dataptr+14)); // write result 4 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1115 punpckhdq_r2r(mm3, mm4); // n31:n21|n11:n01- produce second result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1116
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1117 movq_r2m(mm1, *(dataptr+1)); // write result 5 out - (first result for other 4 x 4 block)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1118 punpckldq_r2r(mm0, mm2); // n32:n22|n12:n02- produce third result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1119
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1120 movq_r2m(mm4, *(dataptr+3)); // write result 6 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1121 punpckhdq_r2r(mm0, mm6); // n33:n23|n13:n03 - produce fourth result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1122
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1123 movq_r2m(mm2, *(dataptr+5)); // write result 7 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1124
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1125 movq_m2r(*dataptr, mm0); // m03:m02|m01:m00 - first line, first 4x4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1126
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1127 movq_r2m(mm6, *(dataptr+7)); // write result 8 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1128
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1129 // Do first 4x4 quadrant, which is used in the beginning of the DCT:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1130
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1131 movq_m2r(*(dataptr+4), mm7); // m23:m22|m21:m20 - third line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1132 movq_r2r(mm0, mm2); // copy first line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1133
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1134 punpcklwd_m2r(*(dataptr+2), mm0); // m11:m01|m10:m00 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1135 movq_r2r(mm7, mm4); // copy third line
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1136
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1137 punpcklwd_m2r(*(dataptr+6), mm7); // m31:m21|m30:m20 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1138 movq_r2r(mm0, mm1); // copy first intermediate result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1139
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1140 movq_m2r(*(dataptr+2), mm6); // m13:m12|m11:m10 - second line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1141 punpckldq_r2r(mm7, mm0); // m30:m20|m10:m00 - interleave to produce result 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1142
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1143 movq_m2r(*(dataptr+6), mm5); // m33:m32|m31:m30 - fourth line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1144 punpckhdq_r2r(mm7, mm1); // m31:m21|m11:m01 - interleave to produce result 2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1145
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1146 movq_r2r(mm0, mm7); // write result 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1147 punpckhwd_r2r(mm6, mm2); // m13:m03|m12:m02 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1148
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1149 psubw_m2r(*(dataptr+14), mm7); // tmp07=x0-x7 /* Stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1150 movq_r2r(mm1, mm6); // write result 2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1151
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1152 paddw_m2r(*(dataptr+14), mm0); // tmp00=x0+x7 /* Stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1153 punpckhwd_r2r(mm5, mm4); // m33:m23|m32:m22 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1154
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1155 paddw_m2r(*(dataptr+12), mm1); // tmp01=x1+x6 /* Stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1156 movq_r2r(mm2, mm3); // copy first intermediate result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1157
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1158 psubw_m2r(*(dataptr+12), mm6); // tmp06=x1-x6 /* Stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1159 punpckldq_r2r(mm4, mm2); // m32:m22|m12:m02 - interleave to produce result 3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1160
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1161 movq_r2m(mm7, tmp7); // save tmp07
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1162 movq_r2r(mm2, mm5); // write result 3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1163
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1164 movq_r2m(mm6, tmp6); // save tmp06
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1165
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1166 punpckhdq_r2r(mm4, mm3); // m33:m23|m13:m03 - interleave to produce result 4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1167
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1168 paddw_m2r(*(dataptr+10), mm2); // tmp02=x2+x5 /* stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1169 movq_r2r(mm3, mm4); // write result 4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1170
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1171 /************************************************************************************************
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1172 End of Transpose 2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1173 ************************************************************************************************/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1174
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1175 paddw_m2r(*(dataptr+8), mm3); // tmp03=x3+x4 /* stage 1*/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1176 movq_r2r(mm0, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1177
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1178 psubw_m2r(*(dataptr+8), mm4); // tmp04=x3-x4 /* stage 1*/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1179 movq_r2r(mm1, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1180
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1181 paddw_r2r(mm3, mm0); // tmp10 = tmp00 + tmp03 /* even 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1182 psubw_r2r(mm3, mm7); // tmp13 = tmp00 - tmp03 /* even 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1183
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1184 psubw_r2r(mm2, mm6); // tmp12 = tmp01 - tmp02 /* even 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1185 paddw_r2r(mm2, mm1); // tmp11 = tmp01 + tmp02 /* even 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1186
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1187 psubw_m2r(*(dataptr+10), mm5); // tmp05=x2-x5 /* stage 1*/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1188 paddw_r2r(mm7, mm6); // tmp12 + tmp13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1189
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1190 /* stage 3 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1191
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1192 movq_m2r(tmp6, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1193 movq_r2r(mm0, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1194
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1195 psllw_i2r(2, mm6); // m8 * 2^2
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1196 paddw_r2r(mm1, mm0);
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1197
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1198 pmulhw_m2r(RTjpeg_C4, mm6); // z1
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1199 psubw_r2r(mm1, mm3);
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1200
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1201 movq_r2m(mm0, *dataptr);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1202 movq_r2r(mm7, mm0);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1203
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1204 /* Odd part */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1205 movq_r2m(mm3, *(dataptr+8));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1206 paddw_r2r(mm5, mm4); // tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1207
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1208 movq_m2r(tmp7, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1209 paddw_r2r(mm6, mm0); // tmp32
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1210
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1211 paddw_r2r(mm2, mm5); // tmp11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1212 psubw_r2r(mm6, mm7); // tmp33
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1213
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1214 movq_r2m(mm0, *(dataptr+4));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1215 paddw_r2r(mm3, mm2); // tmp12
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1216
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1217 /* stage 4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1218 movq_r2m(mm7, *(dataptr+12));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1219 movq_r2r(mm4, mm1); // copy of tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1220
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1221 psubw_r2r(mm2, mm1); // tmp10 - tmp12
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1222 psllw_i2r(2, mm4); // m8 * 2^2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1223
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1224 movq_m2r(RTjpeg_C2mC6, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1225 psllw_i2r(2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1226
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1227 pmulhw_m2r(RTjpeg_C6, mm1); // z5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1228 psllw_i2r(2, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1229
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1230 pmulhw_r2r(mm0, mm4); // z5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1231
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1232 /* stage 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1233
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1234 pmulhw_m2r(RTjpeg_C2pC6, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1235 psllw_i2r(2, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1236
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1237 pmulhw_m2r(RTjpeg_C4, mm5); // z3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1238 movq_r2r(mm3, mm0); // copy tmp7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1239
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1240 movq_m2r(*(dataptr+1), mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1241 paddw_r2r(mm1, mm4); // z2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1242
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1243 paddw_r2r(mm1, mm2); // z4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1244
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1245 paddw_r2r(mm5, mm0); // z11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1246 psubw_r2r(mm5, mm3); // z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1247
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1248 /* stage 6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1249
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1250 movq_r2r(mm3, mm5); // copy z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1251 psubw_r2r(mm4, mm3); // y3=z13 - z2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1252
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1253 paddw_r2r(mm4, mm5); // y5=z13 + z2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1254 movq_r2r(mm0, mm6); // copy z11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1255
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1256 movq_r2m(mm3, *(dataptr+6)); //save y3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1257 psubw_r2r(mm2, mm0); // y7=z11 - z4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1258
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1259 movq_r2m(mm5, *(dataptr+10)); //save y5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1260 paddw_r2r(mm2, mm6); // y1=z11 + z4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1261
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1262 movq_r2m(mm0, *(dataptr+14)); //save y7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1263
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1264 /************************************************
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1265 * End of 1st 4 rows
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1266 ************************************************/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1267
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1268 movq_m2r(*(dataptr+3), mm1); // load x1 /* stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1269 movq_r2r(mm7, mm0); // copy x0
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1270
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1271 movq_r2m(mm6, *(dataptr+2)); //save y1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1272
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1273 movq_m2r(*(dataptr+5), mm2); // load x2 /* stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1274 movq_r2r(mm1, mm6); // copy x1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1275
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1276 paddw_m2r(*(dataptr+15), mm0); // tmp00 = x0 + x7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1277
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1278 movq_m2r(*(dataptr+7), mm3); // load x3 /* stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1279 movq_r2r(mm2, mm5); // copy x2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1280
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1281 psubw_m2r(*(dataptr+15), mm7); // tmp07 = x0 - x7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1282 movq_r2r(mm3, mm4); // copy x3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1283
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1284 paddw_m2r(*(dataptr+13), mm1); // tmp01 = x1 + x6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1285
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1286 movq_r2m(mm7, tmp7); // save tmp07
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1287 movq_r2r(mm0, mm7); // copy tmp00
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1288
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1289 psubw_m2r(*(dataptr+13), mm6); // tmp06 = x1 - x6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1290
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1291 /* stage 2, Even Part */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1292
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1293 paddw_m2r(*(dataptr+9), mm3); // tmp03 = x3 + x4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1294
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1295 movq_r2m(mm6, tmp6); // save tmp07
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1296 movq_r2r(mm1, mm6); // copy tmp01
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1297
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1298 paddw_m2r(*(dataptr+11), mm2); // tmp02 = x2 + x5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1299 paddw_r2r(mm3, mm0); // tmp10 = tmp00 + tmp03
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1300
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1301 psubw_r2r(mm3, mm7); // tmp13 = tmp00 - tmp03
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1302
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1303 psubw_m2r(*(dataptr+9), mm4); // tmp04 = x3 - x4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1304 psubw_r2r(mm2, mm6); // tmp12 = tmp01 - tmp02
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1305
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1306 paddw_r2r(mm2, mm1); // tmp11 = tmp01 + tmp02
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1307
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1308 psubw_m2r(*(dataptr+11), mm5); // tmp05 = x2 - x5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1309 paddw_r2r(mm7, mm6); // tmp12 + tmp13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1310
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1311 /* stage 3, Even and stage 4 & 5 even */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1312
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1313 movq_m2r(tmp6, mm2); // load tmp6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1314 movq_r2r(mm0, mm3); // copy tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1315
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1316 psllw_i2r(2, mm6); // shift z1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1317 paddw_r2r(mm1, mm0); // y0=tmp10 + tmp11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1318
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1319 pmulhw_m2r(RTjpeg_C4, mm6); // z1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1320 psubw_r2r(mm1, mm3); // y4=tmp10 - tmp11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1321
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1322 movq_r2m(mm0, *(dataptr+1)); //save y0
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1323 movq_r2r(mm7, mm0); // copy tmp13
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1324
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1325 /* odd part */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1326
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1327 movq_r2m(mm3, *(dataptr+9)); //save y4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1328 paddw_r2r(mm5, mm4); // tmp10 = tmp4 + tmp5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1329
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1330 movq_m2r(tmp7, mm3); // load tmp7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1331 paddw_r2r(mm6, mm0); // tmp32 = tmp13 + z1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1332
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1333 paddw_r2r(mm2, mm5); // tmp11 = tmp5 + tmp6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1334 psubw_r2r(mm6, mm7); // tmp33 = tmp13 - z1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1335
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1336 movq_r2m(mm0, *(dataptr+5)); //save y2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1337 paddw_r2r(mm3, mm2); // tmp12 = tmp6 + tmp7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1338
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1339 /* stage 4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1340
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1341 movq_r2m(mm7, *(dataptr+13)); //save y6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1342 movq_r2r(mm4, mm1); // copy tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1343
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1344 psubw_r2r(mm2, mm1); // tmp10 - tmp12
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1345 psllw_i2r(2, mm4); // shift tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1346
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1347 movq_m2r(RTjpeg_C2mC6, mm0); // load C2mC6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1348 psllw_i2r(2, mm1); // shift (tmp10-tmp12)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1349
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1350 pmulhw_m2r(RTjpeg_C6, mm1); // z5
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1351 psllw_i2r(2, mm5); // prepare for multiply
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1352
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1353 pmulhw_r2r(mm0, mm4); // multiply by converted real
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1354
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1355 /* stage 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1356
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1357 pmulhw_m2r(RTjpeg_C4, mm5); // z3
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1358 psllw_i2r(2, mm2); // prepare for multiply
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1359
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1360 pmulhw_m2r(RTjpeg_C2pC6, mm2); // multiply
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1361 movq_r2r(mm3, mm0); // copy tmp7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1362
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1363 movq_m2r(*(dataptr+9), mm7); // m03:m02|m01:m00 - first line (line 4)and copy into mm7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1364 paddw_r2r(mm1, mm4); // z2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1365
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1366 paddw_r2r(mm5, mm0); // z11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1367 psubw_r2r(mm5, mm3); // z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1368
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1369 /* stage 6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1370
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1371 movq_r2r(mm3, mm5); // copy z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1372 paddw_r2r(mm1, mm2); // z4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1373
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1374 movq_r2r(mm0, mm6); // copy z11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1375 psubw_r2r(mm4, mm5); // y3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1376
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1377 paddw_r2r(mm2, mm6); // y1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1378 paddw_r2r(mm4, mm3); // y5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1379
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1380 movq_r2m(mm5, *(dataptr+7)); //save y3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1381 psubw_r2r(mm2, mm0); // yè=z11 - z4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1382
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1383 movq_r2m(mm3, *(dataptr+11)); //save y5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1384
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1385 movq_r2m(mm6, *(dataptr+3)); //save y1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1386
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1387 movq_r2m(mm0, *(dataptr+15)); //save y7
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1388
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1389
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1390 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1391 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1392
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1393 /*
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1394
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1395 Main Routines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1396
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1397 This file contains most of the initialisation and control functions
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1398
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1399 (C) Justin Schoeman 1998
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1400
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1401 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1402
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1403 /*
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1404
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1405 Private function
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1406
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1407 Initialise all the cache-aliged data blocks
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1408
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1409 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1410
28849
87b59e8d3c26 Mark everything not used outside the file as "static"
reimar
parents: 28298
diff changeset
1411 static void RTjpeg_init_data(void)
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1412 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1413 unsigned long dptr;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1414
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1415 dptr=(unsigned long)&(RTjpeg_alldata[0]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1416 dptr+=32;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1417 dptr=dptr>>5;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1418 dptr=dptr<<5; /* cache align data */
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1419
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1420 RTjpeg_block=(__s16 *)dptr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1421 dptr+=sizeof(__s16)*64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1422 RTjpeg_lqt=(__s32 *)dptr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1423 dptr+=sizeof(__s32)*64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1424 RTjpeg_cqt=(__s32 *)dptr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1425 dptr+=sizeof(__s32)*64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1426 RTjpeg_liqt=(__u32 *)dptr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1427 dptr+=sizeof(__u32)*64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1428 RTjpeg_ciqt=(__u32 *)dptr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1429 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1430
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1431 /*
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1432
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1433 External Function
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1434
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1435 Re-set quality factor
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1436
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1437 Input: buf -> pointer to 128 ints for quant values store to pass back to
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1438 init_decompress.
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1439 Q -> quality factor (192=best, 32=worst)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1440 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1441
28849
87b59e8d3c26 Mark everything not used outside the file as "static"
reimar
parents: 28298
diff changeset
1442 static void RTjpeg_init_Q(__u8 Q)
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1443 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1444 int i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1445 __u64 qual;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1446
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1447 qual=(__u64)Q<<(32-7); /* 32 bit FP, 255=2, 0=0 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1448
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1449 for(i=0; i<64; i++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1450 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1451 RTjpeg_lqt[i]=(__s32)((qual/((__u64)RTjpeg_lum_quant_tbl[i]<<16))>>3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1452 if(RTjpeg_lqt[i]==0)RTjpeg_lqt[i]=1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1453 RTjpeg_cqt[i]=(__s32)((qual/((__u64)RTjpeg_chrom_quant_tbl[i]<<16))>>3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1454 if(RTjpeg_cqt[i]==0)RTjpeg_cqt[i]=1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1455 RTjpeg_liqt[i]=(1<<16)/(RTjpeg_lqt[i]<<3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1456 RTjpeg_ciqt[i]=(1<<16)/(RTjpeg_cqt[i]<<3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1457 RTjpeg_lqt[i]=((1<<16)/RTjpeg_liqt[i])>>3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1458 RTjpeg_cqt[i]=((1<<16)/RTjpeg_ciqt[i])>>3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1459 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1460
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1461 RTjpeg_lb8=0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1462 while(RTjpeg_liqt[RTjpeg_ZZ[++RTjpeg_lb8]]<=8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1463 RTjpeg_lb8--;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1464 RTjpeg_cb8=0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1465 while(RTjpeg_ciqt[RTjpeg_ZZ[++RTjpeg_cb8]]<=8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1466 RTjpeg_cb8--;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1467
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1468 RTjpeg_dct_init();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1469 RTjpeg_quant_init();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1470 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1471
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1472 /*
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1473
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1474 External Function
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1475
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1476 Initialise compression.
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1477
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1478 Input: buf -> pointer to 128 ints for quant values store to pass back to
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1479 init_decompress.
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1480 width -> width of image
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1481 height -> height of image
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1482 Q -> quality factor (192=best, 32=worst)
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1483
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1484 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1485
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1486 void RTjpeg_init_compress(__u32 *buf, int width, int height, __u8 Q)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1487 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1488 int i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1489 __u64 qual;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1490
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1491 RTjpeg_init_data();
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1492
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1493 RTjpeg_width=width;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1494 RTjpeg_height=height;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1495 RTjpeg_Ywidth = RTjpeg_width>>3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1496 RTjpeg_Ysize=width * height;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1497 RTjpeg_Cwidth = RTjpeg_width>>4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1498 RTjpeg_Csize= (width>>1) * height;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1499
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1500 qual=(__u64)Q<<(32-7); /* 32 bit FP, 255=2, 0=0 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1501
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1502 for(i=0; i<64; i++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1503 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1504 RTjpeg_lqt[i]=(__s32)((qual/((__u64)RTjpeg_lum_quant_tbl[i]<<16))>>3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1505 if(RTjpeg_lqt[i]==0)RTjpeg_lqt[i]=1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1506 RTjpeg_cqt[i]=(__s32)((qual/((__u64)RTjpeg_chrom_quant_tbl[i]<<16))>>3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1507 if(RTjpeg_cqt[i]==0)RTjpeg_cqt[i]=1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1508 RTjpeg_liqt[i]=(1<<16)/(RTjpeg_lqt[i]<<3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1509 RTjpeg_ciqt[i]=(1<<16)/(RTjpeg_cqt[i]<<3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1510 RTjpeg_lqt[i]=((1<<16)/RTjpeg_liqt[i])>>3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1511 RTjpeg_cqt[i]=((1<<16)/RTjpeg_ciqt[i])>>3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1512 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1513
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1514 RTjpeg_lb8=0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1515 while(RTjpeg_liqt[RTjpeg_ZZ[++RTjpeg_lb8]]<=8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1516 RTjpeg_lb8--;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1517 RTjpeg_cb8=0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1518 while(RTjpeg_ciqt[RTjpeg_ZZ[++RTjpeg_cb8]]<=8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1519 RTjpeg_cb8--;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1520
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1521 RTjpeg_dct_init();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1522 RTjpeg_quant_init();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1523
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1524 for(i=0; i<64; i++)
14896
9ddae5897422 Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents: 14642
diff changeset
1525 buf[i]=le2me_32(RTjpeg_liqt[i]);
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1526 for(i=0; i<64; i++)
14896
9ddae5897422 Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents: 14642
diff changeset
1527 buf[64+i]=le2me_32(RTjpeg_ciqt[i]);
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1528 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1529
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1530 int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1531 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1532 __s8 * sb;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1533 register __s8 * bp1 = bp + (RTjpeg_width<<3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1534 register __s8 * bp2 = bp + RTjpeg_Ysize;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1535 register __s8 * bp3 = bp2 + (RTjpeg_Csize>>1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1536 register int i, j, k;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1537
28298
a7124a264ea6 Completely get rid of MMX define, use HAVE_MMX define instead.
gpoirier
parents: 28296
diff changeset
1538 #if HAVE_MMX
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1539 emms();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1540 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1541 sb=sp;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1542 /* Y */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1543 for(i=RTjpeg_height>>1; i; i-=8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1544 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1545 for(j=0, k=0; j<RTjpeg_width; j+=16, k+=8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1546 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1547 RTjpeg_dctY(bp+j, RTjpeg_block, RTjpeg_Ywidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1548 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1549 sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1550
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1551 RTjpeg_dctY(bp+j+8, RTjpeg_block, RTjpeg_Ywidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1552 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1553 sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1554
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1555 RTjpeg_dctY(bp1+j, RTjpeg_block, RTjpeg_Ywidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1556 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1557 sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1558
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1559 RTjpeg_dctY(bp1+j+8, RTjpeg_block, RTjpeg_Ywidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1560 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1561 sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1562
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1563 RTjpeg_dctY(bp2+k, RTjpeg_block, RTjpeg_Cwidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1564 RTjpeg_quant(RTjpeg_block, RTjpeg_cqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1565 sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_cb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1566
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1567 RTjpeg_dctY(bp3+k, RTjpeg_block, RTjpeg_Cwidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1568 RTjpeg_quant(RTjpeg_block, RTjpeg_cqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1569 sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_cb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1570
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1571 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1572 bp+=RTjpeg_width<<4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1573 bp1+=RTjpeg_width<<4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1574 bp2+=RTjpeg_width<<2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1575 bp3+=RTjpeg_width<<2;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1576
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1577 }
28298
a7124a264ea6 Completely get rid of MMX define, use HAVE_MMX define instead.
gpoirier
parents: 28296
diff changeset
1578 #if HAVE_MMX
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1579 emms();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1580 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1581 return (sp-sb);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1582 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1583
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1584 /*
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1585 External Function
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1586
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1587 Initialise additional data structures for motion compensation
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1588
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1589 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1590
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1591 void RTjpeg_init_mcompress(void)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1592 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1593 unsigned long tmp;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1594
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1595 if(!RTjpeg_old)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1596 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1597 RTjpeg_old=malloc((4*RTjpeg_width*RTjpeg_height)+32);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1598 tmp=(unsigned long)RTjpeg_old;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1599 tmp+=32;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1600 tmp=tmp>>5;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1601 RTjpeg_old=(__s16 *)(tmp<<5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1602 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1603 if (!RTjpeg_old)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1604 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1605 fprintf(stderr, "RTjpeg: Could not allocate memory\n");
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1606 exit(-1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1607 }
14642
38572280e8e7 bzero is deprecated patch by Gianluigi Tiesi <mplayer at netfarm.it>
faust3
parents: 12928
diff changeset
1608 memset(RTjpeg_old, 0, ((4*RTjpeg_width*RTjpeg_height)));
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1609 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1610
28298
a7124a264ea6 Completely get rid of MMX define, use HAVE_MMX define instead.
gpoirier
parents: 28296
diff changeset
1611 #if HAVE_MMX
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1612
28849
87b59e8d3c26 Mark everything not used outside the file as "static"
reimar
parents: 28298
diff changeset
1613 static int RTjpeg_bcomp(__s16 *old, mmx_t *mask)
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1614 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1615 int i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1616 mmx_t *mold=(mmx_t *)old;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1617 mmx_t *mblock=(mmx_t *)RTjpeg_block;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1618 volatile mmx_t result;
12928
bc760f3f129e ICC 8.0 compilation fixes
atmos4
parents: 12378
diff changeset
1619 static mmx_t neg={0xffffffffffffffffULL};
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1620
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1621 movq_m2r(*mask, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1622 movq_m2r(neg, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1623 pxor_r2r(mm5, mm5);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1624
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1625 for(i=0; i<8; i++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1626 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1627 movq_m2r(*(mblock++), mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1628 movq_m2r(*(mblock++), mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1629 movq_m2r(*(mold++), mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1630 movq_m2r(*(mold++), mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1631 psubsw_r2r(mm1, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1632 psubsw_r2r(mm3, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1633 movq_r2r(mm0, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1634 movq_r2r(mm2, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1635 pcmpgtw_r2r(mm7, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1636 pcmpgtw_r2r(mm7, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1637 pxor_r2r(mm6, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1638 pxor_r2r(mm6, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1639 pcmpgtw_r2r(mm7, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1640 pcmpgtw_r2r(mm7, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1641 por_r2r(mm0, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1642 por_r2r(mm2, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1643 por_r2r(mm1, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1644 por_r2r(mm3, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1645 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1646 movq_r2m(mm5, result);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1647
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1648 if(result.q)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1649 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1650 return 0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1651 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1652 return 1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1653 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1654
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1655 #else
28849
87b59e8d3c26 Mark everything not used outside the file as "static"
reimar
parents: 28298
diff changeset
1656 static int RTjpeg_bcomp(__s16 *old, __u16 *mask)
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1657 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1658 int i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1659
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1660 for(i=0; i<64; i++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1661 if(abs(old[i]-RTjpeg_block[i])>*mask)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1662 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1663 for(i=0; i<16; i++)((__u64 *)old)[i]=((__u64 *)RTjpeg_block)[i];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1664 return 0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1665 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1666 return 1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1667 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1668 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1669
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1670 int RTjpeg_mcompressYUV420(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1671 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1672 __s8 * sb;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1673 register __s8 * bp1 = bp + (RTjpeg_width<<3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1674 register __s8 * bp2 = bp + RTjpeg_Ysize;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1675 register __s8 * bp3 = bp2 + (RTjpeg_Csize>>1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1676 register int i, j, k;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1677
28298
a7124a264ea6 Completely get rid of MMX define, use HAVE_MMX define instead.
gpoirier
parents: 28296
diff changeset
1678 #if HAVE_MMX
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1679 emms();
16653
27b0d49988b2 Fix 100l bugs that break playback on 64 bit systems (like typedefing __u32
reimar
parents: 14896
diff changeset
1680 RTjpeg_lmask.uq=((__u64)lmask<<48)|((__u64)lmask<<32)|((__u64)lmask<<16)|lmask;
27b0d49988b2 Fix 100l bugs that break playback on 64 bit systems (like typedefing __u32
reimar
parents: 14896
diff changeset
1681 RTjpeg_cmask.uq=((__u64)cmask<<48)|((__u64)cmask<<32)|((__u64)cmask<<16)|cmask;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1682 #else
16661
adb581352e63 Stupidity in last patch broke compile without MMX: RTjpeg_lmask is a union
reimar
parents: 16653
diff changeset
1683 RTjpeg_lmask=lmask;
adb581352e63 Stupidity in last patch broke compile without MMX: RTjpeg_lmask is a union
reimar
parents: 16653
diff changeset
1684 RTjpeg_cmask=cmask;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1685 #endif
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1686
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1687 sb=sp;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1688 block=RTjpeg_old;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1689 /* Y */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1690 for(i=RTjpeg_height>>1; i; i-=8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1691 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1692 for(j=0, k=0; j<RTjpeg_width; j+=16, k+=8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1693 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1694 RTjpeg_dctY(bp+j, RTjpeg_block, RTjpeg_Ywidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1695 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1696 if(RTjpeg_bcomp(block, &RTjpeg_lmask))
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1697 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1698 *((__u8 *)sp++)=255;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1699 }
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1700 else sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1701 block+=64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1702
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1703 RTjpeg_dctY(bp+j+8, RTjpeg_block, RTjpeg_Ywidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1704 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1705 if(RTjpeg_bcomp(block, &RTjpeg_lmask))
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1706 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1707 *((__u8 *)sp++)=255;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1708 }
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1709 else sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1710 block+=64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1711
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1712 RTjpeg_dctY(bp1+j, RTjpeg_block, RTjpeg_Ywidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1713 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1714 if(RTjpeg_bcomp(block, &RTjpeg_lmask))
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1715 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1716 *((__u8 *)sp++)=255;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1717 }
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1718 else sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1719 block+=64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1720
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1721 RTjpeg_dctY(bp1+j+8, RTjpeg_block, RTjpeg_Ywidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1722 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1723 if(RTjpeg_bcomp(block, &RTjpeg_lmask))
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1724 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1725 *((__u8 *)sp++)=255;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1726 }
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1727 else sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1728 block+=64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1729
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1730 RTjpeg_dctY(bp2+k, RTjpeg_block, RTjpeg_Cwidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1731 RTjpeg_quant(RTjpeg_block, RTjpeg_cqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1732 if(RTjpeg_bcomp(block, &RTjpeg_cmask))
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1733 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1734 *((__u8 *)sp++)=255;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1735 }
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1736 else sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_cb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1737 block+=64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1738
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1739 RTjpeg_dctY(bp3+k, RTjpeg_block, RTjpeg_Cwidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1740 RTjpeg_quant(RTjpeg_block, RTjpeg_cqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1741 if(RTjpeg_bcomp(block, &RTjpeg_cmask))
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1742 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1743 *((__u8 *)sp++)=255;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1744 }
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1745 else sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_cb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1746 block+=64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1747 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1748 bp+=RTjpeg_width<<4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1749 bp1+=RTjpeg_width<<4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1750 bp2+=RTjpeg_width<<2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1751 bp3+=RTjpeg_width<<2;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28853
diff changeset
1752
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1753 }
28298
a7124a264ea6 Completely get rid of MMX define, use HAVE_MMX define instead.
gpoirier
parents: 28296
diff changeset
1754 #if HAVE_MMX
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1755 emms();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1756 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1757 return (sp-sb);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1758 }