Skip to content

Commit

Permalink
y4m: Use more accurate values for PAR
Browse files Browse the repository at this point in the history
The old values were close enough, but change them to follow EBU R92
and SMPTE RP 187.
  • Loading branch information
ifb committed Feb 5, 2024
1 parent c85594a commit e48c519
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tools/ld-chroma-decoder/outputwriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,19 @@ QByteArray OutputWriter::getStreamHeader() const
}

// Pixel aspect ratio
// XXX Can this be computed, in case the width has been adjusted?
// Follows EBU R92 and SMPTE RP 187 except that values are scaled from
// BT.601 sampling (13.5 MHz) to 4fSC
if (videoParameters.system == PAL) {
if (videoParameters.isWidescreen) {
str << " A512:461"; // (16 / 9) * (576 / 922)
str << " A865:779"; // (16 / 9) * (576 / (702 * 4*fSC / 13.5))
} else {
str << " A384:461"; // (4 / 3) * (576 / 922)
str << " A259:311"; // (4 / 3) * (576 / (702 * 4*fSC / 13.5))
}
} else {
if (videoParameters.isWidescreen) {
str << " A194:171"; // (16 / 9) * (485 / 760)
str << " A25:22"; // (16 / 9) * (480 / (708 * 4*fSC / 13.5))
} else {
str << " A97:114"; // (4 / 3) * (485 / 760)
str << " A352:413"; // (4 / 3) * (480 / (708 * 4*fSC / 13.5))
}
}

Expand Down

0 comments on commit e48c519

Please sign in to comment.