Skip to content

Commit

Permalink
[vaapi] Support running progressive frames through the vpp deinterlacer
Browse files Browse the repository at this point in the history
PAFF video requires to run all frames through the deinterlace filter
even if they are progressive. In that case, do not set any field flags
and only run one postprocessing step, producing one output picture.
  • Loading branch information
pkerling committed Mar 28, 2019
1 parent 7db304b commit 03559d3
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp
Expand Up @@ -2588,7 +2588,7 @@ bool CVppPostproc::Filter(CVaapiProcessedPicture &outPic)

// skip deinterlacing cycle if requested
if ((m_step == 1) &&
((outPic.DVDPic.iFlags & DVD_CODEC_CTRL_SKIPDEINT) || (m_vppMethod == VS_INTERLACEMETHOD_NONE)))
((outPic.DVDPic.iFlags & DVD_CODEC_CTRL_SKIPDEINT) || !(outPic.DVDPic.iFlags & DVP_FLAG_INTERLACED) || (m_vppMethod == VS_INTERLACEMETHOD_NONE)))
{
Advance();
return false;
Expand Down Expand Up @@ -2643,17 +2643,21 @@ bool CVppPostproc::Filter(CVaapiProcessedPicture &outPic)
if (m_vppMethod != VS_INTERLACEMETHOD_NONE)
{
unsigned int flags = 0;
if (it->DVDPic.iFlags & DVP_FLAG_TOP_FIELD_FIRST)
flags = 0;
else
flags = VA_DEINTERLACING_BOTTOM_FIELD_FIRST | VA_DEINTERLACING_BOTTOM_FIELD;

if (m_step)
if (it->DVDPic.iFlags & DVP_FLAG_INTERLACED)
{
if (flags & VA_DEINTERLACING_BOTTOM_FIELD)
flags &= ~VA_DEINTERLACING_BOTTOM_FIELD;
if (it->DVDPic.iFlags & DVP_FLAG_TOP_FIELD_FIRST)
flags = 0;
else
flags |= VA_DEINTERLACING_BOTTOM_FIELD;
flags = VA_DEINTERLACING_BOTTOM_FIELD_FIRST | VA_DEINTERLACING_BOTTOM_FIELD;

if (m_step)
{
if (flags & VA_DEINTERLACING_BOTTOM_FIELD)
flags &= ~VA_DEINTERLACING_BOTTOM_FIELD;
else
flags |= VA_DEINTERLACING_BOTTOM_FIELD;
}
}
if (!CheckSuccess(vaMapBuffer(m_config.dpy, m_filter, (void**) &filterParams), "vaMapBuffer"))
{
Expand Down

0 comments on commit 03559d3

Please sign in to comment.