Revision 8a322796 libswscale/rgb2rgb.c
libswscale/rgb2rgb.c | ||
---|---|---|
1 | 1 |
/* |
2 |
* rgb2rgb.c, Software RGB to RGB convertor
|
|
3 |
* pluralize by Software PAL8 to RGB convertor
|
|
4 |
* Software YUV to YUV convertor
|
|
5 |
* Software YUV to RGB convertor
|
|
6 |
* Written by Nick Kurshev.
|
|
7 |
* palette & YUV & runtime CPU stuff by Michael (michaelni@gmx.at)
|
|
2 |
* software RGB to RGB converter
|
|
3 |
* pluralize by software PAL8 to RGB converter
|
|
4 |
* software YUV to YUV converter
|
|
5 |
* software YUV to RGB converter
|
|
6 |
* Written by Nick Kurshev. |
|
7 |
* palette & YUV & runtime CPU stuff by Michael (michaelni@gmx.at) |
|
8 | 8 |
* |
9 | 9 |
* This file is part of FFmpeg. |
10 | 10 |
* |
... | ... | |
22 | 22 |
* along with FFmpeg; if not, write to the Free Software |
23 | 23 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
24 | 24 |
* |
25 |
* the C code (not assembly, mmx, ...) of this file can be used
|
|
26 |
* under the LGPL license too
|
|
25 |
* The C code (not assembly, MMX, ...) of this file can be used
|
|
26 |
* under the LGPL license.
|
|
27 | 27 |
*/ |
28 | 28 |
#include <inttypes.h> |
29 | 29 |
#include "config.h" |
... | ... | |
33 | 33 |
#include "swscale.h" |
34 | 34 |
#include "swscale_internal.h" |
35 | 35 |
|
36 |
#define FAST_BGR2YV12 // use 7 bit coeffs instead of 15bit
|
|
36 |
#define FAST_BGR2YV12 // use 7-bit instead of 15-bit coefficients
|
|
37 | 37 |
|
38 | 38 |
void (*rgb24to32)(const uint8_t *src, uint8_t *dst, long src_size); |
39 | 39 |
void (*rgb24to16)(const uint8_t *src, uint8_t *dst, long src_size); |
... | ... | |
149 | 149 |
#define RV ((int)( 0.439*(1<<RGB2YUV_SHIFT)+0.5)) |
150 | 150 |
#define RU ((int)(-0.148*(1<<RGB2YUV_SHIFT)+0.5)) |
151 | 151 |
|
152 |
//Note: we have C, MMX, MMX2, 3DNOW version therse no 3DNOW+MMX2 one
|
|
153 |
//Plain C versions
|
|
152 |
//Note: We have C, MMX, MMX2, 3DNOW versions, there is no 3DNOW + MMX2 one.
|
|
153 |
//plain C versions
|
|
154 | 154 |
#undef HAVE_MMX |
155 | 155 |
#undef HAVE_MMX2 |
156 | 156 |
#undef HAVE_3DNOW |
... | ... | |
190 | 190 |
#endif //ARCH_X86 || ARCH_X86_64 |
191 | 191 |
|
192 | 192 |
/* |
193 |
rgb15->rgb16 Original by Strepto/Astral
|
|
193 |
RGB15->RGB16 original by Strepto/Astral
|
|
194 | 194 |
ported to gcc & bugfixed : A'rpi |
195 | 195 |
MMX2, 3DNOW optimization by Nick Kurshev |
196 |
32bit c version, and and&add trick by Michael Niedermayer
|
|
196 |
32-bit C version, and and&add trick by Michael Niedermayer
|
|
197 | 197 |
*/ |
198 | 198 |
|
199 | 199 |
void sws_rgb2rgb_init(int flags){ |
... | ... | |
266 | 266 |
{ |
267 | 267 |
long i; |
268 | 268 |
/* |
269 |
writes 1 byte o much and might cause alignment issues on some architectures?
|
|
269 |
Writes 1 byte too much and might cause alignment issues on some architectures?
|
|
270 | 270 |
for (i=0; i<num_pixels; i++) |
271 | 271 |
((unsigned *)(&dst[i*3])) = ((unsigned *)palette)[src[i]]; |
272 | 272 |
*/ |
... | ... | |
284 | 284 |
{ |
285 | 285 |
long i; |
286 | 286 |
/* |
287 |
writes 1 byte o much and might cause alignment issues on some architectures?
|
|
287 |
Writes 1 byte too much and might cause alignment issues on some architectures?
|
|
288 | 288 |
for (i=0; i<num_pixels; i++) |
289 | 289 |
((unsigned *)(&dst[i*3])) = ((unsigned *)palette)[src[i]]; |
290 | 290 |
*/ |
... | ... | |
299 | 299 |
} |
300 | 300 |
|
301 | 301 |
/** |
302 |
* Palette is assumed to contain bgr16, see rgb32to16 to convert the palette
|
|
302 |
* Palette is assumed to contain BGR16, see rgb32to16 to convert the palette.
|
|
303 | 303 |
*/ |
304 | 304 |
void palette8torgb16(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette) |
305 | 305 |
{ |
Also available in: Unified diff