annotate libvo/yuv2rgb_mlib.c @ 1110:71b8911ec3da

-Wall like cleanup
author al3x
date Tue, 12 Jun 2001 14:09:25 +0000
parents 3b5f5d1c5041
children 014b29286ec4
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
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
37 static void mlib_YUV2ARGB420_32(uint8_t* image, const uint8_t* py,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
38 const uint8_t* pu, const uint8_t* pv,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
39 const uint32_t h_size, const uint32_t v_size,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
40 const uint32_t rgb_stride, const uint32_t y_stride,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
41 const uint32_t uv_stride)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
42 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
43 mlib_VideoColorYUV2ARGB420(image, py, pu, pv, h_size,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
44 v_size, rgb_stride, y_stride, uv_stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
45 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
46
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
47 static void mlib_YUV2ABGR420_32(uint8_t* image, const uint8_t* py,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
48 const uint8_t* pu, const uint8_t* pv,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
49 const uint32_t h_size, const uint32_t v_size,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
50 const uint32_t rgb_stride, const uint32_t y_stride,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
51 const uint32_t uv_stride)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
52 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
53 mlib_VideoColorYUV2ABGR420(image, py, pu, pv, h_size,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
54 v_size, rgb_stride, y_stride, uv_stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
55 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
56
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
57 static void mlib_YUV2RGB420_24(uint8_t* image, const uint8_t* py,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
58 const uint8_t* pu, const uint8_t* pv,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
59 const uint32_t h_size, const uint32_t v_size,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
60 const uint32_t rgb_stride, const uint32_t y_stride,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
61 const uint32_t uv_stride)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
62 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
63 mlib_VideoColorYUV2RGB420(image, py, pu, pv, h_size,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
64 v_size, rgb_stride, y_stride, uv_stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
65 }
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 yuv2rgb_fun yuv2rgb_init_mlib(int bpp, int mode)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
69 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
70
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
71 if( bpp == 24 )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
72 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
73 if( mode == MODE_RGB )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
74 return mlib_YUV2RGB420_24;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
75 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
76
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
77 if( bpp == 32 )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
78 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
79 if( mode == MODE_RGB )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
80 return mlib_YUV2ARGB420_32;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
81 else if( mode == MODE_BGR )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
82 return mlib_YUV2ABGR420_32;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
83 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
84
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
85 return NULL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
86 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
87