Commit 15b4ed29 authored by gbazin's avatar gbazin
Browse files

* modules/video_filter/swscale/*: new resizing/chroma conversion video filter...

* modules/video_filter/swscale/*: new resizing/chroma conversion video filter based on MPlayer's swscale module.
  (not enabled in configure.ac yet as it may have problems building on some platforms)
parent c1032025
......@@ -4105,6 +4105,7 @@ AC_CONFIG_FILES([
modules/stream_out/transrate/Makefile
modules/video_chroma/Makefile
modules/video_filter/Makefile
modules/video_filter/swscale/Makefile
modules/video_output/Makefile
modules/video_output/directx/Makefile
modules/video_output/qte/Makefile
......
SOURCES_swscale = \
swscale.c \
swscale.h \
swscale_internal.h \
yuv2rgb.c \
rgb2rgb.c \
rgb2rgb.h \
common.h \
filter.c \
$(NULL)
EXTRA_DIST += \
swscale_template.c \
swscale_altivec_template.c \
yuv2rgb_template.c \
yuv2rgb_altivec.c \
yuv2rgb_mlib.c \
rgb2rgb_template.c
\ No newline at end of file
/*****************************************************************************
* common.h: a few defines and wrappers for swscale
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
* $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define mp_msg(a,b,args... ) //fprintf(stderr, ##args)
#define vo_format_name(a) ""
#ifndef _VLC_FILTER_H
extern void *( *swscale_fast_memcpy )( void *, const void *, int );
#endif
#define memcpy(a,b,c) swscale_fast_memcpy(a,b,c)
#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__OS2__) || \
(defined(__OpenBSD__) && !defined(__ELF__))
#define MANGLE(a) "_" #a
#else
#define MANGLE(a) #a
#endif
#ifdef ARCH_X86
static inline unsigned short ByteSwap16(unsigned short x)
{
__asm("xchgb %b0,%h0" :
"=q" (x) :
"0" (x));
return x;
}
#define bswap_16(x) ByteSwap16(x)
#else
#define bswap_16(x) (((x) & 0x00ff) << 8 | ((x) & 0xff00) >> 8)
#endif /* !ARCH_X86 */
/* SWSCALE image formats */
#define IMGFMT_RGB_MASK 0xFFFFFF00
#define IMGFMT_RGB (('R'<<24)|('G'<<16)|('B'<<8))
#define IMGFMT_RGB1 (IMGFMT_RGB|1)
#define IMGFMT_RGB4 (IMGFMT_RGB|4)
#define IMGFMT_RGB4_CHAR (IMGFMT_RGB|4|128) // RGB4 with 1 pixel per byte
#define IMGFMT_RGB8 (IMGFMT_RGB|8)
#define IMGFMT_RGB15 (IMGFMT_RGB|15)
#define IMGFMT_RGB16 (IMGFMT_RGB|16)
#define IMGFMT_RGB24 (IMGFMT_RGB|24)
#define IMGFMT_RGB32 (IMGFMT_RGB|32)
#define IMGFMT_BGR_MASK 0xFFFFFF00
#define IMGFMT_BGR (('B'<<24)|('G'<<16)|('R'<<8))
#define IMGFMT_BGR1 (IMGFMT_BGR|1)
#define IMGFMT_BGR4 (IMGFMT_BGR|4)
#define IMGFMT_BGR4_CHAR (IMGFMT_BGR|4|128) // BGR4 with 1 pixel per byte
#define IMGFMT_BGR8 (IMGFMT_BGR|8)
#define IMGFMT_BGR15 (IMGFMT_BGR|15)
#define IMGFMT_BGR16 (IMGFMT_BGR|16)
#define IMGFMT_BGR24 (IMGFMT_BGR|24)
#define IMGFMT_BGR32 (IMGFMT_BGR|32)
#ifdef WORDS_BIGENDIAN
#define IMGFMT_ABGR IMGFMT_RGB32
#define IMGFMT_BGRA (IMGFMT_RGB32|64)
#define IMGFMT_ARGB IMGFMT_BGR32
#define IMGFMT_RGBA (IMGFMT_BGR32|64)
#else
#define IMGFMT_ABGR (IMGFMT_BGR32|64)
#define IMGFMT_BGRA IMGFMT_BGR32
#define IMGFMT_ARGB (IMGFMT_RGB32|64)
#define IMGFMT_RGBA IMGFMT_RGB32
#endif
/* old names for compatibility */
#define IMGFMT_RG4B IMGFMT_RGB4_CHAR
#define IMGFMT_BG4B IMGFMT_BGR4_CHAR
#define IMGFMT_IS_RGB(fmt) (((fmt)&IMGFMT_RGB_MASK)==IMGFMT_RGB)
#define IMGFMT_IS_BGR(fmt) (((fmt)&IMGFMT_BGR_MASK)==IMGFMT_BGR)
#define IMGFMT_RGB_DEPTH(fmt) ((fmt)&0x3F)
#define IMGFMT_BGR_DEPTH(fmt) ((fmt)&0x3F)
/* Planar YUV Formats */
#define IMGFMT_YVU9 0x39555659
#define IMGFMT_IF09 0x39304649
#define IMGFMT_YV12 0x32315659
#define IMGFMT_I420 0x30323449
#define IMGFMT_IYUV 0x56555949
#define IMGFMT_CLPL 0x4C504C43
#define IMGFMT_Y800 0x30303859
#define IMGFMT_Y8 0x20203859
#define IMGFMT_NV12 0x3231564E
#define IMGFMT_NV21 0x3132564E
/* unofficial Planar Formats, FIXME if official 4CC exists */
#define IMGFMT_444P 0x50343434
#define IMGFMT_422P 0x50323234
#define IMGFMT_411P 0x50313134
#define IMGFMT_HM12 0x32314D48
/* Packed YUV Formats */
#define IMGFMT_IUYV 0x56595549
#define IMGFMT_IY41 0x31435949
#define IMGFMT_IYU1 0x31555949
#define IMGFMT_IYU2 0x32555949
#define IMGFMT_UYVY 0x59565955
#define IMGFMT_UYNV 0x564E5955
#define IMGFMT_cyuv 0x76757963
#define IMGFMT_Y422 0x32323459
#define IMGFMT_YUY2 0x32595559
#define IMGFMT_YUNV 0x564E5559
#define IMGFMT_YVYU 0x55595659
#define IMGFMT_Y41P 0x50313459
#define IMGFMT_Y211 0x31313259
#define IMGFMT_Y41T 0x54313459
#define IMGFMT_Y42T 0x54323459
#define IMGFMT_V422 0x32323456
#define IMGFMT_V655 0x35353656
#define IMGFMT_CLJR 0x524A4C43
#define IMGFMT_YUVP 0x50565559
#define IMGFMT_UYVP 0x50565955
/*****************************************************************************
* filter.c: video scaling module using the swscale library
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id$
*
* Author: Gildas Bazin <gbazin@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <vlc/vlc.h>
#include <vlc/decoder.h>
#include "vlc_filter.h"
#include "common.h"
#include "swscale.h"
void *( *swscale_fast_memcpy )( void *, const void *, size_t );
/*****************************************************************************
* filter_sys_t : filter descriptor
*****************************************************************************/
struct filter_sys_t
{
struct SwsContext *ctx;
SwsFilter *p_src_filter;
SwsFilter *p_dst_filter;
int i_cpu_mask, i_sws_flags;
es_format_t fmt_in;
es_format_t fmt_out;
};
/****************************************************************************
* Local prototypes
****************************************************************************/
static int OpenFilter ( vlc_object_t * );
static void CloseFilter( vlc_object_t * );
static picture_t *Filter( filter_t *, picture_t * );
static int CheckInit( filter_t * );
static int GetSwscaleChroma( vlc_fourcc_t );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
#define MODE_TEXT N_("Scaling mode")
#define MODE_LONGTEXT N_("You can choose the default scaling mode")
static int pi_mode_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 };
static char *ppsz_mode_descriptions[] =
{ N_("Fast bilinear"), N_("Bilinear"), N_("Bicubic (good quality)"),
N_("Experimental"), N_("Nearest neighbour (bad quality)"),
N_("Area"), N_("Luma bicubic / chroma bilinear"), N_("Gauss"),
N_("SincR"), N_("Lanczos"), N_("Bicubic spline") };
vlc_module_begin();
set_description( _("Video scaling filter") );
set_capability( "video filter2", 1000 );
set_callbacks( OpenFilter, CloseFilter );
add_integer( "swscale-mode", 0, NULL, MODE_TEXT, MODE_LONGTEXT, VLC_TRUE );
change_integer_list( pi_mode_values, ppsz_mode_descriptions, 0 );
vlc_module_end();
/*****************************************************************************
* OpenFilter: probe the filter and return score
*****************************************************************************/
static int OpenFilter( vlc_object_t *p_this )
{
filter_t *p_filter = (filter_t*)p_this;
filter_sys_t *p_sys;
vlc_value_t val;
unsigned int i_fmt_in, i_fmt_out;
int i_sws_mode;
float sws_lum_gblur = 0.0, sws_chr_gblur = 0.0;
int sws_chr_vshift = 0, sws_chr_hshift = 0;
float sws_chr_sharpen = 0.0, sws_lum_sharpen = 0.0;
/* Supported Input formats: YV12, I420/IYUV, YUY2, UYVY, BGR32, BGR24,
* BGR16, BGR15, RGB32, RGB24, Y8/Y800, YVU9/IF09 */
if( !(i_fmt_in = GetSwscaleChroma(p_filter->fmt_in.video.i_chroma)) )
{
return VLC_EGENERIC;
}
/* Supported output formats: YV12, I420/IYUV, YUY2, UYVY,
* {BGR,RGB}{1,4,8,15,16,24,32}, Y8/Y800, YVU9/IF09 */
if( !(i_fmt_out = GetSwscaleChroma(p_filter->fmt_out.video.i_chroma)) )
{
return VLC_EGENERIC;
}
/* Allocate the memory needed to store the decoder's structure */
if( ( p_filter->p_sys = p_sys =
(filter_sys_t *)malloc(sizeof(filter_sys_t)) ) == NULL )
{
msg_Err( p_filter, "out of memory" );
return VLC_EGENERIC;
}
swscale_fast_memcpy = p_filter->p_vlc->pf_memcpy;
/* Set CPU capabilities */
p_sys->i_cpu_mask = 0;
if( p_filter->p_libvlc->i_cpu & CPU_CAPABILITY_MMX )
{
p_sys->i_cpu_mask |= SWS_CPU_CAPS_MMX;
}
if( p_filter->p_libvlc->i_cpu & CPU_CAPABILITY_MMXEXT )
{
p_sys->i_cpu_mask |= SWS_CPU_CAPS_MMX2;
}
if( p_filter->p_libvlc->i_cpu & CPU_CAPABILITY_3DNOW )
{
p_sys->i_cpu_mask |= SWS_CPU_CAPS_3DNOW;
}
if( p_filter->p_libvlc->i_cpu & CPU_CAPABILITY_ALTIVEC )
{
p_sys->i_cpu_mask |= SWS_CPU_CAPS_ALTIVEC;
}
var_Create( p_filter, "swscale-mode", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
var_Get( p_filter, "swscale-mode", &val );
i_sws_mode = val.i_int;
switch( i_sws_mode )
{
case 0: p_sys->i_sws_flags |= SWS_FAST_BILINEAR; break;
case 1: p_sys->i_sws_flags |= SWS_BILINEAR; break;
case 2: p_sys->i_sws_flags |= SWS_BICUBIC; break;
case 3: p_sys->i_sws_flags |= SWS_X; break;
case 4: p_sys->i_sws_flags |= SWS_POINT; break;
case 5: p_sys->i_sws_flags |= SWS_AREA; break;
case 6: p_sys->i_sws_flags |= SWS_BICUBLIN; break;
case 7: p_sys->i_sws_flags |= SWS_GAUSS; break;
case 8: p_sys->i_sws_flags |= SWS_SINC; break;
case 9: p_sys->i_sws_flags |= SWS_LANCZOS; break;
case 10: p_sys->i_sws_flags |= SWS_SPLINE; break;
default: p_sys->i_sws_flags |= SWS_FAST_BILINEAR; i_sws_mode = 0; break;
}
p_sys->p_src_filter = 0; p_sys->p_dst_filter = 0;
p_sys->p_src_filter =
sws_getDefaultFilter( sws_lum_gblur, sws_chr_gblur,
sws_lum_sharpen, sws_chr_sharpen,
sws_chr_hshift, sws_chr_vshift, 0 );
/* Misc init */
p_sys->ctx = NULL;
p_filter->pf_video_filter = Filter;
es_format_Init( &p_sys->fmt_in, 0, 0 );
es_format_Init( &p_sys->fmt_out, 0, 0 );
if( CheckInit( p_filter ) != VLC_SUCCESS )
{
if( p_sys->p_src_filter ) sws_freeFilter( p_sys->p_src_filter );
free( p_sys );
return VLC_EGENERIC;
}
msg_Dbg( p_filter, "%ix%i chroma: %4.4s -> %ix%i chroma: %4.4s",
p_filter->fmt_in.video.i_width, p_filter->fmt_in.video.i_height,
(char *)&p_filter->fmt_in.video.i_chroma,
p_filter->fmt_out.video.i_width, p_filter->fmt_out.video.i_height,
(char *)&p_filter->fmt_out.video.i_chroma );
if( p_filter->fmt_in.video.i_width != p_filter->fmt_out.video.i_width ||
p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height )
{
msg_Dbg( p_filter, "scaling mode: %s",
ppsz_mode_descriptions[i_sws_mode] );
}
return VLC_SUCCESS;
}
/*****************************************************************************
* CloseFilter: clean up the filter
*****************************************************************************/
static void CloseFilter( vlc_object_t *p_this )
{
filter_t *p_filter = (filter_t*)p_this;
filter_sys_t *p_sys = p_filter->p_sys;
if( p_sys->ctx ) sws_freeContext( p_sys->ctx );
if( p_sys->p_src_filter ) sws_freeFilter( p_sys->p_src_filter );
free( p_sys );
}
/*****************************************************************************
* CheckInit: Initialise filter when necessary
*****************************************************************************/
static int CheckInit( filter_t *p_filter )
{
filter_sys_t *p_sys = p_filter->p_sys;
if( p_filter->fmt_in.video.i_width != p_sys->fmt_in.video.i_width ||
p_filter->fmt_in.video.i_height != p_sys->fmt_in.video.i_height ||
p_filter->fmt_out.video.i_width != p_sys->fmt_out.video.i_width ||
p_filter->fmt_out.video.i_height != p_sys->fmt_out.video.i_height )
{
unsigned int i_fmt_in, i_fmt_out;
if( !(i_fmt_in = GetSwscaleChroma(p_filter->fmt_in.video.i_chroma)) ||
!(i_fmt_out = GetSwscaleChroma(p_filter->fmt_out.video.i_chroma)) )
{
msg_Err( p_filter, "format not supported" );
return VLC_EGENERIC;
}
if( p_sys->ctx ) sws_freeContext( p_sys->ctx );
p_sys->ctx =
sws_getContext( p_filter->fmt_in.video.i_width,
p_filter->fmt_in.video.i_height, i_fmt_in,
p_filter->fmt_out.video.i_width,
p_filter->fmt_out.video.i_height, i_fmt_out,
p_sys->i_sws_flags | p_sys->i_cpu_mask,
p_sys->p_src_filter, p_sys->p_dst_filter );
if( !p_sys->ctx )
{
msg_Err( p_filter, "could not init SwScaler" );
return VLC_EGENERIC;
}
p_sys->fmt_in = p_filter->fmt_in;
p_sys->fmt_out = p_filter->fmt_out;
}
return VLC_SUCCESS;
}
/****************************************************************************
* Filter: the whole thing
****************************************************************************
* This function is called just after the thread is launched.
****************************************************************************/
static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
{
filter_sys_t *p_sys = p_filter->p_sys;
uint8_t *src[3]; int src_stride[3];
uint8_t *dst[3]; int dst_stride[3];
picture_t *p_pic_dst;
int i_plane;
/* Check if format properties changed */
if( CheckInit( p_filter ) != VLC_SUCCESS ) return 0;
/* Request output picture */
p_pic_dst = p_filter->pf_vout_buffer_new( p_filter );
if( !p_pic_dst )
{
msg_Warn( p_filter, "can't get output picture" );
return NULL;
}
for( i_plane = 0; i_plane < p_pic->i_planes; i_plane++ )
{
src[i_plane] = p_pic->p[i_plane].p_pixels;
src_stride[i_plane] = p_pic->p[i_plane].i_pitch;
}
for( i_plane = 0; i_plane < p_pic_dst->i_planes; i_plane++ )
{
dst[i_plane] = p_pic_dst->p[i_plane].p_pixels;
dst_stride[i_plane] = p_pic_dst->p[i_plane].i_pitch;
}
sws_scale_ordered( p_sys->ctx, src, src_stride,
0, p_filter->fmt_in.video.i_height,
dst, dst_stride );
p_pic_dst->date = p_pic->date;
p_pic_dst->b_force = p_pic->b_force;
p_pic_dst->i_nb_fields = p_pic->i_nb_fields;
p_pic_dst->b_progressive = p_pic->b_progressive;
p_pic_dst->b_top_field_first = p_pic->b_top_field_first;
p_pic->pf_release( p_pic );
return p_pic_dst;
}
/*****************************************************************************
* Chroma fourcc -> ffmpeg_id mapping
*****************************************************************************/
static struct
{
vlc_fourcc_t i_chroma;
unsigned int i_swscale_chroma;
} chroma_table[] =
{
/* Planar YUV formats */
{ VLC_FOURCC('Y','V','1','2'), IMGFMT_YV12 },
{ VLC_FOURCC('I','4','2','0'), IMGFMT_I420 },
{ VLC_FOURCC('I','Y','U','V'), IMGFMT_IYUV },
{ VLC_FOURCC('I','4','4','4'), IMGFMT_444P },
{ VLC_FOURCC('I','4','2','2'), IMGFMT_422P },
{ VLC_FOURCC('I','4','1','1'), IMGFMT_411P },
/* Packed YUV formats */
{ VLC_FOURCC('U','Y','V','Y'), IMGFMT_UYVY },
{ VLC_FOURCC('Y','U','Y','2'), IMGFMT_YUY2 },
/* Packed RGB formats */
{ VLC_FOURCC('R','V','1','5'), IMGFMT_RGB15 },
{ VLC_FOURCC('R','V','1','6'), IMGFMT_RGB16 },
{ VLC_FOURCC('R','V','2','4'), IMGFMT_RGB24 },
{ VLC_FOURCC('R','V','3','2'), IMGFMT_RGB32 },
{ VLC_FOURCC('G','R','E','Y'), IMGFMT_RGB8 },
{0}
};
static int GetSwscaleChroma( vlc_fourcc_t i_chroma )
{
int i;
for( i = 0; chroma_table[i].i_chroma != 0; i++ )
{
if( chroma_table[i].i_chroma == i_chroma )
return chroma_table[i].i_swscale_chroma;
}
return 0;
}
/*
*
* rgb2rgb.c, Software RGB to RGB convertor
* pluralize by Software PAL8 to RGB convertor
* Software YUV to YUV convertor
* Software YUV to RGB convertor
* Written by Nick Kurshev.
* palette & yuv & runtime cpu stuff by Michael (michaelni@gmx.at) (under GPL)
*/
#include <inttypes.h>
#include "config.h"
#include "rgb2rgb.h"
#include "swscale.h"
#include "common.h"
#define FAST_BGR2YV12 // use 7 bit coeffs instead of 15bit
void (*rgb24to32)(const uint8_t *src,uint8_t *dst,unsigned src_size);
void (*rgb24to16)(const uint8_t *src,uint8_t *dst,unsigned src_size);
void (*rgb24to15)(const uint8_t *src,uint8_t *dst,unsigned src_size);
void (*rgb32to24)(const uint8_t *src,uint8_t *dst,unsigned src_size);
void (*rgb32to16)(const uint8_t *src,uint8_t *dst,unsigned src_size);
void (*rgb32to15)(const uint8_t *src,uint8_t *dst,unsigned src_size);
void (*rgb15to16)(const uint8_t *src,uint8_t *dst,unsigned src_size);
void (*rgb15to24)(const uint8_t *src,uint8_t *dst,unsigned src_size);
void (*rgb15to32)(const uint8_t *src,uint8_t *dst,unsigned src_size);
void (*rgb16to15)(const uint8_t *src,uint8_t *dst,unsigned src_size);
void (*rgb16to24)(const uint8_t *src,uint8_t *dst,unsigned src_size);
void (*rgb16to32)(const uint8_t *src,uint8_t *dst,unsigned src_size);
//void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, unsigned src_size);
void (*rgb24tobgr24)(const uint8_t *src, uint8_t *dst, unsigned src_size);
void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, unsigned src_size);
void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, unsigned src_size);
void (*rgb32tobgr32)(const uint8_t *src, uint8_t *dst, unsigned src_size);
//void (*rgb32tobgr24)(const uint8_t *src, uint8_t *dst, unsigned src_size);
void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, unsigned src_size);
void (*rgb32tobgr15)(const uint8_t *src, uint8_t *dst, unsigned src_size);
void (*yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
unsigned int width, unsigned int height,
int lumStride, int chromStride, int dstStride);
void (*yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
unsigned int width, unsigned int height,
int lumStride, int chromStride, int dstStride);
void (*yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
unsigned int width, unsigned int height,
int lumStride, int chromStride, int dstStride);
void (*yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
unsigned int width, unsigned int height,
int lumStride, int chromStride, int srcStride);
void (*rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
unsigned int width, unsigned int height,
int lumStride, int chromStride, int srcStride);
void (*planar2x)(const uint8_t *src, uint8_t *dst, int width, int height, int srcStride, int dstStride);
void (*interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dst,
unsigned width, unsigned height, int src1Stride,
int src2Stride, int dstStride);
void (*vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
uint8_t *dst1, uint8_t *dst2,
unsigned width, unsigned height,
int srcStride1, int srcStride2,
int dstStride1, int dstStride2);
void (*yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint8_t *src3,
uint8_t *dst,
unsigned width, unsigned height,
int srcStride1, int srcStride2,
int srcStride3, int dstStride);
#ifdef ARCH_X86
static const uint64_t mmx_null __attribute__((aligned(8))) = 0x0000000000000000ULL;
static const uint64_t mmx_one __attribute__((aligned(8))) = 0xFFFFFFFFFFFFFFFFULL;
static const uint64_t mask32b attribute_used __attribute__((aligned(8))) = 0x000000FF000000FFULL;
static const uint64_t mask32g attribute_used __attribute__((aligned(8))) = 0x0000FF000000FF00ULL;
static const uint64_t mask32r attribute_used __attribute__((aligned(8))) = 0x00FF000000FF0000ULL;
static const uint64_t mask32 __attribute__((aligned(8))) = 0x00FFFFFF00FFFFFFULL;
static const uint64_t mask3216br __attribute__((aligned(8)))=0x00F800F800F800F8ULL;
static const uint64_t mask3216g __attribute__((aligned(8)))=0x0000FC000000FC00ULL;
static const uint64_t mask3215g __attribute__((aligned(8)))=0x0000F8000000F800ULL;
static const uint64_t mul3216 __attribute__((aligned(8))) = 0x2000000420000004ULL;
static const uint64_t mul3215 __attribute__((aligned(8))) = 0x2000000820000008ULL;
static const uint64_t mask24b attribute_used __attribute__((aligned(8))) = 0x00FF0000FF0000FFULL;
static const uint64_t mask24g attribute_used __attribute__((aligned(8))) = 0xFF0000FF0000FF00ULL;
static const uint64_t mask24r attribute_used __attribute__((aligned(8))) = 0x0000FF0000FF0000ULL;
static const uint64_t mask24l __attribute__((aligned(8))) = 0x0000000000FFFFFFULL;
static const uint64_t mask24h __attribute__((aligned(8))) = 0x0000FFFFFF000000ULL;