MythTV  master
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MythDeinterlacer Class Reference

Handles software based deinterlacing of video frames. More...

#include <mythdeinterlacer.h>

Collaboration diagram for MythDeinterlacer:
Collaboration graph
[legend]

Public Member Functions

 MythDeinterlacer ()=default
 
 ~MythDeinterlacer ()
 
void Filter (VideoFrame *Frame, FrameScanType Scan, bool Force=false)
 Deinterlace Frame if needed. More...
 

Private Member Functions

bool Initialise (VideoFrame *Frame, MythDeintType Deinterlacer, bool DoubleRate, bool TopFieldFirst)
 Initialise deinterlacing using the given MythDeintType. More...
 
void Cleanup (void)
 

Private Attributes

VideoFrameType m_inputType { FMT_NONE }
 
AVPixelFormat m_inputFmt { AV_PIX_FMT_NONE }
 
int m_width { 0 }
 
int m_height { 0 }
 
MythDeintType m_deintType { DEINT_NONE }
 
bool m_doubleRate { false }
 
bool m_topFirst { true }
 
MythAVFrame m_frame { }
 
AVFilterGraph * m_graph { nullptr }
 
AVFilterContext * m_source { nullptr }
 
AVFilterContext * m_sink { nullptr }
 
VideoFramem_bobFrame { nullptr }
 
SwsContext * m_swsContext { nullptr }
 

Detailed Description

Handles software based deinterlacing of video frames.

Based upon the deinterlacing preferences passed in through the video frame, MythDeinterlacer will deinterlace the given frame using the appropriate quality and using single or double frame rate.

The following deinterlacers are used: Basic - onefield/bob using libswcale Medium - libavfilter's yadif High - libavfilter's bwdif

Note
libavfilter frame doubling filters expect frames to be presented in the correct order and will break if they do not receive a frame followed by the retrieval of 2 'fields'.
There is no support for deinterlacig NV12 frame formats in libavilter

Definition at line 16 of file mythdeinterlacer.h.

Constructor & Destructor Documentation

◆ MythDeinterlacer()

MythDeinterlacer::MythDeinterlacer ( )
default

◆ ~MythDeinterlacer()

MythDeinterlacer::~MythDeinterlacer ( )

Definition at line 30 of file mythdeinterlacer.cpp.

Member Function Documentation

◆ Filter()

void MythDeinterlacer::Filter ( VideoFrame Frame,
FrameScanType  Scan,
bool  Force = false 
)

Deinterlace Frame if needed.

Software deinterlacing is the choice of last resort i.e. shader or driver based deinterlacers are always preferred if available.

If using double rate deinterlacing, the frame must be presented in the correct order i.e. kScan_Interlaced followed by kScan_Intr2ndField.

The appropriate field to deinterlace is determined by the scan type and the flags for interlaced_reverse and top_field_first in VideoFrame.

libavilter's must be recreated if any parameter is changed as there is no method to select the field 'on the fly'.

Parameters
ForceSet to true to ensure a deinterlaced frame is always returned. Used for preview images.

Definition at line 52 of file mythdeinterlacer.cpp.

Referenced by MythPlayer::GetScreenGrabAtFrame(), and MythVideoOutputOpenGL::ProcessFrame().

◆ Initialise()

bool MythDeinterlacer::Initialise ( VideoFrame Frame,
MythDeintType  Deinterlacer,
bool  DoubleRate,
bool  TopFieldFirst 
)
private

Initialise deinterlacing using the given MythDeintType.

Definition at line 287 of file mythdeinterlacer.cpp.

Referenced by Filter().

◆ Cleanup()

void MythDeinterlacer::Cleanup ( void  )
inlineprivate

Definition at line 266 of file mythdeinterlacer.cpp.

Referenced by Filter(), Initialise(), and ~MythDeinterlacer().

Member Data Documentation

◆ m_inputType

VideoFrameType MythDeinterlacer::m_inputType { FMT_NONE }
private

Definition at line 33 of file mythdeinterlacer.h.

Referenced by Filter(), and Initialise().

◆ m_inputFmt

AVPixelFormat MythDeinterlacer::m_inputFmt { AV_PIX_FMT_NONE }
private

Definition at line 34 of file mythdeinterlacer.h.

Referenced by Filter(), and Initialise().

◆ m_width

int MythDeinterlacer::m_width { 0 }
private

Definition at line 35 of file mythdeinterlacer.h.

Referenced by Filter(), and Initialise().

◆ m_height

int MythDeinterlacer::m_height { 0 }
private

Definition at line 36 of file mythdeinterlacer.h.

Referenced by Filter(), and Initialise().

◆ m_deintType

MythDeintType MythDeinterlacer::m_deintType { DEINT_NONE }
private

Definition at line 37 of file mythdeinterlacer.h.

Referenced by Cleanup(), Filter(), and Initialise().

◆ m_doubleRate

bool MythDeinterlacer::m_doubleRate { false }
private

Definition at line 38 of file mythdeinterlacer.h.

Referenced by Filter(), and Initialise().

◆ m_topFirst

bool MythDeinterlacer::m_topFirst { true }
private

Definition at line 39 of file mythdeinterlacer.h.

Referenced by Filter(), and Initialise().

◆ m_frame

MythAVFrame MythDeinterlacer::m_frame { }
private

Definition at line 40 of file mythdeinterlacer.h.

Referenced by Filter().

◆ m_graph

AVFilterGraph* MythDeinterlacer::m_graph { nullptr }
private

Definition at line 41 of file mythdeinterlacer.h.

Referenced by Cleanup(), Filter(), and Initialise().

◆ m_source

AVFilterContext* MythDeinterlacer::m_source { nullptr }
private

Definition at line 42 of file mythdeinterlacer.h.

Referenced by Filter(), and Initialise().

◆ m_sink

AVFilterContext* MythDeinterlacer::m_sink { nullptr }
private

Definition at line 43 of file mythdeinterlacer.h.

Referenced by Filter(), and Initialise().

◆ m_bobFrame

VideoFrame* MythDeinterlacer::m_bobFrame { nullptr }
private

Definition at line 44 of file mythdeinterlacer.h.

Referenced by Cleanup(), and Filter().

◆ m_swsContext

SwsContext* MythDeinterlacer::m_swsContext { nullptr }
private

Definition at line 45 of file mythdeinterlacer.h.

Referenced by Cleanup(), Filter(), and Initialise().


The documentation for this class was generated from the following files: