MythTV  master
mythdeinterlacer.h
Go to the documentation of this file.
1 #ifndef MYTHDEINTERLACER_H
2 #define MYTHDEINTERLACER_H
3 
4 // MythTV
5 #include "videoouttypes.h"
6 #include "mythavutil.h"
7 #include "videodisplayprofile.h"
8 
9 extern "C" {
10 #include "libavfilter/avfilter.h"
11 #include "libswscale/swscale.h"
12 }
13 
15 {
16  public:
17  MythDeinterlacer() = default;
19 
20  void Filter (VideoFrame *Frame, FrameScanType Scan,
21  VideoDisplayProfile *Profile, bool Force = false);
22 
23  private:
24  bool Initialise (VideoFrame *Frame, MythDeintType Deinterlacer,
25  bool DoubleRate, bool TopFieldFirst,
26  VideoDisplayProfile *Profile);
27  inline void Cleanup (void);
28  void OneField (VideoFrame *Frame, FrameScanType Scan);
29  void Blend (VideoFrame *Frame, FrameScanType Scan);
30  bool SetUpCache (VideoFrame *Frame);
31 
32  private:
33  Q_DISABLE_COPY(MythDeinterlacer)
34 
36  AVPixelFormat m_inputFmt { AV_PIX_FMT_NONE };
37  int m_width { 0 };
38  int m_height { 0 };
40  bool m_doubleRate { false };
41  bool m_topFirst { true };
43  AVFilterGraph* m_graph { nullptr };
44  AVFilterContext* m_source { nullptr };
45  AVFilterContext* m_sink { nullptr };
46  VideoFrame* m_bobFrame { nullptr };
47  SwsContext* m_swsContext { nullptr };
48  long long m_discontinuityCounter { 0 };
49  bool m_autoFieldOrder { false };
50  long long m_lastFieldChange { 0 };
51  static bool s_haveSIMD;
52 };
53 
54 #endif // MYTHDEINTERLACER_H
void OneField(VideoFrame *Frame, FrameScanType Scan)
void Blend(VideoFrame *Frame, FrameScanType Scan)
bool SetUpCache(VideoFrame *Frame)
FrameScanType
Definition: videoouttypes.h:78
VideoFrameType
Definition: mythframe.h:23
VideoFrame * m_bobFrame
long long m_discontinuityCounter
MythDeintType
Definition: mythframe.h:120
MythAVFrame m_frame
AVFilterContext * m_source
static bool s_haveSIMD
long long m_lastFieldChange
SwsContext * m_swsContext
void Filter(VideoFrame *Frame, FrameScanType Scan, VideoDisplayProfile *Profile, bool Force=false)
Deinterlace Frame if needed.
Handles software based deinterlacing of video frames.
AVFilterContext * m_sink
bool Initialise(VideoFrame *Frame, MythDeintType Deinterlacer, bool DoubleRate, bool TopFieldFirst, VideoDisplayProfile *Profile)
Initialise deinterlacing using the given MythDeintType.
AVFilterGraph * m_graph
MythDeintType m_deintType
AVPixelFormat m_inputFmt
MythAVFrame little utility class that act as a safe way to allocate an AVFrame which can then be allo...
Definition: mythavutil.h:42
MythDeinterlacer()=default
VideoFrameType m_inputType