11#define CLAMP(n) (n > 255 ? 255 : (n < 0 ? 0 : n))
13#define EXPAND_UV(u, v) \
16 int rv = 409 * vv + 128; \
17 int guv = 100 * uu + 208 * vv + 128; \
18 int bu = 516 * uu + 128; \
22 int yy = (
y - 16) * 298;
24 |
CLAMP((yy + rv) >> 8) << 16
25 |
CLAMP((yy - guv) >> 8) << 8
26 |
CLAMP((yy + bu) >> 8);
30 const uchar *u,
int uStride,
31 const uchar *
v,
int vStride,
42 const uchar *lineY1 =
y + yStride;
43 const uchar *lineU = u;
48 lineU += uvPixelStride;
49 lineV += uvPixelStride;
66 const uchar *u,
int uStride,
67 const uchar *
v,
int vStride,
76 const uchar *lineU = u;
81 lineU += uvPixelStride;
82 lineV += uvPixelStride;
101 plane2, plane2Stride,
102 plane3, plane3Stride,
112 plane2, plane2Stride,
113 plane3, plane3Stride,
124 plane3, plane3Stride,
125 plane2, plane2Stride,
191 for (
int j = 0;
j <
width;
j += 2) {
217 for (
int j = 0;
j <
width;
j += 2) {
237 plane2, plane2Stride,
238 plane2 + 1, plane2Stride,
248 plane2 + 1, plane2Stride,
249 plane2, plane2Stride,
258 Q_ASSERT(plane1Stride == plane2Stride);
259 Q_ASSERT(plane1Stride == plane3Stride);
262 plane3, plane3Stride,
263 plane2, plane2Stride,
272 Q_ASSERT(plane1Stride == plane2Stride);
275 plane2 + (plane1Stride >> 1), plane1Stride,
276 plane2, plane1Stride,
285 Q_ASSERT(plane1Stride == plane2Stride);
286 Q_ASSERT(plane1Stride == plane3Stride);
289 plane2, plane2Stride,
290 plane3, plane3Stride,
299 Q_ASSERT(plane1Stride == plane2Stride);
302 plane2, plane1Stride,
303 plane2 + (plane1Stride >> 1), plane1Stride,
310template<
typename Pixel>
322 for (;
x <
width - 3;
x += 4) {
344template<
typename Pixel>
356 for (;
x <
width - 3;
x += 4) {
361 *argb++ =
p[0].convert();
362 *argb++ =
p[1].convert();
363 *argb++ =
p[2].convert();
364 *argb++ =
p[3].convert();
370 *argb++ =
data->convert();
379 const uchar *u,
int uStride,
380 const uchar *
v,
int vStride,
391 const uchar *lineY1 =
y + yStride;
392 const uchar *lineU = u;
395 for (
int i = 0;
i <
width;
i += 2) {
397 lineU += uvPixelStride;
398 lineV += uvPixelStride;
422 plane2 + 1, plane2Stride,
423 plane2 + 3, plane2Stride,
443 for (;
x <
width - 3;
x += 4) {
444 *argb++ = pixel->convert();
446 *argb++ = pixel->convert();
448 *argb++ = pixel->convert();
450 *argb++ = pixel->convert();
456 *argb++ = pixel->convert();
467 qt_convert_to_ARGB32<ARGB8888>,
468 qt_convert_premultiplied_to_ARGB32<ARGB8888>,
469 qt_convert_premultiplied_to_ARGB32<XRGB8888>,
470 qt_convert_to_ARGB32<BGRA8888>,
471 qt_convert_premultiplied_to_ARGB32<BGRA8888>,
472 qt_convert_premultiplied_to_ARGB32<BGRX8888>,
473 qt_convert_to_ARGB32<ABGR8888>,
474 qt_convert_premultiplied_to_ARGB32<XBGR8888>,
475 qt_convert_to_ARGB32<RGBA8888>,
476 qt_convert_premultiplied_to_ARGB32<RGBX8888>,
490 qt_convert_Y_to_ARGB32<uchar>,
491 qt_convert_Y_to_ARGB32<ushort>,
499#ifdef QT_COMPILER_SUPPORTS_SSE2
517#ifdef QT_COMPILER_SUPPORTS_SSSE3
535#ifdef QT_COMPILER_SUPPORTS_AVX2
557 static std::once_flag once;
The QVideoFrame class represents a frame of video data.
Combined button and popup list for selecting options.
GLsizei const GLfloat * v
[13]
GLint GLint GLint GLint GLint x
[0]
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean GLboolean a
[7]
GLuint GLfloat GLfloat GLfloat GLfloat y1
const void GLsizei GLsizei stride
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLsizei GLsizei GLenum format
GLuint GLfloat GLfloat y0
constexpr QRgb qPremultiply(QRgb x)
#define qCpuHasFeature(feature)
static void QT_FASTCALL qt_convert_NV12_to_ARGB32(const QVideoFrame &frame, uchar *output)
static void QT_FASTCALL qt_convert_YUV420P_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_IMC1_to_ARGB32(const QVideoFrame &frame, uchar *output)
VideoFrameConvertFunc qConverterForFormat(QVideoFrameFormat::PixelFormat format)
static void QT_FASTCALL qt_convert_YUV422P_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_premultiplied_to_ARGB32(const QVideoFrame &frame, uchar *output)
static quint32 qYUVToARGB32(int y, int rv, int guv, int bu, int a=0xff)
static void QT_FASTCALL qt_convert_YUYV_to_ARGB32(const QVideoFrame &frame, uchar *output)
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 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_AYUV_to_ARGB32(const QVideoFrame &frame, uchar *output)
static void QT_FASTCALL qt_convert_Y_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_YV12_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_P016_to_ARGB32(const QVideoFrame &frame, uchar *output)
static void qInitConvertFuncsAsm()
static VideoFrameConvertFunc qConvertFuncs[QVideoFrameFormat::NPixelFormats]
static void QT_FASTCALL qt_convert_to_ARGB32(const QVideoFrame &frame, uchar *output)
static void QT_FASTCALL qt_convert_IMC4_to_ARGB32(const QVideoFrame &frame, uchar *output)
static void QT_FASTCALL qt_convert_NV21_to_ARGB32(const QVideoFrame &frame, uchar *output)
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)
#define MERGE_LOOPS(width, height, stride, bpp)
#define FETCH_INFO_PACKED(frame)
#define FETCH_INFO_BIPLANAR(frame)
#define FETCH_INFO_TRIPLANAR(frame)
QT_BEGIN_NAMESPACE typedef uchar * output