forge
Explore
Log in

Don't you dare go Hollow

Size the P_Skip rebate to what skipping actually saves

Browse files at this commit

1bfd0701844b8caa1bdd9323cf39bf6ff676f304Ahmet Kaan GümüşParent: 942a61a
  • perf
    • size the P_Skip rebate to what skipping actually saves
Show full message
perf(h264): size the P_Skip rebate to what skipping actually saves

The skip candidate was handed a four-bit rebate. Sweeping it against
x264 on three clips puts the flat part of the curve at 0-2 bits: on a
3840x1608 film clip at GOP 10, 0 and 2 read -0.113 and -0.110 dB where
4 reads -0.233 and 8 reads -0.708. The screen capture and the synthetic
clip move by 0.01 dB across the same range.

Two rather than zero because skipping does save signalling, and two is
the top of the flat region.
crates/ec-h264/src/enc/mb.rsmodified+6 -1
@@ -653,7 +653,12 @@ fn choose_inter(pic: &Picture, e: &MbEnc<'_>, mb_x: usize, mb_y: usize) -> Inter
653 let skip_cost = {653 let skip_cost = {
654 let mut buf = [0u8; 256];654 let mut buf = [0u8; 256];
655 mc_luma(&plane, sx as i32, sy as i32, skip_mv, 16, 16, 16, &mut buf);655 mc_luma(&plane, sx as i32, sy as i32, skip_mv, 16, 16, 16, &mut buf);
656- satd_block(&e.src.y, sw, sx, sy, &buf, 16, 0, 16, 16) - motion_rate(e, 4.0)656+ // P_Skip's rebate is the signalling it genuinely saves, and two bits is
657+ // where the measurement is flat: 0 and 2 read -0.113 and -0.110 dB
658+ // BD-PSNR against x264 on the film clip at GOP 10 where the four this
659+ // used to claim reads -0.233 dB and eight reads -0.708 dB. The screen
660+ // capture and the synthetic clip move by 0.01 dB across 0, 2 and 4.
661+ satd_block(&e.src.y, sw, sx, sy, &buf, 16, 0, 16, 16) - motion_rate(e, 2.0)
657 };662 };
658 663
659 let mut best = (PShape::Whole, [mv16, mv16], cost16);664 let mut best = (PShape::Whole, [mv16, mv16], cost16);