author | alwin <alwin> | 2005-04-12 18:01:08 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-04-12 18:01:08 (UTC) |
commit | be565a8eb0c602e5173b71cf71ba510a7a7f4520 (patch) (unidiff) | |
tree | 2091e68446c071a5ce7a6d375db0afab695c46bd | |
parent | 4fd936e4096ba9c732bde17a48489bfbb94b19ba (diff) | |
download | opie-be565a8eb0c602e5173b71cf71ba510a7a7f4520.zip opie-be565a8eb0c602e5173b71cf71ba510a7a7f4520.tar.gz opie-be565a8eb0c602e5173b71cf71ba510a7a7f4520.tar.bz2 |
buildfix
-rw-r--r-- | noncore/multimedia/opieplayer2/yuv2rgb_arm2.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/yuv2rgb_arm2.c b/noncore/multimedia/opieplayer2/yuv2rgb_arm2.c index cbd32e8..91cd0b1 100644 --- a/noncore/multimedia/opieplayer2/yuv2rgb_arm2.c +++ b/noncore/multimedia/opieplayer2/yuv2rgb_arm2.c | |||
@@ -1,198 +1,199 @@ | |||
1 | /* | 1 | /* |
2 | * yuv2rgb_arm2.c | 2 | * yuv2rgb_arm2.c |
3 | * Copyright (C) 2002 Frederic 'dilb' Boulay. | 3 | * Copyright (C) 2002 Frederic 'dilb' Boulay. |
4 | * All Rights Reserved. | 4 | * All Rights Reserved. |
5 | * | 5 | * |
6 | * Author: Frederic Boulay <dilb@handhelds.org> | 6 | * Author: Frederic Boulay <dilb@handhelds.org> |
7 | * | 7 | * |
8 | * you can redistribute this file and/or modify | 8 | * you can redistribute this file and/or modify |
9 | * it under the terms of the GNU General Public License (version 2) | 9 | * it under the terms of the GNU General Public License (version 2) |
10 | * as published by the Free Software Foundation. | 10 | * as published by the Free Software Foundation. |
11 | * | 11 | * |
12 | * This file is distributed in the hope that it will be useful, | 12 | * This file is distributed in the hope that it will be useful, |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
16 | * | 16 | * |
17 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License |
18 | * along with this program; if not, write to the Free Software | 18 | * along with this program; if not, write to the Free Software |
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 | * | 20 | * |
21 | * | 21 | * |
22 | * The function defined in this file, are derived from work done in the xine | 22 | * The function defined in this file, are derived from work done in the xine |
23 | * project. | 23 | * project. |
24 | * In order to improve performance, by strongly reducing memory bandwidth | 24 | * In order to improve performance, by strongly reducing memory bandwidth |
25 | * needed, the scaling functions are merged with the yuv2rgb function. | 25 | * needed, the scaling functions are merged with the yuv2rgb function. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #ifdef __arm__ | 28 | #ifdef __arm__ |
29 | 29 | ||
30 | #include <stdio.h> | 30 | #include <stdio.h> |
31 | #include <stdlib.h> | 31 | #include <stdlib.h> |
32 | #include <string.h> | 32 | #include <string.h> |
33 | #include <inttypes.h> | 33 | #include <inttypes.h> |
34 | 34 | ||
35 | #include "yuv2rgb.h" | 35 | #include "yuv2rgb.h" |
36 | #include <xine/xineutils.h> | 36 | #include <xine/xineutils.h> |
37 | 37 | ||
38 | /* Prototypes of the "local" functions available here: */ | 38 | /* Prototypes of the "local" functions available here: */ |
39 | /* first prototype, function called when no scaling is needed: */ | 39 | /* first prototype, function called when no scaling is needed: */ |
40 | static void arm_rgb16_noscale(yuv2rgb_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*); | 40 | static void arm_rgb16_noscale(yuv2rgb_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*); |
41 | /* second prototype, function called when no horizontal scaling is needed: */ | 41 | /* second prototype, function called when no horizontal scaling is needed: */ |
42 | static void arm_rgb16_step_dx_32768(yuv2rgb_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*); | 42 | static void arm_rgb16_step_dx_32768(yuv2rgb_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*); |
43 | /* third prototype, function called when scaling is needed for zooming in: */ | 43 | /* third prototype, function called when scaling is needed for zooming in: */ |
44 | static void arm_rgb16_step_dx_inf_32768(yuv2rgb_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*); | 44 | static void arm_rgb16_step_dx_inf_32768(yuv2rgb_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*); |
45 | /* fourth prototype, function called when scaling is needed for zooming out (between 1x and 2x): */ | 45 | /* fourth prototype, function called when scaling is needed for zooming out (between 1x and 2x): */ |
46 | static void arm_rgb16_step_dx_bet_32768_65536(yuv2rgb_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*); | 46 | static void arm_rgb16_step_dx_bet_32768_65536(yuv2rgb_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*); |
47 | /* fifth prototype, function called when scaling is needed for zooming out (greater than 2x): */ | 47 | /* fifth prototype, function called when scaling is needed for zooming out (greater than 2x): */ |
48 | static void arm_rgb16_step_dx_sup_65536(yuv2rgb_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*); | 48 | static void arm_rgb16_step_dx_sup_65536(yuv2rgb_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*); |
49 | /* sixth prototype, function where the decision of the scaling function to use is made.*/ | 49 | /* sixth prototype, function where the decision of the scaling function to use is made.*/ |
50 | static void arm_rgb16_2 (yuv2rgb_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*); | 50 | static void arm_rgb16_2 (yuv2rgb_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*); |
51 | 51 | ||
52 | 52 | ||
53 | 53 | ||
54 | 54 | ||
55 | /* extern function: */ | 55 | /* extern function: */ |
56 | 56 | ||
57 | /* Function: */ | 57 | /* Function: */ |
58 | void yuv2rgb_init_arm (yuv2rgb_factory_t *this) | 58 | void yuv2rgb_init_arm (yuv2rgb_factory_t *this) |
59 | /* This function initialise the member yuv2rgb_fun, if everything is right | 59 | /* This function initialise the member yuv2rgb_fun, if everything is right |
60 | the function optimised for the arm target should be used.*/ | 60 | the function optimised for the arm target should be used.*/ |
61 | { | 61 | { |
62 | if (this->swapped) | 62 | if (this->swapped) |
63 | return; /*no swapped pixel output upto now*/ | 63 | return; /*no swapped pixel output upto now*/ |
64 | 64 | ||
65 | switch (this->mode) | 65 | switch (this->mode) |
66 | { | 66 | { |
67 | case MODE_16_RGB: | 67 | case MODE_16_RGB: |
68 | this->yuv2rgb_fun = arm_rgb16_2; | 68 | this->yuv2rgb_fun = arm_rgb16_2; |
69 | break; | 69 | break; |
70 | default: | 70 | default: |
71 | break; | ||
71 | } | 72 | } |
72 | } | 73 | } |
73 | 74 | ||
74 | 75 | ||
75 | 76 | ||
76 | /* local functions: */ | 77 | /* local functions: */ |
77 | 78 | ||
78 | /* Function: */ | 79 | /* Function: */ |
79 | static void arm_rgb16_2 (yuv2rgb_t *this, uint8_t * _dst, uint8_t * _py, uint8_t * _pu, uint8_t * _pv) | 80 | static void arm_rgb16_2 (yuv2rgb_t *this, uint8_t * _dst, uint8_t * _py, uint8_t * _pu, uint8_t * _pv) |
80 | /* This function takes care of applying the right scaling conversion | 81 | /* This function takes care of applying the right scaling conversion |
81 | (yuv2rgb is included in each scaling function!)*/ | 82 | (yuv2rgb is included in each scaling function!)*/ |
82 | { | 83 | { |
83 | if (!this->do_scale) | 84 | if (!this->do_scale) |
84 | { | 85 | { |
85 | arm_rgb16_noscale(this, _dst, _py, _pu, _pv); | 86 | arm_rgb16_noscale(this, _dst, _py, _pu, _pv); |
86 | return; | 87 | return; |
87 | } | 88 | } |
88 | if (this->step_dx<32768) | 89 | if (this->step_dx<32768) |
89 | { | 90 | { |
90 | arm_rgb16_step_dx_inf_32768(this, _dst, _py, _pu, _pv); | 91 | arm_rgb16_step_dx_inf_32768(this, _dst, _py, _pu, _pv); |
91 | return; | 92 | return; |
92 | } | 93 | } |
93 | if (this->step_dx==32768) | 94 | if (this->step_dx==32768) |
94 | { | 95 | { |
95 | arm_rgb16_step_dx_32768(this, _dst, _py, _pu, _pv); | 96 | arm_rgb16_step_dx_32768(this, _dst, _py, _pu, _pv); |
96 | return; | 97 | return; |
97 | } | 98 | } |
98 | if (this->step_dx<65536) | 99 | if (this->step_dx<65536) |
99 | { | 100 | { |
100 | arm_rgb16_step_dx_bet_32768_65536(this, _dst, _py, _pu, _pv); | 101 | arm_rgb16_step_dx_bet_32768_65536(this, _dst, _py, _pu, _pv); |
101 | return; | 102 | return; |
102 | } | 103 | } |
103 | arm_rgb16_step_dx_sup_65536(this, _dst, _py, _pu, _pv); | 104 | arm_rgb16_step_dx_sup_65536(this, _dst, _py, _pu, _pv); |
104 | return; | 105 | return; |
105 | } | 106 | } |
106 | 107 | ||
107 | 108 | ||
108 | /* Function: */ | 109 | /* Function: */ |
109 | static void arm_rgb16_noscale(yuv2rgb_t *this, uint8_t * _dst, uint8_t * _py, uint8_t * _pu, uint8_t * _pv) | 110 | static void arm_rgb16_noscale(yuv2rgb_t *this, uint8_t * _dst, uint8_t * _py, uint8_t * _pu, uint8_t * _pv) |
110 | /* This function is called when the source and the destination pictures have the same size. | 111 | /* This function is called when the source and the destination pictures have the same size. |
111 | In this case, scaling part is not needed. | 112 | In this case, scaling part is not needed. |
112 | (This code is probably far from being optimised, in particular, the asm | 113 | (This code is probably far from being optimised, in particular, the asm |
113 | generated is not the most efficient, a pure asm version will probably | 114 | generated is not the most efficient, a pure asm version will probably |
114 | emerge sooner or later). But at least, this version is faster than what | 115 | emerge sooner or later). But at least, this version is faster than what |
115 | was used before.*/ | 116 | was used before.*/ |
116 | { | 117 | { |
117 | int height; | 118 | int height; |
118 | 119 | ||
119 | height=this->dest_height; | 120 | height=this->dest_height; |
120 | 121 | ||
121 | while (height>0) | 122 | while (height>0) |
122 | { | 123 | { |
123 | uint16_t *r, *g, *b; | 124 | uint16_t *r, *g, *b; |
124 | uint8_t *py, *py2, *pu, *pv; | 125 | uint8_t *py, *py2, *pu, *pv; |
125 | uint16_t *dst, *dst2; | 126 | uint16_t *dst, *dst2; |
126 | int width; | 127 | int width; |
127 | register uint8_t p1y, p1u, p1v; | 128 | register uint8_t p1y, p1u, p1v; |
128 | 129 | ||
129 | height-=2; | 130 | height-=2; |
130 | width=this->dest_width; | 131 | width=this->dest_width; |
131 | dst = _dst; | 132 | dst = _dst; |
132 | dst2 = _dst + this->rgb_stride; | 133 | dst2 = _dst + this->rgb_stride; |
133 | py = _py; | 134 | py = _py; |
134 | py2 = _py + this->y_stride; | 135 | py2 = _py + this->y_stride; |
135 | pu = _pu; | 136 | pu = _pu; |
136 | pv = _pv; | 137 | pv = _pv; |
137 | 138 | ||
138 | while (width>0) | 139 | while (width>0) |
139 | { | 140 | { |
140 | width-=2; | 141 | width-=2; |
141 | p1y=*py++; | 142 | p1y=*py++; |
142 | p1u=*pu++; | 143 | p1u=*pu++; |
143 | p1v=*pv++; | 144 | p1v=*pv++; |
144 | 145 | ||
145 | r = this->table_rV[p1v]; | 146 | r = this->table_rV[p1v]; |
146 | g = (void *) (((uint8_t *)this->table_gU[p1u]) + this->table_gV[p1v]); | 147 | g = (void *) (((uint8_t *)this->table_gU[p1u]) + this->table_gV[p1v]); |
147 | b = this->table_bU[p1u]; | 148 | b = this->table_bU[p1u]; |
148 | 149 | ||
149 | *dst++ = r[p1y] + g[p1y] + b[p1y]; | 150 | *dst++ = r[p1y] + g[p1y] + b[p1y]; |
150 | p1y=*py++; | 151 | p1y=*py++; |
151 | *dst++ = r[p1y] + g[p1y] + b[p1y]; | 152 | *dst++ = r[p1y] + g[p1y] + b[p1y]; |
152 | 153 | ||
153 | p1y=*py2++; | 154 | p1y=*py2++; |
154 | 155 | ||
155 | *dst2++ = r[p1y] + g[p1y] + b[p1y]; | 156 | *dst2++ = r[p1y] + g[p1y] + b[p1y]; |
156 | p1y=*py2++; | 157 | p1y=*py2++; |
157 | *dst2++ = r[p1y] + g[p1y] + b[p1y]; | 158 | *dst2++ = r[p1y] + g[p1y] + b[p1y]; |
158 | } | 159 | } |
159 | _dst += (this->rgb_stride)<<1; | 160 | _dst += (this->rgb_stride)<<1; |
160 | _py += (this->y_stride)<<1; | 161 | _py += (this->y_stride)<<1; |
161 | _pu += this->uv_stride; | 162 | _pu += this->uv_stride; |
162 | _pv += this->uv_stride; | 163 | _pv += this->uv_stride; |
163 | } | 164 | } |
164 | } | 165 | } |
165 | 166 | ||
166 | 167 | ||
167 | /* Function: */ | 168 | /* Function: */ |
168 | static void arm_rgb16_step_dx_inf_32768(yuv2rgb_t *this, uint8_t * _dst, uint8_t * _py, uint8_t * _pu, uint8_t * _pv) | 169 | static void arm_rgb16_step_dx_inf_32768(yuv2rgb_t *this, uint8_t * _dst, uint8_t * _py, uint8_t * _pu, uint8_t * _pv) |
169 | /* This function is called when the destination picture is bigger than the size | 170 | /* This function is called when the destination picture is bigger than the size |
170 | of the source picture. | 171 | of the source picture. |
171 | */ | 172 | */ |
172 | { | 173 | { |
173 | int recal_uv, height; /* Note about recal_uv: bit0 is for | 174 | int recal_uv, height; /* Note about recal_uv: bit0 is for |
174 | applying scale on u and v, bit1 is for increments of u and v pointers.*/ | 175 | applying scale on u and v, bit1 is for increments of u and v pointers.*/ |
175 | int dy; | 176 | int dy; |
176 | 177 | ||
177 | dy = 0; | 178 | dy = 0; |
178 | height = this->dest_height; | 179 | height = this->dest_height; |
179 | recal_uv=1; // 1 for evaluation of scale_line, needed the first time | 180 | recal_uv=1; // 1 for evaluation of scale_line, needed the first time |
180 | 181 | ||
181 | while(1) | 182 | while(1) |
182 | { | 183 | { |
183 | register int dxy; | 184 | register int dxy; |
184 | register int dxuv; | 185 | register int dxuv; |
185 | register uint8_t p1y, p2y; | 186 | register uint8_t p1y, p2y; |
186 | uint8_t dest1y, dest2y; | 187 | uint8_t dest1y, dest2y; |
187 | register uint8_t p1u, p2u; | 188 | register uint8_t p1u, p2u; |
188 | register uint8_t p1v, p2v; | 189 | register uint8_t p1v, p2v; |
189 | uint8_t dest1u; | 190 | uint8_t dest1u; |
190 | uint8_t dest1v; | 191 | uint8_t dest1v; |
191 | int width; | 192 | int width; |
192 | uint8_t *u_buffer; | 193 | uint8_t *u_buffer; |
193 | uint8_t *v_buffer; | 194 | uint8_t *v_buffer; |
194 | uint16_t *r, *g, *b; | 195 | uint16_t *r, *g, *b; |
195 | uint8_t *py, *pu, *pv; | 196 | uint8_t *py, *pu, *pv; |
196 | uint16_t *dst; | 197 | uint16_t *dst; |
197 | 198 | ||
198 | dxy = 0; | 199 | dxy = 0; |