2 * yuv2rgb_mlib.c, Software YUV to RGB coverter using mediaLib
4 * Copyright (C) 2000, HÃ¥kan Hjort <d95hjort@dtek.chalmers.se>
7 * This file is part of mpeg2dec, a free MPEG-2 video decoder
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, or (at your option)
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.
19 * You should have received a copy of the GNU General Public License
20 * along with GNU Make; see the file COPYING. If not, write to
21 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include <mlib_types.h>
26 #include <mlib_status.h>
28 #include <mlib_video.h>
30 static void mlib_YUV2ARGB420_32(uint8_t* image, uint8_t* py,
31 uint8_t* pu, uint8_t* pv,
32 int h_size, int v_size,
33 int rgb_stride, int y_stride, int uv_stride)
35 mlib_VideoColorYUV2ARGB420(image, py, pu, pv, h_size,
36 v_size, rgb_stride, y_stride, uv_stride);
39 static void mlib_YUV2ABGR420_32(uint8_t* image, uint8_t* py,
40 uint8_t* pu, uint8_t* pv,
41 int h_size, int v_size,
42 int rgb_stride, int y_stride, int uv_stride)
44 mlib_VideoColorYUV2ABGR420(image, py, pu, pv, h_size,
45 v_size, rgb_stride, y_stride, uv_stride);
48 static void mlib_YUV2RGB420_24(uint8_t* image, uint8_t* py,
49 uint8_t* pu, uint8_t* pv,
50 int h_size, int v_size,
51 int rgb_stride, int y_stride, int uv_stride)
53 mlib_VideoColorYUV2RGB420(image, py, pu, pv, h_size,
54 v_size, rgb_stride, y_stride, uv_stride);
58 yuv2rgb_fun yuv2rgb_init_mlib(int bpp, int mode)
63 if( mode == MODE_RGB )
64 return mlib_YUV2RGB420_24;
69 if( mode == MODE_RGB )
70 return mlib_YUV2ARGB420_32;
71 else if( mode == MODE_BGR )
72 return mlib_YUV2ABGR420_32;