[vlc-commits] [Git][videolan/vlc][master] filter_picture: pass only the chroma to GetPackedRgbIndexes()

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Sun Oct 1 10:40:25 UTC 2023



Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC


Commits:
a6caa96f by Steve Lhomme at 2023-10-01T09:21:32+00:00
filter_picture: pass only the chroma to GetPackedRgbIndexes()

We don't need anything else anymore.

- - - - -


3 changed files:

- modules/video_filter/blend.cpp
- modules/video_filter/filter_picture.h
- modules/video_filter/sepia.c


Changes:

=====================================
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;


=====================================
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;


=====================================
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



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a6caa96f1dda3dc75846ac18eaa2b0abec305d2d

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a6caa96f1dda3dc75846ac18eaa2b0abec305d2d
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list