[vlc-commits] [Git][videolan/vlc][master] 2 commits: d3d11_fmt: allow selecting a format with any alpha value
Steve Lhomme (@robUx4)
gitlab at videolan.org
Wed Apr 3 16:00:16 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
dac3cffc by Steve Lhomme at 2024-04-03T15:31:12+00:00
d3d11_fmt: allow selecting a format with any alpha value
The decoder may end up using a format with alpha even if it doesn't use it.
- - - - -
72f534b2 by Steve Lhomme at 2024-04-03T15:31:12+00:00
d3d11va: allow decoder output with alpha values
Only for formats that meet all the bit depth and chroma sub-sampling.
- - - - -
3 changed files:
- modules/codec/avcodec/d3d11va.c
- modules/video_chroma/d3d11_fmt.cpp
- modules/video_chroma/d3d11_fmt.h
Changes:
=====================================
modules/codec/avcodec/d3d11va.c
=====================================
@@ -396,8 +396,9 @@ static int DxSetupOutput(vlc_va_t *va, const directx_va_mode_t *mode, const vide
int idx = 0;
const d3d_format_t *decoder_format;
UINT supportFlags = D3D11_FORMAT_SUPPORT_DECODER_OUTPUT | D3D11_FORMAT_SUPPORT_SHADER_LOAD;
+ // enough sub-sampling+bit depth, with any alpha
decoder_format = FindD3D11Format( va, sys->d3d_dev, 0, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT,
- mode->bit_depth, mode->log2_chroma_h+1, mode->log2_chroma_w+1, 0,
+ mode->bit_depth, mode->log2_chroma_h+1, mode->log2_chroma_w+1, -1,
DXGI_CHROMA_GPU, supportFlags );
if (decoder_format == NULL)
// other chroma sub-sampling
=====================================
modules/video_chroma/d3d11_fmt.cpp
=====================================
@@ -744,7 +744,7 @@ const d3d_format_t *(FindD3D11Format)(vlc_object_t *o,
uint8_t bits_per_channel,
uint8_t widthDenominator,
uint8_t heightDenominator,
- uint8_t alpha_bits,
+ int alpha_bits,
int cpu_gpu,
UINT supportFlags)
{
@@ -766,7 +766,7 @@ const d3d_format_t *(FindD3D11Format)(vlc_object_t *o,
continue;
if (heightDenominator && heightDenominator < output_format->heightDenominator)
continue;
- if (alpha_bits && output_format->bitsForAlpha < alpha_bits)
+ if (alpha_bits > 0 && output_format->bitsForAlpha < alpha_bits)
continue;
if (alpha_bits == 0 && output_format->bitsForAlpha != 0)
continue;
=====================================
modules/video_chroma/d3d11_fmt.h
=====================================
@@ -197,7 +197,7 @@ const d3d_format_t *FindD3D11Format(vlc_object_t *,
uint8_t bits_per_channel,
uint8_t widthDenominator,
uint8_t heightDenominator,
- uint8_t alpha_bits,
+ int alpha_bits,
int cpu_gpu,
UINT supportFlags);
#define FindD3D11Format(a,b,c,d,e,f,g,h,i,j) \
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6f115bf3597ecbdedc11f9e9fbd923b48eddbf11...72f534b24eb017e4b128622b59b9b895f124f7a7
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6f115bf3597ecbdedc11f9e9fbd923b48eddbf11...72f534b24eb017e4b128622b59b9b895f124f7a7
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