Skip to content

Commit

Permalink
Correctly chunk sse calc in importance block sizes
Browse files Browse the repository at this point in the history
A previous patch tried to do this, but missed the 4x4 case on subsampled
frames. Roughly 2% speedup on the default speed level.
  • Loading branch information
KyleSiefring committed Jun 15, 2020
1 parent db69fb4 commit 0680e52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rdo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ pub fn sse_wxh<T: Pixel, F: Fn(Area, BlockSize) -> DistortionScale>(

// To bias the distortion correctly, compute it in blocks up to the size
// importance block size in a non-subsampled plane.
let imp_block_w = IMPORTANCE_BLOCK_SIZE.min(w);
let imp_block_h = IMPORTANCE_BLOCK_SIZE.min(h);
let imp_block_w = IMPORTANCE_BLOCK_SIZE.min(w << src1.plane_cfg.xdec);
let imp_block_h = IMPORTANCE_BLOCK_SIZE.min(h << src1.plane_cfg.ydec);
let imp_bsize = BlockSize::from_width_and_height(imp_block_w, imp_block_h);
let block_w = imp_block_w >> src1.plane_cfg.xdec;
let block_h = imp_block_h >> src1.plane_cfg.ydec;
Expand Down

0 comments on commit 0680e52

Please sign in to comment.