|| title->video_codec_param == AV_CODEC_ID_H264
|| title->video_codec_param == AV_CODEC_ID_VC1
|| title->video_codec_param == AV_CODEC_ID_WMV3
- || title->video_codec_param == AV_CODEC_ID_MPEG4 )
+ || title->video_codec_param == AV_CODEC_ID_MPEG4
+ || title->video_codec_param == AV_CODEC_ID_HEVC )
&& title->opaque_priv );
}
#define HB_DVD_READ_BUFFER_SIZE 2048
+#define HBALIGN(x, a) (((x)+(a)-1)&~((a)-1))
+
typedef struct hb_handle_s hb_handle_t;
typedef struct hb_hwd_s hb_hwd_t;
typedef struct hb_list_s hb_list_t;
*/
static int hb_dx_create_video_decoder( hb_va_dxva2_t *dxva2, int codec_id, const hb_title_t* fmt )
{
+ int surface_alignment;
dxva2->width = fmt->geometry.width;
dxva2->height = fmt->geometry.height;
- dxva2->surface_width = (fmt->geometry.width + 15) & ~15;
- dxva2->surface_height = (fmt->geometry.height + 15) & ~15;
+
switch( codec_id )
{
case AV_CODEC_ID_H264:
dxva2->surface_count = 16 + 1;
+ surface_alignment = 16;
+ break;
+ case AV_CODEC_ID_HEVC:
+ dxva2->surface_count = 16 + 1;
+ surface_alignment = 128;
+ break;
+ case AV_CODEC_ID_MPEG2VIDEO:
+ dxva2->surface_count = 2 + 1;
+ surface_alignment = 32;
break;
default:
dxva2->surface_count = 2 + 1;
+ surface_alignment = 16;
break;
}
+
+ dxva2->surface_width = HBALIGN(fmt->geometry.width, surface_alignment);
+ dxva2->surface_height = HBALIGN(fmt->geometry.height, surface_alignment);
+
LPDIRECT3DSURFACE9 surface_list[VA_DXVA2_MAX_SURFACE_COUNT];
if( FAILED( IDirectXVideoDecoderService_CreateSurface( dxva2->vs,
dxva2->surface_width,
static const GUID DXVA2_ModeVC1_B = { 0x1b81beA1, 0xa0c7, 0x11d3, {0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} };
static const GUID DXVA2_ModeVC1_C = { 0x1b81beA2, 0xa0c7, 0x11d3, {0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} };
static const GUID DXVA2_ModeVC1_D = { 0x1b81beA3, 0xa0c7, 0x11d3, {0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} };
+static const GUID DXVA2_ModeHEVC_VLD_Main = { 0x5b11d51b, 0x2f4c,0x4452, {0xbc, 0xc3, 0x09, 0xf2, 0xa1, 0x16, 0x0c, 0xc0} };
typedef struct
{
{ "VC-1 IDCT", &DXVA2_ModeVC1_C, 0 },
{ "VC-1 MoComp", &DXVA2_ModeVC1_B, 0 },
{ "VC-1 post processing", &DXVA2_ModeVC1_A, 0 },
+
+ { "DXVA2_ModeHEVC_VLD_Main", &DXVA2_ModeHEVC_VLD_Main, AV_CODEC_ID_HEVC },
{ NULL, NULL, 0 }
};