MCPcopy Create free account
hub / github.com/Aleksoid1978/VideoRenderer / GetExtendedFormatString

Function GetExtendedFormatString

Source/Helper.cpp:1213–1241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1211}
1212
1213void GetExtendedFormatString(LPCSTR (&strs)[6], const DXVA2_ExtendedFormat exFormat, const ColorSystem_t colorSystem)
1214{
1215 static LPCSTR chromalocation[] = { "unknown", "Center(MPEG-1)", nullptr, nullptr, nullptr, "Left(MPEG-2)", "TopLeft(PAL DV)", "TopLeft(Co-sited)" };
1216 static LPCSTR nominalrange[] = { "unknown", "0-255", "16-235", "48-208" };
1217 static LPCSTR transfermatrix[] = { "unknown", "BT.709", "BT.601", "SMPTE 240M", "BT.2020", nullptr, nullptr, "YCgCo" };
1218 static LPCSTR lighting[] = { "unknown", "bright", "office", "dim", "dark" };
1219 static LPCSTR primaries[] = { "unknown", "Reserved", "BT.709", "BT.470-4 System M", "BT.470-4 System B,G",
1220 "SMPTE 170M", "SMPTE 240M", "EBU Tech. 3213", "SMPTE C", "BT.2020" };
1221 static LPCSTR transfunc[] = { "unknown", "Linear RGB", "1.8 gamma", "2.0 gamma", "2.2 gamma", "BT.709", "SMPTE 240M",
1222 "sRGB", "2.8 gamma", "Log100", "Log316", "Symmetric BT.709", "Constant luminance BT.2020", "Non-constant luminance BT.2020",
1223 "2.6 gamma", "SMPTE ST 2084 (PQ)", "ARIB STD-B67 (HLG)"};
1224
1225 auto getDesc = [] (unsigned num, LPCSTR* descs, unsigned count) {
1226 if (num < count && descs[num]) {
1227 return descs[num];
1228 } else {
1229 return "invalid";
1230 }
1231 };
1232
1233 if (colorSystem == CS_YUV) {
1234 strs[0] = getDesc(exFormat.VideoChromaSubsampling, chromalocation, std::size(chromalocation));
1235 strs[1] = getDesc(exFormat.NominalRange, nominalrange, std::size(nominalrange));
1236 strs[2] = getDesc(exFormat.VideoTransferMatrix, transfermatrix, std::size(transfermatrix));
1237 strs[3] = getDesc(exFormat.VideoLighting, lighting, std::size(lighting));
1238 strs[4] = getDesc(exFormat.VideoPrimaries, primaries, std::size(primaries));
1239 strs[5] = getDesc(exFormat.VideoTransferFunction, transfunc, std::size(transfunc));
1240 }
1241}

Callers 1

UpdateStatsInputFmtMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected