From a6caa96f1dda3dc75846ac18eaa2b0abec305d2d Mon Sep 17 00:00:00 2001 From: Steve Lhomme <robux4@ycbcr.xyz> Date: Fri, 8 Sep 2023 11:59:33 +0200 Subject: [PATCH] filter_picture: pass only the chroma to GetPackedRgbIndexes() We don't need anything else anymore. --- modules/video_filter/blend.cpp | 2 +- modules/video_filter/filter_picture.h | 4 ++-- modules/video_filter/sepia.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/video_filter/blend.cpp b/modules/video_filter/blend.cpp index 9161e653fb5e..63da1094906d 100644 --- a/modules/video_filter/blend.cpp +++ b/modules/video_filter/blend.cpp @@ -267,7 +267,7 @@ class CPictureRGBX : public CPicture { public: CPictureRGBX(const CPicture &cfg) : CPicture(cfg) { - if (GetPackedRgbIndexes(fmt, &offset_r, &offset_g, &offset_b, &offset_a) != VLC_SUCCESS) { + if (GetPackedRgbIndexes(fmt->i_chroma, &offset_r, &offset_g, &offset_b, &offset_a) != VLC_SUCCESS) { /* at least init to something on error to silence compiler warnings */ offset_r = 0; offset_g = 1; diff --git a/modules/video_filter/filter_picture.h b/modules/video_filter/filter_picture.h index 9bc3a32e19ac..8ce66a61e0c5 100644 --- a/modules/video_filter/filter_picture.h +++ b/modules/video_filter/filter_picture.h @@ -90,10 +90,10 @@ static inline int GetPackedYuvOffsets( vlc_fourcc_t i_chroma, } } -static inline int GetPackedRgbIndexes( const video_format_t *p_fmt, int *i_r_index, +static inline int GetPackedRgbIndexes( vlc_fourcc_t fcc, int *i_r_index, int *i_g_index, int *i_b_index, int *i_a_index ) { - switch(p_fmt->i_chroma) + switch(fcc) { case VLC_CODEC_RGBA: *i_r_index = 0; diff --git a/modules/video_filter/sepia.c b/modules/video_filter/sepia.c index 396959b29b58..3d230634d3df 100644 --- a/modules/video_filter/sepia.c +++ b/modules/video_filter/sepia.c @@ -410,7 +410,7 @@ static void RVSepia( picture_t *p_pic, picture_t *p_outpic, int i_intensity ) p_pic->format.i_chroma != VLC_CODEC_BGR24; int i_rindex = 0, i_gindex = 1, i_bindex = 2, i_aindex = -1; - GetPackedRgbIndexes( &p_outpic->format, &i_rindex, &i_gindex, &i_bindex, &i_aindex ); + GetPackedRgbIndexes( p_outpic->format.i_chroma, &i_rindex, &i_gindex, &i_bindex, &i_aindex ); p_in = p_pic->p[0].p_pixels; p_in_end = p_in + p_pic->p[0].i_visible_lines -- GitLab