Mercurial > mplayer.hg
annotate libswscale/mlib/yuv2rgb_mlib.c @ 32658:7246ea769aef
Drop unnecessary Xlib.h #include from Xss screensaver extensions check.
author | diego |
---|---|
date | Sun, 02 Jan 2011 12:05:23 +0000 |
parents | 6fd0de7a6fd2 |
children |
rev | line source |
---|---|
29028 | 1 /* |
2 * software YUV to RGB converter using mediaLib | |
3 * | |
4 * Copyright (C) 2003 Michael Niedermayer <michaelni@gmx.at> | |
5 * | |
6 * This file is part of FFmpeg. | |
7 * | |
8 * FFmpeg is free software; you can redistribute it and/or | |
9 * modify it under the terms of the GNU Lesser General Public | |
10 * License as published by the Free Software Foundation; either | |
11 * version 2.1 of the License, or (at your option) any later version. | |
12 * | |
13 * FFmpeg is distributed in the hope that it will be useful, | |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 * Lesser General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU Lesser General Public | |
19 * License along with FFmpeg; if not, write to the Free Software | |
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
21 */ | |
22 | |
23 #include <mlib_types.h> | |
24 #include <mlib_status.h> | |
25 #include <mlib_sys.h> | |
26 #include <mlib_video.h> | |
27 #include <inttypes.h> | |
28 #include <stdlib.h> | |
29 #include <assert.h> | |
30 | |
31 #include "libswscale/swscale.h" | |
31966
6fd0de7a6fd2
Fix mlib compilation: add mising include for SwsContext.
reimar
parents:
29481
diff
changeset
|
32 #include "libswscale/swscale_internal.h" |
29028 | 33 |
34 static int mlib_YUV2ARGB420_32(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, | |
29481 | 35 int srcSliceH, uint8_t* dst[], int dstStride[]) |
36 { | |
37 if(c->srcFormat == PIX_FMT_YUV422P) { | |
29028 | 38 srcStride[1] *= 2; |
39 srcStride[2] *= 2; | |
40 } | |
41 | |
42 assert(srcStride[1] == srcStride[2]); | |
43 | |
44 mlib_VideoColorYUV2ARGB420(dst[0]+srcSliceY*dstStride[0], src[0], src[1], src[2], c->dstW, | |
45 srcSliceH, dstStride[0], srcStride[0], srcStride[1]); | |
46 return srcSliceH; | |
47 } | |
48 | |
49 static int mlib_YUV2ABGR420_32(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, | |
29481 | 50 int srcSliceH, uint8_t* dst[], int dstStride[]) |
51 { | |
52 if(c->srcFormat == PIX_FMT_YUV422P) { | |
29028 | 53 srcStride[1] *= 2; |
54 srcStride[2] *= 2; | |
55 } | |
56 | |
57 assert(srcStride[1] == srcStride[2]); | |
58 | |
59 mlib_VideoColorYUV2ABGR420(dst[0]+srcSliceY*dstStride[0], src[0], src[1], src[2], c->dstW, | |
60 srcSliceH, dstStride[0], srcStride[0], srcStride[1]); | |
61 return srcSliceH; | |
62 } | |
63 | |
64 static int mlib_YUV2RGB420_24(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, | |
29481 | 65 int srcSliceH, uint8_t* dst[], int dstStride[]) |
66 { | |
67 if(c->srcFormat == PIX_FMT_YUV422P) { | |
29028 | 68 srcStride[1] *= 2; |
69 srcStride[2] *= 2; | |
70 } | |
71 | |
72 assert(srcStride[1] == srcStride[2]); | |
73 | |
74 mlib_VideoColorYUV2RGB420(dst[0]+srcSliceY*dstStride[0], src[0], src[1], src[2], c->dstW, | |
75 srcSliceH, dstStride[0], srcStride[0], srcStride[1]); | |
76 return srcSliceH; | |
77 } | |
78 | |
79 | |
80 SwsFunc ff_yuv2rgb_init_mlib(SwsContext *c) | |
81 { | |
29481 | 82 switch(c->dstFormat) { |
29028 | 83 case PIX_FMT_RGB24: return mlib_YUV2RGB420_24; |
84 case PIX_FMT_BGR32: return mlib_YUV2ARGB420_32; | |
85 case PIX_FMT_RGB32: return mlib_YUV2ABGR420_32; | |
86 default: return NULL; | |
87 } | |
88 } | |
89 |