Parent Directory | Revision Log
Revision 1.10 - (view) (download)
1 : | canard | 1.2 | # Copyright (C) 2002 Guillaume Morin <guillaume@morinfr.org>, Alcôve |
2 : | canard | 1.1 | # |
3 : | edgomez | 1.10 | # * This file is part of XviD, a free MPEG-4 video encoder/decoder |
4 : | # * | ||
5 : | # * XviD is free software; you can redistribute it and/or modify it | ||
6 : | # * under the terms of the GNU General Public License as published by | ||
7 : | # * the Free Software Foundation; either version 2 of the License, or | ||
8 : | # * (at your option) any later version. | ||
9 : | # * | ||
10 : | # * This program is distributed in the hope that it will be useful, | ||
11 : | # * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 : | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 : | # * GNU General Public License for more details. | ||
14 : | # * | ||
15 : | # * You should have received a copy of the GNU General Public License | ||
16 : | # * along with this program; if not, write to the Free Software | ||
17 : | # * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 : | # * | ||
19 : | # * Under section 8 of the GNU General Public License, the copyright | ||
20 : | # * holders of XVID explicitly forbid distribution in the following | ||
21 : | # * countries: | ||
22 : | # * | ||
23 : | # * - Japan | ||
24 : | # * - United States of America | ||
25 : | # * | ||
26 : | # * Linking XviD statically or dynamically with other modules is making a | ||
27 : | # * combined work based on XviD. Thus, the terms and conditions of the | ||
28 : | # * GNU General Public License cover the whole combination. | ||
29 : | # * | ||
30 : | # * As a special exception, the copyright holders of XviD give you | ||
31 : | # * permission to link XviD with independent modules that communicate with | ||
32 : | # * XviD solely through the VFW1.1 and DShow interfaces, regardless of the | ||
33 : | # * license terms of these independent modules, and to copy and distribute | ||
34 : | # * the resulting combined work under terms of your choice, provided that | ||
35 : | # * every copy of the combined work is accompanied by a complete copy of | ||
36 : | # * the source code of XviD (the version of XviD used to produce the | ||
37 : | # * combined work), being distributed under the terms of the GNU General | ||
38 : | # * Public License plus this exception. An independent module is a module | ||
39 : | # * which is not derived from or based on XviD. | ||
40 : | # * | ||
41 : | # * Note that people who make modified versions of XviD are not obligated | ||
42 : | # * to grant this special exception for their modified versions; it is | ||
43 : | # * their choice whether to do so. The GNU General Public License gives | ||
44 : | # * permission to release a modified version without this exception; this | ||
45 : | # * exception also makes it possible to release a modified version which | ||
46 : | # * carries forward this exception. | ||
47 : | # * | ||
48 : | canard | 1.1 | # |
49 : | edgomez | 1.10 | # $Id: cbp_ppc.s,v 1.9 2002/03/28 12:29:58 canard Exp $ |
50 : | # $Source: /xvid/xvidcore/src/bitstream/ppc_asm/cbp_ppc.s,v $ | ||
51 : | # $Date: 2002/03/28 12:29:58 $ | ||
52 : | # $Author: canard $ | ||
53 : | canard | 1.2 | # |
54 : | canard | 1.5 | # This is my first PPC ASM attempt. So I might do nasty things. |
55 : | # Please send any comments to <guillaume@morinfr.org> | ||
56 : | canard | 1.2 | |
57 : | canard | 1.1 | |
58 : | canard | 1.2 | # Returns a field of bits that indicates non zero ac blocks |
59 : | # for this macro block | ||
60 : | # | ||
61 : | # uint32_t calc_cbp_c(const int16_t codes[6][64]) | ||
62 : | canard | 1.1 | #{ |
63 : | canard | 1.2 | # uint32_t i, j; |
64 : | # uint32_t cbp = 0; | ||
65 : | canard | 1.1 | # |
66 : | canard | 1.2 | # for (i = 0; i < 6; i++) { |
67 : | # for (j = 1; j < 61; j+=4) { | ||
68 : | canard | 1.1 | # if (codes[i][j] |codes[i][j+1]| |
69 : | canard | 1.2 | # codes[i][j+2]|codes[i][j+3]) { |
70 : | canard | 1.1 | # cbp |= 1 << (5 - i); |
71 : | # break; | ||
72 : | # } | ||
73 : | # } | ||
74 : | canard | 1.2 | # |
75 : | # if(codes[i][j]|codes[i][j+1]|codes[i][j+2]) | ||
76 : | # cbp |= 1 << (5 - i); | ||
77 : | # | ||
78 : | # } | ||
79 : | # | ||
80 : | # return cbp; | ||
81 : | # | ||
82 : | canard | 1.1 | #} |
83 : | |||
84 : | canard | 1.8 | .data |
85 : | .skip: | ||
86 : | .word 0,-1 | ||
87 : | .align 4 | ||
88 : | |||
89 : | canard | 1.1 | .text |
90 : | .global calc_cbp_ppc | ||
91 : | calc_cbp_ppc: | ||
92 : | canard | 1.2 | # r9 will contain coeffs addr |
93 : | canard | 1.9 | mr %r9,%r3 |
94 : | canard | 1.4 | # r8 is the loop counter (rows) |
95 : | canard | 1.9 | li %r8,5 |
96 : | canard | 1.2 | # r3 contains the result, therefore we set it to 0 |
97 : | canard | 1.9 | li %r3,0 |
98 : | canard | 1.1 | .loop: |
99 : | canard | 1.5 | # CTR is the loop2 counter |
100 : | canard | 1.9 | li %r4,16 |
101 : | mtctr %r4 | ||
102 : | canard | 1.2 | # r6 is coeff pointer for this line |
103 : | canard | 1.9 | mr %r6,%r9 |
104 : | lis %r7,.skip@ha | ||
105 : | addi %r7,%r7,.skip@l | ||
106 : | lwz %r7,0(%r7) | ||
107 : | canard | 1.1 | .loop2: |
108 : | canard | 1.2 | # coeffs is a matrix of 16 bits cells |
109 : | canard | 1.9 | lwz %r4,0(%r6) |
110 : | and %r4,%r4,%r7 | ||
111 : | li %r7,-1 | ||
112 : | canard | 1.8 | |
113 : | canard | 1.9 | lwz %r5,4(%r6) |
114 : | canard | 1.2 | # or. updates CR0 |
115 : | canard | 1.9 | or. %r4,%r5,%r4 |
116 : | canard | 1.2 | # testing bit 2 (is zero) of CR0 |
117 : | canard | 1.3 | bf 2,.cbp |
118 : | canard | 1.9 | addi %r6,%r6,8 |
119 : | canard | 1.5 | bdnz .loop2 |
120 : | canard | 1.8 | b .newline |
121 : | canard | 1.1 | .cbp: |
122 : | canard | 1.9 | li %r4,1 |
123 : | slw %r4,%r4,%r8 | ||
124 : | or %r3,%r3,%r4 | ||
125 : | canard | 1.1 | .newline: |
126 : | canard | 1.9 | addi %r9,%r9,128 |
127 : | canard | 1.2 | # updates CR0, blabla |
128 : | canard | 1.9 | subic. %r8,%r8,1 |
129 : | canard | 1.3 | bf 0,.loop |
130 : | canard | 1.1 | blr |
No admin address has been configured | ViewVC Help |
Powered by ViewVC 1.0.4 |