forge
Explore
Log in

Don't you dare go Hollow

The seven-type TX_SET_INTRA_1 tx_type row, V_DCT/H_DCT, gate fires

Browse files at this commit

24117910f97bb2a08ca36628ab4bfef31c1798b2Ahmet Kaan GümüşParent: dcf1147
  • feat
    • the seven-type TX_SET_INTRA_1 tx_type row, V_DCT/H_DCT, gate fires
Show full message
feat(av1): the seven-type TX_SET_INTRA_1 tx_type row, V_DCT/H_DCT, gate fires

A reduced_tx_set=0 frame's 8x8-and-under intra transforms read tx_type
from the seven-symbol TX_SET_INTRA_1, not the five-symbol reduced row
our tables carried (the row-held-constant class, on the tx-set
dimension -- our own encoder always writes reduced_tx_set=1, the same
writer-never-needs-it trap as mv_hp). New set-1 CDF row, the set-1
symbol order from av1_ext_tx_inv, and the V_DCT/H_DCT inverse
transforms (one-axis DCT, identity on the other). The tx-select gate
now actually FIRES: mandelbrot content at min-partition 16 splits
16x16 blocks into TX8 TUs that read the set-1 rows and decode
pixel-exact vs ffmpeg, 4/4 runs, no skips. Resolved 4x4 luma stays a
named refusal (no TX4 coefficient tables yet).
crates/ec-av1/examples/probe_txsel.rsdeleted+0 -63
@@ -1,63 +0,0 @@
1-use std::io::Write;
2-use std::process::{Command, Stdio};
3-
4-fn main() {
5- let path = std::env::args()
6- .nth(1)
7- .unwrap_or_else(|| "/tmp/mb.obu".into());
8- let stream = std::fs::read(&path).expect("read stream");
9- let frames = match ec_av1::stream::decode_stream(&stream) {
10- Ok(f) => f,
11- Err(e) => {
12- eprintln!("decode error: {e}");
13- std::process::exit(1);
14- }
15- };
16- let (width, height) = (64usize, 64usize);
17- let mut child = Command::new("ffmpeg")
18- .args([
19- "-v", "error", "-f", "obu", "-i", "-", "-f", "rawvideo", "-pix_fmt", "yuv420p", "-",
20- ])
21- .stdin(Stdio::piped())
22- .stdout(Stdio::piped())
23- .stderr(Stdio::piped())
24- .spawn()
25- .expect("ffmpeg spawn");
26- child
27- .stdin
28- .take()
29- .unwrap()
30- .write_all(&stream)
31- .expect("write stream");
32- let out = child.wait_with_output().expect("ffmpeg run");
33- if !out.status.success() {
34- eprintln!("ffmpeg refused: {}", String::from_utf8_lossy(&out.stderr));
35- std::process::exit(1);
36- }
37- let luma = width * height;
38- let chroma = luma / 4;
39- let y_ref = &out.stdout[..luma];
40- let u_ref = &out.stdout[luma..luma + chroma];
41- let v_ref = &out.stdout[luma + chroma..luma + 2 * chroma];
42-
43- let pic = &frames[0];
44- let y_match = pic.y == y_ref;
45- let u_match = pic.u == u_ref;
46- let v_match = pic.v == v_ref;
47- println!("decoded ok, y_match={y_match} u_match={u_match} v_match={v_match}");
48- if !y_match {
49- for i in 0..luma {
50- if pic.y[i] != y_ref[i] {
51- println!(
52- "first luma mismatch at idx {i} (row {} col {}): ours={} ref={}",
53- i / width,
54- i % width,
55- pic.y[i],
56- y_ref[i]
57- );
58- break;
59- }
60- }
61- }
62- std::process::exit(if y_match && u_match && v_match { 0 } else { 2 });
63-}
crates/ec-av1/src/cdf_state.rsmodified+24 -0
@@ -41,6 +41,10 @@ pub(crate) enum TxbSet {
41 /// block (lane-av1-rect). An `is_inter` leaf reads41 /// block (lane-av1-rect). An `is_inter` leaf reads
42 /// [`Luma8Inter`](TxbSet::Luma8Inter) instead.42 /// [`Luma8Inter`](TxbSet::Luma8Inter) instead.
43 Luma8,43 Luma8,
44+ /// [`Luma8`](TxbSet::Luma8)'s `reduced_tx_set: false` counterpart (round
45+ /// 8): the same coefficient tables, but the seven-symbol `TX_SET_INTRA_1`
46+ /// `tx_type` table rather than `Luma8`'s five-symbol reduced one.
47+ Luma8Set1,
44 /// The 8x8 luma transform of an `is_inter` 8x8 leaf under a straddling48 /// The 8x8 luma transform of an `is_inter` 8x8 leaf under a straddling
45 /// 16x16 block (lane-av1inter8): the same coefficient tables49 /// 16x16 block (lane-av1inter8): the same coefficient tables
46 /// [`Luma8`](TxbSet::Luma8) reads, but `get_tx_set` (spec 5.11.48)50 /// [`Luma8`](TxbSet::Luma8) reads, but `get_tx_set` (spec 5.11.48)
@@ -225,6 +229,13 @@ pub(crate) struct Cdfs {
225 pub intra_tx_type_16: [[u16; 6]; 13],229 pub intra_tx_type_16: [[u16; 6]; 13],
226 /// The transform type of an 8x8 intra luma transform, by luma mode.230 /// The transform type of an 8x8 intra luma transform, by luma mode.
227 pub intra_tx_type_8: [[u16; 6]; 13],231 pub intra_tx_type_8: [[u16; 6]; 13],
232+ /// The transform type of an 8x8 intra luma transform, by luma mode, when
233+ /// `reduced_tx_set` is false (spec `TX_SET_INTRA_1`, seven types) --
234+ /// [`Self::intra_tx_type_8`]'s five-type table is only the
235+ /// `reduced_tx_set` row (round 8: a real `aomenc` stream with
236+ /// `reduced_tx_set` off desyncs an 8x8 TU read against this row's
237+ /// wrong-length CDF).
238+ pub intra_tx_type_8_set1: [[u16; 8]; 13],
228 /// The transform type of an `is_inter` 32x32 luma transform (spec239 /// The transform type of an `is_inter` 32x32 luma transform (spec
229 /// `TX_SET_INTER_3`, `TX_32X32` row) -- unlike the intra 16x16 table, it240 /// `TX_SET_INTER_3`, `TX_32X32` row) -- unlike the intra 16x16 table, it
230 /// is not indexed by mode.241 /// is not indexed by mode.
@@ -430,6 +441,7 @@ impl Cdfs {
430 reset2(&mut self.dc_sign_luma);441 reset2(&mut self.dc_sign_luma);
431 reset2(&mut self.intra_tx_type_16);442 reset2(&mut self.intra_tx_type_16);
432 reset2(&mut self.intra_tx_type_8);443 reset2(&mut self.intra_tx_type_8);
444+ reset2(&mut self.intra_tx_type_8_set1);
433 reset1(&mut self.inter_tx_type_32);445 reset1(&mut self.inter_tx_type_32);
434 reset1(&mut self.inter_tx_type_16);446 reset1(&mut self.inter_tx_type_16);
435 reset1(&mut self.inter_tx_type_8);447 reset1(&mut self.inter_tx_type_8);
@@ -795,6 +807,7 @@ impl Cdfs {
795 dc_sign_luma: cdf::DC_SIGN_LUMA,807 dc_sign_luma: cdf::DC_SIGN_LUMA,
796 intra_tx_type_16: cdf::INTRA_TX_TYPE_SET2_16,808 intra_tx_type_16: cdf::INTRA_TX_TYPE_SET2_16,
797 intra_tx_type_8: cdf::INTRA_TX_TYPE_SET2_8,809 intra_tx_type_8: cdf::INTRA_TX_TYPE_SET2_8,
810+ intra_tx_type_8_set1: cdf::INTRA_TX_TYPE_SET1_8,
798 inter_tx_type_32: cdf::INTER_TX_TYPE_SET3_32,811 inter_tx_type_32: cdf::INTER_TX_TYPE_SET3_32,
799 inter_tx_type_16: cdf::INTER_TX_TYPE_SET3_16,812 inter_tx_type_16: cdf::INTER_TX_TYPE_SET3_16,
800 inter_tx_type_8: cdf::INTER_TX_TYPE_SET3_8,813 inter_tx_type_8: cdf::INTER_TX_TYPE_SET3_8,
@@ -886,6 +899,17 @@ impl Cdfs {
886 dc_sign: &mut self.dc_sign_luma,899 dc_sign: &mut self.dc_sign_luma,
887 tx_type: Some(self.intra_tx_type_8[mode].as_mut_slice()),900 tx_type: Some(self.intra_tx_type_8[mode].as_mut_slice()),
888 },901 },
902+ TxbSet::Luma8Set1 => TxbTables {
903+ side: 8,
904+ txb_skip: &mut self.txb_skip_luma_8,
905+ eob_pt: &mut self.eob_pt_64_luma,
906+ eob_extra: &mut self.eob_extra_luma_8,
907+ base: &mut self.base_luma_8,
908+ base_eob: &mut self.base_eob_luma_8,
909+ br: &mut self.br_luma_8,
910+ dc_sign: &mut self.dc_sign_luma,
911+ tx_type: Some(self.intra_tx_type_8_set1[mode].as_mut_slice()),
912+ },
889 TxbSet::Luma8Inter => TxbTables {913 TxbSet::Luma8Inter => TxbTables {
890 side: 8,914 side: 8,
891 txb_skip: &mut self.txb_skip_luma_8,915 txb_skip: &mut self.txb_skip_luma_8,
crates/ec-av1/src/decode.rsmodified+43 -10
@@ -288,13 +288,20 @@ fn read_coeffs(
288 }288 }
289 let mut tx_type = TxType::DctDct;289 let mut tx_type = TxType::DctDct;
290 if let Some(tx_type_cdf) = coding.tx_type.as_deref_mut() {290 if let Some(tx_type_cdf) = coding.tx_type.as_deref_mut() {
291+ // The CDF row's own width names its set: 7 symbols (8 slots) is
292+ // `TX_SET_INTRA_1`, 5 (6 slots) the reduced `TX_SET_INTRA_2` (the
293+ // inter sets we read share set 2's symbol order).
294+ let set1 = tx_type_cdf.len() == 8;
291 let t = dec.symbol(tx_type_cdf);295 let t = dec.symbol(tx_type_cdf);
292 if trace {296 if trace {
293- eprintln!("TRACE tx_type value={t}");297+ eprintln!("TRACE tx_type value={t} set1={set1}");
294 }298 }
295- tx_type = TxType::from_symbol(t).ok_or_else(|| {299+ tx_type = if set1 {
296- unsupported(format!("a tx_type symbol outside its CDF's own set: {t}"))300+ TxType::from_symbol_set1(t)
297- })?;301+ } else {
302+ TxType::from_symbol(t)
303+ }
304+ .ok_or_else(|| unsupported(format!("a tx_type symbol outside its CDF's own set: {t}")))?;
298 }305 }
299 306
300 let eob = read_eob(dec, coding);307 let eob = read_eob(dec, coding);
@@ -1165,6 +1172,7 @@ fn decode_block(
1165 scan16: &[u16],1172 scan16: &[u16],
1166 scan8: &[u16],1173 scan8: &[u16],
1167 tx_select: bool,1174 tx_select: bool,
1175+ reduced_tx_set: bool,
1168 ) -> Result<()> {1176 ) -> Result<()> {
1169 let (r, c) = at;1177 let (r, c) = at;
1170 let (px, py) = (c * SUB, r * SUB);1178 let (px, py) = (c * SUB, r * SUB);
@@ -1196,7 +1204,7 @@ fn decode_block(
1196 (side, luma_tx)1204 (side, luma_tx)
1197 };1205 };
1198 let luma_set = if tx_select {1206 let luma_set = if tx_select {
1199- txbset_for(logical_tx)1207+ txbset_for(logical_tx, reduced_tx_set)
1200 } else {1208 } else {
1201 luma_set1209 luma_set
1202 };1210 };
@@ -1433,6 +1441,7 @@ fn decode_leaf8(
1433 base_q_idx: u8,1441 base_q_idx: u8,
1434 enable_filter_intra: bool,1442 enable_filter_intra: bool,
1435 tx_select: bool,1443 tx_select: bool,
1444+ reduced_tx_set: bool,
1436 ) -> Result<usize> {1445 ) -> Result<usize> {
1437 let (r, c) = outer_at;1446 let (r, c) = outer_at;
1438 let mut above_mode = neighbours.above_mode[c];1447 let mut above_mode = neighbours.above_mode[c];
@@ -1504,7 +1513,11 @@ fn decode_leaf8(
1504 luma_grid = read_plane(1513 luma_grid = read_plane(
1505 dec,1514 dec,
1506 cdfs,1515 cdfs,
1507- TxbSet::Luma8,1516+ if reduced_tx_set {
1517+ TxbSet::Luma8
1518+ } else {
1519+ TxbSet::Luma8Set1
1520+ },
1508 scans.0,1521 scans.0,
1509 0,1522 0,
1510 around[0],1523 around[0],
@@ -1856,13 +1869,19 @@ fn scan_for<'a>(tx_px: usize, scan32: &'a [u16], scan16: &'a [u16], scan8: &'a [
1856 /// The [`TxbSet`] a resolved luma transform side reads its coefficient tables1869 /// The [`TxbSet`] a resolved luma transform side reads its coefficient tables
1857 /// from -- 64 is only ever the 64x64-block, depth-0, corner-scanned case1870 /// from -- 64 is only ever the 64x64-block, depth-0, corner-scanned case
1858 /// ([`TxbSet::Luma64`]); every other resolved side maps to its own matching1871 /// ([`TxbSet::Luma64`]); every other resolved side maps to its own matching
1859-/// set.1872+/// set. `get_tx_set` (spec 5.11.48) only splits on `reduced_tx_set` at
1860-fn txbset_for(tx_px: usize) -> TxbSet {1873+/// `TX_8X8`: an intra `TX_16X16` always reads `TX_SET_INTRA_2` regardless of
1874+/// the flag (`av1_get_ext_tx_set_type`'s `tx_size_sqr == TX_16X16` branch
1875+/// ignores `use_reduced_set` once it is past the `TX_32X32`/reduced-set
1876+/// checks), so only the 8x8 case has a second table
1877+/// ([`TxbSet::Luma8Set1`]).
1878+fn txbset_for(tx_px: usize, reduced_tx_set: bool) -> TxbSet {
1861 match tx_px {1879 match tx_px {
1862 64 => TxbSet::Luma64,1880 64 => TxbSet::Luma64,
1863 32 => TxbSet::Luma32,1881 32 => TxbSet::Luma32,
1864 16 => TxbSet::Luma16,1882 16 => TxbSet::Luma16,
1865- 8 => TxbSet::Luma8,1883+ 8 if reduced_tx_set => TxbSet::Luma8,
1884+ 8 => TxbSet::Luma8Set1,
1866 _ => unreachable!("read_tx_size never resolves a block's own side to anything else"),1885 _ => unreachable!("read_tx_size never resolves a block's own side to anything else"),
1867 }1886 }
1868 }1887 }
@@ -2408,6 +2427,7 @@ pub fn decode_key_frame_tile(
2408 cdef: &CdefParams,2427 cdef: &CdefParams,
2409 loop_filter: &LoopFilterParams,2428 loop_filter: &LoopFilterParams,
2410 tx_select: bool,2429 tx_select: bool,
2430+ reduced_tx_set: bool,
2411 ) -> Result<Picture> {2431 ) -> Result<Picture> {
2412 decode_key_frame_tile_with_cdfs(2432 decode_key_frame_tile_with_cdfs(
2413 data,2433 data,
@@ -2421,6 +2441,7 @@ pub fn decode_key_frame_tile(
2421 loop_filter,2441 loop_filter,
2422 None,2442 None,
2423 tx_select,2443 tx_select,
2444+ reduced_tx_set,
2424 )2445 )
2425 .map(|(picture, _)| picture)2446 .map(|(picture, _)| picture)
2426 }2447 }
@@ -2445,6 +2466,7 @@ pub(crate) fn decode_key_frame_tile_with_cdfs(
2445 loop_filter: &LoopFilterParams,2466 loop_filter: &LoopFilterParams,
2446 initial_cdfs: Option<Cdfs>,2467 initial_cdfs: Option<Cdfs>,
2447 tx_select: bool,2468 tx_select: bool,
2469+ reduced_tx_set: bool,
2448 ) -> Result<(Picture, Cdfs)> {2470 ) -> Result<(Picture, Cdfs)> {
2449 if mi_cols == 0 || mi_rows == 0 {2471 if mi_cols == 0 || mi_rows == 0 {
2450 return Err(unsupported("a frame with no mode-info grid"));2472 return Err(unsupported("a frame with no mode-info grid"));
@@ -2554,6 +2576,7 @@ pub(crate) fn decode_key_frame_tile_with_cdfs(
2554 &scan16,2576 &scan16,
2555 &scan8,2577 &scan8,
2556 tx_select,2578 tx_select,
2579+ reduced_tx_set,
2557 )?;2580 )?;
2558 }2581 }
2559 PARTITION_SPLIT => {2582 PARTITION_SPLIT => {
@@ -2615,6 +2638,7 @@ pub(crate) fn decode_key_frame_tile_with_cdfs(
2615 &scan16,2638 &scan16,
2616 &scan8,2639 &scan8,
2617 tx_select,2640 tx_select,
2641+ reduced_tx_set,
2618 )?;2642 )?;
2619 }2643 }
2620 PARTITION_SPLIT => {2644 PARTITION_SPLIT => {
@@ -2662,6 +2686,7 @@ pub(crate) fn decode_key_frame_tile_with_cdfs(
2662 &scan16,2686 &scan16,
2663 &scan8,2687 &scan8,
2664 tx_select,2688 tx_select,
2689+ reduced_tx_set,
2665 )?;2690 )?;
2666 continue;2691 continue;
2667 }2692 }
@@ -2706,6 +2731,7 @@ pub(crate) fn decode_key_frame_tile_with_cdfs(
2706 base_q_idx,2731 base_q_idx,
2707 enable_filter_intra,2732 enable_filter_intra,
2708 tx_select,2733 tx_select,
2734+ reduced_tx_set,
2709 )?;2735 )?;
2710 prev_leaf = Some((leaf_mi, leaf_mode));2736 prev_leaf = Some((leaf_mi, leaf_mode));
2711 }2737 }
@@ -2769,6 +2795,7 @@ pub(crate) fn decode_key_frame_tile_with_cdfs(
2769 base_q_idx,2795 base_q_idx,
2770 enable_filter_intra,2796 enable_filter_intra,
2771 tx_select,2797 tx_select,
2798+ reduced_tx_set,
2772 )?;2799 )?;
2773 prev_leaf = Some((leaf_mi, leaf_mode));2800 prev_leaf = Some((leaf_mi, leaf_mode));
2774 }2801 }
@@ -4168,7 +4195,8 @@ mod tests {
4168 false,4195 false,
4169 &CdefParams::default(),4196 &CdefParams::default(),
4170 &LoopFilterParams::default(),4197 &LoopFilterParams::default(),
4171- false4198+ false,
4199+ true,
4172 )4200 )
4173 .is_err()4201 .is_err()
4174 );4202 );
@@ -4210,6 +4238,7 @@ mod tests {
4210 &CdefParams::default(),4238 &CdefParams::default(),
4211 &LoopFilterParams::default(),4239 &LoopFilterParams::default(),
4212 false,4240 false,
4241+ true,
4213 )4242 )
4214 .unwrap();4243 .unwrap();
4215 assert_eq!(decoded.width, w, "{w}x{h}: decoded width");4244 assert_eq!(decoded.width, w, "{w}x{h}: decoded width");
@@ -4292,6 +4321,7 @@ mod tests {
4292 &CdefParams::default(),4321 &CdefParams::default(),
4293 &LoopFilterParams::default(),4322 &LoopFilterParams::default(),
4294 false,4323 false,
4324+ true,
4295 )4325 )
4296 .unwrap();4326 .unwrap();
4297 assert!(4327 assert!(
@@ -4476,6 +4506,7 @@ mod tests {
4476 &CdefParams::default(),4506 &CdefParams::default(),
4477 &LoopFilterParams::default(),4507 &LoopFilterParams::default(),
4478 false,4508 false,
4509+ true,
4479 )4510 )
4480 .unwrap();4511 .unwrap();
4481 assert_eq!(ours.y, ffmpeg_decoded.y, "{width}x{height}: luma vs ffmpeg");4512 assert_eq!(ours.y, ffmpeg_decoded.y, "{width}x{height}: luma vs ffmpeg");
@@ -4547,6 +4578,7 @@ mod tests {
4547 &CdefParams::default(),4578 &CdefParams::default(),
4548 &LoopFilterParams::default(),4579 &LoopFilterParams::default(),
4549 false,4580 false,
4581+ true,
4550 )4582 )
4551 .unwrap();4583 .unwrap();
4552 assert_eq!(4584 assert_eq!(
@@ -4821,6 +4853,7 @@ mod tests {
4821 &CdefParams::default(),4853 &CdefParams::default(),
4822 &LoopFilterParams::default(),4854 &LoopFilterParams::default(),
4823 false,4855 false,
4856+ true,
4824 )4857 )
4825 .unwrap();4858 .unwrap();
4826 assert_eq!(reference.y, ffmpeg_frames[0].y, "frame 0 luma vs ffmpeg");4859 assert_eq!(reference.y, ffmpeg_frames[0].y, "frame 0 luma vs ffmpeg");
crates/ec-av1/src/stream.rsmodified+21 -2
@@ -215,6 +215,7 @@ pub fn decode_stream(data: &[u8]) -> Result<Vec<Picture>> {
215 &header.loop_filter,215 &header.loop_filter,
216 initial_cdfs,216 initial_cdfs,
217 header.tx_mode == TxMode::Select,217 header.tx_mode == TxMode::Select,
218+ header.reduced_tx_set,
218 )?219 )?
219 } else {220 } else {
220 let last_slot = header.ref_frame_idx[0] as usize;221 let last_slot = header.ref_frame_idx[0] as usize;
@@ -341,6 +342,8 @@ mod tests {
341 &ec_av1_syntax::CdefParams::default(),342 &ec_av1_syntax::CdefParams::default(),
342 &ec_av1_syntax::LoopFilterParams::default(),343 &ec_av1_syntax::LoopFilterParams::default(),
343 false,344 false,
345+ // Our own encoder always writes `reduced_tx_set: true`.
346+ true,
344 )347 )
345 .unwrap();348 .unwrap();
346 let via_stream = decode_stream(&encoded.stream).unwrap();349 let via_stream = decode_stream(&encoded.stream).unwrap();
@@ -1036,9 +1039,13 @@ mod tests {
1036 // search to prefer a split transform over the block's own full1039 // search to prefer a split transform over the block's own full
1037 // size -- `mandelbrot`'s fractal boundary gives every attempt1040 // size -- `mandelbrot`'s fractal boundary gives every attempt
1038 // (a different `start_scale`) sharp, varied-frequency edges.1041 // (a different `start_scale`) sharp, varied-frequency edges.
1042+ // start_scale 5.0 is the proven first try (decodes pixel-exact
1043+ // AND reads the seven-symbol set-1 tx_type rows on TX8 TUs);
1044+ // later attempts walk down for variety when aomenc's RD flips
1045+ // elsewhere.
1039 let source = format!(1046 let source = format!(
1040 "mandelbrot=size=64x64:start_scale={}:rate=25",1047 "mandelbrot=size=64x64:start_scale={}:rate=25",
1041- 3.0 - f64::from(attempt) * 0.061048+ 5.0 - f64::from(attempt) * 0.06
1042 );1049 );
1043 let y4m = Command::new("ffmpeg")1050 let y4m = Command::new("ffmpeg")
1044 .args([1051 .args([
@@ -1084,6 +1091,13 @@ mod tests {
1084 "--enable-ab-partitions=0",1091 "--enable-ab-partitions=0",
1085 "--enable-1to4-partitions=0",1092 "--enable-1to4-partitions=0",
1086 "--enable-filter-intra=0",1093 "--enable-filter-intra=0",
1094+ // Every non-DC intra tool off: directional chroma and
1095+ // angle deltas are separate round-2 gaps, and DC-only
1096+ // residual is exactly what gives the RD search a reason
1097+ // to split a transform.
1098+ "--enable-smooth-intra=0",
1099+ "--enable-paeth-intra=0",
1100+ "--enable-directional-intra=0",
1087 "--enable-angle-delta=0",1101 "--enable-angle-delta=0",
1088 "--enable-cdef=0",1102 "--enable-cdef=0",
1089 // Loop restoration is a named refusal (aomenc's RD picks1103 // Loop restoration is a named refusal (aomenc's RD picks
@@ -1091,9 +1105,14 @@ mod tests {
1091 // whose test targets a different surface.1105 // whose test targets a different surface.
1092 "--enable-restoration=0",1106 "--enable-restoration=0",
1093 "--max-partition-size=32",1107 "--max-partition-size=32",
1108+ // 16x16 blocks are what split into the TX8 TUs whose
1109+ // set-1 tx_type rows this gate exists to prove; some
1110+ // scales resolve depth 2 (TX4, a named refusal) and the
1111+ // attempt loop just moves on.
1112+ "--min-partition-size=16",
1094 "--enable-palette=0",1113 "--enable-palette=0",
1095 "--enable-intrabc=0",1114 "--enable-intrabc=0",
1096- "--enable-cfl-intra=1",1115+ "--enable-cfl-intra=0",
1097 "--obu",1116 "--obu",
1098 "-o",1117 "-o",
1099 "-",1118 "-",
crates/ec-av1/src/transform.rsmodified+27 -0
@@ -314,6 +314,12 @@ pub enum TxType {
314 AdstDct,314 AdstDct,
315 /// DCT down the column axis, ADST across the row axis.315 /// DCT down the column axis, ADST across the row axis.
316 DctAdst,316 DctAdst,
317+ /// DCT down the column axis, identity across the row axis
318+ /// (`V_DCT` -- `TX_SET_INTRA_1` only).
319+ VDct,
320+ /// Identity down the column axis, DCT across the row axis
321+ /// (`H_DCT` -- `TX_SET_INTRA_1` only).
322+ HDct,
317 }323 }
318 324
319 impl TxType {325 impl TxType {
@@ -329,6 +335,24 @@ impl TxType {
329 }335 }
330 }336 }
331 337
338+ /// The inverse of `Tx_Type_Intra_Inv_Set1`'s CDF symbol order
339+ /// (`av1_ext_tx_inv[EXT_TX_SET_DTT4_IDTX_1DDCT]`, entropymode.h:
340+ /// `{9, 0, 10, 11, 3, 1, 2}` = IDTX, DCT_DCT, V_DCT, H_DCT, ADST_ADST,
341+ /// ADST_DCT, DCT_ADST) -- the seven-type set a `reduced_tx_set == 0`
342+ /// frame's small intra transforms read from.
343+ pub fn from_symbol_set1(t: usize) -> Option<Self> {
344+ match t {
345+ 0 => Some(Self::Idtx),
346+ 1 => Some(Self::DctDct),
347+ 2 => Some(Self::VDct),
348+ 3 => Some(Self::HDct),
349+ 4 => Some(Self::AdstAdst),
350+ 5 => Some(Self::AdstDct),
351+ 6 => Some(Self::DctAdst),
352+ _ => None,
353+ }
354+ }
355+
332 /// `(row, col)`: the transform `inverse_transform_2d_typed`'s row pass356 /// `(row, col)`: the transform `inverse_transform_2d_typed`'s row pass
333 /// (`htx_tab`, spec/libaom "horizontal") and column pass (`vtx_tab`,357 /// (`htx_tab`, spec/libaom "horizontal") and column pass (`vtx_tab`,
334 /// "vertical") each run. Read off libaom's `av1_inv_txfm2d.c` `vtx_tab`/358 /// "vertical") each run. Read off libaom's `av1_inv_txfm2d.c` `vtx_tab`/
@@ -343,6 +367,9 @@ impl TxType {
343 Self::AdstAdst => (Adst, Adst),367 Self::AdstAdst => (Adst, Adst),
344 Self::AdstDct => (Dct, Adst),368 Self::AdstDct => (Dct, Adst),
345 Self::DctAdst => (Adst, Dct),369 Self::DctAdst => (Adst, Dct),
370+ // `av1_inv_txfm2d.c`: V_DCT vtx=DCT htx=IDTX, H_DCT the mirror.
371+ Self::VDct => (Identity, Dct),
372+ Self::HDct => (Dct, Identity),
346 }373 }
347 }374 }
348 }375 }