annotate libmpcodecs/native/RTjpegN.c @ 22768:7989c3586b9e

add mf://bmp wish, remove deinterlace filter during playback
author compn
date Fri, 23 Mar 2007 01:48:54 +0000
parents cea0eb833758
children b21e1506e50b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1 /*
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2 RTjpeg (C) Justin Schoeman 1998 (justin@suntiger.ee.up.ac.za)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3
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 #ifdef HAVE_MMX
07d5beff8793 enabling mmx support if capable
alex
parents: 3802
diff changeset
30 #define MMX
07d5beff8793 enabling mmx support if capable
alex
parents: 3802
diff changeset
31 #endif
07d5beff8793 enabling mmx support if capable
alex
parents: 3802
diff changeset
32
21372
1767c271d710 Remove bswap.h, use libavutil/bswap.h instead.
diego
parents: 16661
diff changeset
33 #include "libavutil/common.h"
21507
fa99b3d31d13 Hack around libavutil/bswap.h compilation problems due to always_inline undefined.
reimar
parents: 21372
diff changeset
34 #include "mpbswap.h"
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
35 #include "RTjpegN.h"
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
36
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
37 #ifdef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
38 #include "mmx.h"
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
39 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
40
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
41 //#define SHOWBLOCK 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
42 #define BETTERCOMPRESSION 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
43
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
44 static const unsigned char RTjpeg_ZZ[64]={
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
45 0,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
46 8, 1,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
47 2, 9, 16,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
48 24, 17, 10, 3,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
49 4, 11, 18, 25, 32,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
50 40, 33, 26, 19, 12, 5,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
51 6, 13, 20, 27, 34, 41, 48,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
52 56, 49, 42, 35, 28, 21, 14, 7,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
53 15, 22, 29, 36, 43, 50, 57,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
54 58, 51, 44, 37, 30, 23,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
55 31, 38, 45, 52, 59,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
56 60, 53, 46, 39,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
57 47, 54, 61,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
58 62, 55,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
59 63 };
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
60
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
61 static const __u64 RTjpeg_aan_tab[64]={
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
62 4294967296ULL, 5957222912ULL, 5611718144ULL, 5050464768ULL, 4294967296ULL, 3374581504ULL, 2324432128ULL, 1184891264ULL,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
63 5957222912ULL, 8263040512ULL, 7783580160ULL, 7005009920ULL, 5957222912ULL, 4680582144ULL, 3224107520ULL, 1643641088ULL,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
64 5611718144ULL, 7783580160ULL, 7331904512ULL, 6598688768ULL, 5611718144ULL, 4408998912ULL, 3036936960ULL, 1548224000ULL,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
65 5050464768ULL, 7005009920ULL, 6598688768ULL, 5938608128ULL, 5050464768ULL, 3968072960ULL, 2733115392ULL, 1393296000ULL,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
66 4294967296ULL, 5957222912ULL, 5611718144ULL, 5050464768ULL, 4294967296ULL, 3374581504ULL, 2324432128ULL, 1184891264ULL,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
67 3374581504ULL, 4680582144ULL, 4408998912ULL, 3968072960ULL, 3374581504ULL, 2651326208ULL, 1826357504ULL, 931136000ULL,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
68 2324432128ULL, 3224107520ULL, 3036936960ULL, 2733115392ULL, 2324432128ULL, 1826357504ULL, 1258030336ULL, 641204288ULL,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
69 1184891264ULL, 1643641088ULL, 1548224000ULL, 1393296000ULL, 1184891264ULL, 931136000ULL, 641204288ULL, 326894240ULL,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
70 };
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
71
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
72 #ifndef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
73 static __s32 RTjpeg_ws[64+31];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
74 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
75 __u8 RTjpeg_alldata[2*64+4*64+4*64+4*64+4*64+32];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
76
3835
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
77 static __s16 *block; // rh
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
78 static __s16 *RTjpeg_block;
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
79 static __s32 *RTjpeg_lqt;
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
80 static __s32 *RTjpeg_cqt;
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
81 static __u32 *RTjpeg_liqt;
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
82 static __u32 *RTjpeg_ciqt;
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
83
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
84 static unsigned char RTjpeg_lb8;
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
85 static unsigned char RTjpeg_cb8;
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
86 static int RTjpeg_width, RTjpeg_height;
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
87 static int RTjpeg_Ywidth, RTjpeg_Cwidth;
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
88 static int RTjpeg_Ysize, RTjpeg_Csize;
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
89
ab0797fc1215 symbol block is multiply-defined <- fixed
arpi
parents: 3805
diff changeset
90 static __s16 *RTjpeg_old=NULL;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
91
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
92 #ifdef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
93 mmx_t RTjpeg_lmask;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
94 mmx_t RTjpeg_cmask;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
95 #else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
96 __u16 RTjpeg_lmask;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
97 __u16 RTjpeg_cmask;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
98 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
99 int RTjpeg_mtest=0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
100
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
101 static const unsigned char RTjpeg_lum_quant_tbl[64] = {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
102 16, 11, 10, 16, 24, 40, 51, 61,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
103 12, 12, 14, 19, 26, 58, 60, 55,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
104 14, 13, 16, 24, 40, 57, 69, 56,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
105 14, 17, 22, 29, 51, 87, 80, 62,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
106 18, 22, 37, 56, 68, 109, 103, 77,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
107 24, 35, 55, 64, 81, 104, 113, 92,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
108 49, 64, 78, 87, 103, 121, 120, 101,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
109 72, 92, 95, 98, 112, 100, 103, 99
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
110 };
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
111
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
112 static const unsigned char RTjpeg_chrom_quant_tbl[64] = {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
113 17, 18, 24, 47, 99, 99, 99, 99,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
114 18, 21, 26, 66, 99, 99, 99, 99,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
115 24, 26, 56, 99, 99, 99, 99, 99,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
116 47, 66, 99, 99, 99, 99, 99, 99,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
117 99, 99, 99, 99, 99, 99, 99, 99,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
118 99, 99, 99, 99, 99, 99, 99, 99,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
119 99, 99, 99, 99, 99, 99, 99, 99,
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
120 99, 99, 99, 99, 99, 99, 99, 99
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
121 };
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
122
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
123 #ifdef BETTERCOMPRESSION
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
124
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
125 /*--------------------------------------------------*/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
126 /* better encoding, but needs a lot more cpu time */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
127 /* seems to be more effective than old method +lzo */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
128 /* with this encoding lzo isn't efficient anymore */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
129 /* there is still more potential for better */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
130 /* encoding but that would need even more cputime */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
131 /* anyway your mileage may vary */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
132 /* */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
133 /* written by Martin BIELY and Roman HOCHLEITNER */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
134 /*--------------------------------------------------*/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
135
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
136 /* +++++++++++++++++++++++++++++++++++++++++++++++++++*/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
137 /* Block to Stream (encoding) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
138 /* */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
139
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
140 int RTjpeg_b2s(__s16 *data, __s8 *strm, __u8 bt8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
141 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
142 register int ci, co=1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
143 register __s16 ZZvalue;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
144 register unsigned char bitten;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
145 register unsigned char bitoff;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
146
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
147 #ifdef SHOWBLOCK
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
148
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
149 int ii;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
150 for (ii=0; ii < 64; ii++) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
151 fprintf(stdout, "%d ", data[RTjpeg_ZZ[ii]]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
152 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
153 fprintf(stdout, "\n\n");
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
154
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
155 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
156
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
157 // *strm++ = 0x10;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
158 // *strm = 0x00;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
159 //
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
160 // return 2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
161
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
162 // first byte allways written
12378
649f596054e0 more lvalue casts, ugly this time
rfelker
parents: 9763
diff changeset
163 ((__u8*)strm)[0]=
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
164 (__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
165
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
166
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
167 ci=63;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
168 while (data[RTjpeg_ZZ[ci]]==0 && ci>0) ci--;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
169
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
170 bitten = ((unsigned char)ci) << 2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
171
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
172 if (ci==0) {
12378
649f596054e0 more lvalue casts, ugly this time
rfelker
parents: 9763
diff changeset
173 ((__u8*)strm)[1]= bitten;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
174 co = 2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
175 return (int)co;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
176 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
177
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
178 /* bitoff=0 because the high 6bit contain first non zero position */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
179 bitoff = 0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
180 co = 1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
181
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
182 for(; ci>0; ci--) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
183
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
184 ZZvalue = data[RTjpeg_ZZ[ci]];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
185
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
186 switch(ZZvalue) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
187 case 0:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
188 break;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
189 case 1:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
190 bitten |= (0x01<<bitoff);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
191 break;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
192 case -1:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
193 bitten |= (0x03<<bitoff);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
194 break;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
195 default:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
196 bitten |= (0x02<<bitoff);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
197 goto HERZWEH;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
198 break;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
199 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
200
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
201 if( bitoff == 0 ) {
12378
649f596054e0 more lvalue casts, ugly this time
rfelker
parents: 9763
diff changeset
202 ((__u8*)strm)[co]= bitten;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
203 bitten = 0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
204 bitoff = 8;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
205 co++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
206 } /* "fall through" */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
207 bitoff-=2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
208
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
209 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
210
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
211 /* ci must be 0 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
212 if(bitoff != 6) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
213
12378
649f596054e0 more lvalue casts, ugly this time
rfelker
parents: 9763
diff changeset
214 ((__u8*)strm)[co]= bitten;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
215 co++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
216
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
217 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
218 goto BAUCHWEH;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
219
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
220 HERZWEH:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
221 /* ci cannot be 0 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
222 /* correct bitoff to nibble boundaries */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
223
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
224 switch(bitoff){
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
225 case 4:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
226 case 6:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
227 bitoff = 0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
228 break;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
229 case 2:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
230 case 0:
12378
649f596054e0 more lvalue casts, ugly this time
rfelker
parents: 9763
diff changeset
231 ((__u8*)strm)[co]= bitten;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
232 bitoff = 4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
233 co++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
234 bitten = 0; // clear half nibble values in bitten
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
235 break;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
236 default:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
237 break;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
238 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
239
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
240 for(; ci>0; ci--) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
241
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
242 ZZvalue = data[RTjpeg_ZZ[ci]];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
243
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
244 if( (ZZvalue > 7) || (ZZvalue < -7) ) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
245 bitten |= (0x08<<bitoff);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
246 goto HIRNWEH;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
247 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
248
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
249 bitten |= (ZZvalue&0xf)<<bitoff;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
250
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
251 if( bitoff == 0 ) {
12378
649f596054e0 more lvalue casts, ugly this time
rfelker
parents: 9763
diff changeset
252 ((__u8*)strm)[co]= bitten;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
253 bitten = 0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
254 bitoff = 8;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
255 co++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
256 } /* "fall thru" */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
257 bitoff-=4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
258 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
259
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
260 /* ci must be 0 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
261 if( bitoff == 0 ) {
12378
649f596054e0 more lvalue casts, ugly this time
rfelker
parents: 9763
diff changeset
262 ((__u8*)strm)[co]= bitten;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
263 co++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
264 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
265 goto BAUCHWEH;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
266
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
267 HIRNWEH:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
268
12378
649f596054e0 more lvalue casts, ugly this time
rfelker
parents: 9763
diff changeset
269 ((__u8*)strm)[co]= bitten;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
270 co++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
271
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
272
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
273 /* bitting is over now we bite */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
274 for(; ci>0; ci--) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
275
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
276 ZZvalue = data[RTjpeg_ZZ[ci]];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
277
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
278 if(ZZvalue>0)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
279 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
280 strm[co++]=(__s8)(ZZvalue>127)?127:ZZvalue;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
281 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
282 else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
283 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
284 strm[co++]=(__s8)(ZZvalue<-128)?-128:ZZvalue;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
285 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
286
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
287 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
288
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
289
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
290 BAUCHWEH:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
291 /* we gotoo much now we are ill */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
292 #ifdef SHOWBLOCK
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
293 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
294 int i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
295 fprintf(stdout, "\nco = '%d'\n", co);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
296 for (i=0; i < co+2; i++) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
297 fprintf(stdout, "%d ", strm[i]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
298 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
299 fprintf(stdout, "\n\n");
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
300 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
301 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
302
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
303 return (int)co;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
304 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
305
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
306 /* +++++++++++++++++++++++++++++++++++++++++++++++++++*/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
307 /* Stream to Block (decoding) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
308 /* */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
309
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
310 int RTjpeg_s2b(__s16 *data, __s8 *strm, __u8 bt8, __u32 *qtbl)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
311 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
312 int ci;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
313 register int co;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
314 register int i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
315 register unsigned char bitten;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
316 register unsigned char bitoff;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
317
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
318 /* first byte always read */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
319 i=RTjpeg_ZZ[0];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
320 data[i]=((__u8)strm[0])*qtbl[i];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
321
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
322 /* we start at the behind */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
323
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
324 bitten = ((unsigned char)strm[1]) >> 2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
325 co = 63;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
326 for(; co > bitten; co--) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
327
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
328 data[RTjpeg_ZZ[co]] = 0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
329
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
330 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
331
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
332 if (co==0) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
333 ci = 2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
334 goto AUTOBAHN;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
335 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
336
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
337 /* we have to read the last 2 bits of the second byte */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
338 ci=1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
339 bitoff = 0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
340
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
341 for(; co>0; co--) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
342
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
343 bitten = ((unsigned char)strm[ci]) >> bitoff;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
344 bitten &= 0x03;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
345
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
346 i=RTjpeg_ZZ[co];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
347
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
348 switch( bitten ) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
349 case 0x03:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
350 data[i]= -qtbl[i];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
351 break;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
352 case 0x02:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
353 goto FUSSWEG;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
354 break;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
355 case 0x01:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
356 data[i]= qtbl[i];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
357 break;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
358 case 0x00:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
359 data[i]= 0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
360 break;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
361 default:
6335
e9bd97d5c5cc warning & newline fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents: 5602
diff changeset
362 break;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
363 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
364
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
365 if( bitoff == 0 ) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
366 bitoff = 8;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
367 ci++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
368 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
369 bitoff -= 2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
370 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
371 /* co is 0 now */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
372 /* data is written properly */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
373
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
374 /* if bitoff!=6 then ci is the index, but should be the byte count, so we increment by 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
375 if (bitoff!=6) ci++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
376
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
377 goto AUTOBAHN;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
378
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
379
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
380 FUSSWEG:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
381 /* correct bitoff to nibble */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
382 switch(bitoff){
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
383 case 4:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
384 case 6:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
385 bitoff = 0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
386 break;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
387 case 2:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
388 case 0:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
389 /* we have to read from the next byte */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
390 ci++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
391 bitoff = 4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
392 break;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
393 default:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
394 break;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
395 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
396
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
397 for(; co>0; co--) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
398
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
399 bitten = ((unsigned char)strm[ci]) >> bitoff;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
400 bitten &= 0x0f;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
401
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
402 i=RTjpeg_ZZ[co];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
403
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
404 if( bitten == 0x08 ) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
405 goto STRASSE;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
406 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
407
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
408 /* the compiler cannot do sign extension for signed nibbles */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
409 if( bitten & 0x08 ) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
410 bitten |= 0xf0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
411 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
412 /* the unsigned char bitten now is a valid signed char */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
413
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
414 data[i]=((signed char)bitten)*qtbl[i];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
415
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
416 if( bitoff == 0 ) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
417 bitoff = 8;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
418 ci++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
419 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
420 bitoff -= 4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
421 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
422 /* co is 0 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
423
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
424 /* if bitoff!=4 then ci is the index, but should be the byte count, so we increment by 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
425 if (bitoff!=4) ci++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
426
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
427 goto AUTOBAHN;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
428
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
429 STRASSE:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
430 ci++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
431
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
432 for(; co>0; co--) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
433 i=RTjpeg_ZZ[co];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
434 data[i]=strm[ci++]*qtbl[i];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
435 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
436
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
437 /* ci now is the count, because it points to next element => no incrementing */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
438
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
439 AUTOBAHN:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
440
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
441 #ifdef SHOWBLOCK
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
442 fprintf(stdout, "\nci = '%d'\n", ci);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
443 for (i=0; i < 64; i++) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
444 fprintf(stdout, "%d ", data[RTjpeg_ZZ[i]]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
445 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
446 fprintf(stdout, "\n\n");
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
447 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
448
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
449 return ci;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
450 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
451
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
452 #else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
453
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
454 int RTjpeg_b2s(__s16 *data, __s8 *strm, __u8 bt8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
455 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
456 register int ci, co=1, tmp;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
457 register __s16 ZZvalue;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
458
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
459 #ifdef SHOWBLOCK
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
460
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
461 int ii;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
462 for (ii=0; ii < 64; ii++) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
463 fprintf(stdout, "%d ", data[RTjpeg_ZZ[ii]]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
464 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
465 fprintf(stdout, "\n\n");
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
466
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
467 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
468
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
469 (__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
470
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
471 for(ci=1; ci<=bt8; ci++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
472 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
473 ZZvalue = data[RTjpeg_ZZ[ci]];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
474
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
475 if(ZZvalue>0)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
476 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
477 strm[co++]=(__s8)(ZZvalue>127)?127:ZZvalue;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
478 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
479 else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
480 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
481 strm[co++]=(__s8)(ZZvalue<-128)?-128:ZZvalue;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
482 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
483 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
484
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
485 for(; ci<64; ci++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
486 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
487 ZZvalue = data[RTjpeg_ZZ[ci]];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
488
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
489 if(ZZvalue>0)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
490 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
491 strm[co++]=(__s8)(ZZvalue>63)?63:ZZvalue;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
492 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
493 else if(ZZvalue<0)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
494 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
495 strm[co++]=(__s8)(ZZvalue<-64)?-64:ZZvalue;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
496 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
497 else /* compress zeros */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
498 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
499 tmp=ci;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
500 do
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
501 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
502 ci++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
503 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
504 while((ci<64)&&(data[RTjpeg_ZZ[ci]]==0));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
505
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
506 strm[co++]=(__s8)(63+(ci-tmp));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
507 ci--;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
508 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
509 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
510 return (int)co;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
511 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
512
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
513 int RTjpeg_s2b(__s16 *data, __s8 *strm, __u8 bt8, __u32 *qtbl)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
514 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
515 int ci=1, co=1, tmp;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
516 register int i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
517
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
518 i=RTjpeg_ZZ[0];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
519 data[i]=((__u8)strm[0])*qtbl[i];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
520
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
521 for(co=1; co<=bt8; co++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
522 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
523 i=RTjpeg_ZZ[co];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
524 data[i]=strm[ci++]*qtbl[i];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
525 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
526
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
527 for(; co<64; co++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
528 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
529 if(strm[ci]>63)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
530 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
531 tmp=co+strm[ci]-63;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
532 for(; co<tmp; co++)data[RTjpeg_ZZ[co]]=0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
533 co--;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
534 } else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
535 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
536 i=RTjpeg_ZZ[co];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
537 data[i]=strm[ci]*qtbl[i];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
538 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
539 ci++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
540 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
541 return (int)ci;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
542 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
543 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
544
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
545 #if defined(MMX)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
546 void RTjpeg_quant_init(void)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
547 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
548 int i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
549 __s16 *qtbl;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
550
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
551 qtbl=(__s16 *)RTjpeg_lqt;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
552 for(i=0; i<64; i++)qtbl[i]=(__s16)RTjpeg_lqt[i];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
553
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
554 qtbl=(__s16 *)RTjpeg_cqt;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
555 for(i=0; i<64; i++)qtbl[i]=(__s16)RTjpeg_cqt[i];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
556 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
557
12928
bc760f3f129e ICC 8.0 compilation fixes
atmos4
parents: 12378
diff changeset
558 static mmx_t RTjpeg_ones={0x0001000100010001LL};
bc760f3f129e ICC 8.0 compilation fixes
atmos4
parents: 12378
diff changeset
559 static mmx_t RTjpeg_half={0x7fff7fff7fff7fffLL};
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
560
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
561 void RTjpeg_quant(__s16 *block, __s32 *qtbl)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
562 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
563 int i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
564 mmx_t *bl, *ql;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
565
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
566 ql=(mmx_t *)qtbl;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
567 bl=(mmx_t *)block;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
568
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
569 movq_m2r(RTjpeg_ones, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
570 movq_m2r(RTjpeg_half, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
571
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
572 for(i=16; i; i--)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
573 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
574 movq_m2r(*(ql++), mm0); /* quant vals (4) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
575 movq_m2r(*bl, mm2); /* block vals (4) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
576 movq_r2r(mm0, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
577 movq_r2r(mm2, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
578
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
579 punpcklwd_r2r(mm6, mm0); /* 1 qb 1 qa */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
580 punpckhwd_r2r(mm6, mm1); /* 1 qd 1 qc */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
581
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
582 punpcklwd_r2r(mm7, mm2); /* 32767 bb 32767 ba */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
583 punpckhwd_r2r(mm7, mm3); /* 32767 bd 32767 bc */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
584
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
585 pmaddwd_r2r(mm2, mm0); /* 32767+bb*qb 32767+ba*qa */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
586 pmaddwd_r2r(mm3, mm1); /* 32767+bd*qd 32767+bc*qc */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
587
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
588 psrad_i2r(16, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
589 psrad_i2r(16, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
590
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
591 packssdw_r2r(mm1, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
592
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
593 movq_r2m(mm0, *(bl++));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
594
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
595 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
596 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
597 #else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
598 void RTjpeg_quant_init(void)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
599 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
600 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
601
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
602 void RTjpeg_quant(__s16 *block, __s32 *qtbl)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
603 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
604 int i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
605
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
606 for(i=0; i<64; i++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
607 block[i]=(__s16)((block[i]*qtbl[i]+32767)>>16);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
608 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
609 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
610
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
611 /*
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
612 * Perform the forward DCT on one block of samples.
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
613 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
614 #ifdef MMX
12928
bc760f3f129e ICC 8.0 compilation fixes
atmos4
parents: 12378
diff changeset
615 static mmx_t RTjpeg_C4 ={0x2D412D412D412D41LL};
bc760f3f129e ICC 8.0 compilation fixes
atmos4
parents: 12378
diff changeset
616 static mmx_t RTjpeg_C6 ={0x187E187E187E187ELL};
bc760f3f129e ICC 8.0 compilation fixes
atmos4
parents: 12378
diff changeset
617 static mmx_t RTjpeg_C2mC6={0x22A322A322A322A3LL};
bc760f3f129e ICC 8.0 compilation fixes
atmos4
parents: 12378
diff changeset
618 static mmx_t RTjpeg_C2pC6={0x539F539F539F539FLL};
bc760f3f129e ICC 8.0 compilation fixes
atmos4
parents: 12378
diff changeset
619 static mmx_t RTjpeg_zero ={0x0000000000000000LL};
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
620
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
621 #else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
622
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
623 #define FIX_0_382683433 ((__s32) 98) /* FIX(0.382683433) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
624 #define FIX_0_541196100 ((__s32) 139) /* FIX(0.541196100) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
625 #define FIX_0_707106781 ((__s32) 181) /* FIX(0.707106781) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
626 #define FIX_1_306562965 ((__s32) 334) /* FIX(1.306562965) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
627
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
628 #define DESCALE10(x) (__s16)( ((x)+128) >> 8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
629 #define DESCALE20(x) (__s16)(((x)+32768) >> 16)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
630 #define D_MULTIPLY(var,const) ((__s32) ((var) * (const)))
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
631 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
632
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
633 void RTjpeg_dct_init(void)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
634 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
635 int i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
636
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
637 for(i=0; i<64; i++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
638 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
639 RTjpeg_lqt[i]=(((__u64)RTjpeg_lqt[i]<<32)/RTjpeg_aan_tab[i]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
640 RTjpeg_cqt[i]=(((__u64)RTjpeg_cqt[i]<<32)/RTjpeg_aan_tab[i]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
641 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
642 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
643
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
644 void RTjpeg_dctY(__u8 *idata, __s16 *odata, int rskip)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
645 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
646 #ifndef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
647 __s32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
648 __s32 tmp10, tmp11, tmp12, tmp13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
649 __s32 z1, z2, z3, z4, z5, z11, z13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
650 __u8 *idataptr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
651 __s16 *odataptr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
652 __s32 *wsptr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
653 int ctr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
654
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
655 idataptr = idata;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
656 wsptr = RTjpeg_ws;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
657 for (ctr = 7; ctr >= 0; ctr--) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
658 tmp0 = idataptr[0] + idataptr[7];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
659 tmp7 = idataptr[0] - idataptr[7];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
660 tmp1 = idataptr[1] + idataptr[6];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
661 tmp6 = idataptr[1] - idataptr[6];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
662 tmp2 = idataptr[2] + idataptr[5];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
663 tmp5 = idataptr[2] - idataptr[5];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
664 tmp3 = idataptr[3] + idataptr[4];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
665 tmp4 = idataptr[3] - idataptr[4];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
666
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
667 tmp10 = (tmp0 + tmp3); /* phase 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
668 tmp13 = tmp0 - tmp3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
669 tmp11 = (tmp1 + tmp2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
670 tmp12 = tmp1 - tmp2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
671
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
672 wsptr[0] = (tmp10 + tmp11)<<8; /* phase 3 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
673 wsptr[4] = (tmp10 - tmp11)<<8;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
674
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
675 z1 = D_MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
676 wsptr[2] = (tmp13<<8) + z1; /* phase 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
677 wsptr[6] = (tmp13<<8) - z1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
678
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
679 tmp10 = tmp4 + tmp5; /* phase 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
680 tmp11 = tmp5 + tmp6;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
681 tmp12 = tmp6 + tmp7;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
682
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
683 z5 = D_MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
684 z2 = D_MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
685 z4 = D_MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
686 z3 = D_MULTIPLY(tmp11, FIX_0_707106781); /* c4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
687
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
688 z11 = (tmp7<<8) + z3; /* phase 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
689 z13 = (tmp7<<8) - z3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
690
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
691 wsptr[5] = z13 + z2; /* phase 6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
692 wsptr[3] = z13 - z2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
693 wsptr[1] = z11 + z4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
694 wsptr[7] = z11 - z4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
695
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
696 idataptr += rskip<<3; /* advance pointer to next row */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
697 wsptr += 8;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
698 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
699
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
700 wsptr = RTjpeg_ws;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
701 odataptr=odata;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
702 for (ctr = 7; ctr >= 0; ctr--) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
703 tmp0 = wsptr[0] + wsptr[56];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
704 tmp7 = wsptr[0] - wsptr[56];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
705 tmp1 = wsptr[8] + wsptr[48];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
706 tmp6 = wsptr[8] - wsptr[48];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
707 tmp2 = wsptr[16] + wsptr[40];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
708 tmp5 = wsptr[16] - wsptr[40];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
709 tmp3 = wsptr[24] + wsptr[32];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
710 tmp4 = wsptr[24] - wsptr[32];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
711
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
712 tmp10 = tmp0 + tmp3; /* phase 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
713 tmp13 = tmp0 - tmp3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
714 tmp11 = tmp1 + tmp2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
715 tmp12 = tmp1 - tmp2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
716
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
717 odataptr[0] = DESCALE10(tmp10 + tmp11); /* phase 3 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
718 odataptr[32] = DESCALE10(tmp10 - tmp11);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
719
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
720 z1 = D_MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
721 odataptr[16] = DESCALE20((tmp13<<8) + z1); /* phase 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
722 odataptr[48] = DESCALE20((tmp13<<8) - z1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
723
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
724 tmp10 = tmp4 + tmp5; /* phase 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
725 tmp11 = tmp5 + tmp6;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
726 tmp12 = tmp6 + tmp7;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
727
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
728 z5 = D_MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
729 z2 = D_MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
730 z4 = D_MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
731 z3 = D_MULTIPLY(tmp11, FIX_0_707106781); /* c4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
732
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
733 z11 = (tmp7<<8) + z3; /* phase 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
734 z13 = (tmp7<<8) - z3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
735
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
736 odataptr[40] = DESCALE20(z13 + z2); /* phase 6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
737 odataptr[24] = DESCALE20(z13 - z2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
738 odataptr[8] = DESCALE20(z11 + z4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
739 odataptr[56] = DESCALE20(z11 - z4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
740
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
741 odataptr++; /* advance pointer to next column */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
742 wsptr++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
743 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
744 #else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
745 volatile mmx_t tmp6, tmp7;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
746 register mmx_t *dataptr = (mmx_t *)odata;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
747 mmx_t *idata2 = (mmx_t *)idata;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
748
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
749 // first copy the input 8 bit to the destination 16 bits
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
750
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
751 movq_m2r(RTjpeg_zero, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
752
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
753
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
754 movq_m2r(*idata2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
755 movq_r2r(mm0, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
756
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
757 punpcklbw_r2r(mm2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
758 movq_r2m(mm0, *(dataptr));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
759
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
760 punpckhbw_r2r(mm2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
761 movq_r2m(mm1, *(dataptr+1));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
762
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
763 idata2 += rskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
764
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
765 movq_m2r(*idata2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
766 movq_r2r(mm0, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
767
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
768 punpcklbw_r2r(mm2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
769 movq_r2m(mm0, *(dataptr+2));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
770
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
771 punpckhbw_r2r(mm2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
772 movq_r2m(mm1, *(dataptr+3));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
773
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
774 idata2 += rskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
775
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
776 movq_m2r(*idata2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
777 movq_r2r(mm0, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
778
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
779 punpcklbw_r2r(mm2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
780 movq_r2m(mm0, *(dataptr+4));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
781
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
782 punpckhbw_r2r(mm2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
783 movq_r2m(mm1, *(dataptr+5));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
784
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
785 idata2 += rskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
786
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
787 movq_m2r(*idata2, mm0);
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 punpcklbw_r2r(mm2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
791 movq_r2m(mm0, *(dataptr+6));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
792
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
793 punpckhbw_r2r(mm2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
794 movq_r2m(mm1, *(dataptr+7));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
795
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
796 idata2 += rskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
797
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
798 movq_m2r(*idata2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
799 movq_r2r(mm0, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
800
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
801 punpcklbw_r2r(mm2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
802 movq_r2m(mm0, *(dataptr+8));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
803
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
804 punpckhbw_r2r(mm2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
805 movq_r2m(mm1, *(dataptr+9));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
806
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
807 idata2 += rskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
808
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
809 movq_m2r(*idata2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
810 movq_r2r(mm0, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
811
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
812 punpcklbw_r2r(mm2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
813 movq_r2m(mm0, *(dataptr+10));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
814
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
815 punpckhbw_r2r(mm2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
816 movq_r2m(mm1, *(dataptr+11));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
817
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
818 idata2 += rskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
819
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
820 movq_m2r(*idata2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
821 movq_r2r(mm0, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
822
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
823 punpcklbw_r2r(mm2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
824 movq_r2m(mm0, *(dataptr+12));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
825
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
826 punpckhbw_r2r(mm2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
827 movq_r2m(mm1, *(dataptr+13));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
828
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
829 idata2 += rskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
830
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
831 movq_m2r(*idata2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
832 movq_r2r(mm0, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
833
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
834 punpcklbw_r2r(mm2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
835 movq_r2m(mm0, *(dataptr+14));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
836
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
837 punpckhbw_r2r(mm2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
838 movq_r2m(mm1, *(dataptr+15));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
839
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
840 /* Start Transpose to do calculations on rows */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
841
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
842 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
843
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
844 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
845 movq_r2r(mm7, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
846
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
847 punpcklwd_m2r(*(dataptr+11), mm7); // m11:m01|m10:m00 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
848 movq_r2r(mm6, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
849
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
850 punpcklwd_m2r(*(dataptr+15), mm6); // m31:m21|m30:m20 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
851 movq_r2r(mm7, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
852
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
853 movq_m2r(*(dataptr+11), mm3); // m13:m13|m11:m10 - second line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
854 punpckldq_r2r(mm6, mm7); // m30:m20|m10:m00 - interleave to produce result 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
855
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
856 movq_m2r(*(dataptr+15), mm0); // m13:m13|m11:m10 - fourth line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
857 punpckhdq_r2r(mm6, mm1); // m31:m21|m11:m01 - interleave to produce result 2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
858
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
859 movq_r2m(mm7,*(dataptr+9)); // write result 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
860 punpckhwd_r2r(mm3, mm5); // m13:m03|m12:m02 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
861
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
862 movq_r2m(mm1,*(dataptr+11)); // write result 2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
863 punpckhwd_r2r(mm0, mm2); // m33:m23|m32:m22 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
864
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
865 movq_r2r(mm5, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
866 punpckldq_r2r(mm2, mm5); // m32:m22|m12:m02 - interleave to produce result 3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
867
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
868 movq_m2r(*(dataptr+1), mm0); // m03:m02|m01:m00 - first line, 4x4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
869 punpckhdq_r2r(mm2, mm1); // m33:m23|m13:m03 - interleave to produce result 4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
870
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
871 movq_r2m(mm5,*(dataptr+13)); // write result 3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
872
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
873 // last 4x4 done
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
874
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
875 movq_r2m(mm1, *(dataptr+15)); // write result 4, last 4x4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
876
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
877 movq_m2r(*(dataptr+5), mm2); // m23:m22|m21:m20 - third line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
878 movq_r2r(mm0, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
879
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
880 punpcklwd_m2r(*(dataptr+3), mm0); // m11:m01|m10:m00 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
881 movq_r2r(mm2, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
882
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
883 punpcklwd_m2r(*(dataptr+7), mm2); // m31:m21|m30:m20 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
884 movq_r2r(mm0, mm4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
885
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
886 //
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
887 movq_m2r(*(dataptr+8), mm1); // n03:n02|n01:n00 - first line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
888 punpckldq_r2r(mm2, mm0); // m30:m20|m10:m00 - interleave to produce first result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
889
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
890 movq_m2r(*(dataptr+12), mm3); // n23:n22|n21:n20 - third line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
891 punpckhdq_r2r(mm2, mm4); // m31:m21|m11:m01 - interleave to produce second result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
892
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
893 punpckhwd_m2r(*(dataptr+3), mm6); // m13:m03|m12:m02 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
894 movq_r2r(mm1, mm2); // copy first line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
895
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
896 punpckhwd_m2r(*(dataptr+7), mm7); // m33:m23|m32:m22 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
897 movq_r2r(mm6, mm5); // copy first intermediate result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
898
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
899 movq_r2m(mm0, *(dataptr+8)); // write result 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
900 punpckhdq_r2r(mm7, mm5); // m33:m23|m13:m03 - produce third result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
901
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
902 punpcklwd_m2r(*(dataptr+10), mm1); // n11:n01|n10:n00 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
903 movq_r2r(mm3, mm0); // copy third line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
904
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
905 punpckhwd_m2r(*(dataptr+10), mm2); // n13:n03|n12:n02 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
906
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
907 movq_r2m(mm4, *(dataptr+10)); // write result 2 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
908 punpckldq_r2r(mm7, mm6); // m32:m22|m12:m02 - produce fourth result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
909
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
910 punpcklwd_m2r(*(dataptr+14), mm3); // n31:n21|n30:n20 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
911 movq_r2r(mm1, mm4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
912
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
913 movq_r2m(mm6, *(dataptr+12)); // write result 3 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
914 punpckldq_r2r(mm3, mm1); // n30:n20|n10:n00 - produce first result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
915
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
916 punpckhwd_m2r(*(dataptr+14), mm0); // n33:n23|n32:n22 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
917 movq_r2r(mm2, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
918
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
919 movq_r2m(mm5, *(dataptr+14)); // write result 4 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
920 punpckhdq_r2r(mm3, mm4); // n31:n21|n11:n01- produce second result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
921
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
922 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
923 punpckldq_r2r(mm0, mm2); // n32:n22|n12:n02- produce third result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
924
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
925 movq_r2m(mm4, *(dataptr+3)); // write result 6 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
926 punpckhdq_r2r(mm0, mm6); // n33:n23|n13:n03 - produce fourth result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
927
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
928 movq_r2m(mm2, *(dataptr+5)); // write result 7 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
929
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
930 movq_m2r(*dataptr, mm0); // m03:m02|m01:m00 - first line, first 4x4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
931
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
932 movq_r2m(mm6, *(dataptr+7)); // write result 8 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
933
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
934
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
935 // Do first 4x4 quadrant, which is used in the beginning of the DCT:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
936
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
937 movq_m2r(*(dataptr+4), mm7); // m23:m22|m21:m20 - third line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
938 movq_r2r(mm0, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
939
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
940 punpcklwd_m2r(*(dataptr+2), mm0); // m11:m01|m10:m00 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
941 movq_r2r(mm7, mm4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
942
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
943 punpcklwd_m2r(*(dataptr+6), mm7); // m31:m21|m30:m20 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
944 movq_r2r(mm0, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
945
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
946 movq_m2r(*(dataptr+2), mm6); // m13:m12|m11:m10 - second line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
947 punpckldq_r2r(mm7, mm0); // m30:m20|m10:m00 - interleave to produce result 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
948
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
949 movq_m2r(*(dataptr+6), mm5); // m33:m32|m31:m30 - fourth line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
950 punpckhdq_r2r(mm7, mm1); // m31:m21|m11:m01 - interleave to produce result 2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
951
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
952 movq_r2r(mm0, mm7); // write result 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
953 punpckhwd_r2r(mm6, mm2); // m13:m03|m12:m02 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
954
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
955 psubw_m2r(*(dataptr+14), mm7); // tmp07=x0-x7 /* Stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
956 movq_r2r(mm1, mm6); // write result 2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
957
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
958 paddw_m2r(*(dataptr+14), mm0); // tmp00=x0+x7 /* Stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
959 punpckhwd_r2r(mm5, mm4); // m33:m23|m32:m22 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
960
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
961 paddw_m2r(*(dataptr+12), mm1); // tmp01=x1+x6 /* Stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
962 movq_r2r(mm2, mm3); // copy first intermediate result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
963
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
964 psubw_m2r(*(dataptr+12), mm6); // tmp06=x1-x6 /* Stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
965 punpckldq_r2r(mm4, mm2); // m32:m22|m12:m02 - interleave to produce result 3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
966
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
967 movq_r2m(mm7, tmp7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
968 movq_r2r(mm2, mm5); // write result 3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
969
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
970 movq_r2m(mm6, tmp6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
971 punpckhdq_r2r(mm4, mm3); // m33:m23|m13:m03 - interleave to produce result 4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
972
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
973 paddw_m2r(*(dataptr+10), mm2); // tmp02=x2+5 /* Stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
974 movq_r2r(mm3, mm4); // write result 4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
975
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
976 /************************************************************************************************
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
977 End of Transpose
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
978 ************************************************************************************************/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
979
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
980
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
981 paddw_m2r(*(dataptr+8), mm3); // tmp03=x3+x4 /* stage 1*/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
982 movq_r2r(mm0, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
983
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
984 psubw_m2r(*(dataptr+8), mm4); // tmp04=x3-x4 /* stage 1*/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
985 movq_r2r(mm1, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
986
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
987 paddw_r2r(mm3, mm0); // tmp10 = tmp00 + tmp03 /* even 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
988 psubw_r2r(mm3, mm7); // tmp13 = tmp00 - tmp03 /* even 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
989
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
990 psubw_r2r(mm2, mm6); // tmp12 = tmp01 - tmp02 /* even 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
991 paddw_r2r(mm2, mm1); // tmp11 = tmp01 + tmp02 /* even 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
992
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
993 psubw_m2r(*(dataptr+10), mm5); // tmp05=x2-x5 /* stage 1*/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
994 paddw_r2r(mm7, mm6); // tmp12 + tmp13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
995
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
996 /* stage 3 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
997
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
998 movq_m2r(tmp6, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
999 movq_r2r(mm0, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1000
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1001 psllw_i2r(2, mm6); // m8 * 2^2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1002 paddw_r2r(mm1, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1003
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1004 pmulhw_m2r(RTjpeg_C4, mm6); // z1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1005 psubw_r2r(mm1, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1006
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1007 movq_r2m(mm0, *dataptr);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1008 movq_r2r(mm7, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1009
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1010 /* Odd part */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1011 movq_r2m(mm3, *(dataptr+8));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1012 paddw_r2r(mm5, mm4); // tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1013
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1014 movq_m2r(tmp7, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1015 paddw_r2r(mm6, mm0); // tmp32
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1016
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1017 paddw_r2r(mm2, mm5); // tmp11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1018 psubw_r2r(mm6, mm7); // tmp33
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1019
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1020 movq_r2m(mm0, *(dataptr+4));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1021 paddw_r2r(mm3, mm2); // tmp12
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1022
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1023 /* stage 4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1024
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1025 movq_r2m(mm7, *(dataptr+12));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1026 movq_r2r(mm4, mm1); // copy of tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1027
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1028 psubw_r2r(mm2, mm1); // tmp10 - tmp12
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1029 psllw_i2r(2, mm4); // m8 * 2^2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1030
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1031 movq_m2r(RTjpeg_C2mC6, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1032 psllw_i2r(2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1033
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1034 pmulhw_m2r(RTjpeg_C6, mm1); // z5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1035 psllw_i2r(2, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1036
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1037 pmulhw_r2r(mm0, mm4); // z5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1038
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1039 /* stage 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1040
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1041 pmulhw_m2r(RTjpeg_C2pC6, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1042 psllw_i2r(2, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1043
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1044 pmulhw_m2r(RTjpeg_C4, mm5); // z3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1045 movq_r2r(mm3, mm0); // copy tmp7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1046
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1047 movq_m2r(*(dataptr+1), mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1048 paddw_r2r(mm1, mm4); // z2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1049
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1050 paddw_r2r(mm1, mm2); // z4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1051
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1052 paddw_r2r(mm5, mm0); // z11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1053 psubw_r2r(mm5, mm3); // z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1054
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1055 /* stage 6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1056
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1057 movq_r2r(mm3, mm5); // copy z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1058 psubw_r2r(mm4, mm3); // y3=z13 - z2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1059
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1060 paddw_r2r(mm4, mm5); // y5=z13 + z2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1061 movq_r2r(mm0, mm6); // copy z11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1062
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1063 movq_r2m(mm3, *(dataptr+6)); //save y3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1064 psubw_r2r(mm2, mm0); // y7=z11 - z4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1065
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1066 movq_r2m(mm5, *(dataptr+10)); //save y5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1067 paddw_r2r(mm2, mm6); // y1=z11 + z4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1068
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1069 movq_r2m(mm0, *(dataptr+14)); //save y7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1070
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1071 /************************************************
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1072 * End of 1st 4 rows
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1073 ************************************************/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1074
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1075 movq_m2r(*(dataptr+3), mm1); // load x1 /* stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1076 movq_r2r(mm7, mm0); // copy x0
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1077
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1078 movq_r2m(mm6, *(dataptr+2)); //save y1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1079
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1080 movq_m2r(*(dataptr+5), mm2); // load x2 /* stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1081 movq_r2r(mm1, mm6); // copy x1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1082
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1083 paddw_m2r(*(dataptr+15), mm0); // tmp00 = x0 + x7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1084
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1085 movq_m2r(*(dataptr+7), mm3); // load x3 /* stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1086 movq_r2r(mm2, mm5); // copy x2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1087
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1088 psubw_m2r(*(dataptr+15), mm7); // tmp07 = x0 - x7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1089 movq_r2r(mm3, mm4); // copy x3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1090
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1091 paddw_m2r(*(dataptr+13), mm1); // tmp01 = x1 + x6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1092
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1093 movq_r2m(mm7, tmp7); // save tmp07
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1094 movq_r2r(mm0, mm7); // copy tmp00
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1095
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1096 psubw_m2r(*(dataptr+13), mm6); // tmp06 = x1 - x6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1097
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1098 /* stage 2, Even Part */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1099
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1100 paddw_m2r(*(dataptr+9), mm3); // tmp03 = x3 + x4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1101
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1102 movq_r2m(mm6, tmp6); // save tmp07
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1103 movq_r2r(mm1, mm6); // copy tmp01
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1104
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1105 paddw_m2r(*(dataptr+11), mm2); // tmp02 = x2 + x5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1106 paddw_r2r(mm3, mm0); // tmp10 = tmp00 + tmp03
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1107
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1108 psubw_r2r(mm3, mm7); // tmp13 = tmp00 - tmp03
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1109
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1110 psubw_m2r(*(dataptr+9), mm4); // tmp04 = x3 - x4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1111 psubw_r2r(mm2, mm6); // tmp12 = tmp01 - tmp02
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1112
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1113 paddw_r2r(mm2, mm1); // tmp11 = tmp01 + tmp02
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1114
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1115 psubw_m2r(*(dataptr+11), mm5); // tmp05 = x2 - x5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1116 paddw_r2r(mm7, mm6); // tmp12 + tmp13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1117
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1118 /* stage 3, Even and stage 4 & 5 even */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1119
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1120 movq_m2r(tmp6, mm2); // load tmp6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1121 movq_r2r(mm0, mm3); // copy tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1122
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1123 psllw_i2r(2, mm6); // shift z1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1124 paddw_r2r(mm1, mm0); // y0=tmp10 + tmp11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1125
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1126 pmulhw_m2r(RTjpeg_C4, mm6); // z1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1127 psubw_r2r(mm1, mm3); // y4=tmp10 - tmp11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1128
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1129 movq_r2m(mm0, *(dataptr+1)); //save y0
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1130 movq_r2r(mm7, mm0); // copy tmp13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1131
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1132 /* odd part */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1133
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1134 movq_r2m(mm3, *(dataptr+9)); //save y4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1135 paddw_r2r(mm5, mm4); // tmp10 = tmp4 + tmp5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1136
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1137 movq_m2r(tmp7, mm3); // load tmp7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1138 paddw_r2r(mm6, mm0); // tmp32 = tmp13 + z1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1139
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1140 paddw_r2r(mm2, mm5); // tmp11 = tmp5 + tmp6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1141 psubw_r2r(mm6, mm7); // tmp33 = tmp13 - z1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1142
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1143 movq_r2m(mm0, *(dataptr+5)); //save y2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1144 paddw_r2r(mm3, mm2); // tmp12 = tmp6 + tmp7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1145
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1146 /* stage 4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1147
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1148 movq_r2m(mm7, *(dataptr+13)); //save y6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1149 movq_r2r(mm4, mm1); // copy tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1150
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1151 psubw_r2r(mm2, mm1); // tmp10 - tmp12
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1152 psllw_i2r(2, mm4); // shift tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1153
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1154 movq_m2r(RTjpeg_C2mC6, mm0); // load C2mC6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1155 psllw_i2r(2, mm1); // shift (tmp10-tmp12)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1156
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1157 pmulhw_m2r(RTjpeg_C6, mm1); // z5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1158 psllw_i2r(2, mm5); // prepare for multiply
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1159
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1160 pmulhw_r2r(mm0, mm4); // multiply by converted real
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1161
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1162 /* stage 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1163
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1164 pmulhw_m2r(RTjpeg_C4, mm5); // z3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1165 psllw_i2r(2, mm2); // prepare for multiply
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1166
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1167 pmulhw_m2r(RTjpeg_C2pC6, mm2); // multiply
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1168 movq_r2r(mm3, mm0); // copy tmp7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1169
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1170 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
1171 paddw_r2r(mm1, mm4); // z2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1172
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1173 paddw_r2r(mm5, mm0); // z11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1174 psubw_r2r(mm5, mm3); // z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1175
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1176 /* stage 6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1177
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1178 movq_r2r(mm3, mm5); // copy z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1179 paddw_r2r(mm1, mm2); // z4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1180
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1181 movq_r2r(mm0, mm6); // copy z11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1182 psubw_r2r(mm4, mm5); // y3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1183
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1184 paddw_r2r(mm2, mm6); // y1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1185 paddw_r2r(mm4, mm3); // y5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1186
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1187 movq_r2m(mm5, *(dataptr+7)); //save y3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1188
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1189 movq_r2m(mm6, *(dataptr+3)); //save y1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1190 psubw_r2r(mm2, mm0); // y7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1191
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1192 /************************************************************************************************
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1193 Start of Transpose
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1194 ************************************************************************************************/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1195
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1196 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
1197 movq_r2r(mm7, mm5); // copy first line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1198
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1199 punpcklwd_r2r(mm3, mm7); // m11:m01|m10:m00 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1200 movq_r2r(mm6, mm2); // copy third line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1201
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1202 punpcklwd_r2r(mm0, mm6); // m31:m21|m30:m20 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1203 movq_r2r(mm7, mm1); // copy first intermediate result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1204
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1205 punpckldq_r2r(mm6, mm7); // m30:m20|m10:m00 - interleave to produce result 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1206
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1207 punpckhdq_r2r(mm6, mm1); // m31:m21|m11:m01 - interleave to produce result 2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1208
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1209 movq_r2m(mm7, *(dataptr+9)); // write result 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1210 punpckhwd_r2r(mm3, mm5); // m13:m03|m12:m02 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1211
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1212 movq_r2m(mm1, *(dataptr+11)); // write result 2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1213 punpckhwd_r2r(mm0, mm2); // m33:m23|m32:m22 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1214
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1215 movq_r2r(mm5, mm1); // copy first intermediate result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1216 punpckldq_r2r(mm2, mm5); // m32:m22|m12:m02 - interleave to produce result 3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1217
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1218 movq_m2r(*(dataptr+1), mm0); // m03:m02|m01:m00 - first line, 4x4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1219 punpckhdq_r2r(mm2, mm1); // m33:m23|m13:m03 - interleave to produce result 4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1220
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1221 movq_r2m(mm5, *(dataptr+13)); // write result 3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1222
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1223 /****** last 4x4 done */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1224
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1225 movq_r2m(mm1, *(dataptr+15)); // write result 4, last 4x4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1226
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1227 movq_m2r(*(dataptr+5), mm2); // m23:m22|m21:m20 - third line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1228 movq_r2r(mm0, mm6); // copy first line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1229
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1230 punpcklwd_m2r(*(dataptr+3), mm0); // m11:m01|m10:m00 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1231 movq_r2r(mm2, mm7); // copy third line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1232
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1233 punpcklwd_m2r(*(dataptr+7), mm2); // m31:m21|m30:m20 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1234 movq_r2r(mm0, mm4); // copy first intermediate result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1235
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1236
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1237
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1238 movq_m2r(*(dataptr+8), mm1); // n03:n02|n01:n00 - first line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1239 punpckldq_r2r(mm2, mm0); // m30:m20|m10:m00 - interleave to produce first result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1240
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1241 movq_m2r(*(dataptr+12), mm3); // n23:n22|n21:n20 - third line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1242 punpckhdq_r2r(mm2, mm4); // m31:m21|m11:m01 - interleave to produce second result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1243
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1244 punpckhwd_m2r(*(dataptr+3), mm6); // m13:m03|m12:m02 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1245 movq_r2r(mm1, mm2); // copy first line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1246
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1247 punpckhwd_m2r(*(dataptr+7), mm7); // m33:m23|m32:m22 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1248 movq_r2r(mm6, mm5); // copy first intermediate result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1249
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1250 movq_r2m(mm0, *(dataptr+8)); // write result 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1251 punpckhdq_r2r(mm7, mm5); // m33:m23|m13:m03 - produce third result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1252
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1253 punpcklwd_m2r(*(dataptr+10), mm1); // n11:n01|n10:n00 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1254 movq_r2r(mm3, mm0); // copy third line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1255
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1256 punpckhwd_m2r(*(dataptr+10), mm2); // n13:n03|n12:n02 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1257
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1258 movq_r2m(mm4, *(dataptr+10)); // write result 2 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1259 punpckldq_r2r(mm7, mm6); // m32:m22|m12:m02 - produce fourth result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1260
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1261 punpcklwd_m2r(*(dataptr+14), mm3); // n33:n23|n32:n22 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1262 movq_r2r(mm1, mm4); // copy second intermediate result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1263
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1264 movq_r2m(mm6, *(dataptr+12)); // write result 3 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1265 punpckldq_r2r(mm3, mm1); //
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1266
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1267 punpckhwd_m2r(*(dataptr+14), mm0); // n33:n23|n32:n22 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1268 movq_r2r(mm2, mm6); // copy second intermediate result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1269
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1270 movq_r2m(mm5, *(dataptr+14)); // write result 4 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1271 punpckhdq_r2r(mm3, mm4); // n31:n21|n11:n01- produce second result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1272
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1273 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
1274 punpckldq_r2r(mm0, mm2); // n32:n22|n12:n02- produce third result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1275
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1276 movq_r2m(mm4, *(dataptr+3)); // write result 6 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1277 punpckhdq_r2r(mm0, mm6); // n33:n23|n13:n03 - produce fourth result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1278
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1279 movq_r2m(mm2, *(dataptr+5)); // write result 7 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1280
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1281 movq_m2r(*dataptr, mm0); // m03:m02|m01:m00 - first line, first 4x4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1282
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1283 movq_r2m(mm6, *(dataptr+7)); // write result 8 out
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1284
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1285 // Do first 4x4 quadrant, which is used in the beginning of the DCT:
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1286
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1287 movq_m2r(*(dataptr+4), mm7); // m23:m22|m21:m20 - third line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1288 movq_r2r(mm0, mm2); // copy first line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1289
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1290 punpcklwd_m2r(*(dataptr+2), mm0); // m11:m01|m10:m00 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1291 movq_r2r(mm7, mm4); // copy third line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1292
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1293 punpcklwd_m2r(*(dataptr+6), mm7); // m31:m21|m30:m20 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1294 movq_r2r(mm0, mm1); // copy first intermediate result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1295
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1296 movq_m2r(*(dataptr+2), mm6); // m13:m12|m11:m10 - second line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1297 punpckldq_r2r(mm7, mm0); // m30:m20|m10:m00 - interleave to produce result 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1298
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1299 movq_m2r(*(dataptr+6), mm5); // m33:m32|m31:m30 - fourth line
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1300 punpckhdq_r2r(mm7, mm1); // m31:m21|m11:m01 - interleave to produce result 2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1301
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1302 movq_r2r(mm0, mm7); // write result 1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1303 punpckhwd_r2r(mm6, mm2); // m13:m03|m12:m02 - interleave first and second lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1304
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1305 psubw_m2r(*(dataptr+14), mm7); // tmp07=x0-x7 /* Stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1306 movq_r2r(mm1, mm6); // write result 2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1307
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1308 paddw_m2r(*(dataptr+14), mm0); // tmp00=x0+x7 /* Stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1309 punpckhwd_r2r(mm5, mm4); // m33:m23|m32:m22 - interleave third and fourth lines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1310
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1311 paddw_m2r(*(dataptr+12), mm1); // tmp01=x1+x6 /* Stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1312 movq_r2r(mm2, mm3); // copy first intermediate result
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1313
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1314 psubw_m2r(*(dataptr+12), mm6); // tmp06=x1-x6 /* Stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1315 punpckldq_r2r(mm4, mm2); // m32:m22|m12:m02 - interleave to produce result 3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1316
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1317 movq_r2m(mm7, tmp7); // save tmp07
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1318 movq_r2r(mm2, mm5); // write result 3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1319
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1320 movq_r2m(mm6, tmp6); // save tmp06
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1321
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1322 punpckhdq_r2r(mm4, mm3); // m33:m23|m13:m03 - interleave to produce result 4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1323
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1324 paddw_m2r(*(dataptr+10), mm2); // tmp02=x2+x5 /* stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1325 movq_r2r(mm3, mm4); // write result 4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1326
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1327 /************************************************************************************************
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1328 End of Transpose 2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1329 ************************************************************************************************/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1330
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1331 paddw_m2r(*(dataptr+8), mm3); // tmp03=x3+x4 /* stage 1*/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1332 movq_r2r(mm0, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1333
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1334 psubw_m2r(*(dataptr+8), mm4); // tmp04=x3-x4 /* stage 1*/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1335 movq_r2r(mm1, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1336
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1337 paddw_r2r(mm3, mm0); // tmp10 = tmp00 + tmp03 /* even 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1338 psubw_r2r(mm3, mm7); // tmp13 = tmp00 - tmp03 /* even 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1339
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1340 psubw_r2r(mm2, mm6); // tmp12 = tmp01 - tmp02 /* even 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1341 paddw_r2r(mm2, mm1); // tmp11 = tmp01 + tmp02 /* even 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1342
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1343 psubw_m2r(*(dataptr+10), mm5); // tmp05=x2-x5 /* stage 1*/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1344 paddw_r2r(mm7, mm6); // tmp12 + tmp13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1345
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1346 /* stage 3 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1347
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1348 movq_m2r(tmp6, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1349 movq_r2r(mm0, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1350
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1351 psllw_i2r(2, mm6); // m8 * 2^2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1352 paddw_r2r(mm1, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1353
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1354 pmulhw_m2r(RTjpeg_C4, mm6); // z1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1355 psubw_r2r(mm1, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1356
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1357 movq_r2m(mm0, *dataptr);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1358 movq_r2r(mm7, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1359
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1360 /* Odd part */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1361 movq_r2m(mm3, *(dataptr+8));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1362 paddw_r2r(mm5, mm4); // tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1363
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1364 movq_m2r(tmp7, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1365 paddw_r2r(mm6, mm0); // tmp32
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1366
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1367 paddw_r2r(mm2, mm5); // tmp11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1368 psubw_r2r(mm6, mm7); // tmp33
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1369
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1370 movq_r2m(mm0, *(dataptr+4));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1371 paddw_r2r(mm3, mm2); // tmp12
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1372
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1373 /* stage 4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1374 movq_r2m(mm7, *(dataptr+12));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1375 movq_r2r(mm4, mm1); // copy of tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1376
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1377 psubw_r2r(mm2, mm1); // tmp10 - tmp12
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1378 psllw_i2r(2, mm4); // m8 * 2^2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1379
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1380 movq_m2r(RTjpeg_C2mC6, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1381 psllw_i2r(2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1382
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1383 pmulhw_m2r(RTjpeg_C6, mm1); // z5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1384 psllw_i2r(2, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1385
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1386 pmulhw_r2r(mm0, mm4); // z5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1387
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1388 /* stage 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1389
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1390 pmulhw_m2r(RTjpeg_C2pC6, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1391 psllw_i2r(2, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1392
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1393 pmulhw_m2r(RTjpeg_C4, mm5); // z3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1394 movq_r2r(mm3, mm0); // copy tmp7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1395
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1396 movq_m2r(*(dataptr+1), mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1397 paddw_r2r(mm1, mm4); // z2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1398
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1399 paddw_r2r(mm1, mm2); // z4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1400
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1401 paddw_r2r(mm5, mm0); // z11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1402 psubw_r2r(mm5, mm3); // z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1403
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1404 /* stage 6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1405
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1406 movq_r2r(mm3, mm5); // copy z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1407 psubw_r2r(mm4, mm3); // y3=z13 - z2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1408
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1409 paddw_r2r(mm4, mm5); // y5=z13 + z2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1410 movq_r2r(mm0, mm6); // copy z11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1411
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1412 movq_r2m(mm3, *(dataptr+6)); //save y3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1413 psubw_r2r(mm2, mm0); // y7=z11 - z4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1414
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1415 movq_r2m(mm5, *(dataptr+10)); //save y5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1416 paddw_r2r(mm2, mm6); // y1=z11 + z4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1417
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1418 movq_r2m(mm0, *(dataptr+14)); //save y7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1419
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1420 /************************************************
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1421 * End of 1st 4 rows
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1422 ************************************************/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1423
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1424 movq_m2r(*(dataptr+3), mm1); // load x1 /* stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1425 movq_r2r(mm7, mm0); // copy x0
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1426
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1427 movq_r2m(mm6, *(dataptr+2)); //save y1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1428
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1429 movq_m2r(*(dataptr+5), mm2); // load x2 /* stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1430 movq_r2r(mm1, mm6); // copy x1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1431
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1432 paddw_m2r(*(dataptr+15), mm0); // tmp00 = x0 + x7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1433
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1434 movq_m2r(*(dataptr+7), mm3); // load x3 /* stage 1 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1435 movq_r2r(mm2, mm5); // copy x2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1436
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1437 psubw_m2r(*(dataptr+15), mm7); // tmp07 = x0 - x7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1438 movq_r2r(mm3, mm4); // copy x3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1439
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1440 paddw_m2r(*(dataptr+13), mm1); // tmp01 = x1 + x6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1441
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1442 movq_r2m(mm7, tmp7); // save tmp07
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1443 movq_r2r(mm0, mm7); // copy tmp00
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1444
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1445 psubw_m2r(*(dataptr+13), mm6); // tmp06 = x1 - x6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1446
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1447 /* stage 2, Even Part */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1448
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1449 paddw_m2r(*(dataptr+9), mm3); // tmp03 = x3 + x4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1450
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1451 movq_r2m(mm6, tmp6); // save tmp07
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1452 movq_r2r(mm1, mm6); // copy tmp01
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1453
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1454 paddw_m2r(*(dataptr+11), mm2); // tmp02 = x2 + x5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1455 paddw_r2r(mm3, mm0); // tmp10 = tmp00 + tmp03
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1456
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1457 psubw_r2r(mm3, mm7); // tmp13 = tmp00 - tmp03
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1458
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1459 psubw_m2r(*(dataptr+9), mm4); // tmp04 = x3 - x4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1460 psubw_r2r(mm2, mm6); // tmp12 = tmp01 - tmp02
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1461
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1462 paddw_r2r(mm2, mm1); // tmp11 = tmp01 + tmp02
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1463
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1464 psubw_m2r(*(dataptr+11), mm5); // tmp05 = x2 - x5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1465 paddw_r2r(mm7, mm6); // tmp12 + tmp13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1466
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1467 /* stage 3, Even and stage 4 & 5 even */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1468
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1469 movq_m2r(tmp6, mm2); // load tmp6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1470 movq_r2r(mm0, mm3); // copy tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1471
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1472 psllw_i2r(2, mm6); // shift z1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1473 paddw_r2r(mm1, mm0); // y0=tmp10 + tmp11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1474
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1475 pmulhw_m2r(RTjpeg_C4, mm6); // z1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1476 psubw_r2r(mm1, mm3); // y4=tmp10 - tmp11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1477
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1478 movq_r2m(mm0, *(dataptr+1)); //save y0
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1479 movq_r2r(mm7, mm0); // copy tmp13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1480
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1481 /* odd part */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1482
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1483 movq_r2m(mm3, *(dataptr+9)); //save y4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1484 paddw_r2r(mm5, mm4); // tmp10 = tmp4 + tmp5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1485
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1486 movq_m2r(tmp7, mm3); // load tmp7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1487 paddw_r2r(mm6, mm0); // tmp32 = tmp13 + z1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1488
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1489 paddw_r2r(mm2, mm5); // tmp11 = tmp5 + tmp6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1490 psubw_r2r(mm6, mm7); // tmp33 = tmp13 - z1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1491
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1492 movq_r2m(mm0, *(dataptr+5)); //save y2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1493 paddw_r2r(mm3, mm2); // tmp12 = tmp6 + tmp7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1494
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1495 /* stage 4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1496
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1497 movq_r2m(mm7, *(dataptr+13)); //save y6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1498 movq_r2r(mm4, mm1); // copy tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1499
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1500 psubw_r2r(mm2, mm1); // tmp10 - tmp12
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1501 psllw_i2r(2, mm4); // shift tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1502
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1503 movq_m2r(RTjpeg_C2mC6, mm0); // load C2mC6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1504 psllw_i2r(2, mm1); // shift (tmp10-tmp12)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1505
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1506 pmulhw_m2r(RTjpeg_C6, mm1); // z5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1507 psllw_i2r(2, mm5); // prepare for multiply
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1508
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1509 pmulhw_r2r(mm0, mm4); // multiply by converted real
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1510
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1511 /* stage 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1512
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1513 pmulhw_m2r(RTjpeg_C4, mm5); // z3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1514 psllw_i2r(2, mm2); // prepare for multiply
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1515
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1516 pmulhw_m2r(RTjpeg_C2pC6, mm2); // multiply
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1517 movq_r2r(mm3, mm0); // copy tmp7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1518
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1519 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
1520 paddw_r2r(mm1, mm4); // z2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1521
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1522 paddw_r2r(mm5, mm0); // z11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1523 psubw_r2r(mm5, mm3); // z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1524
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1525 /* stage 6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1526
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1527 movq_r2r(mm3, mm5); // copy z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1528 paddw_r2r(mm1, mm2); // z4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1529
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1530 movq_r2r(mm0, mm6); // copy z11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1531 psubw_r2r(mm4, mm5); // y3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1532
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1533 paddw_r2r(mm2, mm6); // y1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1534 paddw_r2r(mm4, mm3); // y5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1535
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1536 movq_r2m(mm5, *(dataptr+7)); //save y3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1537 psubw_r2r(mm2, mm0); // yè=z11 - z4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1538
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1539 movq_r2m(mm3, *(dataptr+11)); //save y5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1540
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1541 movq_r2m(mm6, *(dataptr+3)); //save y1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1542
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1543 movq_r2m(mm0, *(dataptr+15)); //save y7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1544
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1545
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1546 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1547 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1548
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1549 #define FIX_1_082392200 ((__s32) 277) /* FIX(1.082392200) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1550 #define FIX_1_414213562 ((__s32) 362) /* FIX(1.414213562) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1551 #define FIX_1_847759065 ((__s32) 473) /* FIX(1.847759065) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1552 #define FIX_2_613125930 ((__s32) 669) /* FIX(2.613125930) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1553
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1554 #define DESCALE(x) (__s16)( ((x)+4) >> 3)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1555
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1556 /* clip yuv to 16..235 (should be 16..240 for cr/cb but ... */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1557
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1558 #define RL(x) ((x)>235) ? 235 : (((x)<16) ? 16 : (x))
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1559 #define MULTIPLY(var,const) (((__s32) ((var) * (const)) + 128)>>8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1560
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1561 void RTjpeg_idct_init(void)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1562 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1563 int i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1564
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1565 for(i=0; i<64; i++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1566 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1567 RTjpeg_liqt[i]=((__u64)RTjpeg_liqt[i]*RTjpeg_aan_tab[i])>>32;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1568 RTjpeg_ciqt[i]=((__u64)RTjpeg_ciqt[i]*RTjpeg_aan_tab[i])>>32;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1569 }
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 void RTjpeg_idct(__u8 *odata, __s16 *data, int rskip)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1573 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1574 #ifdef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1575
12928
bc760f3f129e ICC 8.0 compilation fixes
atmos4
parents: 12378
diff changeset
1576 static mmx_t fix_141 = {0x5a825a825a825a82LL};
bc760f3f129e ICC 8.0 compilation fixes
atmos4
parents: 12378
diff changeset
1577 static mmx_t fix_184n261 = {0xcf04cf04cf04cf04LL};
bc760f3f129e ICC 8.0 compilation fixes
atmos4
parents: 12378
diff changeset
1578 static mmx_t fix_184 = {0x7641764176417641LL};
bc760f3f129e ICC 8.0 compilation fixes
atmos4
parents: 12378
diff changeset
1579 static mmx_t fix_n184 = {0x896f896f896f896fLL};
bc760f3f129e ICC 8.0 compilation fixes
atmos4
parents: 12378
diff changeset
1580 static mmx_t fix_108n184 = {0xcf04cf04cf04cf04LL};
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1581
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1582 mmx_t workspace[64];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1583 mmx_t *wsptr = workspace;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1584 register mmx_t *dataptr = (mmx_t *)odata;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1585 mmx_t *idata = (mmx_t *)data;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1586
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1587 rskip = rskip>>3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1588 /*
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1589 * Perform inverse DCT on one block of coefficients.
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1590 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1591
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1592 /* Odd part */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1593
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1594 movq_m2r(*(idata+10), mm1); // load idata[DCTSIZE*5]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1595
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1596 movq_m2r(*(idata+6), mm0); // load idata[DCTSIZE*3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1597
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1598 movq_m2r(*(idata+2), mm3); // load idata[DCTSIZE*1]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1599
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1600 movq_r2r(mm1, mm2); // copy tmp6 /* phase 6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1601
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1602 movq_m2r(*(idata+14), mm4); // load idata[DCTSIZE*7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1603
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1604 paddw_r2r(mm0, mm1); // z13 = tmp6 + tmp5;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1605
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1606 psubw_r2r(mm0, mm2); // z10 = tmp6 - tmp5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1607
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1608 psllw_i2r(2, mm2); // shift z10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1609 movq_r2r(mm2, mm0); // copy z10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1610
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1611 pmulhw_m2r(fix_184n261, mm2); // MULTIPLY( z12, FIX_1_847759065); /* 2*c2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1612 movq_r2r(mm3, mm5); // copy tmp4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1613
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1614 pmulhw_m2r(fix_n184, mm0); // MULTIPLY(z10, -FIX_1_847759065); /* 2*c2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1615 paddw_r2r(mm4, mm3); // z11 = tmp4 + tmp7;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1616
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1617 movq_r2r(mm3, mm6); // copy z11 /* phase 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1618 psubw_r2r(mm4, mm5); // z12 = tmp4 - tmp7;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1619
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1620 psubw_r2r(mm1, mm6); // z11-z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1621 psllw_i2r(2, mm5); // shift z12
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1622
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1623 movq_m2r(*(idata+12), mm4); // load idata[DCTSIZE*6], even part
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1624 movq_r2r(mm5, mm7); // copy z12
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1625
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1626 pmulhw_m2r(fix_108n184, mm5); // MULT(z12, (FIX_1_08-FIX_1_84)) //- z5; /* 2*(c2-c6) */ even part
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1627 paddw_r2r(mm1, mm3); // tmp7 = z11 + z13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1628
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1629 //ok
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1630
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1631 /* Even part */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1632 pmulhw_m2r(fix_184, mm7); // MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) //+ z5; /* -2*(c2+c6) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1633 psllw_i2r(2, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1634
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1635 movq_m2r(*(idata+4), mm1); // load idata[DCTSIZE*2]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1636
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1637 paddw_r2r(mm5, mm0); // tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1638
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1639 paddw_r2r(mm7, mm2); // tmp12
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1640
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1641 pmulhw_m2r(fix_141, mm6); // tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1642 psubw_r2r(mm3, mm2); // tmp6 = tmp12 - tmp7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1643
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1644 movq_r2r(mm1, mm5); // copy tmp1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1645 paddw_r2r(mm4, mm1); // tmp13= tmp1 + tmp3; /* phases 5-3 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1646
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1647 psubw_r2r(mm4, mm5); // tmp1-tmp3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1648 psubw_r2r(mm2, mm6); // tmp5 = tmp11 - tmp6;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1649
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1650 movq_r2m(mm1, *(wsptr)); // save tmp13 in workspace
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1651 psllw_i2r(2, mm5); // shift tmp1-tmp3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1652
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1653 movq_m2r(*(idata), mm7); // load idata[DCTSIZE*0]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1654
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1655 pmulhw_m2r(fix_141, mm5); // MULTIPLY(tmp1 - tmp3, FIX_1_414213562)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1656 paddw_r2r(mm6, mm0); // tmp4 = tmp10 + tmp5;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1657
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1658 movq_m2r(*(idata+8), mm4); // load idata[DCTSIZE*4]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1659
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1660 psubw_r2r(mm1, mm5); // tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; /* 2*c4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1661
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1662 movq_r2m(mm0, *(wsptr+4)); // save tmp4 in workspace
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1663 movq_r2r(mm7, mm1); // copy tmp0 /* phase 3 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1664
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1665 movq_r2m(mm5, *(wsptr+2)); // save tmp12 in workspace
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1666 psubw_r2r(mm4, mm1); // tmp11 = tmp0 - tmp2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1667
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1668 paddw_r2r(mm4, mm7); // tmp10 = tmp0 + tmp2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1669 movq_r2r(mm1, mm5); // copy tmp11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1670
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1671 paddw_m2r(*(wsptr+2), mm1); // tmp1 = tmp11 + tmp12;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1672 movq_r2r(mm7, mm4); // copy tmp10 /* phase 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1673
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1674 paddw_m2r(*(wsptr), mm7); // tmp0 = tmp10 + tmp13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1675
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1676 psubw_m2r(*(wsptr), mm4); // tmp3 = tmp10 - tmp13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1677 movq_r2r(mm7, mm0); // copy tmp0
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1678
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1679 psubw_m2r(*(wsptr+2), mm5); // tmp2 = tmp11 - tmp12;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1680 paddw_r2r(mm3, mm7); // wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1681
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1682 psubw_r2r(mm3, mm0); // wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1683
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1684 movq_r2m(mm7, *(wsptr)); // wsptr[DCTSIZE*0]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1685 movq_r2r(mm1, mm3); // copy tmp1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1686
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1687 movq_r2m(mm0, *(wsptr+14)); // wsptr[DCTSIZE*7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1688 paddw_r2r(mm2, mm1); // wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1689
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1690 psubw_r2r(mm2, mm3); // wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1691
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1692 movq_r2m(mm1, *(wsptr+2)); // wsptr[DCTSIZE*1]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1693 movq_r2r(mm4, mm1); // copy tmp3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1694
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1695 movq_r2m(mm3, *(wsptr+12)); // wsptr[DCTSIZE*6]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1696
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1697 paddw_m2r(*(wsptr+4), mm4); // wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1698
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1699 psubw_m2r(*(wsptr+4), mm1); // wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1700
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1701 movq_r2m(mm4, *(wsptr+8));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1702 movq_r2r(mm5, mm7); // copy tmp2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1703
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1704 paddw_r2r(mm6, mm5); // wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1705
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1706 movq_r2m(mm1, *(wsptr+6));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1707 psubw_r2r(mm6, mm7); // wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1708
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1709 movq_r2m(mm5, *(wsptr+4));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1710
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1711 movq_r2m(mm7, *(wsptr+10));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1712
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1713 //ok
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1714
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1715
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1716 /*****************************************************************/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1717
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1718 idata++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1719 wsptr++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1720
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1721 /*****************************************************************/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1722
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1723 movq_m2r(*(idata+10), mm1); // load idata[DCTSIZE*5]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1724
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1725 movq_m2r(*(idata+6), mm0); // load idata[DCTSIZE*3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1726
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1727 movq_m2r(*(idata+2), mm3); // load idata[DCTSIZE*1]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1728 movq_r2r(mm1, mm2); // copy tmp6 /* phase 6 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1729
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1730 movq_m2r(*(idata+14), mm4); // load idata[DCTSIZE*7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1731 paddw_r2r(mm0, mm1); // z13 = tmp6 + tmp5;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1732
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1733 psubw_r2r(mm0, mm2); // z10 = tmp6 - tmp5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1734
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1735 psllw_i2r(2, mm2); // shift z10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1736 movq_r2r(mm2, mm0); // copy z10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1737
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1738 pmulhw_m2r(fix_184n261, mm2); // MULTIPLY( z12, FIX_1_847759065); /* 2*c2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1739 movq_r2r(mm3, mm5); // copy tmp4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1740
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1741 pmulhw_m2r(fix_n184, mm0); // MULTIPLY(z10, -FIX_1_847759065); /* 2*c2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1742 paddw_r2r(mm4, mm3); // z11 = tmp4 + tmp7;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1743
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1744 movq_r2r(mm3, mm6); // copy z11 /* phase 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1745 psubw_r2r(mm4, mm5); // z12 = tmp4 - tmp7;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1746
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1747 psubw_r2r(mm1, mm6); // z11-z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1748 psllw_i2r(2, mm5); // shift z12
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1749
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1750 movq_m2r(*(idata+12), mm4); // load idata[DCTSIZE*6], even part
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1751 movq_r2r(mm5, mm7); // copy z12
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1752
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1753 pmulhw_m2r(fix_108n184, mm5); // MULT(z12, (FIX_1_08-FIX_1_84)) //- z5; /* 2*(c2-c6) */ even part
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1754 paddw_r2r(mm1, mm3); // tmp7 = z11 + z13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1755
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1756 //ok
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1757
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1758 /* Even part */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1759 pmulhw_m2r(fix_184, mm7); // MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) //+ z5; /* -2*(c2+c6) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1760 psllw_i2r(2, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1761
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1762 movq_m2r(*(idata+4), mm1); // load idata[DCTSIZE*2]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1763
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1764 paddw_r2r(mm5, mm0); // tmp10
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1765
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1766 paddw_r2r(mm7, mm2); // tmp12
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1767
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1768 pmulhw_m2r(fix_141, mm6); // tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1769 psubw_r2r(mm3, mm2); // tmp6 = tmp12 - tmp7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1770
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1771 movq_r2r(mm1, mm5); // copy tmp1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1772 paddw_r2r(mm4, mm1); // tmp13= tmp1 + tmp3; /* phases 5-3 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1773
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1774 psubw_r2r(mm4, mm5); // tmp1-tmp3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1775 psubw_r2r(mm2, mm6); // tmp5 = tmp11 - tmp6;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1776
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1777 movq_r2m(mm1, *(wsptr)); // save tmp13 in workspace
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1778 psllw_i2r(2, mm5); // shift tmp1-tmp3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1779
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1780 movq_m2r(*(idata), mm7); // load idata[DCTSIZE*0]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1781 paddw_r2r(mm6, mm0); // tmp4 = tmp10 + tmp5;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1782
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1783 pmulhw_m2r(fix_141, mm5); // MULTIPLY(tmp1 - tmp3, FIX_1_414213562)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1784
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1785 movq_m2r(*(idata+8), mm4); // load idata[DCTSIZE*4]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1786
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1787 psubw_r2r(mm1, mm5); // tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; /* 2*c4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1788
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1789 movq_r2m(mm0, *(wsptr+4)); // save tmp4 in workspace
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1790 movq_r2r(mm7, mm1); // copy tmp0 /* phase 3 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1791
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1792 movq_r2m(mm5, *(wsptr+2)); // save tmp12 in workspace
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1793 psubw_r2r(mm4, mm1); // tmp11 = tmp0 - tmp2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1794
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1795 paddw_r2r(mm4, mm7); // tmp10 = tmp0 + tmp2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1796 movq_r2r(mm1, mm5); // copy tmp11
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1797
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1798 paddw_m2r(*(wsptr+2), mm1); // tmp1 = tmp11 + tmp12;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1799 movq_r2r(mm7, mm4); // copy tmp10 /* phase 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1800
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1801 paddw_m2r(*(wsptr), mm7); // tmp0 = tmp10 + tmp13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1803 psubw_m2r(*(wsptr), mm4); // tmp3 = tmp10 - tmp13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1804 movq_r2r(mm7, mm0); // copy tmp0
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1805
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1806 psubw_m2r(*(wsptr+2), mm5); // tmp2 = tmp11 - tmp12;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1807 paddw_r2r(mm3, mm7); // wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1808
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1809 psubw_r2r(mm3, mm0); // wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1810
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1811 movq_r2m(mm7, *(wsptr)); // wsptr[DCTSIZE*0]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1812 movq_r2r(mm1, mm3); // copy tmp1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1813
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1814 movq_r2m(mm0, *(wsptr+14)); // wsptr[DCTSIZE*7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1815 paddw_r2r(mm2, mm1); // wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1816
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1817 psubw_r2r(mm2, mm3); // wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1818
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1819 movq_r2m(mm1, *(wsptr+2)); // wsptr[DCTSIZE*1]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1820 movq_r2r(mm4, mm1); // copy tmp3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1821
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1822 movq_r2m(mm3, *(wsptr+12)); // wsptr[DCTSIZE*6]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1823
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1824 paddw_m2r(*(wsptr+4), mm4); // wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1825
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1826 psubw_m2r(*(wsptr+4), mm1); // wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1827
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1828 movq_r2m(mm4, *(wsptr+8));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1829 movq_r2r(mm5, mm7); // copy tmp2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1830
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1831 paddw_r2r(mm6, mm5); // wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1832
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1833 movq_r2m(mm1, *(wsptr+6));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1834 psubw_r2r(mm6, mm7); // wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1835
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1836 movq_r2m(mm5, *(wsptr+4));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1837
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1838 movq_r2m(mm7, *(wsptr+10));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1839
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1840 /*****************************************************************/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1841
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1842 /* Pass 2: process rows from work array, store into output array. */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1843 /* Note that we must descale the results by a factor of 8 == 2**3, */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1844 /* and also undo the PASS1_BITS scaling. */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1845
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1846 /*****************************************************************/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1847 /* Even part */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1848
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1849 wsptr--;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1850
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1851 // tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1852 // tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1853 // tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1854 // tmp14 = ((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1855 movq_m2r(*(wsptr), mm0); // wsptr[0,0],[0,1],[0,2],[0,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1856
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1857 movq_m2r(*(wsptr+1), mm1); // wsptr[0,4],[0,5],[0,6],[0,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1858 movq_r2r(mm0, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1859
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1860 movq_m2r(*(wsptr+2), mm3); // wsptr[1,0],[1,1],[1,2],[1,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1861 paddw_r2r(mm1, mm0); // wsptr[0,tmp10],[xxx],[0,tmp13],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1862
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1863 movq_m2r(*(wsptr+3), mm4); // wsptr[1,4],[1,5],[1,6],[1,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1864 psubw_r2r(mm1, mm2); // wsptr[0,tmp11],[xxx],[0,tmp14],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1865
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1866 movq_r2r(mm0, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1867 movq_r2r(mm3, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1868
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1869 paddw_r2r(mm4, mm3); // wsptr[1,tmp10],[xxx],[1,tmp13],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1870 movq_r2r(mm2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1871
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1872 psubw_r2r(mm4, mm5); // wsptr[1,tmp11],[xxx],[1,tmp14],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1873 punpcklwd_r2r(mm3, mm0); // wsptr[0,tmp10],[1,tmp10],[xxx],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1874
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1875 movq_m2r(*(wsptr+7), mm7); // wsptr[3,4],[3,5],[3,6],[3,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1876 punpckhwd_r2r(mm3, mm6); // wsptr[0,tmp13],[1,tmp13],[xxx],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1877
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1878 movq_m2r(*(wsptr+4), mm3); // wsptr[2,0],[2,1],[2,2],[2,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1879 punpckldq_r2r(mm6, mm0); // wsptr[0,tmp10],[1,tmp10],[0,tmp13],[1,tmp13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1880
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1881 punpcklwd_r2r(mm5, mm1); // wsptr[0,tmp11],[1,tmp11],[xxx],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1882 movq_r2r(mm3, mm4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1883
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1884 movq_m2r(*(wsptr+6), mm6); // wsptr[3,0],[3,1],[3,2],[3,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1885 punpckhwd_r2r(mm5, mm2); // wsptr[0,tmp14],[1,tmp14],[xxx],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1886
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1887 movq_m2r(*(wsptr+5), mm5); // wsptr[2,4],[2,5],[2,6],[2,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1888 punpckldq_r2r(mm2, mm1); // wsptr[0,tmp11],[1,tmp11],[0,tmp14],[1,tmp14]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1889
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1890
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1891 paddw_r2r(mm5, mm3); // wsptr[2,tmp10],[xxx],[2,tmp13],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1892 movq_r2r(mm6, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1893
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1894 psubw_r2r(mm5, mm4); // wsptr[2,tmp11],[xxx],[2,tmp14],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1895 paddw_r2r(mm7, mm6); // wsptr[3,tmp10],[xxx],[3,tmp13],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1896
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1897 movq_r2r(mm3, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1898 punpcklwd_r2r(mm6, mm3); // wsptr[2,tmp10],[3,tmp10],[xxx],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1899
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1900 psubw_r2r(mm7, mm2); // wsptr[3,tmp11],[xxx],[3,tmp14],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1901 punpckhwd_r2r(mm6, mm5); // wsptr[2,tmp13],[3,tmp13],[xxx],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1902
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1903 movq_r2r(mm4, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1904 punpckldq_r2r(mm5, mm3); // wsptr[2,tmp10],[3,tmp10],[2,tmp13],[3,tmp13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1905
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1906 punpcklwd_r2r(mm2, mm4); // wsptr[2,tmp11],[3,tmp11],[xxx],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1907
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1908 punpckhwd_r2r(mm2, mm7); // wsptr[2,tmp14],[3,tmp14],[xxx],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1909
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1910 punpckldq_r2r(mm7, mm4); // wsptr[2,tmp11],[3,tmp11],[2,tmp14],[3,tmp14]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1911 movq_r2r(mm1, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1912
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1913 //ok
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1914
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1915 // mm0 = ;wsptr[0,tmp10],[1,tmp10],[0,tmp13],[1,tmp13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1916 // mm1 = ;wsptr[0,tmp11],[1,tmp11],[0,tmp14],[1,tmp14]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1917
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1918
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1919 movq_r2r(mm0, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1920 punpckhdq_r2r(mm4, mm6); // wsptr[0,tmp14],[1,tmp14],[2,tmp14],[3,tmp14]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1921
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1922 punpckldq_r2r(mm4, mm1); // wsptr[0,tmp11],[1,tmp11],[2,tmp11],[3,tmp11]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1923 psllw_i2r(2, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1924
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1925 pmulhw_m2r(fix_141, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1926 punpckldq_r2r(mm3, mm0); // wsptr[0,tmp10],[1,tmp10],[2,tmp10],[3,tmp10]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1927
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1928 punpckhdq_r2r(mm3, mm2); // wsptr[0,tmp13],[1,tmp13],[2,tmp13],[3,tmp13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1929 movq_r2r(mm0, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1930
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1931 // tmp0 = tmp10 + tmp13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1932 // tmp3 = tmp10 - tmp13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1933 paddw_r2r(mm2, mm0); // [0,tmp0],[1,tmp0],[2,tmp0],[3,tmp0]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1934 psubw_r2r(mm2, mm7); // [0,tmp3],[1,tmp3],[2,tmp3],[3,tmp3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1935
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1936 // tmp12 = MULTIPLY(tmp14, FIX_1_414213562) - tmp13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1937 psubw_r2r(mm2, mm6); // wsptr[0,tmp12],[1,tmp12],[2,tmp12],[3,tmp12]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1938 // tmp1 = tmp11 + tmp12;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1939 // tmp2 = tmp11 - tmp12;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1940 movq_r2r(mm1, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1941
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1942 //OK
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1943
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1944 /* Odd part */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1945
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1946 // z13 = (DCTELEM) wsptr[5] + (DCTELEM) wsptr[3];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1947 // z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1948 // z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1949 // z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1950 movq_m2r(*(wsptr), mm3); // wsptr[0,0],[0,1],[0,2],[0,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1951 paddw_r2r(mm6, mm1); // [0,tmp1],[1,tmp1],[2,tmp1],[3,tmp1]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1952
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1953 movq_m2r(*(wsptr+1), mm4); // wsptr[0,4],[0,5],[0,6],[0,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1954 psubw_r2r(mm6, mm5); // [0,tmp2],[1,tmp2],[2,tmp2],[3,tmp2]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1955
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1956 movq_r2r(mm3, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1957 punpckldq_r2r(mm4, mm3); // wsptr[0,0],[0,1],[0,4],[0,5]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1958
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1959 punpckhdq_r2r(mm6, mm4); // wsptr[0,6],[0,7],[0,2],[0,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1960 movq_r2r(mm3, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1961
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1962 //Save tmp0 and tmp1 in wsptr
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1963 movq_r2m(mm0, *(wsptr)); // save tmp0
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1964 paddw_r2r(mm4, mm2); // wsptr[xxx],[0,z11],[xxx],[0,z13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1965
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1966
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1967 //Continue with z10 --- z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1968 movq_m2r(*(wsptr+2), mm6); // wsptr[1,0],[1,1],[1,2],[1,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1969 psubw_r2r(mm4, mm3); // wsptr[xxx],[0,z12],[xxx],[0,z10]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1970
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1971 movq_m2r(*(wsptr+3), mm0); // wsptr[1,4],[1,5],[1,6],[1,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1972 movq_r2r(mm6, mm4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1973
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1974 movq_r2m(mm1, *(wsptr+1)); // save tmp1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1975 punpckldq_r2r(mm0, mm6); // wsptr[1,0],[1,1],[1,4],[1,5]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1976
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1977 punpckhdq_r2r(mm4, mm0); // wsptr[1,6],[1,7],[1,2],[1,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1978 movq_r2r(mm6, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1979
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1980 //Save tmp2 and tmp3 in wsptr
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1981 paddw_r2r(mm0, mm6); // wsptr[xxx],[1,z11],[xxx],[1,z13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1982 movq_r2r(mm2, mm4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1983
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1984 //Continue with z10 --- z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1985 movq_r2m(mm5, *(wsptr+2)); // save tmp2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1986 punpcklwd_r2r(mm6, mm2); // wsptr[xxx],[xxx],[0,z11],[1,z11]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1987
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1988 psubw_r2r(mm0, mm1); // wsptr[xxx],[1,z12],[xxx],[1,z10]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1989 punpckhwd_r2r(mm6, mm4); // wsptr[xxx],[xxx],[0,z13],[1,z13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1990
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1991 movq_r2r(mm3, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1992 punpcklwd_r2r(mm1, mm3); // wsptr[xxx],[xxx],[0,z12],[1,z12]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1993
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1994 movq_r2m(mm7, *(wsptr+3)); // save tmp3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1995 punpckhwd_r2r(mm1, mm0); // wsptr[xxx],[xxx],[0,z10],[1,z10]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1996
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1997 movq_m2r(*(wsptr+4), mm6); // wsptr[2,0],[2,1],[2,2],[2,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1998 punpckhdq_r2r(mm2, mm0); // wsptr[0,z10],[1,z10],[0,z11],[1,z11]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
1999
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2000 movq_m2r(*(wsptr+5), mm7); // wsptr[2,4],[2,5],[2,6],[2,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2001 punpckhdq_r2r(mm4, mm3); // wsptr[0,z12],[1,z12],[0,z13],[1,z13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2002
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2003 movq_m2r(*(wsptr+6), mm1); // wsptr[3,0],[3,1],[3,2],[3,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2004 movq_r2r(mm6, mm4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2005
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2006 punpckldq_r2r(mm7, mm6); // wsptr[2,0],[2,1],[2,4],[2,5]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2007 movq_r2r(mm1, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2008
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2009 punpckhdq_r2r(mm4, mm7); // wsptr[2,6],[2,7],[2,2],[2,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2010 movq_r2r(mm6, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2011
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2012 movq_m2r(*(wsptr+7), mm4); // wsptr[3,4],[3,5],[3,6],[3,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2013 paddw_r2r(mm7, mm6); // wsptr[xxx],[2,z11],[xxx],[2,z13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2014
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2015 psubw_r2r(mm7, mm2); // wsptr[xxx],[2,z12],[xxx],[2,z10]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2016 punpckldq_r2r(mm4, mm1); // wsptr[3,0],[3,1],[3,4],[3,5]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2017
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2018 punpckhdq_r2r(mm5, mm4); // wsptr[3,6],[3,7],[3,2],[3,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2019 movq_r2r(mm1, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2020
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2021 paddw_r2r(mm4, mm1); // wsptr[xxx],[3,z11],[xxx],[3,z13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2022 psubw_r2r(mm4, mm7); // wsptr[xxx],[3,z12],[xxx],[3,z10]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2023
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2024 movq_r2r(mm6, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2025 punpcklwd_r2r(mm1, mm6); // wsptr[xxx],[xxx],[2,z11],[3,z11]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2026
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2027 punpckhwd_r2r(mm1, mm5); // wsptr[xxx],[xxx],[2,z13],[3,z13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2028 movq_r2r(mm2, mm4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2029
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2030 punpcklwd_r2r(mm7, mm2); // wsptr[xxx],[xxx],[2,z12],[3,z12]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2031
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2032 punpckhwd_r2r(mm7, mm4); // wsptr[xxx],[xxx],[2,z10],[3,z10]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2033
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2034 punpckhdq_r2r(mm6, mm4); /// wsptr[2,z10],[3,z10],[2,z11],[3,z11]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2035
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2036 punpckhdq_r2r(mm5, mm2); // wsptr[2,z12],[3,z12],[2,z13],[3,z13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2037 movq_r2r(mm0, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2038
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2039 punpckldq_r2r(mm4, mm0); // wsptr[0,z10],[1,z10],[2,z10],[3,z10]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2040
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2041 punpckhdq_r2r(mm4, mm5); // wsptr[0,z11],[1,z11],[2,z11],[3,z11]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2042 movq_r2r(mm3, mm4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2043
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2044 punpckhdq_r2r(mm2, mm4); // wsptr[0,z13],[1,z13],[2,z13],[3,z13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2045 movq_r2r(mm5, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2046
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2047 punpckldq_r2r(mm2, mm3); // wsptr[0,z12],[1,z12],[2,z12],[3,z12]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2048 // tmp7 = z11 + z13; /* phase 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2049 // tmp8 = z11 - z13; /* phase 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2050 psubw_r2r(mm4, mm1); // tmp8
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2051
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2052 paddw_r2r(mm4, mm5); // tmp7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2053 // tmp21 = MULTIPLY(tmp8, FIX_1_414213562); /* 2*c4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2054 psllw_i2r(2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2055
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2056 psllw_i2r(2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2057
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2058 pmulhw_m2r(fix_141, mm1); // tmp21
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2059 // tmp20 = MULTIPLY(z12, (FIX_1_082392200- FIX_1_847759065)) /* 2*(c2-c6) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2060 // + MULTIPLY(z10, - FIX_1_847759065); /* 2*c2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2061 psllw_i2r(2, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2062 movq_r2r(mm0, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2063
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2064 pmulhw_m2r(fix_n184, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2065 movq_r2r(mm3, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2066
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2067 movq_m2r(*(wsptr), mm2); // tmp0,final1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2068
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2069 pmulhw_m2r(fix_108n184, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2070 // tmp22 = MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) /* -2*(c2+c6) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2071 // + MULTIPLY(z12, FIX_1_847759065); /* 2*c2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2072 movq_r2r(mm2, mm4); // final1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2073
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2074 pmulhw_m2r(fix_184n261, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2075 paddw_r2r(mm5, mm2); // tmp0+tmp7,final1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2076
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2077 pmulhw_m2r(fix_184, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2078 psubw_r2r(mm5, mm4); // tmp0-tmp7,final1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2079
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2080 // tmp6 = tmp22 - tmp7; /* phase 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2081 psraw_i2r(3, mm2); // outptr[0,0],[1,0],[2,0],[3,0],final1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2082
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2083 paddw_r2r(mm6, mm7); // tmp20
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2084 psraw_i2r(3, mm4); // outptr[0,7],[1,7],[2,7],[3,7],final1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2085
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2086 paddw_r2r(mm0, mm3); // tmp22
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2087
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2088 // tmp5 = tmp21 - tmp6;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2089 psubw_r2r(mm5, mm3); // tmp6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2090
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2091 // tmp4 = tmp20 + tmp5;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2092 movq_m2r(*(wsptr+1), mm0); // tmp1,final2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2093 psubw_r2r(mm3, mm1); // tmp5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2094
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2095 movq_r2r(mm0, mm6); // final2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2096 paddw_r2r(mm3, mm0); // tmp1+tmp6,final2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2097
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2098 /* Final output stage: scale down by a factor of 8 and range-limit */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2099
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2100
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2101 // outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2102 // & RANGE_MASK];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2103 // outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2104 // & RANGE_MASK]; final1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2105
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2106
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2107 // outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2108 // & RANGE_MASK];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2109 // outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2110 // & RANGE_MASK]; final2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2111 psubw_r2r(mm3, mm6); // tmp1-tmp6,final2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2112 psraw_i2r(3, mm0); // outptr[0,1],[1,1],[2,1],[3,1]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2113
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2114 psraw_i2r(3, mm6); // outptr[0,6],[1,6],[2,6],[3,6]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2115
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2116 packuswb_r2r(mm4, mm0); // out[0,1],[1,1],[2,1],[3,1],[0,7],[1,7],[2,7],[3,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2117
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2118 movq_m2r(*(wsptr+2), mm5); // tmp2,final3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2119 packuswb_r2r(mm6, mm2); // out[0,0],[1,0],[2,0],[3,0],[0,6],[1,6],[2,6],[3,6]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2120
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2121 // outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2122 // & RANGE_MASK];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2123 // outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2124 // & RANGE_MASK]; final3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2125 paddw_r2r(mm1, mm7); // tmp4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2126 movq_r2r(mm5, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2127
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2128 paddw_r2r(mm1, mm5); // tmp2+tmp5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2129 psubw_r2r(mm1, mm3); // tmp2-tmp5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2130
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2131 psraw_i2r(3, mm5); // outptr[0,2],[1,2],[2,2],[3,2]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2132
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2133 movq_m2r(*(wsptr+3), mm4); // tmp3,final4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2134 psraw_i2r(3, mm3); // outptr[0,5],[1,5],[2,5],[3,5]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2135
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2136
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2137
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2138 // outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2139 // & RANGE_MASK];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2140 // outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2141 // & RANGE_MASK]; final4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2142 movq_r2r(mm4, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2143 paddw_r2r(mm7, mm4); // tmp3+tmp4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2144
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2145 psubw_r2r(mm7, mm6); // tmp3-tmp4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2146 psraw_i2r(3, mm4); // outptr[0,4],[1,4],[2,4],[3,4]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2147
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2148 // mov ecx, [dataptr]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2149
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2150 psraw_i2r(3, mm6); // outptr[0,3],[1,3],[2,3],[3,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2151
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2152 packuswb_r2r(mm4, mm5); // out[0,2],[1,2],[2,2],[3,2],[0,4],[1,4],[2,4],[3,4]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2153
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2154 packuswb_r2r(mm3, mm6); // out[0,3],[1,3],[2,3],[3,3],[0,5],[1,5],[2,5],[3,5]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2155 movq_r2r(mm2, mm4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2156
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2157 movq_r2r(mm5, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2158 punpcklbw_r2r(mm0, mm2); // out[0,0],[0,1],[1,0],[1,1],[2,0],[2,1],[3,0],[3,1]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2159
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2160 punpckhbw_r2r(mm0, mm4); // out[0,6],[0,7],[1,6],[1,7],[2,6],[2,7],[3,6],[3,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2161 movq_r2r(mm2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2162
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2163 punpcklbw_r2r(mm6, mm5); // out[0,2],[0,3],[1,2],[1,3],[2,2],[2,3],[3,2],[3,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2164
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2165 // add dataptr, 4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2166
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2167 punpckhbw_r2r(mm6, mm7); // out[0,4],[0,5],[1,4],[1,5],[2,4],[2,5],[3,4],[3,5]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2168
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2169 punpcklwd_r2r(mm5, mm2); // out[0,0],[0,1],[0,2],[0,3],[1,0],[1,1],[1,2],[1,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2170
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2171 // add ecx, output_col
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2172
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2173 movq_r2r(mm7, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2174 punpckhwd_r2r(mm5, mm1); // out[2,0],[2,1],[2,2],[2,3],[3,0],[3,1],[3,2],[3,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2175
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2176 movq_r2r(mm2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2177 punpcklwd_r2r(mm4, mm6); // out[0,4],[0,5],[0,6],[0,7],[1,4],[1,5],[1,6],[1,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2178
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2179 // mov idata, [dataptr]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2180
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2181 punpckldq_r2r(mm6, mm2); // out[0,0],[0,1],[0,2],[0,3],[0,4],[0,5],[0,6],[0,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2182
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2183 // add dataptr, 4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2184
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2185 movq_r2r(mm1, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2186
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2187 // add idata, output_col
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2188
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2189 punpckhwd_r2r(mm4, mm7); // out[2,4],[2,5],[2,6],[2,7],[3,4],[3,5],[3,6],[3,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2190
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2191 movq_r2m(mm2, *(dataptr));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2192
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2193 punpckhdq_r2r(mm6, mm0); // out[1,0],[1,1],[1,2],[1,3],[1,4],[1,5],[1,6],[1,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2194
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2195 dataptr += rskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2196 movq_r2m(mm0, *(dataptr));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2197
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2198 punpckldq_r2r(mm7, mm1); // out[2,0],[2,1],[2,2],[2,3],[2,4],[2,5],[2,6],[2,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2199 punpckhdq_r2r(mm7, mm3); // out[3,0],[3,1],[3,2],[3,3],[3,4],[3,5],[3,6],[3,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2200
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2201 dataptr += rskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2202 movq_r2m(mm1, *(dataptr));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2203
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2204 dataptr += rskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2205 movq_r2m(mm3, *(dataptr));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2206
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2207 /*******************************************************************/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2208
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2209 wsptr += 8;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2210
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2211 /*******************************************************************/
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2212
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2213 // tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2214 // tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2215 // tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2216 // tmp14 = ((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2217 movq_m2r(*(wsptr), mm0); // wsptr[0,0],[0,1],[0,2],[0,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2218
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2219 movq_m2r(*(wsptr+1), mm1); // wsptr[0,4],[0,5],[0,6],[0,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2220 movq_r2r(mm0, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2221
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2222 movq_m2r(*(wsptr+2), mm3); // wsptr[1,0],[1,1],[1,2],[1,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2223 paddw_r2r(mm1, mm0); // wsptr[0,tmp10],[xxx],[0,tmp13],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2224
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2225 movq_m2r(*(wsptr+3), mm4); // wsptr[1,4],[1,5],[1,6],[1,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2226 psubw_r2r(mm1, mm2); // wsptr[0,tmp11],[xxx],[0,tmp14],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2227
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2228 movq_r2r(mm0, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2229 movq_r2r(mm3, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2230
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2231 paddw_r2r(mm4, mm3); // wsptr[1,tmp10],[xxx],[1,tmp13],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2232 movq_r2r(mm2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2233
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2234 psubw_r2r(mm4, mm5); // wsptr[1,tmp11],[xxx],[1,tmp14],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2235 punpcklwd_r2r(mm3, mm0); // wsptr[0,tmp10],[1,tmp10],[xxx],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2236
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2237 movq_m2r(*(wsptr+7), mm7); // wsptr[3,4],[3,5],[3,6],[3,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2238 punpckhwd_r2r(mm3, mm6); // wsptr[0,tmp13],[1,tmp13],[xxx],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2239
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2240 movq_m2r(*(wsptr+4), mm3); // wsptr[2,0],[2,1],[2,2],[2,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2241 punpckldq_r2r(mm6, mm0); // wsptr[0,tmp10],[1,tmp10],[0,tmp13],[1,tmp13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2242
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2243 punpcklwd_r2r(mm5, mm1); // wsptr[0,tmp11],[1,tmp11],[xxx],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2244 movq_r2r(mm3, mm4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2245
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2246 movq_m2r(*(wsptr+6), mm6); // wsptr[3,0],[3,1],[3,2],[3,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2247 punpckhwd_r2r(mm5, mm2); // wsptr[0,tmp14],[1,tmp14],[xxx],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2248
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2249 movq_m2r(*(wsptr+5), mm5); // wsptr[2,4],[2,5],[2,6],[2,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2250 punpckldq_r2r(mm2, mm1); // wsptr[0,tmp11],[1,tmp11],[0,tmp14],[1,tmp14]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2251
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2252 paddw_r2r(mm5, mm3); // wsptr[2,tmp10],[xxx],[2,tmp13],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2253 movq_r2r(mm6, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2254
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2255 psubw_r2r(mm5, mm4); // wsptr[2,tmp11],[xxx],[2,tmp14],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2256 paddw_r2r(mm7, mm6); // wsptr[3,tmp10],[xxx],[3,tmp13],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2257
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2258 movq_r2r(mm3, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2259 punpcklwd_r2r(mm6, mm3); // wsptr[2,tmp10],[3,tmp10],[xxx],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2260
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2261 psubw_r2r(mm7, mm2); // wsptr[3,tmp11],[xxx],[3,tmp14],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2262 punpckhwd_r2r(mm6, mm5); // wsptr[2,tmp13],[3,tmp13],[xxx],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2263
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2264 movq_r2r(mm4, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2265 punpckldq_r2r(mm5, mm3); // wsptr[2,tmp10],[3,tmp10],[2,tmp13],[3,tmp13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2266
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2267 punpcklwd_r2r(mm2, mm4); // wsptr[2,tmp11],[3,tmp11],[xxx],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2268
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2269 punpckhwd_r2r(mm2, mm7); // wsptr[2,tmp14],[3,tmp14],[xxx],[xxx]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2270
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2271 punpckldq_r2r(mm7, mm4); // wsptr[2,tmp11],[3,tmp11],[2,tmp14],[3,tmp14]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2272 movq_r2r(mm1, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2273
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2274 //OK
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2275
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2276 // mm0 = ;wsptr[0,tmp10],[1,tmp10],[0,tmp13],[1,tmp13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2277 // mm1 = ;wsptr[0,tmp11],[1,tmp11],[0,tmp14],[1,tmp14]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2278
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2279 movq_r2r(mm0, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2280 punpckhdq_r2r(mm4, mm6); // wsptr[0,tmp14],[1,tmp14],[2,tmp14],[3,tmp14]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2281
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2282 punpckldq_r2r(mm4, mm1); // wsptr[0,tmp11],[1,tmp11],[2,tmp11],[3,tmp11]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2283 psllw_i2r(2, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2284
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2285 pmulhw_m2r(fix_141, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2286 punpckldq_r2r(mm3, mm0); // wsptr[0,tmp10],[1,tmp10],[2,tmp10],[3,tmp10]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2287
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2288 punpckhdq_r2r(mm3, mm2); // wsptr[0,tmp13],[1,tmp13],[2,tmp13],[3,tmp13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2289 movq_r2r(mm0, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2290
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2291 // tmp0 = tmp10 + tmp13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2292 // tmp3 = tmp10 - tmp13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2293 paddw_r2r(mm2, mm0); // [0,tmp0],[1,tmp0],[2,tmp0],[3,tmp0]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2294 psubw_r2r(mm2, mm7); // [0,tmp3],[1,tmp3],[2,tmp3],[3,tmp3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2295
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2296 // tmp12 = MULTIPLY(tmp14, FIX_1_414213562) - tmp13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2297 psubw_r2r(mm2, mm6); // wsptr[0,tmp12],[1,tmp12],[2,tmp12],[3,tmp12]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2298 // tmp1 = tmp11 + tmp12;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2299 // tmp2 = tmp11 - tmp12;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2300 movq_r2r(mm1, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2301
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2302 //OK
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2303
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2304
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2305 /* Odd part */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2306
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2307 // z13 = (DCTELEM) wsptr[5] + (DCTELEM) wsptr[3];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2308 // z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2309 // z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2310 // z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2311 movq_m2r(*(wsptr), mm3); // wsptr[0,0],[0,1],[0,2],[0,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2312 paddw_r2r(mm6, mm1); // [0,tmp1],[1,tmp1],[2,tmp1],[3,tmp1]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2313
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2314 movq_m2r(*(wsptr+1), mm4); // wsptr[0,4],[0,5],[0,6],[0,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2315 psubw_r2r(mm6, mm5); // [0,tmp2],[1,tmp2],[2,tmp2],[3,tmp2]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2316
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2317 movq_r2r(mm3, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2318 punpckldq_r2r(mm4, mm3); // wsptr[0,0],[0,1],[0,4],[0,5]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2319
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2320 punpckhdq_r2r(mm6, mm4); // wsptr[0,6],[0,7],[0,2],[0,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2321 movq_r2r(mm3, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2322
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2323 //Save tmp0 and tmp1 in wsptr
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2324 movq_r2m(mm0, *(wsptr)); // save tmp0
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2325 paddw_r2r(mm4, mm2); // wsptr[xxx],[0,z11],[xxx],[0,z13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2326
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2327
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2328 //Continue with z10 --- z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2329 movq_m2r(*(wsptr+2), mm6); // wsptr[1,0],[1,1],[1,2],[1,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2330 psubw_r2r(mm4, mm3); // wsptr[xxx],[0,z12],[xxx],[0,z10]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2331
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2332 movq_m2r(*(wsptr+3), mm0); // wsptr[1,4],[1,5],[1,6],[1,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2333 movq_r2r(mm6, mm4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2334
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2335 movq_r2m(mm1, *(wsptr+1)); // save tmp1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2336 punpckldq_r2r(mm0, mm6); // wsptr[1,0],[1,1],[1,4],[1,5]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2337
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2338 punpckhdq_r2r(mm4, mm0); // wsptr[1,6],[1,7],[1,2],[1,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2339 movq_r2r(mm6, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2340
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2341 //Save tmp2 and tmp3 in wsptr
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2342 paddw_r2r(mm0, mm6); // wsptr[xxx],[1,z11],[xxx],[1,z13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2343 movq_r2r(mm2, mm4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2344
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2345 //Continue with z10 --- z13
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2346 movq_r2m(mm5, *(wsptr+2)); // save tmp2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2347 punpcklwd_r2r(mm6, mm2); // wsptr[xxx],[xxx],[0,z11],[1,z11]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2348
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2349 psubw_r2r(mm0, mm1); // wsptr[xxx],[1,z12],[xxx],[1,z10]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2350 punpckhwd_r2r(mm6, mm4); // wsptr[xxx],[xxx],[0,z13],[1,z13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2351
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2352 movq_r2r(mm3, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2353 punpcklwd_r2r(mm1, mm3); // wsptr[xxx],[xxx],[0,z12],[1,z12]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2354
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2355 movq_r2m(mm7, *(wsptr+3)); // save tmp3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2356 punpckhwd_r2r(mm1, mm0); // wsptr[xxx],[xxx],[0,z10],[1,z10]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2357
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2358 movq_m2r(*(wsptr+4), mm6); // wsptr[2,0],[2,1],[2,2],[2,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2359 punpckhdq_r2r(mm2, mm0); // wsptr[0,z10],[1,z10],[0,z11],[1,z11]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2360
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2361 movq_m2r(*(wsptr+5), mm7); // wsptr[2,4],[2,5],[2,6],[2,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2362 punpckhdq_r2r(mm4, mm3); // wsptr[0,z12],[1,z12],[0,z13],[1,z13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2363
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2364 movq_m2r(*(wsptr+6), mm1); // wsptr[3,0],[3,1],[3,2],[3,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2365 movq_r2r(mm6, mm4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2366
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2367 punpckldq_r2r(mm7, mm6); // wsptr[2,0],[2,1],[2,4],[2,5]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2368 movq_r2r(mm1, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2369
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2370 punpckhdq_r2r(mm4, mm7); // wsptr[2,6],[2,7],[2,2],[2,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2371 movq_r2r(mm6, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2372
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2373 movq_m2r(*(wsptr+7), mm4); // wsptr[3,4],[3,5],[3,6],[3,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2374 paddw_r2r(mm7, mm6); // wsptr[xxx],[2,z11],[xxx],[2,z13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2375
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2376 psubw_r2r(mm7, mm2); // wsptr[xxx],[2,z12],[xxx],[2,z10]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2377 punpckldq_r2r(mm4, mm1); // wsptr[3,0],[3,1],[3,4],[3,5]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2378
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2379 punpckhdq_r2r(mm5, mm4); // wsptr[3,6],[3,7],[3,2],[3,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2380 movq_r2r(mm1, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2381
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2382 paddw_r2r(mm4, mm1); // wsptr[xxx],[3,z11],[xxx],[3,z13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2383 psubw_r2r(mm4, mm7); // wsptr[xxx],[3,z12],[xxx],[3,z10]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2384
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2385 movq_r2r(mm6, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2386 punpcklwd_r2r(mm1, mm6); // wsptr[xxx],[xxx],[2,z11],[3,z11]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2387
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2388 punpckhwd_r2r(mm1, mm5); // wsptr[xxx],[xxx],[2,z13],[3,z13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2389 movq_r2r(mm2, mm4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2390
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2391 punpcklwd_r2r(mm7, mm2); // wsptr[xxx],[xxx],[2,z12],[3,z12]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2392
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2393 punpckhwd_r2r(mm7, mm4); // wsptr[xxx],[xxx],[2,z10],[3,z10]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2394
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2395 punpckhdq_r2r(mm6, mm4); // wsptr[2,z10],[3,z10],[2,z11],[3,z11]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2396
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2397 punpckhdq_r2r(mm5, mm2); // wsptr[2,z12],[3,z12],[2,z13],[3,z13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2398 movq_r2r(mm0, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2399
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2400 punpckldq_r2r(mm4, mm0); // wsptr[0,z10],[1,z10],[2,z10],[3,z10]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2401
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2402 punpckhdq_r2r(mm4, mm5); // wsptr[0,z11],[1,z11],[2,z11],[3,z11]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2403 movq_r2r(mm3, mm4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2404
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2405 punpckhdq_r2r(mm2, mm4); // wsptr[0,z13],[1,z13],[2,z13],[3,z13]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2406 movq_r2r(mm5, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2407
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2408 punpckldq_r2r(mm2, mm3); // wsptr[0,z12],[1,z12],[2,z12],[3,z12]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2409 // tmp7 = z11 + z13; /* phase 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2410 // tmp8 = z11 - z13; /* phase 5 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2411 psubw_r2r(mm4, mm1); // tmp8
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2412
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2413 paddw_r2r(mm4, mm5); // tmp7
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2414 // tmp21 = MULTIPLY(tmp8, FIX_1_414213562); /* 2*c4 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2415 psllw_i2r(2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2416
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2417 psllw_i2r(2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2418
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2419 pmulhw_m2r(fix_141, mm1); // tmp21
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2420 // tmp20 = MULTIPLY(z12, (FIX_1_082392200- FIX_1_847759065)) /* 2*(c2-c6) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2421 // + MULTIPLY(z10, - FIX_1_847759065); /* 2*c2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2422 psllw_i2r(2, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2423 movq_r2r(mm0, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2424
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2425 pmulhw_m2r(fix_n184, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2426 movq_r2r(mm3, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2427
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2428 movq_m2r(*(wsptr), mm2); // tmp0,final1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2429
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2430 pmulhw_m2r(fix_108n184, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2431 // tmp22 = MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) /* -2*(c2+c6) */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2432 // + MULTIPLY(z12, FIX_1_847759065); /* 2*c2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2433 movq_r2r(mm2, mm4); // final1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2434
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2435 pmulhw_m2r(fix_184n261, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2436 paddw_r2r(mm5, mm2); // tmp0+tmp7,final1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2437
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2438 pmulhw_m2r(fix_184, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2439 psubw_r2r(mm5, mm4); // tmp0-tmp7,final1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2440
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2441 // tmp6 = tmp22 - tmp7; /* phase 2 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2442 psraw_i2r(3, mm2); // outptr[0,0],[1,0],[2,0],[3,0],final1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2443
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2444 paddw_r2r(mm6, mm7); // tmp20
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2445 psraw_i2r(3, mm4); // outptr[0,7],[1,7],[2,7],[3,7],final1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2446
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2447 paddw_r2r(mm0, mm3); // tmp22
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2448
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2449 // tmp5 = tmp21 - tmp6;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2450 psubw_r2r(mm5, mm3); // tmp6
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2451
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2452 // tmp4 = tmp20 + tmp5;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2453 movq_m2r(*(wsptr+1), mm0); // tmp1,final2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2454 psubw_r2r(mm3, mm1); // tmp5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2455
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2456 movq_r2r(mm0, mm6); // final2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2457 paddw_r2r(mm3, mm0); // tmp1+tmp6,final2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2458
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2459 /* Final output stage: scale down by a factor of 8 and range-limit */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2460
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2461 // outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2462 // & RANGE_MASK];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2463 // outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2464 // & RANGE_MASK]; final1
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2465
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2466
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2467 // outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2468 // & RANGE_MASK];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2469 // outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2470 // & RANGE_MASK]; final2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2471 psubw_r2r(mm3, mm6); // tmp1-tmp6,final2
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2472 psraw_i2r(3, mm0); // outptr[0,1],[1,1],[2,1],[3,1]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2473
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2474 psraw_i2r(3, mm6); // outptr[0,6],[1,6],[2,6],[3,6]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2475
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2476 packuswb_r2r(mm4, mm0); // out[0,1],[1,1],[2,1],[3,1],[0,7],[1,7],[2,7],[3,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2477
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2478 movq_m2r(*(wsptr+2), mm5); // tmp2,final3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2479 packuswb_r2r(mm6, mm2); // out[0,0],[1,0],[2,0],[3,0],[0,6],[1,6],[2,6],[3,6]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2480
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2481 // outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2482 // & RANGE_MASK];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2483 // outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2484 // & RANGE_MASK]; final3
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2485 paddw_r2r(mm1, mm7); // tmp4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2486 movq_r2r(mm5, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2487
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2488 paddw_r2r(mm1, mm5); // tmp2+tmp5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2489 psubw_r2r(mm1, mm3); // tmp2-tmp5
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2490
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2491 psraw_i2r(3, mm5); // outptr[0,2],[1,2],[2,2],[3,2]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2492
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2493 movq_m2r(*(wsptr+3), mm4); // tmp3,final4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2494 psraw_i2r(3, mm3); // outptr[0,5],[1,5],[2,5],[3,5]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2495
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2496
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2497
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2498 // outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2499 // & RANGE_MASK];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2500 // outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2501 // & RANGE_MASK]; final4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2502 movq_r2r(mm4, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2503 paddw_r2r(mm7, mm4); // tmp3+tmp4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2504
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2505 psubw_r2r(mm7, mm6); // tmp3-tmp4
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2506 psraw_i2r(3, mm4); // outptr[0,4],[1,4],[2,4],[3,4]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2507
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2508 psraw_i2r(3, mm6); // outptr[0,3],[1,3],[2,3],[3,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2509
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2510 /*
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2511 movq_r2m(mm4, *dummy);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2512 fprintf(stderr, "3-4 %016llx\n", dummy);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2513 movq_r2m(mm4, *dummy);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2514 fprintf(stderr, "3+4 %016llx\n", dummy);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2515 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2516
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2517
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2518 packuswb_r2r(mm4, mm5); // out[0,2],[1,2],[2,2],[3,2],[0,4],[1,4],[2,4],[3,4]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2519
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2520 packuswb_r2r(mm3, mm6); // out[0,3],[1,3],[2,3],[3,3],[0,5],[1,5],[2,5],[3,5]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2521 movq_r2r(mm2, mm4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2522
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2523 movq_r2r(mm5, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2524 punpcklbw_r2r(mm0, mm2); // out[0,0],[0,1],[1,0],[1,1],[2,0],[2,1],[3,0],[3,1]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2525
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2526 punpckhbw_r2r(mm0, mm4); // out[0,6],[0,7],[1,6],[1,7],[2,6],[2,7],[3,6],[3,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2527 movq_r2r(mm2, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2528
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2529 punpcklbw_r2r(mm6, mm5); // out[0,2],[0,3],[1,2],[1,3],[2,2],[2,3],[3,2],[3,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2530
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2531 punpckhbw_r2r(mm6, mm7); // out[0,4],[0,5],[1,4],[1,5],[2,4],[2,5],[3,4],[3,5]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2532
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2533 punpcklwd_r2r(mm5, mm2); // out[0,0],[0,1],[0,2],[0,3],[1,0],[1,1],[1,2],[1,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2534
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2535 movq_r2r(mm7, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2536 punpckhwd_r2r(mm5, mm1); // out[2,0],[2,1],[2,2],[2,3],[3,0],[3,1],[3,2],[3,3]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2537
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2538 movq_r2r(mm2, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2539 punpcklwd_r2r(mm4, mm6); // out[0,4],[0,5],[0,6],[0,7],[1,4],[1,5],[1,6],[1,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2540
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2541 punpckldq_r2r(mm6, mm2); // out[0,0],[0,1],[0,2],[0,3],[0,4],[0,5],[0,6],[0,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2542
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2543 movq_r2r(mm1, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2544
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2545 punpckhwd_r2r(mm4, mm7); // out[2,4],[2,5],[2,6],[2,7],[3,4],[3,5],[3,6],[3,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2546
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2547 dataptr += rskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2548 movq_r2m(mm2, *(dataptr));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2549
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2550 punpckhdq_r2r(mm6, mm0); // out[1,0],[1,1],[1,2],[1,3],[1,4],[1,5],[1,6],[1,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2551
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2552 dataptr += rskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2553 movq_r2m(mm0, *(dataptr));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2554
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2555 punpckldq_r2r(mm7, mm1); // out[2,0],[2,1],[2,2],[2,3],[2,4],[2,5],[2,6],[2,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2556
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2557 punpckhdq_r2r(mm7, mm3); // out[3,0],[3,1],[3,2],[3,3],[3,4],[3,5],[3,6],[3,7]
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2558
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2559 dataptr += rskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2560 movq_r2m(mm1, *(dataptr));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2561
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2562 dataptr += rskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2563 movq_r2m(mm3, *(dataptr));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2564
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2565 #else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2566 __s32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2567 __s32 tmp10, tmp11, tmp12, tmp13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2568 __s32 z5, z10, z11, z12, z13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2569 __s16 *inptr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2570 __s32 *wsptr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2571 __u8 *outptr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2572 int ctr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2573 __s32 dcval;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2574 __s32 workspace[64];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2575
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2576 inptr = data;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2577 wsptr = workspace;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2578 for (ctr = 8; ctr > 0; ctr--) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2579
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2580 if ((inptr[8] | inptr[16] | inptr[24] |
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2581 inptr[32] | inptr[40] | inptr[48] | inptr[56]) == 0) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2582 dcval = inptr[0];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2583 wsptr[0] = dcval;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2584 wsptr[8] = dcval;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2585 wsptr[16] = dcval;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2586 wsptr[24] = dcval;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2587 wsptr[32] = dcval;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2588 wsptr[40] = dcval;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2589 wsptr[48] = dcval;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2590 wsptr[56] = dcval;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2591
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2592 inptr++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2593 wsptr++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2594 continue;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2595 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2596
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2597 tmp0 = inptr[0];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2598 tmp1 = inptr[16];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2599 tmp2 = inptr[32];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2600 tmp3 = inptr[48];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2601
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2602 tmp10 = tmp0 + tmp2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2603 tmp11 = tmp0 - tmp2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2604
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2605 tmp13 = tmp1 + tmp3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2606 tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2607
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2608 tmp0 = tmp10 + tmp13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2609 tmp3 = tmp10 - tmp13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2610 tmp1 = tmp11 + tmp12;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2611 tmp2 = tmp11 - tmp12;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2612
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2613 tmp4 = inptr[8];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2614 tmp5 = inptr[24];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2615 tmp6 = inptr[40];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2616 tmp7 = inptr[56];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2617
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2618 z13 = tmp6 + tmp5;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2619 z10 = tmp6 - tmp5;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2620 z11 = tmp4 + tmp7;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2621 z12 = tmp4 - tmp7;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2622
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2623 tmp7 = z11 + z13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2624 tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2625
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2626 z5 = MULTIPLY(z10 + z12, FIX_1_847759065);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2627 tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2628 tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2629
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2630 tmp6 = tmp12 - tmp7;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2631 tmp5 = tmp11 - tmp6;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2632 tmp4 = tmp10 + tmp5;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2633
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2634 wsptr[0] = (__s32) (tmp0 + tmp7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2635 wsptr[56] = (__s32) (tmp0 - tmp7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2636 wsptr[8] = (__s32) (tmp1 + tmp6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2637 wsptr[48] = (__s32) (tmp1 - tmp6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2638 wsptr[16] = (__s32) (tmp2 + tmp5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2639 wsptr[40] = (__s32) (tmp2 - tmp5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2640 wsptr[32] = (__s32) (tmp3 + tmp4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2641 wsptr[24] = (__s32) (tmp3 - tmp4);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2642
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2643 inptr++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2644 wsptr++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2645 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2646
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2647 wsptr = workspace;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2648 for (ctr = 0; ctr < 8; ctr++) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2649 outptr = &(odata[ctr*rskip]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2650
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2651 tmp10 = wsptr[0] + wsptr[4];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2652 tmp11 = wsptr[0] - wsptr[4];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2653
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2654 tmp13 = wsptr[2] + wsptr[6];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2655 tmp12 = MULTIPLY(wsptr[2] - wsptr[6], FIX_1_414213562) - tmp13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2656
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2657 tmp0 = tmp10 + tmp13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2658 tmp3 = tmp10 - tmp13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2659 tmp1 = tmp11 + tmp12;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2660 tmp2 = tmp11 - tmp12;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2661
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2662 z13 = wsptr[5] + wsptr[3];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2663 z10 = wsptr[5] - wsptr[3];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2664 z11 = wsptr[1] + wsptr[7];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2665 z12 = wsptr[1] - wsptr[7];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2666
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2667 tmp7 = z11 + z13;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2668 tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2669
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2670 z5 = MULTIPLY(z10 + z12, FIX_1_847759065);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2671 tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2672 tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2673
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2674 tmp6 = tmp12 - tmp7;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2675 tmp5 = tmp11 - tmp6;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2676 tmp4 = tmp10 + tmp5;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2677
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2678 outptr[0] = RL(DESCALE(tmp0 + tmp7));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2679 outptr[7] = RL(DESCALE(tmp0 - tmp7));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2680 outptr[1] = RL(DESCALE(tmp1 + tmp6));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2681 outptr[6] = RL(DESCALE(tmp1 - tmp6));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2682 outptr[2] = RL(DESCALE(tmp2 + tmp5));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2683 outptr[5] = RL(DESCALE(tmp2 - tmp5));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2684 outptr[4] = RL(DESCALE(tmp3 + tmp4));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2685 outptr[3] = RL(DESCALE(tmp3 - tmp4));
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2686
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2687 wsptr += 8;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2688 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2689 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2690 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2691 /*
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2692
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2693 Main Routines
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2694
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2695 This file contains most of the initialisation and control functions
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2696
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2697 (C) Justin Schoeman 1998
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2698
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2699 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2700
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2701 /*
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2702
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2703 Private function
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2704
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2705 Initialise all the cache-aliged data blocks
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2706
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2707 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2708
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2709 void RTjpeg_init_data(void)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2710 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2711 unsigned long dptr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2712
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2713 dptr=(unsigned long)&(RTjpeg_alldata[0]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2714 dptr+=32;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2715 dptr=dptr>>5;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2716 dptr=dptr<<5; /* cache align data */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2717
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2718 RTjpeg_block=(__s16 *)dptr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2719 dptr+=sizeof(__s16)*64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2720 RTjpeg_lqt=(__s32 *)dptr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2721 dptr+=sizeof(__s32)*64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2722 RTjpeg_cqt=(__s32 *)dptr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2723 dptr+=sizeof(__s32)*64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2724 RTjpeg_liqt=(__u32 *)dptr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2725 dptr+=sizeof(__u32)*64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2726 RTjpeg_ciqt=(__u32 *)dptr;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2727 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2728
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2729 /*
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2730
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2731 External Function
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2732
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2733 Re-set quality factor
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2734
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2735 Input: buf -> pointer to 128 ints for quant values store to pass back to
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2736 init_decompress.
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2737 Q -> quality factor (192=best, 32=worst)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2738 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2739
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2740 void RTjpeg_init_Q(__u8 Q)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2741 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2742 int i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2743 __u64 qual;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2744
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2745 qual=(__u64)Q<<(32-7); /* 32 bit FP, 255=2, 0=0 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2746
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2747 for(i=0; i<64; i++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2748 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2749 RTjpeg_lqt[i]=(__s32)((qual/((__u64)RTjpeg_lum_quant_tbl[i]<<16))>>3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2750 if(RTjpeg_lqt[i]==0)RTjpeg_lqt[i]=1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2751 RTjpeg_cqt[i]=(__s32)((qual/((__u64)RTjpeg_chrom_quant_tbl[i]<<16))>>3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2752 if(RTjpeg_cqt[i]==0)RTjpeg_cqt[i]=1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2753 RTjpeg_liqt[i]=(1<<16)/(RTjpeg_lqt[i]<<3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2754 RTjpeg_ciqt[i]=(1<<16)/(RTjpeg_cqt[i]<<3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2755 RTjpeg_lqt[i]=((1<<16)/RTjpeg_liqt[i])>>3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2756 RTjpeg_cqt[i]=((1<<16)/RTjpeg_ciqt[i])>>3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2757 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2758
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2759 RTjpeg_lb8=0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2760 while(RTjpeg_liqt[RTjpeg_ZZ[++RTjpeg_lb8]]<=8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2761 RTjpeg_lb8--;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2762 RTjpeg_cb8=0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2763 while(RTjpeg_ciqt[RTjpeg_ZZ[++RTjpeg_cb8]]<=8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2764 RTjpeg_cb8--;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2765
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2766 RTjpeg_dct_init();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2767 RTjpeg_idct_init();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2768 RTjpeg_quant_init();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2769 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2770
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2771 /*
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2772
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2773 External Function
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2774
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2775 Initialise compression.
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2776
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2777 Input: buf -> pointer to 128 ints for quant values store to pass back to
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2778 init_decompress.
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2779 width -> width of image
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2780 height -> height of image
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2781 Q -> quality factor (192=best, 32=worst)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2782
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2783 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2784
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2785 void RTjpeg_init_compress(__u32 *buf, int width, int height, __u8 Q)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2786 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2787 int i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2788 __u64 qual;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2789
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2790 RTjpeg_init_data();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2791
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2792 RTjpeg_width=width;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2793 RTjpeg_height=height;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2794 RTjpeg_Ywidth = RTjpeg_width>>3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2795 RTjpeg_Ysize=width * height;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2796 RTjpeg_Cwidth = RTjpeg_width>>4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2797 RTjpeg_Csize= (width>>1) * height;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2798
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2799 qual=(__u64)Q<<(32-7); /* 32 bit FP, 255=2, 0=0 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2800
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2801 for(i=0; i<64; i++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2802 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2803 RTjpeg_lqt[i]=(__s32)((qual/((__u64)RTjpeg_lum_quant_tbl[i]<<16))>>3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2804 if(RTjpeg_lqt[i]==0)RTjpeg_lqt[i]=1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2805 RTjpeg_cqt[i]=(__s32)((qual/((__u64)RTjpeg_chrom_quant_tbl[i]<<16))>>3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2806 if(RTjpeg_cqt[i]==0)RTjpeg_cqt[i]=1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2807 RTjpeg_liqt[i]=(1<<16)/(RTjpeg_lqt[i]<<3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2808 RTjpeg_ciqt[i]=(1<<16)/(RTjpeg_cqt[i]<<3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2809 RTjpeg_lqt[i]=((1<<16)/RTjpeg_liqt[i])>>3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2810 RTjpeg_cqt[i]=((1<<16)/RTjpeg_ciqt[i])>>3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2811 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2812
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2813 RTjpeg_lb8=0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2814 while(RTjpeg_liqt[RTjpeg_ZZ[++RTjpeg_lb8]]<=8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2815 RTjpeg_lb8--;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2816 RTjpeg_cb8=0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2817 while(RTjpeg_ciqt[RTjpeg_ZZ[++RTjpeg_cb8]]<=8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2818 RTjpeg_cb8--;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2819
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2820 RTjpeg_dct_init();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2821 RTjpeg_quant_init();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2822
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2823 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
2824 buf[i]=le2me_32(RTjpeg_liqt[i]);
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2825 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
2826 buf[64+i]=le2me_32(RTjpeg_ciqt[i]);
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2827 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2828
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2829 void RTjpeg_init_decompress(__u32 *buf, int width, int height)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2830 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2831 int i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2832
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2833 RTjpeg_init_data();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2834
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2835 RTjpeg_width=width;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2836 RTjpeg_height=height;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2837 RTjpeg_Ywidth = RTjpeg_width>>3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2838 RTjpeg_Ysize=width * height;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2839 RTjpeg_Cwidth = RTjpeg_width>>4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2840 RTjpeg_Csize= (width>>1) * height;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2841
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2842 for(i=0; i<64; i++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2843 {
14896
9ddae5897422 Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents: 14642
diff changeset
2844 RTjpeg_liqt[i]=le2me_32(buf[i]);
9ddae5897422 Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents: 14642
diff changeset
2845 RTjpeg_ciqt[i]=le2me_32(buf[i+64]);
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2846 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2847
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2848 RTjpeg_lb8=0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2849 while(RTjpeg_liqt[RTjpeg_ZZ[++RTjpeg_lb8]]<=8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2850 RTjpeg_lb8--;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2851 RTjpeg_cb8=0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2852 while(RTjpeg_ciqt[RTjpeg_ZZ[++RTjpeg_cb8]]<=8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2853 RTjpeg_cb8--;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2854
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2855 RTjpeg_idct_init();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2856
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2857 // RTjpeg_color_init();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2858 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2859
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2860 int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2861 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2862 __s8 * sb;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2863 register __s8 * bp1 = bp + (RTjpeg_width<<3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2864 register __s8 * bp2 = bp + RTjpeg_Ysize;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2865 register __s8 * bp3 = bp2 + (RTjpeg_Csize>>1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2866 register int i, j, k;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2867
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2868 #ifdef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2869 emms();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2870 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2871 sb=sp;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2872 /* Y */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2873 for(i=RTjpeg_height>>1; i; i-=8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2874 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2875 for(j=0, k=0; j<RTjpeg_width; j+=16, k+=8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2876 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2877 RTjpeg_dctY(bp+j, RTjpeg_block, RTjpeg_Ywidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2878 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2879 sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2880
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2881 RTjpeg_dctY(bp+j+8, RTjpeg_block, RTjpeg_Ywidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2882 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2883 sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2884
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2885 RTjpeg_dctY(bp1+j, RTjpeg_block, RTjpeg_Ywidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2886 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2887 sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2888
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2889 RTjpeg_dctY(bp1+j+8, RTjpeg_block, RTjpeg_Ywidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2890 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2891 sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2892
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2893 RTjpeg_dctY(bp2+k, RTjpeg_block, RTjpeg_Cwidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2894 RTjpeg_quant(RTjpeg_block, RTjpeg_cqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2895 sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_cb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2896
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2897 RTjpeg_dctY(bp3+k, RTjpeg_block, RTjpeg_Cwidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2898 RTjpeg_quant(RTjpeg_block, RTjpeg_cqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2899 sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_cb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2900
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2901 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2902 bp+=RTjpeg_width<<4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2903 bp1+=RTjpeg_width<<4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2904 bp2+=RTjpeg_width<<2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2905 bp3+=RTjpeg_width<<2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2906
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2907 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2908 #ifdef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2909 emms();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2910 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2911 return (sp-sb);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2912 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2913
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2914 int RTjpeg_compressYUV422(__s8 *sp, unsigned char *bp)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2915 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2916 __s8 * sb;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2917 register __s8 * bp2 = bp + RTjpeg_Ysize;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2918 register __s8 * bp3 = bp2 + RTjpeg_Csize;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2919 register int i, j, k;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2920
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2921 #ifdef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2922 emms();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2923 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2924 sb=sp;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2925 /* Y */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2926 for(i=RTjpeg_height; i; i-=8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2927 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2928 for(j=0, k=0; j<RTjpeg_width; j+=16, k+=8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2929 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2930 RTjpeg_dctY(bp+j, RTjpeg_block, RTjpeg_Ywidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2931 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2932 sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2933
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2934 RTjpeg_dctY(bp+j+8, RTjpeg_block, RTjpeg_Ywidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2935 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2936 sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2937
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2938 RTjpeg_dctY(bp2+k, RTjpeg_block, RTjpeg_Cwidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2939 RTjpeg_quant(RTjpeg_block, RTjpeg_cqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2940 sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_cb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2941
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2942 RTjpeg_dctY(bp3+k, RTjpeg_block, RTjpeg_Cwidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2943 RTjpeg_quant(RTjpeg_block, RTjpeg_cqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2944 sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_cb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2945
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2946 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2947 bp+=RTjpeg_width<<3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2948 bp2+=RTjpeg_width<<2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2949 bp3+=RTjpeg_width<<2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2950
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2951 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2952 #ifdef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2953 emms();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2954 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2955 return (sp-sb);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2956 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2957
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2958 int RTjpeg_compress8(__s8 *sp, unsigned char *bp)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2959 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2960 __s8 * sb;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2961 int i, j;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2962
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2963 #ifdef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2964 emms();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2965 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2966
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2967 sb=sp;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2968 /* Y */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2969 for(i=0; i<RTjpeg_height; i+=8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2970 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2971 for(j=0; j<RTjpeg_width; j+=8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2972 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2973 RTjpeg_dctY(bp+j, RTjpeg_block, RTjpeg_width);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2974 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2975 sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2976 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2977 bp+=RTjpeg_width;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2978 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2979
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2980 #ifdef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2981 emms();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2982 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2983 return (sp-sb);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2984 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2985
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2986 void RTjpeg_decompressYUV422(__s8 *sp, __u8 *bp)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2987 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2988 register __s8 * bp2 = bp + RTjpeg_Ysize;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2989 register __s8 * bp3 = bp2 + (RTjpeg_Csize);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2990 int i, j,k;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2991
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2992 #ifdef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2993 emms();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2994 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2995
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2996 /* Y */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2997 for(i=RTjpeg_height; i; i-=8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2998 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
2999 for(k=0, j=0; j<RTjpeg_width; j+=16, k+=8) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3000 if(*sp==-1)sp++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3001 else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3002 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3003 sp+=RTjpeg_s2b(RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3004 RTjpeg_idct(bp+j, RTjpeg_block, RTjpeg_width);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3005 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3006 if(*sp==-1)sp++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3007 else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3008 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3009 sp+=RTjpeg_s2b(RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3010 RTjpeg_idct(bp+j+8, RTjpeg_block, RTjpeg_width);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3011 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3012 if(*sp==-1)sp++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3013 else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3014 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3015 sp+=RTjpeg_s2b(RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3016 RTjpeg_idct(bp2+k, RTjpeg_block, RTjpeg_width>>1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3017 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3018 if(*sp==-1)sp++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3019 else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3020 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3021 sp+=RTjpeg_s2b(RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3022 RTjpeg_idct(bp3+k, RTjpeg_block, RTjpeg_width>>1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3023 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3024 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3025 bp+=RTjpeg_width<<3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3026 bp2+=RTjpeg_width<<2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3027 bp3+=RTjpeg_width<<2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3028 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3029 #ifdef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3030 emms();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3031 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3032 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3033
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3034 void RTjpeg_decompressYUV420(__s8 *sp, __u8 *bp)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3035 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3036 register __s8 * bp1 = bp + (RTjpeg_width<<3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3037 register __s8 * bp2 = bp + RTjpeg_Ysize;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3038 register __s8 * bp3 = bp2 + (RTjpeg_Csize>>1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3039 int i, j,k;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3040
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3041 #ifdef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3042 emms();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3043 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3044
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3045 /* Y */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3046 for(i=RTjpeg_height>>1; i; i-=8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3047 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3048 for(k=0, j=0; j<RTjpeg_width; j+=16, k+=8) {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3049 if(*sp==-1)sp++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3050 else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3051 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3052 sp+=RTjpeg_s2b(RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3053 RTjpeg_idct(bp+j, RTjpeg_block, RTjpeg_width);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3054 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3055 if(*sp==-1)sp++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3056 else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3057 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3058 sp+=RTjpeg_s2b(RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3059 RTjpeg_idct(bp+j+8, RTjpeg_block, RTjpeg_width);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3060 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3061 if(*sp==-1)sp++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3062 else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3063 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3064 sp+=RTjpeg_s2b(RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3065 RTjpeg_idct(bp1+j, RTjpeg_block, RTjpeg_width);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3066 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3067 if(*sp==-1)sp++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3068 else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3069 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3070 sp+=RTjpeg_s2b(RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3071 RTjpeg_idct(bp1+j+8, RTjpeg_block, RTjpeg_width);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3072 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3073 if(*sp==-1)sp++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3074 else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3075 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3076 sp+=RTjpeg_s2b(RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3077 RTjpeg_idct(bp2+k, RTjpeg_block, RTjpeg_width>>1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3078 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3079 if(*sp==-1)sp++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3080 else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3081 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3082 sp+=RTjpeg_s2b(RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3083 RTjpeg_idct(bp3+k, RTjpeg_block, RTjpeg_width>>1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3084 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3085 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3086 bp+=RTjpeg_width<<4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3087 bp1+=RTjpeg_width<<4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3088 bp2+=RTjpeg_width<<2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3089 bp3+=RTjpeg_width<<2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3090 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3091 #ifdef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3092 emms();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3093 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3094 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3095
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3096 void RTjpeg_decompress8(__s8 *sp, __u8 *bp)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3097 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3098 int i, j;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3099
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3100 #ifdef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3101 emms();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3102 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3103
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3104 /* Y */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3105 for(i=0; i<RTjpeg_height; i+=8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3106 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3107 for(j=0; j<RTjpeg_width; j+=8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3108 if(*sp==-1)sp++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3109 else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3110 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3111 sp+=RTjpeg_s2b(RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3112 RTjpeg_idct(bp+j, RTjpeg_block, RTjpeg_width);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3113 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3114 bp+=RTjpeg_width<<3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3115 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3116 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3117
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3118 /*
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3119 External Function
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3120
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3121 Initialise additional data structures for motion compensation
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3122
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3123 */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3124
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3125 void RTjpeg_init_mcompress(void)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3126 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3127 unsigned long tmp;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3128
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3129 if(!RTjpeg_old)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3130 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3131 RTjpeg_old=malloc((4*RTjpeg_width*RTjpeg_height)+32);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3132 tmp=(unsigned long)RTjpeg_old;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3133 tmp+=32;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3134 tmp=tmp>>5;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3135 RTjpeg_old=(__s16 *)(tmp<<5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3136 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3137 if (!RTjpeg_old)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3138 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3139 fprintf(stderr, "RTjpeg: Could not allocate memory\n");
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3140 exit(-1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3141 }
14642
38572280e8e7 bzero is deprecated patch by Gianluigi Tiesi <mplayer at netfarm.it>
faust3
parents: 12928
diff changeset
3142 memset(RTjpeg_old, 0, ((4*RTjpeg_width*RTjpeg_height)));
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3143 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3144
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3145 #ifdef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3146
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3147 int RTjpeg_bcomp(__s16 *old, mmx_t *mask)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3148 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3149 int i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3150 mmx_t *mold=(mmx_t *)old;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3151 mmx_t *mblock=(mmx_t *)RTjpeg_block;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3152 volatile mmx_t result;
12928
bc760f3f129e ICC 8.0 compilation fixes
atmos4
parents: 12378
diff changeset
3153 static mmx_t neg={0xffffffffffffffffULL};
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3154
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3155 movq_m2r(*mask, mm7);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3156 movq_m2r(neg, mm6);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3157 pxor_r2r(mm5, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3158
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3159 for(i=0; i<8; i++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3160 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3161 movq_m2r(*(mblock++), mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3162 movq_m2r(*(mblock++), mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3163 movq_m2r(*(mold++), mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3164 movq_m2r(*(mold++), mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3165 psubsw_r2r(mm1, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3166 psubsw_r2r(mm3, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3167 movq_r2r(mm0, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3168 movq_r2r(mm2, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3169 pcmpgtw_r2r(mm7, mm0);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3170 pcmpgtw_r2r(mm7, mm2);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3171 pxor_r2r(mm6, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3172 pxor_r2r(mm6, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3173 pcmpgtw_r2r(mm7, mm1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3174 pcmpgtw_r2r(mm7, mm3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3175 por_r2r(mm0, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3176 por_r2r(mm2, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3177 por_r2r(mm1, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3178 por_r2r(mm3, mm5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3179 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3180 movq_r2m(mm5, result);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3181
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3182 if(result.q)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3183 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3184 // if(!RTjpeg_mtest)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3185 // for(i=0; i<16; i++)((__u64 *)old)[i]=((__u64 *)RTjpeg_block)[i];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3186 return 0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3187 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3188 // printf(".");
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3189 return 1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3190 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3191
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3192 #else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3193 int RTjpeg_bcomp(__s16 *old, __u16 *mask)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3194 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3195 int i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3196
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3197 for(i=0; i<64; i++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3198 if(abs(old[i]-RTjpeg_block[i])>*mask)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3199 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3200 if(!RTjpeg_mtest)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3201 for(i=0; i<16; i++)((__u64 *)old)[i]=((__u64 *)RTjpeg_block)[i];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3202 return 0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3203 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3204 return 1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3205 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3206 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3207
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3208 void RTjpeg_set_test(int i)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3209 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3210 RTjpeg_mtest=i;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3211 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3212
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3213 int RTjpeg_mcompressYUV420(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3214 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3215 __s8 * sb;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3216 //rh __s16 *block;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3217 register __s8 * bp1 = bp + (RTjpeg_width<<3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3218 register __s8 * bp2 = bp + RTjpeg_Ysize;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3219 register __s8 * bp3 = bp2 + (RTjpeg_Csize>>1);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3220 register int i, j, k;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3221
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3222 #ifdef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3223 emms();
16653
27b0d49988b2 Fix 100l bugs that break playback on 64 bit systems (like typedefing __u32
reimar
parents: 14896
diff changeset
3224 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
3225 RTjpeg_cmask.uq=((__u64)cmask<<48)|((__u64)cmask<<32)|((__u64)cmask<<16)|cmask;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3226 #else
16661
adb581352e63 Stupidity in last patch broke compile without MMX: RTjpeg_lmask is a union
reimar
parents: 16653
diff changeset
3227 RTjpeg_lmask=lmask;
adb581352e63 Stupidity in last patch broke compile without MMX: RTjpeg_lmask is a union
reimar
parents: 16653
diff changeset
3228 RTjpeg_cmask=cmask;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3229 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3230
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3231 sb=sp;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3232 block=RTjpeg_old;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3233 /* Y */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3234 for(i=RTjpeg_height>>1; i; i-=8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3235 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3236 for(j=0, k=0; j<RTjpeg_width; j+=16, k+=8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3237 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3238 RTjpeg_dctY(bp+j, RTjpeg_block, RTjpeg_Ywidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3239 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3240 if(RTjpeg_bcomp(block, &RTjpeg_lmask))
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3241 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3242 *((__u8 *)sp++)=255;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3243 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3244 else sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3245 block+=64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3246
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3247 RTjpeg_dctY(bp+j+8, RTjpeg_block, RTjpeg_Ywidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3248 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3249 if(RTjpeg_bcomp(block, &RTjpeg_lmask))
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3250 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3251 *((__u8 *)sp++)=255;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3252 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3253 else sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3254 block+=64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3255
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3256 RTjpeg_dctY(bp1+j, RTjpeg_block, RTjpeg_Ywidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3257 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3258 if(RTjpeg_bcomp(block, &RTjpeg_lmask))
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3259 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3260 *((__u8 *)sp++)=255;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3261 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3262 else sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3263 block+=64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3264
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3265 RTjpeg_dctY(bp1+j+8, RTjpeg_block, RTjpeg_Ywidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3266 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3267 if(RTjpeg_bcomp(block, &RTjpeg_lmask))
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3268 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3269 *((__u8 *)sp++)=255;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3270 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3271 else sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3272 block+=64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3273
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3274 RTjpeg_dctY(bp2+k, RTjpeg_block, RTjpeg_Cwidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3275 RTjpeg_quant(RTjpeg_block, RTjpeg_cqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3276 if(RTjpeg_bcomp(block, &RTjpeg_cmask))
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3277 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3278 *((__u8 *)sp++)=255;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3279 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3280 else sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_cb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3281 block+=64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3282
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3283 RTjpeg_dctY(bp3+k, RTjpeg_block, RTjpeg_Cwidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3284 RTjpeg_quant(RTjpeg_block, RTjpeg_cqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3285 if(RTjpeg_bcomp(block, &RTjpeg_cmask))
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3286 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3287 *((__u8 *)sp++)=255;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3288 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3289 else sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_cb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3290 block+=64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3291 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3292 bp+=RTjpeg_width<<4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3293 bp1+=RTjpeg_width<<4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3294 bp2+=RTjpeg_width<<2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3295 bp3+=RTjpeg_width<<2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3296
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3297 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3298 #ifdef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3299 emms();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3300 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3301 return (sp-sb);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3302 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3303
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3304
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3305 int RTjpeg_mcompressYUV422(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3306 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3307 __s8 * sb;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3308 __s16 *block;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3309 register __s8 * bp2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3310 register __s8 * bp3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3311 register int i, j, k;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3312
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3313 #ifdef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3314 emms();
16653
27b0d49988b2 Fix 100l bugs that break playback on 64 bit systems (like typedefing __u32
reimar
parents: 14896
diff changeset
3315 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
3316 RTjpeg_cmask.uq=((__u64)cmask<<48)|((__u64)cmask<<32)|((__u64)cmask<<16)|cmask;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3317 #else
16661
adb581352e63 Stupidity in last patch broke compile without MMX: RTjpeg_lmask is a union
reimar
parents: 16653
diff changeset
3318 RTjpeg_lmask=lmask;
adb581352e63 Stupidity in last patch broke compile without MMX: RTjpeg_lmask is a union
reimar
parents: 16653
diff changeset
3319 RTjpeg_cmask=cmask;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3320 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3321
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3322 bp = bp - RTjpeg_width*0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3323 bp2 = bp + RTjpeg_Ysize-RTjpeg_width*0;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3324 bp3 = bp2 + RTjpeg_Csize;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3325
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3326 sb=sp;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3327 block=RTjpeg_old;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3328 /* Y */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3329 for(i=RTjpeg_height; i; i-=8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3330 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3331 for(j=0, k=0; j<RTjpeg_width; j+=16, k+=8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3332 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3333 RTjpeg_dctY(bp+j, RTjpeg_block, RTjpeg_Ywidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3334 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3335 if(RTjpeg_bcomp(block, &RTjpeg_lmask))
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3336 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3337 *((__u8 *)sp++)=255;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3338 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3339 else sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3340 block+=64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3341
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3342 RTjpeg_dctY(bp+j+8, RTjpeg_block, RTjpeg_Ywidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3343 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3344 if(RTjpeg_bcomp(block, &RTjpeg_lmask))
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3345 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3346 *((__u8 *)sp++)=255;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3347 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3348 else sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3349 block+=64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3350
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3351 RTjpeg_dctY(bp2+k, RTjpeg_block, RTjpeg_Cwidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3352 RTjpeg_quant(RTjpeg_block, RTjpeg_cqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3353 if(RTjpeg_bcomp(block, &RTjpeg_cmask))
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3354 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3355 *((__u8 *)sp++)=255;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3356 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3357 else sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_cb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3358 block+=64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3359
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3360 RTjpeg_dctY(bp3+k, RTjpeg_block, RTjpeg_Cwidth);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3361 RTjpeg_quant(RTjpeg_block, RTjpeg_cqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3362 if(RTjpeg_bcomp(block, &RTjpeg_cmask))
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3363 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3364 *((__u8 *)sp++)=255;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3365 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3366 else sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_cb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3367 block+=64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3368
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3369 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3370 bp+=RTjpeg_width<<3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3371 bp2+=RTjpeg_width<<2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3372 bp3+=RTjpeg_width<<2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3373 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3374 printf ("%d\n", block - RTjpeg_old);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3375 #ifdef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3376 emms();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3377 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3378 return (sp-sb);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3379 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3380
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3381 int RTjpeg_mcompress8(__s8 *sp, unsigned char *bp, __u16 lmask)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3382 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3383 __s8 * sb;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3384 __s16 *block;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3385 int i, j;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3386
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3387 #ifdef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3388 emms();
16653
27b0d49988b2 Fix 100l bugs that break playback on 64 bit systems (like typedefing __u32
reimar
parents: 14896
diff changeset
3389 RTjpeg_lmask.uq=((__u64)lmask<<48)|((__u64)lmask<<32)|((__u64)lmask<<16)|lmask;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3390 #else
16661
adb581352e63 Stupidity in last patch broke compile without MMX: RTjpeg_lmask is a union
reimar
parents: 16653
diff changeset
3391 RTjpeg_lmask=lmask;
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3392 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3393
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3394
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3395 sb=sp;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3396 block=RTjpeg_old;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3397 /* Y */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3398 for(i=0; i<RTjpeg_height; i+=8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3399 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3400 for(j=0; j<RTjpeg_width; j+=8)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3401 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3402 RTjpeg_dctY(bp+j, RTjpeg_block, RTjpeg_width);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3403 RTjpeg_quant(RTjpeg_block, RTjpeg_lqt);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3404 if(RTjpeg_bcomp(block, &RTjpeg_lmask))
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3405 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3406 *((__u8 *)sp++)=255;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3407 // printf("* %d ", sp[-1]);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3408 } else sp+=RTjpeg_b2s(RTjpeg_block, sp, RTjpeg_lb8);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3409 block+=64;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3410 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3411 bp+=RTjpeg_width<<3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3412 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3413 #ifdef MMX
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3414 emms();
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3415 #endif
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3416 return (sp-sb);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3417 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3418
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3419 void RTjpeg_color_init(void)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3420 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3421 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3422
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3423 #define KcrR 76284
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3424 #define KcrG 53281
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3425 #define KcbG 25625
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3426 #define KcbB 132252
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3427 #define Ky 76284
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3428
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3429 void RTjpeg_yuv422rgb(__u8 *buf, __u8 *rgb, int stride)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3430 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3431 int tmp;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3432 int i, j;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3433 __s32 y, crR, crG, cbG, cbB;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3434 __u8 *bufcr, *bufcb, *bufy, *bufoute;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3435 int yskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3436
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3437 yskip=RTjpeg_width;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3438
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3439 bufcb=&buf[RTjpeg_width*RTjpeg_height];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3440 bufcr=&buf[RTjpeg_width*RTjpeg_height+(RTjpeg_width*RTjpeg_height)/2];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3441 bufy=&buf[0];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3442 bufoute=rgb;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3443
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3444 for(i=0; i<(RTjpeg_height); i++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3445 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3446 for(j=0; j<RTjpeg_width; j+=2)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3447 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3448 crR=(*bufcr-128)*KcrR;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3449 crG=(*(bufcr++)-128)*KcrG;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3450 cbG=(*bufcb-128)*KcbG;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3451 cbB=(*(bufcb++)-128)*KcbB;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3452
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3453 y=(bufy[j]-16)*Ky;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3454
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3455 tmp=(y+crR)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3456 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3457 tmp=(y-crG-cbG)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3458 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3459 tmp=(y+cbB)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3460 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3461
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3462 y=(bufy[j+1]-16)*Ky;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3463
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3464 tmp=(y+crR)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3465 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3466 tmp=(y-crG-cbG)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3467 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3468 tmp=(y+cbB)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3469 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3470
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3471 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3472 bufy+=yskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3473 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3474 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3475
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3476
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3477 void RTjpeg_yuv420rgb(__u8 *buf, __u8 *rgb, int stride)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3478 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3479 int tmp;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3480 int i, j;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3481 __s32 y, crR, crG, cbG, cbB;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3482 __u8 *bufcr, *bufcb, *bufy, *bufoute, *bufouto;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3483 int oskip, yskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3484
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3485 if(stride==0)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3486 oskip=RTjpeg_width*3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3487 else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3488 oskip=2*stride-RTjpeg_width*3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3489
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3490 yskip=RTjpeg_width;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3491
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3492 bufcb=&buf[RTjpeg_width*RTjpeg_height];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3493 bufcr=&buf[RTjpeg_width*RTjpeg_height+(RTjpeg_width*RTjpeg_height)/4];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3494 bufy=&buf[0];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3495 bufoute=rgb;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3496 bufouto=rgb+RTjpeg_width*3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3497
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3498 for(i=0; i<(RTjpeg_height>>1); i++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3499 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3500 for(j=0; j<RTjpeg_width; j+=2)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3501 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3502 crR=(*bufcr-128)*KcrR;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3503 crG=(*(bufcr++)-128)*KcrG;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3504 cbG=(*bufcb-128)*KcbG;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3505 cbB=(*(bufcb++)-128)*KcbB;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3506
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3507 y=(bufy[j]-16)*Ky;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3508
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3509 tmp=(y+crR)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3510 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3511 tmp=(y-crG-cbG)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3512 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3513 tmp=(y+cbB)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3514 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3515
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3516 y=(bufy[j+1]-16)*Ky;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3517
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3518 tmp=(y+crR)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3519 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3520 tmp=(y-crG-cbG)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3521 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3522 tmp=(y+cbB)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3523 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3524
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3525 y=(bufy[j+yskip]-16)*Ky;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3526
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3527 tmp=(y+crR)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3528 *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3529 tmp=(y-crG-cbG)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3530 *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3531 tmp=(y+cbB)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3532 *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3533
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3534 y=(bufy[j+1+yskip]-16)*Ky;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3535
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3536 tmp=(y+crR)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3537 *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3538 tmp=(y-crG-cbG)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3539 *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3540 tmp=(y+cbB)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3541 *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3542
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3543 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3544 bufoute+=oskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3545 bufouto+=oskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3546 bufy+=yskip<<1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3547 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3548 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3549
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3550
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3551 void RTjpeg_yuvrgb32(__u8 *buf, __u8 *rgb, int stride)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3552 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3553 int tmp;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3554 int i, j;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3555 __s32 y, crR, crG, cbG, cbB;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3556 __u8 *bufcr, *bufcb, *bufy, *bufoute, *bufouto;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3557 int oskip, yskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3558
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3559 if(stride==0)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3560 oskip=RTjpeg_width*4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3561 else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3562 oskip = 2*stride-RTjpeg_width*4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3563 yskip=RTjpeg_width;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3564
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3565 bufcb=&buf[RTjpeg_width*RTjpeg_height];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3566 bufcr=&buf[RTjpeg_width*RTjpeg_height+(RTjpeg_width*RTjpeg_height)/2];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3567 bufy=&buf[0];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3568 bufoute=rgb;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3569 bufouto=rgb+RTjpeg_width*4;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3570
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3571 for(i=0; i<(RTjpeg_height>>1); i++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3572 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3573 for(j=0; j<RTjpeg_width; j+=2)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3574 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3575 crR=(*bufcr-128)*KcrR;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3576 crG=(*(bufcr++)-128)*KcrG;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3577 cbG=(*bufcb-128)*KcbG;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3578 cbB=(*(bufcb++)-128)*KcbB;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3579
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3580 y=(bufy[j]-16)*Ky;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3581
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3582 tmp=(y+cbB)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3583 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3584 tmp=(y-crG-cbG)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3585 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3586 tmp=(y+crR)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3587 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3588 bufoute++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3589
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3590 y=(bufy[j+1]-16)*Ky;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3591
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3592 tmp=(y+cbB)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3593 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3594 tmp=(y-crG-cbG)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3595 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3596 tmp=(y+crR)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3597 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3598 bufoute++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3599
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3600 y=(bufy[j+yskip]-16)*Ky;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3601
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3602 tmp=(y+cbB)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3603 *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3604 tmp=(y-crG-cbG)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3605 *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3606 tmp=(y+crR)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3607 *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3608 bufouto++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3609
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3610 y=(bufy[j+1+yskip]-16)*Ky;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3611
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3612 tmp=(y+cbB)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3613 *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3614 tmp=(y-crG-cbG)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3615 *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3616 tmp=(y+crR)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3617 *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3618 bufouto++;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3619
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3620 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3621 bufoute+=oskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3622 bufouto+=oskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3623 bufy+=yskip<<1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3624 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3625 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3626
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3627 void RTjpeg_yuvrgb24(__u8 *buf, __u8 *rgb, int stride)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3628 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3629 int tmp;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3630 int i, j;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3631 __s32 y, crR, crG, cbG, cbB;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3632 __u8 *bufcr, *bufcb, *bufy, *bufoute, *bufouto;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3633 int oskip, yskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3634
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3635 if(stride==0)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3636 oskip=RTjpeg_width*3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3637 else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3638 oskip=2*stride - RTjpeg_width*3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3639
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3640 yskip=RTjpeg_width;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3641
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3642 bufcb=&buf[RTjpeg_width*RTjpeg_height];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3643 bufcr=&buf[RTjpeg_width*RTjpeg_height+(RTjpeg_width*RTjpeg_height)/4];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3644 bufy=&buf[0];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3645 bufoute=rgb;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3646 bufouto=rgb+RTjpeg_width*3;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3647
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3648 for(i=0; i<(RTjpeg_height>>1); i++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3649 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3650 for(j=0; j<RTjpeg_width; j+=2)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3651 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3652 crR=(*bufcr-128)*KcrR;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3653 crG=(*(bufcr++)-128)*KcrG;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3654 cbG=(*bufcb-128)*KcbG;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3655 cbB=(*(bufcb++)-128)*KcbB;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3656
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3657 y=(bufy[j]-16)*Ky;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3658
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3659 tmp=(y+cbB)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3660 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3661 tmp=(y-crG-cbG)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3662 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3663 tmp=(y+crR)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3664 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3665
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3666 y=(bufy[j+1]-16)*Ky;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3667
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3668 tmp=(y+cbB)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3669 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3670 tmp=(y-crG-cbG)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3671 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3672 tmp=(y+crR)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3673 *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3674
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3675 y=(bufy[j+yskip]-16)*Ky;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3676
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3677 tmp=(y+cbB)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3678 *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3679 tmp=(y-crG-cbG)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3680 *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3681 tmp=(y+crR)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3682 *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3683
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3684 y=(bufy[j+1+yskip]-16)*Ky;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3685
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3686 tmp=(y+cbB)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3687 *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3688 tmp=(y-crG-cbG)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3689 *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3690 tmp=(y+crR)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3691 *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3692
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3693 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3694 bufoute+=oskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3695 bufouto+=oskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3696 bufy+=yskip<<1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3697 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3698 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3699
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3700 void RTjpeg_yuvrgb16(__u8 *buf, __u8 *rgb, int stride)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3701 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3702 int tmp;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3703 int i, j;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3704 __s32 y, crR, crG, cbG, cbB;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3705 __u8 *bufcr, *bufcb, *bufy, *bufoute, *bufouto;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3706 int oskip, yskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3707 unsigned char r, g, b;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3708
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3709 if(stride==0)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3710 oskip=RTjpeg_width*2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3711 else
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3712 oskip=2*stride-RTjpeg_width*2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3713
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3714 yskip=RTjpeg_width;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3715
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3716 bufcb=&buf[RTjpeg_width*RTjpeg_height];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3717 bufcr=&buf[RTjpeg_width*RTjpeg_height+(RTjpeg_width*RTjpeg_height)/4];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3718 bufy=&buf[0];
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3719 bufoute=rgb;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3720 bufouto=rgb+RTjpeg_width*2;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3721
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3722 for(i=0; i<(RTjpeg_height>>1); i++)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3723 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3724 for(j=0; j<RTjpeg_width; j+=2)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3725 {
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3726 crR=(*bufcr-128)*KcrR;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3727 crG=(*(bufcr++)-128)*KcrG;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3728 cbG=(*bufcb-128)*KcbG;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3729 cbB=(*(bufcb++)-128)*KcbB;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3730
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3731 y=(bufy[j]-16)*Ky;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3732
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3733 tmp=(y+cbB)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3734 b=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3735 tmp=(y-crG-cbG)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3736 g=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3737 tmp=(y+crR)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3738 r=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3739 tmp=(int)((int)b >> 3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3740 tmp|=(int)(((int)g >> 2) << 5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3741 tmp|=(int)(((int)r >> 3) << 11);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3742 *(bufoute++)=tmp&0xff;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3743 *(bufoute++)=tmp>>8;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3744
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3745
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3746 y=(bufy[j+1]-16)*Ky;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3747
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3748 tmp=(y+cbB)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3749 b=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3750 tmp=(y-crG-cbG)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3751 g=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3752 tmp=(y+crR)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3753 r=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3754 tmp=(int)((int)b >> 3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3755 tmp|=(int)(((int)g >> 2) << 5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3756 tmp|=(int)(((int)r >> 3) << 11);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3757 *(bufoute++)=tmp&0xff;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3758 *(bufoute++)=tmp>>8;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3759
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3760 y=(bufy[j+yskip]-16)*Ky;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3761
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3762 tmp=(y+cbB)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3763 b=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3764 tmp=(y-crG-cbG)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3765 g=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3766 tmp=(y+crR)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3767 r=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3768 tmp=(int)((int)b >> 3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3769 tmp|=(int)(((int)g >> 2) << 5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3770 tmp|=(int)(((int)r >> 3) << 11);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3771 *(bufouto++)=tmp&0xff;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3772 *(bufouto++)=tmp>>8;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3773
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3774 y=(bufy[j+1+yskip]-16)*Ky;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3775
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3776 tmp=(y+cbB)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3777 b=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3778 tmp=(y-crG-cbG)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3779 g=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3780 tmp=(y+crR)>>16;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3781 r=(tmp>255)?255:((tmp<0)?0:tmp);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3782 tmp=(int)((int)b >> 3);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3783 tmp|=(int)(((int)g >> 2) << 5);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3784 tmp|=(int)(((int)r >> 3) << 11);
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3785 *(bufouto++)=tmp&0xff;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3786 *(bufouto++)=tmp>>8;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3787
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3788 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3789 bufoute+=oskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3790 bufouto+=oskip;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3791 bufy+=yskip<<1;
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3792 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3793 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3794
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3795 /* fix stride */
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3796
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3797 void RTjpeg_yuvrgb8(__u8 *buf, __u8 *rgb, int stride)
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3798 {
9763
7e5d9bf1e56f bcopy -> memcpy for MINGW32 port
faust3
parents: 6335
diff changeset
3799 memcpy(rgb, buf, RTjpeg_width*RTjpeg_height);
3802
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3800 }
bf37d5cd3e6e used by NuppelVideo decoder
alex
parents:
diff changeset
3801