Mercurial > mplayer.hg
annotate libswscale/yuv2rgb_mlib.c @ 23129:9528d1ebe68f
cosmetics: Remove trailing whitespace.
author | diego |
---|---|
date | Thu, 26 Apr 2007 23:07:11 +0000 |
parents | 8aac0a59f9c7 |
children | ebc55c913d73 |
rev | line source |
---|---|
23129 | 1 /* |
18861 | 2 * yuv2rgb_mlib.c, Software YUV to RGB coverter using mediaLib |
3 * | |
4 * Copyright (C) 2000, Håkan Hjort <d95hjort@dtek.chalmers.se> | |
5 * All Rights Reserved. | |
6 * | |
7 * This file is part of mpeg2dec, a free MPEG-2 video decoder | |
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, or (at your option) | |
12 * 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 | |
21976 | 20 * along with mpeg2dec; if not, write to the Free Software |
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
18861 | 22 */ |
23 | |
24 #include <mlib_types.h> | |
25 #include <mlib_status.h> | |
26 #include <mlib_sys.h> | |
27 #include <mlib_video.h> | |
28 #include <inttypes.h> | |
29 #include <stdlib.h> | |
30 #include <assert.h> | |
31 | |
32 #include "swscale.h" | |
33 | |
23129 | 34 static int mlib_YUV2ARGB420_32(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, |
18861 | 35 int srcSliceH, uint8_t* dst[], int dstStride[]){ |
19872
8e50cba9fe03
Remove the dependency of libswscale on img_format.h
lucabe
parents:
19431
diff
changeset
|
36 if(c->srcFormat == PIX_FMT_YUV422P){ |
18861 | 37 srcStride[1] *= 2; |
38 srcStride[2] *= 2; | |
39 } | |
23129 | 40 |
18861 | 41 assert(srcStride[1] == srcStride[2]); |
23129 | 42 |
18861 | 43 mlib_VideoColorYUV2ARGB420(dst[0]+srcSliceY*dstStride[0], src[0], src[1], src[2], c->dstW, |
44 srcSliceH, dstStride[0], srcStride[0], srcStride[1]); | |
45 return srcSliceH; | |
46 } | |
47 | |
23129 | 48 static int mlib_YUV2ABGR420_32(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, |
18861 | 49 int srcSliceH, uint8_t* dst[], int dstStride[]){ |
19872
8e50cba9fe03
Remove the dependency of libswscale on img_format.h
lucabe
parents:
19431
diff
changeset
|
50 if(c->srcFormat == PIX_FMT_YUV422P){ |
18861 | 51 srcStride[1] *= 2; |
52 srcStride[2] *= 2; | |
53 } | |
23129 | 54 |
18861 | 55 assert(srcStride[1] == srcStride[2]); |
23129 | 56 |
18861 | 57 mlib_VideoColorYUV2ABGR420(dst[0]+srcSliceY*dstStride[0], src[0], src[1], src[2], c->dstW, |
58 srcSliceH, dstStride[0], srcStride[0], srcStride[1]); | |
59 return srcSliceH; | |
60 } | |
61 | |
23129 | 62 static int mlib_YUV2RGB420_24(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, |
18861 | 63 int srcSliceH, uint8_t* dst[], int dstStride[]){ |
19872
8e50cba9fe03
Remove the dependency of libswscale on img_format.h
lucabe
parents:
19431
diff
changeset
|
64 if(c->srcFormat == PIX_FMT_YUV422P){ |
18861 | 65 srcStride[1] *= 2; |
66 srcStride[2] *= 2; | |
67 } | |
23129 | 68 |
18861 | 69 assert(srcStride[1] == srcStride[2]); |
23129 | 70 |
18861 | 71 mlib_VideoColorYUV2RGB420(dst[0]+srcSliceY*dstStride[0], src[0], src[1], src[2], c->dstW, |
72 srcSliceH, dstStride[0], srcStride[0], srcStride[1]); | |
73 return srcSliceH; | |
74 } | |
75 | |
76 | |
23129 | 77 SwsFunc yuv2rgb_init_mlib(SwsContext *c) |
18861 | 78 { |
79 switch(c->dstFormat){ | |
19872
8e50cba9fe03
Remove the dependency of libswscale on img_format.h
lucabe
parents:
19431
diff
changeset
|
80 case PIX_FMT_RGB24: return mlib_YUV2RGB420_24; |
8e50cba9fe03
Remove the dependency of libswscale on img_format.h
lucabe
parents:
19431
diff
changeset
|
81 case PIX_FMT_BGR32: return mlib_YUV2ARGB420_32; |
8e50cba9fe03
Remove the dependency of libswscale on img_format.h
lucabe
parents:
19431
diff
changeset
|
82 case PIX_FMT_RGB32: return mlib_YUV2ABGR420_32; |
18861 | 83 default: return NULL; |
84 } | |
85 } | |
86 |