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
*****************************************************************************/
( 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 )
{
#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
***********************************************************************/
p_src2 = p_src->p->p_pixels + p_filter->fmt_in.video.i_x_offset +
i_src2_pitch * p_filter->fmt_in.video.i_y_offset;
- const uint8_t *p_trans = p_src2;
#define p_pal p_filter->fmt_in.video.p_palette->palette
/* Draw until we reach the bottom of the subtitle */
p_dst_v += b_even_scanline ? i_dst_pitch/2 : 0,
p_src1_v += b_even_scanline ? i_src1_pitch/2 : 0 )
{
+ const uint8_t *p_trans = p_src2;
b_even_scanline = !b_even_scanline;
/* Draw until we reach the end of the line */
i_width &= ~1; /* Needs to be a multiple of 2 */
- const uint8_t *p_trans = p_src2;
#define p_pal p_filter->fmt_in.video.p_palette->palette
/* Draw until we reach the bottom of the subtitle */
for( i_y = 0; i_y < i_height; i_y++,
p_dst += i_dst_pitch, p_src1 += i_src1_pitch, p_src2 += i_src2_pitch )
{
+ const uint8_t *p_trans = p_src2;
/* Draw until we reach the end of the line */
for( i_x = 0; i_x < i_width; i_x++, b_even = !b_even )
{
p_src2 = p_src->p->p_pixels + p_filter->fmt_in.video.i_x_offset +
i_src2_pitch * p_filter->fmt_in.video.i_y_offset;
- const uint8_t *p_trans = p_src2;
#define p_pal p_filter->fmt_in.video.p_palette->palette
#define rgbpal rgbpalette.palette
for( i_y = 0; i_y < i_height; i_y++,
p_dst += i_dst_pitch, p_src1 += i_src1_pitch, p_src2 += i_src2_pitch )
{
+ const uint8_t *p_trans = p_src2;
/* Draw until we reach the end of the line */
for( i_x = 0; i_x < i_width; i_x++ )
{