mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2026-02-20 15:23:01 -05:00
avif: YCgCo-Re decoding fix
This commit is contained in:
@ -265,9 +265,15 @@ bool QAVIFHandler::decode_one_frame()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t resultdepth = m_decoder->image->depth;
|
||||||
|
if (m_decoder->image->matrixCoefficients == 16 && m_decoder->image->yuvFormat == AVIF_PIXEL_FORMAT_YUV444 && resultdepth == 10) {
|
||||||
|
// 10-bit YCgCo-Re AVIF must be decoded to 8bit
|
||||||
|
resultdepth = 8;
|
||||||
|
}
|
||||||
|
|
||||||
QImage::Format resultformat;
|
QImage::Format resultformat;
|
||||||
|
|
||||||
if (m_decoder->image->depth > 8) {
|
if (resultdepth > 8) {
|
||||||
if (loadalpha) {
|
if (loadalpha) {
|
||||||
resultformat = QImage::Format_RGBA64;
|
resultformat = QImage::Format_RGBA64;
|
||||||
} else {
|
} else {
|
||||||
@ -405,7 +411,7 @@ bool QAVIFHandler::decode_one_frame()
|
|||||||
rgb.maxThreads = m_decoder->maxThreads;
|
rgb.maxThreads = m_decoder->maxThreads;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (m_decoder->image->depth > 8) {
|
if (resultdepth > 8) {
|
||||||
rgb.depth = 16;
|
rgb.depth = 16;
|
||||||
rgb.format = AVIF_RGB_FORMAT_RGBA;
|
rgb.format = AVIF_RGB_FORMAT_RGBA;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user