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(
3309233092 loop_filter, allow_high_precision_mv, force_integer_mv, interp_fixed,
3309333093 enable_dual_filter, reference_select, tx_select,
3309433094 &LoopRestorationParams::default(), initial_cdfs, NO_SIGN_BIAS, false,
33095- switchable_motion_mode, fctx,
33095+ switchable_motion_mode, false, fctx,
3309633096 )
3309733097 }
3309833098
@@ -33138,6 +33138,12 @@ pub(crate) fn decode_inter_frame_tile_lr(
3313833138 // crate's own encoder writes once inter blocks started carrying a
3313933139 // `motion_mode` symbol (class: test asserts against a stale header).
3314033140 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,
3314133147 fctx: &crate::decode::FrameCtx,
3314233148 ) -> Result<Picture> {
3314333149 let single_tile = TileInfo {
@@ -33167,6 +33173,7 @@ pub(crate) fn decode_inter_frame_tile_lr(
3316733173 sign_bias,
3316833174 allow_screen_content_tools,
3316933175 switchable_motion_mode,
33176+ allow_warped_motion,
3317033177 fctx,
3317133178 )
3317233179 }
@@ -33202,6 +33209,12 @@ pub(crate) fn decode_inter_frame_tiles_lr(
3320233209 // crate's own encoder writes once inter blocks started carrying a
3320333210 // `motion_mode` symbol (class: test asserts against a stale header).
3320433211 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,
3320533218 fctx: &crate::decode::FrameCtx,
3320633219 ) -> Result<Picture> {
3320733220 decode_inter_frame_tile_with_cdfs(
@@ -33237,7 +33250,7 @@ pub(crate) fn decode_inter_frame_tiles_lr(
3323733250 true,
3323833251 tx_select,
3323933252 switchable_motion_mode,
33240- false,
33253+ allow_warped_motion,
3324133254 allow_screen_content_tools,
3324233255 DeltaParams::default(),
3324333256 // `enable_filter_intra`: this crate's own encoder never writes the
@@ -37790,6 +37803,10 @@ mod tests {
3779037803 // Same stale-header class: the bit that makes this frame's
3779137804 // inter blocks carry a `motion_mode` symbol.
3779237805 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"),
3779337810 fctx,
3779437811 )
3779537812 .unwrap();
@@ -38124,6 +38141,10 @@ mod tests {
3812438141 // Same stale-header class: the bit that makes this frame's
3812538142 // inter blocks carry a `motion_mode` symbol.
3812638143 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"),
3812738148 fctx,
3812838149 )
3812938150 .unwrap();
crates/ec-av1/src/encode.rsmodified+1 -0
@@ -7710,6 +7710,7 @@ pub(crate) fn encode_inter_frame(
77107710 sign_bias,
77117711 h.allow_screen_content_tools,
77127712 switchable_motion_mode,
7713+ h.allow_warped_motion,
77137714 fctx,
77147715 )
77157716 },