MythTV  master
yuv2rgb.h
Go to the documentation of this file.
1 /*
2  * yuv2rgb.h
3  * Copyright (C) 2000-2001 Michel Lespinasse <walken@zoy.org>
4  * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
5  *
6  * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
7  * See http://libmpeg2.sourceforge.net/ for updates.
8  *
9  * mpeg2dec is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * mpeg2dec is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  */
23 
24 #ifndef MYTH_YUV2RGB_H
25 #define MYTH_YUV2RGB_H
26 
27 #include <cinttypes>
28 
29 #define MODE_RGB 0x1
30 #define MODE_BGR 0x2
31 
32 typedef void (* yuv2rgb_fun) (uint8_t * image, uint8_t * py,
33  uint8_t * pu, uint8_t * pv,
34  int h_size, int v_size,
35  int rgb_stride, int y_stride, int uv_stride,
36  int alphaones);
37 
38 extern yuv2rgb_fun yuv2rgb;
39 
40 void yuv2rgb_init (int bpp, int mode);
41 yuv2rgb_fun yuv2rgb_init_mmxext (int bpp, int mode);
42 yuv2rgb_fun yuv2rgb_init_mmx (int bpp, int mode);
43 //yuv2rgb_fun yuv2rgb_init_mlib (int bpp, int mode);
44 
45 // actually does to i420
46 void rgb32_to_yuv420p(unsigned char *lum, unsigned char *cb, unsigned char *cr,
47  unsigned char *alpha, unsigned char *src,
48  int width, int height, int srcwidth);
49 
50 
51 // These are used to help speed up playback by QuickTime on OS X
52 
53 typedef void (*conv_i420_2vuy_fun) (
54  uint8_t *image, int vuy_stride,
55  const uint8_t *py, const uint8_t *pu, const uint8_t *pv,
56  int y_stride, int u_stride, int v_stride,
57  int h_size, int v_size);
58 
59 
61 
62 typedef void (*conv_2vuy_i420_fun) (
63  uint8_t *py, uint8_t *pu, uint8_t *pv,
64  int y_stride, int u_stride, int v_stride,
65  const uint8_t *image, int vuy_stride,
66  int h_size, int v_size);
67 
69 
70 #endif /* MYTH_YUV2RGB_H */
void(* yuv2rgb_fun)(uint8_t *image, uint8_t *py, uint8_t *pu, uint8_t *pv, int h_size, int v_size, int rgb_stride, int y_stride, int uv_stride, int alphaones)
Definition: yuv2rgb.h:32
yuv2rgb_fun yuv2rgb
yuv2rgb_fun yuv2rgb_init_mmx(int bpp, int mode)
This returns a yuv to rgba converter, using mmx if MMX was compiled in.
Definition: yuv2rgb.cpp:384
conv_i420_2vuy_fun get_i420_2vuy_conv(void)
Returns I420 to 2VUY conversion function.
Definition: yuv2rgb.cpp:1017
conv_2vuy_i420_fun get_2vuy_i420_conv(void)
Returns 2VUY to I420 conversion function.
Definition: yuv2rgb.cpp:1211
void yuv2rgb_init(int bpp, int mode)
void(* conv_i420_2vuy_fun)(uint8_t *image, int vuy_stride, const uint8_t *py, const uint8_t *pu, const uint8_t *pv, int y_stride, int u_stride, int v_stride, int h_size, int v_size)
Definition: yuv2rgb.h:53
void rgb32_to_yuv420p(unsigned char *lum, unsigned char *cb, unsigned char *cr, unsigned char *alpha, unsigned char *src, int width, int height, int srcwidth)
Convert planar RGB to YUV420.
Definition: yuv2rgb.cpp:499
yuv2rgb_fun yuv2rgb_init_mmxext(int bpp, int mode)
This returns a yuv to rgba converter, using mmxext if MMX was compiled in.
Definition: yuv2rgb.cpp:360
void(* conv_2vuy_i420_fun)(uint8_t *py, uint8_t *pu, uint8_t *pv, int y_stride, int u_stride, int v_stride, const uint8_t *image, int vuy_stride, int h_size, int v_size)
Definition: yuv2rgb.h:62