Skip to content

Commit

Permalink
[UNTESTED] DirectVobSubFilter: stop overriding known BT.601 matrices
Browse files Browse the repository at this point in the history
Commit e928f83 allowed colorimetry
information to be received from the DirectShow filter chain, so we don’t
need to rely on resolution-based guesses as much.
However, since it only checked for BT709 (and assigned a suboptimal
fallback for SMPTE240) but not BT601, a known-to-be BT601 matrix
was still overriden by the fallback guess for larger video resolutions.
  • Loading branch information
TheOneric committed Feb 7, 2023
1 parent e695750 commit 9729c23
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/filters/transform/vsfilter/DirectVobSubFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2287,10 +2287,22 @@ void CDirectVobSubFilter::SetYuvMatrix()
}
else
{
yuv_matrix = (extformat.VideoTransferMatrix == DXVA2_VideoTransferMatrix_BT709 ||
extformat.VideoTransferMatrix == DXVA2_VideoTransferMatrix_SMPTE240M ||
m_xy_size_opt[SIZE_ORIGINAL_VIDEO].cx > m_bt601Width ||
m_xy_size_opt[SIZE_ORIGINAL_VIDEO].cy > m_bt601Height) ? ColorConvTable::BT709 : ColorConvTable::BT601;
switch (extformat.VideoTransferMatrix)
{
// FIXME: ColorConvTable doesn't support SMPTE240M.
// Since it's more similar to BT709 than BT601, prefer the former.
case DXVA2_VideoTransferMatrix_SMPTE240M: // -fallthrough
case DXVA2_VideoTransferMatrix_BT709:
yuv_matrix = ColorConvTable::BT709;
break;
case DXVA2_VideoTransferMatrix_BT601:
yuv_matrix = ColorConvTable::BT601;
break;
default:
yuv_matrix = (m_xy_size_opt[SIZE_ORIGINAL_VIDEO].cx > m_bt601Width ||
m_xy_size_opt[SIZE_ORIGINAL_VIDEO].cy > m_bt601Height) ?
ColorConvTable::BT709 : ColorConvTable::BT601;
}
}
}
else
Expand Down

0 comments on commit 9729c23

Please sign in to comment.