[vlc-commits] sepia: compute RGB indices from masks
Rémi Denis-Courmont
git at videolan.org
Mon Dec 17 18:46:11 CET 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Dec 17 19:19:22 2018 +0200| [6c11e8b146e5fc9384199a467e674aa64a2e628a] | committer: Rémi Denis-Courmont
sepia: compute RGB indices from masks
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6c11e8b146e5fc9384199a467e674aa64a2e628a
---
modules/video_filter/filter_picture.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/modules/video_filter/filter_picture.h b/modules/video_filter/filter_picture.h
index 30aec839a7..28fb4d5727 100644
--- a/modules/video_filter/filter_picture.h
+++ b/modules/video_filter/filter_picture.h
@@ -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;
}
More information about the vlc-commits
mailing list