forge
Explore
Log in

Don't you dare go Hollow

A local-warp candidate behind EC_AV1_WARP

Browse files at this commit

a745879568eaf4e9d91557d09e325288651cb05dAhmet Kaan GümüşParent: fbf67c0
  • feat
    • a local-warp candidate behind EC_AV1_WARP
Show full message
feat(av1): a local-warp candidate behind EC_AV1_WARP

The 3-symbol motion_mode alphabet in the tile writer (num_proj_ref
mirrored from the decoder), the encoder-side WARPED_CAUSAL candidate
built by the decoder's own find_samples/select_samples/find_projection/
warp_affine, and the frame's allow_warped_motion threaded into the
encoder's trial decode -- hard-coding it false there desynced every
warp-knob stream.
crates/ec-av1/src/decode.rsmodified+23 -2
@@ -33092,7 +33092,7 @@ pub(crate) fn decode_inter_frame_tile(
33092 loop_filter, allow_high_precision_mv, force_integer_mv, interp_fixed,33092 loop_filter, allow_high_precision_mv, force_integer_mv, interp_fixed,
33093 enable_dual_filter, reference_select, tx_select,33093 enable_dual_filter, reference_select, tx_select,
33094 &LoopRestorationParams::default(), initial_cdfs, NO_SIGN_BIAS, false,33094 &LoopRestorationParams::default(), initial_cdfs, NO_SIGN_BIAS, false,
33095- switchable_motion_mode, fctx,33095+ switchable_motion_mode, false, fctx,
33096 )33096 )
33097 }33097 }
33098 33098
@@ -33138,6 +33138,12 @@ pub(crate) fn decode_inter_frame_tile_lr(
33138 // crate's own encoder writes once inter blocks started carrying a33138 // crate's own encoder writes once inter blocks started carrying a
33139 // `motion_mode` symbol (class: test asserts against a stale header).33139 // `motion_mode` symbol (class: test asserts against a stale header).
33140 switchable_motion_mode: bool,33140 switchable_motion_mode: bool,
33141+ // lane-av1obmc2: this frame header's own `allow_warped_motion` (spec
33142+ // 5.9.2) -- what picks the 3-symbol `motion_mode_cdf` alphabet over the
33143+ // 2-symbol `obmc_cdf` one at a block with a warp sample. Hard-coding
33144+ // `false` here desynced every stream this crate's encoder writes with the
33145+ // warp knob on: the same stale-header class as the parameter above.
33146+ allow_warped_motion: bool,
33141 fctx: &crate::decode::FrameCtx,33147 fctx: &crate::decode::FrameCtx,
33142 ) -> Result<Picture> {33148 ) -> Result<Picture> {
33143 let single_tile = TileInfo {33149 let single_tile = TileInfo {
@@ -33167,6 +33173,7 @@ pub(crate) fn decode_inter_frame_tile_lr(
33167 sign_bias,33173 sign_bias,
33168 allow_screen_content_tools,33174 allow_screen_content_tools,
33169 switchable_motion_mode,33175 switchable_motion_mode,
33176+ allow_warped_motion,
33170 fctx,33177 fctx,
33171 )33178 )
33172 }33179 }
@@ -33202,6 +33209,12 @@ pub(crate) fn decode_inter_frame_tiles_lr(
33202 // crate's own encoder writes once inter blocks started carrying a33209 // crate's own encoder writes once inter blocks started carrying a
33203 // `motion_mode` symbol (class: test asserts against a stale header).33210 // `motion_mode` symbol (class: test asserts against a stale header).
33204 switchable_motion_mode: bool,33211 switchable_motion_mode: bool,
33212+ // lane-av1obmc2: this frame header's own `allow_warped_motion` (spec
33213+ // 5.9.2) -- what picks the 3-symbol `motion_mode_cdf` alphabet over the
33214+ // 2-symbol `obmc_cdf` one at a block with a warp sample. Hard-coding
33215+ // `false` here desynced every stream this crate's encoder writes with the
33216+ // warp knob on: the same stale-header class as the parameter above.
33217+ allow_warped_motion: bool,
33205 fctx: &crate::decode::FrameCtx,33218 fctx: &crate::decode::FrameCtx,
33206 ) -> Result<Picture> {33219 ) -> Result<Picture> {
33207 decode_inter_frame_tile_with_cdfs(33220 decode_inter_frame_tile_with_cdfs(
@@ -33237,7 +33250,7 @@ pub(crate) fn decode_inter_frame_tiles_lr(
33237 true,33250 true,
33238 tx_select,33251 tx_select,
33239 switchable_motion_mode,33252 switchable_motion_mode,
33240- false,33253+ allow_warped_motion,
33241 allow_screen_content_tools,33254 allow_screen_content_tools,
33242 DeltaParams::default(),33255 DeltaParams::default(),
33243 // `enable_filter_intra`: this crate's own encoder never writes the33256 // `enable_filter_intra`: this crate's own encoder never writes the
@@ -37790,6 +37803,10 @@ mod tests {
37790 // Same stale-header class: the bit that makes this frame's37803 // Same stale-header class: the bit that makes this frame's
37791 // inter blocks carry a `motion_mode` symbol.37804 // inter blocks carry a `motion_mode` symbol.
37792 frame.switchable_motion_mode,37805 frame.switchable_motion_mode,
37806+ // These GOP round trips decode a tile the encoder wrote, so
37807+ // the warp bit must be the one it wrote too (lane-av1obmc2);
37808+ // the encoder only sets it under `EC_AV1_WARP`.
37809+ crate::envflags::env_flag!("EC_AV1_WARP"),
37793 fctx,37810 fctx,
37794 )37811 )
37795 .unwrap();37812 .unwrap();
@@ -38124,6 +38141,10 @@ mod tests {
38124 // Same stale-header class: the bit that makes this frame's38141 // Same stale-header class: the bit that makes this frame's
38125 // inter blocks carry a `motion_mode` symbol.38142 // inter blocks carry a `motion_mode` symbol.
38126 frame.switchable_motion_mode,38143 frame.switchable_motion_mode,
38144+ // These GOP round trips decode a tile the encoder wrote, so
38145+ // the warp bit must be the one it wrote too (lane-av1obmc2);
38146+ // the encoder only sets it under `EC_AV1_WARP`.
38147+ crate::envflags::env_flag!("EC_AV1_WARP"),
38127 fctx,38148 fctx,
38128 )38149 )
38129 .unwrap();38150 .unwrap();
crates/ec-av1/src/encode.rsmodified+1 -0
@@ -7710,6 +7710,7 @@ pub(crate) fn encode_inter_frame(
7710 sign_bias,7710 sign_bias,
7711 h.allow_screen_content_tools,7711 h.allow_screen_content_tools,
7712 switchable_motion_mode,7712 switchable_motion_mode,
7713+ h.allow_warped_motion,
7713 fctx,7714 fctx,
7714 )7715 )
7715 },7716 },