MythTV  master
mythframe.cpp
Go to the documentation of this file.
1 // MythTV
2 #include "mythlogging.h"
3 #include "mythvideoprofile.h"
4 #include "mythframe.h"
5 
6 // FFmpeg - for av_malloc/av_free
7 extern "C" {
8 #include "libavcodec/avcodec.h"
9 }
10 
11 #define LOC QString("VideoFrame: ")
12 
23 {
25  LOG(VB_GENERAL, LOG_ERR, LOC + "Frame still contains a hardware buffer!");
26  else if (m_buffer)
27  av_freep(&m_buffer);
28 }
29 
30 MythVideoFrame::MythVideoFrame(VideoFrameType Type, int Width, int Height, const VideoFrameTypes* RenderFormats)
31 {
32  Init(Type, Width, Height, (RenderFormats == nullptr) ? &kDefaultRenderFormats : RenderFormats);
33 }
34 
35 MythVideoFrame::MythVideoFrame(VideoFrameType Type, uint8_t* Buffer, size_t BufferSize,
36  int Width, int Height, const VideoFrameTypes* RenderFormats, int Alignment)
37 {
38  const VideoFrameTypes* formats = (RenderFormats == nullptr) ? &kDefaultRenderFormats : RenderFormats;
39  Init(Type, Buffer, BufferSize, Width, Height, formats, Alignment);
40 }
41 
42 void MythVideoFrame::Init(VideoFrameType Type, int Width, int Height, const VideoFrameTypes* RenderFormats)
43 {
44  size_t newsize = 0;
45  uint8_t* newbuffer = nullptr;
46  if ((Width > 0 && Height > 0) && !((Type == FMT_NONE) || HardwareFormat(Type)))
47  {
48  newsize = GetBufferSize(Type, Width, Height);
49  bool reallocate = !((Width == m_width) && (Height == m_height) && (newsize == m_bufferSize) && (Type == m_type));
50  newbuffer = reallocate ? GetAlignedBuffer(newsize) : m_buffer;
51  newsize = reallocate ? newsize : m_bufferSize;
52  }
53  Init(Type, newbuffer, newsize, Width, Height, (RenderFormats == nullptr) ? &kDefaultRenderFormats : RenderFormats);
54 }
55 
56 void MythVideoFrame::Init(VideoFrameType Type, uint8_t *Buffer, size_t BufferSize,
57  int Width, int Height, const VideoFrameTypes* RenderFormats, int Alignment)
58 {
60  {
61  LOG(VB_GENERAL, LOG_ERR, LOC + "Trying to reinitialise a hardware frame. Ignoring");
62  return;
63  }
64 
65  if (std::any_of(m_priv.cbegin(), m_priv.cend(), [](const uint8_t* P) { return P != nullptr; }))
66  {
67  LOG(VB_GENERAL, LOG_ERR, LOC + "Priv buffers are set (hardware frame?). Ignoring Init");
68  return;
69  }
70 
71  if ((Buffer && !BufferSize) || (!Buffer && BufferSize))
72  {
73  LOG(VB_GENERAL, LOG_ERR, LOC + "Inconsistent frame buffer data");
74  return;
75  }
76 
77  if (m_buffer && (m_buffer != Buffer))
78  {
79  LOG(VB_GENERAL, LOG_DEBUG, LOC + "Deleting old frame buffer");
80  av_freep(&m_buffer);
81  }
82 
83  m_type = Type;
85  m_buffer = Buffer;
86  m_bufferSize = BufferSize;
87  m_width = Width;
88  m_height = Height;
89  m_renderFormats = (RenderFormats == nullptr) ? &kDefaultRenderFormats : RenderFormats;
90 
91  ClearMetadata();
92 
94  return;
95 
96  int alignedwidth = Alignment > 0 ? (m_width + Alignment - 1) & ~(Alignment - 1) : m_width;
97  int alignedheight = (m_height + MYTH_HEIGHT_ALIGNMENT - 1) & ~(MYTH_HEIGHT_ALIGNMENT -1);
98 
99  for (uint i = 0; i < 3; ++i)
100  m_pitches[i] = GetPitchForPlane(m_type, alignedwidth, i);
101 
102  m_offsets[0] = 0;
103  if (FMT_YV12 == m_type)
104  {
105  m_offsets[1] = alignedwidth * alignedheight;
106  m_offsets[2] = m_offsets[1] + ((alignedwidth + 1) >> 1) * ((alignedheight+1) >> 1);
107  }
108  else if (FormatIs420(m_type))
109  {
110  m_offsets[1] = (alignedwidth << 1) * alignedheight;
111  m_offsets[2] = m_offsets[1] + (alignedwidth * (alignedheight >> 1));
112  }
113  else if (FMT_YUV422P == m_type)
114  {
115  m_offsets[1] = alignedwidth * alignedheight;
116  m_offsets[2] = m_offsets[1] + ((alignedwidth + 1) >> 1) * alignedheight;
117  }
118  else if (FormatIs422(m_type))
119  {
120  m_offsets[1] = (alignedwidth << 1) * alignedheight;
121  m_offsets[2] = m_offsets[1] + (alignedwidth * alignedheight);
122  }
123  else if (FMT_YUV444P == m_type)
124  {
125  m_offsets[1] = alignedwidth * alignedheight;
126  m_offsets[2] = m_offsets[1] + (alignedwidth * alignedheight);
127  }
128  else if (FormatIs444(m_type))
129  {
130  m_offsets[1] = (alignedwidth << 1) * alignedheight;
131  m_offsets[2] = m_offsets[1] + ((alignedwidth << 1) * alignedheight);
132  }
133  else if (FMT_NV12 == m_type)
134  {
135  m_offsets[1] = alignedwidth * alignedheight;
136  m_offsets[2] = 0;
137  }
138  else if (FormatIsNV12(m_type))
139  {
140  m_offsets[1] = (alignedwidth << 1) * alignedheight;
141  m_offsets[2] = 0;
142  }
143  else
144  {
145  m_offsets[1] = m_offsets[2] = 0;
146  }
147 }
148 
150 {
151  m_aspect = -1.0F;
152  m_frameRate = -1.0 ;
153  m_frameNumber = 0;
154  m_frameCounter = 0;
155  m_timecode = 0;
156  m_displayTimecode = 0;
157  m_priv = { nullptr };
158  m_interlaced = 0;
159  m_topFieldFirst = true;
160  m_interlacedReverse = false;
161  m_newGOP = false;
162  m_repeatPic = false;
163  m_forceKey = false;
164  m_dummy = false;
165  m_pauseFrame = false;
166  m_pitches = { 0 };
167  m_offsets = { 0 };
168  m_pixFmt = 0;
169  m_swPixFmt = 0;
170  m_directRendering = true;
171  m_colorspace = 1;
172  m_colorrange = 1;
173  m_colorprimaries = 1;
174  m_colortransfer = 1;
175  m_chromalocation = 1;
176  m_colorshifted = false;
177  m_alreadyDeinterlaced = false;
178  m_rotation = 0;
179  m_stereo3D = 0;
184  m_deinterlaceInuse2x = false;
185 }
186 
187 void MythVideoFrame::CopyPlane(uint8_t *To, int ToPitch, const uint8_t *From, int FromPitch,
188  int PlaneWidth, int PlaneHeight)
189 {
190  if ((ToPitch == PlaneWidth) && (FromPitch == PlaneWidth))
191  {
192  memcpy(To, From, static_cast<size_t>(PlaneWidth * PlaneHeight));
193  return;
194  }
195 
196  for (int y = 0; y < PlaneHeight; y++)
197  {
198  memcpy(To, From, static_cast<size_t>(PlaneWidth));
199  From += FromPitch;
200  To += ToPitch;
201  }
202 }
203 
205 {
206  if (!m_buffer)
207  return;
208 
209  if (HardwareFormat(m_type))
210  {
211  LOG(VB_GENERAL, LOG_ERR, LOC + "Cannot clear a hardware frame");
212  return;
213  }
214 
215  // luma (or RGBA)
216  int uv_height = GetHeightForPlane(m_type, m_height, 1);
217  int uv = (1 << (ColorDepth(m_type) - 1)) - 1;
218  if (FMT_YV12 == m_type || FMT_YUV422P == m_type || FMT_YUV444P == m_type)
219  {
220  memset(m_buffer + m_offsets[0], 0, static_cast<size_t>(m_pitches[0] * m_height));
221  memset(m_buffer + m_offsets[1], uv & 0xff, static_cast<size_t>(m_pitches[1] * uv_height));
222  memset(m_buffer + m_offsets[2], uv & 0xff, static_cast<size_t>(m_pitches[2] * uv_height));
223  }
224  else if ((FormatIs420(m_type) || FormatIs422(m_type) || FormatIs444(m_type)) &&
225  (m_pitches[1] == m_pitches[2]))
226  {
227  memset(m_buffer + m_offsets[0], 0, static_cast<size_t>(m_pitches[0] * m_height));
228  unsigned char uv1 = (uv & 0xff00) >> 8;
229  unsigned char uv2 = (uv & 0x00ff);
230  unsigned char* buf1 = m_buffer + m_offsets[1];
231  unsigned char* buf2 = m_buffer + m_offsets[2];
232  for (int row = 0; row < uv_height; ++row)
233  {
234  for (int col = 0; col < m_pitches[1]; col += 2)
235  {
236  buf1[col] = buf2[col] = uv1;
237  buf1[col + 1] = buf2[col + 1] = uv2;
238  }
239  buf1 += m_pitches[1];
240  buf2 += m_pitches[2];
241  }
242  }
243  else if (FMT_NV12 == m_type)
244  {
245  memset(m_buffer + m_offsets[0], 0, static_cast<size_t>(m_pitches[0] * m_height));
246  memset(m_buffer + m_offsets[1], uv & 0xff, static_cast<size_t>(m_pitches[1] * uv_height));
247  }
248  else if (FormatIsNV12(m_type))
249  {
250  memset(m_buffer + m_offsets[0], 0, static_cast<size_t>(m_pitches[0] * m_height));
251  unsigned char uv1 = (uv & 0xff00) >> 8;
252  unsigned char uv2 = (uv & 0x00ff);
253  unsigned char* buf3 = m_buffer + m_offsets[1];
254  for (int row = 0; row < uv_height; ++row)
255  {
256  for (int col = 0; col < m_pitches[1]; col += 4)
257  {
258  buf3[col] = buf3[col + 2] = uv1;
259  buf3[col + 1] = buf3[col + 3] = uv2;
260  }
261  buf3 += m_pitches[1];
262  }
263  }
264  else if (PackedFormat(m_type))
265  {
266  // TODO
267  }
268  else
269  {
270  memset(m_buffer, 0, m_bufferSize);
271  }
272 }
273 
275 {
276  // Sanity checks
277  if (!From || (this == From))
278  return false;
279 
280  if (m_type != From->m_type)
281  {
282  LOG(VB_GENERAL, LOG_ERR, "Cannot copy frames of differing types");
283  return false;
284  }
285 
286  if (From->m_type == FMT_NONE || HardwareFormat(From->m_type))
287  {
288  LOG(VB_GENERAL, LOG_ERR, "Invalid frame format");
289  return false;
290  }
291 
292  if (!((m_width > 0) && (m_height > 0) &&
293  (m_width == From->m_width) && (m_height == From->m_height)))
294  {
295  LOG(VB_GENERAL, LOG_ERR, "Invalid frame sizes");
296  return false;
297  }
298 
299  if (!(m_buffer && From->m_buffer && (m_buffer != From->m_buffer)))
300  {
301  LOG(VB_GENERAL, LOG_ERR, "Invalid frames for copying");
302  return false;
303  }
304 
305  // N.B. Minimum based on zero width alignment but will apply height alignment
306  size_t minsize = GetBufferSize(m_type, m_width, m_height, 0);
307  if ((m_bufferSize < minsize) || (From->m_bufferSize < minsize))
308  {
309  LOG(VB_GENERAL, LOG_ERR, "Invalid buffer size");
310  return false;
311  }
312 
313  // We have 2 frames of the same valid size and format, they are not hardware frames
314  // and both have buffers reported to satisfy a minimal size.
315 
316  // Copy data
317  uint count = GetNumPlanes(From->m_type);
318  for (uint plane = 0; plane < count; plane++)
319  {
320  CopyPlane(m_buffer + m_offsets[plane], m_pitches[plane],
321  From->m_buffer + From->m_offsets[plane], From->m_pitches[plane],
322  GetPitchForPlane(From->m_type, From->m_width, plane),
323  GetHeightForPlane(From->m_type, From->m_height, plane));
324  }
325 
326  // Copy metadata
327  // Not copied: codec, width, height - should already be the same
328  // Not copied: buf, size, pitches, offsets - should/could be different
329  // Not copied: priv - hardware frames only
330  m_aspect = From->m_aspect;
331  m_frameRate = From->m_frameRate;
335  m_timecode = From->m_timecode;
337  m_interlaced = From->m_interlaced;
340  m_newGOP = From->m_newGOP;
341  m_repeatPic = From->m_repeatPic;
342  m_forceKey = From->m_forceKey;
343  m_dummy = From->m_dummy;
344  m_pauseFrame = From->m_pauseFrame;
345  m_pixFmt = From->m_pixFmt;
346  m_swPixFmt = From->m_swPixFmt;
348  m_colorspace = From->m_colorspace;
349  m_colorrange = From->m_colorrange;
355  m_rotation = From->m_rotation;
361 
362  return true;
363 }
364 
366 {
367  switch (Type)
368  {
369  case FMT_NONE: return "None";
370  case FMT_RGB24: return "RGB24";
371  case FMT_YV12: return "YUV420P";
372  case FMT_RGB32: return "RGB32";
373  case FMT_ARGB32: return "ARGB32";
374  case FMT_RGBA32: return "RGBA32";
375  case FMT_YUV422P: return "YUV422P";
376  case FMT_BGRA: return "BGRA";
377  case FMT_YUY2: return "YUY2";
378  case FMT_NV12: return "NV12";
379  case FMT_P010: return "P010";
380  case FMT_P016: return "P016";
381  case FMT_YUV420P9: return "YUV420P9";
382  case FMT_YUV420P10: return "YUV420P10";
383  case FMT_YUV420P12: return "YUV420P12";
384  case FMT_YUV420P14: return "YUV420P14";
385  case FMT_YUV420P16: return "YUV420P16";
386  case FMT_YUV422P9: return "YUV422P9";
387  case FMT_YUV422P10: return "YUV422P10";
388  case FMT_YUV422P12: return "YUV422P12";
389  case FMT_YUV422P14: return "YUV422P14";
390  case FMT_YUV422P16: return "YUV422P16";
391  case FMT_YUV444P: return "YUV444P";
392  case FMT_YUV444P9: return "YUV444P9";
393  case FMT_YUV444P10: return "YUV444P10";
394  case FMT_YUV444P12: return "YUV444P12";
395  case FMT_YUV444P14: return "YUV444P14";
396  case FMT_YUV444P16: return "YUV444P16";
397  case FMT_VDPAU: return "VDPAU";
398  case FMT_VAAPI: return "VAAPI";
399  case FMT_DXVA2: return "DXVA2";
400  case FMT_MMAL: return "MMAL";
401  case FMT_MEDIACODEC: return "MediaCodec";
402  case FMT_VTB: return "VideoToolBox";
403  case FMT_NVDEC: return "NVDec";
404  case FMT_DRMPRIME: return "DRM-PRIME";
405  }
406  return "?";
407 }
408 
409 size_t MythVideoFrame::GetBufferSize(VideoFrameType Type, int Width, int Height, int Aligned)
410 {
411  // bits per pixel div common factor
412  int bpp = BitsPerPixel(Type) / 4;
413  // bits per byte div common factor
414  int bpb = 8 / 4;
415 
416  // Align height and width. We always align height to 16 rows and the *default*
417  // width alignment is 64bytes, which allows SIMD operations on subsampled
418  // planes (i.e. 32byte alignment)
419  int adj_w = Aligned ? ((Width + Aligned - 1) & ~(Aligned - 1)) : Width;
420  int adj_h = (Height + MYTH_HEIGHT_ALIGNMENT - 1) & ~(MYTH_HEIGHT_ALIGNMENT - 1);
421 
422  // Calculate rounding as necessary.
423  int remainder = (adj_w * adj_h * bpp) % bpb;
424  return static_cast<uint>((adj_w * adj_h * bpp) / bpb + (remainder ? 1 : 0));
425 }
426 
427 uint8_t *MythVideoFrame::GetAlignedBuffer(size_t Size)
428 {
429  return static_cast<uint8_t*>(av_malloc(Size + 64));
430 }
431 
432 uint8_t *MythVideoFrame::CreateBuffer(VideoFrameType Type, int Width, int Height)
433 {
434  size_t size = GetBufferSize(Type, Width, Height);
435  return GetAlignedBuffer(size);
436 }
437 
439 {
441  if (options & Type)
442  return GetDeinterlacer(options);
443  return DEINT_NONE;
444 }
445 
447 {
449  if (options & Type)
450  return GetDeinterlacer(options);
451  return DEINT_NONE;
452 }
453 
455 {
456  return Option & (DEINT_BASIC | DEINT_MEDIUM | DEINT_HIGH);
457 }
458 
460 {
461  MythDeintType deint = GetDeinterlacer(Deint);
462  QString result = DoubleRate ? "2x " : "";
463  if (Deint & DEINT_CPU)
464  {
465  result += "CPU ";
466  switch (deint)
467  {
468  case DEINT_HIGH: return result + "Yadif";
469  case DEINT_MEDIUM: return result + "Linearblend";
470  case DEINT_BASIC: return result + "Onefield";
471  default: break;
472  }
473  }
474  else if (Deint & DEINT_SHADER)
475  {
476  result += "GLSL ";
477  switch (deint)
478  {
479  case DEINT_HIGH: return result + "Kernel";
480  case DEINT_MEDIUM: return result + "Linearblend";
481  case DEINT_BASIC: return result + "Onefield";
482  default: break;
483  }
484  }
485  else if (Deint & DEINT_DRIVER)
486  {
487  switch (Format)
488  {
489  case FMT_MEDIACODEC: return "MediaCodec";
490  case FMT_DRMPRIME: return result + "EGL Onefield";
491  case FMT_VDPAU:
492  result += "VDPAU ";
493  switch (deint)
494  {
495  case DEINT_HIGH: return result + "Advanced";
496  case DEINT_MEDIUM: return result + "Temporal";
497  case DEINT_BASIC: return result + "Basic";
498  default: break;
499  }
500  break;
501  case FMT_NVDEC:
502  result += "NVDec ";
503  switch (deint)
504  {
505  case DEINT_HIGH:
506  case DEINT_MEDIUM: return result + "Adaptive";
507  case DEINT_BASIC: return result + "Basic";
508  default: break;
509  }
510  break;
511  case FMT_VAAPI:
512  result += "VAAPI ";
513  switch (deint)
514  {
515  case DEINT_HIGH: return result + "Compensated";
516  case DEINT_MEDIUM: return result + "Adaptive";
517  case DEINT_BASIC: return result + "Basic";
518  default: break;
519  }
520  break;
521  default: break;
522  }
523  }
524  return "None";
525 }
526 
528 {
529  if (DEINT_NONE == Deint)
530  return QString("None");
531  QString result;
532  if (Deint & DEINT_BASIC) result = "Basic";
533  else if (Deint & DEINT_MEDIUM) result = "Medium";
534  else if (Deint & DEINT_HIGH) result = "High";
535  if (Deint & DEINT_CPU) result += "|CPU";
536  if (Deint & DEINT_SHADER) result += "|GLSL";
537  if (Deint & DEINT_DRIVER) result += "|DRIVER";
538  return result;
539 }
540 
542 {
543  MythDeintType result = DEINT_NONE;
544 
545  if (Deinterlacer.contains(DEINT_QUALITY_HIGH))
546  result = DEINT_HIGH;
547  else if (Deinterlacer.contains(DEINT_QUALITY_MEDIUM))
548  result = DEINT_MEDIUM;
549  else if (Deinterlacer.contains(DEINT_QUALITY_LOW))
550  result = DEINT_BASIC;
551 
552  if (result != DEINT_NONE)
553  {
554  result = result | DEINT_CPU; // NB always assumed
555  if (Deinterlacer.contains(DEINT_QUALITY_SHADER))
556  result = result | DEINT_SHADER;
557  if (Deinterlacer.contains(DEINT_QUALITY_DRIVER))
558  result = result | DEINT_DRIVER;
559  }
560 
561  return result;
562 }
FMT_MEDIACODEC
@ FMT_MEDIACODEC
Definition: mythframe.h:59
DEINT_DRIVER
@ DEINT_DRIVER
Definition: mythframe.h:73
DEINT_MEDIUM
@ DEINT_MEDIUM
Definition: mythframe.h:69
MythVideoFrame::m_colorspace
int m_colorspace
Definition: mythframe.h:145
MythVideoFrame::GetDoubleRateOption
MythDeintType GetDoubleRateOption(MythDeintType Type, MythDeintType Override=DEINT_NONE) const
Definition: mythframe.cpp:446
FMT_YUV420P10
@ FMT_YUV420P10
Definition: mythframe.h:24
MythVideoFrame::m_colortransfer
int m_colortransfer
Definition: mythframe.h:148
MythVideoFrame::GetPitchForPlane
static int GetPitchForPlane(VideoFrameType Type, int Width, uint Plane)
Definition: mythframe.h:299
MythVideoFrame::m_interlaced
int m_interlaced
Definition: mythframe.h:131
FMT_YUV420P16
@ FMT_YUV420P16
Definition: mythframe.h:27
MythVideoFrame::m_newGOP
bool m_newGOP
Definition: mythframe.h:134
FMT_VTB
@ FMT_VTB
Definition: mythframe.h:60
MythVideoFrame::ParseDeinterlacer
static MythDeintType ParseDeinterlacer(const QString &Deinterlacer)
Definition: mythframe.cpp:541
DEINT_SHADER
@ DEINT_SHADER
Definition: mythframe.h:72
FMT_YUV420P14
@ FMT_YUV420P14
Definition: mythframe.h:26
MythVideoFrame::PackedFormat
static bool PackedFormat(VideoFrameType Type)
Definition: mythframe.h:456
MythVideoFrame::m_deinterlaceAllowed
MythDeintType m_deinterlaceAllowed
Definition: mythframe.h:156
MythVideoFrame::ClearBufferToBlank
void ClearBufferToBlank()
Definition: mythframe.cpp:204
MythVideoFrame::m_chromalocation
int m_chromalocation
Definition: mythframe.h:149
FMT_DRMPRIME
@ FMT_DRMPRIME
Definition: mythframe.h:62
DEINT_QUALITY_LOW
#define DEINT_QUALITY_LOW
Definition: mythvideoprofile.h:18
FMT_YUV444P10
@ FMT_YUV444P10
Definition: mythframe.h:44
FMT_YUV422P14
@ FMT_YUV422P14
Definition: mythframe.h:39
MythVideoFrame::m_frameCounter
uint64_t m_frameCounter
Definition: mythframe.h:127
DEINT_QUALITY_SHADER
#define DEINT_QUALITY_SHADER
Definition: mythvideoprofile.h:21
FMT_P010
@ FMT_P010
Definition: mythframe.h:52
DEINT_NONE
@ DEINT_NONE
Definition: mythframe.h:67
MythDate::Format
Format
Definition: mythdate.h:12
MythVideoFrame::m_width
int m_width
Definition: mythframe.h:118
FMT_YUV422P
@ FMT_YUV422P
Definition: mythframe.h:35
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
MythVideoFrame::Init
void Init(VideoFrameType Type, int Width, int Height, const VideoFrameTypes *RenderFormats=nullptr)
Definition: mythframe.cpp:42
MythVideoFrame::HardwareFormat
static bool HardwareFormat(VideoFrameType Type)
Definition: mythframe.h:420
mythframe.h
MythVideoFrame::FormatIs422
static bool FormatIs422(VideoFrameType Type)
Definition: mythframe.h:439
MythVideoFrame::m_forceKey
bool m_forceKey
Definition: mythframe.h:136
MythVideoFrame::m_offsets
FrameOffsets m_offsets
Definition: mythframe.h:140
MythVideoFrame::m_interlacedReverse
bool m_interlacedReverse
Definition: mythframe.h:133
MYTH_HEIGHT_ALIGNMENT
#define MYTH_HEIGHT_ALIGNMENT
Definition: mythframe.h:16
FMT_YUV444P14
@ FMT_YUV444P14
Definition: mythframe.h:46
FMT_YUV444P
@ FMT_YUV444P
Definition: mythframe.h:42
MythVideoFrame::m_timecode
long long m_timecode
Definition: mythframe.h:128
FMT_NONE
@ FMT_NONE
Definition: mythframe.h:20
MythVideoFrame::m_dummy
bool m_dummy
Definition: mythframe.h:137
DEINT_CPU
@ DEINT_CPU
Definition: mythframe.h:71
MythVideoFrame::m_rotation
int m_rotation
Definition: mythframe.h:152
MythVideoFrame::BitsPerPixel
static int BitsPerPixel(VideoFrameType Type)
Definition: mythframe.h:165
MythVideoFrame::m_colorrange
int m_colorrange
Definition: mythframe.h:146
MythVideoFrame::m_deinterlaceDouble
MythDeintType m_deinterlaceDouble
Definition: mythframe.h:155
MythVideoFrame::GetBufferSize
static size_t GetBufferSize(VideoFrameType Type, int Width, int Height, int Aligned=MYTH_WIDTH_ALIGNMENT)
Definition: mythframe.cpp:409
mythlogging.h
DEINT_QUALITY_HIGH
#define DEINT_QUALITY_HIGH
Definition: mythvideoprofile.h:20
MythVideoFrame::m_colorshifted
bool m_colorshifted
Definition: mythframe.h:150
MythVideoFrame::CopyPlane
static void CopyPlane(uint8_t *To, int ToPitch, const uint8_t *From, int FromPitch, int PlaneWidth, int PlaneHeight)
Definition: mythframe.cpp:187
FMT_YUV444P9
@ FMT_YUV444P9
Definition: mythframe.h:43
FMT_YV12
@ FMT_YV12
Definition: mythframe.h:22
MythVideoFrame::m_pixFmt
int m_pixFmt
Definition: mythframe.h:141
MythVideoFrame::m_alreadyDeinterlaced
bool m_alreadyDeinterlaced
Definition: mythframe.h:151
MythVideoFrame::m_displayTimecode
int64_t m_displayTimecode
Definition: mythframe.h:129
FMT_YUV422P10
@ FMT_YUV422P10
Definition: mythframe.h:37
FMT_YUV444P16
@ FMT_YUV444P16
Definition: mythframe.h:47
VideoFrameTypes
std::vector< VideoFrameType > VideoFrameTypes
Definition: mythframe.h:81
FMT_BGRA
@ FMT_BGRA
Definition: mythframe.h:30
formats
const std::array< const std::string, 8 > formats
Definition: vbilut.cpp:189
DEINT_QUALITY_MEDIUM
#define DEINT_QUALITY_MEDIUM
Definition: mythvideoprofile.h:19
MythVideoFrame::m_frameNumber
long long m_frameNumber
Definition: mythframe.h:126
FMT_YUV420P12
@ FMT_YUV420P12
Definition: mythframe.h:25
MythVideoFrame::CreateBuffer
static uint8_t * CreateBuffer(VideoFrameType Type, int Width, int Height)
Definition: mythframe.cpp:432
MythVideoFrame::m_bufferSize
size_t m_bufferSize
Definition: mythframe.h:121
MythVideoFrame::ColorDepth
static int ColorDepth(int Format)
Definition: mythframe.h:394
MythVideoFrame::m_colorprimaries
int m_colorprimaries
Definition: mythframe.h:147
MythVideoFrame::m_pauseFrame
bool m_pauseFrame
Definition: mythframe.h:138
MythVideoFrame::m_directRendering
bool m_directRendering
Definition: mythframe.h:143
mythvideoprofile.h
uint
unsigned int uint
Definition: compat.h:141
MythVideoFrame::GetDeinterlacer
static MythDeintType GetDeinterlacer(MythDeintType Option)
Definition: mythframe.cpp:454
MythVideoFrame::m_renderFormats
const VideoFrameTypes * m_renderFormats
Definition: mythframe.h:144
FMT_YUV444P12
@ FMT_YUV444P12
Definition: mythframe.h:45
MythVideoFrame::FormatIs444
static bool FormatIs444(VideoFrameType Type)
Definition: mythframe.h:445
MythVideoFrame::DeinterlacerPref
static QString DeinterlacerPref(MythDeintType Deint)
Definition: mythframe.cpp:527
FMT_ARGB32
@ FMT_ARGB32
Definition: mythframe.h:32
MythVideoFrame::m_pitches
FramePitches m_pitches
Definition: mythframe.h:139
MythVideoFrame::m_topFieldFirst
bool m_topFieldFirst
Definition: mythframe.h:132
FMT_NVDEC
@ FMT_NVDEC
Definition: mythframe.h:61
MythVideoFrame::FormatIs420
static bool FormatIs420(VideoFrameType Type)
Definition: mythframe.h:433
MythVideoFrame::GetSingleRateOption
MythDeintType GetSingleRateOption(MythDeintType Type, MythDeintType Override=DEINT_NONE) const
Definition: mythframe.cpp:438
MythVideoFrame::GetHeightForPlane
static int GetHeightForPlane(VideoFrameType Type, int Height, uint Plane)
Definition: mythframe.h:253
FMT_YUV422P9
@ FMT_YUV422P9
Definition: mythframe.h:36
MythDeintType
MythDeintType
Definition: mythframe.h:65
MythVideoFrame::m_stereo3D
uint m_stereo3D
Definition: mythframe.h:153
Buffer
Definition: MythExternControl.h:36
MythVideoFrame::m_repeatPic
bool m_repeatPic
Definition: mythframe.h:135
FMT_YUV420P9
@ FMT_YUV420P9
Definition: mythframe.h:23
MythVideoFrame::FormatDescription
static QString FormatDescription(VideoFrameType Type)
Definition: mythframe.cpp:365
FMT_VDPAU
@ FMT_VDPAU
Definition: mythframe.h:55
MythVideoFrame::kDefaultRenderFormats
static const VideoFrameTypes kDefaultRenderFormats
Definition: mythframe.h:88
MythVideoFrame::m_type
VideoFrameType m_type
Definition: mythframe.h:116
FMT_YUV422P16
@ FMT_YUV422P16
Definition: mythframe.h:40
FMT_YUY2
@ FMT_YUY2
Definition: mythframe.h:49
FMT_DXVA2
@ FMT_DXVA2
Definition: mythframe.h:57
MythVideoFrame::DeinterlacerName
static QString DeinterlacerName(MythDeintType Deint, bool DoubleRate, VideoFrameType Format=FMT_NONE)
Definition: mythframe.cpp:459
FMT_RGB24
@ FMT_RGB24
Definition: mythframe.h:29
FMT_YUV422P12
@ FMT_YUV422P12
Definition: mythframe.h:38
MythVideoFrame::m_swPixFmt
int m_swPixFmt
Definition: mythframe.h:142
DEINT_HIGH
@ DEINT_HIGH
Definition: mythframe.h:70
MythVideoFrame::MythVideoFrame
MythVideoFrame()=default
MythVideoFrame::GetNumPlanes
static uint GetNumPlanes(VideoFrameType Type)
Definition: mythframe.h:209
DEINT_QUALITY_DRIVER
#define DEINT_QUALITY_DRIVER
Definition: mythvideoprofile.h:22
MythVideoFrame::m_height
int m_height
Definition: mythframe.h:119
MythVideoFrame::m_bitsPerPixel
int m_bitsPerPixel
Definition: mythframe.h:120
MythVideoFrame::ClearMetadata
void ClearMetadata()
Definition: mythframe.cpp:149
FMT_RGB32
@ FMT_RGB32
endian dependent format, ARGB or BGRA
Definition: mythframe.h:31
MythVideoFrame::GetAlignedBuffer
static uint8_t * GetAlignedBuffer(size_t Size)
Definition: mythframe.cpp:427
FMT_MMAL
@ FMT_MMAL
Definition: mythframe.h:58
VideoFrameType
VideoFrameType
Definition: mythframe.h:18
FMT_VAAPI
@ FMT_VAAPI
Definition: mythframe.h:56
MythVideoFrame::~MythVideoFrame
~MythVideoFrame()
Definition: mythframe.cpp:22
LOC
#define LOC
Definition: mythframe.cpp:11
MythVideoFrame
Definition: mythframe.h:85
FMT_NV12
@ FMT_NV12
Definition: mythframe.h:51
DEINT_BASIC
@ DEINT_BASIC
Definition: mythframe.h:68
MythVideoFrame::m_deinterlaceInuse
MythDeintType m_deinterlaceInuse
Definition: mythframe.h:157
FMT_P016
@ FMT_P016
Definition: mythframe.h:53
MythVideoFrame::CopyFrame
bool CopyFrame(MythVideoFrame *From)
Definition: mythframe.cpp:274
build_compdb.options
options
Definition: build_compdb.py:11
MythVideoFrame::FormatIsNV12
static bool FormatIsNV12(VideoFrameType Type)
Definition: mythframe.h:451
MythVideoFrame::m_frameRate
double m_frameRate
Definition: mythframe.h:125
MythVideoFrame::m_deinterlaceSingle
MythDeintType m_deinterlaceSingle
Definition: mythframe.h:154
MythVideoFrame::m_deinterlaceInuse2x
bool m_deinterlaceInuse2x
Definition: mythframe.h:158
MythVideoFrame::m_aspect
float m_aspect
Definition: mythframe.h:124
MythVideoFrame::m_priv
std::array< uint8_t *, 4 > m_priv
Definition: mythframe.h:130
FMT_RGBA32
@ FMT_RGBA32
Definition: mythframe.h:33
MythVideoFrame::m_buffer
uint8_t * m_buffer
Definition: mythframe.h:117