Commit 249fb100 authored by Laurent Aimar's avatar Laurent Aimar

Removed video_format_FixRgb from blend.c

parent 1239429e
......@@ -117,8 +117,6 @@ static void BlendRGBAR16( filter_t *, picture_t *, picture_t *, picture_t *,
static void BlendRGBAR24( filter_t *, picture_t *, picture_t *, picture_t *,
int, int, int, int, int );
static void video_format_FixRgb( video_format_t *p_fmt );
/*****************************************************************************
* OpenFilter: probe the filter and return score
*****************************************************************************/
......@@ -390,27 +388,6 @@ static void vlc_blend_rgb16( uint16_t *p_dst, const uint16_t *p_src,
( vlc_blend( B >> p_fmt->i_rbshift, b, i_alpha ) << p_fmt->i_lbshift );
}
/*****************************************************************************
* BinaryLog: computes the base 2 log of a binary value
*****************************************************************************
* This functions is used by MaskToShift, to get a bit index from a binary
* value.
*****************************************************************************/
static int BinaryLog( uint32_t i )
{
int i_log = 0;
if( i == 0 ) return -31337;
if( i & 0xffff0000 ) i_log += 16;
if( i & 0xff00ff00 ) i_log += 8;
if( i & 0xf0f0f0f0 ) i_log += 4;
if( i & 0xcccccccc ) i_log += 2;
if( i & 0xaaaaaaaa ) i_log += 1;
return i_log;
}
static void vlc_rgb_index( int *pi_rindex, int *pi_gindex, int *pi_bindex,
const video_format_t *p_fmt )
{
......@@ -430,87 +407,6 @@ static void vlc_rgb_index( int *pi_rindex, int *pi_gindex, int *pi_bindex,
#endif
}
/**
* It transforms a color mask into right and left shifts
* FIXME copied from video_output.c
*/
static void MaskToShift( int *pi_left, int *pi_right, uint32_t i_mask )
{
uint32_t i_low, i_high; /* lower hand higher bits of the mask */
if( !i_mask )
{
*pi_left = *pi_right = 0;
return;
}
/* Get bits */
i_low = i_high = i_mask;
i_low &= - (int32_t)i_low; /* lower bit of the mask */
i_high += i_low; /* higher bit of the mask */
/* Transform bits into an index. Also deal with i_high overflow, which
* is faster than changing the BinaryLog code to handle 64 bit integers. */
i_low = BinaryLog (i_low);
i_high = i_high ? BinaryLog (i_high) : 32;
/* Update pointers and return */
*pi_left = i_low;
*pi_right = (8 - i_high + i_low);
}
/* FIXME should be moved to src/ */
static void video_format_FixRgb( video_format_t *p_fmt )
{
if( p_fmt->i_chroma != FCC_RV15 &&
p_fmt->i_chroma != FCC_RV16 &&
p_fmt->i_chroma != FCC_RV24 &&
p_fmt->i_chroma != FCC_RV32 )
return;
/* FIXME find right default mask */
if( !p_fmt->i_rmask || !p_fmt->i_gmask || !p_fmt->i_bmask )
{
switch( p_fmt->i_chroma )
{
case FCC_RV15:
p_fmt->i_rmask = 0x7c00;
p_fmt->i_gmask = 0x03e0;
p_fmt->i_bmask = 0x001f;
break;
case FCC_RV16:
p_fmt->i_rmask = 0xf800;
p_fmt->i_gmask = 0x07e0;
p_fmt->i_bmask = 0x001f;
break;
case FCC_RV24:
p_fmt->i_rmask = 0xff0000;
p_fmt->i_gmask = 0x00ff00;
p_fmt->i_bmask = 0x0000ff;
break;
case FCC_RV32:
p_fmt->i_rmask = 0x00ff0000;
p_fmt->i_gmask = 0x0000ff00;
p_fmt->i_bmask = 0x000000ff;
break;
default:
assert(0);
break;
}
}
MaskToShift( &p_fmt->i_lrshift, &p_fmt->i_rrshift,
p_fmt->i_rmask );
MaskToShift( &p_fmt->i_lgshift, &p_fmt->i_rgshift,
p_fmt->i_gmask );
MaskToShift( &p_fmt->i_lbshift, &p_fmt->i_rbshift,
p_fmt->i_bmask );
}
/***********************************************************************
* YUVA
***********************************************************************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment