Skip to content

Commit

Permalink
ADD: ffmpeg deinterlace option + call yadif by its name
Browse files Browse the repository at this point in the history
  • Loading branch information
koying committed Apr 13, 2016
1 parent 66cfed7 commit d957910
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 14 deletions.
9 changes: 7 additions & 2 deletions addons/resource.language.en_gb/resources/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -7972,7 +7972,7 @@ msgstr ""

#: xbmc/video/dialogs/GUIDialogVideoSettings.cpp
msgctxt "#16020"
msgid "Deinterlace"
msgid "Yadif"
msgstr ""

#: xbmc/video/dialogs/GUIDialogVideoSettings.cpp
Expand Down Expand Up @@ -8344,7 +8344,12 @@ msgctxt "#16335"
msgid "IMX - Fast motion (double)"
msgstr ""

#empty strings from id 16336 to 16399
#: xbmc/video/dialogs/GUIDialogVideoSettings.cpp
msgctxt "#16336"
msgid "Software - FFmpeg"
msgstr ""

#empty strings from id 16337 to 16399

#: xbmc/video/dialogs/GUIDialogVideoSettings.cpp
msgctxt "#16400"
Expand Down
16 changes: 10 additions & 6 deletions xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3295,12 +3295,16 @@ bool CLinuxRendererGLES::Supports(EINTERLACEMETHOD method)
return false;
}

#if !defined(TARGET_ANDROID) && (defined(__i386__) || defined(__x86_64__))
if(method == VS_INTERLACEMETHOD_DEINTERLACE
|| method == VS_INTERLACEMETHOD_DEINTERLACE_HALF
|| method == VS_INTERLACEMETHOD_SW_BLEND)
#if (defined(__i386__) || defined(__x86_64__))
if(method == VS_INTERLACEMETHOD_YADIF
|| method == VS_INTERLACEMETHOD_YADIF_HALF
|| method == VS_INTERLACEMETHOD_RENDER_BOB
|| method == VS_INTERLACEMETHOD_SW_FFMPEG
|| method == VS_INTERLACEMETHOD_SW_BLEND
|| method == VS_INTERLACEMETHOD_RENDER_BOB_INVERTED)
#else
if(method == VS_INTERLACEMETHOD_SW_BLEND
if(method == VS_INTERLACEMETHOD_SW_FFMPEG
|| method == VS_INTERLACEMETHOD_SW_BLEND
|| method == VS_INTERLACEMETHOD_RENDER_BOB
|| method == VS_INTERLACEMETHOD_RENDER_BOB_INVERTED)
#endif
Expand Down Expand Up @@ -3386,7 +3390,7 @@ EINTERLACEMETHOD CLinuxRendererGLES::AutoInterlaceMethod()
return VS_INTERLACEMETHOD_IMX_FASTMOTION;

#if !defined(TARGET_ANDROID) && (defined(__i386__) || defined(__x86_64__))
return VS_INTERLACEMETHOD_DEINTERLACE_HALF;
return VS_INTERLACEMETHOD_YADIF_HALF;
#else
return VS_INTERLACEMETHOD_RENDER_BOB;
#endif
Expand Down
2 changes: 2 additions & 0 deletions xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ unsigned int CDVDVideoCodecFFmpeg::SetFilters(unsigned int flags)
}
}

#if (defined(__i386__) || defined(__x86_64__))
if(flags & FILTER_DEINTERLACE_YADIF)
{
if(flags & FILTER_DEINTERLACE_HALFED)
Expand All @@ -424,6 +425,7 @@ unsigned int CDVDVideoCodecFFmpeg::SetFilters(unsigned int flags)

flags &= ~FILTER_DEINTERLACE_ANY | FILTER_DEINTERLACE_YADIF;
}
#endif

return flags;
}
Expand Down
11 changes: 9 additions & 2 deletions xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,9 +553,9 @@ void CDVDPlayerVideo::Process()

if (mDeintMode != VS_DEINTERLACEMODE_OFF)
{
if (mInt == VS_INTERLACEMETHOD_DEINTERLACE)
if (mInt == VS_INTERLACEMETHOD_YADIF)
mFilters = CDVDVideoCodec::FILTER_DEINTERLACE_ANY;
else if(mInt == VS_INTERLACEMETHOD_DEINTERLACE_HALF)
else if(mInt == VS_INTERLACEMETHOD_YADIF_HALF)
mFilters = CDVDVideoCodec::FILTER_DEINTERLACE_ANY | CDVDVideoCodec::FILTER_DEINTERLACE_HALFED;

if (mDeintMode == VS_DEINTERLACEMODE_AUTO && mFilters)
Expand Down Expand Up @@ -678,6 +678,13 @@ void CDVDPlayerVideo::Process()
sPostProcessType += g_advancedSettings.m_videoPPFFmpegDeint;
bPostProcessDeint = true;
}
else if(mInt == VS_INTERLACEMETHOD_SW_FFMPEG)
{
if (!sPostProcessType.empty())
sPostProcessType += ",";
sPostProcessType += "ffmpegdeint";
bPostProcessDeint = true;
}
}

if (CMediaSettings::GetInstance().GetCurrentVideoSettings().m_PostProcess)
Expand Down
6 changes: 4 additions & 2 deletions xbmc/settings/VideoSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ enum EINTERLACEMETHOD
VS_INTERLACEMETHOD_RENDER_BOB_INVERTED=5,
VS_INTERLACEMETHOD_RENDER_BOB=6,

VS_INTERLACEMETHOD_DEINTERLACE=7,
VS_INTERLACEMETHOD_YADIF=7,

VS_INTERLACEMETHOD_VDPAU_BOB=8,
VS_INTERLACEMETHOD_INVERSE_TELECINE=9,
Expand All @@ -55,7 +55,7 @@ enum EINTERLACEMETHOD
VS_INTERLACEMETHOD_VDPAU_TEMPORAL_HALF=13,
VS_INTERLACEMETHOD_VDPAU_TEMPORAL_SPATIAL=14,
VS_INTERLACEMETHOD_VDPAU_TEMPORAL_SPATIAL_HALF=15,
VS_INTERLACEMETHOD_DEINTERLACE_HALF=16,
VS_INTERLACEMETHOD_YADIF_HALF=16,
VS_INTERLACEMETHOD_DXVA_BOB = 17,
VS_INTERLACEMETHOD_DXVA_BEST = 18,
// VS_INTERLACEMETHOD_DXVA_ANY = 19, Legacy
Expand All @@ -75,6 +75,8 @@ enum EINTERLACEMETHOD
VS_INTERLACEMETHOD_IMX_FASTMOTION = 29,
VS_INTERLACEMETHOD_IMX_FASTMOTION_DOUBLE = 30,

VS_INTERLACEMETHOD_SW_FFMPEG = 31,

VS_INTERLACEMETHOD_MAX // do not use and keep as last enum value.
};

Expand Down
5 changes: 3 additions & 2 deletions xbmc/video/dialogs/GUIDialogVideoSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,10 @@ void CGUIDialogVideoSettings::InitializeSettings()
entries.push_back(std::make_pair(20129, VS_INTERLACEMETHOD_RENDER_WEAVE));
entries.push_back(std::make_pair(16022, VS_INTERLACEMETHOD_RENDER_BOB_INVERTED));
entries.push_back(std::make_pair(16021, VS_INTERLACEMETHOD_RENDER_BOB));
entries.push_back(std::make_pair(16020, VS_INTERLACEMETHOD_DEINTERLACE));
entries.push_back(std::make_pair(16036, VS_INTERLACEMETHOD_DEINTERLACE_HALF));
entries.push_back(std::make_pair(16020, VS_INTERLACEMETHOD_YADIF));
entries.push_back(std::make_pair(16036, VS_INTERLACEMETHOD_YADIF_HALF));
entries.push_back(std::make_pair(16324, VS_INTERLACEMETHOD_SW_BLEND));
entries.push_back(std::make_pair(16336, VS_INTERLACEMETHOD_SW_FFMPEG));
entries.push_back(std::make_pair(16314, VS_INTERLACEMETHOD_INVERSE_TELECINE));
entries.push_back(std::make_pair(16311, VS_INTERLACEMETHOD_VDPAU_TEMPORAL_SPATIAL));
entries.push_back(std::make_pair(16310, VS_INTERLACEMETHOD_VDPAU_TEMPORAL));
Expand Down

0 comments on commit d957910

Please sign in to comment.