Doxygen Source Code Documentation
        
Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search   
yuv2rgb_mlib.c
Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 #include "config.h"
00024 
00025 #ifdef LIBVO_MLIB
00026 
00027 #include <stddef.h>
00028 #include <mlib_types.h>
00029 #include <mlib_status.h>
00030 #include <mlib_sys.h>
00031 #include <mlib_video.h>
00032 #include <inttypes.h>
00033 
00034 #include "convert.h"
00035 #include "convert_internal.h"
00036 
00037 static void mlib_YUV2ARGB420_32 (void * _id, uint8_t * const * src,
00038                                  unsigned int v_offset)
00039 {
00040     convert_rgb_t * id = (convert_rgb_t *) _id;
00041 
00042     mlib_VideoColorYUV2ARGB420 (id->rgb_ptr + id->rgb_stride * v_offset,
00043                                 src[0], src[1], src[2],
00044                                 id->width, 16, id->rgb_stride,
00045                                 id->uv_stride << 1, id->uv_stride);
00046 }
00047 
00048 static void mlib_YUV2ABGR420_32 (void * _id, uint8_t * const * src,
00049                                  unsigned int v_offset)
00050 {
00051     convert_rgb_t * id = (convert_rgb_t *) _id;
00052 
00053     mlib_VideoColorYUV2ABGR420 (id->rgb_ptr + id->rgb_stride * v_offset,
00054                                 src[0], src[1], src[2],
00055                                 id->width, 16, id->rgb_stride,
00056                                 id->uv_stride << 1, id->uv_stride);
00057 }
00058 
00059 static void mlib_YUV2RGB420_24 (void * _id, uint8_t * const * src,
00060                                 unsigned int v_offset)
00061 {
00062     convert_rgb_t * id = (convert_rgb_t *) _id;
00063 
00064     mlib_VideoColorYUV2RGB420 (id->rgb_ptr + id->rgb_stride * v_offset,
00065                                src[0], src[1], src[2],
00066                                id->width, 16, id->rgb_stride,
00067                                id->uv_stride << 1, id->uv_stride);
00068 }
00069 
00070 yuv2rgb_copy * yuv2rgb_init_mlib (int order, int bpp)
00071 {
00072     if ((order == CONVERT_RGB) && (bpp == 24))
00073         return mlib_YUV2RGB420_24;
00074     else if ((order == CONVERT_RGB) && (bpp == 32))
00075         return mlib_YUV2ARGB420_32;
00076     else if ((order == CONVERT_BGR) && (bpp == 32))
00077         return mlib_YUV2ABGR420_32;
00078     return NULL;        
00079 }
00080 
00081 #endif