trim 16 bytes from each recording::Segment

This reduces the working set by another 960 bytes for a typical one-hour recording, improving cache efficiency a bit more.

8 bytes from SampleIndexIterator:
   * reduce the three "bytes" fields to two. Doing so as "bytes_key" vs
     "bytes_nonkey" slowed it down a bit, perhaps because the "bytes" is
     needed right away and requires a branch. But "bytes" vs "bytes_other"
     seems fine. Looks like it can do this with cmovs in parallel with other
     stuff.
   * stuff "is_key" into the "i" field.

8 bytes from recording::Segment itself:
   * make "frames" and "key_frame" u16s
   * stuff "trailing_zero" into "video_sample_entry_id"
This commit is contained in:
Scott Lamb
2017-02-27 21:14:06 -08:00
parent 15609ddb8e
commit ce363162f4
4 changed files with 114 additions and 86 deletions

View File

@@ -79,7 +79,7 @@ fn summarize_index(video_index: &[u8]) -> Result<RecordingSummary, Error> {
bytes += it.bytes as u64;
duration += it.duration_90k;
video_samples += 1;
video_sync_samples += if it.is_key { 1 } else { 0 };
video_sync_samples += it.is_key() as i32;
}
Ok(RecordingSummary{
bytes: bytes,