Steve Lhomme
468ef3103f
directx_va: fix warning when DXVA2 is not available
The defines come from detection in configure.ac so they are not defined
when the header is not found.
2 years ago
Steve Lhomme
c608b70a8f
avcodec: include winapifamily.h when using WINAPI_FAMILY_PARTITION()
2 years ago
Steve Lhomme
823d70123c
modules/win32: document why we need vlc_codecs.h
Formatting string or matching a VLC FourCC.
2 years ago
Steve Lhomme
54e045e4e1
modules/win32: remove unused vlc_codecs.h
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
d6ffd5bc35
subpicture: use helper functions for vlc_spu_regions
3 years ago
Steve Lhomme
3d610be9f0
subpicture: use vlc_list for regions
This separates the region type from its container.
The drawback is that it makes the structure bigger. But we get plenty
of helpers. There might be other containers suitable but we use a mix of
append and prepend.
3 years ago
Steve Lhomme
ce7efde1d9
avcodec/subtitle: log the unknown subtitle type
If there's a text type we should be able to handle it.
3 years ago
Steve Lhomme
adeb34f614
avcodec/encoder: fix FourCC logging
Introduced in 5c153bf0b1
3 years ago
Steve Lhomme
b8ff1cfccd
dxva2: use D3D9FormatFourcc to find matching D3DFORMAT
3 years ago
Steve Lhomme
2e582357c1
d3d9_fmt: share the d3d9_format_t structure
3 years ago
Steve Lhomme
fecebe1588
avcodec: fix crash when AV1 hardware decoder fails
If InitVideoDecCommon() fails, it's already cleaning the decoder,
release the context and freeing p_sys.
We must not do anything and just return the error.
3 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
febc89b811
avcodec/video: get the VLC chroma with the color range
This will be used later.
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
a061a88bce
avcodec/fourcc: map common RGB16 chromas to AV_CODEC_ID_RAWVIDEO
Just like RGB+x formats.
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
f758b236c6
avcodec/fourcc: map RGB24/BGR24 to AV_CODEC_ID_RAWVIDEO
Just like VLC_CODEC_RGB24M.
3 years ago
Steve Lhomme
03463c279b
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
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
400d76e941
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.
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
e32e6ef12e
avcodec/fourcc: map RGB8 formats to AV_CODEC_ID_RAWVIDEO
Just like VLC_CODEC_RGB8+mask.
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
3e5f2e5d20
codec: use the i_level as a bits per pixel when i_profile is -1
Some decoders may need that information to decode properly. The information
is provided by a few demuxers.
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
2be2c76089
dxva2: don't set the mask anymore
This is not necessary since 10f2ca94d8 .
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
a427c3c9dd
avcodec: set bits_per_coded_sample using vlc_fourcc_GetChromaBPP()
bits_per_coded_sample should be 15 for VLC_CODEC_RGB15 which is what
this function returns.
3 years ago
Steve Lhomme
10f2ca94d8
avcodec: reset the output mask with VA after we reset the chroma
If the chroma really needs a mask, it should set it. But when we reset the
chroma we should reset the mask as well.
3 years ago
Steve Lhomme
c5a1d28ae5
avcodec: use the default RGB mask for temporary RGB32
Although with push we should not need this hack anymore. Especially if we
assume we have to use the palette from each picture and not the format.
3 years ago