directx_va: adjust the Xbox constraints

It can't handle 4K aligned to 128 but is fine when aligned to 16.
This commit is contained in:
Steve Lhomme 2018-02-19 12:39:10 +01:00
parent a15bca0d4b
commit 1a5ea023b3
4 changed files with 9 additions and 5 deletions

View File

@ -378,7 +378,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
if (err!=VLC_SUCCESS)
goto error;
err = directx_va_Setup(va, &sys->dx_sys, ctx, fmt);
err = directx_va_Setup(va, &sys->dx_sys, ctx, fmt, isXboxHardware(sys->d3d_dev.d3ddevice));
if (err != VLC_SUCCESS)
goto error;

View File

@ -283,7 +283,7 @@ char *directx_va_GetDecoderName(const GUID *guid)
/* */
int directx_va_Setup(vlc_va_t *va, directx_sys_t *dx_sys, const AVCodecContext *avctx,
const es_format_t *fmt)
const es_format_t *fmt, int flag_xbox)
{
/* */
if (FindVideoServiceConversion(va, dx_sys, fmt, avctx)) {
@ -306,7 +306,11 @@ int directx_va_Setup(vlc_va_t *va, directx_sys_t *dx_sys, const AVCodecContext *
case AV_CODEC_ID_HEVC:
/* the HEVC DXVA2 spec asks for 128 pixel aligned surfaces to ensure
all coding features have enough room to work with */
surface_alignment = 128;
/* On the Xbox 1/S, the decoder cannot do 4K aligned to 128 but is OK with 64 */
if (flag_xbox)
surface_alignment = 16;
else
surface_alignment = 128;
surface_count += 16;
break;
case AV_CODEC_ID_H264:

View File

@ -80,7 +80,7 @@ typedef struct
int directx_va_Open(vlc_va_t *, directx_sys_t *);
void directx_va_Close(vlc_va_t *, directx_sys_t *);
int directx_va_Setup(vlc_va_t *, directx_sys_t *, const AVCodecContext *avctx, const es_format_t *);
int directx_va_Setup(vlc_va_t *, directx_sys_t *, const AVCodecContext *avctx, const es_format_t *, int flag_xbox);
char *directx_va_GetDecoderName(const GUID *guid);
#endif /* AVCODEC_DIRECTX_VA_H */

View File

@ -315,7 +315,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
if (err!=VLC_SUCCESS)
goto error;
err = directx_va_Setup(va, &sys->dx_sys, ctx, fmt);
err = directx_va_Setup(va, &sys->dx_sys, ctx, fmt, 0);
if (err != VLC_SUCCESS)
goto error;