Parent Directory | Revision Log
Revision 70 - (view) (download)
1 : | canard | 70 | # Copyright (C) 2002 Guillaume Morin <guillaume@morinfr.org>, Alcôve |
2 : | # | ||
3 : | # This program is free software; you can redistribute it and/or modify | ||
4 : | # it under the terms of the GNU General Public License as published by | ||
5 : | # the Free Software Foundation; either version 2 of the License, or | ||
6 : | # (at your option) any later version. | ||
7 : | # | ||
8 : | # This program is distributed in the hope that it will be useful, | ||
9 : | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 : | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 : | # GNU General Public License for more details. | ||
12 : | # | ||
13 : | # You should have received a copy of the GNU General Public License | ||
14 : | # along with this program; if not, write to the Free Software | ||
15 : | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
16 : | # | ||
17 : | # | ||
18 : | # $Id: cbp_altivec.s,v 1.1 2002-03-26 23:21:02 canard Exp $ | ||
19 : | # $Source: /home/xvid/cvs_copy/cvs-server-root/xvid/xvidcore/src/bitstream/ppc_asm/cbp_altivec.s,v $ | ||
20 : | # $Date: 2002-03-26 23:21:02 $ | ||
21 : | # $Author: canard $ | ||
22 : | # | ||
23 : | # This is my first PPC ASM attempt. So I might do nasty things. | ||
24 : | # Please send any comments to <guillaume@morinfr.org> | ||
25 : | |||
26 : | |||
27 : | # Returns a field of bits that indicates non zero ac blocks | ||
28 : | # for this macro block | ||
29 : | # | ||
30 : | # uint32_t calc_cbp_c(const int16_t codes[6][64]) | ||
31 : | #{ | ||
32 : | # uint32_t i, j; | ||
33 : | # uint32_t cbp = 0; | ||
34 : | # | ||
35 : | # for (i = 0; i < 6; i++) { | ||
36 : | # for (j = 1; j < 61; j+=4) { | ||
37 : | # if (codes[i][j] |codes[i][j+1]| | ||
38 : | # codes[i][j+2]|codes[i][j+3]) { | ||
39 : | # cbp |= 1 << (5 - i); | ||
40 : | # break; | ||
41 : | # } | ||
42 : | # } | ||
43 : | # | ||
44 : | # if(codes[i][j]|codes[i][j+1]|codes[i][j+2]) | ||
45 : | # cbp |= 1 << (5 - i); | ||
46 : | # | ||
47 : | # } | ||
48 : | # | ||
49 : | # return cbp; | ||
50 : | # | ||
51 : | #} | ||
52 : | |||
53 : | .data | ||
54 : | .skip: | ||
55 : | .quad 0x0000FFFFFFFFFFFF,-1 | ||
56 : | .align 4 | ||
57 : | |||
58 : | .text | ||
59 : | .global calc_cbp_altivec | ||
60 : | calc_cbp_altivec: | ||
61 : | # r9 will contain coeffs addr | ||
62 : | mr 9,3 | ||
63 : | # r3 contains the result, therefore we set it to 0 | ||
64 : | xor 3,3,3 | ||
65 : | |||
66 : | # CTR is the loop counter (rows) | ||
67 : | li 4,6 | ||
68 : | mtctr 4 | ||
69 : | vxor 12,12,12 | ||
70 : | lis 4,.skip@ha | ||
71 : | addi 4,4,.skip@l | ||
72 : | lvx 10,0,4 | ||
73 : | .loop: | ||
74 : | mr 6,9 | ||
75 : | # coeffs is a matrix of 16 bits cells | ||
76 : | lvxl 1,0,6 | ||
77 : | vand 1,1,10 | ||
78 : | |||
79 : | addi 6,6,16 | ||
80 : | lvxl 2,0,6 | ||
81 : | |||
82 : | addi 6,6,16 | ||
83 : | lvxl 3,0,6 | ||
84 : | |||
85 : | addi 6,6,16 | ||
86 : | lvxl 4,0,6 | ||
87 : | |||
88 : | addi 6,6,16 | ||
89 : | lvxl 5,0,6 | ||
90 : | |||
91 : | addi 6,6,16 | ||
92 : | lvxl 6,0,6 | ||
93 : | |||
94 : | addi 6,6,16 | ||
95 : | lvxl 7,0,6 | ||
96 : | |||
97 : | addi 6,6,16 | ||
98 : | lvxl 8,0,6 | ||
99 : | |||
100 : | vor 1,2,1 | ||
101 : | vor 1,3,1 | ||
102 : | vor 1,4,1 | ||
103 : | vor 1,5,1 | ||
104 : | vor 1,6,1 | ||
105 : | vor 1,7,1 | ||
106 : | vor 1,8,1 | ||
107 : | |||
108 : | vcmpequw. 3,1,12 | ||
109 : | bt 24,.newline | ||
110 : | .cbp: | ||
111 : | mfctr 5 | ||
112 : | subi 5,5,1 | ||
113 : | li 4,1 | ||
114 : | slw 4,4,5 | ||
115 : | or 3,3,4 | ||
116 : | .newline: | ||
117 : | addi 9,9,128 | ||
118 : | bdnz .loop | ||
119 : | blr |
No admin address has been configured | ViewVC Help |
Powered by ViewVC 1.0.4 |