diff options
Diffstat (limited to 'src/multimedia/video')
-rw-r--r-- | src/multimedia/video/qvideoframe.cpp | 26 | ||||
-rw-r--r-- | src/multimedia/video/qvideoframeconversionhelper.cpp | 94 | ||||
-rw-r--r-- | src/multimedia/video/qvideoframeconversionhelper_p.h | 7 | ||||
-rw-r--r-- | src/multimedia/video/qvideosurfaceformat.cpp | 21 | ||||
-rw-r--r-- | src/multimedia/video/qvideosurfaceformat.h | 5 | ||||
-rw-r--r-- | src/multimedia/video/qvideotexturehelper.cpp | 43 |
6 files changed, 0 insertions, 196 deletions
diff --git a/src/multimedia/video/qvideoframe.cpp b/src/multimedia/video/qvideoframe.cpp index a4a985a5f..720a7948b 100644 --- a/src/multimedia/video/qvideoframe.cpp +++ b/src/multimedia/video/qvideoframe.cpp @@ -60,22 +60,17 @@ static bool pixelFormatHasAlpha[QVideoSurfaceFormat::NPixelFormats] = true, //Format_ARGB32, true, //Format_ARGB32_Premultiplied, false, //Format_RGB32, - false, //Format_RGB24, false, //Format_RGB565, false, //Format_RGB555, - true, //Format_ARGB8565_Premultiplied, true, //Format_BGRA32, true, //Format_BGRA32_Premultiplied, true, //Format_ABGR32, false, //Format_BGR32, - false, //Format_BGR24, false, //Format_BGR565, false, //Format_BGR555, - true, //Format_BGRA5658_Premultiplied, true, //Format_AYUV444, true, //Format_AYUV444_Premultiplied, - false, //Format_YUV444, false, //Format_YUV420P, false, //Format_YUV422P, false, //Format_YV12, @@ -179,10 +174,6 @@ private: The frame stored using a 32-bit RGB format (0xffRRGGBB). This is equivalent to QImage::Format_RGB32 - \value Format_RGB24 - The frame is stored using a 24-bit RGB format (8-8-8). This is equivalent to - QImage::Format_RGB888 - \value Format_RGB565 The frame is stored using a 16-bit RGB format (5-6-5). This is equivalent to QImage::Format_RGB16. @@ -191,9 +182,6 @@ private: The frame is stored using a 16-bit RGB format (5-5-5). This is equivalent to QImage::Format_RGB555. - \value Format_ARGB8565_Premultiplied - The frame is stored using a 24-bit premultiplied ARGB format (8-5-6-5). - \value Format_BGRA32 The frame is stored using a 32-bit BGRA format (0xBBGGRRAA). @@ -206,27 +194,18 @@ private: \value Format_BGR32 The frame is stored using a 32-bit BGR format (0xBBGGRRff). - \value Format_BGR24 - The frame is stored using a 24-bit BGR format (0xBBGGRR). - \value Format_BGR565 The frame is stored using a 16-bit BGR format (5-6-5). \value Format_BGR555 The frame is stored using a 16-bit BGR format (5-5-5). - \value Format_BGRA5658_Premultiplied - The frame is stored using a 24-bit premultiplied BGRA format (5-6-5-8). - \value Format_AYUV444 The frame is stored using a packed 32-bit AYUV format (0xAAYYUUVV). \value Format_AYUV444_Premultiplied The frame is stored using a packed premultiplied 32-bit AYUV format (0xAAYYUUVV). - \value Format_YUV444 - The frame is stored using a 24-bit packed YUV format (8-8-8). - \value Format_YUV420P The frame is stored using an 8-bit per component planar YUV format with the U and V planes horizontally and vertically sub-sampled, i.e. the height and width of the U and V planes are @@ -589,21 +568,16 @@ bool QVideoFrame::map(QVideoFrame::MapMode mode) case QVideoSurfaceFormat::Format_ARGB32: case QVideoSurfaceFormat::Format_ARGB32_Premultiplied: case QVideoSurfaceFormat::Format_RGB32: - case QVideoSurfaceFormat::Format_RGB24: case QVideoSurfaceFormat::Format_RGB565: case QVideoSurfaceFormat::Format_RGB555: - case QVideoSurfaceFormat::Format_ARGB8565_Premultiplied: case QVideoSurfaceFormat::Format_BGRA32: case QVideoSurfaceFormat::Format_BGRA32_Premultiplied: case QVideoSurfaceFormat::Format_ABGR32: case QVideoSurfaceFormat::Format_BGR32: - case QVideoSurfaceFormat::Format_BGR24: case QVideoSurfaceFormat::Format_BGR565: case QVideoSurfaceFormat::Format_BGR555: - case QVideoSurfaceFormat::Format_BGRA5658_Premultiplied: case QVideoSurfaceFormat::Format_AYUV444: case QVideoSurfaceFormat::Format_AYUV444_Premultiplied: - case QVideoSurfaceFormat::Format_YUV444: case QVideoSurfaceFormat::Format_UYVY: case QVideoSurfaceFormat::Format_YUYV: case QVideoSurfaceFormat::Format_Y8: diff --git a/src/multimedia/video/qvideoframeconversionhelper.cpp b/src/multimedia/video/qvideoframeconversionhelper.cpp index 7612c88c3..bd1c21f24 100644 --- a/src/multimedia/video/qvideoframeconversionhelper.cpp +++ b/src/multimedia/video/qvideoframeconversionhelper.cpp @@ -213,30 +213,6 @@ static void QT_FASTCALL qt_convert_AYUV444_Premultiplied_to_ARGB32(const QVideoF } } -static void QT_FASTCALL qt_convert_YUV444_to_ARGB32(const QVideoFrame &frame, uchar *output) -{ - FETCH_INFO_PACKED(frame) - MERGE_LOOPS(width, height, stride, 3) - - quint32 *rgb = reinterpret_cast<quint32*>(output); - - for (int i = 0; i < height; ++i) { - const uchar *lineSrc = src; - - for (int j = 0; j < width; ++j) { - int y = *lineSrc++; - int u = *lineSrc++; - int v = *lineSrc++; - - EXPAND_UV(u, v); - - *rgb++ = qYUVToARGB32(y, rv, guv, bu); - } - - src += stride; - } -} - static void QT_FASTCALL qt_convert_UYVY_to_ARGB32(const QVideoFrame &frame, uchar *output) { FETCH_INFO_PACKED(frame) @@ -444,38 +420,6 @@ static void QT_FASTCALL qt_convert_ABGR32_to_ARGB32(const QVideoFrame &frame, uc } } -static void QT_FASTCALL qt_convert_BGR24_to_ARGB32(const QVideoFrame &frame, uchar *output) -{ - FETCH_INFO_PACKED(frame) - MERGE_LOOPS(width, height, stride, 3) - - quint32 *argb = reinterpret_cast<quint32*>(output); - - for (int y = 0; y < height; ++y) { - const uchar *bgr = src; - - int x = 0; - for (; x < width - 3; x += 4) { - *argb++ = qConvertBGR24ToARGB32(bgr); - bgr += 3; - *argb++ = qConvertBGR24ToARGB32(bgr); - bgr += 3; - *argb++ = qConvertBGR24ToARGB32(bgr); - bgr += 3; - *argb++ = qConvertBGR24ToARGB32(bgr); - bgr += 3; - } - - // leftovers - for (; x < width; ++x) { - *argb++ = qConvertBGR24ToARGB32(bgr); - bgr += 3; - } - - src += stride; - } -} - static void QT_FASTCALL qt_convert_BGR565_to_ARGB32(const QVideoFrame &frame, uchar *output) { FETCH_INFO_PACKED(frame) @@ -528,39 +472,6 @@ static void QT_FASTCALL qt_convert_BGR555_to_ARGB32(const QVideoFrame &frame, uc } } -static void QT_FASTCALL qt_convert_BGRA5658_to_ARGB32(const QVideoFrame &frame, uchar *output) -{ - FETCH_INFO_PACKED(frame) - MERGE_LOOPS(width, height, stride, 3) - - quint32 *argb = reinterpret_cast<quint32*>(output); - - for (int y = 0; y < height; ++y) { - const uchar *bgr = src; - - int x = 0; - for (; x < width - 3; x += 4) { - *argb++ = qConvertBGRA5658ToARGB32(bgr); - bgr += 3; - *argb++ = qConvertBGRA5658ToARGB32(bgr); - bgr += 3; - *argb++ = qConvertBGRA5658ToARGB32(bgr); - bgr += 3; - *argb++ = qConvertBGRA5658ToARGB32(bgr); - bgr += 3; - } - - // leftovers - for (; x < width; ++x) { - *argb++ = qConvertBGRA5658ToARGB32(bgr); - bgr += 3; - } - - src += stride; - } -} - - static inline void planarYUV420_16bit_to_ARGB32(const uchar *y, int yStride, const uchar *u, int uStride, const uchar *v, int vStride, @@ -629,21 +540,16 @@ static VideoFrameConvertFunc qConvertFuncs[QVideoSurfaceFormat::NPixelFormats] = /* Format_ARGB32 */ nullptr, // Not needed /* Format_ARGB32_Premultiplied */ nullptr, // Not needed /* Format_RGB32 */ nullptr, // Not needed - /* Format_RGB24 */ nullptr, // Not needed /* Format_RGB565 */ nullptr, // Not needed /* Format_RGB555 */ nullptr, // Not needed - /* Format_ARGB8565_Premultiplied */ nullptr, // Not needed /* Format_BGRA32 */ qt_convert_BGRA32_to_ARGB32, /* Format_BGRA32_Premultiplied */ qt_convert_BGRA32_Premultiplied_to_ARGB32, /* Format_ABGR32 */ qt_convert_ABGR32_to_ARGB32, /* Format_BGR32 */ qt_convert_BGRA32_Premultiplied_to_ARGB32, - /* Format_BGR24 */ qt_convert_BGR24_to_ARGB32, /* Format_BGR565 */ qt_convert_BGR565_to_ARGB32, /* Format_BGR555 */ qt_convert_BGR555_to_ARGB32, - /* Format_BGRA5658_Premultiplied */ qt_convert_BGRA5658_to_ARGB32, /* Format_AYUV444 */ qt_convert_AYUV444_to_ARGB32, /* Format_AYUV444_Premultiplied */ qt_convert_AYUV444_Premultiplied_to_ARGB32, - /* Format_YUV444 */ qt_convert_YUV444_to_ARGB32, /* Format_YUV420P */ qt_convert_YUV420P_to_ARGB32, /* Format_YUV422P */ qt_convert_YUV422P_to_ARGB32, /* Format_YV12 */ qt_convert_YV12_to_ARGB32, diff --git a/src/multimedia/video/qvideoframeconversionhelper_p.h b/src/multimedia/video/qvideoframeconversionhelper_p.h index 58edd48f2..1d633995c 100644 --- a/src/multimedia/video/qvideoframeconversionhelper_p.h +++ b/src/multimedia/video/qvideoframeconversionhelper_p.h @@ -80,13 +80,6 @@ inline quint32 qConvertBGR24ToARGB32(const uchar *bgr) return 0xFF000000 | bgr[0] | bgr[1] << 8 | bgr[2] << 16; } -inline quint32 qConvertBGRA5658ToARGB32(const uchar *bgr) -{ - return (bgr[0] & 0xf8) | (quint32(bgr[0] & 7) << 13) | - (quint32(bgr[1] & 0xe0) << 5) | (quint32(bgr[1] & 0x1f) << 3) | - bgr[2] << 24; -} - inline quint32 qConvertBGR565ToARGB32(quint16 bgr) { return 0xff000000 diff --git a/src/multimedia/video/qvideosurfaceformat.cpp b/src/multimedia/video/qvideosurfaceformat.cpp index 52fb3ea3b..8c562c2b8 100644 --- a/src/multimedia/video/qvideosurfaceformat.cpp +++ b/src/multimedia/video/qvideosurfaceformat.cpp @@ -432,12 +432,8 @@ QVideoSurfaceFormat::PixelFormat QVideoSurfaceFormat::pixelFormatFromImageFormat return QVideoSurfaceFormat::Format_ARGB32_Premultiplied; case QImage::Format_RGB16: return QVideoSurfaceFormat::Format_RGB565; - case QImage::Format_ARGB8565_Premultiplied: - return QVideoSurfaceFormat::Format_ARGB8565_Premultiplied; case QImage::Format_RGB555: return QVideoSurfaceFormat::Format_RGB555; - case QImage::Format_RGB888: - return QVideoSurfaceFormat::Format_RGB24; case QImage::Format_Grayscale8: return QVideoSurfaceFormat::Format_Y8; case QImage::Format_Grayscale16: @@ -463,14 +459,10 @@ QImage::Format QVideoSurfaceFormat::imageFormatFromPixelFormat(QVideoSurfaceForm return QImage::Format_ARGB32_Premultiplied; case QVideoSurfaceFormat::Format_RGB32: return QImage::Format_RGB32; - case QVideoSurfaceFormat::Format_RGB24: - return QImage::Format_RGB888; case QVideoSurfaceFormat::Format_RGB565: return QImage::Format_RGB16; case QVideoSurfaceFormat::Format_RGB555: return QImage::Format_RGB555; - case QVideoSurfaceFormat::Format_ARGB8565_Premultiplied: - return QImage::Format_ARGB8565_Premultiplied; case QVideoSurfaceFormat::Format_Y8: return QImage::Format_Grayscale8; case QVideoSurfaceFormat::Format_Y16: @@ -479,13 +471,10 @@ QImage::Format QVideoSurfaceFormat::imageFormatFromPixelFormat(QVideoSurfaceForm case QVideoSurfaceFormat::Format_BGRA32: case QVideoSurfaceFormat::Format_BGRA32_Premultiplied: case QVideoSurfaceFormat::Format_BGR32: - case QVideoSurfaceFormat::Format_BGR24: case QVideoSurfaceFormat::Format_BGR565: case QVideoSurfaceFormat::Format_BGR555: - case QVideoSurfaceFormat::Format_BGRA5658_Premultiplied: case QVideoSurfaceFormat::Format_AYUV444: case QVideoSurfaceFormat::Format_AYUV444_Premultiplied: - case QVideoSurfaceFormat::Format_YUV444: case QVideoSurfaceFormat::Format_YUV420P: case QVideoSurfaceFormat::Format_YUV422P: case QVideoSurfaceFormat::Format_YV12: @@ -582,14 +571,10 @@ QDebug operator<<(QDebug dbg, QVideoSurfaceFormat::PixelFormat pf) return dbg << "Format_ARGB32_Premultiplied"; case QVideoSurfaceFormat::Format_RGB32: return dbg << "Format_RGB32"; - case QVideoSurfaceFormat::Format_RGB24: - return dbg << "Format_RGB24"; case QVideoSurfaceFormat::Format_RGB565: return dbg << "Format_RGB565"; case QVideoSurfaceFormat::Format_RGB555: return dbg << "Format_RGB555"; - case QVideoSurfaceFormat::Format_ARGB8565_Premultiplied: - return dbg << "Format_ARGB8565_Premultiplied"; case QVideoSurfaceFormat::Format_BGRA32: return dbg << "Format_BGRA32"; case QVideoSurfaceFormat::Format_BGRA32_Premultiplied: @@ -598,20 +583,14 @@ QDebug operator<<(QDebug dbg, QVideoSurfaceFormat::PixelFormat pf) return dbg << "Format_ABGR32"; case QVideoSurfaceFormat::Format_BGR32: return dbg << "Format_BGR32"; - case QVideoSurfaceFormat::Format_BGR24: - return dbg << "Format_BGR24"; case QVideoSurfaceFormat::Format_BGR565: return dbg << "Format_BGR565"; case QVideoSurfaceFormat::Format_BGR555: return dbg << "Format_BGR555"; - case QVideoSurfaceFormat::Format_BGRA5658_Premultiplied: - return dbg << "Format_BGRA5658_Premultiplied"; case QVideoSurfaceFormat::Format_AYUV444: return dbg << "Format_AYUV444"; case QVideoSurfaceFormat::Format_AYUV444_Premultiplied: return dbg << "Format_AYUV444_Premultiplied"; - case QVideoSurfaceFormat::Format_YUV444: - return dbg << "Format_YUV444"; case QVideoSurfaceFormat::Format_YUV420P: return dbg << "Format_YUV420P"; case QVideoSurfaceFormat::Format_YUV422P: diff --git a/src/multimedia/video/qvideosurfaceformat.h b/src/multimedia/video/qvideosurfaceformat.h index 41b5c8292..6e231125f 100644 --- a/src/multimedia/video/qvideosurfaceformat.h +++ b/src/multimedia/video/qvideosurfaceformat.h @@ -65,22 +65,17 @@ public: Format_ARGB32, Format_ARGB32_Premultiplied, Format_RGB32, - Format_RGB24, Format_RGB565, Format_RGB555, - Format_ARGB8565_Premultiplied, Format_BGRA32, Format_BGRA32_Premultiplied, Format_ABGR32, Format_BGR32, - Format_BGR24, Format_BGR565, Format_BGR555, - Format_BGRA5658_Premultiplied, Format_AYUV444, Format_AYUV444_Premultiplied, - Format_YUV444, Format_YUV420P, Format_YUV422P, Format_YV12, diff --git a/src/multimedia/video/qvideotexturehelper.cpp b/src/multimedia/video/qvideotexturehelper.cpp index 4465ae6f1..ff0f43db0 100644 --- a/src/multimedia/video/qvideotexturehelper.cpp +++ b/src/multimedia/video/qvideotexturehelper.cpp @@ -64,11 +64,6 @@ static const TextureDescription descriptions[QVideoSurfaceFormat::NPixelFormats] { QRhiTexture::BGRA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, - // Format_RGB24 - { 1, - { QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, - { { 1, 1 }, { 1, 1 }, { 1, 1 } } - }, // Format_RGB565 { 1, { QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, @@ -79,11 +74,6 @@ static const TextureDescription descriptions[QVideoSurfaceFormat::NPixelFormats] { QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, - // Format_ARGB8565_Premultiplied - { 1, - { QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, - { { 1, 1 }, { 1, 1 }, { 1, 1 } } - }, // Format_BGRA32 { 1, { QRhiTexture::BGRA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, @@ -104,11 +94,6 @@ static const TextureDescription descriptions[QVideoSurfaceFormat::NPixelFormats] { QRhiTexture::BGRA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, - // Format_BGR24 - { 1, - { QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, - { { 1, 1 }, { 1, 1 }, { 1, 1 } } - }, // Format_BGR565 { 1, { QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, @@ -119,11 +104,6 @@ static const TextureDescription descriptions[QVideoSurfaceFormat::NPixelFormats] { QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, - // Format_BGRA5658_Premultiplied - { 1, - { QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, - { { 1, 1 }, { 1, 1 }, { 1, 1 } } - }, // Format_AYUV444 { 1, @@ -135,11 +115,6 @@ static const TextureDescription descriptions[QVideoSurfaceFormat::NPixelFormats] { QRhiTexture::BGRA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, - // Format_YUV444 - { 1, - { QRhiTexture::BGRA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, - { { 1, 1 }, { 1, 1 }, { 1, 1 } } - }, // Format_YUV420P { 3, { QRhiTexture::R8, QRhiTexture::R8, QRhiTexture::R8 }, @@ -246,20 +221,14 @@ QString vertexShaderFileName(QVideoSurfaceFormat::PixelFormat format) case QVideoSurfaceFormat::Format_Invalid: case QVideoSurfaceFormat::Format_Jpeg: - case QVideoSurfaceFormat::Format_RGB24: case QVideoSurfaceFormat::Format_RGB565: case QVideoSurfaceFormat::Format_RGB555: - case QVideoSurfaceFormat::Format_ARGB8565_Premultiplied: - case QVideoSurfaceFormat::Format_BGR24: case QVideoSurfaceFormat::Format_BGR565: case QVideoSurfaceFormat::Format_BGR555: - case QVideoSurfaceFormat::Format_BGRA5658_Premultiplied: case QVideoSurfaceFormat::Format_Y8: case QVideoSurfaceFormat::Format_Y16: - case QVideoSurfaceFormat::Format_YUV444: - case QVideoSurfaceFormat::Format_IMC1: case QVideoSurfaceFormat::Format_IMC2: case QVideoSurfaceFormat::Format_IMC3: @@ -297,20 +266,14 @@ QString fragmentShaderFileName(QVideoSurfaceFormat::PixelFormat format) case QVideoSurfaceFormat::Format_Invalid: case QVideoSurfaceFormat::Format_Jpeg: - case QVideoSurfaceFormat::Format_RGB24: case QVideoSurfaceFormat::Format_RGB565: case QVideoSurfaceFormat::Format_RGB555: - case QVideoSurfaceFormat::Format_ARGB8565_Premultiplied: - case QVideoSurfaceFormat::Format_BGR24: case QVideoSurfaceFormat::Format_BGR565: case QVideoSurfaceFormat::Format_BGR555: - case QVideoSurfaceFormat::Format_BGRA5658_Premultiplied: case QVideoSurfaceFormat::Format_Y8: case QVideoSurfaceFormat::Format_Y16: - case QVideoSurfaceFormat::Format_YUV444: - case QVideoSurfaceFormat::Format_IMC1: case QVideoSurfaceFormat::Format_IMC2: case QVideoSurfaceFormat::Format_IMC3: @@ -383,20 +346,14 @@ QByteArray uniformData(const QVideoSurfaceFormat &format, const QMatrix4x4 &tran case QVideoSurfaceFormat::Format_Invalid: case QVideoSurfaceFormat::Format_Jpeg: - case QVideoSurfaceFormat::Format_RGB24: case QVideoSurfaceFormat::Format_RGB565: case QVideoSurfaceFormat::Format_RGB555: - case QVideoSurfaceFormat::Format_ARGB8565_Premultiplied: - case QVideoSurfaceFormat::Format_BGR24: case QVideoSurfaceFormat::Format_BGR565: case QVideoSurfaceFormat::Format_BGR555: - case QVideoSurfaceFormat::Format_BGRA5658_Premultiplied: case QVideoSurfaceFormat::Format_Y8: case QVideoSurfaceFormat::Format_Y16: - case QVideoSurfaceFormat::Format_YUV444: - case QVideoSurfaceFormat::Format_IMC1: case QVideoSurfaceFormat::Format_IMC2: case QVideoSurfaceFormat::Format_IMC3: |