annotate ps2/idct_mmi.c @ 4586:365f2fed8461 libavcodec

Use pointers to avoid copying AVFrame. This ensure get_buffer() won't be confused with an AVFrame pointer which looks like it wasn't released.
author aurel
date Sat, 24 Feb 2007 00:55:50 +0000
parents c8c591fe26f8
children d5ba514e3f4a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
689
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
1 /*
3680
7690bafea6e0 Mark this file properly as LGPL as allowed by its author Leon van Stuivenberg.
diego
parents: 2979
diff changeset
2 * Originally provided by Intel at Application Note AP-922.
7690bafea6e0 Mark this file properly as LGPL as allowed by its author Leon van Stuivenberg.
diego
parents: 2979
diff changeset
3 *
7690bafea6e0 Mark this file properly as LGPL as allowed by its author Leon van Stuivenberg.
diego
parents: 2979
diff changeset
4 * Column code adapted from Peter Gubanov.
7690bafea6e0 Mark this file properly as LGPL as allowed by its author Leon van Stuivenberg.
diego
parents: 2979
diff changeset
5 * Copyright (c) 2000-2001 Peter Gubanov <peter@elecard.net.ru>
7690bafea6e0 Mark this file properly as LGPL as allowed by its author Leon van Stuivenberg.
diego
parents: 2979
diff changeset
6 * http://www.elecard.com/peter/idct.shtml
7690bafea6e0 Mark this file properly as LGPL as allowed by its author Leon van Stuivenberg.
diego
parents: 2979
diff changeset
7 * rounding trick copyright (c) 2000 Michel Lespinasse <walken@zoy.org>
7690bafea6e0 Mark this file properly as LGPL as allowed by its author Leon van Stuivenberg.
diego
parents: 2979
diff changeset
8 *
7690bafea6e0 Mark this file properly as LGPL as allowed by its author Leon van Stuivenberg.
diego
parents: 2979
diff changeset
9 * MMI port and (c) 2002 by Leon van Stuivenberg
7690bafea6e0 Mark this file properly as LGPL as allowed by its author Leon van Stuivenberg.
diego
parents: 2979
diff changeset
10 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3680
diff changeset
11 * This file is part of FFmpeg.
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3680
diff changeset
12 *
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3680
diff changeset
13 * FFmpeg is free software; you can redistribute it and/or
3680
7690bafea6e0 Mark this file properly as LGPL as allowed by its author Leon van Stuivenberg.
diego
parents: 2979
diff changeset
14 * modify it under the terms of the GNU Lesser General Public
7690bafea6e0 Mark this file properly as LGPL as allowed by its author Leon van Stuivenberg.
diego
parents: 2979
diff changeset
15 * License as published by the Free Software Foundation; either
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3680
diff changeset
16 * version 2.1 of the License, or (at your option) any later version.
3680
7690bafea6e0 Mark this file properly as LGPL as allowed by its author Leon van Stuivenberg.
diego
parents: 2979
diff changeset
17 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3680
diff changeset
18 * FFmpeg is distributed in the hope that it will be useful,
3680
7690bafea6e0 Mark this file properly as LGPL as allowed by its author Leon van Stuivenberg.
diego
parents: 2979
diff changeset
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7690bafea6e0 Mark this file properly as LGPL as allowed by its author Leon van Stuivenberg.
diego
parents: 2979
diff changeset
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7690bafea6e0 Mark this file properly as LGPL as allowed by its author Leon van Stuivenberg.
diego
parents: 2979
diff changeset
21 * Lesser General Public License for more details.
7690bafea6e0 Mark this file properly as LGPL as allowed by its author Leon van Stuivenberg.
diego
parents: 2979
diff changeset
22 *
7690bafea6e0 Mark this file properly as LGPL as allowed by its author Leon van Stuivenberg.
diego
parents: 2979
diff changeset
23 * You should have received a copy of the GNU Lesser General Public
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3680
diff changeset
24 * License along with FFmpeg; if not, write to the Free Software
3680
7690bafea6e0 Mark this file properly as LGPL as allowed by its author Leon van Stuivenberg.
diego
parents: 2979
diff changeset
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
7690bafea6e0 Mark this file properly as LGPL as allowed by its author Leon van Stuivenberg.
diego
parents: 2979
diff changeset
26 *
7690bafea6e0 Mark this file properly as LGPL as allowed by its author Leon van Stuivenberg.
diego
parents: 2979
diff changeset
27 */
689
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
28
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
29 #include "../common.h"
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
30 #include "../dsputil.h"
689
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
31 #include "mmi.h"
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
32
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
33 #define BITS_INV_ACC 5 // 4 or 5 for IEEE
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
34 #define SHIFT_INV_ROW (16 - BITS_INV_ACC)
696
477bcb3b2f0a ps2 idct bugfix patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 689
diff changeset
35 #define SHIFT_INV_COL (1 + BITS_INV_ACC)
689
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
36
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
37 #define TG1 6518
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
38 #define TG2 13573
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
39 #define TG3 21895
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
40 #define CS4 23170
689
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
41
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
42 #define ROUNDER_0 0
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
43 #define ROUNDER_1 16
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
44
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
45 #define TAB_i_04 (32+0)
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
46 #define TAB_i_17 (32+64)
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
47 #define TAB_i_26 (32+128)
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
48 #define TAB_i_35 (32+192)
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
49
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
50 #define TG_1_16 (32+256+0)
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
51 #define TG_2_16 (32+256+16)
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
52 #define TG_3_16 (32+256+32)
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
53 #define COS_4_16 (32+256+48)
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
54
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
55 #define CLIPMAX (32+256+64+0)
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
56
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
57 static short consttable[] align16 = {
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
58 /* rounder 0*/ // assume SHIFT_INV_ROW == 11
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
59 0x3ff, 1, 0x3ff, 1, 0x3ff, 1, 0x3ff, 1,
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
60 /* rounder 1*/
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
61 0x3ff, 0, 0x3ff, 0, 0x3ff, 0, 0x3ff, 0,
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
62 /* row 0/4*/
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 1876
diff changeset
63 16384, 21407, -16384, -21407, 22725, 19266, -22725, -12873,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 1876
diff changeset
64 8867, 16384, 8867, 16384, 4520, 12873, -4520, 19266,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 1876
diff changeset
65 16384, -8867, 16384, -8867, 12873, -22725, 19266, -22725,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 1876
diff changeset
66 21407, -16384, -21407, 16384, 19266, 4520, -12873, 4520,
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
67 /* row 1/7*/
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 1876
diff changeset
68 22725, 29692, -22725, -29692, 31521, 26722, -31521, -17855,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 1876
diff changeset
69 12299, 22725, 12299, 22725, 6270, 17855, -6270, 26722,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 1876
diff changeset
70 22725, -12299, 22725, -12299, 17855, -31521, 26722, -31521,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 1876
diff changeset
71 29692, -22725, -29692, 22725, 26722, 6270, -17855, 6270,
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
72 /* row 2/6*/
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 1876
diff changeset
73 21407, 27969, -21407, -27969, 29692, 25172, -29692, -16819,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 1876
diff changeset
74 11585, 21407, 11585, 21407, 5906, 16819, -5906, 25172,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 1876
diff changeset
75 21407, -11585, 21407, -11585, 16819, -29692, 25172, -29692,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 1876
diff changeset
76 27969, -21407, -27969, 21407, 25172, 5906, -16819, 5906,
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
77 /*row 3/5*/
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 1876
diff changeset
78 19266, 25172, -19266, -25172, 26722, 22654, -26722, -15137,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 1876
diff changeset
79 10426, 19266, 10426, 19266, 5315, 15137, -5315, 22654,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 1876
diff changeset
80 19266, -10426, 19266, -10426, 15137, -26722, 22654, -26722,
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
81 25172, -19266, -25172, 19266, 22654, 5315, -15137, 5315,
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
82 /*column constants*/
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
83 TG1, TG1, TG1, TG1, TG1, TG1, TG1, TG1,
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
84 TG2, TG2, TG2, TG2, TG2, TG2, TG2, TG2,
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
85 TG3, TG3, TG3, TG3, TG3, TG3, TG3, TG3,
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
86 CS4, CS4, CS4, CS4, CS4, CS4, CS4, CS4,
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
87 /* clamp */
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
88 255, 255, 255, 255, 255, 255, 255, 255
689
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
89 };
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
90
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
91
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
92 #define DCT_8_INV_ROW1(blk, rowoff, taboff, rnd, outreg) { \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
93 lq(blk, rowoff, $16); /* r16 = x7 x5 x3 x1 x6 x4 x2 x0 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
94 /*slot*/ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
95 lq($24, 0+taboff, $17); /* r17 = w */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
96 /*delay slot $16*/ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
97 lq($24, 16+taboff, $18);/* r18 = w */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
98 prevh($16, $2); /* r2 = x1 x3 x5 x7 x0 x2 x4 x6 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
99 lq($24, 32+taboff, $19);/* r19 = w */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
100 phmadh($17, $16, $17); /* r17 = b1"b0'a1"a0' */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
101 lq($24, 48+taboff, $20);/* r20 = w */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
102 phmadh($18, $2, $18); /* r18 = b1'b0"a1'a0" */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
103 phmadh($19, $16, $19); /* r19 = b3"b2'a3"a2' */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
104 phmadh($20, $2, $20); /* r20 = b3'b2"a3'a2" */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
105 paddw($17, $18, $17); /* r17 = (b1)(b0)(a1)(a0) */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
106 paddw($19, $20, $19); /* r19 = (b3)(b2)(a3)(a2) */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
107 pcpyld($19, $17, $18); /* r18 = (a3)(a2)(a1)(a0) */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
108 pcpyud($17, $19, $20); /* r20 = (b3)(b2)(b1)(b0) */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
109 paddw($18, rnd, $18); /* r18 = (a3)(a2)(a1)(a0) */\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
110 paddw($18, $20, $17); /* r17 = ()()()(a0+b0) */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
111 psubw($18, $20, $20); /* r20 = ()()()(a0-b0) */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
112 psraw($17, SHIFT_INV_ROW, $17); /* r17 = (y3 y2 y1 y0) */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
113 psraw($20, SHIFT_INV_ROW, $20); /* r20 = (y4 y5 y6 y7) */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
114 ppach($20, $17, outreg);/* out = y4 y5 y6 y7 y3 y2 y1 y0 Note order */ \
689
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
115 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
116 prevh(outreg, $2); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
117 pcpyud($2, $2, $2); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
118 pcpyld($2, outreg, outreg); \
689
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
119 }
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
120
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
121
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
122 #define DCT_8_INV_COL8() \
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
123 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
124 lq($24, TG_3_16, $2); /* r2 = tn3 */ \
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
125 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
126 pmulth($11, $2, $17); /* r17 = x3 * tn3 (6420) */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
127 psraw($17, 15, $17); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
128 pmfhl_uw($3); /* r3 = 7531 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
129 psraw($3, 15, $3); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
130 pinteh($3, $17, $17); /* r17 = x3 * tn3 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
131 psubh($17, $13, $17); /* r17 = tm35 */ \
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
132 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
133 pmulth($13, $2, $18); /* r18 = x5 * tn3 (6420) */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
134 psraw($18, 15, $18); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
135 pmfhl_uw($3); /* r3 = 7531 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
136 psraw($3, 15, $3); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
137 pinteh($3, $18, $18); /* r18 = x5 * tn3 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
138 paddh($18, $11, $18); /* r18 = tp35 */ \
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
139 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
140 lq($24, TG_1_16, $2); /* r2 = tn1 */ \
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
141 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
142 pmulth($15, $2, $19); /* r19 = x7 * tn1 (6420) */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
143 psraw($19, 15, $19); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
144 pmfhl_uw($3); /* r3 = 7531 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
145 psraw($3, 15, $3); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
146 pinteh($3, $19, $19); /* r19 = x7 * tn1 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
147 paddh($19, $9, $19); /* r19 = tp17 */ \
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
148 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
149 pmulth($9, $2, $20); /* r20 = x1 * tn1 (6420) */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
150 psraw($20, 15, $20); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
151 pmfhl_uw($3); /* r3 = 7531 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
152 psraw($3, 15, $3); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
153 pinteh($3, $20, $20); /* r20 = x1 * tn1 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
154 psubh($20, $15, $20); /* r20 = tm17 */ \
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
155 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
156 psubh($19, $18, $3); /* r3 = t1 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
157 paddh($20, $17, $16); /* r16 = t2 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
158 psubh($20, $17, $23); /* r23 = b3 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
159 paddh($19, $18, $20); /* r20 = b0 */ \
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
160 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
161 lq($24, COS_4_16, $2); /* r2 = cs4 */ \
689
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
162 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
163 paddh($3, $16, $21); /* r21 = t1+t2 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
164 psubh($3, $16, $22); /* r22 = t1-t2 */ \
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
165 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
166 pmulth($21, $2, $21); /* r21 = cs4 * (t1+t2) 6420 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
167 psraw($21, 15, $21); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
168 pmfhl_uw($3); /* r3 = 7531 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
169 psraw($3, 15, $3); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
170 pinteh($3, $21, $21); /* r21 = b1 */ \
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
171 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
172 pmulth($22, $2, $22); /* r22 = cs4 * (t1-t2) 6420 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
173 psraw($22, 15, $22); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
174 pmfhl_uw($3); /* r3 = 7531 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
175 psraw($3, 15, $3); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
176 pinteh($3, $22, $22); /* r22 = b2 */ \
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
177 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
178 lq($24, TG_2_16, $2); /* r2 = tn2 */ \
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
179 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
180 pmulth($10, $2, $17); /* r17 = x2 * tn2 (6420) */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
181 psraw($17, 15, $17); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
182 pmfhl_uw($3); /* r3 = 7531 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
183 psraw($3, 15, $3); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
184 pinteh($3, $17, $17); /* r17 = x3 * tn3 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
185 psubh($17, $14, $17); /* r17 = tm26 */ \
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
186 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
187 pmulth($14, $2, $18); /* r18 = x6 * tn2 (6420) */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
188 psraw($18, 15, $18); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
189 pmfhl_uw($3); /* r3 = 7531 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
190 psraw($3, 15, $3); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
191 pinteh($3, $18, $18); /* r18 = x6 * tn2 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
192 paddh($18, $10, $18); /* r18 = tp26 */ \
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
193 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
194 paddh($8, $12, $2); /* r2 = tp04 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
195 psubh($8, $12, $3); /* r3 = tm04 */ \
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
196 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
197 paddh($2, $18, $16); /* r16 = a0 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
198 psubh($2, $18, $19); /* r19 = a3 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
199 psubh($3, $17, $18); /* r18 = a2 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
200 paddh($3, $17, $17); /* r17 = a1 */
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
201
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
202
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
203 #define DCT_8_INV_COL8_STORE(blk) \
689
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
204 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
205 paddh($16, $20, $2); /* y0 a0+b0 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
206 psubh($16, $20, $16); /* y7 a0-b0 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
207 psrah($2, SHIFT_INV_COL, $2); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
208 psrah($16, SHIFT_INV_COL, $16); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
209 sq($2, 0, blk); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
210 sq($16, 112, blk); \
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
211 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
212 paddh($17, $21, $3); /* y1 a1+b1 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
213 psubh($17, $21, $17); /* y6 a1-b1 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
214 psrah($3, SHIFT_INV_COL, $3); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
215 psrah($17, SHIFT_INV_COL, $17); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
216 sq($3, 16, blk); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
217 sq($17, 96, blk); \
689
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
218 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
219 paddh($18, $22, $2); /* y2 a2+b2 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
220 psubh($18, $22, $18); /* y5 a2-b2 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
221 psrah($2, SHIFT_INV_COL, $2); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
222 psrah($18, SHIFT_INV_COL, $18); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
223 sq($2, 32, blk); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
224 sq($18, 80, blk); \
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
225 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
226 paddh($19, $23, $3); /* y3 a3+b3 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
227 psubh($19, $23, $19); /* y4 a3-b3 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
228 psrah($3, SHIFT_INV_COL, $3); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
229 psrah($19, SHIFT_INV_COL, $19); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
230 sq($3, 48, blk); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
231 sq($19, 64, blk);
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
232
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
233
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
234
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
235 #define DCT_8_INV_COL8_PMS() \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
236 paddh($16, $20, $2); /* y0 a0+b0 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
237 psubh($16, $20, $20); /* y7 a0-b0 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
238 psrah($2, SHIFT_INV_COL, $16); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
239 psrah($20, SHIFT_INV_COL, $20); \
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
240 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
241 paddh($17, $21, $3); /* y1 a1+b1 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
242 psubh($17, $21, $21); /* y6 a1-b1 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
243 psrah($3, SHIFT_INV_COL, $17); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
244 psrah($21, SHIFT_INV_COL, $21); \
689
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
245 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
246 paddh($18, $22, $2); /* y2 a2+b2 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
247 psubh($18, $22, $22); /* y5 a2-b2 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
248 psrah($2, SHIFT_INV_COL, $18); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
249 psrah($22, SHIFT_INV_COL, $22); \
689
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
250 \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
251 paddh($19, $23, $3); /* y3 a3+b3 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
252 psubh($19, $23, $23); /* y4 a3-b3 */ \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
253 psrah($3, SHIFT_INV_COL, $19); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
254 psrah($23, SHIFT_INV_COL, $23);
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
255
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
256 #define PUT(rs) \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
257 pminh(rs, $11, $2); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
258 pmaxh($2, $0, $2); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
259 ppacb($0, $2, $2); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
260 sd3(2, 0, 4); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
261 __asm__ __volatile__ ("add $4, $5, $4");
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
262
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
263 #define DCT_8_INV_COL8_PUT() \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
264 PUT($16); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
265 PUT($17); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
266 PUT($18); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
267 PUT($19); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
268 PUT($23); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
269 PUT($22); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
270 PUT($21); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
271 PUT($20);
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
272
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
273 #define ADD(rs) \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
274 ld3(4, 0, 2); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
275 pextlb($0, $2, $2); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
276 paddh($2, rs, $2); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
277 pminh($2, $11, $2); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
278 pmaxh($2, $0, $2); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
279 ppacb($0, $2, $2); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
280 sd3(2, 0, 4); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
281 __asm__ __volatile__ ("add $4, $5, $4");
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
282
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
283 /*fixme: schedule*/
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
284 #define DCT_8_INV_COL8_ADD() \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
285 ADD($16); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
286 ADD($17); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
287 ADD($18); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
288 ADD($19); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
289 ADD($23); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
290 ADD($22); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
291 ADD($21); \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
292 ADD($20);
689
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
293
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
294
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
295 void ff_mmi_idct(int16_t * block)
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
296 {
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
297 /* $4 = block */
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
298 __asm__ __volatile__("la $24, %0"::"m"(consttable[0]));
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
299 lq($24, ROUNDER_0, $8);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
300 lq($24, ROUNDER_1, $7);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
301 DCT_8_INV_ROW1($4, 0, TAB_i_04, $8, $8);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
302 DCT_8_INV_ROW1($4, 16, TAB_i_17, $7, $9);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
303 DCT_8_INV_ROW1($4, 32, TAB_i_26, $7, $10);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
304 DCT_8_INV_ROW1($4, 48, TAB_i_35, $7, $11);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
305 DCT_8_INV_ROW1($4, 64, TAB_i_04, $7, $12);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
306 DCT_8_INV_ROW1($4, 80, TAB_i_35, $7, $13);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
307 DCT_8_INV_ROW1($4, 96, TAB_i_26, $7, $14);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
308 DCT_8_INV_ROW1($4, 112, TAB_i_17, $7, $15);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
309 DCT_8_INV_COL8();
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
310 DCT_8_INV_COL8_STORE($4);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 1876
diff changeset
311
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
312 //let savedtemp regs be saved
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
313 __asm__ __volatile__(" ":::"$16", "$17", "$18", "$19", "$20", "$21", "$22", "$23");
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
314 }
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
315
689
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
316
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 721
diff changeset
317 void ff_mmi_idct_put(uint8_t *dest, int line_size, DCTELEM *block)
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
318 {
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
319 /* $4 = dest, $5 = line_size, $6 = block */
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
320 __asm__ __volatile__("la $24, %0"::"m"(consttable[0]));
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
321 lq($24, ROUNDER_0, $8);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
322 lq($24, ROUNDER_1, $7);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
323 DCT_8_INV_ROW1($6, 0, TAB_i_04, $8, $8);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
324 DCT_8_INV_ROW1($6, 16, TAB_i_17, $7, $9);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
325 DCT_8_INV_ROW1($6, 32, TAB_i_26, $7, $10);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
326 DCT_8_INV_ROW1($6, 48, TAB_i_35, $7, $11);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
327 DCT_8_INV_ROW1($6, 64, TAB_i_04, $7, $12);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
328 DCT_8_INV_ROW1($6, 80, TAB_i_35, $7, $13);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
329 DCT_8_INV_ROW1($6, 96, TAB_i_26, $7, $14);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
330 DCT_8_INV_ROW1($6, 112, TAB_i_17, $7, $15);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
331 DCT_8_INV_COL8();
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
332 lq($24, CLIPMAX, $11);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
333 DCT_8_INV_COL8_PMS();
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
334 DCT_8_INV_COL8_PUT();
689
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
335
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
336 //let savedtemp regs be saved
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
337 __asm__ __volatile__(" ":::"$16", "$17", "$18", "$19", "$20", "$21", "$22", "$23");
689
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
338 }
696
477bcb3b2f0a ps2 idct bugfix patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 689
diff changeset
339
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
340
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 721
diff changeset
341 void ff_mmi_idct_add(uint8_t *dest, int line_size, DCTELEM *block)
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
342 {
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
343 /* $4 = dest, $5 = line_size, $6 = block */
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
344 __asm__ __volatile__("la $24, %0"::"m"(consttable[0]));
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
345 lq($24, ROUNDER_0, $8);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
346 lq($24, ROUNDER_1, $7);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
347 DCT_8_INV_ROW1($6, 0, TAB_i_04, $8, $8);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
348 DCT_8_INV_ROW1($6, 16, TAB_i_17, $7, $9);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
349 DCT_8_INV_ROW1($6, 32, TAB_i_26, $7, $10);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
350 DCT_8_INV_ROW1($6, 48, TAB_i_35, $7, $11);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
351 DCT_8_INV_ROW1($6, 64, TAB_i_04, $7, $12);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
352 DCT_8_INV_ROW1($6, 80, TAB_i_35, $7, $13);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
353 DCT_8_INV_ROW1($6, 96, TAB_i_26, $7, $14);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
354 DCT_8_INV_ROW1($6, 112, TAB_i_17, $7, $15);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
355 DCT_8_INV_COL8();
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
356 lq($24, CLIPMAX, $11);
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
357 DCT_8_INV_COL8_PMS();
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
358 DCT_8_INV_COL8_ADD();
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
359
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
360 //let savedtemp regs be saved
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
361 __asm__ __volatile__(" ":::"$16", "$17", "$18", "$19", "$20", "$21", "$22", "$23");
721
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
362 }
71f669e9f633 ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents: 696
diff changeset
363