30 const uchar *u,
int uStride,
31 const uchar *v,
int vStride,
34 int width,
int height)
38 for (
int j = 0; j + 1 < height; j += 2) {
39 const uchar *lineY0 = y;
40 const uchar *lineY1 = y + yStride;
41 const uchar *lineU = u;
42 const uchar *lineV = v;
45 quint32 *rgb1 = rgb + width;
46 for (
int i = 0; i + 1 < width; i += 2) {
48 lineU += uvPixelStride;
49 lineV += uvPixelStride;
51 rgb0[i] = qYUVToARGB32(*lineY0++, rv, guv, bu);
52 rgb0[i + 1] = qYUVToARGB32(*lineY0++, rv, guv, bu);
53 rgb1[i] = qYUVToARGB32(*lineY1++, rv, guv, bu);
54 rgb1[i + 1] = qYUVToARGB32(*lineY1++, rv, guv, bu);
374 const uchar *u,
int uStride,
375 const uchar *v,
int vStride,
378 int width,
int height)
382 for (
int j = 0; j + 1 < height; j += 2) {
383 const uchar *lineY0 = y;
384 const uchar *lineY1 = y + yStride;
385 const uchar *lineU = u;
386 const uchar *lineV = v;
389 quint32 *rgb1 = rgb + width;
391 for (
int i = 0; i + 1 < width; i += 2) {
393 lineU += uvPixelStride;
394 lineV += uvPixelStride;
396 *rgb0++ = qYUVToARGB32(*lineY0, rv, guv, bu);
398 *rgb0++ = qYUVToARGB32(*lineY0, rv, guv, bu);
400 *rgb1++ = qYUVToARGB32(*lineY1, rv, guv, bu);
402 *rgb1++ = qYUVToARGB32(*lineY1, rv, guv, bu);
471 qt_convert_to_ARGB32<ARGB8888>,
472 qt_convert_premultiplied_to_ARGB32<ARGB8888>,
473 qt_convert_premultiplied_to_ARGB32<XRGB8888>,
474 qt_convert_to_ARGB32<BGRA8888>,
475 qt_convert_premultiplied_to_ARGB32<BGRA8888>,
476 qt_convert_premultiplied_to_ARGB32<BGRX8888>,
477 qt_convert_to_ARGB32<ABGR8888>,
478 qt_convert_premultiplied_to_ARGB32<XBGR8888>,
479 qt_convert_to_ARGB32<RGBA8888>,
480 qt_convert_premultiplied_to_ARGB32<RGBX8888>,
481 qt_convert_AYUV_to_ARGB32,
482 qt_convert_AYUV_Premultiplied_to_ARGB32,
483 qt_convert_YUV420P_to_ARGB32,
484 qt_convert_YUV422P_to_ARGB32,
485 qt_convert_YV12_to_ARGB32,
486 qt_convert_UYVY_to_ARGB32,
487 qt_convert_YUYV_to_ARGB32,
488 qt_convert_NV12_to_ARGB32,
489 qt_convert_NV21_to_ARGB32,
490 qt_convert_IMC1_to_ARGB32,
491 qt_convert_IMC2_to_ARGB32,
492 qt_convert_IMC3_to_ARGB32,
493 qt_convert_IMC4_to_ARGB32,
494 qt_convert_Y_to_ARGB32<uchar>,
495 qt_convert_Y_to_ARGB32<ushort>,
496 qt_convert_P016_to_ARGB32,
497 qt_convert_P016_to_ARGB32,
507#ifdef QT_COMPILER_SUPPORTS_SSE2
508 extern void QT_FASTCALL qt_convert_ARGB8888_to_ARGB32_sse2(
const QVideoFrame &frame, uchar *output);
509 extern void QT_FASTCALL qt_convert_ABGR8888_to_ARGB32_sse2(
const QVideoFrame &frame, uchar *output);
510 extern void QT_FASTCALL qt_convert_RGBA8888_to_ARGB32_sse2(
const QVideoFrame &frame, uchar *output);
511 extern void QT_FASTCALL qt_convert_BGRA8888_to_ARGB32_sse2(
const QVideoFrame &frame, uchar *output);
512 extern void QT_FASTCALL qt_copy_pixels_with_mask_sse2(uint32_t * dst,
const uint32_t *src, size_t size, uint32_t mask);
514 if (qCpuHasFeature(SSE2)){
515 qConvertFuncs[QVideoFrameFormat::Format_ARGB8888] = qt_convert_ARGB8888_to_ARGB32_sse2;
516 qConvertFuncs[QVideoFrameFormat::Format_ARGB8888_Premultiplied] = qt_convert_ARGB8888_to_ARGB32_sse2;
517 qConvertFuncs[QVideoFrameFormat::Format_XRGB8888] = qt_convert_ARGB8888_to_ARGB32_sse2;
518 qConvertFuncs[QVideoFrameFormat::Format_BGRA8888] = qt_convert_BGRA8888_to_ARGB32_sse2;
519 qConvertFuncs[QVideoFrameFormat::Format_BGRA8888_Premultiplied] = qt_convert_BGRA8888_to_ARGB32_sse2;
520 qConvertFuncs[QVideoFrameFormat::Format_BGRX8888] = qt_convert_BGRA8888_to_ARGB32_sse2;
521 qConvertFuncs[QVideoFrameFormat::Format_ABGR8888] = qt_convert_ABGR8888_to_ARGB32_sse2;
522 qConvertFuncs[QVideoFrameFormat::Format_XBGR8888] = qt_convert_ABGR8888_to_ARGB32_sse2;
523 qConvertFuncs[QVideoFrameFormat::Format_RGBA8888] = qt_convert_RGBA8888_to_ARGB32_sse2;
524 qConvertFuncs[QVideoFrameFormat::Format_RGBX8888] = qt_convert_RGBA8888_to_ARGB32_sse2;
526 qPixelsCopyFunc = qt_copy_pixels_with_mask_sse2;
529#ifdef QT_COMPILER_SUPPORTS_SSSE3
530 extern void QT_FASTCALL qt_convert_ARGB8888_to_ARGB32_ssse3(
const QVideoFrame &frame, uchar *output);
531 extern void QT_FASTCALL qt_convert_ABGR8888_to_ARGB32_ssse3(
const QVideoFrame &frame, uchar *output);
532 extern void QT_FASTCALL qt_convert_RGBA8888_to_ARGB32_ssse3(
const QVideoFrame &frame, uchar *output);
533 extern void QT_FASTCALL qt_convert_BGRA8888_to_ARGB32_ssse3(
const QVideoFrame &frame, uchar *output);
534 if (qCpuHasFeature(SSSE3)){
535 qConvertFuncs[QVideoFrameFormat::Format_ARGB8888] = qt_convert_ARGB8888_to_ARGB32_ssse3;
536 qConvertFuncs[QVideoFrameFormat::Format_ARGB8888_Premultiplied] = qt_convert_ARGB8888_to_ARGB32_ssse3;
537 qConvertFuncs[QVideoFrameFormat::Format_XRGB8888] = qt_convert_ARGB8888_to_ARGB32_ssse3;
538 qConvertFuncs[QVideoFrameFormat::Format_BGRA8888] = qt_convert_BGRA8888_to_ARGB32_ssse3;
539 qConvertFuncs[QVideoFrameFormat::Format_BGRA8888_Premultiplied] = qt_convert_BGRA8888_to_ARGB32_ssse3;
540 qConvertFuncs[QVideoFrameFormat::Format_BGRX8888] = qt_convert_BGRA8888_to_ARGB32_ssse3;
541 qConvertFuncs[QVideoFrameFormat::Format_ABGR8888] = qt_convert_ABGR8888_to_ARGB32_ssse3;
542 qConvertFuncs[QVideoFrameFormat::Format_XBGR8888] = qt_convert_ABGR8888_to_ARGB32_ssse3;
543 qConvertFuncs[QVideoFrameFormat::Format_RGBA8888] = qt_convert_RGBA8888_to_ARGB32_ssse3;
544 qConvertFuncs[QVideoFrameFormat::Format_RGBX8888] = qt_convert_RGBA8888_to_ARGB32_ssse3;
547#ifdef QT_COMPILER_SUPPORTS_AVX2
548 extern void QT_FASTCALL qt_convert_ARGB8888_to_ARGB32_avx2(
const QVideoFrame &frame, uchar *output);
549 extern void QT_FASTCALL qt_convert_ABGR8888_to_ARGB32_avx2(
const QVideoFrame &frame, uchar *output);
550 extern void QT_FASTCALL qt_convert_RGBA8888_to_ARGB32_avx2(
const QVideoFrame &frame, uchar *output);
551 extern void QT_FASTCALL qt_convert_BGRA8888_to_ARGB32_avx2(
const QVideoFrame &frame, uchar *output);
552 extern void QT_FASTCALL qt_copy_pixels_with_mask_avx2(uint32_t * dst,
const uint32_t *src, size_t size, uint32_t mask);
553 if (qCpuHasFeature(AVX2)){
554 qConvertFuncs[QVideoFrameFormat::Format_ARGB8888] = qt_convert_ARGB8888_to_ARGB32_avx2;
555 qConvertFuncs[QVideoFrameFormat::Format_ARGB8888_Premultiplied] = qt_convert_ARGB8888_to_ARGB32_avx2;
556 qConvertFuncs[QVideoFrameFormat::Format_XRGB8888] = qt_convert_ARGB8888_to_ARGB32_avx2;
557 qConvertFuncs[QVideoFrameFormat::Format_BGRA8888] = qt_convert_BGRA8888_to_ARGB32_avx2;
558 qConvertFuncs[QVideoFrameFormat::Format_BGRA8888_Premultiplied] = qt_convert_BGRA8888_to_ARGB32_avx2;
559 qConvertFuncs[QVideoFrameFormat::Format_BGRX8888] = qt_convert_BGRA8888_to_ARGB32_avx2;
560 qConvertFuncs[QVideoFrameFormat::Format_ABGR8888] = qt_convert_ABGR8888_to_ARGB32_avx2;
561 qConvertFuncs[QVideoFrameFormat::Format_XBGR8888] = qt_convert_ABGR8888_to_ARGB32_avx2;
562 qConvertFuncs[QVideoFrameFormat::Format_RGBA8888] = qt_convert_RGBA8888_to_ARGB32_avx2;
563 qConvertFuncs[QVideoFrameFormat::Format_RGBX8888] = qt_convert_RGBA8888_to_ARGB32_avx2;
565 qPixelsCopyFunc = qt_copy_pixels_with_mask_avx2;