Skip to content

Commit

Permalink
MMALRender: Allow advanced deinterlace with software decode
Browse files Browse the repository at this point in the history
Uses YUV420 directly which improves performance.
Requires updated firmware
  • Loading branch information
popcornmix committed Dec 1, 2016
1 parent e36ac2a commit 20fc1c7
Showing 1 changed file with 2 additions and 6 deletions.
Expand Up @@ -553,12 +553,8 @@ void CMMALRenderer::Run()
EINTERLACEMETHOD last_interlace_method = m_interlace_method; EINTERLACEMETHOD last_interlace_method = m_interlace_method;
EINTERLACEMETHOD interlace_method = CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod; EINTERLACEMETHOD interlace_method = CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod;
if (interlace_method == VS_INTERLACEMETHOD_AUTO) if (interlace_method == VS_INTERLACEMETHOD_AUTO)
{
interlace_method = VS_INTERLACEMETHOD_MMAL_ADVANCED; interlace_method = VS_INTERLACEMETHOD_MMAL_ADVANCED;
// avoid advanced deinterlace when using software decode and HD resolution
if (omvb->m_state == MMALStateFFDec && omvb->m_width * omvb->m_height > 720*576)
interlace_method = VS_INTERLACEMETHOD_MMAL_BOB;
}
bool interlace = (omvb->mmal_buffer->flags & MMAL_BUFFER_HEADER_VIDEO_FLAG_INTERLACED) ? true:false; bool interlace = (omvb->mmal_buffer->flags & MMAL_BUFFER_HEADER_VIDEO_FLAG_INTERLACED) ? true:false;


// advanced deinterlace requires 3 frames of context so disable when showing stills // advanced deinterlace requires 3 frames of context so disable when showing stills
Expand Down Expand Up @@ -1370,7 +1366,7 @@ bool CMMALRenderer::CheckConfigurationDeint(uint32_t width, uint32_t height, uin
m_deint_output->format->es->video.crop.height = height; m_deint_output->format->es->video.crop.height = height;
m_deint_output->format->es->video.width = ALIGN_UP(width, 32); m_deint_output->format->es->video.width = ALIGN_UP(width, 32);
m_deint_output->format->es->video.height = ALIGN_UP(height, 16); m_deint_output->format->es->video.height = ALIGN_UP(height, 16);
m_deint_output->format->encoding = advanced_deinterlace ? MMAL_ENCODING_YUVUV128 : MMAL_ENCODING_I420; m_deint_output->format->encoding = advanced_deinterlace && encoding == MMAL_ENCODING_OPAQUE ? MMAL_ENCODING_YUVUV128 : MMAL_ENCODING_I420;


status = mmal_port_format_commit(m_deint_output); status = mmal_port_format_commit(m_deint_output);
if (status != MMAL_SUCCESS) if (status != MMAL_SUCCESS)
Expand Down

0 comments on commit 20fc1c7

Please sign in to comment.