Stop naming specific commercial discs in the AACS and codec comments
The same scrub as the previous commit, over the files it did not reach: the variant-MKB layout notes, the 2.1 segment index observations, the PPS-revert regressions and the playlist-twin tiebreak. Measurements keep their numbers — "a v70 `0x2d` body = 46_100*2 + 16" is the useful part, and the title it came from never was.
This commit is contained in:
+3
-3
@@ -25,7 +25,7 @@
|
||||
//! u32 start_spn | u32 end_spn (source-packet numbers, inclusive)
|
||||
//! ```
|
||||
//! `index` is the 1..32 forensic index tag, NOT a sequential segment id: measured
|
||||
//! on a retail 2.1 disc (Zombieland) it cycles 1,2,…,32,1,2,… across records in
|
||||
//! on a retail 2.1 disc it cycles 1,2,…,32,1,2,… across records in
|
||||
//! file order — 24 full cycles of 32 plus a final partial cycle of 24 = 792
|
||||
//! records. Source-packet numbers are the 192-byte BDAV packet index: byte offset
|
||||
//! = `spn * 192`. Each segment is ~2560 packets (~480 KB) = 80 aligned units,
|
||||
@@ -334,7 +334,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn parses_real_disc_layout() {
|
||||
// First three records observed on retail 2.1 (Zombieland): the variant
|
||||
// First three records observed on retail 2.1: the variant
|
||||
// field counts 1,2,3,… (it wraps at 32 further into the table — see
|
||||
// `index_field_cycles_one_to_thirty_two`), segments are 2560 packets.
|
||||
let tbl = build_tbl(&[
|
||||
@@ -396,7 +396,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn index_field_cycles_one_to_thirty_two() {
|
||||
// Reality on Zombieland: field@4 is the index, cycling 1..=32 in file
|
||||
// Reality on a retail 2.1 disc: field@4 is the index, cycling 1..=32 in file
|
||||
// order (NOT a sequential segment id). Reproduce one-and-a-bit cycles.
|
||||
let mut recs = Vec::new();
|
||||
let mut spn = 1000u32;
|
||||
|
||||
+4
-4
@@ -91,8 +91,8 @@ pub fn is_variant_mkb(records: &[MkbRecord]) -> bool {
|
||||
}
|
||||
|
||||
/// Body of the `0x2d` record: the `VARIANTS` table followed by the trailing
|
||||
/// 16-byte `Kvn` Nonce. Measured `46_100*2 + 16 = 92_216` on Zombieland v70 and
|
||||
/// `92_220` on Stand By Me v70 — in both, the leading `body.len() - 16` bytes are
|
||||
/// 16-byte `Kvn` Nonce. Measured `46_100*2 + 16 = 92_216` on one v70 disc and
|
||||
/// `92_220` on another — in both, the leading `body.len() - 16` bytes are
|
||||
/// the big-endian `u16` `VARIANTS` table (one per subset-difference) and the last
|
||||
/// 16 bytes are the Nonce, with NO leading header. This does NOT hold the C used
|
||||
/// for `Kmp` — that is the per-slot block in `0x0c`
|
||||
@@ -361,7 +361,7 @@ impl std::error::Error for MediaKeyVariantError {}
|
||||
/// Look up the per-slot `VARIANTS` value for the matched subset-difference slot,
|
||||
/// keyed by the same index that selected the cvalue ([`ProcessingKeyMatch::cvalue_index`]).
|
||||
///
|
||||
/// LAYOUT (fixed against a real 2.1 variant MKB — Zombieland v70, `MKB_RO.inf`):
|
||||
/// LAYOUT (fixed against a real 2.1 variant MKB — a v70 `MKB_RO.inf`):
|
||||
/// the `0x2d` Encrypted-Media-Key-Variant-Data body is exactly
|
||||
/// `46_100*2 + 16 = 92_216` bytes, i.e. one **big-endian u16 `VARIANTS` entry per
|
||||
/// subset-difference slot** (1:1 with the `0x0c` variant cvalues and the `0x04`
|
||||
@@ -378,7 +378,7 @@ fn variants_for_uv(records: &[MkbRecord], sd_slot_index: usize) -> Option<u16> {
|
||||
// The VARIANTS table is the leading bytes; the 16-byte Kvn Nonce is packed at
|
||||
// the TAIL (see [`variant_nonce`]). Bound the read to the table region so a
|
||||
// near-end slot can never read Nonce bytes as a VARIANTS entry. NO leading
|
||||
// header (measured: Zombieland v70 `0x2d` body = 46_100*2 + 16 = 92_216).
|
||||
// header (measured: a v70 `0x2d` body = 46_100*2 + 16 = 92_216).
|
||||
const NONCE: usize = 16;
|
||||
let table_len = body.len().checked_sub(NONCE)?;
|
||||
let off = sd_slot_index.checked_mul(2)?;
|
||||
|
||||
+2
-2
@@ -2221,8 +2221,8 @@ impl Disc {
|
||||
.then_with(|| b.size_bytes.cmp(&a.size_bytes))
|
||||
// Tiebreak for equal-size twins: longer duration, then richer audio —
|
||||
// the same feature authored as sibling playlists (a full-audio main
|
||||
// vs an audio-reduced twin, e.g. Fight Club's 00800 [DTS-HD MA + 13
|
||||
// tracks] vs 00004 [stereo AC-3 only]). Prefer lossless-multichannel.
|
||||
// vs an audio-reduced twin: 00800 [DTS-HD MA + 13 tracks] vs
|
||||
// 00004 [stereo AC-3 only]). Prefer lossless-multichannel.
|
||||
.then_with(|| b.duration_secs.total_cmp(&a.duration_secs))
|
||||
.then_with(|| Self::audio_richness(b).cmp(&Self::audio_richness(a)))
|
||||
}
|
||||
|
||||
@@ -1168,7 +1168,7 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
/// Regression (Fight Club bug, H.264 variant): PPS id 0 = body A (→ avcC),
|
||||
/// Regression (the PPS revert bug, H.264 variant): PPS id 0 = body A (→ avcC),
|
||||
/// redefined to B, then switched BACK to A. A streaming decoder is on B; the
|
||||
/// revert to A == avcC must still be emitted in-band or the A-segment
|
||||
/// decodes against B.
|
||||
|
||||
@@ -1708,7 +1708,7 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
/// Regression (Fight Club UHD banded corruption): a stream redefines PPS
|
||||
/// Regression (UHD banded corruption): a stream redefines PPS
|
||||
/// id 0 mid-title, then a later keyframe arrives WITHOUT repeating it (the
|
||||
/// source relies on the decoder retaining the redefinition — valid for a
|
||||
/// raw bitstream). An hvcC player re-applies the FIRST (codecPrivate) PPS
|
||||
@@ -1856,7 +1856,7 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
/// Regression (Fight Club UHD, the real bug): id 0 is body A (→ hvcC), then
|
||||
/// Regression (a UHD title, the real bug): id 0 is body A (→ hvcC), then
|
||||
/// redefined to B, then the title switches BACK to A. A streaming decoder
|
||||
/// (hvcC at init, in-band updates only) is sitting on B; the switch back to
|
||||
/// A must be emitted IN-BAND even though A == codecPrivate, or the whole
|
||||
@@ -2604,7 +2604,7 @@ mod tests {
|
||||
// PES4: back to PPS-A. Even though A == codecPrivate, the ACTIVE set is
|
||||
// B, so switching to A is a real change and MUST be emitted in-band — a
|
||||
// streaming decoder (hvcC at init, in-band updates only) is sitting on B
|
||||
// and would otherwise never revert. (This is the Fight Club bug: the old
|
||||
// and would otherwise never revert. (This is the PPS revert bug: the old
|
||||
// `== codecPrivate → strip` rule dropped exactly this revert.)
|
||||
let mut d = pps(0xAA);
|
||||
d.extend(slice());
|
||||
|
||||
Reference in New Issue
Block a user