Commit 62319093 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

es_format: remove right RGB shifts

RGB shifts carry zero entropy as they can trivially be recomputed from
the RGB masks. And then, they were only two users.

This saves 12 bytes per format.
parent 109db265
......@@ -366,9 +366,9 @@ struct video_format_t
unsigned int i_frame_rate_base; /**< frame rate denominator */
uint32_t i_rmask, i_gmask, i_bmask; /**< color masks for RGB chroma */
int i_rrshift, i_lrshift;
int i_rgshift, i_lgshift;
int i_rbshift, i_lbshift;
int i_lrshift;
int i_lgshift;
int i_lbshift;
video_palette_t *p_palette; /**< video palette from demuxer */
video_orientation_t orientation; /**< picture orientation */
video_color_primaries_t primaries; /**< color primaries */
......
......@@ -39,10 +39,9 @@
* 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 )
static void MaskToShift( int *pi_left, uint32_t i_mask )
{
*pi_left = ctz(i_mask);
*pi_right = 8 - vlc_popcount(i_mask);
}
/* */
......@@ -81,12 +80,9 @@ void video_format_FixRgb( video_format_t *p_fmt )
}
}
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 );
MaskToShift( &p_fmt->i_lrshift, p_fmt->i_rmask );
MaskToShift( &p_fmt->i_lgshift, p_fmt->i_gmask );
MaskToShift( &p_fmt->i_lbshift, p_fmt->i_bmask );
}
void video_format_Setup( video_format_t *p_fmt, vlc_fourcc_t i_chroma,
......
......@@ -118,9 +118,6 @@ filter_t *filter_NewBlend( vlc_object_t *p_this,
p_blend->fmt_out.video.i_rmask = p_dst_chroma->i_rmask;
p_blend->fmt_out.video.i_gmask = p_dst_chroma->i_gmask;
p_blend->fmt_out.video.i_bmask = p_dst_chroma->i_bmask;
p_blend->fmt_out.video.i_rrshift= p_dst_chroma->i_rrshift;
p_blend->fmt_out.video.i_rgshift= p_dst_chroma->i_rgshift;
p_blend->fmt_out.video.i_rbshift= p_dst_chroma->i_rbshift;
p_blend->fmt_out.video.i_lrshift= p_dst_chroma->i_lrshift;
p_blend->fmt_out.video.i_lgshift= p_dst_chroma->i_lgshift;
p_blend->fmt_out.video.i_lbshift= p_dst_chroma->i_lbshift;
......
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