CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 547
Description
From reading the current code
Lines 3477 to 3504 in bb9223e
auto parseMatrixString = [&](const CString & sYuvMatrix) { | |
int nPos = 0; | |
CString range = sYuvMatrix.Tokenize(_T("."), nPos); | |
CString matrix = sYuvMatrix.Mid(nPos); | |
yuvRange = ColorConvTable::RANGE_TV; | |
if (range == _T("PC")) { | |
yuvRange = ColorConvTable::RANGE_PC; | |
} | |
if (matrix == _T("709")) { | |
yuvMatrix = ColorConvTable::BT709; | |
} else if (matrix == _T("240M")) { | |
yuvMatrix = ColorConvTable::BT709; | |
} else if (matrix == _T("601")) { | |
yuvMatrix = ColorConvTable::BT601; | |
} else if (matrix == _T("2020")) { | |
yuvMatrix = ColorConvTable::BT2020; | |
} else { | |
yuvMatrix = ColorConvTable::NONE; | |
} | |
}; | |
if (!m_sYCbCrMatrix.IsEmpty()) { | |
parseMatrixString(m_sYCbCrMatrix); | |
} else { | |
parseMatrixString(yuvVideoMatrix); | |
} |
it appears to me as if MPC-HC’s ISR defaults to using effectively no colour mangling (by using the video colourspace) if no header was set and doesn't explicitly implement
YCbCr Matrix: None
. None
is a special header value to opt out of any colour mangling as far as possible for the renderer. Instead though all unknown values (so including None
) are assigned ColorConvTable::NONE
.I'm not sure where this value is later used by ISR for ASS subs, but from the conditionals for
::NONE
in PGSSub.cpp and DVBSub.cpp it appears like this amounts to a resolution dependent guess between TV.601
and TV.709
.
Regardless of what ::NONE
really does, this doesn't line up with xy-VSFilter/XySubFilter's behaviour and libass' recommendations as YCbCr Matrix: None
should be different from an invalid value.
No header or an invalid value should be equal to an explicit TV.601
and while xy-VSFilter (but not XySubFilter) does a similar guessing for explicit None
, it only does so due to lack of actual colour information which ISR appears to have. Assuming you want ISR to be more compatible with other renderers (and if I understood the code correctly), I suggest using yuvVideoMatrix
for YCbCr Matrix: None
and equate no or an invalid header to "TV.601"
.
For more information and some historic background, see e.g. libass docs:
https://github.com/libass/libass/blob/5f57443f1784434fe8961275da08be6d6febc688/libass/ass_types.h#L152-L199
Also the libass rendering backend should read track->YCbCrMatrix
and deal with it as described in the above docs. It appears like this field is currently unused. (Same for ass_set_storage_size
but that's unrelated to colour mangling.)