[vlc-commits] [Git][videolan/vlc][master] 120 commits: filter_picture: fix the buffer indices of RGB components for fixed RGB chromas

Steve Lhomme (@robUx4) gitlab at videolan.org
Sun Sep 24 20:17:49 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
0c0a3be0 by Steve Lhomme at 2023-09-24T19:57:38+00:00
filter_picture: fix the buffer indices of RGB components for fixed RGB chromas

The position is always the same regardless of the host endianness.

- - - - -
fdf11d27 by Steve Lhomme at 2023-09-24T19:57:38+00:00
filter_picture: add support RGB+x chromas

- - - - -
a1994062 by Steve Lhomme at 2023-09-24T19:57:38+00:00
i420_rgb: handle RGB+x like RGB32+mask

The mask corresponds to different chroma.

I420_RGB32 should handle the mask so all chromas can be handled.

- - - - -
4f31b3f1 by Steve Lhomme at 2023-09-24T19:57:38+00:00
access/dshow: use VLC_CODEC_BGRX for MEDIASUBTYPE_RGB32

This is the proper type corresponding to MEDIASUBTYPE_RGB32 [1].
We don't need to handle VLC_CODEC_RGB32 anymore.

The use of VLC_CODEC_RGBA for MEDIASUBTYPE_ARGB32 is suspicious considering [1],
it should probably be VLC_CODEC_BGRA.

[1] https://learn.microsoft.com/en-us/windows/win32/directshow/uncompressed-rgb-video-subtypes
"If the subtype is MEDIASUBTYPE_ARGB32, byte 3 contains a value for the
alpha channel. If the subtype is MEDIASUBTYPE_RGB32, byte 3 should be ignored."

- - - - -
ee29a649 by Steve Lhomme at 2023-09-24T19:57:38+00:00
access/shm: replace VLC_CODEC_RGB32 with VLC_CODEC_XRGB

This is the same format once the mask is "fixed".

- - - - -
ac4e0da6 by Steve Lhomme at 2023-09-24T19:57:38+00:00
access/vnc: replace VLC_CODEC_RGB32 with XRGB/BGRX

It corresponds to the mask that is applied (R << 16 | G << 8 | B) and
depends on the endianness.

- - - - -
197a27b9 by Steve Lhomme at 2023-09-24T19:57:38+00:00
screen/mac: replace VLC_CODEC_RGB32 with VLC_CODEC_XRGB

This would be the one used with the "fixed" mask.

- - - - -
7f55e1d8 by Steve Lhomme at 2023-09-24T19:57:38+00:00
screen/wayland: replace VLC_CODEC_RGB32 with VLC_CODEC_BGRX

This corresponds to WL_SHM_FORMAT_XRGB8888.

- - - - -
69aabb9b by Steve Lhomme at 2023-09-24T19:57:38+00:00
screen/win32: replace VLC_CODEC_RGB32 with VLC_CODEC_BGRX

This is the format corresponding to the mask.

- - - - -
fcca2403 by Steve Lhomme at 2023-09-24T19:57:38+00:00
screen/xcb: replace VLC_CODEC_RGB32 with VLC_CODEC_XRGB

This is the format once the mask will be "fixed".

- - - - -
d0494dcd by Steve Lhomme at 2023-09-24T19:57:38+00:00
access/v4l2: map newer ARGB32/ABGR32 formats

RGB32 and BGR32 are deprecated [1]

[1] https://www.kernel.org/doc/html/v4.15/media/uapi/v4l/pixfmt-packed-rgb.html

- - - - -
936d15b2 by Steve Lhomme at 2023-09-24T19:57:38+00:00
access/v4l2: mapping 32-bit chromas to VLC ones without a mask

See [1] for details on each chroma.

[1] https://www.kernel.org/doc/html/v4.15/media/uapi/v4l/pixfmt-packed-rgb.html

- - - - -
f09cb927 by Steve Lhomme at 2023-09-24T19:57:38+00:00
codec/cdg: replace VLC_CODEC_RGB32 with XBGR

This is the format corresponding to the mask that was set.

- - - - -
ccbd82a9 by Steve Lhomme at 2023-09-24T19:57:38+00:00
mft: map MFVideoFormat_RGB32 to VLC_CODEC_RGBX

The documentation [1] says that it's equivalent to D3DFMT_X8R8G8B8.
And the d3d10 porting documentation [2] says it's equivalent to
DXGI_FORMAT_B8G8R8X8_UNORM.

[1] https://learn.microsoft.com/en-us/windows/win32/medfound/video-subtype-guids
[2] https://learn.microsoft.com/en-us/windows/win32/direct3d10/d3d10-graphics-programming-guide-resources-legacy-formats

- - - - -
2fa25201 by Steve Lhomme at 2023-09-24T19:57:38+00:00
xwd: replace VLC_CODEC_RGB32 with VLC_CODEC_XRGB

This is the equivalent of VLC_CODEC_ARGB used below, without the alpha.

The TODO on RGB mask in ce0db74040b472094ac77762ade60bd466903233 means
they not have been known when it was written. The new code is not the
code that could have been assume (BGRX on Little Endian).

- - - - -
400d76e9 by Steve Lhomme at 2023-09-24T19:57:38+00:00
avcodec/video: replace VLC_CODEC_RGB32 with VLC_CODEC_XRGB

This is the format once the mask will be "fixed".

This is still a hack not to transmit a palletized format until we get
the palette.

- - - - -
178f1b2d by Steve Lhomme at 2023-09-24T19:57:38+00:00
dxgi_fmt: map DXGI_FORMAT_B8G8R8X8 to VLC_CODEC_BGRX

This avoids dealing with a mask.

- - - - -
eb6c7066 by Steve Lhomme at 2023-09-24T19:57:38+00:00
video/mirror: handle all 32-bit RGB sources

The order of component doesn't matter during the copy. Only the size to copy
matters.

- - - - -
91b92b3b by Steve Lhomme at 2023-09-24T19:57:38+00:00
video/mirror: handle RGB+x as well

This is the same as handling RGB+a, the x part will be ignored as it's the
same chroma on input and output.

- - - - -
64d085f5 by Steve Lhomme at 2023-09-24T19:57:38+00:00
video/posterize: handle all 32-bit RGB sources

The order of component doesn't matter during the process. Only the size
to copy matters.

- - - - -
dd761258 by Steve Lhomme at 2023-09-24T19:57:38+00:00
video/posterize: handle RGB+x as well

This is the same as handling RGB+a, the x part will be ignored as it's the
same chroma on input and output.

RVPosterize() could be optimized to not process the x component and just
skip it. But then we need to check exactly what component it it.

- - - - -
de2d21f0 by Steve Lhomme at 2023-09-24T19:57:38+00:00
video/scale: handle RGB+x as well

This is the same as handling RGB+a, the x part will be ignored as it's the
same chroma on input and output.

- - - - -
3b09b79a by Steve Lhomme at 2023-09-24T19:57:38+00:00
blend: add support for ARGB and ABGR

Only the position of the components change and CPictureRGBX can handle it.

- - - - -
6b06568d by Steve Lhomme at 2023-09-24T19:57:38+00:00
video/sepia: handle RGB+a sources

- - - - -
7918a059 by Steve Lhomme at 2023-09-24T19:57:38+00:00
blend: add support for RGB+x

- - - - -
782a1312 by Steve Lhomme at 2023-09-24T19:57:38+00:00
video/sepia: handle RGB+x sources

- - - - -
6127d031 by Steve Lhomme at 2023-09-24T19:57:38+00:00
caca: request replace VLC_CODEC_RGB32 with XRGB

This is the format corresponding to the mask we used.

We reset mask to make sure it's not used as a format with mask.

- - - - -
1a45b292 by Steve Lhomme at 2023-09-24T19:57:38+00:00
vmem: use XRGB instead of VLC_CODEC_RGB32

This is the format corresponding to the mask. It's better to avoid
using masks when possible.

- - - - -
e6ceaa2a by Steve Lhomme at 2023-09-24T19:57:38+00:00
libplacebo: support VLC_CODEC_BGRX

It's similar to BGRA but without alpha.

- - - - -
841b9b1d by Steve Lhomme at 2023-09-24T19:57:38+00:00
opengl/sw: map XRGB/BGRX like their counterpart with alpha

This is handled the same as the VLC_CODEC_RGB32 with the corresponding mask.

- - - - -
a72593a8 by Steve Lhomme at 2023-09-24T19:57:38+00:00
wayland/shm: replace VLC_CODEC_RGB32 with VLC_CODEC_BGRX

The buffers are uploaded as WL_SHM_FORMAT_XRGB8888.

- - - - -
9ad789bc by Steve Lhomme at 2023-09-24T19:57:38+00:00
direct3d9: use VLC_CODEC_BGRA when mapping D3DFMT_A8R8G8B8

D3DFMT_A8R8G8B8 is equivalent to DXGI_FORMAT_B8G8R8A8_UNORM
which is VLC_CODEC_BGRA.

We don't need a mask.

- - - - -
b40ab362 by Steve Lhomme at 2023-09-24T19:57:38+00:00
direct3d9: use VLC_CODEC_BGRX when mapping D3DFMT_X8R8G8B8

So we don't have to deal with a mask.

- - - - -
9aed0277 by Steve Lhomme at 2023-09-24T19:57:38+00:00
goom: use VLC_CODEC_XRGB instead of VLC_CODEC_RGB32

This is the format that will be used once the mask is "fixed".

No need to provide a format with a mask here.

- - - - -
65efb009 by Steve Lhomme at 2023-09-24T19:57:38+00:00
fourcc: fallback to VLC_CODEC_XRGB/BGRX instead of VLC_CODEC_RGB32 if possible

This will avoid using a mask. This is the same format with the "fixed" mask.

We need both as some display modules/filter may only one or the other.

The pp_RGB_fallback list suspiciously contains many times the same chroma.

- - - - -
461dcf04 by Steve Lhomme at 2023-09-24T19:57:38+00:00
es_format: replace default VLC_CODEC_RGB32 with RGB+x chromas

The mask in native endianness represents the position of components.

- - - - -
f859440f by Steve Lhomme at 2023-09-24T19:57:38+00:00
drm/fourcc: map chromas to RGB+x

- - - - -
df6d963f by Steve Lhomme at 2023-09-24T19:57:38+00:00
chroma/chain: favor fallback to XRGB/BGRX over VLC_CODEC_RGB32

We need both as some display module may only support one or the other.

This avoids handling the mask if possible. Eventually we should remove
fallback to format that require a mask (which is not even set).

- - - - -
75923a4c by Steve Lhomme at 2023-09-24T19:57:38+00:00
vout/xcb: handle 32 bits depth

FFmpeg does support so it should work here too.

- - - - -
8e4277e2 by Steve Lhomme at 2023-09-24T19:57:38+00:00
bitmapinfoheader: constify ParseBitmapInfoHeader()

- - - - -
40fe9eda by Steve Lhomme at 2023-09-24T19:57:38+00:00
bitmapinfoheader: fallback to BI_RGB mapping for bogus mask sizes

- - - - -
620bf8e5 by Steve Lhomme at 2023-09-24T19:57:38+00:00
bitmapinfoheader: map 32-bit RGB to VLC_CODEC_XRGB

This is what BI_RGB corresponds to.

- - - - -
4d05d37e by Steve Lhomme at 2023-09-24T19:57:38+00:00
bitmapinfoheader: map RV32 biCompression to VLC_CODEC_XRGB

It corresponds to the "fixed" RGB32 mask.

- - - - -
d7ef2f94 by Steve Lhomme at 2023-09-24T19:57:38+00:00
yuv_rgb: fix RGB+x mapping

The mask corresponds to VLC_CODEC_XBGR.

- - - - -
0127ad54 by Steve Lhomme at 2023-09-24T19:57:38+00:00
vlc_fourcc: rename VLC_CODEC_RGB24 to VLC_CODEC_RGB24M

To signify it uses a mask, and to leave room for a real VLC_CODEC_RGB24 without
a mask.

- - - - -
1adac9be by Steve Lhomme at 2023-09-24T19:57:38+00:00
fourcc: add VLC_CODEC_RGB24/VLC_CODEC_BGR24 with fixed masks

- - - - -
afd5c83f by Steve Lhomme at 2023-09-24T19:57:38+00:00
avcodec/chroma: map common RGB24 formats to libavutil ones

They have the same definition

- - - - -
c6a5dfb7 by Steve Lhomme at 2023-09-24T19:57:38+00:00
access/v4l2: map 24-bit chromas to VLC ones without a mask

The formats are mapped according to their description [1].

[1] https://www.kernel.org/doc/html/v4.15/media/uapi/v4l/pixfmt-packed-rgb.html

- - - - -
4f6c1922 by Steve Lhomme at 2023-09-24T19:57:38+00:00
drm/fourcc: map RGB24 chromas

The formats are little endian by default [1].

[1] https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/drm_fourcc.c

- - - - -
2fa5ba49 by Steve Lhomme at 2023-09-24T19:57:38+00:00
filter_picture: add support for 24-bit RGB without a mask

- - - - -
41a2bfd9 by Steve Lhomme at 2023-09-24T19:57:38+00:00
fourcc: fallback to RGB24/BGR24 instead of VLC_CODEC_RGB24M

This will avoid using a mask. We need both as some display modules may
support one or the other.

The pp_RGB_fallback list suspiciously contains many times the same chroma.

- - - - -
ce375ece by Steve Lhomme at 2023-09-24T19:57:38+00:00
i420_rgb: add support for RGB24 without a mask

We can reconstruct the mask using vlc_RGBChromaToMask().

- - - - -
70dbf29e by Steve Lhomme at 2023-09-24T19:57:38+00:00
access/dshow: use VLC_CODEC_BGR24 instead of VLC_CODEC_RGB24M

MEDIASUBTYPE_RGB24 corresponds to VLC_CODEC_BGR24 [1]

[1] https://learn.microsoft.com/en-us/windows/win32/directshow/uncompressed-rgb-video-subtypes

- - - - -
21bd9cff by Steve Lhomme at 2023-09-24T19:57:38+00:00
screen/win32: use VLC_CODEC_RGB24 instead of VLC_CODEC_RGB24M

This is the chroma corresponding to the default RGB24M mask.

- - - - -
7939c2aa by Steve Lhomme at 2023-09-24T19:57:38+00:00
chroma/chain: favor fallback to RGB24/BGR24 over VLC_CODEC_RGB24M

This avoids handling the mask if possible. Eventually we should remove
fallback to format that require a mask (which is not even set).

We need BGR24 as some rare display module may accept that instead of RGB24.

- - - - -
121627b2 by Steve Lhomme at 2023-09-24T19:57:38+00:00
sout/rtp: map RGB24/BGR24 in addition to VLC_CODEC_RGB24M

We can accept both masks, but the BGR needs to be signaled differently.

- - - - -
7aebcaaf by Steve Lhomme at 2023-09-24T19:57:38+00:00
flaschen: use RGB24 chromas instead of VLC_CODEC_RGB24M

The chroma corresponds to the default RGB24M mask.

- - - - -
67fe18cb by Steve Lhomme at 2023-09-24T19:57:38+00:00
wingdi: request VLC_CODEC_RGB24 instead of RGB24 with a mask

- - - - -
8d0f2b86 by Steve Lhomme at 2023-09-24T19:57:38+00:00
direct3d9: request RGB24 without a mask

The chroma corresponds to the mask.

The chroma doesn't corresponds to the mask. It seems more logical
given A8R8G8B8 and X8R8G8B8 map the BGR equivalents [1].

[1] https://learn.microsoft.com/en-us/windows/win32/direct3d10/d3d10-graphics-programming-guide-resources-legacy-formats

- - - - -
e83880db by Steve Lhomme at 2023-09-24T19:57:38+00:00
libplacebo: accept SPU as RGB24

This avoids using a mask.

It corresponds to the default RGB24M mask.

- - - - -
f880909c by Steve Lhomme at 2023-09-24T19:57:38+00:00
opencv: map RGB output to RGB24 without a mask

The chroma corresponds to the default RGB24M mask.

- - - - -
3378a114 by Steve Lhomme at 2023-09-24T19:57:38+00:00
demux/mp4: map '2','4','B','G' to VLC_CODEC_BGR24

The mask corresponds to BGR on Big-Endian and was probably the intention
of fe489afd03fc820767b1a684d2bea3f4e201cbd4.
In libavformat it's mapped to AV_PIX_FMT_BGR24.

- - - - -
b7e2b6a3 by Steve Lhomme at 2023-09-24T19:57:38+00:00
demux/mp4: map 24-bit 'r','a','w',' ' to VLC_CODEC_RGB24

It can't depend on endianness.

It was probably the intention of fe489afd03fc820767b1a684d2bea3f4e201cbd4.
In libavformat it's mapped to AV_PIX_FMT_RGB24.

- - - - -
f1977c51 by Steve Lhomme at 2023-09-24T19:57:38+00:00
bitmapinfoheader: map 24-bit BI_RGB to VLC_CODEC_BGR24

This was originally the mask in 042dc8aca36f16881c398537a2b18ad1ccf03fbc
but got inverted in 7794977d68953eb62c6ddb1edcbed9043f866ebe.

- - - - -
8880b743 by Steve Lhomme at 2023-09-24T19:57:38+00:00
bitmapinfoheader: handle muxing VLC_CODEC_RGB24

24-bit RGB in AVI is only BGR. The code transforms each RGB sample
into a BGR sample. We can't use the mask from vlc_RGBChromaToMask()
as 24 bit RGB can only be BI_RGB in AVI.

- - - - -
4f2134fa by Steve Lhomme at 2023-09-24T19:57:38+00:00
xwd: map 24-bit RGB to RGB24/BGR24 without a mask

This corresponds to the default RGB24M mask.

- - - - -
b04d7caa by Steve Lhomme at 2023-09-24T19:57:38+00:00
png: decode RGB without alpha as RGB24 without a mask

The output likely doesn't depend on the endianness and is probably RGB24.

- - - - -
b8a72022 by Steve Lhomme at 2023-09-24T19:57:38+00:00
png: request RGB24 without a mask when encoding

This corresponds to the chroma with the default RGB24M mask.

We probably want RGBA in case the source has alpha.

- - - - -
b1f59ee5 by Steve Lhomme at 2023-09-24T19:57:38+00:00
jpeg: decode as RGB24 without a mask

This corresponds to the default RGB24M mask.

- - - - -
3c25d09d by Steve Lhomme at 2023-09-24T19:57:38+00:00
bgp: decode as RGB24 without a mask

This corresponds to the default RGB24M mask.

- - - - -
de4609be by Steve Lhomme at 2023-09-24T19:57:38+00:00
dmo: decoder into BGR24 without a mask

MEDIASUBTYPE_RGB24 corresponds to VLC_CODEC_BGR24

- - - - -
03463c27 by Steve Lhomme at 2023-09-24T19:57:38+00:00
avcodec: use RGB24 without a mask when encoding TIFF

Given the code below we accept a few chroma mapping, including AV_PIX_FMT_RGB24
which maps to VLC_CODEC_RGB24 regardless of endianness.

The libavcodec encoder does accept AV_PIX_FMT_RGB24, not AV_PIX_FMT_BGR24 [1].

[1] https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/tiffenc.c#l583

- - - - -
2f1524d5 by Steve Lhomme at 2023-09-24T19:57:38+00:00
rdp: use RGB24 without a mask

This corresponds to the default RGB24M mask.

- - - - -
54b05bc4 by Steve Lhomme at 2023-09-24T19:57:38+00:00
shm: use RGB24 without a mask

This corresponds to the default RGB24M mask.

- - - - -
36ab56cf by Steve Lhomme at 2023-09-24T19:57:38+00:00
vnc: use RGB24 without a mask

This corresponds to the default RGB24 mask.

- - - - -
f758b236 by Steve Lhomme at 2023-09-24T19:57:38+00:00
avcodec/fourcc: map RGB24/BGR24 to AV_CODEC_ID_RAWVIDEO

Just like VLC_CODEC_RGB24M.

- - - - -
7a8052be by Steve Lhomme at 2023-09-24T19:57:38+00:00
qt: handle VLC_CODEC_RGB24 like VLC_CODEC_RGB24M

It matches the default mask.

- - - - -
c7994015 by Steve Lhomme at 2023-09-24T19:57:38+00:00
libplacebo: handle RGB24/BGR24 chromas

If VLC_CODEC_RGB24M can be handled, these too.

- - - - -
4a84718d by Steve Lhomme at 2023-09-24T19:57:38+00:00
mft: map VLC_CODEC_BGR24 to MFVideoFormat_RGB24

In addition to VLC_CODEC_RGB24M. MFVideoFormat_RGB24 is equivalent to
D3DFMT_R8G8B8 [1]. It's not clear what byte order it's using but the 32-bit
variants are equivalent to BGR when used from DXGI [2]

[1] https://learn.microsoft.com/en-us/windows/win32/medfound/video-subtype-guids
[2] https://learn.microsoft.com/en-us/windows/win32/direct3d10/d3d10-graphics-programming-guide-resources-legacy-formats

- - - - -
aa39bd23 by Steve Lhomme at 2023-09-24T19:57:38+00:00
rv32: handle VLC_CODEC_BGR24

The mask is not handled but the Filter code suggest inverting RGB and BGR.

- - - - -
d5484378 by Steve Lhomme at 2023-09-24T19:57:38+00:00
video_filter: handle BGR24/RGB24 like RB24M in mask agnostic filters

- - - - -
6a09839f by Steve Lhomme at 2023-09-24T19:57:38+00:00
blend: handle RGB24/BGR24 like RGB24M

GetPackedRgbIndexes() will provide the proper masks.

- - - - -
37f22017 by Steve Lhomme at 2023-09-24T19:57:38+00:00
sepia: handle RGB24/BGR24 like RGB24M

GetPackedRgbIndexes() will provide the proper masks.

- - - - -
05e686c7 by Steve Lhomme at 2023-09-24T19:57:38+00:00
ball: handle VLC_CODEC_RGB24 like VLC_CODEC_RGB24M

It matches the default mask.

- - - - -
5d9516bc by Steve Lhomme at 2023-09-24T19:57:38+00:00
interop_sw: handle VLC_CODEC_RGB24 and VLC_CODEC_BGR24

VLC_CODEC_BGR24 can oonly be mapped if GL_BGR is defined.

- - - - -
86bc650a by Steve Lhomme at 2023-09-24T19:57:38+00:00
es_format: replace default VLC_CODEC_RGB24 with RGB24/BGR24 chromas

We don't need to keep the mask when we don't have to.

- - - - -
09fe358c by Steve Lhomme at 2023-09-24T19:57:38+00:00
fourcc: add common RGB16 chromas without a mask

- - - - -
2fb72742 by Steve Lhomme at 2023-09-24T19:57:38+00:00
avcodec/chroma: map common RGB16 formats to libavutil ones

They have the same definition

- - - - -
a061a88b by Steve Lhomme at 2023-09-24T19:57:38+00:00
avcodec/fourcc: map common RGB16 chromas to AV_CODEC_ID_RAWVIDEO

Just like RGB+x formats.

- - - - -
fe0efd3b by Steve Lhomme at 2023-09-24T19:57:38+00:00
fourcc: fallback to RGB565 instead of VLC_CODEC_RGB16 if possible

This will avoid using a mask..

The pp_RGB_fallback list suspiciously contains many times the same chroma.

- - - - -
9d808776 by Steve Lhomme at 2023-09-24T19:57:38+00:00
drm/fourcc: map 565 RGB chromas

The formats are little endian by default [1], but there may be big endian variants.

[1] https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/drm_fourcc.c

- - - - -
212f67c0 by Steve Lhomme at 2023-09-24T19:57:38+00:00
access/v4l2: map 16-bit chromas to VLC ones without a mask

The formats are mapped according to their description [1].

[1] https://www.kernel.org/doc/html/v4.15/media/uapi/v4l/pixfmt-packed-rgb.html

- - - - -
5f4b0123 by Steve Lhomme at 2023-09-24T19:57:38+00:00
dxgi_fmt: map DXGI_FORMAT_B5G6R5_UNORM to VLC_CODEC_BGR565LE

- - - - -
98cb6739 by Steve Lhomme at 2023-09-24T19:57:38+00:00
direct3d9: map D3DFMT_R5G6B5 to VLC_CODEC_RGB565LE

It is cleaner/safer than relying on masks.

- - - - -
9538a640 by Steve Lhomme at 2023-09-24T19:57:38+00:00
access/dshow: use VLC_CODEC_RGB565LE for MEDIASUBTYPE_RGB565

This is the proper type corresponding to MEDIASUBTYPE_RGB565 on Little-Endian [1].

[1] https://learn.microsoft.com/en-us/windows/win32/directshow/uncompressed-rgb-video-subtypes
"RGB 565 uses the following memory layout:

High-order byte:    Low-order byte:
R R R R R G G G     G G G B B B B B"

- - - - -
991cec5c by Steve Lhomme at 2023-09-24T19:57:38+00:00
neon/yuv_rgb: support VLC_CODEC_RGB565LE like VLC_CODEC_RGB16

It corresponds to VLC_CODEC_RGB16 with the "fixed" mask on Little-Endian.

- - - - -
b26837c5 by Steve Lhomme at 2023-09-24T19:57:38+00:00
mmal: map VLC_CODEC_RGB565BE to MMAL_ENCODING_RGB16

This corresponds to the mask selected with VLC_CODEC_RGB16. It also corresponds
to the V4L2_PIX_FMT_RGB565X mapping we use [1]

[1] https://github.com/6by9/v4l2_mmal/blob/6d808f8ef2def6dac7782bba976f3529cdc60673/v4l2_mmal.c#L160C15-L160C35

- - - - -
5910421f by Steve Lhomme at 2023-09-24T19:57:38+00:00
libplacebo: add support for VLC_CODEC_RGB565LE

It's the same chroma as the fixed VLC_CODEC_RGB16 on Little-Endian.
The mask was never used so it may or may not be what is expected.

- - - - -
3accdf5d by Steve Lhomme at 2023-09-24T19:57:38+00:00
libplacebo: support VLC_CODEC_RGB565LE instead of VLC_CODEC_RGB16 for SPU's

This is the format corresponding to the "fixed" mask on Little-Endian.
The mask is not actually used.

- - - - -
5a8147e6 by Steve Lhomme at 2023-09-24T19:57:38+00:00
fourcc: add common RGB15 chromas without a mask

- - - - -
94ecd856 by Steve Lhomme at 2023-09-24T19:57:38+00:00
avcodec/chroma: map common RGB15 formats to libavutil ones

They have the same definition

- - - - -
a7463cee by Steve Lhomme at 2023-09-24T19:57:38+00:00
demux/mp4: map 16-bit raw to VLC_CODEC_RGB555BE

In FFmpeg it's mapped to AV_PIX_FMT_RGB555BE [1] which corresponds
to our VLC_CODEC_RGB555BE.

[1] https://github.com/FFmpeg/FFmpeg/blob/27562bf0226b22b0dbc631f8177e17ef98028499/libavformat/movenc.c#L1743

- - - - -
179d1dfc by Steve Lhomme at 2023-09-24T19:57:38+00:00
access/dshow: use VLC_CODEC_RGB555LE for MEDIASUBTYPE_RGB555

This is the proper type corresponding to MEDIASUBTYPE_RGB555 on Little-Endian [1].

[1] https://learn.microsoft.com/en-us/windows/win32/directshow/uncompressed-rgb-video-subtypes
"RGB 555 uses the following memory layout:

High-order byte:    Low-order byte:
X R R R R R G G     G G G B B B B B"

- - - - -
342e1fdb by Steve Lhomme at 2023-09-24T19:57:38+00:00
screen/win32: output VLC_CODEC_BGR555LE instead of VLC_CODEC_RGB15

This corresponds to how the Windows player renders 15-bit/16-bit BI_RGB.

- - - - -
b0e478bd by Steve Lhomme at 2023-09-24T19:57:38+00:00
access/v4l2: map 15-bit RGB chromas to VLC ones without a mask

The formats are mapped according to their description [1].

We don't map the variants with 1 bit of alpha as we don't have such
chromas in VLC.

[1] https://www.kernel.org/doc/html/v4.15/media/uapi/v4l/pixfmt-packed-rgb.html

- - - - -
9bb1409b by Steve Lhomme at 2023-09-24T19:57:38+00:00
drm/fourcc: map 555 RGB chromas

The formats are little endian by default [1], but there may be big endian variants.
We don't have the variants where the unused bit is at the end. They also
don't exist in libavutil.

[1] https://github.com/torvalds/linux/blob/master/include/drm/drm_fourcc.h

- - - - -
dd671890 by Steve Lhomme at 2023-09-24T19:57:38+00:00
libplacebo: add support for VLC_CODEC_RGB555LE

It's the same chroma as the fixed VLC_CODEC_RGB15 on Little-Endian.
The mask was never used so it may or may not be what is expected.

- - - - -
0edfb95b by Steve Lhomme at 2023-09-24T19:57:38+00:00
libplacebo: support VLC_CODEC_RGB555LE instead of VLC_CODEC_RGB15 for SPU's

This is the format corresponding to the "fixed" mask on Little-Endian.

- - - - -
22e4fb9f by Steve Lhomme at 2023-09-24T19:57:38+00:00
direct3d9: map D3DFMT_X1R5G5B5 to VLC_CODEC_RGB555LE

It is cleaner/safer than relying on masks.
This corresponds to the mask that was used on Little-Endian.

- - - - -
90d829bf by Steve Lhomme at 2023-09-24T19:57:38+00:00
wingdi: request VLC_CODEC_RGB555LE instead of VLC_CODEC_RGB16

The mask corresponds to 15-bit BI_RGB which is RGB555LE in AVI.

- - - - -
13977c66 by Steve Lhomme at 2023-09-24T19:57:38+00:00
fourcc: fallback to RGB555 instead of VLC_CODEC_RGB15

This will avoid using a mask..

The pp_RGB_fallback list suspiciously contains many times the same chroma.

- - - - -
8136e585 by Steve Lhomme at 2023-09-24T19:57:38+00:00
mft: always set the mask to 0

We don't get any chroma with a mask anymore.

- - - - -
71f603ce by Steve Lhomme at 2023-09-24T19:57:38+00:00
access/v4l2: remove empty ifdef

- - - - -
5870d8e3 by Steve Lhomme at 2023-09-24T19:57:38+00:00
d3d11_surface: set the RGB mask when setting the chroma

Later it will be assumed to be using these masks, it's better to set them
at the source.

- - - - -
8ab08c6b by Steve Lhomme at 2023-09-24T19:57:38+00:00
subpictures: ensure the RGB mask is zero

We are only provided a chroma without a mask. We should not receive a
chroma that requires a palette. If there is one without a palette we should
not use it because we don't really know the mask expected by the video output.
It could be RGBX, XBGR, etc.

- - - - -
14510ecb by Steve Lhomme at 2023-09-24T19:57:38+00:00
access/dshow: remove unused SetRGBMasks()

- - - - -
584bc555 by Steve Lhomme at 2023-09-24T19:57:38+00:00
direct3d11: reset the mask after we set the chroma

We don't use a mask anymore.

- - - - -
b111d3b3 by Steve Lhomme at 2023-09-24T19:57:38+00:00
dxgi_fmt: remove empty DxgiFormatMask()

- - - - -
b8a80d1c by Steve Lhomme at 2023-09-24T19:57:38+00:00
direct3d9: remove always null RGB mask

- - - - -
91bde00c by Steve Lhomme at 2023-09-24T19:57:38+00:00
access/v4l2: remove always null mask

- - - - -


30 changed files:

- include/vlc_fourcc.h
- modules/access/dshow/dshow.cpp
- modules/access/dshow/filter.cpp
- modules/access/screen/dxgi.cpp
- modules/access/screen/mac.c
- modules/access/screen/wayland.c
- modules/access/screen/win32.c
- modules/access/screen/xcb.c
- modules/access/shm.c
- modules/access/v4l2/video.c
- modules/access/vnc.c
- modules/codec/avcodec/chroma.c
- modules/codec/avcodec/fourcc.c
- modules/codec/avcodec/video.c
- modules/codec/bpg.c
- modules/codec/cdg.c
- modules/codec/dmo/dmo.c
- modules/codec/jpeg.c
- modules/codec/mft.cpp
- modules/codec/png.c
- modules/codec/xwd.c
- modules/demux/avi/bitmapinfoheader.h
- modules/demux/mp4/essetup.c
- modules/gui/qt/style/systempalette.cpp
- modules/hw/d3d11/d3d11_decoder.cpp
- modules/hw/d3d11/d3d11_surface.c
- modules/hw/mmal/mmal_picture.c
- modules/isa/arm/neon/yuv_rgb.c
- modules/stream_out/rtpfmt.c
- modules/video_chroma/chain.c


The diff was not included because it is too large.


View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/748cd53af31bce4d52501fde9d2f432ff9f57d77...91bde00c81978a2360e278764a619fa7835c66e4

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/748cd53af31bce4d52501fde9d2f432ff9f57d77...91bde00c81978a2360e278764a619fa7835c66e4
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