Skip to content

Commit

Permalink
Switch to qpu deinterlace and add option to allow it for HD video
Browse files Browse the repository at this point in the history
  • Loading branch information
popcornmix committed Sep 11, 2015
1 parent 6614a54 commit d99bd86
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
7 changes: 5 additions & 2 deletions OMXVideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ bool COMXVideo::PortSettingsChanged()

if(m_deinterlace || m_config.anaglyph)
{
bool advanced_deinterlace = port_image.format.video.nFrameWidth * port_image.format.video.nFrameHeight <= 576 * 720;
bool advanced_deinterlace = m_config.advanced_hd_deinterlace || port_image.format.video.nFrameWidth * port_image.format.video.nFrameHeight <= 576 * 720;

if (m_config.anaglyph != OMX_ImageFilterAnaglyphNone || !advanced_deinterlace)
{
Expand Down Expand Up @@ -280,8 +280,11 @@ bool COMXVideo::PortSettingsChanged()
}
else
{
image_filter.nNumParams = 1;
image_filter.nNumParams = 4;
image_filter.nParams[0] = 3;
image_filter.nParams[1] = 0; // default frame interval
image_filter.nParams[2] = 0; // half framerate
image_filter.nParams[3] = 1; // use qpus
if (!advanced_deinterlace)
image_filter.eImageFilter = OMX_ImageFilterDeInterlaceFast;
else
Expand Down
2 changes: 2 additions & 0 deletions OMXVideo.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class OMXVideoConfig
CRect dst_rect;
float display_aspect;
EDEINTERLACEMODE deinterlace;
bool advanced_hd_deinterlace;
OMX_IMAGEFILTERANAGLYPHTYPE anaglyph;
bool hdmi_clock_sync;
bool allow_mvc;
Expand All @@ -67,6 +68,7 @@ class OMXVideoConfig
dst_rect.SetRect(0, 0, 0, 0);
display_aspect = 0.0f;
deinterlace = VS_DEINTERLACEMODE_AUTO;
advanced_hd_deinterlace = false;
anaglyph = OMX_ImageFilterAnaglyphNone;
hdmi_clock_sync = false;
allow_mvc = false;
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Usage: omxplayer [OPTIONS] [FILE]
--nodeinterlace Force no deinterlacing
--nativedeinterlace let display handle interlace
--anaglyph type convert 3d to anaglyph
--advanced Allow advanced deinterlace for HD videos
-w --hw Hw audio decoding
-3 --3d mode Switch tv into 3d mode (e.g. SBS/TB)
-M --allow-mvc Allow decoding of both views of MVC stereo stream
Expand Down
5 changes: 5 additions & 0 deletions omxplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ int main(int argc, char *argv[])
const int native_deinterlace_opt = 0x20e;
const int display_opt = 0x20f;
const int alpha_opt = 0x210;
const int advanced_opt = 0x211;
const int http_cookie_opt = 0x300;
const int http_user_agent_opt = 0x301;

Expand All @@ -581,6 +582,7 @@ int main(int argc, char *argv[])
{ "nodeinterlace",no_argument, NULL, no_deinterlace_opt },
{ "nativedeinterlace",no_argument, NULL, native_deinterlace_opt },
{ "anaglyph", required_argument, NULL, anaglyph_opt },
{ "advanced", no_argument, NULL, advanced_opt },
{ "hw", no_argument, NULL, 'w' },
{ "3d", required_argument, NULL, '3' },
{ "allow-mvc", no_argument, NULL, 'M' },
Expand Down Expand Up @@ -683,6 +685,9 @@ int main(int argc, char *argv[])
case anaglyph_opt:
m_config_video.anaglyph = (OMX_IMAGEFILTERANAGLYPHTYPE)atoi(optarg);
break;
case advanced_opt:
m_config_video.advanced_hd_deinterlace = true;
break;
case 'w':
m_config_audio.hwdecode = true;
break;
Expand Down

0 comments on commit d99bd86

Please sign in to comment.