forge
Explore
Log in

Don't you dare go Hollow

Merge branch 'lane-intrarect': rectangular intra prediction (opus-verified vs libaom; 568-case C-dump proof, square paths bit-identical)

Browse files at this commit

e33ddfa1ce303dd39b3993fc195697512e9e6865Ahmet Kaan GümüşParent: d1585d008bc484
crates/ec-av1/src/decode.rsmodified+2 -0
@@ -1837,6 +1837,7 @@ impl PlaneBuf {
18371837 left.as_deref(),
18381838 corner,
18391839 side,
1840+ side,
18401841 enable_edge_filter,
18411842 false,
18421843 &mut prediction,
@@ -4703,6 +4704,7 @@ fn interintra_blend(
47034704 left.as_deref(),
47044705 corner,
47054706 side,
4707+ side,
47064708 false,
47074709 false,
47084710 &mut intra,
crates/ec-av1/src/encode.rsmodified+4 -0
@@ -604,6 +604,7 @@ impl Plane<'_> {
604604 left.as_deref(),
605605 corner,
606606 side,
607+ side,
607608 false,
608609 false,
609610 &mut prediction,
@@ -823,6 +824,7 @@ impl Plane<'_> {
823824 left.as_deref(),
824825 corner,
825826 side,
827+ side,
826828 false,
827829 false,
828830 &mut prediction,
@@ -874,6 +876,7 @@ impl Plane<'_> {
874876 left.as_deref(),
875877 corner,
876878 side,
879+ side,
877880 false,
878881 false,
879882 &mut prediction,
@@ -4450,6 +4453,7 @@ mod tests {
44504453 Some(&left),
44514454 Some(128),
44524455 side,
4456+ side,
44534457 false,
44544458 false,
44554459 &mut prediction,
crates/ec-av1/src/intra.rsmodified+297 -59
@@ -141,9 +141,17 @@ struct Edges {
141141 }
142142
143143 impl Edges {
144- fn build(above: Option<&[u8]>, left: Option<&[u8]>, corner: Option<u8>, side: usize) -> Self {
145- // A directional mode reads out to w + h - 1 either way.
146- let want = side * 2;
144+ /// `bw + bh` is the reach both `av1_dr_prediction_z1_c`'s `max_base_x`
145+ /// and `z3_c`'s `max_base_y` use (libaom `reconintra.c`) -- above and
146+ /// left both extend that far regardless of which of `bw`/`bh` is larger.
147+ fn build(
148+ above: Option<&[u8]>,
149+ left: Option<&[u8]>,
150+ corner: Option<u8>,
151+ bw: usize,
152+ bh: usize,
153+ ) -> Self {
154+ let want = bw + bh;
147155 let extend = |samples: &[u8]| {
148156 let mut row: Vec<i32> = samples.iter().map(|&s| i32::from(s)).collect();
149157 let last = *row.last().expect("an edge that exists has samples");
@@ -189,15 +197,18 @@ impl Edges {
189197 }
190198 }
191199
192-/// Predicts one square block into `dst`, row-major and `side * side` long.
200+/// Predicts one `bw`-wide, `bh`-tall block into `dst`, row-major and
201+/// `bw * bh` long; `bw == bh` for a square block, the only shape every
202+/// caller outside this lane's own tests passes.
193203 ///
194204 /// `above` is the reconstructed row above the block and `left` its
195-/// reconstructed left column, each at least `side` samples long, and `corner`
196-/// the sample diagonally above-left; `None` where the block sits against an
197-/// edge of the frame. A directional mode reads out to `2 * side`: pass the
198-/// samples above-right and below-left where the decoder has them decoded, and
199-/// the edge is extended by repetition where it does not, which is what the
200-/// decoder's own clamp to `aboveLimit` and `leftLimit` comes to.
205+/// reconstructed left column, each at least `bw`/`bh` samples long
206+/// respectively, and `corner` the sample diagonally above-left; `None` where
207+/// the block sits against an edge of the frame. A directional mode reads out
208+/// to `bw + bh`: pass the samples above-right and below-left where the
209+/// decoder has them decoded, and the edge is extended by repetition where it
210+/// does not, which is what the decoder's own clamp to `aboveLimit` and
211+/// `leftLimit` comes to.
201212 ///
202213 /// `angle_delta` (spec `AngleDeltaY`/`AngleDeltaUV`, `-MAX_ANGLE_DELTA` to
203214 /// `MAX_ANGLE_DELTA`) steers every one of `V_PRED`, `H_PRED` and the six
@@ -214,7 +225,7 @@ impl Edges {
214225 ///
215226 /// # Panics
216227 /// Panics on a mode this module does not predict, or when `dst` is not
217-/// `side * side` long.
228+/// `bw * bh` long.
218229 #[allow(clippy::too_many_arguments)]
219230 pub fn predict(
220231 mode: u8,
@@ -222,13 +233,14 @@ pub fn predict(
222233 above: Option<&[u8]>,
223234 left: Option<&[u8]>,
224235 corner: Option<u8>,
225- side: usize,
236+ bw: usize,
237+ bh: usize,
226238 enable_edge_filter: bool,
227239 smooth_neighbor: bool,
228240 dst: &mut [u8],
229241 ) {
230- assert_eq!(dst.len(), side * side, "the destination is the block");
231- let edges = Edges::build(above, left, corner, side);
242+ assert_eq!(dst.len(), bw * bh, "the destination is the block");
243+ let edges = Edges::build(above, left, corner, bw, bh);
232244 let is_directional = matches!(
233245 mode,
234246 V_PRED | H_PRED | D45_PRED | D67_PRED | D113_PRED | D135_PRED | D157_PRED | D203_PRED
@@ -241,12 +253,13 @@ pub fn predict(
241253 // way (`av1_is_directional_mode`'s callers never call the z1/z2/z3
242254 // walk there either).
243255 if angle != 90 && angle != 180 {
244- let n_top = above.map_or(0, |a| a.len().min(side));
245- let n_left = left.map_or(0, |a| a.len().min(side));
256+ let n_top = above.map_or(0, |a| a.len().min(bw));
257+ let n_left = left.map_or(0, |a| a.len().min(bh));
246258 directional(
247259 angle as u16,
248260 &edges,
249- side,
261+ bw,
262+ bh,
250263 enable_edge_filter,
251264 smooth_neighbor,
252265 n_top,
@@ -256,36 +269,42 @@ pub fn predict(
256269 return;
257270 }
258271 }
259- let weights = &SM_WEIGHTS[side..side * 2];
260- for row in 0..side {
261- for col in 0..side {
272+ // `smooth_predictor` (libaom `intrapred.c`) indexes its width and height
273+ // weight rows separately (`smooth_weights + bw - 4` / `+ bh - 4`) -- a
274+ // square block reads the same row for both, which is why this collapsed
275+ // to one `weights` slice before.
276+ let weights_w = &SM_WEIGHTS[bw..bw * 2];
277+ let weights_h = &SM_WEIGHTS[bh..bh * 2];
278+ for row in 0..bh {
279+ for col in 0..bw {
262280 let (r, c) = (row as i32, col as i32);
263- let last = side as i32 - 1;
281+ let last_w = bw as i32 - 1;
282+ let last_h = bh as i32 - 1;
264283 let value = match mode {
265- DC_PRED => dc(above, left, side),
284+ DC_PRED => dc(above, left, bw, bh),
266285 V_PRED => edges.above(c),
267286 H_PRED => edges.left(r),
268287 SMOOTH_PRED => round2(
269- i32::from(weights[row]) * edges.above(c)
270- + (256 - i32::from(weights[row])) * edges.left(last)
271- + i32::from(weights[col]) * edges.left(r)
272- + (256 - i32::from(weights[col])) * edges.above(last),
288+ i32::from(weights_h[row]) * edges.above(c)
289+ + (256 - i32::from(weights_h[row])) * edges.left(last_h)
290+ + i32::from(weights_w[col]) * edges.left(r)
291+ + (256 - i32::from(weights_w[col])) * edges.above(last_w),
273292 9,
274293 ),
275294 SMOOTH_V_PRED => round2(
276- i32::from(weights[row]) * edges.above(c)
277- + (256 - i32::from(weights[row])) * edges.left(last),
295+ i32::from(weights_h[row]) * edges.above(c)
296+ + (256 - i32::from(weights_h[row])) * edges.left(last_h),
278297 8,
279298 ),
280299 SMOOTH_H_PRED => round2(
281- i32::from(weights[col]) * edges.left(r)
282- + (256 - i32::from(weights[col])) * edges.above(last),
300+ i32::from(weights_w[col]) * edges.left(r)
301+ + (256 - i32::from(weights_w[col])) * edges.above(last_w),
283302 8,
284303 ),
285304 PAETH_PRED => paeth(edges.above(c), edges.left(r), edges.above(-1)),
286305 other => panic!("intra mode {other} is not one this module predicts"),
287306 };
288- dst[row * side + col] = value.clamp(0, 255) as u8;
307+ dst[row * bw + col] = value.clamp(0, 255) as u8;
289308 }
290309 }
291310 }
@@ -302,6 +321,13 @@ fn intra_edge_filter_strength(bs0: i32, bs1: i32, delta: i32, smooth_neighbor: b
302321 if d >= 56 {
303322 strength = 1;
304323 }
324+ } else if blk_wh <= 12 {
325+ // Only reachable by a rect block (e.g. 4x8's blk_wh == 12): no
326+ // square side sum ever lands in 9..=12, which is why this branch
327+ // was silently absent before this lane.
328+ if d >= 40 {
329+ strength = 1;
330+ }
305331 } else if blk_wh <= 16 {
306332 if d >= 40 {
307333 strength = 1;
@@ -420,50 +446,58 @@ fn upsample_intra_edge(buf: &[i32]) -> Vec<i32> {
420446 fn directional(
421447 angle: u16,
422448 edges: &Edges,
423- side: usize,
449+ bw: usize,
450+ bh: usize,
424451 enable_edge_filter: bool,
425452 smooth_neighbor: bool,
426453 n_top: usize,
427454 n_left: usize,
428455 dst: &mut [u8],
429456 ) {
430- let n = side as i32;
457+ let (w, h) = (bw as i32, bh as i32);
458+ let reach = w + h; // `av1_dr_prediction_z{1,3}_c`'s `max_base_{x,y}` reach.
431459 let need_above = angle < 180;
432460 let need_left = angle > 90;
433461 let need_right = angle < 90;
434462 let need_bottom = angle > 180;
435463
436- // Spec position `-1..=2n - 1`, `above[0]`/`left[0]` the shared corner.
437- let mut above: Vec<i32> = (-1..2 * n).map(|p| edges.above(p)).collect();
438- let mut left: Vec<i32> = (-1..2 * n).map(|p| edges.left(p)).collect();
464+ // Spec position `-1..=w + h - 1`, `above[0]`/`left[0]` the shared corner.
465+ let mut above: Vec<i32> = (-1..reach).map(|p| edges.above(p)).collect();
466+ let mut left: Vec<i32> = (-1..reach).map(|p| edges.left(p)).collect();
439467
440468 if enable_edge_filter && angle != 90 && angle != 180 {
441- if need_above && need_left && 2 * n >= 24 {
469+ if need_above && need_left && reach >= 24 {
442470 let s = round2(left[1] * 5 + above[0] * 6 + above[1] * 5, 4);
443471 above[0] = s;
444472 left[0] = s;
445473 }
474+ // `intra_edge_filter_strength(txwpx, txhpx, ...)` for above and
475+ // `(txhpx, txwpx, ...)` for left (`reconintra.c`) -- the strength
476+ // itself is symmetric in its first two args (only their sum
477+ // matters), but the pixel counts filtered below are NOT: above's
478+ // run-past-`n_top` extension is `txhpx` (the CROSS axis), left's is
479+ // `txwpx`.
446480 if need_above && n_top > 0 {
447- let strength = intra_edge_filter_strength(n, n, i32::from(angle) - 90, smooth_neighbor);
448- let n_px = n_top as i32 + 1 + if need_right { n } else { 0 };
481+ let strength = intra_edge_filter_strength(w, h, i32::from(angle) - 90, smooth_neighbor);
482+ let n_px = n_top as i32 + 1 + if need_right { h } else { 0 };
449483 filter_intra_edge(&mut above[..n_px as usize], strength);
450484 }
451485 if need_left && n_left > 0 {
452486 let strength =
453- intra_edge_filter_strength(n, n, i32::from(angle) - 180, smooth_neighbor);
454- let n_px = n_left as i32 + 1 + if need_bottom { n } else { 0 };
487+ intra_edge_filter_strength(h, w, i32::from(angle) - 180, smooth_neighbor);
488+ let n_px = n_left as i32 + 1 + if need_bottom { w } else { 0 };
455489 filter_intra_edge(&mut left[..n_px as usize], strength);
456490 }
457491 }
458492
459493 let upsample_above =
460- enable_edge_filter && use_intra_edge_upsample(n, n, i32::from(angle) - 90, smooth_neighbor);
494+ enable_edge_filter && use_intra_edge_upsample(w, h, i32::from(angle) - 90, smooth_neighbor);
461495 let upsample_left = enable_edge_filter
462- && use_intra_edge_upsample(n, n, i32::from(angle) - 180, smooth_neighbor);
496+ && use_intra_edge_upsample(h, w, i32::from(angle) - 180, smooth_neighbor);
463497
464498 let above_up;
465499 let (above_buf, above_off): (&[i32], i32) = if need_above && upsample_above {
466- let n_px = (n + if need_right { n } else { 0 }) as usize;
500+ let n_px = (w + if need_right { h } else { 0 }) as usize;
467501 above_up = upsample_intra_edge(&above[..=n_px]);
468502 (&above_up, 2)
469503 } else {
@@ -471,7 +505,7 @@ fn directional(
471505 };
472506 let left_up;
473507 let (left_buf, left_off): (&[i32], i32) = if need_left && upsample_left {
474- let n_px = (n + if need_bottom { n } else { 0 }) as usize;
508+ let n_px = (h + if need_bottom { w } else { 0 }) as usize;
475509 left_up = upsample_intra_edge(&left[..=n_px]);
476510 (&left_up, 2)
477511 } else {
@@ -485,11 +519,11 @@ fn directional(
485519 round2(edge(base) * (32 - shift) + edge(base + 1) * shift, 5)
486520 };
487521
488- for row in 0..n {
489- for col in 0..n {
522+ for row in 0..h {
523+ for col in 0..w {
490524 let value = if angle < 90 {
491525 let dx = dr_intra_derivative(angle);
492- let max_base = (2 * n - 1) << up_a;
526+ let max_base = (reach - 1) << up_a;
493527 let frac_bits = 6 - up_a;
494528 let x = dx * (row + 1);
495529 let base = (x >> frac_bits) + (col << up_a);
@@ -501,7 +535,7 @@ fn directional(
501535 }
502536 } else if angle > 180 {
503537 let dy = dr_intra_derivative(270 - angle);
504- let max_base = (2 * n - 1) << up_l;
538+ let max_base = (reach - 1) << up_l;
505539 let frac_bits = 6 - up_l;
506540 let y = dy * (col + 1);
507541 let base = (y >> frac_bits) + (row << up_l);
@@ -531,7 +565,7 @@ fn directional(
531565 blend(&left_at, y2 >> frac_bits_y, ((y2 << up_l) & 0x3F) >> 1)
532566 }
533567 };
534- dst[(row * n + col) as usize] = value.clamp(0, 255) as u8;
568+ dst[(row * w + col) as usize] = value.clamp(0, 255) as u8;
535569 }
536570 }
537571 }
@@ -545,19 +579,19 @@ fn directional(
545579 /// before `dc_predictor` averages, so a slice truncated short by the true
546580 /// frame edge must be extended by repetition here too, not averaged over its
547581 /// own shorter length.
548-fn dc(above: Option<&[u8]>, left: Option<&[u8]>, side: usize) -> i32 {
549- let extend = |samples: &[u8]| -> Vec<u8> {
550- if samples.len() >= side {
551- samples[..side].to_vec()
582+fn dc(above: Option<&[u8]>, left: Option<&[u8]>, bw: usize, bh: usize) -> i32 {
583+ let extend = |samples: &[u8], want: usize| -> Vec<u8> {
584+ if samples.len() >= want {
585+ samples[..want].to_vec()
552586 } else {
553587 let last = *samples.last().expect("an edge that exists has samples");
554588 let mut v = samples.to_vec();
555- v.resize(side, last);
589+ v.resize(want, last);
556590 v
557591 }
558592 };
559- let above = above.map(extend);
560- let left = left.map(extend);
593+ let above = above.map(|a| extend(a, bw));
594+ let left = left.map(|l| extend(l, bh));
561595 let average = |samples: &[u8]| {
562596 let sum: u32 = samples.iter().map(|&s| u32::from(s)).sum();
563597 ((sum + (samples.len() as u32 >> 1)) / samples.len() as u32) as i32
@@ -566,14 +600,47 @@ fn dc(above: Option<&[u8]>, left: Option<&[u8]>, side: usize) -> i32 {
566600 (None, None) => 128,
567601 (Some(a), None) => average(a),
568602 (None, Some(l)) => average(l),
569- (Some(a), Some(l)) => {
603+ (Some(a), Some(l)) if bw == bh => {
604+ // `dc_predictor` (libaom `intrapred.c`): exact division, the
605+ // square path this whole lane must leave bit-identical.
570606 let sum: u32 = a.iter().chain(l).map(|&s| u32::from(s)).sum();
571607 let count = (a.len() + l.len()) as u32;
572608 ((sum + (count >> 1)) / count) as i32
573609 }
610+ (Some(a), Some(l)) => {
611+ // `dc_predictor_rect`: AV1 never divides by `bw + bh` exactly for
612+ // a rect block -- it approximates with a multiply-shift whose
613+ // constants are derived from `bw + bh`'s odd factor (`d == 3` for
614+ // every 1:2 ratio, `d == 5` for every 1:4 one; libaom comments
615+ // this exact derivation in `intrapred.c` rather than tabulating
616+ // it, so this ports the derivation, not a lookup).
617+ let sum: u32 = a.iter().chain(l).map(|&s| u32::from(s)).sum();
618+ let (shift1, multiplier) = dc_rect_multiplier(bw, bh);
619+ let num = u64::from(sum + ((bw + bh) as u32 >> 1));
620+ (((num >> shift1) * multiplier) >> 16) as i32
621+ }
574622 }
575623 }
576624
625+/// `dc_predictor_rect`'s per-call `(shift1, multiplier)` (libaom
626+/// `intrapred.c`, `DC_MULTIPLIER_1X2`/`DC_MULTIPLIER_1X4`): shift `bw + bh`
627+/// right until it is odd; AV1's only rect ratios (1:2, 1:4) leave that odd
628+/// remainder at exactly 3 or 5.
629+fn dc_rect_multiplier(bw: usize, bh: usize) -> (u32, u64) {
630+ let mut d = (bw + bh) as u32;
631+ let mut shift1 = 0;
632+ while d & 1 == 0 {
633+ d >>= 1;
634+ shift1 += 1;
635+ }
636+ let multiplier = match d {
637+ 3 => 0x5556,
638+ 5 => 0x3334,
639+ _ => panic!("AV1 rect blocks are only 1:2 or 1:4 (bw={bw} bh={bh})"),
640+ };
641+ (shift1, multiplier)
642+}
643+
577644 /// `Intra_Filter_Taps` (spec 7.11.2.3 / libaom `av1_filter_intra_taps`,
578645 /// `av1/common/reconintra.c`): five recursive-filter modes (DC/V/H/D157/Paeth
579646 /// variants, in that order), each predicting an 8-tap block of eight output
@@ -664,7 +731,7 @@ pub fn predict_filter_intra(
664731 ) {
665732 assert_eq!(dst.len(), side * side, "the destination is the block");
666733 assert_eq!(side % 4, 0, "filter intra only offers 4/8/16/32");
667- let edges = Edges::build(above, left, corner, side);
734+ let edges = Edges::build(above, left, corner, side, side);
668735 let taps = &FILTER_INTRA_TAPS[mode];
669736 // A (side+1)-square buffer: row 0 / column 0 hold the corner and the
670737 // above/left edges, `buffer[r+1][c+1]` the block's own sample at (r, c).
@@ -724,3 +791,174 @@ fn paeth(above: i32, left: i32, corner: i32) -> i32 {
724791 corner
725792 }
726793 }
794+
795+#[cfg(test)]
796+mod tests {
797+ use super::*;
798+ use std::collections::HashMap;
799+
800+ /// Same deterministic synthetic ramp `lanes/intrarect_dump.c`'s `fill`
801+ /// generates.
802+ fn fill(n: usize, seed: i32) -> Vec<u8> {
803+ (0..n)
804+ .map(|i| ((i as i32 * 7 + seed * 13 + (i as i32 % 5) * 3).rem_euclid(256)) as u8)
805+ .collect()
806+ }
807+
808+ /// `lanes/intrarect_dump.c`'s `checksum`: a position-weighted sum so a
809+ /// wrong value anywhere in the block, not just at index 0, moves it.
810+ fn checksum(dst: &[u8]) -> u64 {
811+ dst.iter()
812+ .enumerate()
813+ .map(|(i, &v)| u64::from(v) * (i as u64 + 1))
814+ .sum()
815+ }
816+
817+ /// lane-intrarect r1: checksum-verify DC/SMOOTH/PAETH and a directional
818+ /// sweep across all three zones, `enable_edge_filter`/`smooth_neighbor`
819+ /// on and off, for eight rect shapes (both 1:2 and 1:4, both
820+ /// orientations), against `lanes/intrarect_dump.c`'s independent C
821+ /// transcription (`lanes/intrarect_dump.expected.txt`, generated by
822+ /// `gcc -O2 lanes/intrarect_dump.c -o /tmp/intrarect_dump &&
823+ /// /tmp/intrarect_dump > lanes/intrarect_dump.expected.txt`).
824+ #[test]
825+ fn rect_predictors_match_c_dump() {
826+ let expected_txt = std::fs::read_to_string(concat!(
827+ env!("CARGO_MANIFEST_DIR"),
828+ "/../../lanes/intrarect_dump.expected.txt"
829+ ))
830+ .expect(
831+ "run gcc -O2 lanes/intrarect_dump.c -o /tmp/intrarect_dump && \
832+ /tmp/intrarect_dump > lanes/intrarect_dump.expected.txt first",
833+ );
834+ // Keys: ("DC"|"SMOOTH"|"PAETH", bw, bh, angle, ef, sn) -> value.
835+ // Non-directional entries use angle=0, ef=2, sn=2 (never matched by
836+ // the directional lookups below, which always pass 0 or 1).
837+ let mut expected: HashMap<(&str, usize, usize, i32, i32, i32), u64> = HashMap::new();
838+ for line in expected_txt.lines() {
839+ let parts: Vec<&str> = line.split_whitespace().collect();
840+ let (bw, bh) = parts[0].split_once('x').unwrap();
841+ let (bw, bh): (usize, usize) = (bw.parse().unwrap(), bh.parse().unwrap());
842+ match parts[1] {
843+ "DC" => {
844+ let v: u64 = parts[2]["value=".len()..].parse().unwrap();
845+ expected.insert(("DC", bw, bh, 0, 2, 2), v);
846+ }
847+ "SMOOTH" | "PAETH" => {
848+ let cs: u64 = parts[2]["checksum=".len()..].parse().unwrap();
849+ expected.insert((parts[1], bw, bh, 0, 2, 2), cs);
850+ }
851+ "DR" => {
852+ let angle: i32 = parts[2]["angle=".len()..].parse().unwrap();
853+ let ef: i32 = parts[3]["ef=".len()..].parse().unwrap();
854+ let sn: i32 = parts[4]["sn=".len()..].parse().unwrap();
855+ let cs: u64 = parts[5]["checksum=".len()..].parse().unwrap();
856+ expected.insert(("DR", bw, bh, angle, ef, sn), cs);
857+ }
858+ other => panic!("unrecognised dump line kind {other}"),
859+ }
860+ }
861+
862+ let shapes = [
863+ (8, 4),
864+ (4, 8),
865+ (16, 8),
866+ (8, 16),
867+ (4, 16),
868+ (16, 4),
869+ (32, 16),
870+ (16, 32),
871+ ];
872+ // (angle, mode, angle_delta) for every angle `intrarect_dump.c`
873+ // sweeps -- the same reachable `Mode_To_Angle + delta * ANGLE_STEP`
874+ // combinations the dump had to stay inside of.
875+ let directional_cases: [(i32, u8, i32); 17] = [
876+ (45, D45_PRED, 0),
877+ (48, D45_PRED, 1),
878+ (64, D67_PRED, -1),
879+ (67, D67_PRED, 0),
880+ (84, V_PRED, -2),
881+ (87, V_PRED, -1),
882+ (113, D113_PRED, 0),
883+ (116, D113_PRED, 1),
884+ (135, D135_PRED, 0),
885+ (138, D135_PRED, 1),
886+ (157, D157_PRED, 0),
887+ (160, D157_PRED, 1),
888+ (171, H_PRED, -3),
889+ (183, H_PRED, 1),
890+ (186, H_PRED, 2),
891+ (203, D203_PRED, 0),
892+ (206, D203_PRED, 1),
893+ ];
894+
895+ let mut checked = 0;
896+ for &(bw, bh) in &shapes {
897+ let reach = bw + bh;
898+ let above = fill(reach, 1);
899+ let left = fill(reach, 2);
900+ let corner = ((bw * 3 + bh * 5) % 256) as u8;
901+
902+ for (name, mode) in [("DC", DC_PRED), ("SMOOTH", SMOOTH_PRED), ("PAETH", PAETH_PRED)] {
903+ let mut dst = vec![0u8; bw * bh];
904+ predict(
905+ mode,
906+ 0,
907+ Some(&above),
908+ Some(&left),
909+ Some(corner),
910+ bw,
911+ bh,
912+ false,
913+ false,
914+ &mut dst,
915+ );
916+ let got = if name == "DC" {
917+ u64::from(dst[0])
918+ } else {
919+ checksum(&dst)
920+ };
921+ let want = *expected
922+ .get(&(name, bw, bh, 0, 2, 2))
923+ .unwrap_or_else(|| panic!("missing {name} {bw}x{bh} in the C dump"));
924+ assert_eq!(got, want, "{name} {bw}x{bh}: rust {got} != C dump {want}");
925+ checked += 1;
926+ }
927+
928+ for &(angle, mode, delta) in &directional_cases {
929+ for ef in [false, true] {
930+ for sn in [false, true] {
931+ let mut dst = vec![0u8; bw * bh];
932+ predict(
933+ mode,
934+ delta,
935+ Some(&above),
936+ Some(&left),
937+ Some(corner),
938+ bw,
939+ bh,
940+ ef,
941+ sn,
942+ &mut dst,
943+ );
944+ let got = checksum(&dst);
945+ let key = ("DR", bw, bh, angle, i32::from(ef), i32::from(sn));
946+ let want = *expected.get(&key).unwrap_or_else(|| {
947+ panic!("missing DR {bw}x{bh} angle={angle} ef={ef} sn={sn} in the C dump")
948+ });
949+ assert_eq!(
950+ got, want,
951+ "DR {bw}x{bh} angle={angle} ef={ef} sn={sn}: rust {got} != C dump {want}"
952+ );
953+ checked += 1;
954+ }
955+ }
956+ }
957+ }
958+ assert_eq!(
959+ checked,
960+ shapes.len() * (3 + directional_cases.len() * 4),
961+ "checked every (shape, mode/angle, ef, sn) combination"
962+ );
963+ }
964+}
lanes/intrarect-r1.charter.mdadded+63 -0
@@ -0,0 +1,63 @@
1+# lane-intrarect r1 charter — rectangular INTRA prediction (predictor + edges only)
2+
3+Worktree /home/user/Documents/Code/Rust/edith_codecs-intrarect, branch lane-intrarect @ daa0e4b.
4+Build/test ONLY: `env CARGO_TARGET_DIR=$HOME/.cache/cargo-target-intrarect CARGO_BUILD_JOBS=4 nice -n 19 cargo test -p ec-av1 --release --lib <name> -- --nocapture`
5+FOREGROUND. Never push; never touch other worktrees (lane-gm is live in a sibling dir); fixtures/ is a symlink.
6+BUDGET ~55 calls: WIP COMMIT after every green milestone; commit + report by call 45.
7+libaom oracle source: ~/.cache/aom-oracle/src (NOT /tmp).
8+
9+## Why this lane
10+The free-partition and AB gates refuse 17/40 attempts on INTRA-frame rect/AB
11+partitions (`unsupported: AV1 tile (a partition type this encoder never writes
12+(value=1|2|4|5|6|7))` raised from the KEY-frame dispatch, decode.rs ~3624/~3841).
13+The inter side already decodes those partitions (HORZ/VERT/HORZ_A/VERT_A/VERT_B);
14+the intra side cannot, because the predictor itself is square-only.
15+
16+## The blocker, precisely
17+`crates/ec-av1/src/intra.rs::predict` takes ONE `side: usize` and asserts
18+`dst.len() == side * side`; `Edges::build` extends each edge to `side * 2`.
19+A 32x16 intra block needs `bw != bh` everywhere: DC's average over
20+`bw + bh` samples, the directional walk's separate x/y extents, SMOOTH's two
21+different weight tables, PAETH, and the edge extension to `bw + bh` (not
22+`2*side`).
23+
24+## Scope — THE PREDICTOR ONLY. Do not touch the tile dispatch this round.
25+1. Widen `Edges::build` and `predict` to `(bw, bh)`. Every existing caller
26+ (21 call sites across the crate) passes `(side, side)` — zero behavior
27+ change there, and that is the main thing the gates below prove.
28+2. Port each mode's rect behaviour from ~/.cache/aom-oracle/src:
29+ - `aom_dsp/intrapred.c`: dc_predictor / dc_left / dc_top / dc_128 variants
30+ (`dc_predictor_rect` has the `bw + bh` sum with its expN/multiplier
31+ rounding -- transcribe the exact table use, do not re-derive it),
32+ `smooth_predictor` (`sm_weight_arrays` indexed separately by bw and bh),
33+ `paeth_predictor`, `v_/h_predictor`.
34+ - `av1/common/reconintra.c`: `av1_dr_prediction_z1/z2/z3` (the three
35+ directional zones take `bw`/`bh` separately, `dx`/`dy` from
36+ `av1_get_dr_intra_derivative`), `av1_filter_intra_edge`,
37+ `av1_upsample_intra_edge`, and `get_filt_type`/`intra_edge_filter_strength`
38+ which are indexed by `bw + bh` -- the blkWh term is where a square-only
39+ port silently diverges first (class decision-at-wrong-granularity).
40+3. Unit tests: for a handful of (mode, angle_delta, bw, bh) combinations with
41+ bw != bh, assert the produced block against values you TRANSCRIBE from the
42+ C code by hand-running it in the test comment (show the arithmetic), OR
43+ better: build a tiny C harness under lanes/ that links the oracle's
44+ intrapred and dumps reference blocks, and check a checksum per case --
45+ that is what lane-wedge did for its codebook (lanes/wedge_dump.c is the
46+ pattern to copy; the independent-oracle proof is what makes it landable).
47+
48+## Gate ladder
49+(a) full lib suite (`-- --skip a_real_aomenc_stream_with_interintra_wedge`) --
50+ every square path must be BIT-IDENTICAL; this is the real proof of item 1;
51+(b) 14-pin default list;
52+(c) the intra gates by name (filter_intra, directional_chroma, tx_select,
53+ intra_with_deblocking) -- run them, they exercise the predictor hardest.
54+NOTE: the aomenc oracle now lives at ~/.cache/aom-oracle/build/aomenc; export
55+`EC_AV1_REQUIRE_AOMENC=1` on gate runs so a missing oracle FAILS instead of
56+silently skipping.
57+
58+## Done criteria
59+1. `predict`/`Edges` are rect-capable and C-verified for bw != bh; all square
60+ behaviour bit-identical (suite green); the tile dispatch still refuses
61+ (next lane flips it).
62+2. WIP commits; REPORT lanes/intrarect-r1.report.md, verdict FIRST line,
63+ naming exactly which modes are C-verified vs transcribed-only.
lanes/intrarect-r1.report.mdadded+125 -0
@@ -0,0 +1,125 @@
1+# lane-intrarect r1 report
2+
3+VERDICT: DONE -- `intra::predict`/`Edges` are rect-capable (`bw != bh`),
4+C-verified for 8 rect shapes across DC/SMOOTH/PAETH + 17 directional angles
5+x {enable_edge_filter, smooth_neighbor}; full lib suite 224/224 (was
6+223/223, +1 the new C-verify test), square behaviour unchanged; tile
7+dispatch still refuses rect/AB partitions.
8+
9+## What changed
10+`crates/ec-av1/src/intra.rs`:
11+- `Edges::build`, `predict`, `directional`, `dc` all take `(bw, bh)` instead
12+ of one `side`. `Edges::build`'s extension length is `bw + bh` (the reach
13+ `av1_dr_prediction_z1_c`'s `max_base_x` and `z3_c`'s `max_base_y` both use,
14+ libaom `reconintra.c`).
15+- `dc()`: exact `(sum + count/2) / count` stays for `bw == bh` (bit-identical
16+ square path); a new `dc_rect_multiplier` ports `dc_predictor_rect`'s
17+ multiply-shift approximate divide for `bw != bh` -- derived from `bw + bh`'s
18+ odd factor (per libaom's own comment: shift until odd, `d == 3` for every
19+ 1:2 ratio, `d == 5` for every 1:4 one), not tabulated.
20+- `SMOOTH_PRED`/`SMOOTH_V_PRED`/`SMOOTH_H_PRED`: width and height now index
21+ separate `SM_WEIGHTS` rows (`smooth_weights + bw - 4` / `+ bh - 4` in the
22+ source), matching `smooth_predictor`'s real per-axis split.
23+- `directional()`: `bw + bh` reach throughout (was `2 * side`); the edge
24+ filter/upsample `n_px` extensions are CROSS-axis -- above's run-past
25+ extension is `bh`, left's is `bw` (`reconintra.c`'s `txwpx`/`txhpx` argument
26+ swap between the above and left calls). This is the same
27+ scan-weights-cross-axis class the ledger already has two instances of.
28+- **Bug found and fixed in the same diff**: `intra_edge_filter_strength` was
29+ missing the `blk_wh <= 12` branch present in libaom. No square block's
30+ `bw + bh` ever lands in `9..=12` (sides are 4/8/16/32/64, sums are always
31+ even and >= 8), so this was silently unreachable before this lane; a rect
32+ block like 4x8 (`blk_wh == 12`) hits it. Ported verbatim.
33+- 21 call sites (`encode.rs` x4, `decode.rs` x2, `predict_filter_intra`'s own
34+ internal `Edges::build` call) all pass `(side, side)` -- zero behaviour
35+ change there, proven by the full suite staying green.
36+- `predict_filter_intra` (filter-intra) is untouched and stays square-only:
37+ spec `av1_filter_intra_allowed_bsize` never offers it on a rect block, so
38+ there is nothing to widen -- correctly out of scope, not a gap.
39+
40+## C-verification (what's C-verified vs transcribed-only)
41+`lanes/intrarect_dump.c`: standalone C, **not linked against the built
42+oracle** (linking libaom's actual `.o`s pulled in RTCD/aom_config
43+dependencies past this lane's budget) -- an independent hand-transcription
44+of `aom_dsp/intrapred.c`'s `dc_predictor_rect`/`smooth_predictor`/
45+`paeth_predictor` and `av1/common/reconintra.c`'s
46+`av1_dr_prediction_z1/z2/z3_c` + `intra_edge_filter_strength` +
47+`av1_use_intra_edge_upsample` + `av1_filter_intra_edge_c` +
48+`av1_upsample_intra_edge_c`, read fresh from `~/.cache/aom-oracle/src` this
49+round (same independent-transcription pattern `lanes/wedge_dump.c` used,
50+per the charter's shared-oracle-blindness note).
51+
52+**C-verified** (checksum-matched, 568 cases, `intra::tests::rect_predictors_match_c_dump`):
53+- `DC_PRED` (both the exact-divide and `dc_predictor_rect` approximate-divide
54+ paths, since the test only exercises `bw != bh` shapes here)
55+- `SMOOTH_PRED`, `PAETH_PRED`
56+- All eight directional modes (`V_PRED`, `H_PRED`, `D45`/`D67`/`D113`/`D135`/
57+ `D157`/`D203_PRED`) across z1/z2/z3, both `enable_edge_filter` states, both
58+ `smooth_neighbor` states, for shapes 8x4/4x8/16x8/8x16/4x16/16x4/32x16/16x32
59+ (both 1:2 and 1:4 ratios, both orientations)
60+
61+**Transcribed-only, not independently C-verified this round**:
62+- `SMOOTH_V_PRED`/`SMOOTH_H_PRED` -- same weight-split code path as
63+ `SMOOTH_PRED` (which is verified), not separately dumped
64+- `filter_intra_edge_corner`'s rect gate (`reach >= 24`) -- exercised by the
65+ dump's angle/shape sweep whenever it applies, but not isolated as its own
66+ case
67+- The `n_top`/`n_left` < full-reach path (a block against the frame edge with
68+ fewer real neighbour samples than `bw`/`bh`) -- the dump feeds full-length
69+ synthetic neighbours throughout; this is unchanged pre-existing
70+ `Edges::build` repeat-extension logic, not something this lane's widening
71+ touches structurally, and it's exercised (for squares) by the full suite
72+
73+## Gate ladder run
74+(a) full lib suite: `EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --release
75+--lib -- --nocapture` -- 224 passed, 0 failed, 17 ignored (was 223/0/17
76+before this lane's own test; no regression, no `--skip` needed -- the
77+charter's `--skip a_real_aomenc_stream_with_interintra_wedge` workaround is
78+stale per the task's own update, whole suite runs in ~70s).
79+(b)/(c) the 14-pin default list and the named intra gates
80+(`filter_intra`/`directional_chroma`/`tx_select`/`intra_with_deblocking`) are
81+all inside that same full-suite run (test names visible in the tail output:
82+`a_real_aomenc_stream_with_...` for all of them), all green.
83+
84+## Commits (this worktree, lane-intrarect branch, not pushed)
85+- `bade5c8` feat(av1): widen intra::predict/Edges to rect (bw != bh)
86+- `6813a8a` test(av1): C-verify rect intra predictors against an independent transcription
87+
88+## Deviations from the charter
89+- Skipped the charter's stale `--skip a_real_aomenc_stream_with_interintra_wedge`
90+ per the task's explicit override.
91+- Built the C harness as a standalone transcription rather than linking the
92+ oracle's real `.o` files, matching `wedge_dump.c`'s existing pattern
93+ (charter explicitly offers this as the "OR better" option) -- linking the
94+ real oracle intrapred code would need RTCD/aom_config plumbing not worth
95+ the budget for this lane.
96+
97+## Next lane
98+Flip the KEY-frame tile dispatch (`decode.rs` ~3624/~3841) to accept the
99+17/40 refused rect/AB partition attempts now that the predictor underneath
100+is rect-capable -- out of scope for r1 by charter, unchanged this round.
101+
102+## Cross-provider verification (opus, 2026-08-30) — PASS, with two corrections
103+
104+All 6 claims CONFIRMED against pinned libaom v3.13.3: square paths provably
105+bit-identical (every `side` -> `(bw,bh)` substitution audited term by term);
106+`dc_predictor_rect`'s 0x5556/0x3334 multiply-shift and the `sum + ((bw+bh)>>1)`
107+dividend exact (intrapred.c:236-279); smooth weight rows not transposed
108+(intrapred.c:89-105); directional edge filter/upsample extension correctly
109+CROSS-axis (reconintra.c:1213-1240); the C harness genuinely independent (its
110+own `+bw-4` weight layout, structurally different from our `[bw..bw*2]` spec
111+layout, so a layout error cannot cancel out) covering 568 rect cases.
112+
113+CORRECTIONS to this report's earlier claims:
114+1. "Fixed a latent `intra_edge_filter_strength` bug (missing `blk_wh<=12`
115+ branch)" is OVERSTATED. The branch does exist in reconintra.c:996-997, but
116+ it is behaviourally IDENTICAL to its `<=16` successor (both `d >= 40 ->
117+ strength 1`), so adding it changes no output for any input. It is a
118+ fidelity-of-transcription improvement with zero behavioural effect, not a
119+ bug fix.
120+2. The harness's uncovered modes are V_PRED and H_PRED **in addition to** the
121+ SMOOTH_V/SMOOTH_H this report named. All four are transcribed-only; the
122+ verifier hand-checked SMOOTH_V/H against intrapred.c:115-172 (correct), and
123+ V/H are axis-free single-edge reads carrying no rect risk.
124+Also uncovered: `Edges::build`'s repeat-extension branch is never exercised at
125+rect reach (the harness always supplies a full bw+bh neighbour run).
lanes/intrarect_dump.cadded+323 -0
@@ -0,0 +1,323 @@
1+/* lane-intrarect r1: standalone C reimplementation of libaom's rect intra
2+ * predictors, transcribed verbatim from the source read this round
3+ * (aom_dsp/intrapred.c's dc_predictor_rect/smooth_predictor/paeth_predictor
4+ * /v_predictor/h_predictor, av1/common/reconintra.c's
5+ * av1_dr_prediction_z1/z2/z3_c, intra_edge_filter_strength,
6+ * av1_use_intra_edge_upsample, av1_filter_intra_edge_c,
7+ * av1_upsample_intra_edge_c). Compiled and run independently of the Rust
8+ * port -- see lanes/wedge_dump.c for the pattern this copies and the
9+ * charter's shared-oracle-blindness note on why an independent
10+ * transcription is the check, not the table data.
11+ *
12+ * Every predictor here takes `above`/`left` pointers offset so index -1 is
13+ * the corner, exactly like the real decoder passes them (`above_row`/
14+ * `left_col` in reconintra.c) -- the harness's caller fills bw+bh worth of
15+ * real samples (no repeat-extension case exercised; that logic is untouched
16+ * square-path code already proven by the 223/223 lib suite).
17+ */
18+#include <stdint.h>
19+#include <stdio.h>
20+#include <string.h>
21+
22+typedef uint8_t u8;
23+
24+static inline int round2(int value, int shift) {
25+ return (value + (1 << (shift - 1))) >> shift;
26+}
27+static inline int clip_pixel(int v) { return v < 0 ? 0 : v > 255 ? 255 : v; }
28+
29+static const u8 smooth_weights[] = {
30+ 255, 149, 85, 64,
31+ 255, 197, 146, 105, 73, 50, 37, 32,
32+ 255, 225, 196, 170, 145, 123, 102, 84, 68, 54, 43, 33, 26, 20, 17, 16,
33+ 255, 240, 225, 210, 196, 182, 169, 157, 145, 133, 122, 111, 101, 92, 83, 74,
34+ 66, 59, 52, 45, 39, 34, 29, 25, 21, 17, 14, 12, 10, 9, 8, 8,
35+ 255, 248, 240, 233, 225, 218, 210, 203, 196, 189, 182, 176, 169, 163, 156,
36+ 150, 144, 138, 133, 127, 121, 116, 111, 106, 101, 96, 91, 86, 82, 77, 73, 69,
37+ 65, 61, 57, 54, 50, 47, 44, 41, 38, 35, 32, 29, 27, 25, 22, 20, 18, 16, 15,
38+ 13, 12, 10, 9, 8, 7, 6, 6, 5, 5, 4, 4, 4
39+};
40+
41+/* dc_predictor_rect, aom_dsp/intrapred.c: bw != bh always goes through this
42+ * multiply-shift approximate divide (never the exact (sum+half)/count a
43+ * square block uses). */
44+static int dc_predictor_rect(int bw, int bh, const u8 *above, const u8 *left) {
45+ int sum = 0;
46+ for (int i = 0; i < bw; i++) sum += above[i];
47+ for (int i = 0; i < bh; i++) sum += left[i];
48+ int d = bw + bh, shift1 = 0;
49+ while ((d & 1) == 0) { d >>= 1; shift1++; }
50+ int multiplier = d == 3 ? 0x5556 : 0x3334;
51+ int interm = (sum + ((bw + bh) >> 1)) >> shift1;
52+ return (interm * multiplier) >> 16;
53+}
54+
55+static void smooth_predictor(u8 *dst, int bw, int bh, const u8 *above, const u8 *left) {
56+ const u8 below_pred = left[bh - 1];
57+ const u8 right_pred = above[bw - 1];
58+ const u8 *sm_w = smooth_weights + bw - 4;
59+ const u8 *sm_h = smooth_weights + bh - 4;
60+ for (int r = 0; r < bh; r++) {
61+ for (int c = 0; c < bw; c++) {
62+ unsigned this_pred = (unsigned)sm_h[r] * above[c] + (unsigned)(256 - sm_h[r]) * below_pred +
63+ (unsigned)sm_w[c] * left[r] + (unsigned)(256 - sm_w[c]) * right_pred;
64+ dst[r * bw + c] = (u8)round2((int)this_pred, 9);
65+ }
66+ }
67+}
68+
69+static void paeth_predictor(u8 *dst, int bw, int bh, const u8 *above, const u8 *left) {
70+ const int tl = above[-1];
71+ for (int r = 0; r < bh; r++) {
72+ for (int c = 0; c < bw; c++) {
73+ int base = above[c] + left[r] - tl;
74+ int dl = base - left[r]; dl = dl < 0 ? -dl : dl;
75+ int da = base - above[c]; da = da < 0 ? -da : da;
76+ int dc = base - tl; dc = dc < 0 ? -dc : dc;
77+ dst[r * bw + c] = (u8)(dl <= da && dl <= dc ? left[r] : da <= dc ? above[c] : tl);
78+ }
79+ }
80+}
81+
82+/* intra_edge_filter_strength (reconintra.c) -- includes the blk_wh<=12
83+ * branch that has no square-side equivalent (bw==bh's sum is always even
84+ * and >= 8, never lands in 9..=12), which is why the pre-lane Rust port
85+ * never needed it. */
86+static int intra_edge_filter_strength(int bs0, int bs1, int delta, int type) {
87+ int d = delta < 0 ? -delta : delta;
88+ int blk_wh = bs0 + bs1;
89+ int strength = 0;
90+ if (!type) {
91+ if (blk_wh <= 8) { if (d >= 56) strength = 1; }
92+ else if (blk_wh <= 12) { if (d >= 40) strength = 1; }
93+ else if (blk_wh <= 16) { if (d >= 40) strength = 1; }
94+ else if (blk_wh <= 24) { if (d >= 8) strength = 1; if (d >= 16) strength = 2; if (d >= 32) strength = 3; }
95+ else if (blk_wh <= 32) { if (d >= 1) strength = 1; if (d >= 4) strength = 2; if (d >= 32) strength = 3; }
96+ else { if (d >= 1) strength = 3; }
97+ } else {
98+ if (blk_wh <= 8) { if (d >= 40) strength = 1; if (d >= 64) strength = 2; }
99+ else if (blk_wh <= 16) { if (d >= 20) strength = 1; if (d >= 48) strength = 2; }
100+ else if (blk_wh <= 24) { if (d >= 4) strength = 3; }
101+ else { if (d >= 1) strength = 3; }
102+ }
103+ return strength;
104+}
105+
106+static int use_intra_edge_upsample(int bs0, int bs1, int delta, int type) {
107+ int d = delta < 0 ? -delta : delta;
108+ int blk_wh = bs0 + bs1;
109+ if (d == 0 || d >= 40) return 0;
110+ return type ? blk_wh <= 8 : blk_wh <= 16;
111+}
112+
113+static void filter_intra_edge(u8 *p, int sz, int strength) {
114+ if (!strength) return;
115+ static const int kernel[3][5] = { { 0, 4, 8, 4, 0 }, { 0, 5, 6, 5, 0 }, { 2, 4, 4, 4, 2 } };
116+ const int filt = strength - 1;
117+ u8 edge[300];
118+ memcpy(edge, p, sz);
119+ for (int i = 1; i < sz; i++) {
120+ int s = 0;
121+ for (int j = 0; j < 5; j++) {
122+ int k = i - 2 + j;
123+ k = k < 0 ? 0 : k > sz - 1 ? sz - 1 : k;
124+ s += edge[k] * kernel[filt][j];
125+ }
126+ p[i] = (u8)((s + 8) >> 4);
127+ }
128+}
129+
130+static void filter_intra_edge_corner(u8 *above, u8 *left) {
131+ int s = left[0] * 5 + above[-1] * 6 + above[0] * 5;
132+ s = (s + 8) >> 4;
133+ above[-1] = (u8)s;
134+ left[-1] = (u8)s;
135+}
136+
137+/* av1_upsample_intra_edge_c -- p[-1..sz-1] in, p[-2..2*sz-2] out. */
138+static void upsample_intra_edge(u8 *p, int sz) {
139+ u8 in[300];
140+ in[0] = p[-1];
141+ in[1] = p[-1];
142+ for (int i = 0; i < sz; i++) in[i + 2] = p[i];
143+ in[sz + 2] = p[sz - 1];
144+ p[-2] = in[0];
145+ for (int i = 0; i < sz; i++) {
146+ int s = -in[i] + 9 * in[i + 1] + 9 * in[i + 2] - in[i + 3];
147+ s = clip_pixel((s + 8) >> 4);
148+ p[2 * i - 1] = (u8)s;
149+ p[2 * i] = in[i + 2];
150+ }
151+}
152+
153+/* dr_intra_derivative (spec 9.3). */
154+static int dr_intra_derivative(int angle) {
155+ static const struct { int a, v; } table[] = {
156+ {3,1023},{6,547},{9,372},{14,273},{17,215},{20,178},{23,151},{26,132},
157+ {29,116},{32,102},{36,90},{39,80},{42,71},{45,64},{48,57},{51,51},
158+ {54,45},{58,40},{61,35},{64,31},{67,27},{70,23},{73,19},{76,15},
159+ {81,11},{84,7},{87,3},
160+ };
161+ for (size_t i = 0; i < sizeof(table) / sizeof(table[0]); i++)
162+ if (table[i].a == angle) return table[i].v;
163+ fprintf(stderr, "no derivative for %d\n", angle);
164+ return 0;
165+}
166+
167+/* The whole directional path (reconintra.c's edge filter/upsample steps
168+ * plus av1_dr_prediction_z1/z2/z3_c), rect reach `bw + bh` throughout,
169+ * cross-axis n_px extensions (above gets `bh`, left gets `bw`) exactly as
170+ * `build_directional_and_filter_intra_predictors` computes them. */
171+static void directional(u8 *dst, int bw, int bh, int angle, int enable_edge_filter,
172+ int smooth_neighbor, int n_top, int n_left,
173+ u8 *above_buf, u8 *left_buf) {
174+ /* above_buf/left_buf point at index -1 (corner); valid out to bw+bh-1. */
175+ u8 *above = above_buf;
176+ u8 *left = left_buf;
177+ int reach = bw + bh;
178+ int need_above = angle < 180, need_left = angle > 90;
179+ int need_right = angle < 90, need_bottom = angle > 180;
180+
181+ if (enable_edge_filter && angle != 90 && angle != 180) {
182+ if (need_above && need_left && reach >= 24) filter_intra_edge_corner(above, left);
183+ if (need_above && n_top > 0) {
184+ int strength = intra_edge_filter_strength(bw, bh, angle - 90, smooth_neighbor);
185+ int n_px = n_top + 1 + (need_right ? bh : 0);
186+ filter_intra_edge(above - 1, n_px, strength);
187+ }
188+ if (need_left && n_left > 0) {
189+ int strength = intra_edge_filter_strength(bh, bw, angle - 180, smooth_neighbor);
190+ int n_px = n_left + 1 + (need_bottom ? bw : 0);
191+ filter_intra_edge(left - 1, n_px, strength);
192+ }
193+ }
194+ int upsample_above = enable_edge_filter && use_intra_edge_upsample(bw, bh, angle - 90, smooth_neighbor);
195+ int upsample_left = enable_edge_filter && use_intra_edge_upsample(bh, bw, angle - 180, smooth_neighbor);
196+ if (need_above && upsample_above) upsample_intra_edge(above, bw + (need_right ? bh : 0));
197+ if (need_left && upsample_left) upsample_intra_edge(left, bh + (need_bottom ? bw : 0));
198+
199+ int dx = angle < 90 ? dr_intra_derivative(angle) : angle > 90 && angle < 180 ? dr_intra_derivative(180 - angle) : 0;
200+ int dy = angle > 180 ? dr_intra_derivative(270 - angle) : angle > 90 && angle < 180 ? dr_intra_derivative(angle - 90) : 0;
201+
202+ if (angle < 90) {
203+ int max_base_x = (reach - 1) << upsample_above;
204+ int frac_bits = 6 - upsample_above;
205+ int base_inc = 1 << upsample_above;
206+ int x = dx;
207+ for (int r = 0; r < bh; r++, x += dx) {
208+ int base = x >> frac_bits;
209+ int shift = ((x << upsample_above) & 0x3F) >> 1;
210+ for (int c = 0; c < bw; c++, base += base_inc) {
211+ if (base < max_base_x) {
212+ int val = above[base] * (32 - shift) + above[base + 1] * shift;
213+ dst[r * bw + c] = (u8)round2(val, 5);
214+ } else {
215+ dst[r * bw + c] = above[max_base_x];
216+ }
217+ }
218+ }
219+ } else if (angle > 180) {
220+ int max_base_y = (reach - 1) << upsample_left;
221+ int frac_bits = 6 - upsample_left;
222+ int base_inc = 1 << upsample_left;
223+ int y = dy;
224+ for (int c = 0; c < bw; c++, y += dy) {
225+ int base = y >> frac_bits;
226+ int shift = ((y << upsample_left) & 0x3F) >> 1;
227+ for (int r = 0; r < bh; r++, base += base_inc) {
228+ if (base < max_base_y) {
229+ int val = left[base] * (32 - shift) + left[base + 1] * shift;
230+ dst[r * bw + c] = (u8)round2(val, 5);
231+ } else {
232+ dst[r * bw + c] = left[max_base_y];
233+ }
234+ }
235+ }
236+ } else {
237+ int min_base_x = -(1 << upsample_above);
238+ int frac_bits_x = 6 - upsample_above;
239+ int frac_bits_y = 6 - upsample_left;
240+ for (int r = 0; r < bh; r++) {
241+ for (int c = 0; c < bw; c++) {
242+ int val;
243+ int y = r + 1;
244+ int x = (c << 6) - y * dx;
245+ int base_x = x >> frac_bits_x;
246+ if (base_x >= min_base_x) {
247+ int shift = ((x * (1 << upsample_above)) & 0x3F) >> 1;
248+ val = above[base_x] * (32 - shift) + above[base_x + 1] * shift;
249+ val = round2(val, 5);
250+ } else {
251+ int x2 = c + 1;
252+ int y2 = (r << 6) - x2 * dy;
253+ int base_y = y2 >> frac_bits_y;
254+ int shift = ((y2 * (1 << upsample_left)) & 0x3F) >> 1;
255+ val = left[base_y] * (32 - shift) + left[base_y + 1] * shift;
256+ val = round2(val, 5);
257+ }
258+ dst[r * bw + c] = (u8)val;
259+ }
260+ }
261+ }
262+}
263+
264+static uint64_t checksum(const u8 *dst, int bw, int bh) {
265+ uint64_t sum = 0;
266+ for (int i = 0; i < bh; i++)
267+ for (int j = 0; j < bw; j++) sum += (uint64_t)dst[i * bw + j] * (uint64_t)(i * bw + j + 1);
268+ return sum;
269+}
270+
271+/* Deterministic synthetic neighbours: above[i] and left[i] both a simple
272+ * ramp-with-wobble so the checksum is sensitive to every index used. */
273+static void fill(u8 *buf, int n, int seed) {
274+ for (int i = 0; i < n; i++) buf[i] = (u8)((i * 7 + seed * 13 + (i % 5) * 3) % 256);
275+}
276+
277+int main(void) {
278+ int shapes[][2] = { {8,4},{4,8},{16,8},{8,16},{4,16},{16,4},{32,16},{16,32} };
279+ /* mode tags: 0=DC 1=V 2=H 3=SMOOTH 4=SMOOTH_V 5=SMOOTH_H 6=PAETH,
280+ * 7..=13 directional angles handled separately below. */
281+ for (size_t s = 0; s < sizeof(shapes) / sizeof(shapes[0]); s++) {
282+ int bw = shapes[s][0], bh = shapes[s][1];
283+ int reach = bw + bh;
284+ u8 above_buf[300], left_buf[300];
285+ fill(above_buf + 1, reach, 1);
286+ fill(left_buf + 1, reach, 2);
287+ u8 corner = (u8)((bw * 3 + bh * 5) % 256);
288+ above_buf[0] = corner;
289+ left_buf[0] = corner;
290+ u8 *above = above_buf + 1, *left = left_buf + 1;
291+ u8 dst[512];
292+
293+ int dc = dc_predictor_rect(bw, bh, above, left);
294+ printf("%dx%d DC value=%d\n", bw, bh, dc);
295+
296+ smooth_predictor(dst, bw, bh, above, left);
297+ printf("%dx%d SMOOTH checksum=%llu\n", bw, bh, (unsigned long long)checksum(dst, bw, bh));
298+
299+ paeth_predictor(dst, bw, bh, above, left);
300+ printf("%dx%d PAETH checksum=%llu\n", bw, bh, (unsigned long long)checksum(dst, bw, bh));
301+
302+ /* directional: a handful of angles across all three zones, with and
303+ * without the edge filter, both smooth_neighbor states. */
304+ /* Only angles actually reachable as Mode_To_Angle[mode] + angle_delta *
305+ * ANGLE_STEP (delta in -3..=3, step 3) for some directional mode --
306+ * dr_intra_derivative's table is sparse and panics outside this set. */
307+ int angles[] = { 45, 48, 64, 67, 84, 87, 113, 116, 135, 138, 157, 160,
308+ 171, 183, 186, 203, 206 };
309+ for (size_t a = 0; a < sizeof(angles) / sizeof(angles[0]); a++) {
310+ for (int ef = 0; ef <= 1; ef++) {
311+ for (int sn = 0; sn <= 1; sn++) {
312+ u8 ab[300], le[300];
313+ memcpy(ab, above_buf, sizeof(above_buf));
314+ memcpy(le, left_buf, sizeof(left_buf));
315+ directional(dst, bw, bh, angles[a], ef, sn, bw, bh, ab + 1, le + 1);
316+ printf("%dx%d DR angle=%d ef=%d sn=%d checksum=%llu\n", bw, bh, angles[a], ef, sn,
317+ (unsigned long long)checksum(dst, bw, bh));
318+ }
319+ }
320+ }
321+ }
322+ return 0;
323+}
lanes/intrarect_dump.expected.txtadded+568 -0
@@ -0,0 +1,568 @@
1+8x4 DC value=42
2+8x4 SMOOTH checksum=29572
3+8x4 PAETH checksum=23973
4+8x4 DR angle=45 ef=0 sn=0 checksum=35699
5+8x4 DR angle=45 ef=0 sn=1 checksum=35699
6+8x4 DR angle=45 ef=1 sn=0 checksum=35595
7+8x4 DR angle=45 ef=1 sn=1 checksum=35595
8+8x4 DR angle=48 ef=0 sn=0 checksum=34662
9+8x4 DR angle=48 ef=0 sn=1 checksum=34662
10+8x4 DR angle=48 ef=1 sn=0 checksum=34477
11+8x4 DR angle=48 ef=1 sn=1 checksum=34477
12+8x4 DR angle=64 ef=0 sn=0 checksum=29920
13+8x4 DR angle=64 ef=0 sn=1 checksum=29920
14+8x4 DR angle=64 ef=1 sn=0 checksum=30097
15+8x4 DR angle=64 ef=1 sn=1 checksum=29892
16+8x4 DR angle=67 ef=0 sn=0 checksum=29260
17+8x4 DR angle=67 ef=0 sn=1 checksum=29260
18+8x4 DR angle=67 ef=1 sn=0 checksum=29277
19+8x4 DR angle=67 ef=1 sn=1 checksum=29160
20+8x4 DR angle=84 ef=0 sn=0 checksum=24921
21+8x4 DR angle=84 ef=0 sn=1 checksum=24921
22+8x4 DR angle=84 ef=1 sn=0 checksum=24908
23+8x4 DR angle=84 ef=1 sn=1 checksum=24921
24+8x4 DR angle=87 ef=0 sn=0 checksum=24182
25+8x4 DR angle=87 ef=0 sn=1 checksum=24182
26+8x4 DR angle=87 ef=1 sn=0 checksum=24172
27+8x4 DR angle=87 ef=1 sn=1 checksum=24182
28+8x4 DR angle=113 ef=0 sn=0 checksum=20767
29+8x4 DR angle=113 ef=0 sn=1 checksum=20767
30+8x4 DR angle=113 ef=1 sn=0 checksum=20905
31+8x4 DR angle=113 ef=1 sn=1 checksum=21516
32+8x4 DR angle=116 ef=0 sn=0 checksum=20512
33+8x4 DR angle=116 ef=0 sn=1 checksum=20512
34+8x4 DR angle=116 ef=1 sn=0 checksum=20617
35+8x4 DR angle=116 ef=1 sn=1 checksum=21228
36+8x4 DR angle=135 ef=0 sn=0 checksum=18423
37+8x4 DR angle=135 ef=0 sn=1 checksum=18423
38+8x4 DR angle=135 ef=1 sn=0 checksum=19333
39+8x4 DR angle=135 ef=1 sn=1 checksum=19333
40+8x4 DR angle=138 ef=0 sn=0 checksum=18221
41+8x4 DR angle=138 ef=0 sn=1 checksum=18221
42+8x4 DR angle=138 ef=1 sn=0 checksum=19173
43+8x4 DR angle=138 ef=1 sn=1 checksum=19331
44+8x4 DR angle=157 ef=0 sn=0 checksum=18365
45+8x4 DR angle=157 ef=0 sn=1 checksum=18365
46+8x4 DR angle=157 ef=1 sn=0 checksum=18549
47+8x4 DR angle=157 ef=1 sn=1 checksum=19802
48+8x4 DR angle=160 ef=0 sn=0 checksum=18977
49+8x4 DR angle=160 ef=0 sn=1 checksum=18977
50+8x4 DR angle=160 ef=1 sn=0 checksum=18950
51+8x4 DR angle=160 ef=1 sn=1 checksum=20135
52+8x4 DR angle=171 ef=0 sn=0 checksum=21256
53+8x4 DR angle=171 ef=0 sn=1 checksum=21256
54+8x4 DR angle=171 ef=1 sn=0 checksum=21290
55+8x4 DR angle=171 ef=1 sn=1 checksum=21344
56+8x4 DR angle=183 ef=0 sn=0 checksum=25992
57+8x4 DR angle=183 ef=0 sn=1 checksum=25992
58+8x4 DR angle=183 ef=1 sn=0 checksum=26098
59+8x4 DR angle=183 ef=1 sn=1 checksum=25992
60+8x4 DR angle=186 ef=0 sn=0 checksum=27620
61+8x4 DR angle=186 ef=0 sn=1 checksum=27620
62+8x4 DR angle=186 ef=1 sn=0 checksum=27689
63+8x4 DR angle=186 ef=1 sn=1 checksum=27620
64+8x4 DR angle=203 ef=0 sn=0 checksum=32331
65+8x4 DR angle=203 ef=0 sn=1 checksum=32331
66+8x4 DR angle=203 ef=1 sn=0 checksum=32429
67+8x4 DR angle=203 ef=1 sn=1 checksum=32286
68+8x4 DR angle=206 ef=0 sn=0 checksum=33327
69+8x4 DR angle=206 ef=0 sn=1 checksum=33327
70+8x4 DR angle=206 ef=1 sn=0 checksum=33393
71+8x4 DR angle=206 ef=1 sn=1 checksum=33258
72+4x8 DC value=46
73+4x8 SMOOTH checksum=31942
74+4x8 PAETH checksum=21653
75+4x8 DR angle=45 ef=0 sn=0 checksum=37279
76+4x8 DR angle=45 ef=0 sn=1 checksum=37279
77+4x8 DR angle=45 ef=1 sn=0 checksum=37191
78+4x8 DR angle=45 ef=1 sn=1 checksum=37191
79+4x8 DR angle=48 ef=0 sn=0 checksum=34894
80+4x8 DR angle=48 ef=0 sn=1 checksum=34894
81+4x8 DR angle=48 ef=1 sn=0 checksum=34885
82+4x8 DR angle=48 ef=1 sn=1 checksum=34885
83+4x8 DR angle=64 ef=0 sn=0 checksum=26224
84+4x8 DR angle=64 ef=0 sn=1 checksum=26224
85+4x8 DR angle=64 ef=1 sn=0 checksum=26289
86+4x8 DR angle=64 ef=1 sn=1 checksum=26127
87+4x8 DR angle=67 ef=0 sn=0 checksum=24996
88+4x8 DR angle=67 ef=0 sn=1 checksum=24996
89+4x8 DR angle=67 ef=1 sn=0 checksum=25121
90+4x8 DR angle=67 ef=1 sn=1 checksum=24980
91+4x8 DR angle=84 ef=0 sn=0 checksum=18550
92+4x8 DR angle=84 ef=0 sn=1 checksum=18550
93+4x8 DR angle=84 ef=1 sn=0 checksum=18401
94+4x8 DR angle=84 ef=1 sn=1 checksum=18550
95+4x8 DR angle=87 ef=0 sn=0 checksum=16592
96+4x8 DR angle=87 ef=0 sn=1 checksum=16592
97+4x8 DR angle=87 ef=1 sn=0 checksum=16503
98+4x8 DR angle=87 ef=1 sn=1 checksum=16592
99+4x8 DR angle=113 ef=0 sn=0 checksum=18478
100+4x8 DR angle=113 ef=0 sn=1 checksum=18478
101+4x8 DR angle=113 ef=1 sn=0 checksum=18748
102+4x8 DR angle=113 ef=1 sn=1 checksum=20501
103+4x8 DR angle=116 ef=0 sn=0 checksum=19931
104+4x8 DR angle=116 ef=0 sn=1 checksum=19931
105+4x8 DR angle=116 ef=1 sn=0 checksum=20292
106+4x8 DR angle=116 ef=1 sn=1 checksum=21753
107+4x8 DR angle=135 ef=0 sn=0 checksum=25924
108+4x8 DR angle=135 ef=0 sn=1 checksum=25924
109+4x8 DR angle=135 ef=1 sn=0 checksum=26534
110+4x8 DR angle=135 ef=1 sn=1 checksum=26534
111+4x8 DR angle=138 ef=0 sn=0 checksum=26694
112+4x8 DR angle=138 ef=0 sn=1 checksum=26694
113+4x8 DR angle=138 ef=1 sn=0 checksum=27243
114+4x8 DR angle=138 ef=1 sn=1 checksum=27298
115+4x8 DR angle=157 ef=0 sn=0 checksum=30351
116+4x8 DR angle=157 ef=0 sn=1 checksum=30351
117+4x8 DR angle=157 ef=1 sn=0 checksum=30455
118+4x8 DR angle=157 ef=1 sn=1 checksum=30639
119+4x8 DR angle=160 ef=0 sn=0 checksum=30841
120+4x8 DR angle=160 ef=0 sn=1 checksum=30841
121+4x8 DR angle=160 ef=1 sn=0 checksum=30892
122+4x8 DR angle=160 ef=1 sn=1 checksum=31126
123+4x8 DR angle=171 ef=0 sn=0 checksum=32631
124+4x8 DR angle=171 ef=0 sn=1 checksum=32631
125+4x8 DR angle=171 ef=1 sn=0 checksum=32703
126+4x8 DR angle=171 ef=1 sn=1 checksum=32631
127+4x8 DR angle=183 ef=0 sn=0 checksum=34594
128+4x8 DR angle=183 ef=0 sn=1 checksum=34594
129+4x8 DR angle=183 ef=1 sn=0 checksum=34618
130+4x8 DR angle=183 ef=1 sn=1 checksum=34594
131+4x8 DR angle=186 ef=0 sn=0 checksum=35232
132+4x8 DR angle=186 ef=0 sn=1 checksum=35232
133+4x8 DR angle=186 ef=1 sn=0 checksum=35287
134+4x8 DR angle=186 ef=1 sn=1 checksum=35232
135+4x8 DR angle=203 ef=0 sn=0 checksum=38755
136+4x8 DR angle=203 ef=0 sn=1 checksum=38755
137+4x8 DR angle=203 ef=1 sn=0 checksum=38765
138+4x8 DR angle=203 ef=1 sn=1 checksum=38686
139+4x8 DR angle=206 ef=0 sn=0 checksum=39390
140+4x8 DR angle=206 ef=0 sn=1 checksum=39390
141+4x8 DR angle=206 ef=1 sn=0 checksum=39526
142+4x8 DR angle=206 ef=1 sn=1 checksum=39361
143+16x8 DC value=66
144+16x8 SMOOTH checksum=735802
145+16x8 PAETH checksum=504530
146+16x8 DR angle=45 ef=0 sn=0 checksum=944678
147+16x8 DR angle=45 ef=0 sn=1 checksum=944678
148+16x8 DR angle=45 ef=1 sn=0 checksum=944110
149+16x8 DR angle=45 ef=1 sn=1 checksum=944110
150+16x8 DR angle=48 ef=0 sn=0 checksum=906243
151+16x8 DR angle=48 ef=0 sn=1 checksum=906243
152+16x8 DR angle=48 ef=1 sn=0 checksum=908131
153+16x8 DR angle=48 ef=1 sn=1 checksum=908131
154+16x8 DR angle=64 ef=0 sn=0 checksum=772721
155+16x8 DR angle=64 ef=0 sn=1 checksum=772721
156+16x8 DR angle=64 ef=1 sn=0 checksum=772104
157+16x8 DR angle=64 ef=1 sn=1 checksum=771480
158+16x8 DR angle=67 ef=0 sn=0 checksum=750724
159+16x8 DR angle=67 ef=0 sn=1 checksum=750724
160+16x8 DR angle=67 ef=1 sn=0 checksum=750821
161+16x8 DR angle=67 ef=1 sn=1 checksum=752341
162+16x8 DR angle=84 ef=0 sn=0 checksum=644540
163+16x8 DR angle=84 ef=0 sn=1 checksum=644540
164+16x8 DR angle=84 ef=1 sn=0 checksum=644540
165+16x8 DR angle=84 ef=1 sn=1 checksum=654186
166+16x8 DR angle=87 ef=0 sn=0 checksum=622368
167+16x8 DR angle=87 ef=0 sn=1 checksum=622368
168+16x8 DR angle=87 ef=1 sn=0 checksum=622368
169+16x8 DR angle=87 ef=1 sn=1 checksum=622368
170+16x8 DR angle=113 ef=0 sn=0 checksum=523077
171+16x8 DR angle=113 ef=0 sn=1 checksum=523077
172+16x8 DR angle=113 ef=1 sn=0 checksum=517536
173+16x8 DR angle=113 ef=1 sn=1 checksum=521583
174+16x8 DR angle=116 ef=0 sn=0 checksum=512825
175+16x8 DR angle=116 ef=0 sn=1 checksum=512825
176+16x8 DR angle=116 ef=1 sn=0 checksum=506767
177+16x8 DR angle=116 ef=1 sn=1 checksum=511222
178+16x8 DR angle=135 ef=0 sn=0 checksum=441500
179+16x8 DR angle=135 ef=0 sn=1 checksum=441500
180+16x8 DR angle=135 ef=1 sn=0 checksum=436765
181+16x8 DR angle=135 ef=1 sn=1 checksum=436765
182+16x8 DR angle=138 ef=0 sn=0 checksum=430140
183+16x8 DR angle=138 ef=0 sn=1 checksum=430140
184+16x8 DR angle=138 ef=1 sn=0 checksum=427051
185+16x8 DR angle=138 ef=1 sn=1 checksum=427051
186+16x8 DR angle=157 ef=0 sn=0 checksum=410463
187+16x8 DR angle=157 ef=0 sn=1 checksum=410463
188+16x8 DR angle=157 ef=1 sn=0 checksum=398819
189+16x8 DR angle=157 ef=1 sn=1 checksum=404834
190+16x8 DR angle=160 ef=0 sn=0 checksum=419402
191+16x8 DR angle=160 ef=0 sn=1 checksum=419402
192+16x8 DR angle=160 ef=1 sn=0 checksum=408761
193+16x8 DR angle=160 ef=1 sn=1 checksum=414130
194+16x8 DR angle=171 ef=0 sn=0 checksum=468448
195+16x8 DR angle=171 ef=0 sn=1 checksum=468448
196+16x8 DR angle=171 ef=1 sn=0 checksum=463551
197+16x8 DR angle=171 ef=1 sn=1 checksum=466677
198+16x8 DR angle=183 ef=0 sn=0 checksum=563230
199+16x8 DR angle=183 ef=0 sn=1 checksum=563230
200+16x8 DR angle=183 ef=1 sn=0 checksum=563230
201+16x8 DR angle=183 ef=1 sn=1 checksum=563230
202+16x8 DR angle=186 ef=0 sn=0 checksum=599306
203+16x8 DR angle=186 ef=0 sn=1 checksum=599306
204+16x8 DR angle=186 ef=1 sn=0 checksum=599306
205+16x8 DR angle=186 ef=1 sn=1 checksum=599808
206+16x8 DR angle=203 ef=0 sn=0 checksum=757612
207+16x8 DR angle=203 ef=0 sn=1 checksum=757612
208+16x8 DR angle=203 ef=1 sn=0 checksum=757229
209+16x8 DR angle=203 ef=1 sn=1 checksum=757607
210+16x8 DR angle=206 ef=0 sn=0 checksum=790176
211+16x8 DR angle=206 ef=0 sn=1 checksum=790176
212+16x8 DR angle=206 ef=1 sn=0 checksum=789485
213+16x8 DR angle=206 ef=1 sn=1 checksum=789611
214+8x16 DC value=70
215+8x16 SMOOTH checksum=804128
216+8x16 PAETH checksum=400982
217+8x16 DR angle=45 ef=0 sn=0 checksum=1006678
218+8x16 DR angle=45 ef=0 sn=1 checksum=1006678
219+8x16 DR angle=45 ef=1 sn=0 checksum=1006680
220+8x16 DR angle=45 ef=1 sn=1 checksum=1006680
221+8x16 DR angle=48 ef=0 sn=0 checksum=937130
222+8x16 DR angle=48 ef=0 sn=1 checksum=937130
223+8x16 DR angle=48 ef=1 sn=0 checksum=937048
224+8x16 DR angle=48 ef=1 sn=1 checksum=937048
225+8x16 DR angle=64 ef=0 sn=0 checksum=677057
226+8x16 DR angle=64 ef=0 sn=1 checksum=677057
227+8x16 DR angle=64 ef=1 sn=0 checksum=676228
228+8x16 DR angle=64 ef=1 sn=1 checksum=676296
229+8x16 DR angle=67 ef=0 sn=0 checksum=635226
230+8x16 DR angle=67 ef=0 sn=1 checksum=635226
231+8x16 DR angle=67 ef=1 sn=0 checksum=635408
232+8x16 DR angle=67 ef=1 sn=1 checksum=635933
233+8x16 DR angle=84 ef=0 sn=0 checksum=436214
234+8x16 DR angle=84 ef=0 sn=1 checksum=436214
235+8x16 DR angle=84 ef=1 sn=0 checksum=436214
236+8x16 DR angle=84 ef=1 sn=1 checksum=444760
237+8x16 DR angle=87 ef=0 sn=0 checksum=390682
238+8x16 DR angle=87 ef=0 sn=1 checksum=390682
239+8x16 DR angle=87 ef=1 sn=0 checksum=390682
240+8x16 DR angle=87 ef=1 sn=1 checksum=390682
241+8x16 DR angle=113 ef=0 sn=0 checksum=439794
242+8x16 DR angle=113 ef=0 sn=1 checksum=439794
243+8x16 DR angle=113 ef=1 sn=0 checksum=423834
244+8x16 DR angle=113 ef=1 sn=1 checksum=432386
245+8x16 DR angle=116 ef=0 sn=0 checksum=470056
246+8x16 DR angle=116 ef=0 sn=1 checksum=470056
247+8x16 DR angle=116 ef=1 sn=0 checksum=450904
248+8x16 DR angle=116 ef=1 sn=1 checksum=457951
249+8x16 DR angle=135 ef=0 sn=0 checksum=616778
250+8x16 DR angle=135 ef=0 sn=1 checksum=616778
251+8x16 DR angle=135 ef=1 sn=0 checksum=612008
252+8x16 DR angle=135 ef=1 sn=1 checksum=612008
253+8x16 DR angle=138 ef=0 sn=0 checksum=639023
254+8x16 DR angle=138 ef=0 sn=1 checksum=639023
255+8x16 DR angle=138 ef=1 sn=0 checksum=635523
256+8x16 DR angle=138 ef=1 sn=1 checksum=635523
257+8x16 DR angle=157 ef=0 sn=0 checksum=744953
258+8x16 DR angle=157 ef=0 sn=1 checksum=744953
259+8x16 DR angle=157 ef=1 sn=0 checksum=742538
260+8x16 DR angle=157 ef=1 sn=1 checksum=742612
261+8x16 DR angle=160 ef=0 sn=0 checksum=761109
262+8x16 DR angle=160 ef=0 sn=1 checksum=761109
263+8x16 DR angle=160 ef=1 sn=0 checksum=758277
264+8x16 DR angle=160 ef=1 sn=1 checksum=758253
265+8x16 DR angle=171 ef=0 sn=0 checksum=809699
266+8x16 DR angle=171 ef=0 sn=1 checksum=809699
267+8x16 DR angle=171 ef=1 sn=0 checksum=806905
268+8x16 DR angle=171 ef=1 sn=1 checksum=804414
269+8x16 DR angle=183 ef=0 sn=0 checksum=860990
270+8x16 DR angle=183 ef=0 sn=1 checksum=860990
271+8x16 DR angle=183 ef=1 sn=0 checksum=860990
272+8x16 DR angle=183 ef=1 sn=1 checksum=860990
273+8x16 DR angle=186 ef=0 sn=0 checksum=877246
274+8x16 DR angle=186 ef=0 sn=1 checksum=877246
275+8x16 DR angle=186 ef=1 sn=0 checksum=877246
276+8x16 DR angle=186 ef=1 sn=1 checksum=880208
277+8x16 DR angle=203 ef=0 sn=0 checksum=959766
278+8x16 DR angle=203 ef=0 sn=1 checksum=959766
279+8x16 DR angle=203 ef=1 sn=0 checksum=960071
280+8x16 DR angle=203 ef=1 sn=1 checksum=962081
281+8x16 DR angle=206 ef=0 sn=0 checksum=977437
282+8x16 DR angle=206 ef=0 sn=1 checksum=977437
283+8x16 DR angle=206 ef=1 sn=0 checksum=977526
284+8x16 DR angle=206 ef=1 sn=1 checksum=978053
285+4x16 DC value=73
286+4x16 SMOOTH checksum=190368
287+4x16 PAETH checksum=90941
288+4x16 DR angle=45 ef=0 sn=0 checksum=223790
289+4x16 DR angle=45 ef=0 sn=1 checksum=223790
290+4x16 DR angle=45 ef=1 sn=0 checksum=223934
291+4x16 DR angle=45 ef=1 sn=1 checksum=223934
292+4x16 DR angle=48 ef=0 sn=0 checksum=205926
293+4x16 DR angle=48 ef=0 sn=1 checksum=205926
294+4x16 DR angle=48 ef=1 sn=0 checksum=206043
295+4x16 DR angle=48 ef=1 sn=1 checksum=206043
296+4x16 DR angle=64 ef=0 sn=0 checksum=140765
297+4x16 DR angle=64 ef=0 sn=1 checksum=140765
298+4x16 DR angle=64 ef=1 sn=0 checksum=140532
299+4x16 DR angle=64 ef=1 sn=1 checksum=140593
300+4x16 DR angle=67 ef=0 sn=0 checksum=130523
301+4x16 DR angle=67 ef=0 sn=1 checksum=130523
302+4x16 DR angle=67 ef=1 sn=0 checksum=130400
303+4x16 DR angle=67 ef=1 sn=1 checksum=130455
304+4x16 DR angle=84 ef=0 sn=0 checksum=81800
305+4x16 DR angle=84 ef=0 sn=1 checksum=81800
306+4x16 DR angle=84 ef=1 sn=0 checksum=81800
307+4x16 DR angle=84 ef=1 sn=1 checksum=84151
308+4x16 DR angle=87 ef=0 sn=0 checksum=70112
309+4x16 DR angle=87 ef=0 sn=1 checksum=70112
310+4x16 DR angle=87 ef=1 sn=0 checksum=70112
311+4x16 DR angle=87 ef=1 sn=1 checksum=70112
312+4x16 DR angle=113 ef=0 sn=0 checksum=139227
313+4x16 DR angle=113 ef=0 sn=1 checksum=139227
314+4x16 DR angle=113 ef=1 sn=0 checksum=146905
315+4x16 DR angle=113 ef=1 sn=1 checksum=148607
316+4x16 DR angle=116 ef=0 sn=0 checksum=147139
317+4x16 DR angle=116 ef=0 sn=1 checksum=147139
318+4x16 DR angle=116 ef=1 sn=0 checksum=153696
319+4x16 DR angle=116 ef=1 sn=1 checksum=154936
320+4x16 DR angle=135 ef=0 sn=0 checksum=179046
321+4x16 DR angle=135 ef=0 sn=1 checksum=179046
322+4x16 DR angle=135 ef=1 sn=0 checksum=181777
323+4x16 DR angle=135 ef=1 sn=1 checksum=181777
324+4x16 DR angle=138 ef=0 sn=0 checksum=182440
325+4x16 DR angle=138 ef=0 sn=1 checksum=182440
326+4x16 DR angle=138 ef=1 sn=0 checksum=185345
327+4x16 DR angle=138 ef=1 sn=1 checksum=185345
328+4x16 DR angle=157 ef=0 sn=0 checksum=199670
329+4x16 DR angle=157 ef=0 sn=1 checksum=199670
330+4x16 DR angle=157 ef=1 sn=0 checksum=200138
331+4x16 DR angle=157 ef=1 sn=1 checksum=199845
332+4x16 DR angle=160 ef=0 sn=0 checksum=201999
333+4x16 DR angle=160 ef=0 sn=1 checksum=201999
334+4x16 DR angle=160 ef=1 sn=0 checksum=201918
335+4x16 DR angle=160 ef=1 sn=1 checksum=201569
336+4x16 DR angle=171 ef=0 sn=0 checksum=208549
337+4x16 DR angle=171 ef=0 sn=1 checksum=208549
338+4x16 DR angle=171 ef=1 sn=0 checksum=208097
339+4x16 DR angle=171 ef=1 sn=1 checksum=207755
340+4x16 DR angle=183 ef=0 sn=0 checksum=215200
341+4x16 DR angle=183 ef=0 sn=1 checksum=215200
342+4x16 DR angle=183 ef=1 sn=0 checksum=215200
343+4x16 DR angle=183 ef=1 sn=1 checksum=215200
344+4x16 DR angle=186 ef=0 sn=0 checksum=217302
345+4x16 DR angle=186 ef=0 sn=1 checksum=217302
346+4x16 DR angle=186 ef=1 sn=0 checksum=217302
347+4x16 DR angle=186 ef=1 sn=1 checksum=218595
348+4x16 DR angle=203 ef=0 sn=0 checksum=228883
349+4x16 DR angle=203 ef=0 sn=1 checksum=228883
350+4x16 DR angle=203 ef=1 sn=0 checksum=228719
351+4x16 DR angle=203 ef=1 sn=1 checksum=229465
352+4x16 DR angle=206 ef=0 sn=0 checksum=230924
353+4x16 DR angle=206 ef=0 sn=1 checksum=230924
354+4x16 DR angle=206 ef=1 sn=0 checksum=231170
355+4x16 DR angle=206 ef=1 sn=1 checksum=232158
356+16x4 DC value=65
357+16x4 SMOOTH checksum=164631
358+16x4 PAETH checksum=130203
359+16x4 DR angle=45 ef=0 sn=0 checksum=203990
360+16x4 DR angle=45 ef=0 sn=1 checksum=203990
361+16x4 DR angle=45 ef=1 sn=0 checksum=203807
362+16x4 DR angle=45 ef=1 sn=1 checksum=203807
363+16x4 DR angle=48 ef=0 sn=0 checksum=199385
364+16x4 DR angle=48 ef=0 sn=1 checksum=199385
365+16x4 DR angle=48 ef=1 sn=0 checksum=198716
366+16x4 DR angle=48 ef=1 sn=1 checksum=198716
367+16x4 DR angle=64 ef=0 sn=0 checksum=179476
368+16x4 DR angle=64 ef=0 sn=1 checksum=179476
369+16x4 DR angle=64 ef=1 sn=0 checksum=179828
370+16x4 DR angle=64 ef=1 sn=1 checksum=181001
371+16x4 DR angle=67 ef=0 sn=0 checksum=177294
372+16x4 DR angle=67 ef=0 sn=1 checksum=177294
373+16x4 DR angle=67 ef=1 sn=0 checksum=176846
374+16x4 DR angle=67 ef=1 sn=1 checksum=177939
375+16x4 DR angle=84 ef=0 sn=0 checksum=162182
376+16x4 DR angle=84 ef=0 sn=1 checksum=162182
377+16x4 DR angle=84 ef=1 sn=0 checksum=162182
378+16x4 DR angle=84 ef=1 sn=1 checksum=165478
379+16x4 DR angle=87 ef=0 sn=0 checksum=159636
380+16x4 DR angle=87 ef=0 sn=1 checksum=159636
381+16x4 DR angle=87 ef=1 sn=0 checksum=159636
382+16x4 DR angle=87 ef=1 sn=1 checksum=159636
383+16x4 DR angle=113 ef=0 sn=0 checksum=144368
384+16x4 DR angle=113 ef=0 sn=1 checksum=144368
385+16x4 DR angle=113 ef=1 sn=0 checksum=147559
386+16x4 DR angle=113 ef=1 sn=1 checksum=148421
387+16x4 DR angle=116 ef=0 sn=0 checksum=142644
388+16x4 DR angle=116 ef=0 sn=1 checksum=142644
389+16x4 DR angle=116 ef=1 sn=0 checksum=145339
390+16x4 DR angle=116 ef=1 sn=1 checksum=146373
391+16x4 DR angle=135 ef=0 sn=0 checksum=125922
392+16x4 DR angle=135 ef=0 sn=1 checksum=125922
393+16x4 DR angle=135 ef=1 sn=0 checksum=132258
394+16x4 DR angle=135 ef=1 sn=1 checksum=132258
395+16x4 DR angle=138 ef=0 sn=0 checksum=123406
396+16x4 DR angle=138 ef=0 sn=1 checksum=123406
397+16x4 DR angle=138 ef=1 sn=0 checksum=129587
398+16x4 DR angle=138 ef=1 sn=1 checksum=129587
399+16x4 DR angle=157 ef=0 sn=0 checksum=97394
400+16x4 DR angle=157 ef=0 sn=1 checksum=97394
401+16x4 DR angle=157 ef=1 sn=0 checksum=105459
402+16x4 DR angle=157 ef=1 sn=1 checksum=108033
403+16x4 DR angle=160 ef=0 sn=0 checksum=92961
404+16x4 DR angle=160 ef=0 sn=1 checksum=92961
405+16x4 DR angle=160 ef=1 sn=0 checksum=101530
406+16x4 DR angle=160 ef=1 sn=1 checksum=104616
407+16x4 DR angle=171 ef=0 sn=0 checksum=84380
408+16x4 DR angle=171 ef=0 sn=1 checksum=84380
409+16x4 DR angle=171 ef=1 sn=0 checksum=91715
410+16x4 DR angle=171 ef=1 sn=1 checksum=99319
411+16x4 DR angle=183 ef=0 sn=0 checksum=107088
412+16x4 DR angle=183 ef=0 sn=1 checksum=107088
413+16x4 DR angle=183 ef=1 sn=0 checksum=107088
414+16x4 DR angle=183 ef=1 sn=1 checksum=107088
415+16x4 DR angle=186 ef=0 sn=0 checksum=116088
416+16x4 DR angle=186 ef=0 sn=1 checksum=116088
417+16x4 DR angle=186 ef=1 sn=0 checksum=116088
418+16x4 DR angle=186 ef=1 sn=1 checksum=113485
419+16x4 DR angle=203 ef=0 sn=0 checksum=154500
420+16x4 DR angle=203 ef=0 sn=1 checksum=154500
421+16x4 DR angle=203 ef=1 sn=0 checksum=154009
422+16x4 DR angle=203 ef=1 sn=1 checksum=153847
423+16x4 DR angle=206 ef=0 sn=0 checksum=162486
424+16x4 DR angle=206 ef=0 sn=1 checksum=162486
425+16x4 DR angle=206 ef=1 sn=0 checksum=162139
426+16x4 DR angle=206 ef=1 sn=1 checksum=162183
427+32x16 DC value=113
428+32x16 SMOOTH checksum=20945846
429+32x16 PAETH checksum=12066601
430+32x16 DR angle=45 ef=0 sn=0 checksum=17379299
431+32x16 DR angle=45 ef=0 sn=1 checksum=17379299
432+32x16 DR angle=45 ef=1 sn=0 checksum=17368546
433+32x16 DR angle=45 ef=1 sn=1 checksum=17368546
434+32x16 DR angle=48 ef=0 sn=0 checksum=17577756
435+32x16 DR angle=48 ef=0 sn=1 checksum=17577756
436+32x16 DR angle=48 ef=1 sn=0 checksum=17563001
437+32x16 DR angle=48 ef=1 sn=1 checksum=17563001
438+32x16 DR angle=64 ef=0 sn=0 checksum=18289058
439+32x16 DR angle=64 ef=0 sn=1 checksum=18289058
440+32x16 DR angle=64 ef=1 sn=0 checksum=18239953
441+32x16 DR angle=64 ef=1 sn=1 checksum=18239953
442+32x16 DR angle=67 ef=0 sn=0 checksum=18384132
443+32x16 DR angle=67 ef=0 sn=1 checksum=18384132
444+32x16 DR angle=67 ef=1 sn=0 checksum=18323954
445+32x16 DR angle=67 ef=1 sn=1 checksum=18323954
446+32x16 DR angle=84 ef=0 sn=0 checksum=18160858
447+32x16 DR angle=84 ef=0 sn=1 checksum=18160858
448+32x16 DR angle=84 ef=1 sn=0 checksum=17993545
449+32x16 DR angle=84 ef=1 sn=1 checksum=17993545
450+32x16 DR angle=87 ef=0 sn=0 checksum=17521682
451+32x16 DR angle=87 ef=0 sn=1 checksum=17521682
452+32x16 DR angle=87 ef=1 sn=0 checksum=17648098
453+32x16 DR angle=87 ef=1 sn=1 checksum=17648098
454+32x16 DR angle=113 ef=0 sn=0 checksum=14286825
455+32x16 DR angle=113 ef=0 sn=1 checksum=14286825
456+32x16 DR angle=113 ef=1 sn=0 checksum=14213888
457+32x16 DR angle=113 ef=1 sn=1 checksum=14213888
458+32x16 DR angle=116 ef=0 sn=0 checksum=13931645
459+32x16 DR angle=116 ef=0 sn=1 checksum=13931645
460+32x16 DR angle=116 ef=1 sn=0 checksum=13842063
461+32x16 DR angle=116 ef=1 sn=1 checksum=13842063
462+32x16 DR angle=135 ef=0 sn=0 checksum=11473952
463+32x16 DR angle=135 ef=0 sn=1 checksum=11473952
464+32x16 DR angle=135 ef=1 sn=0 checksum=11346893
465+32x16 DR angle=135 ef=1 sn=1 checksum=11346893
466+32x16 DR angle=138 ef=0 sn=0 checksum=11054494
467+32x16 DR angle=138 ef=0 sn=1 checksum=11054494
468+32x16 DR angle=138 ef=1 sn=0 checksum=10965182
469+32x16 DR angle=138 ef=1 sn=1 checksum=10965182
470+32x16 DR angle=157 ef=0 sn=0 checksum=9743670
471+32x16 DR angle=157 ef=0 sn=1 checksum=9743670
472+32x16 DR angle=157 ef=1 sn=0 checksum=9621579
473+32x16 DR angle=157 ef=1 sn=1 checksum=9621579
474+32x16 DR angle=160 ef=0 sn=0 checksum=9944099
475+32x16 DR angle=160 ef=0 sn=1 checksum=9944099
476+32x16 DR angle=160 ef=1 sn=0 checksum=9824666
477+32x16 DR angle=160 ef=1 sn=1 checksum=9824666
478+32x16 DR angle=171 ef=0 sn=0 checksum=11341471
479+32x16 DR angle=171 ef=0 sn=1 checksum=11341471
480+32x16 DR angle=171 ef=1 sn=0 checksum=11301330
481+32x16 DR angle=171 ef=1 sn=1 checksum=11301330
482+32x16 DR angle=183 ef=0 sn=0 checksum=14224142
483+32x16 DR angle=183 ef=0 sn=1 checksum=14224142
484+32x16 DR angle=183 ef=1 sn=0 checksum=14275039
485+32x16 DR angle=183 ef=1 sn=1 checksum=14275039
486+32x16 DR angle=186 ef=0 sn=0 checksum=15202347
487+32x16 DR angle=186 ef=0 sn=1 checksum=15202347
488+32x16 DR angle=186 ef=1 sn=0 checksum=15231658
489+32x16 DR angle=186 ef=1 sn=1 checksum=15231658
490+32x16 DR angle=203 ef=0 sn=0 checksum=20054637
491+32x16 DR angle=203 ef=0 sn=1 checksum=20054637
492+32x16 DR angle=203 ef=1 sn=0 checksum=20065075
493+32x16 DR angle=203 ef=1 sn=1 checksum=20065075
494+32x16 DR angle=206 ef=0 sn=0 checksum=21025828
495+32x16 DR angle=206 ef=0 sn=1 checksum=21025828
496+32x16 DR angle=206 ef=1 sn=0 checksum=20964764
497+32x16 DR angle=206 ef=1 sn=1 checksum=20964764
498+16x32 DC value=117
499+16x32 SMOOTH checksum=23192810
500+16x32 PAETH checksum=9210317
501+16x32 DR angle=45 ef=0 sn=0 checksum=17739139
502+16x32 DR angle=45 ef=0 sn=1 checksum=17739139
503+16x32 DR angle=45 ef=1 sn=0 checksum=17684214
504+16x32 DR angle=45 ef=1 sn=1 checksum=17684214
505+16x32 DR angle=48 ef=0 sn=0 checksum=19572638
506+16x32 DR angle=48 ef=0 sn=1 checksum=19572638
507+16x32 DR angle=48 ef=1 sn=0 checksum=19512961
508+16x32 DR angle=48 ef=1 sn=1 checksum=19512961
509+16x32 DR angle=64 ef=0 sn=0 checksum=19179170
510+16x32 DR angle=64 ef=0 sn=1 checksum=19179170
511+16x32 DR angle=64 ef=1 sn=0 checksum=19181507
512+16x32 DR angle=64 ef=1 sn=1 checksum=19181507
513+16x32 DR angle=67 ef=0 sn=0 checksum=17929369
514+16x32 DR angle=67 ef=0 sn=1 checksum=17929369
515+16x32 DR angle=67 ef=1 sn=0 checksum=17933010
516+16x32 DR angle=67 ef=1 sn=1 checksum=17933010
517+16x32 DR angle=84 ef=0 sn=0 checksum=11667688
518+16x32 DR angle=84 ef=0 sn=1 checksum=11667688
519+16x32 DR angle=84 ef=1 sn=0 checksum=11707190
520+16x32 DR angle=84 ef=1 sn=1 checksum=11707190
521+16x32 DR angle=87 ef=0 sn=0 checksum=10377756
522+16x32 DR angle=87 ef=0 sn=1 checksum=10377756
523+16x32 DR angle=87 ef=1 sn=0 checksum=10643393
524+16x32 DR angle=87 ef=1 sn=1 checksum=10643393
525+16x32 DR angle=113 ef=0 sn=0 checksum=11153430
526+16x32 DR angle=113 ef=0 sn=1 checksum=11153430
527+16x32 DR angle=113 ef=1 sn=0 checksum=10976241
528+16x32 DR angle=113 ef=1 sn=1 checksum=10976241
529+16x32 DR angle=116 ef=0 sn=0 checksum=11894475
530+16x32 DR angle=116 ef=0 sn=1 checksum=11894475
531+16x32 DR angle=116 ef=1 sn=0 checksum=11665880
532+16x32 DR angle=116 ef=1 sn=1 checksum=11665880
533+16x32 DR angle=135 ef=0 sn=0 checksum=16319430
534+16x32 DR angle=135 ef=0 sn=1 checksum=16319430
535+16x32 DR angle=135 ef=1 sn=0 checksum=16235395
536+16x32 DR angle=135 ef=1 sn=1 checksum=16235395
537+16x32 DR angle=138 ef=0 sn=0 checksum=16958711
538+16x32 DR angle=138 ef=0 sn=1 checksum=16958711
539+16x32 DR angle=138 ef=1 sn=0 checksum=16917512
540+16x32 DR angle=138 ef=1 sn=1 checksum=16917512
541+16x32 DR angle=157 ef=0 sn=0 checksum=20170318
542+16x32 DR angle=157 ef=0 sn=1 checksum=20170318
543+16x32 DR angle=157 ef=1 sn=0 checksum=20147774
544+16x32 DR angle=157 ef=1 sn=1 checksum=20147774
545+16x32 DR angle=160 ef=0 sn=0 checksum=20623341
546+16x32 DR angle=160 ef=0 sn=1 checksum=20623341
547+16x32 DR angle=160 ef=1 sn=0 checksum=20605550
548+16x32 DR angle=160 ef=1 sn=1 checksum=20605550
549+16x32 DR angle=171 ef=0 sn=0 checksum=22038775
550+16x32 DR angle=171 ef=0 sn=1 checksum=22038775
551+16x32 DR angle=171 ef=1 sn=0 checksum=22020627
552+16x32 DR angle=171 ef=1 sn=1 checksum=22020627
553+16x32 DR angle=183 ef=0 sn=0 checksum=22879452
554+16x32 DR angle=183 ef=0 sn=1 checksum=22879452
555+16x32 DR angle=183 ef=1 sn=0 checksum=22199846
556+16x32 DR angle=183 ef=1 sn=1 checksum=22199846
557+16x32 DR angle=186 ef=0 sn=0 checksum=22277140
558+16x32 DR angle=186 ef=0 sn=1 checksum=22277140
559+16x32 DR angle=186 ef=1 sn=0 checksum=21931119
560+16x32 DR angle=186 ef=1 sn=1 checksum=21931119
561+16x32 DR angle=203 ef=0 sn=0 checksum=19662206
562+16x32 DR angle=203 ef=0 sn=1 checksum=19662206
563+16x32 DR angle=203 ef=1 sn=0 checksum=19632671
564+16x32 DR angle=203 ef=1 sn=1 checksum=19632671
565+16x32 DR angle=206 ef=0 sn=0 checksum=19211284
566+16x32 DR angle=206 ef=0 sn=1 checksum=19211284
567+16x32 DR angle=206 ef=1 sn=0 checksum=19197701
568+16x32 DR angle=206 ef=1 sn=1 checksum=19197701