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

sepia: compute RGB indices from masks

parent 5823da2f
......@@ -99,13 +99,13 @@ static inline int GetPackedRgbIndexes( const video_format_t *p_fmt, int *i_r_ind
#ifdef WORDS_BIGENDIAN
const int i_mask_bits = p_fmt->i_chroma == VLC_CODEC_RGB24 ? 24 : 32;
*i_r_index = ( i_mask_bits - p_fmt->i_lrshift ) / 8;
*i_g_index = ( i_mask_bits - p_fmt->i_lgshift ) / 8;
*i_b_index = ( i_mask_bits - p_fmt->i_lbshift ) / 8;
*i_r_index = (i_mask_bits - vlc_ctz(p_fmt->i_rmask) / 8;
*i_g_index = (i_mask_bits - vlc_ctz(p_fmt->i_gmask) / 8;
*i_b_index = (i_mask_bits - vlc_ctz(p_fmt->i_bmask) / 8;
#else
*i_r_index = p_fmt->i_lrshift / 8;
*i_g_index = p_fmt->i_lgshift / 8;
*i_b_index = p_fmt->i_lbshift / 8;
*i_r_index = vlc_ctz(p_fmt->i_rmask) / 8;
*i_g_index = vlc_ctz(p_fmt->i_gmask) / 8;
*i_b_index = vlc_ctz(p_fmt->i_bmask) / 8;
#endif
return VLC_SUCCESS;
}
......
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