forge
Explore
Log in

Don't you dare go Hollow

The per-tile search job arms its own order hints

Browse files at this commit

aeaf6ba721d10a963086ebecc9578c14c3318c4aAhmet Kaan GümüşParent: 945005e
  • fix
    • the per-tile search job arms its own order hints
Show full message
fix(av1): the per-tile search job arms its own order hints

lane-av1tsearch moved the RD/motion search into one job per tile, and
ref_distance (the distance-scaled search step) reads tile.rs' ORDER_HINTS
thread-local: a search worker read (0, 0, [0; 7]) and scaled nothing, so the
coded bits depended on the thread count -- 2x1 tiles came out 9852 bytes at
one thread and 10034 at four. The inter search_tile closure now arms the
hints the same way the write jobs do.

encoder::tests::tile_bytes_do_not_depend_on_the_thread_count fails before this
and passes after. BD unchanged: +94.4/+104.3/+66.8 vs libaom.
crates/ec-av1/src/encode.rsmodified+5 -0
@@ -5537,6 +5537,11 @@ pub(crate) fn encode_inter_frame(
55375537 let search_tile = |index: usize,
55385538 fctx: &crate::decode::FrameCtx|
55395539 -> Result<Vec<(usize, Quadrant)>> {
5540+ // Thread-local, and this job may be running on a `search_tiles`
5541+ // worker: `ref_distance`'s order-hint distance (the scaled motion
5542+ // search step) is read by the SEARCH, so every worker arms it or the
5543+ // tile's bits depend on the thread count.
5544+ crate::tile::arm_order_hints(seq.order_hint_bits, order_hint, order_hints);
55405545 let rect = layout.rect(index);
55415546 let mut luma = fresh_plane(&picture_y8, frame_width, frame_height, true_width, true_height);
55425547 let mut chroma = [