annotate libvo/yuv2rgb_mlib.c @ 2375:0170742db0c8

3ivx dshow added, ulaw/vbr mp3/cbr mp3 for MOV files added
author alex
date Mon, 22 Oct 2001 17:18:21 +0000
parents 44d4f1e9afb0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2 * yuv2rgb_mlib.c, Software YUV to RGB coverter using mediaLib
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
3 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
4 * Copyright (C) 2000, Håkan Hjort <d95hjort@dtek.chalmers.se>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
5 * All Rights Reserved.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
6 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
7 * This file is part of mpeg2dec, a free MPEG-2 video decoder
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
8 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
9 * mpeg2dec is free software; you can redistribute it and/or modify
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
11 * the Free Software Foundation; either version 2, or (at your option)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
12 * any later version.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
13 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
14 * mpeg2dec is distributed in the hope that it will be useful,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
17 * GNU General Public License for more details.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
18 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
20 * along with GNU Make; see the file COPYING. If not, write to
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
21 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
22 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
23 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
24
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
25 #include <stdio.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
26 #include <stdlib.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
27
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
28 #include "config.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
29 #include "video_out.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
30 #include "yuv2rgb.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
31
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
32 #include <mlib_types.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
33 #include <mlib_status.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
34 #include <mlib_sys.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
35 #include <mlib_video.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
36
1728
014b29286ec4 Remove superfluous 'const' parameter attributes to fix some compiler warnings
jkeil
parents: 1
diff changeset
37 static void mlib_YUV2ARGB420_32(uint8_t* image, uint8_t* py,
014b29286ec4 Remove superfluous 'const' parameter attributes to fix some compiler warnings
jkeil
parents: 1
diff changeset
38 uint8_t* pu, uint8_t* pv,
1806
44d4f1e9afb0 yuv2rgb_fun typedef uses int parameters, not uint32_t (fixes some compiler
jkeil
parents: 1728
diff changeset
39 int h_size, int v_size,
44d4f1e9afb0 yuv2rgb_fun typedef uses int parameters, not uint32_t (fixes some compiler
jkeil
parents: 1728
diff changeset
40 int rgb_stride, int y_stride, int uv_stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
41 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
42 mlib_VideoColorYUV2ARGB420(image, py, pu, pv, h_size,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
43 v_size, rgb_stride, y_stride, uv_stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
44 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
45
1728
014b29286ec4 Remove superfluous 'const' parameter attributes to fix some compiler warnings
jkeil
parents: 1
diff changeset
46 static void mlib_YUV2ABGR420_32(uint8_t* image, uint8_t* py,
014b29286ec4 Remove superfluous 'const' parameter attributes to fix some compiler warnings
jkeil
parents: 1
diff changeset
47 uint8_t* pu, uint8_t* pv,
1806
44d4f1e9afb0 yuv2rgb_fun typedef uses int parameters, not uint32_t (fixes some compiler
jkeil
parents: 1728
diff changeset
48 int h_size, int v_size,
44d4f1e9afb0 yuv2rgb_fun typedef uses int parameters, not uint32_t (fixes some compiler
jkeil
parents: 1728
diff changeset
49 int rgb_stride, int y_stride, int uv_stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
50 {
1806
44d4f1e9afb0 yuv2rgb_fun typedef uses int parameters, not uint32_t (fixes some compiler
jkeil
parents: 1728
diff changeset
51 mlib_VideoColorYUV2ABGR420(image, py, pu, pv, h_size,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
52 v_size, rgb_stride, y_stride, uv_stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
53 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
54
1728
014b29286ec4 Remove superfluous 'const' parameter attributes to fix some compiler warnings
jkeil
parents: 1
diff changeset
55 static void mlib_YUV2RGB420_24(uint8_t* image, uint8_t* py,
014b29286ec4 Remove superfluous 'const' parameter attributes to fix some compiler warnings
jkeil
parents: 1
diff changeset
56 uint8_t* pu, uint8_t* pv,
1806
44d4f1e9afb0 yuv2rgb_fun typedef uses int parameters, not uint32_t (fixes some compiler
jkeil
parents: 1728
diff changeset
57 int h_size, int v_size,
44d4f1e9afb0 yuv2rgb_fun typedef uses int parameters, not uint32_t (fixes some compiler
jkeil
parents: 1728
diff changeset
58 int rgb_stride, int y_stride, int uv_stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
59 {
1806
44d4f1e9afb0 yuv2rgb_fun typedef uses int parameters, not uint32_t (fixes some compiler
jkeil
parents: 1728
diff changeset
60 mlib_VideoColorYUV2RGB420(image, py, pu, pv, h_size,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
61 v_size, rgb_stride, y_stride, uv_stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
62 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
63
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
64
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
65 yuv2rgb_fun yuv2rgb_init_mlib(int bpp, int mode)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
66 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
67
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
68 if( bpp == 24 )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
69 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
70 if( mode == MODE_RGB )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
71 return mlib_YUV2RGB420_24;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
72 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
73
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
74 if( bpp == 32 )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
75 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
76 if( mode == MODE_RGB )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
77 return mlib_YUV2ARGB420_32;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
78 else if( mode == MODE_BGR )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
79 return mlib_YUV2ABGR420_32;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
80 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
81
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
82 return NULL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
83 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
84