Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qvideoframeconversionhelper.cpp File Reference
#include "qvideoframeconversionhelper_p.h"
#include "qrgb.h"
#include <mutex>
+ Include dependency graph for qvideoframeconversionhelper.cpp:

Go to the source code of this file.

Macros

#define CLAMP(n)   (n > 255 ? 255 : (n < 0 ? 0 : n))
 
#define EXPAND_UV(u, v)
 

Functions

static quint32 qYUVToARGB32 (int y, int rv, int guv, int bu, int a=0xff)
 
static void planarYUV420_to_ARGB32 (const uchar *y, int yStride, const uchar *u, int uStride, const uchar *v, int vStride, int uvPixelStride, quint32 *rgb, int width, int height)
 
static void planarYUV422_to_ARGB32 (const uchar *y, int yStride, const uchar *u, int uStride, const uchar *v, int vStride, int uvPixelStride, quint32 *rgb, int width, int height)
 
static void QT_FASTCALL qt_convert_YUV420P_to_ARGB32 (const QVideoFrame &frame, uchar *output)
 
static void QT_FASTCALL qt_convert_YUV422P_to_ARGB32 (const QVideoFrame &frame, uchar *output)
 
static void QT_FASTCALL qt_convert_YV12_to_ARGB32 (const QVideoFrame &frame, uchar *output)
 
static void QT_FASTCALL qt_convert_AYUV_to_ARGB32 (const QVideoFrame &frame, uchar *output)
 
static void QT_FASTCALL qt_convert_AYUV_Premultiplied_to_ARGB32 (const QVideoFrame &frame, uchar *output)
 
static void QT_FASTCALL qt_convert_UYVY_to_ARGB32 (const QVideoFrame &frame, uchar *output)
 
static void QT_FASTCALL qt_convert_YUYV_to_ARGB32 (const QVideoFrame &frame, uchar *output)
 
static void QT_FASTCALL qt_convert_NV12_to_ARGB32 (const QVideoFrame &frame, uchar *output)
 
static void QT_FASTCALL qt_convert_NV21_to_ARGB32 (const QVideoFrame &frame, uchar *output)
 
static void QT_FASTCALL qt_convert_IMC1_to_ARGB32 (const QVideoFrame &frame, uchar *output)
 
static void QT_FASTCALL qt_convert_IMC2_to_ARGB32 (const QVideoFrame &frame, uchar *output)
 
static void QT_FASTCALL qt_convert_IMC3_to_ARGB32 (const QVideoFrame &frame, uchar *output)
 
static void QT_FASTCALL qt_convert_IMC4_to_ARGB32 (const QVideoFrame &frame, uchar *output)
 
template<typename Pixel >
static void QT_FASTCALL qt_convert_to_ARGB32 (const QVideoFrame &frame, uchar *output)
 
template<typename Pixel >
static void QT_FASTCALL qt_convert_premultiplied_to_ARGB32 (const QVideoFrame &frame, uchar *output)
 
static void planarYUV420_16bit_to_ARGB32 (const uchar *y, int yStride, const uchar *u, int uStride, const uchar *v, int vStride, int uvPixelStride, quint32 *rgb, int width, int height)
 
static void QT_FASTCALL qt_convert_P016_to_ARGB32 (const QVideoFrame &frame, uchar *output)
 
template<typename Y >
static void QT_FASTCALL qt_convert_Y_to_ARGB32 (const QVideoFrame &frame, uchar *output)
 
static void qInitConvertFuncsAsm ()
 
VideoFrameConvertFunc qConverterForFormat (QVideoFrameFormat::PixelFormat format)
 

Variables

static VideoFrameConvertFunc qConvertFuncs [QVideoFrameFormat::NPixelFormats]
 

Macro Definition Documentation

◆ CLAMP

#define CLAMP (   n)    (n > 255 ? 255 : (n < 0 ? 0 : n))

Definition at line 11 of file qvideoframeconversionhelper.cpp.

◆ EXPAND_UV

#define EXPAND_UV (   u,
  v 
)
Value:
int uu = u - 128; \
int vv = v - 128; \
int rv = 409 * vv + 128; \
int guv = 100 * uu + 208 * vv + 128; \
int bu = 516 * uu + 128; \
GLsizei const GLfloat * v
[13]

Definition at line 13 of file qvideoframeconversionhelper.cpp.

Function Documentation

◆ planarYUV420_16bit_to_ARGB32()

static void planarYUV420_16bit_to_ARGB32 ( const uchar y,
int  yStride,
const uchar u,
int  uStride,
const uchar v,
int  vStride,
int  uvPixelStride,
quint32 rgb,
int  width,
int  height 
)
inlinestatic

Definition at line 378 of file qvideoframeconversionhelper.cpp.

References EXPAND_UV, i, j, qYUVToARGB32(), and rgb.

Referenced by qt_convert_P016_to_ARGB32().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ planarYUV420_to_ARGB32()

static void planarYUV420_to_ARGB32 ( const uchar y,
int  yStride,
const uchar u,
int  uStride,
const uchar v,
int  vStride,
int  uvPixelStride,
quint32 rgb,
int  width,
int  height 
)
inlinestatic

Definition at line 29 of file qvideoframeconversionhelper.cpp.

References EXPAND_UV, i, j, qYUVToARGB32(), and rgb.

Referenced by qt_convert_IMC1_to_ARGB32(), qt_convert_IMC2_to_ARGB32(), qt_convert_IMC3_to_ARGB32(), qt_convert_IMC4_to_ARGB32(), qt_convert_NV12_to_ARGB32(), qt_convert_NV21_to_ARGB32(), qt_convert_YUV420P_to_ARGB32(), and qt_convert_YV12_to_ARGB32().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ planarYUV422_to_ARGB32()

static void planarYUV422_to_ARGB32 ( const uchar y,
int  yStride,
const uchar u,
int  uStride,
const uchar v,
int  vStride,
int  uvPixelStride,
quint32 rgb,
int  width,
int  height 
)
inlinestatic

Definition at line 65 of file qvideoframeconversionhelper.cpp.

References EXPAND_UV, i, j, qYUVToARGB32(), and rgb.

Referenced by qt_convert_YUV422P_to_ARGB32().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qConverterForFormat()

VideoFrameConvertFunc qConverterForFormat ( QVideoFrameFormat::PixelFormat  format)

Definition at line 555 of file qvideoframeconversionhelper.cpp.

References convert(), qConvertFuncs, and qInitConvertFuncsAsm().

Referenced by convertCPU().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qInitConvertFuncsAsm()

◆ qt_convert_AYUV_Premultiplied_to_ARGB32()

static void QT_FASTCALL qt_convert_AYUV_Premultiplied_to_ARGB32 ( const QVideoFrame frame,
uchar output 
)
static

Definition at line 156 of file qvideoframeconversionhelper.cpp.

References EXPAND_UV, FETCH_INFO_PACKED, frame, i, j, MERGE_LOOPS, output, qYUVToARGB32(), and rgb.

+ Here is the call graph for this function:

◆ qt_convert_AYUV_to_ARGB32()

static void QT_FASTCALL qt_convert_AYUV_to_ARGB32 ( const QVideoFrame frame,
uchar output 
)
static

Definition at line 131 of file qvideoframeconversionhelper.cpp.

References EXPAND_UV, FETCH_INFO_PACKED, frame, i, j, MERGE_LOOPS, output, qPremultiply(), qYUVToARGB32(), and rgb.

+ Here is the call graph for this function:

◆ qt_convert_IMC1_to_ARGB32()

static void QT_FASTCALL qt_convert_IMC1_to_ARGB32 ( const QVideoFrame frame,
uchar output 
)
static

Definition at line 255 of file qvideoframeconversionhelper.cpp.

References FETCH_INFO_TRIPLANAR, frame, output, planarYUV420_to_ARGB32(), and Q_ASSERT.

+ Here is the call graph for this function:

◆ qt_convert_IMC2_to_ARGB32()

static void QT_FASTCALL qt_convert_IMC2_to_ARGB32 ( const QVideoFrame frame,
uchar output 
)
static

Definition at line 269 of file qvideoframeconversionhelper.cpp.

References FETCH_INFO_BIPLANAR, frame, output, planarYUV420_to_ARGB32(), and Q_ASSERT.

+ Here is the call graph for this function:

◆ qt_convert_IMC3_to_ARGB32()

static void QT_FASTCALL qt_convert_IMC3_to_ARGB32 ( const QVideoFrame frame,
uchar output 
)
static

Definition at line 282 of file qvideoframeconversionhelper.cpp.

References FETCH_INFO_TRIPLANAR, frame, output, planarYUV420_to_ARGB32(), and Q_ASSERT.

+ Here is the call graph for this function:

◆ qt_convert_IMC4_to_ARGB32()

static void QT_FASTCALL qt_convert_IMC4_to_ARGB32 ( const QVideoFrame frame,
uchar output 
)
static

Definition at line 296 of file qvideoframeconversionhelper.cpp.

References FETCH_INFO_BIPLANAR, frame, output, planarYUV420_to_ARGB32(), and Q_ASSERT.

+ Here is the call graph for this function:

◆ qt_convert_NV12_to_ARGB32()

static void QT_FASTCALL qt_convert_NV12_to_ARGB32 ( const QVideoFrame frame,
uchar output 
)
static

Definition at line 233 of file qvideoframeconversionhelper.cpp.

References FETCH_INFO_BIPLANAR, frame, output, and planarYUV420_to_ARGB32().

+ Here is the call graph for this function:

◆ qt_convert_NV21_to_ARGB32()

static void QT_FASTCALL qt_convert_NV21_to_ARGB32 ( const QVideoFrame frame,
uchar output 
)
static

Definition at line 244 of file qvideoframeconversionhelper.cpp.

References FETCH_INFO_BIPLANAR, frame, output, and planarYUV420_to_ARGB32().

+ Here is the call graph for this function:

◆ qt_convert_P016_to_ARGB32()

static void QT_FASTCALL qt_convert_P016_to_ARGB32 ( const QVideoFrame frame,
uchar output 
)
static

Definition at line 418 of file qvideoframeconversionhelper.cpp.

References FETCH_INFO_BIPLANAR, frame, output, and planarYUV420_16bit_to_ARGB32().

+ Here is the call graph for this function:

◆ qt_convert_premultiplied_to_ARGB32()

template<typename Pixel >
static void QT_FASTCALL qt_convert_premultiplied_to_ARGB32 ( const QVideoFrame frame,
uchar output 
)
static

Definition at line 345 of file qvideoframeconversionhelper.cpp.

References FETCH_INFO_PACKED, frame, MERGE_LOOPS, output, and Pixel.

◆ qt_convert_to_ARGB32()

template<typename Pixel >
static void QT_FASTCALL qt_convert_to_ARGB32 ( const QVideoFrame frame,
uchar output 
)
static

Definition at line 311 of file qvideoframeconversionhelper.cpp.

References convert(), FETCH_INFO_PACKED, frame, MERGE_LOOPS, output, Pixel, and qPremultiply().

+ Here is the call graph for this function:

◆ qt_convert_UYVY_to_ARGB32()

static void QT_FASTCALL qt_convert_UYVY_to_ARGB32 ( const QVideoFrame frame,
uchar output 
)
static

Definition at line 181 of file qvideoframeconversionhelper.cpp.

References EXPAND_UV, FETCH_INFO_PACKED, frame, i, j, MERGE_LOOPS, output, qYUVToARGB32(), and rgb.

+ Here is the call graph for this function:

◆ qt_convert_Y_to_ARGB32()

template<typename Y >
static void QT_FASTCALL qt_convert_Y_to_ARGB32 ( const QVideoFrame frame,
uchar output 
)
static

Definition at line 431 of file qvideoframeconversionhelper.cpp.

References FETCH_INFO_PACKED, frame, MERGE_LOOPS, output, and Pixel.

◆ qt_convert_YUV420P_to_ARGB32()

static void QT_FASTCALL qt_convert_YUV420P_to_ARGB32 ( const QVideoFrame frame,
uchar output 
)
static

Definition at line 97 of file qvideoframeconversionhelper.cpp.

References FETCH_INFO_TRIPLANAR, frame, output, and planarYUV420_to_ARGB32().

+ Here is the call graph for this function:

◆ qt_convert_YUV422P_to_ARGB32()

static void QT_FASTCALL qt_convert_YUV422P_to_ARGB32 ( const QVideoFrame frame,
uchar output 
)
static

Definition at line 108 of file qvideoframeconversionhelper.cpp.

References FETCH_INFO_TRIPLANAR, frame, output, and planarYUV422_to_ARGB32().

+ Here is the call graph for this function:

◆ qt_convert_YUYV_to_ARGB32()

static void QT_FASTCALL qt_convert_YUYV_to_ARGB32 ( const QVideoFrame frame,
uchar output 
)
static

Definition at line 207 of file qvideoframeconversionhelper.cpp.

References EXPAND_UV, FETCH_INFO_PACKED, frame, i, j, MERGE_LOOPS, output, qYUVToARGB32(), and rgb.

+ Here is the call graph for this function:

◆ qt_convert_YV12_to_ARGB32()

static void QT_FASTCALL qt_convert_YV12_to_ARGB32 ( const QVideoFrame frame,
uchar output 
)
static

Definition at line 120 of file qvideoframeconversionhelper.cpp.

References FETCH_INFO_TRIPLANAR, frame, output, and planarYUV420_to_ARGB32().

+ Here is the call graph for this function:

◆ qYUVToARGB32()

static quint32 qYUVToARGB32 ( int  y,
int  rv,
int  guv,
int  bu,
int  a = 0xff 
)
inlinestatic

Definition at line 20 of file qvideoframeconversionhelper.cpp.

References CLAMP.

Referenced by planarYUV420_16bit_to_ARGB32(), planarYUV420_to_ARGB32(), planarYUV422_to_ARGB32(), qt_convert_AYUV_Premultiplied_to_ARGB32(), qt_convert_AYUV_to_ARGB32(), qt_convert_UYVY_to_ARGB32(), and qt_convert_YUYV_to_ARGB32().

+ Here is the caller graph for this function:

Variable Documentation

◆ qConvertFuncs

VideoFrameConvertFunc qConvertFuncs[QVideoFrameFormat::NPixelFormats]
static

Definition at line 465 of file qvideoframeconversionhelper.cpp.

Referenced by qConverterForFormat(), and qInitConvertFuncsAsm().