[vlc-commits] [Git][videolan/vlc][master] 10 commits: vout/xcb: fall through to handle 32-bit RGB only once

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Sep 29 15:50:09 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
d4a741f7 by Steve Lhomme at 2023-09-29T17:25:57+02:00
vout/xcb: fall through to handle 32-bit RGB only once

- - - - -
920fff9b by Steve Lhomme at 2023-09-29T17:25:57+02:00
vout/xcb: map 32-bit RGB to RGB+x chromas

We pass the mask verbatim so that's how the mask were interpreted so far.

- - - - -
d307f9d6 by Steve Lhomme at 2023-09-29T17:25:57+02:00
vout/xcb: refuse masks that can't be mapped to VLC chromas

We have the most common ones and we won't be able to convert them
otherwise.

- - - - -
c9778355 by Steve Lhomme at 2023-09-29T17:25:57+02:00
opengl: use VLC_CODEC_RGBA for interops using GL_RGBA format

It is used to signal that the internal format will be RGB+alpha
so use the proper value right away.

This corresponds to the VLC FourCC<->OpenGL format mapping in interop_sw.

- - - - -
22ba40db by Steve Lhomme at 2023-09-29T17:25:57+02:00
opengl: use VLC_CODEC_BGRA for interops using GL_BGRA format

It is used to signal that the internal format will be RGB+alpha
so use the proper value right away.

This corresponds to the VLC FourCC<->OpenGL format mapping in interop_sw.

- - - - -
eea22be5 by Steve Lhomme at 2023-09-29T17:25:58+02:00
bitmapinfoheader: use XRGB for 32-bit RGB reading by default

Only use RGB32 when there's a mask involved (BI_BITFIELDS).

- - - - -
fc2aab66 by Steve Lhomme at 2023-09-29T17:25:58+02:00
bitmapinfoheader: map common 32-bit RGB masks to our 32-bit RGB chromas

The mask in AVI correspond to the Little-Endian values we read.

The alpha mask tested is the full 32-bit mask and not just 0xFF which only
matched RGBA before dd73c3e0a07a552fbd00e3279772ddbfd6e2b29d.

- - - - -
2519e912 by Steve Lhomme at 2023-09-29T17:25:58+02:00
bitmapinfoheader: don't map unknown 32-bit RGB mask layout

We want to get rid of masks internally, we can't handle odd values, just like FFmpeg.

- - - - -
89fbb25b by Steve Lhomme at 2023-09-29T17:25:58+02:00
fourcc: change the VLC_CODEC_XRGB FourCC to RV32

So that code passing a chroma as a string ends up on the on the same chroma
layout.

- - - - -
eaf149b7 by Steve Lhomme at 2023-09-29T17:29:52+02:00
vlc_fourcc: remove read-only VLC_CODEC_RGB32

It's never used as such. Only 4 masks existed and they have been replaced with
VLC_CODEC_BGRX, VLC_CODEC_XRGB, VLC_CODEC_XBGR and VLC_CODEC_RGBX.

- - - - -


28 changed files:

- include/vlc_fourcc.h
- modules/codec/avcodec/chroma.c
- modules/codec/avcodec/fourcc.c
- modules/demux/avi/bitmapinfoheader.h
- modules/hw/mmal/mmal_picture.c
- modules/isa/arm/neon/yuv_rgb.c
- modules/video_chroma/chain.c
- modules/video_chroma/i420_rgb.c
- modules/video_chroma/rv32.c
- modules/video_filter/blend.cpp
- modules/video_filter/filter_picture.h
- modules/video_filter/mirror.c
- modules/video_filter/posterize.c
- modules/video_filter/scale.c
- modules/video_filter/sepia.c
- modules/video_output/kva.c
- modules/video_output/libplacebo/utils.c
- modules/video_output/opengl/interop_android.c
- modules/video_output/opengl/interop_cvpx.m
- modules/video_output/opengl/interop_dxva2.c
- modules/video_output/opengl/interop_gst_mem.c
- modules/video_output/opengl/interop_sw.c
- modules/video_output/opengl/interop_vdpau.c
- modules/video_output/vmem.c
- modules/video_output/xcb/pictures.c
- src/misc/es_format.c
- src/misc/fourcc.c
- src/misc/fourcc_list.h


Changes:

=====================================
include/vlc_fourcc.h
=====================================
@@ -347,11 +347,9 @@
 #define VLC_CODEC_RGB15           VLC_FOURCC('R','V','1','5')
 /* 16-bit RGB (using explicit masks) */
 #define VLC_CODEC_RGB16           VLC_FOURCC('R','V','1','6')
-/* 24-bit RGB padded to 32 bits (using explicit masks) */
-#define VLC_CODEC_RGB32           VLC_FOURCC('R','V','3','2')
 
 /* 32-bit RGB, in memory address order: "XRGB" ignoring the x component */
-#define VLC_CODEC_XRGB            VLC_FOURCC('X','R','G','B')
+#define VLC_CODEC_XRGB            VLC_FOURCC('R','V','3','2')
 /* 32-bit RGB, in memory address order: "RGBX" ignoring the x component */
 #define VLC_CODEC_RGBX            VLC_FOURCC('R','G','B','X')
 /* 32-bit BGR, in memory address order: "BGRX" ignoring the x component */


=====================================
modules/codec/avcodec/chroma.c
=====================================
@@ -164,9 +164,6 @@ static const struct
     {VLC_CODEC_BGRX, AV_PIX_FMT_BGR0, 0, 0, 0 },
     {VLC_CODEC_XBGR, AV_PIX_FMT_0BGR, 0, 0, 0 },
 
-    VLC_RGB( VLC_CODEC_RGB32, AV_PIX_FMT_0RGB, AV_PIX_FMT_0BGR, 0x00ff0000, 0x0000ff00, 0x000000ff)
-    VLC_RGB( VLC_CODEC_RGB32, AV_PIX_FMT_RGB0, AV_PIX_FMT_BGR0, 0xff000000, 0x00ff0000, 0x0000ff00)
-
     {VLC_CODEC_RGBA, AV_PIX_FMT_RGBA, 0, 0, 0 },
     {VLC_CODEC_ARGB, AV_PIX_FMT_ARGB, 0, 0, 0 },
     {VLC_CODEC_BGRA, AV_PIX_FMT_BGRA, 0, 0, 0 },


=====================================
modules/codec/avcodec/fourcc.c
=====================================
@@ -61,7 +61,6 @@ static const struct vlc_avcodec_fourcc video_codecs[] =
     { VLC_CODEC_SP5X, AV_CODEC_ID_SP5X },
     { VLC_CODEC_JPEGLS, AV_CODEC_ID_JPEGLS },
     { VLC_CODEC_MP4V, AV_CODEC_ID_MPEG4 },
-    { VLC_CODEC_RGB32, AV_CODEC_ID_RAWVIDEO },
     { VLC_CODEC_RGB24, AV_CODEC_ID_RAWVIDEO },
     { VLC_CODEC_BGR24, AV_CODEC_ID_RAWVIDEO },
     { VLC_CODEC_RGB16, AV_CODEC_ID_RAWVIDEO },


=====================================
modules/demux/avi/bitmapinfoheader.h
=====================================
@@ -50,9 +50,6 @@ static const struct
     { VLC_CODEC_RGB16,      0xf800, /* FIXME it should be B5G6R5LE */
                             0x07e0,
                             0x001f, },
-    { VLC_CODEC_RGB32,      0x00ff0000, /* This is in XRGB format */
-                            0x0000ff00,
-                            0x000000ff, },
 };
 
 static inline void SetBitmapRGBMasks( vlc_fourcc_t i_fourcc, video_format_t *fmt )
@@ -111,7 +108,7 @@ static inline int ParseBitmapInfoHeader( const VLC_BITMAPINFOHEADER *p_bih, size
         switch( p_bih->biBitCount )
         {
             case 32:
-                fmt->video.i_chroma = fmt->i_codec = VLC_CODEC_RGB32;
+                fmt->video.i_chroma = fmt->i_codec = VLC_CODEC_XBGR;
                 break;
             case 24:
                 fmt->video.i_chroma = fmt->i_codec = VLC_CODEC_BGR24;
@@ -141,32 +138,105 @@ static inline int ParseBitmapInfoHeader( const VLC_BITMAPINFOHEADER *p_bih, size
         {
             if( i_bihextra >= 3 * sizeof(uint32_t) )
             {
-                fmt->video.i_rmask = GetDWLE( &p_bihextra[0] );
-                fmt->video.i_gmask = GetDWLE( &p_bihextra[4] );
-                fmt->video.i_bmask = GetDWLE( &p_bihextra[8] );
-                video_format_FixRgb( &fmt->video );
-                if( i_bihextra >= 4 * sizeof(uint32_t) ) /* Alpha channel ? */
+                uint32_t rmask = GetDWLE( &p_bihextra[0] );
+                uint32_t gmask = GetDWLE( &p_bihextra[4] );
+                uint32_t bmask = GetDWLE( &p_bihextra[8] );
+                uint32_t amask = i_bihextra >= 4 * sizeof(uint32_t) ? GetDWLE( &p_bihextra[12] ) : 0;
+
+                vlc_fourcc_t known_chroma = 0;
+                switch( p_bih->biBitCount )
                 {
-                    uint32_t i_alpha = GetDWLE( &p_bihextra[12] );
-                    if( i_alpha == 0xFF )
-                    {
-                        switch (fmt->i_codec)
+                    case 32:
+                        if (rmask == 0x00ff0000 &&
+                            gmask == 0x0000ff00 &&
+                            bmask == 0x000000ff &&
+                            amask == 0x00000000)
+                        {
+                            known_chroma = VLC_CODEC_XRGB;
+                        }
+                        else
+                        if (rmask == 0x000000ff &&
+                            gmask == 0x0000ff00 &&
+                            bmask == 0x00ff0000 &&
+                            amask == 0x00000000)
+                        {
+                            known_chroma = VLC_CODEC_XBGR;
+                        }
+                        else
+                        if (rmask == 0xff000000 &&
+                            gmask == 0x00ff0000 &&
+                            bmask == 0x0000ff00 &&
+                            amask == 0x00000000)
+                        {
+                            known_chroma = VLC_CODEC_RGBX;
+                        }
+                        else
+                        if (rmask == 0x0000ff00 &&
+                            gmask == 0x00ff0000 &&
+                            bmask == 0xff000000 &&
+                            amask == 0x00000000)
                         {
-                            case VLC_CODEC_RGB32: // unknown mask
-                            case VLC_CODEC_BGRX:
-                                fmt->i_codec = fmt->video.i_chroma = VLC_CODEC_BGRA;
-                                break;
-                            case VLC_CODEC_RGBX:
-                                fmt->i_codec = fmt->video.i_chroma = VLC_CODEC_RGBA;
-                                break;
-                            case VLC_CODEC_XBGR:
-                                fmt->i_codec = fmt->video.i_chroma = VLC_CODEC_ABGR;
-                                break;
-                            case VLC_CODEC_XRGB:
-                                fmt->i_codec = fmt->video.i_chroma = VLC_CODEC_ARGB;
-                                break;
+                            known_chroma = VLC_CODEC_BGRX;
                         }
-                    }
+                        if (rmask == 0x00ff0000 &&
+                            gmask == 0x0000ff00 &&
+                            bmask == 0x000000ff &&
+                            amask == 0xff000000)
+                        {
+                            known_chroma = VLC_CODEC_ARGB;
+                        }
+                        else
+                        if (rmask == 0x000000ff &&
+                            gmask == 0x0000ff00 &&
+                            bmask == 0x00ff0000 &&
+                            amask == 0xff000000)
+                        {
+                            known_chroma = VLC_CODEC_ABGR;
+                        }
+                        else
+                        if (rmask == 0xff000000 &&
+                            gmask == 0x00ff0000 &&
+                            bmask == 0x0000ff00 &&
+                            amask == 0x000000ff)
+                        {
+                            known_chroma = VLC_CODEC_RGBA;
+                        }
+                        else
+                        if (rmask == 0x0000ff00 &&
+                            gmask == 0x00ff0000 &&
+                            bmask == 0xff000000 &&
+                            amask == 0x000000ff)
+                        {
+                            known_chroma = VLC_CODEC_BGRA;
+                        }
+                        else
+                        {
+                            // unknown mask
+                            return VLC_ENOTSUP;
+                        }
+                        break;
+                    default:
+                        break;
+                }
+
+                if (known_chroma != 0)
+                {
+                    fmt->video.i_chroma = fmt->i_codec = known_chroma;
+                    fmt->video.i_rmask = 0;
+                    fmt->video.i_gmask = 0;
+                    fmt->video.i_bmask = 0;
+                }
+                else if (amask == 0)
+                {
+                    fmt->video.i_rmask = rmask;
+                    fmt->video.i_gmask = gmask;
+                    fmt->video.i_bmask = bmask;
+                    video_format_FixRgb( &fmt->video );
+                }
+                else
+                {
+                    // unsupported alpha mask
+                    return VLC_ENOTSUP;
                 }
             }
             else
@@ -220,13 +290,7 @@ static inline int ParseBitmapInfoHeader( const VLC_BITMAPINFOHEADER *p_bih, size
     }
     else /* Compressed codecs */
     {
-        vlc_fourcc_t fcc;
-        /* Shitty VLC muxed files storing chroma in biCompression */
-        if (p_bih->biCompression == VLC_FOURCC('R','V','3','2'))
-            fcc = VLC_CODEC_XRGB;
-        else
-            fcc = p_bih->biCompression;
-        fmt->i_codec = vlc_fourcc_GetCodec( VIDEO_ES, fcc );
+        fmt->i_codec = vlc_fourcc_GetCodec( VIDEO_ES, p_bih->biCompression );
 
         /* Copy extradata if any */
         if( i_bihextra > 0 )
@@ -277,11 +341,6 @@ static inline int CreateBitmapInfoHeader( const es_format_t *fmt,
             biBitCount = 32;
             biCompression = BI_BITFIELDS;
             break;
-        case VLC_CODEC_RGB32:
-            biBitCount = 32;
-            if ( !MatchBitmapRGBMasks( fmt ) )
-                biCompression = BI_BITFIELDS;
-            break;
         case VLC_CODEC_BGRA:
         case VLC_CODEC_RGBA:
         case VLC_CODEC_ARGB:


=====================================
modules/hw/mmal/mmal_picture.c
=====================================
@@ -84,22 +84,6 @@ MMAL_FOURCC_T vlc_to_mmal_video_fourcc(const video_frame_format_t * const vf_vlc
             return MMAL_ENCODING_ABGR;
         case VLC_CODEC_XRGB:
             return MMAL_ENCODING_ARGB;
-        case VLC_CODEC_RGB32:
-        {
-            // VLC RGB32 aka RV32 means we have to look at the mask values
-            const uint32_t r = vf_vlc->i_rmask;
-            const uint32_t g = vf_vlc->i_gmask;
-            const uint32_t b = vf_vlc->i_bmask;
-            if (r == 0xff0000 && g == 0xff00 && b == 0xff)
-                return MMAL_ENCODING_BGRA;
-            if (r == 0xff && g == 0xff00 && b == 0xff0000)
-                return MMAL_ENCODING_RGBA;
-            if (r == 0xff000000 && g == 0xff0000 && b == 0xff00)
-                return MMAL_ENCODING_ABGR;
-            if (r == 0xff00 && g == 0xff0000 && b == 0xff000000)
-                return MMAL_ENCODING_ARGB;
-            break;
-        }
         case VLC_CODEC_RGB565BE:
             return MMAL_ENCODING_RGB16;
         case VLC_CODEC_RGB16:


=====================================
modules/isa/arm/neon/yuv_rgb.c
=====================================
@@ -155,12 +155,6 @@ static int Open (filter_t *filter)
             }
             break;
 
-        case VLC_CODEC_RGB32:
-            if(        filter->fmt_out.video.i_rmask != 0x000000ff
-                    || filter->fmt_out.video.i_gmask != 0x0000ff00
-                    || filter->fmt_out.video.i_bmask != 0x00ff0000 )
-                return VLC_EGENERIC;
-            /* fallthrough */
         case VLC_CODEC_XBGR:
 
             switch (filter->fmt_in.video.i_chroma)


=====================================
modules/video_chroma/chain.c
=====================================
@@ -77,7 +77,6 @@ static const vlc_fourcc_t pi_allowed_chromas_yuv[] = {
     ALLOWED_CHROMAS_YUV10,
     VLC_CODEC_XRGB,
     VLC_CODEC_BGRX,
-    VLC_CODEC_RGB32,
     VLC_CODEC_RGB24,
     VLC_CODEC_BGR24,
     VLC_CODEC_BGRA,
@@ -90,7 +89,6 @@ static const vlc_fourcc_t pi_allowed_chromas_yuv10[] = {
     VLC_CODEC_I422,
     VLC_CODEC_XRGB,
     VLC_CODEC_BGRX,
-    VLC_CODEC_RGB32,
     VLC_CODEC_RGB24,
     VLC_CODEC_BGR24,
     VLC_CODEC_BGRA,


=====================================
modules/video_chroma/i420_rgb.c
=====================================
@@ -153,43 +153,6 @@ static int Activate( filter_t *p_filter )
                     msg_Dbg(p_filter, "RGB pixel format is XBGR");
                     p_filter->ops = &I420_A8B8G8R8_ops;
                     break;
-                case VLC_CODEC_RGB32:
-                    /* If we don't have support for the bitmasks, bail out */
-                    if( p_filter->fmt_out.video.i_rmask == 0x00ff0000
-                     && p_filter->fmt_out.video.i_gmask == 0x0000ff00
-                     && p_filter->fmt_out.video.i_bmask == 0x000000ff )
-                    {
-                        /* A8R8G8B8 pixel format */
-                        msg_Dbg(p_filter, "RGB pixel format is A8R8G8B8");
-                        p_filter->ops = &I420_A8R8G8B8_ops;
-                    }
-                    else if( p_filter->fmt_out.video.i_rmask == 0xff000000
-                          && p_filter->fmt_out.video.i_gmask == 0x00ff0000
-                          && p_filter->fmt_out.video.i_bmask == 0x0000ff00 )
-                    {
-                        /* R8G8B8A8 pixel format */
-                        msg_Dbg(p_filter, "RGB pixel format is R8G8B8A8");
-                        p_filter->ops = &I420_R8G8B8A8_ops;
-                    }
-                    else if( p_filter->fmt_out.video.i_rmask == 0x0000ff00
-                          && p_filter->fmt_out.video.i_gmask == 0x00ff0000
-                          && p_filter->fmt_out.video.i_bmask == 0xff000000 )
-                    {
-                        /* B8G8R8A8 pixel format */
-                        msg_Dbg(p_filter, "RGB pixel format is B8G8R8A8");
-                        p_filter->ops = &I420_B8G8R8A8_ops;
-                    }
-                    else if( p_filter->fmt_out.video.i_rmask == 0x000000ff
-                          && p_filter->fmt_out.video.i_gmask == 0x0000ff00
-                          && p_filter->fmt_out.video.i_bmask == 0x00ff0000 )
-                    {
-                        /* A8B8G8R8 pixel format */
-                        msg_Dbg(p_filter, "RGB pixel format is A8B8G8R8");
-                        p_filter->ops = &I420_A8B8G8R8_ops;
-                    }
-                    else
-                        return VLC_EGENERIC;
-                    break;
 #else
                 case VLC_CODEC_RGB233:
                 case VLC_CODEC_RGB332:
@@ -204,7 +167,6 @@ static int Activate( filter_t *p_filter )
                 case VLC_CODEC_XBGR:
                 case VLC_CODEC_RGBX:
                 case VLC_CODEC_BGRX:
-                case VLC_CODEC_RGB32:
                     p_filter->ops = &I420_RGB32_ops;
                     break;
 #endif
@@ -243,7 +205,6 @@ static int Activate( filter_t *p_filter )
         case VLC_CODEC_BGRX:
         case VLC_CODEC_RGB24:
         case VLC_CODEC_BGR24:
-        case VLC_CODEC_RGB32:
             p_sys->i_bytespp = 4;
             break;
         default:
@@ -390,7 +351,6 @@ static void SetYUV( filter_t *p_filter, const video_format_t *vfmt )
     case VLC_CODEC_BGRX:
     case VLC_CODEC_RGB24:
     case VLC_CODEC_BGR24:
-    case VLC_CODEC_RGB32:
         p_sys->p_rgb32 = (uint32_t *)p_sys->p_base;
         for( unsigned i_index = 0; i_index < RED_MARGIN; i_index++ )
         {


=====================================
modules/video_chroma/rv32.c
=====================================
@@ -57,8 +57,7 @@ static int OpenFilter( filter_t *p_filter )
 {
     /* XXX Only support RV24 -> RV32 conversion */
     if( p_filter->fmt_in.video.i_chroma != VLC_CODEC_BGR24 ||
-        (p_filter->fmt_out.video.i_chroma != VLC_CODEC_RGB32 &&
-        p_filter->fmt_out.video.i_chroma != VLC_CODEC_RGBA) )
+        p_filter->fmt_out.video.i_chroma != VLC_CODEC_RGBA )
     {
         return VLC_EGENERIC;
     }


=====================================
modules/video_filter/blend.cpp
=====================================
@@ -578,7 +578,6 @@ static const struct {
     RGB(VLC_CODEC_RGB16,    CPictureRGB16,    convertRgbToRgbSmall),
     RGB(VLC_CODEC_RGB24,    CPictureRGB24,    convertNone),
     RGB(VLC_CODEC_BGR24,    CPictureRGB24,    convertNone),
-    RGB(VLC_CODEC_RGB32,    CPictureRGB32,    convertNone),
     RGB(VLC_CODEC_RGBA,     CPictureRGBA,     convertNone),
     RGB(VLC_CODEC_ARGB,     CPictureRGBA,     convertNone),
     RGB(VLC_CODEC_BGRA,     CPictureBGRA,     convertNone),


=====================================
modules/video_filter/filter_picture.h
=====================================
@@ -155,18 +155,6 @@ static inline int GetPackedRgbIndexes( const video_format_t *p_fmt, int *i_r_ind
             *i_r_index = 2;
             *i_a_index = -1;
             break;
-        case VLC_CODEC_RGB32:
-#ifdef WORDS_BIGENDIAN
-            *i_r_index = (24 - vlc_ctz(p_fmt->i_rmask)) / 8;
-            *i_g_index = (24 - vlc_ctz(p_fmt->i_gmask)) / 8;
-            *i_b_index = (24 - vlc_ctz(p_fmt->i_bmask)) / 8;
-#else
-            *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
-            *i_a_index = -1; // unused
-            break;
         default:
             return VLC_EGENERIC;
     }


=====================================
modules/video_filter/mirror.c
=====================================
@@ -122,7 +122,6 @@ static int Create( filter_t *p_filter )
             break;
         case VLC_CODEC_RGB24:
         case VLC_CODEC_BGR24:
-        case VLC_CODEC_RGB32:
         case VLC_CODEC_RGBA:
         case VLC_CODEC_ARGB:
         case VLC_CODEC_BGRA:
@@ -230,7 +229,6 @@ static void VerticalMirror( picture_t *p_pic, picture_t *p_outpic, int i_plane,
         case VLC_CODEC_BGR24:
             RV24VerticalMirror( p_pic, p_outpic, i_plane, b_left_to_right );
             break;
-        case VLC_CODEC_RGB32:
         case VLC_CODEC_RGBA:
         case VLC_CODEC_ARGB:
         case VLC_CODEC_BGRA:


=====================================
modules/video_filter/posterize.c
=====================================
@@ -105,7 +105,6 @@ static int Create( filter_t *p_filter )
         case VLC_CODEC_RGB24:
         case VLC_CODEC_BGR24:
             break;
-        case VLC_CODEC_RGB32:
         case VLC_CODEC_RGBA:
         case VLC_CODEC_ARGB:
         case VLC_CODEC_BGRA:
@@ -176,7 +175,6 @@ static void Filter( filter_t *p_filter, picture_t *p_pic, picture_t *p_outpic )
         case VLC_CODEC_BGR24:
             RVPosterize( p_pic, p_outpic, false, level );
             break;
-        case VLC_CODEC_RGB32:
         case VLC_CODEC_RGBA:
         case VLC_CODEC_ARGB:
         case VLC_CODEC_BGRA:


=====================================
modules/video_filter/scale.c
=====================================
@@ -57,7 +57,6 @@ static int OpenFilter( filter_t *p_filter )
           p_filter->fmt_in.video.i_chroma != VLC_CODEC_YUVA &&
           p_filter->fmt_in.video.i_chroma != VLC_CODEC_I420 &&
           p_filter->fmt_in.video.i_chroma != VLC_CODEC_YV12 &&
-          p_filter->fmt_in.video.i_chroma != VLC_CODEC_RGB32 &&
           p_filter->fmt_in.video.i_chroma != VLC_CODEC_RGBA &&
           p_filter->fmt_in.video.i_chroma != VLC_CODEC_ARGB &&
           p_filter->fmt_in.video.i_chroma != VLC_CODEC_BGRA &&
@@ -102,8 +101,7 @@ static void Filter( filter_t *p_filter, picture_t *p_pic, picture_t *p_pic_dst )
         p_filter->fmt_in.video.i_chroma != VLC_CODEC_RGBX &&
         p_filter->fmt_in.video.i_chroma != VLC_CODEC_XRGB &&
         p_filter->fmt_in.video.i_chroma != VLC_CODEC_BGRX &&
-        p_filter->fmt_in.video.i_chroma != VLC_CODEC_XBGR &&
-        p_filter->fmt_in.video.i_chroma != VLC_CODEC_RGB32 )
+        p_filter->fmt_in.video.i_chroma != VLC_CODEC_XBGR )
     {
         for( int i_plane = 0; i_plane < p_pic_dst->i_planes; i_plane++ )
         {


=====================================
modules/video_filter/sepia.c
=====================================
@@ -86,7 +86,6 @@ static const struct
     { VLC_CODEC_I420, PlanarI420Sepia },
     { VLC_CODEC_RGB24, RVSepia },
     { VLC_CODEC_BGR24, RVSepia },
-    { VLC_CODEC_RGB32, RVSepia },
     { VLC_CODEC_BGRA, RVSepia },
     { VLC_CODEC_RGBA, RVSepia },
     { VLC_CODEC_ARGB, RVSepia },


=====================================
modules/video_output/kva.c
=====================================
@@ -484,12 +484,6 @@ static int OpenDisplay( vout_display_t *vd, video_format_t *fmt )
                     i_chroma_shift = 2;
                     break;
 
-                case VLC_CODEC_RGB32:
-                    b_hw_accel = sys->kvac.ulInputFormatFlags & KVAF_BGR32;
-                    i_kva_fourcc = FOURCC_BGR4;
-                    i_chroma_shift = 0;
-                    break;
-
                 case VLC_CODEC_RGB16:
                     b_hw_accel = sys->kvac.ulInputFormatFlags & KVAF_BGR16;
                     i_kva_fourcc = FOURCC_R565;


=====================================
modules/video_output/libplacebo/utils.c
=====================================
@@ -200,7 +200,6 @@ static const struct { vlc_fourcc_t fcc; struct fmt_desc desc; } formats[] = {
     { VLC_CODEC_RGB16,          {PACKED(3, 5, 1)} },
     { VLC_CODEC_RGB24,          {PACKED(3, 8, 0)} },
     { VLC_CODEC_BGR24,          {PACKED(3, 8, 0)} },
-    { VLC_CODEC_RGB32,          {PACKED(3, 8, 8)} },
     { VLC_CODEC_RGBA,           {PACKED(4, 8, 0)} },
     { VLC_CODEC_BGRX,           {PACKED(3, 8, 8)} },
     { VLC_CODEC_BGRA,           {PACKED(4, 8, 0)} },
@@ -271,14 +270,6 @@ static void FillDesc(vlc_fourcc_t fcc, const struct fmt_desc *desc,
         data[2].component_map[0] = 1;
         break;
 
-    case VLC_CODEC_RGB32:
-        // XRGB instead of RGBX
-        data[0].component_map[0] = -1;
-        data[1].component_map[0] = 0;
-        data[2].component_map[0] = 1;
-        data[3].component_map[0] = 2;
-        break;
-
     case VLC_CODEC_BGRX:
     case VLC_CODEC_BGRA:
         // Packed BGR


=====================================
modules/video_output/opengl/interop_android.c
=====================================
@@ -240,7 +240,7 @@ Open(vlc_object_t *obj)
     interop->ops = &ops;
 
     interop->tex_target = GL_TEXTURE_EXTERNAL_OES;
-    interop->fmt_out.i_chroma = VLC_CODEC_RGB32;
+    interop->fmt_out.i_chroma = VLC_CODEC_RGBA;
     interop->fmt_out.space = COLOR_SPACE_UNDEF;
 
     interop->tex_count = 1;


=====================================
modules/video_output/opengl/interop_cvpx.m
=====================================
@@ -342,7 +342,7 @@ Open(vlc_object_t *obj)
 
             break;
         case VLC_CODEC_CVPX_BGRA:
-            interop->fmt_out.i_chroma = VLC_CODEC_RGB32;
+            interop->fmt_out.i_chroma = VLC_CODEC_BGRA;
             interop->fmt_out.space = COLOR_SPACE_UNDEF;
 
             interop->tex_count = 1;


=====================================
modules/video_output/opengl/interop_dxva2.c
=====================================
@@ -543,7 +543,7 @@ GLConvOpen(vlc_object_t *obj)
     video_format_TransformBy(&interop->fmt_out, TRANSFORM_VFLIP);
 
     interop->tex_target = GL_TEXTURE_2D;
-    interop->fmt_out.i_chroma = VLC_CODEC_RGB32;
+    interop->fmt_out.i_chroma = VLC_CODEC_BGRA;
     interop->fmt_out.space = COLOR_SPACE_UNDEF;
 
     interop->tex_count = 1;


=====================================
modules/video_output/opengl/interop_gst_mem.c
=====================================
@@ -248,7 +248,7 @@ Open(vlc_object_t *obj)
     video_format_TransformBy(&interop->fmt_out, TRANSFORM_VFLIP);
 
     interop->tex_target = GL_TEXTURE_EXTERNAL_OES;
-    interop->fmt_out.i_chroma = VLC_CODEC_RGB32;
+    interop->fmt_out.i_chroma = VLC_CODEC_RGBA;
     interop->fmt_out.space = COLOR_SPACE_UNDEF;
 
     static const struct vlc_gl_interop_ops ops = {


=====================================
modules/video_output/opengl/interop_sw.c
=====================================
@@ -619,14 +619,6 @@ interop_rgb_base_init(struct vlc_gl_interop *interop, GLenum tex_target,
             break;
 #endif
 
-        case VLC_CODEC_RGB32:
-            if(!interop->fmt_in.i_rmask && !fallback_masks)
-                return VLC_EGENERIC;
-            if(interop->fmt_in.i_rmask == 0x0000ff00)
-                return interop_rgb_base_init(interop, tex_target, VLC_CODEC_BGRA, fallback_masks);
-            else
-                return interop_rgb_base_init(interop, tex_target, VLC_CODEC_RGBA, fallback_masks);
-
         case VLC_CODEC_XRGB:
         case VLC_CODEC_RGBA:
             interop->texs[0] = (struct vlc_gl_tex_cfg) {
@@ -796,25 +788,9 @@ interop_init:
      * be created. */
 
     interop->fmt_in.i_chroma = i_chroma;
-
-    switch(i_chroma)
-    {
-        case VLC_CODEC_RGB32:
-            /* Ensure we only request and forward RGBX or BGRX in memory order */
-            if(interop->fmt_in.i_rmask != 0xff000000 && // RGBX
-               interop->fmt_in.i_rmask != 0x0000ff00)   // BGRX
-            {
-                interop->fmt_in.i_rmask = 0xff000000;
-                interop->fmt_in.i_gmask = 0x00ff0000;
-                interop->fmt_in.i_bmask = 0x0000ff00;
-            }
-            break;
-        default:
-            interop->fmt_in.i_rmask = 0;
-            interop->fmt_in.i_gmask = 0;
-            interop->fmt_in.i_bmask = 0;
-            break;
-    }
+    interop->fmt_in.i_rmask = 0;
+    interop->fmt_in.i_gmask = 0;
+    interop->fmt_in.i_bmask = 0;
 
     static const struct vlc_gl_interop_ops ops = {
         .allocate_textures = tc_common_allocate_textures,


=====================================
modules/video_output/opengl/interop_vdpau.c
=====================================
@@ -189,7 +189,7 @@ Open(vlc_object_t *obj)
     video_format_TransformBy(&interop->fmt_out, TRANSFORM_VFLIP);
 
     interop->tex_target = GL_TEXTURE_2D;
-    interop->fmt_out.i_chroma = VLC_CODEC_RGB32;
+    interop->fmt_out.i_chroma = VLC_CODEC_RGBA;
     interop->fmt_out.space = COLOR_SPACE_UNDEF;
 
     interop->tex_count = 1;


=====================================
modules/video_output/vmem.c
=====================================
@@ -202,9 +202,6 @@ static int Open(vout_display_t *vd,
         fmt.i_gmask = 0x07e0;
         fmt.i_bmask = 0xf800;
         break;
-    case VLC_CODEC_RGB32:
-        fmt.i_chroma = VLC_CODEC_XRGB;
-        /* fallthrough */
     default:
         fmt.i_rmask = 0;
         fmt.i_gmask = 0;


=====================================
modules/video_output/xcb/pictures.c
=====================================
@@ -109,11 +109,44 @@ bool vlc_xcb_VisualToFormat(const xcb_setup_t *setup, uint_fast8_t depth,
         case 32:
             if (fmt->bits_per_pixel != 32)
                 return false;
-            f->i_chroma = VLC_CODEC_RGB32;
-            break;
+            /* fallthrough */
         case 24:
             if (fmt->bits_per_pixel == 32)
-                f->i_chroma = VLC_CODEC_RGB32;
+            {
+                if (vt->red_mask   == 0x00ff0000 &&
+                    vt->green_mask == 0x0000ff00 &&
+                    vt->blue_mask  == 0x000000ff)
+                {
+                    f->i_chroma = VLC_CODEC_XRGB;
+                    use_masks = false;
+                }
+                else
+                if (vt->red_mask   == 0x000000ff &&
+                    vt->green_mask == 0x0000ff00 &&
+                    vt->blue_mask  == 0x00ff0000)
+                {
+                    f->i_chroma = VLC_CODEC_XBGR;
+                    use_masks = false;
+                }
+                else
+                if (vt->red_mask   == 0xff000000 &&
+                    vt->green_mask == 0x00ff0000 &&
+                    vt->blue_mask  == 0x0000ff00)
+                {
+                    f->i_chroma = VLC_CODEC_RGBX;
+                    use_masks = false;
+                }
+                else
+                if (vt->red_mask   == 0x0000ff00 &&
+                    vt->green_mask == 0x00ff0000 &&
+                    vt->blue_mask  == 0xff000000)
+                {
+                    f->i_chroma = VLC_CODEC_BGRX;
+                    use_masks = false;
+                }
+                else
+                    return false;
+            }
             else if (fmt->bits_per_pixel == 24)
             {
                 if (vt->red_mask   == 0xff0000 &&


=====================================
src/misc/es_format.c
=====================================
@@ -53,12 +53,6 @@ void video_format_FixRgb( video_format_t *p_fmt )
             p_fmt->i_bmask = 0x001f;
             break;
 
-        case VLC_CODEC_RGB32:
-            p_fmt->i_rmask = 0x00ff0000;
-            p_fmt->i_gmask = 0x0000ff00;
-            p_fmt->i_bmask = 0x000000ff;
-            break;
-
         default:
             // assert(!"a bogus mask was set on a chroma");
             p_fmt->i_rmask = 0;
@@ -67,50 +61,6 @@ void video_format_FixRgb( video_format_t *p_fmt )
             return;
         }
     }
-
-    // turn known masks into proper chromas
-    if ( p_fmt->i_chroma == VLC_CODEC_RGB32 )
-    {
-        if ( p_fmt->i_rmask == 0x00ff0000 &&
-             p_fmt->i_gmask == 0x0000ff00 &&
-             p_fmt->i_bmask == 0x000000ff )
-        {
-            p_fmt->i_chroma = VLC_CODEC_XRGB;
-            p_fmt->i_rmask = 0;
-            p_fmt->i_gmask = 0;
-            p_fmt->i_bmask = 0;
-        }
-        else
-        if ( p_fmt->i_rmask == 0x000000ff &&
-             p_fmt->i_gmask == 0x0000ff00 &&
-             p_fmt->i_bmask == 0x00ff0000 )
-        {
-            p_fmt->i_chroma = VLC_CODEC_XBGR;
-            p_fmt->i_rmask = 0;
-            p_fmt->i_gmask = 0;
-            p_fmt->i_bmask = 0;
-        }
-        else
-        if ( p_fmt->i_rmask == 0xff000000 &&
-             p_fmt->i_gmask == 0x00ff0000 &&
-             p_fmt->i_bmask == 0x0000ff00 )
-        {
-            p_fmt->i_chroma = VLC_CODEC_RGBX;
-            p_fmt->i_rmask = 0;
-            p_fmt->i_gmask = 0;
-            p_fmt->i_bmask = 0;
-        }
-        else
-        if ( p_fmt->i_rmask == 0x0000ff00 &&
-             p_fmt->i_gmask == 0x00ff0000 &&
-             p_fmt->i_bmask == 0xff000000 )
-        {
-            p_fmt->i_chroma = VLC_CODEC_BGRX;
-            p_fmt->i_rmask = 0;
-            p_fmt->i_gmask = 0;
-            p_fmt->i_bmask = 0;
-        }
-    }
 }
 
 void video_format_Setup( video_format_t *p_fmt, vlc_fourcc_t i_chroma,
@@ -294,8 +244,7 @@ bool video_format_IsSameChroma( const video_format_t *f1,
         return false;
 
     if( f1->i_chroma == VLC_CODEC_RGB15 ||
-        f1->i_chroma == VLC_CODEC_RGB16 ||
-        f1->i_chroma == VLC_CODEC_RGB32 )
+        f1->i_chroma == VLC_CODEC_RGB16 )
     {
         video_format_t v1 = *f1;
         video_format_t v2 = *f2;


=====================================
src/misc/fourcc.c
=====================================
@@ -571,7 +571,6 @@ static const vlc_fourcc_t p_list_YUV[] = {
 static const vlc_fourcc_t p_RGB32_fallback[] = {
     VLC_CODEC_XRGB,
     VLC_CODEC_BGRX,
-    VLC_CODEC_RGB32,
     VLC_CODEC_RGB24,
     VLC_CODEC_BGR24,
     VLC_CODEC_RGB565LE,
@@ -587,7 +586,6 @@ static const vlc_fourcc_t p_RGB24_fallback[] = {
     VLC_CODEC_BGR24,
     VLC_CODEC_XRGB,
     VLC_CODEC_BGRX,
-    VLC_CODEC_RGB32,
     VLC_CODEC_RGB565LE,
     VLC_CODEC_RGB16,
     VLC_CODEC_RGB555LE,
@@ -603,7 +601,6 @@ static const vlc_fourcc_t p_RGB16_fallback[] = {
     VLC_CODEC_BGR24,
     VLC_CODEC_XRGB,
     VLC_CODEC_BGRX,
-    VLC_CODEC_RGB32,
     VLC_CODEC_RGB555LE,
     VLC_CODEC_RGB233,
     VLC_CODEC_BGR233,
@@ -618,7 +615,6 @@ static const vlc_fourcc_t p_RGB15_fallback[] = {
     VLC_CODEC_BGR24,
     VLC_CODEC_XRGB,
     VLC_CODEC_BGRX,
-    VLC_CODEC_RGB32,
     VLC_CODEC_RGB233,
     VLC_CODEC_BGR233,
     VLC_CODEC_RGB332,
@@ -635,7 +631,6 @@ static const vlc_fourcc_t p_RGB8_fallback[] = {
     VLC_CODEC_BGR24,
     VLC_CODEC_XRGB,
     VLC_CODEC_BGRX,
-    VLC_CODEC_RGB32,
     0,
 };
 static const vlc_fourcc_t *const pp_RGB_fallback[] = {
@@ -840,7 +835,6 @@ static const struct
         VLC_CODEC_BGR565LE, VLC_CODEC_BGR565BE }, PACKED_FMT(2, 16) },
     { { VLC_CODEC_RGB24, VLC_CODEC_BGR24,
         0 },                                   PACKED_FMT(3, 24) },
-    { { VLC_CODEC_RGB32, 0 },                  PACKED_FMT(4, 24) },
     { { VLC_CODEC_RGBX, VLC_CODEC_XRGB,
         VLC_CODEC_BGRX, VLC_CODEC_XBGR },      PACKED_FMT(4, 24) },
     { { VLC_CODEC_RGBA, VLC_CODEC_ARGB,


=====================================
src/misc/fourcc_list.h
=====================================
@@ -815,8 +815,6 @@ static const staticentry_t p_list_video[] = {
         A("RV15"),
     B(VLC_CODEC_RGB16, "16 bits RGB"),
         A("RV16"),
-    B(VLC_CODEC_RGB32, "32 bits RGB"),
-        A("RV32"),
     B(VLC_CODEC_RGBA, "32 bits RGBA"),
         A("RGBA"),
     B(VLC_CODEC_ARGB, "32 bits ARGB"),
@@ -830,7 +828,7 @@ static const staticentry_t p_list_video[] = {
     B(VLC_CODEC_RGBA64, "64 bits RGBA"),
         A("RGA4"),
     B(VLC_CODEC_XRGB, "32 bits xRGB"),
-        A("XRGB"),
+        A("RV32"),
     B(VLC_CODEC_RGBX, "32 bits RGBx"),
         A("RGBX"),
     B(VLC_CODEC_XBGR, "32 bits xBGR"),



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/92d89bc3b3936ac04d25270ae94b7cac8f35f017...eaf149b7f8082aba094bfa17fcc50c51520deca5

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/92d89bc3b3936ac04d25270ae94b7cac8f35f017...eaf149b7f8082aba094bfa17fcc50c51520deca5
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