A local-warp candidate behind EC_AV1_WARP
Browse files at this commita745879568eaf4e9d91557d09e325288651cb05dParent: fbf67c0- feat
- a local-warp candidate behind EC_AV1_WARP
2 changed files +24 -2
crates/ec-av1/src/decode.rsmodified+23 -2
| @@ -33092,7 +33092,7 @@ pub(crate) fn decode_inter_frame_tile( | ||
| 33092 | 33092 | loop_filter, allow_high_precision_mv, force_integer_mv, interp_fixed, |
| 33093 | 33093 | enable_dual_filter, reference_select, tx_select, |
| 33094 | 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 | 33138 | // crate's own encoder writes once inter blocks started carrying a |
| 33139 | 33139 | // `motion_mode` symbol (class: test asserts against a stale header). |
| 33140 | 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 | 33147 | fctx: &crate::decode::FrameCtx, |
| 33142 | 33148 | ) -> Result<Picture> { |
| 33143 | 33149 | let single_tile = TileInfo { |
| @@ -33167,6 +33173,7 @@ pub(crate) fn decode_inter_frame_tile_lr( | ||
| 33167 | 33173 | sign_bias, |
| 33168 | 33174 | allow_screen_content_tools, |
| 33169 | 33175 | switchable_motion_mode, |
| 33176 | + allow_warped_motion, | |
| 33170 | 33177 | fctx, |
| 33171 | 33178 | ) |
| 33172 | 33179 | } |
| @@ -33202,6 +33209,12 @@ pub(crate) fn decode_inter_frame_tiles_lr( | ||
| 33202 | 33209 | // crate's own encoder writes once inter blocks started carrying a |
| 33203 | 33210 | // `motion_mode` symbol (class: test asserts against a stale header). |
| 33204 | 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 | 33218 | fctx: &crate::decode::FrameCtx, |
| 33206 | 33219 | ) -> Result<Picture> { |
| 33207 | 33220 | decode_inter_frame_tile_with_cdfs( |
| @@ -33237,7 +33250,7 @@ pub(crate) fn decode_inter_frame_tiles_lr( | ||
| 33237 | 33250 | true, |
| 33238 | 33251 | tx_select, |
| 33239 | 33252 | switchable_motion_mode, |
| 33240 | - false, | |
| 33253 | + allow_warped_motion, | |
| 33241 | 33254 | allow_screen_content_tools, |
| 33242 | 33255 | DeltaParams::default(), |
| 33243 | 33256 | // `enable_filter_intra`: this crate's own encoder never writes the |
| @@ -37790,6 +37803,10 @@ mod tests { | ||
| 37790 | 37803 | // Same stale-header class: the bit that makes this frame's |
| 37791 | 37804 | // inter blocks carry a `motion_mode` symbol. |
| 37792 | 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 | 37810 | fctx, |
| 37794 | 37811 | ) |
| 37795 | 37812 | .unwrap(); |
| @@ -38124,6 +38141,10 @@ mod tests { | ||
| 38124 | 38141 | // Same stale-header class: the bit that makes this frame's |
| 38125 | 38142 | // inter blocks carry a `motion_mode` symbol. |
| 38126 | 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 | 38148 | fctx, |
| 38128 | 38149 | ) |
| 38129 | 38150 | .unwrap(); |
crates/ec-av1/src/encode.rsmodified+1 -0
| @@ -7710,6 +7710,7 @@ pub(crate) fn encode_inter_frame( | ||
| 7710 | 7710 | sign_bias, |
| 7711 | 7711 | h.allow_screen_content_tools, |
| 7712 | 7712 | switchable_motion_mode, |
| 7713 | + h.allow_warped_motion, | |
| 7713 | 7714 | fctx, |
| 7714 | 7715 | ) |
| 7715 | 7716 | }, |