[svn] / trunk / xvidcore / src / bitstream / ppc_asm / cbp_ppc.s Repository:
ViewVC logotype

Annotation of /trunk/xvidcore/src/bitstream/ppc_asm/cbp_ppc.s

Parent Directory Parent Directory | Revision Log Revision Log


Revision 58 - (view) (download)

1 : canard 54 # Copyright (C) 2002 Guillaume Morin <guillaume@morinfr.org>, Alcôve
2 : canard 49 #
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 : canard 58 # $Id: cbp_ppc.s,v 1.6 2002-03-22 13:05:45 canard Exp $
19 : canard 49 # $Source: /home/xvid/cvs_copy/cvs-server-root/xvid/xvidcore/src/bitstream/ppc_asm/cbp_ppc.s,v $
20 : canard 58 # $Date: 2002-03-22 13:05:45 $
21 : canard 49 # $Author: canard $
22 : canard 54 #
23 : canard 57 # This is my first PPC ASM attempt. So I might do nasty things.
24 :     # Please send any comments to <guillaume@morinfr.org>
25 : canard 49
26 : canard 54
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 : canard 49 #{
32 : canard 54 # uint32_t i, j;
33 :     # uint32_t cbp = 0;
34 : canard 49 #
35 : canard 54 # for (i = 0; i < 6; i++) {
36 :     # for (j = 1; j < 61; j+=4) {
37 : canard 49 # if (codes[i][j] |codes[i][j+1]|
38 : canard 54 # codes[i][j+2]|codes[i][j+3]) {
39 : canard 49 # cbp |= 1 << (5 - i);
40 :     # break;
41 :     # }
42 :     # }
43 : canard 54 #
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 : canard 49 #}
52 :    
53 :     .text
54 :     .global calc_cbp_ppc
55 :     calc_cbp_ppc:
56 : canard 54 # r9 will contain coeffs addr
57 : canard 49 mr 9,3
58 : canard 56 # r8 is the loop counter (rows)
59 : canard 49 li 8,5
60 : canard 54 # r3 contains the result, therefore we set it to 0
61 : canard 49 xor 3,3,3
62 :     .loop:
63 : canard 57 # CTR is the loop2 counter
64 : canard 58 li 4,15
65 :     mtctr 4
66 : canard 54 # r6 is coeff pointer for this line
67 : canard 49 mr 6,9
68 :     .loop2:
69 : canard 54 # coeffs is a matrix of 16 bits cells
70 : canard 49 lha 4,2(6)
71 :     lha 5,4(6)
72 :     or 4,5,4
73 :     lha 5,6(6)
74 :     or 4,5,4
75 :     lha 5,8(6)
76 : canard 54 # or. updates CR0
77 :     or. 4,5,4
78 :     # testing bit 2 (is zero) of CR0
79 : canard 55 bf 2,.cbp
80 : canard 49 addi 6,6,8
81 : canard 57 bdnz .loop2
82 :     # latest line coeffs
83 : canard 49 lha 4,2(6)
84 :     lha 5,4(6)
85 :     or 4,5,4
86 :     lha 5,6(6)
87 : canard 54 # or. updates CR0
88 :     or. 4,5,4
89 :     # testing bit 2 (is zero) of CR0
90 : canard 55 bt 2,.newline
91 : canard 49 .cbp:
92 :     li 4,1
93 :     slw 4,4,8
94 :     or 3,3,4
95 :     .newline:
96 :     addi 9,9,128
97 : canard 54 # updates CR0, blabla
98 :     subic. 8,8,1
99 : canard 55 bf 0,.loop
100 : canard 49 blr

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4