forge
Explore
Log in

Don't you dare go Hollow

wip(av1): lane-tiles r5 inter per-tile loop at the 75-turn cap (orchestrator commit, mid-edit, does not compile)

Browse files at this commit

f79846b66adee2a5fd65dd720e433d20df3da769Ahmet Kaan GümüşParent: 10b5545
crates/ec-av1/src/decode.rsmodified+52 -5
@@ -2844,6 +2844,13 @@ struct PlaneBuf {
28442844 /// right/bottom reach bound is still open, tracked in the report.
28452845 tile_x0: usize,
28462846 tile_y0: usize,
2847+ /// lane-tiles r5: this plane's own tile's right/bottom pixel bound
2848+ /// (exclusive) -- a non-last tile column/row's own reach must stop at
2849+ /// its own SB-aligned tile boundary. `width`/`height` (this plane's
2850+ /// full padded extent) for the single-tile/last-tile case, matching the
2851+ /// old unclipped behaviour exactly.
2852+ tile_x1: usize,
2853+ tile_y1: usize,
28472854 }
28482855
28492856 /// One entry per `MV_REFERENCE_FRAME` (index 0/1 unused -- `NONE`/
@@ -2859,9 +2866,11 @@ impl PlaneBuf {
28592866 /// [`Self::tile_y0`]) before that tile's own superblock walk. `x0`/`y0`
28602867 /// are already in this plane's own units (luma pixels for `y`, chroma
28612868 /// pixels — halved — for `u`/`v`).
2862- fn set_tile_origin(&mut self, x0: usize, y0: usize) {
2869+ fn set_tile_origin(&mut self, x0: usize, y0: usize, x1: usize, y1: usize) {
28632870 self.tile_x0 = x0;
28642871 self.tile_y0 = y0;
2872+ self.tile_x1 = x1;
2873+ self.tile_y1 = y1;
28652874 }
28662875
28672876 fn edges(
@@ -2877,14 +2886,16 @@ impl PlaneBuf {
28772886 } else {
28782887 own_across
28792888 }
2880- .min(self.width);
2889+ .min(self.width)
2890+ .min(self.tile_x1);
28812891 let own_down = y + side.min(self.true_height.saturating_sub(y));
28822892 let down = if reach.below_left {
28832893 own_down + side.min(self.true_height.saturating_sub(own_down))
28842894 } else {
28852895 own_down
28862896 }
2887- .min(self.height);
2897+ .min(self.height)
2898+ .min(self.tile_y1);
28882899 let above = (y > self.tile_y0 && across > x)
28892900 .then(|| self.data[(y - 1) * self.width + x..][..across - x].to_vec());
28902901 let left = (x > self.tile_x0 && down > y).then(|| {
@@ -2914,14 +2925,16 @@ impl PlaneBuf {
29142925 } else {
29152926 own_across
29162927 }
2917- .min(self.width);
2928+ .min(self.width)
2929+ .min(self.tile_x1);
29182930 let own_down = y + bh.min(self.true_height.saturating_sub(y));
29192931 let down = if reach.below_left {
29202932 own_down + bh.min(self.true_height.saturating_sub(own_down))
29212933 } else {
29222934 own_down
29232935 }
2924- .min(self.height);
2936+ .min(self.height)
2937+ .min(self.tile_y1);
29252938 let above = (y > self.tile_y0 && across > x)
29262939 .then(|| self.data[(y - 1) * self.width + x..][..across - x].to_vec());
29272940 let left = (x > self.tile_x0 && down > y).then(|| {
@@ -4818,6 +4831,8 @@ pub(crate) fn decode_key_frame_tile_with_cdfs(
48184831 true_height,
48194832 tile_x0: 0,
48204833 tile_y0: 0,
4834+ tile_x1: width,
4835+ tile_y1: height,
48214836 };
48224837 let mut u = PlaneBuf {
48234838 data: vec![0u8; width * height / 4],
@@ -4827,6 +4842,8 @@ pub(crate) fn decode_key_frame_tile_with_cdfs(
48274842 true_height: true_height / 2,
48284843 tile_x0: 0,
48294844 tile_y0: 0,
4845+ tile_x1: width / 2,
4846+ tile_y1: height / 2,
48304847 };
48314848 let mut v = PlaneBuf {
48324849 data: vec![0u8; width * height / 4],
@@ -4836,6 +4853,8 @@ pub(crate) fn decode_key_frame_tile_with_cdfs(
48364853 true_height: true_height / 2,
48374854 tile_x0: 0,
48384855 tile_y0: 0,
4856+ tile_x1: width / 2,
4857+ tile_y1: height / 2,
48394858 };
48404859
48414860 let scan32 = default_scan(TX32);
@@ -9584,6 +9603,8 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
95849603 true_height: reference.height,
95859604 tile_x0: 0,
95869605 tile_y0: 0,
9606+ tile_x1: reference.width,
9607+ tile_y1: reference.height,
95879608 };
95889609 let ref_u = PlaneBuf {
95899610 data: reference.u.clone(),
@@ -9593,6 +9614,8 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
95939614 true_height: reference.height / 2,
95949615 tile_x0: 0,
95959616 tile_y0: 0,
9617+ tile_x1: reference.width / 2,
9618+ tile_y1: reference.height / 2,
95969619 };
95979620 let ref_v = PlaneBuf {
95989621 data: reference.v.clone(),
@@ -9602,6 +9625,8 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
96029625 true_height: reference.height / 2,
96039626 tile_x0: 0,
96049627 tile_y0: 0,
9628+ tile_x1: reference.width / 2,
9629+ tile_y1: reference.height / 2,
96059630 };
96069631 // Every non-`LAST_FRAME` reference this frame header's own `ref_frame_idx`
96079632 // names a live DPB slot for (lane-av1refs: generalised from the old
@@ -9623,6 +9648,8 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
96239648 true_height: g.height,
96249649 tile_x0: 0,
96259650 tile_y0: 0,
9651+ tile_x1: g.width,
9652+ tile_y1: g.height,
96269653 },
96279654 PlaneBuf {
96289655 data: g.u.clone(),
@@ -9632,6 +9659,8 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
96329659 true_height: g.height / 2,
96339660 tile_x0: 0,
96349661 tile_y0: 0,
9662+ tile_x1: g.width / 2,
9663+ tile_y1: g.height / 2,
96359664 },
96369665 PlaneBuf {
96379666 data: g.v.clone(),
@@ -9641,6 +9670,8 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
96419670 true_height: g.height / 2,
96429671 tile_x0: 0,
96439672 tile_y0: 0,
9673+ tile_x1: g.width / 2,
9674+ tile_y1: g.height / 2,
96449675 },
96459676 )
96469677 })
@@ -9656,6 +9687,8 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
96569687 true_height,
96579688 tile_x0: 0,
96589689 tile_y0: 0,
9690+ tile_x1: width,
9691+ tile_y1: height,
96599692 };
96609693 let mut u = PlaneBuf {
96619694 data: vec![0u8; width * height / 4],
@@ -9665,6 +9698,8 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
96659698 true_height: true_height / 2,
96669699 tile_x0: 0,
96679700 tile_y0: 0,
9701+ tile_x1: width / 2,
9702+ tile_y1: height / 2,
96689703 };
96699704 let mut v = PlaneBuf {
96709705 data: vec![0u8; width * height / 4],
@@ -9674,6 +9709,8 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
96749709 true_height: true_height / 2,
96759710 tile_x0: 0,
96769711 tile_y0: 0,
9712+ tile_x1: width / 2,
9713+ tile_y1: height / 2,
96779714 };
96789715
96799716 let scan32 = default_scan(TX32);
@@ -11618,6 +11655,8 @@ mod tests {
1161811655 true_height: height / scale,
1161911656 tile_x0: 0,
1162011657 tile_y0: 0,
11658+ tile_x1: width / scale,
11659+ tile_y1: height / scale,
1162111660 };
1162211661 let ref_y = PlaneBuf {
1162311662 data: ref_pattern.clone(),
@@ -11627,6 +11666,8 @@ mod tests {
1162711666 true_height: height,
1162811667 tile_x0: 0,
1162911668 tile_y0: 0,
11669+ tile_x1: width,
11670+ tile_y1: height,
1163011671 };
1163111672 let ref_u = ref_plane(2);
1163211673 let ref_v = ref_plane(2);
@@ -11639,6 +11680,8 @@ mod tests {
1163911680 true_height: height,
1164011681 tile_x0: 0,
1164111682 tile_y0: 0,
11683+ tile_x1: width,
11684+ tile_y1: height,
1164211685 };
1164311686 let mut u = PlaneBuf {
1164411687 data: vec![0u8; (width / 2) * (height / 2)],
@@ -11648,6 +11691,8 @@ mod tests {
1164811691 true_height: height / 2,
1164911692 tile_x0: 0,
1165011693 tile_y0: 0,
11694+ tile_x1: width / 2,
11695+ tile_y1: height / 2,
1165111696 };
1165211697 let mut v = PlaneBuf {
1165311698 data: vec![0u8; (width / 2) * (height / 2)],
@@ -11657,6 +11702,8 @@ mod tests {
1165711702 true_height: height / 2,
1165811703 tile_x0: 0,
1165911704 tile_y0: 0,
11705+ tile_x1: width / 2,
11706+ tile_y1: height / 2,
1166011707 };
1166111708
1166211709 let mut cdfs = Cdfs::new(q_ctx_of(100));