Skip to content

Commit

Permalink
VAAPI: Use HEVC acceleration (ffmpeg 2.8+)
Browse files Browse the repository at this point in the history
  • Loading branch information
fritsch committed Aug 26, 2015
1 parent a088d22 commit a827bf6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp
Expand Up @@ -564,6 +564,15 @@ bool CDecoder::Open(AVCodecContext* avctx, AVCodecContext* mainctx, const enum P
}
break;
}
#if VA_CHECK_VERSION(0,38,0)
case AV_CODEC_ID_HEVC:
{
profile = VAProfileHEVCMain;
if (!m_vaapiConfig.context->SupportsProfile(profile))
return false;
break;
}
#endif
case AV_CODEC_ID_WMV3:
profile = VAProfileVC1Main;
if (!m_vaapiConfig.context->SupportsProfile(profile))
Expand All @@ -586,14 +595,16 @@ bool CDecoder::Open(AVCodecContext* avctx, AVCodecContext* mainctx, const enum P
return false;
}

if(avctx->codec_id == AV_CODEC_ID_H264)
if (avctx->codec_id == AV_CODEC_ID_H264)
{
m_vaapiConfig.maxReferences = avctx->refs;
if (m_vaapiConfig.maxReferences > 16)
m_vaapiConfig.maxReferences = 16;
if (m_vaapiConfig.maxReferences < 5)
m_vaapiConfig.maxReferences = 5;
}
else if (avctx->codec_id == AV_CODEC_ID_HEVC)
m_vaapiConfig.maxReferences = 16;
else
m_vaapiConfig.maxReferences = 2;

Expand Down

0 comments on commit a827bf6

Please sign in to comment.