Improve commentary

This commit is contained in:
Salman Alshamrani
2024-10-29 00:55:47 -04:00
parent 7cfe36f9df
commit 7f436d5ff9
3 changed files with 13 additions and 4 deletions

View File

@@ -377,6 +377,8 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BNG/@EntryIndexedValue">BNG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UI/@EntryIndexedValue">UI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=WM/@EntryIndexedValue">WM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SDTV/@EntryIndexedValue">SDTV</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HDTV/@EntryIndexedValue">HDTV</s:String>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/ApplyAutoDetectedRules/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=EnumMember/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeStyle/CSharpFileLayoutPatterns/Pattern/@EntryValue">&lt;?xml version="1.0" encoding="utf-16"?&gt;&#xD;

View File

@@ -270,7 +270,7 @@ namespace osu.Framework.Tests.Visual.Sprites
Direction = FillDirection.Vertical,
Children = new[]
{
new SpriteText { Text = "SD / Rec. 601" },
new SpriteText { Text = "SDTV / Rec. 601" },
new TestVideo(videoStore.GetStream("h264.mp4")),
Empty().With(d => d.Height = 10),
new Sprite { Texture = textures.Get("h264-screenshot.png", WrapMode.ClampToEdge, WrapMode.ClampToEdge), Scale = new Vector2(2f) },
@@ -283,7 +283,7 @@ namespace osu.Framework.Tests.Visual.Sprites
Direction = FillDirection.Vertical,
Children = new[]
{
new SpriteText { Text = "HD / Rec. 709" },
new SpriteText { Text = "HDTV / Rec. 709" },
new TestVideo(videoStore.GetStream("h264-hd.mp4")) { Scale = new Vector2(270f / 576f) },
Empty().With(d => d.Height = 10),
new Sprite { Texture = textures.Get("h264-hd-screenshot.png", WrapMode.ClampToEdge, WrapMode.ClampToEdge), Scale = new Vector2(270f / 576f * 2f) },

View File

@@ -268,15 +268,22 @@ namespace osu.Framework.Graphics.Video
if (codecContext == null)
return Matrix3.Zero;
// this matches QuickTime Player's choice of colour spaces:
// - any video with width < 704 and height < 576 uses the SDTV colorspace.
// - any video with width >= 704 and height >= 576 uses the HDTV colorspace.
// (704x576 in particular has a special colour space, but we don't worry about it).
bool unspecifiedUsesHDTV = codecContext->width >= 704 || codecContext->height >= 576;
if (codecContext->colorspace == AVColorSpace.AVCOL_SPC_BT709
// matches QuickTime Player's choice of colour spaces (704x576 in particular uses a special colour space but we don't worry about it).
|| (codecContext->colorspace == AVColorSpace.AVCOL_SPC_UNSPECIFIED && (codecContext->width >= 704 || codecContext->height >= 576)))
|| (codecContext->colorspace == AVColorSpace.AVCOL_SPC_UNSPECIFIED && unspecifiedUsesHDTV))
{
// matrix coefficients for HDTV / Rec. 709 colorspace.
return new Matrix3(1.164f, 1.164f, 1.164f,
0.000f, -0.213f, 2.112f,
1.793f, -0.533f, 0.000f);
}
// matrix coefficients for SDTV / Rec. 601 colorspace.
return new Matrix3(1.164f, 1.164f, 1.164f,
0.000f, -0.392f, 2.017f,
1.596f, -0.813f, 0.000f);