annotate ps2/dsputil_mmi.c @ 689:efcbfbd18864 libavcodec

ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
author michaelni
date Mon, 23 Sep 2002 08:44:24 +0000
parents
children 71f669e9f633
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 /*
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
2 * MMI optimized DSP utils
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
3 * Copyright (c) 2000, 2001 Fabrice Bellard.
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
4 *
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
5 * This library is free software; you can redistribute it and/or
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
6 * modify it under the terms of the GNU Lesser General Public
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
7 * License as published by the Free Software Foundation; either
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
8 * version 2 of the License, or (at your option) any later version.
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
9 *
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
10 * This library is distributed in the hope that it will be useful,
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
13 * Lesser General Public License for more details.
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
14 *
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
15 * You should have received a copy of the GNU Lesser General Public
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
16 * License along with this library; if not, write to the Free Software
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
18 *
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
19 * MMI optimization by Leon van Stuivenberg <leonvs@iae.nl>
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
20 */
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
21
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
22 #include "../dsputil.h"
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
23
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
24 void ff_mmi_idct(DCTELEM * block);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
25
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
26 #include "mmi.h"
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
27
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 static void clear_blocks_mmi(DCTELEM * blocks)
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
30 {
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
31 /* $4 = blocks */
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
32 int i;
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
33 for (i = 0; i < 6; i++) {
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
34 sq($0, 0, $4);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
35 sq($0, 16, $4);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
36 sq($0, 32, $4);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
37 sq($0, 48, $4);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
38 sq($0, 64, $4);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
39 sq($0, 80, $4);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
40 sq($0, 96, $4);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
41 sq($0, 112, $4);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
42 __asm__ __volatile__("addi $4, $4, 128");
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
43 }
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
44 }
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
45
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
46
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
47 static void put_pixels_clamped_mmi(const DCTELEM * block, UINT8 * pixels,
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
48 int line_size)
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
49 {
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
50 /* $4 = block, $5 = pixels, $6 = line_size */
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
51 __asm__ __volatile__("li $11, 255":::"$11");
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
52 lq($4, 0, $12);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
53 pcpyld($11, $11, $11);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
54 pcpyh($11, $11);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
55
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
56 #define PUT(rs) \
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
57 ppacb($0, $##rs, $##rs); \
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
58 sd3(rs, 0, 5); \
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
59 __asm__ __volatile__ ("add $5, $5, $6");
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
60
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
61 pminh($12, $11, $12);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
62 pmaxh($12, $0, $12);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
63 lq($4, 16, $13);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
64 PUT(12);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
65
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
66 pminh($13, $11, $13);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
67 pmaxh($13, $0, $13);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
68 lq($4, 32, $12);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
69 PUT(13);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
70
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
71 pminh($12, $11, $12);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
72 pmaxh($12, $0, $12);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
73 lq($4, 48, $13);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
74 PUT(12);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
75
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
76 pminh($13, $11, $13);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
77 pmaxh($13, $0, $13);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
78 lq($4, 64, $12);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
79 PUT(13);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
80
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
81 pminh($12, $11, $12);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
82 pmaxh($12, $0, $12);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
83 lq($4, 80, $13);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
84 PUT(12);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
85
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
86 pminh($13, $11, $13);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
87 pmaxh($13, $0, $13);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
88 lq($4, 96, $12);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
89 PUT(13);
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 pminh($12, $11, $12);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
92 pmaxh($12, $0, $12);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
93 lq($4, 112, $13);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
94 PUT(12);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
95
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
96 pminh($13, $11, $13);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
97 pmaxh($13, $0, $13);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
98 PUT(13);
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
99 }
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
100
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
101 /* todo
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
102 static void add_pixels_clamped_mmi(const DCTELEM * block, UINT8 * pixels,
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
103 int line_size)
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
104 {
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
105 }
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
106 */
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
107
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
108
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
109 void dsputil_init_mmi(void)
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
110 {
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
111 put_pixels_clamped = put_pixels_clamped_mmi;
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
112 //add_pixels_clamped = add_pixels_clamped_mmi;
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
113 clear_blocks = clear_blocks_mmi;
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
114 ff_idct = ff_mmi_idct;
efcbfbd18864 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff changeset
115 }