Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

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  * yuv2rgb_mlib.c
00003  * Copyright (C) 2000-2002 Håkan Hjort <d95hjort@dtek.chalmers.se>
00004  *
00005  * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
00006  * See http://libmpeg2.sourceforge.net/ for updates.
00007  *
00008  * mpeg2dec is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * mpeg2dec is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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;        /* Fallback to C */
00079 }
00080 
00081 #endif
 

Powered by Plone

This site conforms to the following standards: