Commit 2f4af9df authored by Sam Hocevar's avatar Sam Hocevar

  * ./configure.in: more modules are plugins.
  * ./src/misc/configuration.c: changed ~/.VideoLan/vlc to ~/.videolan/vlcrc,
    and a few cosmetic changes (sorry Gildas for the butchery).
  * ./plugins/chroma/i420_rgb16.c: C version of the I420 to RV15/16 chroma.
parent 278bc72e
......@@ -5454,8 +5454,8 @@ case x"${target_cpu}" in
;;
esac
BUILTINS="${BUILTINS} mpeg_es mpeg_ps mpeg_ts file udp http ipv4 memcpy idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga mpeg_adec ac3_adec mpeg_vdec"
PLUGINS="${PLUGINS} lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort fx_scope"
BUILTINS="${BUILTINS} idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga mpeg_adec ac3_adec mpeg_vdec"
PLUGINS="${PLUGINS} mpeg_es mpeg_ps mpeg_ts file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort fx_scope"
MMX_MODULES="memcpymmx idctmmx motionmmx chroma_i420_rgb_mmx chroma_i420_yuy2_mmx chroma_i422_yuy2_mmx chroma_i420_ymga_mmx"
MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
......
......@@ -444,8 +444,8 @@ esac
dnl
dnl default modules
dnl
BUILTINS="${BUILTINS} mpeg_es mpeg_ps mpeg_ts file udp http ipv4 memcpy idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga mpeg_adec ac3_adec mpeg_vdec"
PLUGINS="${PLUGINS} lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort fx_scope"
BUILTINS="${BUILTINS} idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga mpeg_adec ac3_adec mpeg_vdec"
PLUGINS="${PLUGINS} mpeg_es mpeg_ps mpeg_ts file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort fx_scope"
dnl
dnl Accelerated modules
......@@ -810,7 +810,7 @@ AC_ARG_WITH(dvdcss,
;;
xno)
# don't use libdvdcss at all, build a DVD module that can dlopen() it
BUILTINS="${BUILTINS} dvd"
PLUGINS="${PLUGINS} dvd"
DUMMY_LIBDVDCSS=1
SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c"
CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
......@@ -838,7 +838,7 @@ AC_ARG_WITH(dvdcss,
LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
else
# XXX: no check for libdl is done, don't try this at home !
BUILTINS="${BUILTINS} dvd"
PLUGINS="${PLUGINS} dvd"
DUMMY_LIBDVDCSS=1
SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c"
CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
......@@ -912,19 +912,19 @@ AC_ARG_ENABLE(vcd,
if test x$enable_vcd != xno
then
AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
BUILTINS="${BUILTINS} vcd"
PLUGINS="${PLUGINS} vcd"
])
fi
if test x$enable_vcd != xno -a "${SYS}" = "bsdi"
then
BUILTINS="${BUILTINS} vcd"
fi
if test "x${SYS}" = "xbsdi"
then
PLUGINS="${PLUGINS} vcd"
fi
if test x$enable_vcd != xno -a "${SYS}" = "darwin"
then
BUILTINS="${BUILTINS} vcd"
LIB_VCD="${LIB_VCD} -framework IOKit"
if test "x${SYS}" = "xdarwin"
then
PLUGINS="${PLUGINS} vcd"
LIB_VCD="${LIB_VCD} -framework IOKit"
fi
fi
dnl
......
......@@ -47,6 +47,10 @@
* outputting an error message (in second) */
#define THREAD_COND_TIMEOUT 5
/* The configuration file and directory */
#define CONFIG_DIR ".videolan"
#define CONFIG_FILE "vlcrc"
/*****************************************************************************
* Interface configuration
*****************************************************************************/
......
......@@ -88,6 +88,12 @@
/* Define if you have the getpagesize function. */
#undef HAVE_GETPAGESIZE
/* Define if you have the getpwuid function. */
#undef HAVE_GETPWUID
/* Define if you have the getpwuid_r function. */
#undef HAVE_GETPWUID_R
/* Define if you have the gettimeofday function. */
#undef HAVE_GETTIMEOFDAY
......@@ -121,12 +127,6 @@
/* Define if you have the sigrelse function. */
#undef HAVE_SIGRELSE
/* Define if you have the getpwuid_r function. */
#undef HAVE_GETPWUID_R
/* Define if you have the getpwuid function. */
#undef HAVE_GETPWUID
/* Define if you have the stpcpy function. */
#undef HAVE_STPCPY
......
......@@ -4,7 +4,7 @@
* includes all common video types and constants.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video.h,v 1.45 2002/03/15 04:41:54 sam Exp $
* $Id: video.h,v 1.46 2002/03/16 23:03:19 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -44,11 +44,6 @@ typedef struct plane_s
int i_visible_bytes; /* How many real pixels are there ? */
boolean_t b_hidden; /* Are we allowed to write to the margin ? */
/* Variables used for RGB planes */
int i_red_mask;
int i_green_mask;
int i_blue_mask;
} plane_t;
/*****************************************************************************
......@@ -84,6 +79,9 @@ typedef struct picture_s
boolean_t b_repeat_first_field; /* RFF bit */
boolean_t b_top_field_first; /* which field is first */
/* The picture heap we are attached to */
struct picture_heap_s* p_heap;
/* Private data - the video output plugin might want to put stuff here to
* keep track of the picture */
struct picture_sys_s *p_sys;
......@@ -96,20 +94,31 @@ typedef struct picture_s
*****************************************************************************/
typedef struct picture_heap_s
{
int i_pictures; /* current heap size */
int i_pictures; /* current heap size */
/* Picture static properties - those properties are fixed at initialization
* and should NOT be modified */
int i_width; /* picture width */
int i_height; /* picture height */
u32 i_chroma; /* picture chroma */
int i_aspect; /* aspect ratio */
int i_width; /* picture width */
int i_height; /* picture height */
u32 i_chroma; /* picture chroma */
int i_aspect; /* aspect ratio */
/* Variables used for RGB planes */
int i_rmask, i_rrshift, i_lrshift;
int i_gmask, i_rgshift, i_lgshift;
int i_bmask, i_rbshift, i_lbshift;
/* Real pictures */
picture_t* pp_picture[VOUT_MAX_PICTURES]; /* pictures */
} picture_heap_t;
/* RGB2PIXEL: assemble RGB components to a pixel value, returns a u32 */
#define RGB2PIXEL( p_vout, i_r, i_g, i_b ) \
(((((u32)i_r) >> p_vout->output.i_rrshift) << p_vout->output.i_lrshift) | \
((((u32)i_g) >> p_vout->output.i_rgshift) << p_vout->output.i_lgshift) | \
((((u32)i_b) >> p_vout->output.i_rbshift) << p_vout->output.i_lbshift))
/*****************************************************************************
* Flags used to describe the status of a picture
*****************************************************************************/
......@@ -138,6 +147,7 @@ typedef struct picture_heap_s
#define FOURCC_BI_BITFIELDS 0x00000003 /* RGB, for 16, 24, 32bpp */
#define FOURCC_RV15 0x35315652 /* RGB 15bpp, 0x1f, 0x7e0, 0xf800 */
#define FOURCC_RV16 0x36315652 /* RGB 16bpp, 0x1f, 0x3e0, 0x7c00 */
#define FOURCC_RV24 0x34325652 /* RGB 24bpp, 0xff, 0xff00, 0xff0000 */
#define FOURCC_RV32 0x32335652 /* RGB 32bpp, 0xff, 0xff00, 0xff0000 */
/* Planar YUV formats */
......
......@@ -2,7 +2,7 @@
* vout_beos.cpp: beos video output display method
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: vout_beos.cpp,v 1.44 2002/03/13 08:39:39 tcastley Exp $
* $Id: vout_beos.cpp,v 1.45 2002/03/16 23:03:19 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -485,6 +485,10 @@ int vout_Init( vout_thread_t *p_vout )
* VOUT_ASPECT_FACTOR / p_vout->p_sys->i_height;
p_vout->output.i_chroma = FOURCC_RV32;
p_vout->output.i_rmask = 0x00ff0000;
p_vout->output.i_gmask = 0x0000ff00;
p_vout->output.i_bmask = 0x000000ff;
p_pic = NULL;
/* Find an empty picture slot */
......@@ -509,10 +513,6 @@ int vout_Init( vout_thread_t *p_vout )
p_pic->p->b_margin = 0;
p_pic->p->i_pitch = 4 * p_vout->p_sys->i_width;
p_pic->p->i_red_mask = 0x00ff0000;
p_pic->p->i_green_mask = 0x0000ff00;
p_pic->p->i_blue_mask = 0x000000ff;
p_pic->i_planes = 1;
p_pic->i_status = DESTROYED_PICTURE;
......
......@@ -2,7 +2,7 @@
* i420_rgb.c : YUV to bitmap RGB conversion module for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: i420_rgb.c,v 1.5 2002/02/15 13:32:53 sam Exp $
* $Id: i420_rgb.c,v 1.6 2002/03/16 23:03:19 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -35,6 +35,9 @@
#include "video_output.h"
#include "i420_rgb.h"
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
# include "i420_rgb_c.h"
#endif
/*****************************************************************************
* Local and extern prototypes.
......@@ -44,6 +47,11 @@ static void chroma_getfunctions ( function_list_t * p_function_list );
static int chroma_Init ( vout_thread_t *p_vout );
static void chroma_End ( vout_thread_t *p_vout );
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
static void SetGammaTable ( int *pi_table, double f_gamma );
static void SetYUV ( vout_thread_t *p_vout );
#endif
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
......@@ -52,10 +60,10 @@ MODULE_CONFIG_STOP
MODULE_INIT_START
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
SET_DESCRIPTION( "I420/IYUV/YV12 to RGB 8/15/16/24/32 conversions" )
SET_DESCRIPTION( "I420,IYUV,YV12 to RGB,RV15,RV16,RV24,RV32 conversions" )
ADD_CAPABILITY( CHROMA, 80 )
#elif defined (MODULE_NAME_IS_chroma_i420_rgb_mmx)
SET_DESCRIPTION( "MMX I420/IYUV/YV12 to RGB 15/16/24/32 conversions" )
SET_DESCRIPTION( "MMX I420,IYUV,YV12 to RV15,RV16,RV24,RV32 conversions" )
ADD_CAPABILITY( CHROMA, 100 )
ADD_REQUIREMENT( MMX )
#endif
......@@ -85,6 +93,10 @@ static void chroma_getfunctions( function_list_t * p_function_list )
*****************************************************************************/
static int chroma_Init( vout_thread_t *p_vout )
{
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
size_t i_tables_size;
#endif
if( p_vout->render.i_width & 1 || p_vout->render.i_height & 1 )
{
return -1;
......@@ -98,7 +110,7 @@ static int chroma_Init( vout_thread_t *p_vout )
switch( p_vout->output.i_chroma )
{
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
case FOURCC_BI_RGB:
case FOURCC_RGB:
p_vout->chroma.pf_convert = _M( I420_RGB8 );
break;
#endif
......@@ -132,7 +144,7 @@ static int chroma_Init( vout_thread_t *p_vout )
switch( p_vout->output.i_chroma )
{
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
case FOURCC_BI_RGB:
case FOURCC_RGB:
p_vout->chroma.p_sys->p_buffer = malloc( VOUT_MAX_WIDTH );
break;
#endif
......@@ -166,6 +178,33 @@ static int chroma_Init( vout_thread_t *p_vout )
return -1;
}
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
switch( p_vout->output.i_chroma )
{
case FOURCC_RGB:
i_tables_size = sizeof( u8 ) * PALETTE_TABLE_SIZE;
break;
case FOURCC_RV15:
case FOURCC_RV16:
i_tables_size = sizeof( u16 ) * RGB_TABLE_SIZE;
break;
default: /* RV24, RV32 */
i_tables_size = sizeof( u32 ) * RGB_TABLE_SIZE;
break;
}
p_vout->chroma.p_sys->p_base = malloc( i_tables_size );
if( p_vout->chroma.p_sys->p_base == NULL )
{
free( p_vout->chroma.p_sys->p_offset );
free( p_vout->chroma.p_sys->p_buffer );
free( p_vout->chroma.p_sys );
return -1;
}
SetYUV( p_vout );
#endif
return 0;
}
......@@ -176,8 +215,217 @@ static int chroma_Init( vout_thread_t *p_vout )
*****************************************************************************/
static void chroma_End( vout_thread_t *p_vout )
{
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
free( p_vout->chroma.p_sys->p_base );
#endif
free( p_vout->chroma.p_sys->p_offset );
free( p_vout->chroma.p_sys->p_buffer );
free( p_vout->chroma.p_sys );
}
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
/*****************************************************************************
* SetGammaTable: return intensity table transformed by gamma curve.
*****************************************************************************
* pi_table is a table of 256 entries from 0 to 255.
*****************************************************************************/
static void SetGammaTable( int *pi_table, double f_gamma )
{
int i_y; /* base intensity */
/* Use exp(gamma) instead of gamma */
f_gamma = exp( f_gamma );
/* Build gamma table */
for( i_y = 0; i_y < 256; i_y++ )
{
pi_table[ i_y ] = pow( (double)i_y / 256, f_gamma ) * 256;
}
}
/*****************************************************************************
* SetYUV: compute tables and set function pointers
*****************************************************************************/
static void SetYUV( vout_thread_t *p_vout )
{
int pi_gamma[256]; /* gamma table */
int i_index; /* index in tables */
/* Build gamma table */
SetGammaTable( pi_gamma, p_vout->f_gamma );
/*
* Set pointers and build YUV tables
*/
/* Color: build red, green and blue tables */
switch( p_vout->output.i_chroma )
{
case FOURCC_RGB:
{
#define RGB_MIN 0
#define RGB_MAX 255
#define CLIP( x ) ( ((x < 0) ? 0 : (x > 255) ? 255 : x) << 8 )
int y,u,v;
int r,g,b;
int uvr, uvg, uvb;
int i = 0, j = 0;
u16 red[256], green[256], blue[256], transp[256];
unsigned char lookup[PALETTE_TABLE_SIZE];
p_vout->chroma.p_sys->yuv.p_rgb8 = (u8 *)p_vout->chroma.p_sys->p_base;
/* this loop calculates the intersection of an YUV box
* and the RGB cube. */
for ( y = 0; y <= 256; y += 16 )
{
for ( u = 0; u <= 256; u += 32 )
for ( v = 0; v <= 256; v += 32 )
{
uvr = (V_RED_COEF*(v-128)) >> SHIFT;
uvg = (U_GREEN_COEF*(u-128) + V_GREEN_COEF*(v-128)) >> SHIFT;
uvb = (U_BLUE_COEF*(u-128)) >> SHIFT;
r = y + uvr;
g = y + uvg;
b = y + uvb;
if( r >= RGB_MIN && g >= RGB_MIN && b >= RGB_MIN
&& r <= RGB_MAX && g <= RGB_MAX && b <= RGB_MAX )
{
/* this one should never happen unless someone fscked up my code */
if(j == 256) { intf_ErrMsg( "vout error: no colors left to build palette" ); break; }
/* clip the colors */
red[j] = CLIP( r );
green[j] = CLIP( g );
blue[j] = CLIP( b );
transp[j] = 0;
/* allocate color */
lookup[i] = 1;
p_vout->chroma.p_sys->yuv.p_rgb8[i++] = j;
j++;
}
else
{
lookup[i] = 0;
p_vout->chroma.p_sys->yuv.p_rgb8[i++] = 0;
}
}
i += 128-81;
}
/* the colors have been allocated, we can set the palette */
/* there will eventually be a way to know which colors
* couldn't be allocated and try to find a replacement */
#if 0
p_vout->pf_setpalette( p_vout, red, green, blue, transp );
p_vout->i_white_pixel = 0xff;
p_vout->i_black_pixel = 0x00;
p_vout->i_gray_pixel = 0x44;
p_vout->i_blue_pixel = 0x3b;
#endif
i = 0;
/* this loop allocates colors that got outside
* the RGB cube */
for ( y = 0; y <= 256; y += 16 )
{
for ( u = 0; u <= 256; u += 32 )
for ( v = 0; v <= 256; v += 32 )
{
int u2, v2;
int dist, mindist = 100000000;
if( lookup[i] || y==0)
{
i++;
continue;
}
/* heavy. yeah. */
for( u2 = 0; u2 <= 256; u2 += 32 )
for( v2 = 0; v2 <= 256; v2 += 32 )
{
j = ((y>>4)<<7) + (u2>>5)*9 + (v2>>5);
dist = (u-u2)*(u-u2) + (v-v2)*(v-v2);
if( lookup[j] )
/* find the nearest color */
if( dist < mindist )
{
p_vout->chroma.p_sys->yuv.p_rgb8[i] = p_vout->chroma.p_sys->yuv.p_rgb8[j];
mindist = dist;
}
j -= 128;
if( lookup[j] )
/* find the nearest color */
if( dist + 128 < mindist )
{
p_vout->chroma.p_sys->yuv.p_rgb8[i] = p_vout->chroma.p_sys->yuv.p_rgb8[j];
mindist = dist + 128;
}
}
i++;
}
i += 128-81;
}
}
break;
case FOURCC_RV15:
case FOURCC_RV16:
p_vout->chroma.p_sys->yuv.p_rgb16 = (u16 *)p_vout->chroma.p_sys->p_base;
for( i_index = 0; i_index < RED_MARGIN; i_index++ )
{
p_vout->chroma.p_sys->yuv.p_rgb16[RED_OFFSET - RED_MARGIN + i_index] = RGB2PIXEL( p_vout, pi_gamma[0], 0, 0 );
p_vout->chroma.p_sys->yuv.p_rgb16[RED_OFFSET + 256 + i_index] = RGB2PIXEL( p_vout, pi_gamma[255], 0, 0 );
}
for( i_index = 0; i_index < GREEN_MARGIN; i_index++ )
{
p_vout->chroma.p_sys->yuv.p_rgb16[GREEN_OFFSET - GREEN_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, pi_gamma[0], 0 );
p_vout->chroma.p_sys->yuv.p_rgb16[GREEN_OFFSET + 256 + i_index] = RGB2PIXEL( p_vout, 0, pi_gamma[255], 0 );
}
for( i_index = 0; i_index < BLUE_MARGIN; i_index++ )
{
p_vout->chroma.p_sys->yuv.p_rgb16[BLUE_OFFSET - BLUE_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, 0, pi_gamma[0] );
p_vout->chroma.p_sys->yuv.p_rgb16[BLUE_OFFSET + BLUE_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, 0, pi_gamma[255] );
}
for( i_index = 0; i_index < 256; i_index++ )
{
p_vout->chroma.p_sys->yuv.p_rgb16[RED_OFFSET + i_index] = RGB2PIXEL( p_vout, pi_gamma[ i_index ], 0, 0 );
p_vout->chroma.p_sys->yuv.p_rgb16[GREEN_OFFSET + i_index] = RGB2PIXEL( p_vout, 0, pi_gamma[ i_index ], 0 );
p_vout->chroma.p_sys->yuv.p_rgb16[BLUE_OFFSET + i_index] = RGB2PIXEL( p_vout, 0, 0, pi_gamma[ i_index ] );
}
break;
case FOURCC_RV24:
case FOURCC_RV32:
p_vout->chroma.p_sys->yuv.p_rgb32 = (u32 *)p_vout->chroma.p_sys->p_base;
for( i_index = 0; i_index < RED_MARGIN; i_index++ )
{
p_vout->chroma.p_sys->yuv.p_rgb32[RED_OFFSET - RED_MARGIN + i_index] = RGB2PIXEL( p_vout, pi_gamma[0], 0, 0 );
p_vout->chroma.p_sys->yuv.p_rgb32[RED_OFFSET + 256 + i_index] = RGB2PIXEL( p_vout, pi_gamma[255], 0, 0 );
}
for( i_index = 0; i_index < GREEN_MARGIN; i_index++ )
{
p_vout->chroma.p_sys->yuv.p_rgb32[GREEN_OFFSET - GREEN_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, pi_gamma[0], 0 );
p_vout->chroma.p_sys->yuv.p_rgb32[GREEN_OFFSET + 256 + i_index] = RGB2PIXEL( p_vout, 0, pi_gamma[255], 0 );
}
for( i_index = 0; i_index < BLUE_MARGIN; i_index++ )
{
p_vout->chroma.p_sys->yuv.p_rgb32[BLUE_OFFSET - BLUE_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, 0, pi_gamma[0] );
p_vout->chroma.p_sys->yuv.p_rgb32[BLUE_OFFSET + BLUE_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, 0, pi_gamma[255] );
}
for( i_index = 0; i_index < 256; i_index++ )
{
p_vout->chroma.p_sys->yuv.p_rgb32[RED_OFFSET + i_index] = RGB2PIXEL( p_vout, pi_gamma[ i_index ], 0, 0 );
p_vout->chroma.p_sys->yuv.p_rgb32[GREEN_OFFSET + i_index] = RGB2PIXEL( p_vout, 0, pi_gamma[ i_index ], 0 );
p_vout->chroma.p_sys->yuv.p_rgb32[BLUE_OFFSET + i_index] = RGB2PIXEL( p_vout, 0, 0, pi_gamma[ i_index ] );
}
break;
}
}
#endif
......@@ -2,7 +2,7 @@
* i420_rgb.h : YUV to bitmap RGB conversion module for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: i420_rgb.h,v 1.3 2002/01/28 16:51:22 sam Exp $
* $Id: i420_rgb.h,v 1.4 2002/03/16 23:03:19 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -32,6 +32,17 @@ typedef struct chroma_sys_s
u8 *p_buffer;
int *p_offset;
#ifdef MODULE_NAME_IS_chroma_i420_rgb
/* Pre-calculated conversion tables */
void * p_base; /* base for all conversion tables */
union
{
u8 * p_rgb8; /* RGB 8 bits table */
u16 * p_rgb16; /* RGB 16 bits table */
u32 * p_rgb32; /* RGB 32 bits table */
} yuv;
#endif
} chroma_sys_t;
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* i420_rgb16.c : YUV to bitmap RGB conversion module for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: i420_rgb16.c,v 1.3 2002/01/28 16:51:22 sam Exp $
* $Id: i420_rgb16.c,v 1.4 2002/03/16 23:03:19 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -70,6 +70,12 @@ void _M( I420_RGB15 )( vout_thread_t *p_vout, picture_t *p_src,
int i_scale_count; /* scale modulo counter */
int i_chroma_width = p_vout->render.i_width / 2; /* chroma width */
u16 * p_pic_start; /* beginning of the current line for copy */
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
int i_uval, i_vval; /* U and V samples */
int i_red, i_green, i_blue; /* U and V modified samples */
u16 * p_yuv = p_vout->chroma.p_sys->yuv.p_rgb16;
u16 * p_ybase; /* Y dependant conversion table */
#endif
/* Conversion buffer pointer */
u16 * p_buffer_start = (u16*)p_vout->chroma.p_sys->p_buffer;
......@@ -104,11 +110,6 @@ void _M( I420_RGB15 )( vout_thread_t *p_vout, picture_t *p_src,
p_vout->output.i_width, p_vout->output.i_height,
&b_hscale, &i_vscale, p_offset_start );
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
intf_ErrMsg( "vout error: I420_RGB16 unimplemented, "
"please harass sam@zoy.org" );
#endif
/*
* Perform conversion
*/
......@@ -122,7 +123,10 @@ void _M( I420_RGB15 )( vout_thread_t *p_vout, picture_t *p_src,
for ( i_x = p_vout->render.i_width / 8; i_x--; )
{
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
/* FIXME: TODO */
CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
#elif defined (MODULE_NAME_IS_chroma_i420_rgb_mmx)
__asm__( MMX_INIT_16
: : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) );
......@@ -149,7 +153,10 @@ void _M( I420_RGB15 )( vout_thread_t *p_vout, picture_t *p_src,
p_v -= i_rewind >> 1;
p_buffer -= i_rewind;
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
/* FIXME: TODO */
CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
#elif defined (MODULE_NAME_IS_chroma_i420_rgb_mmx)
__asm__( MMX_INIT_16
: : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) );
......@@ -198,6 +205,12 @@ void _M( I420_RGB16 )( vout_thread_t *p_vout, picture_t *p_src,
int i_scale_count; /* scale modulo counter */
int i_chroma_width = p_vout->render.i_width / 2; /* chroma width */
u16 * p_pic_start; /* beginning of the current line for copy */
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
int i_uval, i_vval; /* U and V samples */
int i_red, i_green, i_blue; /* U and V modified samples */
u16 * p_yuv = p_vout->chroma.p_sys->yuv.p_rgb16;
u16 * p_ybase; /* Y dependant conversion table */
#endif
/* Conversion buffer pointer */
u16 * p_buffer_start = (u16*)p_vout->chroma.p_sys->p_buffer;
......@@ -232,11 +245,6 @@ void _M( I420_RGB16 )( vout_thread_t *p_vout, picture_t *p_src,
p_vout->output.i_width, p_vout->output.i_height,
&b_hscale, &i_vscale, p_offset_start );
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
intf_ErrMsg( "vout error: I420_RGB16 unimplemented, "
"please harass sam@zoy.org" );
#endif
/*
* Perform conversion
*/
......@@ -250,7 +258,10 @@ void _M( I420_RGB16 )( vout_thread_t *p_vout, picture_t *p_src,
for ( i_x = p_vout->render.i_width / 8; i_x--; )
{
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
/* FIXME: TODO */
CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
#elif defined (MODULE_NAME_IS_chroma_i420_rgb_mmx)
__asm__( MMX_INIT_16
: : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) );
......@@ -277,7 +288,10 @@ void _M( I420_RGB16 )( vout_thread_t *p_vout, picture_t *p_src,
p_v -= i_rewind >> 1;
p_buffer -= i_rewind;
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
/* FIXME: TODO */
CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
CONVERT_YUV_PIXEL(2); CONVERT_Y_PIXEL(2);
#elif defined (MODULE_NAME_IS_chroma_i420_rgb_mmx)
__asm__( MMX_INIT_16
: : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) );
......
......@@ -2,7 +2,7 @@
* i420_ymga.c : YUV to YUV conversion module for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: i420_ymga.c,v 1.2 2002/02/15 13:32:53 sam Exp $
* $Id: i420_ymga.c,v 1.3 2002/03/16 23:03:19 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -34,7 +34,7 @@
#include "video.h"
#include "video_output.h"
#define SRC_FOURCC "I420/IYUV/YV12"
#define SRC_FOURCC "I420,IYUV,YV12"
#define DEST_FOURCC "YMGA"
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* i420_yuy2.c : YUV to YUV conversion module for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: i420_yuy2.c,v 1.2 2002/02/15 13:32:53 sam Exp $
* $Id: i420_yuy2.c,v 1.3 2002/03/16 23:03:19 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -36,12 +36,12 @@
#include "i420_yuy2.h"
#define SRC_FOURCC "I420/IYUV/YV12"
#define SRC_FOURCC "I420,IYUV,YV12"
#if defined (MODULE_NAME_IS_chroma_i420_yuy2)
# define DEST_FOURCC "YUY2/YUNV/YVYU/UYVY/UYNV/Y422/IUYV/cyuv/Y211"
# define DEST_FOURCC "YUY2,YUNV,YVYU,UYVY,UYNV,Y422,IUYV,cyuv,Y211"
#else
# define DEST_FOURCC "YUY2/YUNV/YVYU/UYVY/UYNV/Y422/IUYV/cyuv"
# define DEST_FOURCC "YUY2,YUNV,YVYU,UYVY,UYNV,Y422,IUYV,cyuv"
#endif
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* i422_yuy2.c : YUV to YUV conversion module for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: i422_yuy2.c,v 1.2 2002/02/15 13:32:53 sam Exp $
* $Id: i422_yuy2.c,v 1.3 2002/03/16 23:03:19 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -38,9 +38,9 @@
#define SRC_FOURCC "I422"
#if defined (MODULE_NAME_IS_chroma_i422_yuy2)
# define DEST_FOURCC "YUY2/YUNV/YVYU/UYVY/UYNV/Y422/IUYV/cyuv/Y211"
# define DEST_FOURCC "YUY2,YUNV,YVYU,UYVY,UYNV,Y422,IUYV,cyuv,Y211"
#else