Steve Lhomme
ec1111d07a
avcodec/chroma: map AV_PIX_FMT_NV24/42 to VLC_CODEC_NV24/42
Added in 5de4f1d871d60886b9630531fa8c34cad13cc9dd, aka libavutil 56.27.100.
We require libavutil 56.31.100.
1 year ago
Rémi Denis-Courmont
33a268bd65
avcodec: rectify mapping to RGB8 chroma
libavutil defines it as:
packed RGB 3:3:2, 8bpp, (msb)3R 3G 2B(lsb)
which corresponds to VLC's `R332`, not `R233`.
Tested with the Linux `vivid` driver.
7 months ago
Rémi Denis-Courmont
964a38912e
avcodec: bind NV16 chroma
7 months ago
Thomas Guillem
7d9e993e7f
avcodec: chroma: add a function to expose the table
1 year ago
Ilkka Ollakka
931e9f34ce
codec/demux: pump libavcodec/libavformat requirements
pump to ffmpeg 4.2
Debian stable is in 5.1-series and ubuntu Focal (20.04 LTS) is in 4.2 version
2 years ago
Steve Lhomme
f504ce6c4f
avcodec: use LIBAVUTIL_VERSION_CHECK instead version value
This is how it used to be when libav was also supported.
2 years ago
Steve Lhomme
60c58cee77
avcodec/chroma: map VLC_CODEC_VUYA to AV_PIX_FMT_VUYX
It is (at least) part of FFmpeg 6.1 and can be used as DXVA/QSV output.
2 years ago
François Cartegnie
40d8a9fadc
fourcc: add VLC_CODEC_XYZ_12L
2 years ago
François Cartegnie
a805ab05b7
fourcc: rename and differentiate XYZ12 by endianess
2 years ago
Alexandre Janniaux
823d7c3ae5
avcodec: chroma: fix for-loop condition
The previous `!= 0` was kept when the replacement to ARRAY_SIZE() was
done. Since <BOOL> != 0 evaluates to <BOOL>, no regression happened
because of that oversight.
Forgotten from 1eed0681cd .
2 years ago
Steve Lhomme
6906faa15f
fourcc: rename VLC_CODEC_RGBA10 to VLC_CODEC_RGBA10LE
As said in bf2f64958b , it's supposed
to match DXGI_FORMAT_R10G10B10A2_UNORM which is in fact
ABGR [1] in memory order. We declare it like 15/16-bit RGB.
We can't map it to D3D11 opaque BGRA/RGBA directly.
[1] https://learn.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format#portable-coding-for-endian-independence
3 years ago
Steve Lhomme
5c153bf0b1
avcodec/chroma: provide the UV flipped status in FindFfmpegChroma()
Only VLC_CODEC_YV12 has the U/V planes swapped compared to the libavutil
chroma. We need to let the caller know when mapping VLC chromas to
FFmpeg ones.
3 years ago
Steve Lhomme
d3c43f2b4f
fourcc: remove read-only VLC_CODEC_YV9
3 years ago
Steve Lhomme
1eed0681cd
avcodec/chroma: use ARRAY_SIZE to iterate the chroma list
This should be slightly faster than dereferencing the table fourcc.
And it makes the table 1 item smaller!
3 years ago
Steve Lhomme
2b9e31f9d0
avcodec/chroma: simplify headers
We only need the VLC FourCC's and the libavutil enum.
3 years ago
Steve Lhomme
b44d2c4bcd
avcodec/chroma: remove unused RGB macros
3 years ago
Steve Lhomme
e380c2a826
avcodec/chroma: replace GetFfmpegChroma() calls with FindFfmpegChroma()
We may map libavutil chromas with range to VLC+range, but we should not map to
libavutil chromas+range as these chromas are deprecated.
3 years ago
Steve Lhomme
5debcc34b3
avcodec/chroma: map AV_PIX_FMT_YUVJ411P
It's a full range VLC_CODEC_I411.
3 years ago
Steve Lhomme
a30cd2a013
avcodec/chroma: remap full range YUV to chroma+range
The AV_PIX_FMT_YUVJxxx chromas are deprecated and might be removed someday.
We can map these values to VLC chromas+range, but not the other way
around.
3 years ago
Steve Lhomme
a0a06750e2
avcodec/chroma: remove unused FindVlcChroma()
3 years ago
Steve Lhomme
3317a0e9e5
avcodec/chroma: mark the full range chromas
3 years ago
Steve Lhomme
47af51ec58
vlc_es: remove always 0 video_format_t RGB mask
3 years ago
Steve Lhomme
a4280d3493
vlc_es: remove empty video_format_FixRgb()
3 years ago
Steve Lhomme
f10359c14e
avcodec/chroma: get rid of empty masks
They are always 0.
3 years ago
Steve Lhomme
a8893dd50d
vlc_fourcc: remove read-only VLC_CODEC_RGB16
It's never used as such. Only 3 masks existed and they have been replaced with
VLC_CODEC_RGB565BE, VLC_CODEC_RGB565LE and VLC_CODEC_BGR565LE.
3 years ago
Steve Lhomme
3dce515cef
vlc_fourcc: remove read-only VLC_CODEC_RGB15
3 years ago
Steve Lhomme
eaf149b7f8
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.
3 years ago
Steve Lhomme
92d89bc3b3
vlc_fourcc: remove read-only VLC_CODEC_RGB24M
It's never used as such. Only 2 masks existed and they have been replaced with
VLC_CODEC_RGB24 and VLC_CODEC_BGR24.
3 years ago
Steve Lhomme
94ecd856db
avcodec/chroma: map common RGB15 formats to libavutil ones
They have the same definition
3 years ago
Steve Lhomme
2fb72742ca
avcodec/chroma: map common RGB16 formats to libavutil ones
They have the same definition
3 years ago
Steve Lhomme
afd5c83fba
avcodec/chroma: map common RGB24 formats to libavutil ones
They have the same definition
3 years ago
Steve Lhomme
0127ad54f9
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.
3 years ago
Steve Lhomme
6c875b1f65
fourcc: remove read-only VLC_CODEC_RGB8
It's never used anymore at any source.
3 years ago
Steve Lhomme
2208f418ae
avcodec/chroma: map common RGB8 formats to libavutil ones
They have the same definition
3 years ago
Steve Lhomme
b8e72e4ce4
avcodec/chroma: map VLC_CODEC_XYZ12 to AV_PIX_FMT_XYZ12BE
It's not an RGB chroma and has a fixed memory layout as Big-Endian
according to the string in fourcc_list.
3 years ago
Steve Lhomme
1a8dc3fcbf
avcodec/chroma: remove mapping to non VLC chromas
If VLC doesn't have a chroma for it, that means it won't be handled later.
We should not pretend to map it.
3 years ago
Steve Lhomme
824506e8f2
avcodec/chroma: use the proper vlc_fourcc_t for 'Y','V','U','9'
It does match the description for AV_PIX_FMT_YUV410P.
3 years ago
Steve Lhomme
1b0c143bfe
avcodec/chroma. map RGB+x formats to RGB+0 chromas
The libavutil formats will always be mapped to the VLC chromas without
a mask. VLC_CODEC_RGB32 will still be masked to libavutil chromas when
the mask matches or loosely if no mask matches.
3 years ago
Steve Lhomme
a309fb4c10
avcodec/chroma: prioritize RGB mapping with the same mask
If the mask corresponds exactly, we have an exact match. If the RGB source
has a mask but none of the RGB mapping uses the same mask, we map to
a close RGB format with a different mask.
It's better than using the first VLC_CODEC_RGBxx in the list if there's
one corresponding to the exact match.
Another option would be to move the VLC_RGB_ES() calls at the end of the
list.
3 years ago
Steve Lhomme
38ad102b2c
avcodec: return the AVPixelFormat in GetFfmpegChroma()
No need to use a pointer and an error code for that.
3 years ago
Francois Cartegnie
081a0e62a0
codec: avcodec: fix mask mappings for 32 bits RGB
The macros can not handle alpha channel properly,
as it does not only requires reassigning channels
but shifting.
Mapping to/from RGB32 also loses alpha information.
We can not rely on AV native macros for this and
need to declare chroma with fixed alpha position
Could also modify the macro to add left or right
shifts parameters and even less readable for 2 chromas.
3 years ago
Steve Lhomme
e2d4c69d79
avcodec: map VLC_CODEC_RGBA10 to AV_PIX_FMT_X2BGR10
This is a RGB format with 10 bits per color.
3 years ago
Rémi Denis-Courmont
b2cc43dc45
avcodec: add ABGR
4 years ago
Rémi Denis-Courmont
63a44e8d14
avcodec: make P010 and P016 little endian
Every involved modules other than FFmpeg's assume little endian (e.g.
VA, which derives from DRM which uses little endian always), or only
works on little endian systems at all.
4 years ago
Rémi Denis-Courmont
04b5f47748
swscale: fix compilation without avcodec
Fixes #26678 .
4 years ago
Marvin Scholz
dc20caa8e0
avutil: remove LIBAVUTIL_VERSION_MICRO >= 100 checks
This check was used to distinguish FFmpeg and libav, as libav support
is removed now, this is no longer necessary.
4 years ago
Zhao Zhili
51c3da8b00
avcodec: map VLC_CODEC_YUVA_444_12
5 years ago
Steve Lhomme
c78f7ac90f
avcodec: always use AVPixelFormat instead of PixelFormat
AVPixelFormat was introduced in libavutil 51.42.0 we require 55.9.0.
5 years ago
Steve Lhomme
b6f3628fa2
avcodec: use enum AVPixelFormat where a pixel format is expected
5 years ago
Tristan Matthews
9d908d75a7
avcodec: map VLC_CODEC_GBRA_PLANAR
Fixes #23216
6 years ago