forge
Explore
Log in

Don't you dare go Hollow

Merge branch 'lane-t900' (2af10b5d): ec-av1 release build warnings 300 to 0 (gate-counter accessors allowed with reasons, table docs, dead initialisers dropped); byte-exact on four inputs

Browse files at this commit

d6f9cd4a8e99d2a3c81cb48b903c779cfbedc428Ahmet Kaan GümüşParent: 16ae97f16efbd9
crates/ec-av1/src/cdf.rsmodified+86 -0
@@ -19,6 +19,7 @@ pub const PARTITION_W128: [[u16; 9]; 4] = [
19 [711, 966, 1172, 32448, 32538, 32617, 32664, 32768, 0],19 [711, 966, 1172, 32448, 32538, 32617, 32664, 32768, 0],
20 ];20 ];
21 21
22+/// Default CDF table `PARTITION_W64` (AV1 spec 9.4 initial probabilities).
22 pub const PARTITION_W64: [[u16; 11]; 4] = [23 pub const PARTITION_W64: [[u16; 11]; 4] = [
23 [24 [
24 20137, 21547, 23078, 29566, 29837, 30261, 30524, 30892, 31724, 32768, 0,25 20137, 21547, 23078, 29566, 29837, 30261, 30524, 30892, 31724, 32768, 0,
@@ -63,6 +64,7 @@ pub const TXFM_PARTITION: [[u16; 3]; 21] = [
63 [16088, 32768, 0],64 [16088, 32768, 0],
64 ];65 ];
65 66
67+/// Default CDF table `SKIP` (AV1 spec 9.4 initial probabilities).
66 pub const SKIP: [[u16; 3]; 3] = [[31671, 32768, 0], [16515, 32768, 0], [4576, 32768, 0]];68 pub const SKIP: [[u16; 3]; 3] = [[31671, 32768, 0], [16515, 32768, 0], [4576, 32768, 0]];
67 69
68 /// `Default_Intra_Frame_Y_Mode_Cdf` (spec 9.4): the thirteen luma intra70 /// `Default_Intra_Frame_Y_Mode_Cdf` (spec 9.4): the thirteen luma intra
@@ -698,6 +700,7 @@ pub const SEGMENT_ID: [[u16; 9]; 3] = [
698 /// `seg_id_predicted`, indexed by `AboveSegPredContext + LeftSegPredContext`.700 /// `seg_id_predicted`, indexed by `AboveSegPredContext + LeftSegPredContext`.
699 pub const SEGMENT_PRED: [[u16; 3]; 3] = [[16384, 32768, 0]; 3];701 pub const SEGMENT_PRED: [[u16; 3]; 3] = [[16384, 32768, 0]; 3];
700 702
703+/// Default CDF table `DELTA_Q` (AV1 spec 9.4 initial probabilities).
701 pub const DELTA_Q: [u16; 5] = [28160, 32120, 32677, 32768, 0];704 pub const DELTA_Q: [u16; 5] = [28160, 32120, 32677, 32768, 0];
702 /// `default_delta_lf_cdf` -- see [`DELTA_Q`]'s doc.705 /// `default_delta_lf_cdf` -- see [`DELTA_Q`]'s doc.
703 pub const DELTA_LF: [u16; 5] = DELTA_Q;706 pub const DELTA_LF: [u16; 5] = DELTA_Q;
@@ -3186,8 +3189,11 @@ pub const TXB_SKIP_CHROMA_32_Q3: [[u16; 3]; 3] =
3186 /// 128x128 block's four TX_32X32 chroma units -- the offset-7 rows above are3189 /// 128x128 block's four TX_32X32 chroma units -- the offset-7 rows above are
3187 /// every other case (lane-sb128b r3).3190 /// every other case (lane-sb128b r3).
3188 pub const TXB_SKIP_CHROMA_32_BIG_Q0: [[u16; 3]; 3] = [[146, 32768, 0], [5132, 32768, 0], [31657, 32768, 0]];3191 pub const TXB_SKIP_CHROMA_32_BIG_Q0: [[u16; 3]; 3] = [[146, 32768, 0], [5132, 32768, 0], [31657, 32768, 0]];
3192+/// Default CDF table `TXB_SKIP_CHROMA_32_BIG_Q1` (AV1 spec 9.4 initial probabilities).
3189 pub const TXB_SKIP_CHROMA_32_BIG_Q1: [[u16; 3]; 3] = [[641, 32768, 0], [22265, 32768, 0], [31452, 32768, 0]];3193 pub const TXB_SKIP_CHROMA_32_BIG_Q1: [[u16; 3]; 3] = [[641, 32768, 0], [22265, 32768, 0], [31452, 32768, 0]];
3194+/// Default CDF table `TXB_SKIP_CHROMA_32_BIG` (AV1 spec 9.4 initial probabilities).
3190 pub const TXB_SKIP_CHROMA_32_BIG: [[u16; 3]; 3] = [[3082, 32768, 0], [20982, 32768, 0], [29443, 32768, 0]];3195 pub const TXB_SKIP_CHROMA_32_BIG: [[u16; 3]; 3] = [[3082, 32768, 0], [20982, 32768, 0], [29443, 32768, 0]];
3196+/// Default CDF table `TXB_SKIP_CHROMA_32_BIG_Q3` (AV1 spec 9.4 initial probabilities).
3191 pub const TXB_SKIP_CHROMA_32_BIG_Q3: [[u16; 3]; 3] = [[1806, 32768, 0], [14645, 32768, 0], [25336, 32768, 0]];3197 pub const TXB_SKIP_CHROMA_32_BIG_Q3: [[u16; 3]; 3] = [[1806, 32768, 0], [14645, 32768, 0], [25336, 32768, 0]];
3192 /// EOB_EXTRA_LUMA_16, q-context 3: the same table as [`EOB_EXTRA_LUMA_16`], for `base_q_idx` 121..=255.3198 /// EOB_EXTRA_LUMA_16, q-context 3: the same table as [`EOB_EXTRA_LUMA_16`], for `base_q_idx` 121..=255.
3193 pub const EOB_EXTRA_LUMA_16_Q3: [[u16; 3]; 9] = [3199 pub const EOB_EXTRA_LUMA_16_Q3: [[u16; 3]; 9] = [
@@ -3886,8 +3892,11 @@ pub const EOB_PT_64_LUMA_Q3: [u16; 8] = [6307, 7541, 12060, 16358, 22553, 27865,
3886 /// (`av1_default_eob_multi64_cdfs[q][0][1]`), for an 8x8 luma TU whose3892 /// (`av1_default_eob_multi64_cdfs[q][0][1]`), for an 8x8 luma TU whose
3887 /// `tx_type` resolves `V_DCT`/`H_DCT`.3893 /// `tx_type` resolves `V_DCT`/`H_DCT`.
3888 pub const EOB_PT_64_LUMA_CLASS1_Q0: [u16; 8] = [335, 730, 1459, 5494, 8755, 12997, 32768, 0];3894 pub const EOB_PT_64_LUMA_CLASS1_Q0: [u16; 8] = [335, 730, 1459, 5494, 8755, 12997, 32768, 0];
3895+/// Default CDF table `EOB_PT_64_LUMA_CLASS1_Q1` (AV1 spec 9.4 initial probabilities).
3889 pub const EOB_PT_64_LUMA_CLASS1_Q1: [u16; 8] = [401, 605, 1029, 2563, 5845, 12626, 32768, 0];3896 pub const EOB_PT_64_LUMA_CLASS1_Q1: [u16; 8] = [401, 605, 1029, 2563, 5845, 12626, 32768, 0];
3897+/// Default CDF table `EOB_PT_64_LUMA_CLASS1` (AV1 spec 9.4 initial probabilities).
3890 pub const EOB_PT_64_LUMA_CLASS1: [u16; 8] = [497, 810, 1315, 3000, 7004, 15641, 32768, 0];3898 pub const EOB_PT_64_LUMA_CLASS1: [u16; 8] = [497, 810, 1315, 3000, 7004, 15641, 32768, 0];
3899+/// Default CDF table `EOB_PT_64_LUMA_CLASS1_Q3` (AV1 spec 9.4 initial probabilities).
3891 pub const EOB_PT_64_LUMA_CLASS1_Q3: [u16; 8] = [1289, 2320, 3971, 7926, 14153, 24291, 32768, 0];3900 pub const EOB_PT_64_LUMA_CLASS1_Q3: [u16; 8] = [1289, 2320, 3971, 7926, 14153, 24291, 32768, 0];
3892 3901
3893 /// EOB_PT_16_CHROMA_Q0, q-context 0: the same table as [`EOB_PT_16_CHROMA`], for `base_q_idx` 0..=20.3902 /// EOB_PT_16_CHROMA_Q0, q-context 0: the same table as [`EOB_PT_16_CHROMA`], for `base_q_idx` 0..=20.
@@ -4683,6 +4692,7 @@ pub const TXB_SKIP_LUMA_8_Q0_CTX: [[u16; 3]; 7] = [
4683 [26308, 32768, 0],4692 [26308, 32768, 0],
4684 [32537, 32768, 0],4693 [32537, 32768, 0],
4685 ];4694 ];
4695+/// Default CDF table `TXB_SKIP_LUMA_8_Q1_CTX` (AV1 spec 9.4 initial probabilities).
4686 pub const TXB_SKIP_LUMA_8_Q1_CTX: [[u16; 3]; 7] = [4696 pub const TXB_SKIP_LUMA_8_Q1_CTX: [[u16; 3]; 7] = [
4687 [31782, 32768, 0],4697 [31782, 32768, 0],
4688 [1836, 32768, 0],4698 [1836, 32768, 0],
@@ -4692,6 +4702,7 @@ pub const TXB_SKIP_LUMA_8_Q1_CTX: [[u16; 3]; 7] = [
4692 [27518, 32768, 0],4702 [27518, 32768, 0],
4693 [32399, 32768, 0],4703 [32399, 32768, 0],
4694 ];4704 ];
4705+/// Default CDF table `TXB_SKIP_LUMA_8_CTX` (AV1 spec 9.4 initial probabilities).
4695 pub const TXB_SKIP_LUMA_8_CTX: [[u16; 3]; 7] = [4706 pub const TXB_SKIP_LUMA_8_CTX: [[u16; 3]; 7] = [
4696 [31957, 32768, 0],4707 [31957, 32768, 0],
4697 [3230, 32768, 0],4708 [3230, 32768, 0],
@@ -4701,6 +4712,7 @@ pub const TXB_SKIP_LUMA_8_CTX: [[u16; 3]; 7] = [
4701 [26536, 32768, 0],4712 [26536, 32768, 0],
4702 [31986, 32768, 0],4713 [31986, 32768, 0],
4703 ];4714 ];
4715+/// Default CDF table `TXB_SKIP_LUMA_8_Q3_CTX` (AV1 spec 9.4 initial probabilities).
4704 pub const TXB_SKIP_LUMA_8_Q3_CTX: [[u16; 3]; 7] = [4716 pub const TXB_SKIP_LUMA_8_Q3_CTX: [[u16; 3]; 7] = [
4705 [31903, 32768, 0],4717 [31903, 32768, 0],
4706 [2044, 32768, 0],4718 [2044, 32768, 0],
@@ -4710,6 +4722,7 @@ pub const TXB_SKIP_LUMA_8_Q3_CTX: [[u16; 3]; 7] = [
4710 [24168, 32768, 0],4722 [24168, 32768, 0],
4711 [31037, 32768, 0],4723 [31037, 32768, 0],
4712 ];4724 ];
4725+/// Default CDF table `TXB_SKIP_LUMA_16_Q0_CTX` (AV1 spec 9.4 initial probabilities).
4713 pub const TXB_SKIP_LUMA_16_Q0_CTX: [[u16; 3]; 7] = [4726 pub const TXB_SKIP_LUMA_16_Q0_CTX: [[u16; 3]; 7] = [
4714 [29957, 32768, 0],4727 [29957, 32768, 0],
4715 [5391, 32768, 0],4728 [5391, 32768, 0],
@@ -4719,6 +4732,7 @@ pub const TXB_SKIP_LUMA_16_Q0_CTX: [[u16; 3]; 7] = [
4719 [25822, 32768, 0],4732 [25822, 32768, 0],
4720 [32197, 32768, 0],4733 [32197, 32768, 0],
4721 ];4734 ];
4735+/// Default CDF table `TXB_SKIP_LUMA_16_Q1_CTX` (AV1 spec 9.4 initial probabilities).
4722 pub const TXB_SKIP_LUMA_16_Q1_CTX: [[u16; 3]; 7] = [4736 pub const TXB_SKIP_LUMA_16_Q1_CTX: [[u16; 3]; 7] = [
4723 [31901, 32768, 0],4737 [31901, 32768, 0],
4724 [10311, 32768, 0],4738 [10311, 32768, 0],
@@ -4728,6 +4742,7 @@ pub const TXB_SKIP_LUMA_16_Q1_CTX: [[u16; 3]; 7] = [
4728 [27914, 32768, 0],4742 [27914, 32768, 0],
4729 [32296, 32768, 0],4743 [32296, 32768, 0],
4730 ];4744 ];
4745+/// Default CDF table `TXB_SKIP_LUMA_16_CTX` (AV1 spec 9.4 initial probabilities).
4731 pub const TXB_SKIP_LUMA_16_CTX: [[u16; 3]; 7] = [4746 pub const TXB_SKIP_LUMA_16_CTX: [[u16; 3]; 7] = [
4732 [32363, 32768, 0],4747 [32363, 32768, 0],
4733 [10692, 32768, 0],4748 [10692, 32768, 0],
@@ -4737,6 +4752,7 @@ pub const TXB_SKIP_LUMA_16_CTX: [[u16; 3]; 7] = [
4737 [28312, 32768, 0],4752 [28312, 32768, 0],
4738 [32169, 32768, 0],4753 [32169, 32768, 0],
4739 ];4754 ];
4755+/// Default CDF table `TXB_SKIP_LUMA_16_Q3_CTX` (AV1 spec 9.4 initial probabilities).
4740 pub const TXB_SKIP_LUMA_16_Q3_CTX: [[u16; 3]; 7] = [4756 pub const TXB_SKIP_LUMA_16_Q3_CTX: [[u16; 3]; 7] = [
4741 [32510, 32768, 0],4757 [32510, 32768, 0],
4742 [8430, 32768, 0],4758 [8430, 32768, 0],
@@ -4746,6 +4762,7 @@ pub const TXB_SKIP_LUMA_16_Q3_CTX: [[u16; 3]; 7] = [
4746 [28789, 32768, 0],4762 [28789, 32768, 0],
4747 [32139, 32768, 0],4763 [32139, 32768, 0],
4748 ];4764 ];
4765+/// Default CDF table `TXB_SKIP_LUMA_32_Q0_CTX` (AV1 spec 9.4 initial probabilities).
4749 pub const TXB_SKIP_LUMA_32_Q0_CTX: [[u16; 3]; 7] = [4766 pub const TXB_SKIP_LUMA_32_Q0_CTX: [[u16; 3]; 7] = [
4750 [17920, 32768, 0],4767 [17920, 32768, 0],
4751 [1818, 32768, 0],4768 [1818, 32768, 0],
@@ -4755,6 +4772,7 @@ pub const TXB_SKIP_LUMA_32_Q0_CTX: [[u16; 3]; 7] = [
4755 [31554, 32768, 0],4772 [31554, 32768, 0],
4756 [32624, 32768, 0],4773 [32624, 32768, 0],
4757 ];4774 ];
4775+/// Default CDF table `TXB_SKIP_LUMA_32_Q1_CTX` (AV1 spec 9.4 initial probabilities).
4758 pub const TXB_SKIP_LUMA_32_Q1_CTX: [[u16; 3]; 7] = [4776 pub const TXB_SKIP_LUMA_32_Q1_CTX: [[u16; 3]; 7] = [
4759 [26726, 32768, 0],4777 [26726, 32768, 0],
4760 [1045, 32768, 0],4778 [1045, 32768, 0],
@@ -4764,6 +4782,7 @@ pub const TXB_SKIP_LUMA_32_Q1_CTX: [[u16; 3]; 7] = [
4764 [25970, 32768, 0],4782 [25970, 32768, 0],
4765 [31938, 32768, 0],4783 [31938, 32768, 0],
4766 ];4784 ];
4785+/// Default CDF table `TXB_SKIP_LUMA_32_CTX` (AV1 spec 9.4 initial probabilities).
4767 pub const TXB_SKIP_LUMA_32_CTX: [[u16; 3]; 7] = [4786 pub const TXB_SKIP_LUMA_32_CTX: [[u16; 3]; 7] = [
4768 [30669, 32768, 0],4787 [30669, 32768, 0],
4769 [3832, 32768, 0],4788 [3832, 32768, 0],
@@ -4773,6 +4792,7 @@ pub const TXB_SKIP_LUMA_32_CTX: [[u16; 3]; 7] = [
4773 [23313, 32768, 0],4792 [23313, 32768, 0],
4774 [31330, 32768, 0],4793 [31330, 32768, 0],
4775 ];4794 ];
4795+/// Default CDF table `TXB_SKIP_LUMA_32_Q3_CTX` (AV1 spec 9.4 initial probabilities).
4776 pub const TXB_SKIP_LUMA_32_Q3_CTX: [[u16; 3]; 7] = [4796 pub const TXB_SKIP_LUMA_32_Q3_CTX: [[u16; 3]; 7] = [
4777 [31671, 32768, 0],4797 [31671, 32768, 0],
4778 [2056, 32768, 0],4798 [2056, 32768, 0],
@@ -4782,6 +4802,7 @@ pub const TXB_SKIP_LUMA_32_Q3_CTX: [[u16; 3]; 7] = [
4782 [24715, 32768, 0],4802 [24715, 32768, 0],
4783 [31484, 32768, 0],4803 [31484, 32768, 0],
4784 ];4804 ];
4805+/// Default CDF table `TXB_SKIP_LUMA_64_Q0_CTX` (AV1 spec 9.4 initial probabilities).
4785 pub const TXB_SKIP_LUMA_64_Q0_CTX: [[u16; 3]; 7] = [4806 pub const TXB_SKIP_LUMA_64_Q0_CTX: [[u16; 3]; 7] = [
4786 [6308, 32768, 0],4807 [6308, 32768, 0],
4787 [117, 32768, 0],4808 [117, 32768, 0],
@@ -4791,6 +4812,7 @@ pub const TXB_SKIP_LUMA_64_Q0_CTX: [[u16; 3]; 7] = [
4791 [10923, 32768, 0],4812 [10923, 32768, 0],
4792 [30247, 32768, 0],4813 [30247, 32768, 0],
4793 ];4814 ];
4815+/// Default CDF table `TXB_SKIP_LUMA_64_Q1_CTX` (AV1 spec 9.4 initial probabilities).
4794 pub const TXB_SKIP_LUMA_64_Q1_CTX: [[u16; 3]; 7] = [4816 pub const TXB_SKIP_LUMA_64_Q1_CTX: [[u16; 3]; 7] = [
4795 [26584, 32768, 0],4817 [26584, 32768, 0],
4796 [188, 32768, 0],4818 [188, 32768, 0],
@@ -4800,6 +4822,7 @@ pub const TXB_SKIP_LUMA_64_Q1_CTX: [[u16; 3]; 7] = [
4800 [30583, 32768, 0],4822 [30583, 32768, 0],
4801 [32608, 32768, 0],4823 [32608, 32768, 0],
4802 ];4824 ];
4825+/// Default CDF table `TXB_SKIP_LUMA_64_CTX` (AV1 spec 9.4 initial probabilities).
4803 pub const TXB_SKIP_LUMA_64_CTX: [[u16; 3]; 7] = [4826 pub const TXB_SKIP_LUMA_64_CTX: [[u16; 3]; 7] = [
4804 [28573, 32768, 0],4827 [28573, 32768, 0],
4805 [3183, 32768, 0],4828 [3183, 32768, 0],
@@ -4809,6 +4832,7 @@ pub const TXB_SKIP_LUMA_64_CTX: [[u16; 3]; 7] = [
4809 [27832, 32768, 0],4832 [27832, 32768, 0],
4810 [32387, 32768, 0],4833 [32387, 32768, 0],
4811 ];4834 ];
4835+/// Default CDF table `TXB_SKIP_LUMA_64_Q3_CTX` (AV1 spec 9.4 initial probabilities).
4812 pub const TXB_SKIP_LUMA_64_Q3_CTX: [[u16; 3]; 7] = [4836 pub const TXB_SKIP_LUMA_64_Q3_CTX: [[u16; 3]; 7] = [
4813 [31539, 32768, 0],4837 [31539, 32768, 0],
4814 [8433, 32768, 0],4838 [8433, 32768, 0],
@@ -4838,6 +4862,7 @@ pub const TXB_SKIP_LUMA_4_Q0_CTX: [[u16; 3]; 7] = [
4838 [27473, 32768, 0],4862 [27473, 32768, 0],
4839 [32487, 32768, 0],4863 [32487, 32768, 0],
4840 ];4864 ];
4865+/// Default CDF table `TXB_SKIP_LUMA_4_Q1_CTX` (AV1 spec 9.4 initial probabilities).
4841 pub const TXB_SKIP_LUMA_4_Q1_CTX: [[u16; 3]; 7] = [4866 pub const TXB_SKIP_LUMA_4_Q1_CTX: [[u16; 3]; 7] = [
4842 [30371, 32768, 0],4867 [30371, 32768, 0],
4843 [7570, 32768, 0],4868 [7570, 32768, 0],
@@ -4847,6 +4872,7 @@ pub const TXB_SKIP_LUMA_4_Q1_CTX: [[u16; 3]; 7] = [
4847 [27067, 32768, 0],4872 [27067, 32768, 0],
4848 [32013, 32768, 0],4873 [32013, 32768, 0],
4849 ];4874 ];
4875+/// Default CDF table `TXB_SKIP_LUMA_4_CTX` (AV1 spec 9.4 initial probabilities).
4850 pub const TXB_SKIP_LUMA_4_CTX: [[u16; 3]; 7] = [4876 pub const TXB_SKIP_LUMA_4_CTX: [[u16; 3]; 7] = [
4851 [29614, 32768, 0],4877 [29614, 32768, 0],
4852 [9068, 32768, 0],4878 [9068, 32768, 0],
@@ -4856,6 +4882,7 @@ pub const TXB_SKIP_LUMA_4_CTX: [[u16; 3]; 7] = [
4856 [24619, 32768, 0],4882 [24619, 32768, 0],
4857 [30642, 32768, 0],4883 [30642, 32768, 0],
4858 ];4884 ];
4885+/// Default CDF table `TXB_SKIP_LUMA_4_Q3_CTX` (AV1 spec 9.4 initial probabilities).
4859 pub const TXB_SKIP_LUMA_4_Q3_CTX: [[u16; 3]; 7] = [4886 pub const TXB_SKIP_LUMA_4_Q3_CTX: [[u16; 3]; 7] = [
4860 [26887, 32768, 0],4887 [26887, 32768, 0],
4861 [6729, 32768, 0],4888 [6729, 32768, 0],
@@ -4869,8 +4896,11 @@ pub const TXB_SKIP_LUMA_4_Q3_CTX: [[u16; 3]; 7] = [
4869 /// The end-of-block group of a 4x4 luma transform (`av1_default_eob_multi16_cdfs`,4896 /// The end-of-block group of a 4x4 luma transform (`av1_default_eob_multi16_cdfs`,
4870 /// `PLANE_TYPES` idx0 luma).4897 /// `PLANE_TYPES` idx0 luma).
4871 pub const EOB_PT_16_LUMA_Q0: [u16; 6] = [840, 1039, 1980, 4895, 32768, 0];4898 pub const EOB_PT_16_LUMA_Q0: [u16; 6] = [840, 1039, 1980, 4895, 32768, 0];
4899+/// Default CDF table `EOB_PT_16_LUMA_Q1` (AV1 spec 9.4 initial probabilities).
4872 pub const EOB_PT_16_LUMA_Q1: [u16; 6] = [2125, 2551, 5165, 8946, 32768, 0];4900 pub const EOB_PT_16_LUMA_Q1: [u16; 6] = [2125, 2551, 5165, 8946, 32768, 0];
4901+/// Default CDF table `EOB_PT_16_LUMA` (AV1 spec 9.4 initial probabilities).
4873 pub const EOB_PT_16_LUMA: [u16; 6] = [4016, 4897, 8881, 14968, 32768, 0];4902 pub const EOB_PT_16_LUMA: [u16; 6] = [4016, 4897, 8881, 14968, 32768, 0];
4903+/// Default CDF table `EOB_PT_16_LUMA_Q3` (AV1 spec 9.4 initial probabilities).
4874 pub const EOB_PT_16_LUMA_Q3: [u16; 6] = [6708, 8958, 14746, 22133, 32768, 0];4904 pub const EOB_PT_16_LUMA_Q3: [u16; 6] = [6708, 8958, 14746, 22133, 32768, 0];
4875 4905
4876 /// The `TX_CLASS_HORIZ`/`TX_CLASS_VERT` (non-2D-scan) sibling of4906 /// The `TX_CLASS_HORIZ`/`TX_CLASS_VERT` (non-2D-scan) sibling of
@@ -4903,12 +4933,17 @@ pub const EOB_PT_32_LUMA_CLASS1: [u16; 7] = [574, 821, 1836, 5089, 13128, 32768,
4903 /// [`EOB_PT_32_LUMA_CLASS1_Q0`]'s q-context 3 sibling.4933 /// [`EOB_PT_32_LUMA_CLASS1_Q0`]'s q-context 3 sibling.
4904 pub const EOB_PT_32_LUMA_CLASS1_Q3: [u16; 7] = [1156, 1702, 3675, 9274, 20539, 32768, 0];4934 pub const EOB_PT_32_LUMA_CLASS1_Q3: [u16; 7] = [1156, 1702, 3675, 9274, 20539, 32768, 0];
4905 4935
4936+/// Default CDF table `EOB_PT_16_LUMA_CLASS1_Q0` (AV1 spec 9.4 initial probabilities).
4906 pub const EOB_PT_16_LUMA_CLASS1_Q0: [u16; 6] = [370, 671, 1883, 4471, 32768, 0];4937 pub const EOB_PT_16_LUMA_CLASS1_Q0: [u16; 6] = [370, 671, 1883, 4471, 32768, 0];
4938+/// Default CDF table `EOB_PT_16_LUMA_CLASS1_Q1` (AV1 spec 9.4 initial probabilities).
4907 pub const EOB_PT_16_LUMA_CLASS1_Q1: [u16; 6] = [513, 765, 1859, 6339, 32768, 0];4939 pub const EOB_PT_16_LUMA_CLASS1_Q1: [u16; 6] = [513, 765, 1859, 6339, 32768, 0];
4940+/// Default CDF table `EOB_PT_16_LUMA_CLASS1` (AV1 spec 9.4 initial probabilities).
4908 pub const EOB_PT_16_LUMA_CLASS1: [u16; 6] = [716, 1105, 2646, 10056, 32768, 0];4941 pub const EOB_PT_16_LUMA_CLASS1: [u16; 6] = [716, 1105, 2646, 10056, 32768, 0];
4942+/// Default CDF table `EOB_PT_16_LUMA_CLASS1_Q3` (AV1 spec 9.4 initial probabilities).
4909 pub const EOB_PT_16_LUMA_CLASS1_Q3: [u16; 6] = [1222, 2074, 4783, 15410, 32768, 0];4943 pub const EOB_PT_16_LUMA_CLASS1_Q3: [u16; 6] = [1222, 2074, 4783, 15410, 32768, 0];
4910 4944
4911 // EOB_EXTRA_LUMA_44945 // EOB_EXTRA_LUMA_4
4946+/// Default CDF table `EOB_EXTRA_LUMA_4_Q0` (AV1 spec 9.4 initial probabilities).
4912 pub const EOB_EXTRA_LUMA_4_Q0: [[u16; 3]; 9] = [4947 pub const EOB_EXTRA_LUMA_4_Q0: [[u16; 3]; 9] = [
4913 [16961, 32768, 0],4948 [16961, 32768, 0],
4914 [17223, 32768, 0],4949 [17223, 32768, 0],
@@ -4921,6 +4956,7 @@ pub const EOB_EXTRA_LUMA_4_Q0: [[u16; 3]; 9] = [
4921 [16384, 32768, 0],4956 [16384, 32768, 0],
4922 ];4957 ];
4923 4958
4959+/// Default CDF table `EOB_EXTRA_LUMA_4_Q1` (AV1 spec 9.4 initial probabilities).
4924 pub const EOB_EXTRA_LUMA_4_Q1: [[u16; 3]; 9] = [4960 pub const EOB_EXTRA_LUMA_4_Q1: [[u16; 3]; 9] = [
4925 [17471, 32768, 0],4961 [17471, 32768, 0],
4926 [20223, 32768, 0],4962 [20223, 32768, 0],
@@ -4933,6 +4969,7 @@ pub const EOB_EXTRA_LUMA_4_Q1: [[u16; 3]; 9] = [
4933 [16384, 32768, 0],4969 [16384, 32768, 0],
4934 ];4970 ];
4935 4971
4972+/// Default CDF table `EOB_EXTRA_LUMA_4` (AV1 spec 9.4 initial probabilities).
4936 pub const EOB_EXTRA_LUMA_4: [[u16; 3]; 9] = [4973 pub const EOB_EXTRA_LUMA_4: [[u16; 3]; 9] = [
4937 [18983, 32768, 0],4974 [18983, 32768, 0],
4938 [20512, 32768, 0],4975 [20512, 32768, 0],
@@ -4945,6 +4982,7 @@ pub const EOB_EXTRA_LUMA_4: [[u16; 3]; 9] = [
4945 [16384, 32768, 0],4982 [16384, 32768, 0],
4946 ];4983 ];
4947 4984
4985+/// Default CDF table `EOB_EXTRA_LUMA_4_Q3` (AV1 spec 9.4 initial probabilities).
4948 pub const EOB_EXTRA_LUMA_4_Q3: [[u16; 3]; 9] = [4986 pub const EOB_EXTRA_LUMA_4_Q3: [[u16; 3]; 9] = [
4949 [20177, 32768, 0],4987 [20177, 32768, 0],
4950 [20789, 32768, 0],4988 [20789, 32768, 0],
@@ -4958,6 +4996,7 @@ pub const EOB_EXTRA_LUMA_4_Q3: [[u16; 3]; 9] = [
4958 ];4996 ];
4959 4997
4960 // COEFF_BASE_LUMA_44998 // COEFF_BASE_LUMA_4
4999+/// Default CDF table `COEFF_BASE_LUMA_4_Q0` (AV1 spec 9.4 initial probabilities).
4961 pub const COEFF_BASE_LUMA_4_Q0: [[u16; 5]; 42] = [5000 pub const COEFF_BASE_LUMA_4_Q0: [[u16; 5]; 42] = [
4962 [4034, 8930, 12727, 32768, 0],5001 [4034, 8930, 12727, 32768, 0],
4963 [18082, 29741, 31877, 32768, 0],5002 [18082, 29741, 31877, 32768, 0],
@@ -5003,6 +5042,7 @@ pub const COEFF_BASE_LUMA_4_Q0: [[u16; 5]; 42] = [
5003 [8192, 16384, 24576, 32768, 0],5042 [8192, 16384, 24576, 32768, 0],
5004 ];5043 ];
5005 5044
5045+/// Default CDF table `COEFF_BASE_LUMA_4_Q1` (AV1 spec 9.4 initial probabilities).
5006 pub const COEFF_BASE_LUMA_4_Q1: [[u16; 5]; 42] = [5046 pub const COEFF_BASE_LUMA_4_Q1: [[u16; 5]; 42] = [
5007 [6041, 11854, 15927, 32768, 0],5047 [6041, 11854, 15927, 32768, 0],
5008 [20326, 30905, 32251, 32768, 0],5048 [20326, 30905, 32251, 32768, 0],
@@ -5048,6 +5088,7 @@ pub const COEFF_BASE_LUMA_4_Q1: [[u16; 5]; 42] = [
5048 [8192, 16384, 24576, 32768, 0],5088 [8192, 16384, 24576, 32768, 0],
5049 ];5089 ];
5050 5090
5091+/// Default CDF table `COEFF_BASE_LUMA_4` (AV1 spec 9.4 initial probabilities).
5051 pub const COEFF_BASE_LUMA_4: [[u16; 5]; 42] = [5092 pub const COEFF_BASE_LUMA_4: [[u16; 5]; 42] = [
5052 [8896, 16227, 20630, 32768, 0],5093 [8896, 16227, 20630, 32768, 0],
5053 [23629, 31782, 32527, 32768, 0],5094 [23629, 31782, 32527, 32768, 0],
@@ -5093,6 +5134,7 @@ pub const COEFF_BASE_LUMA_4: [[u16; 5]; 42] = [
5093 [8192, 16384, 24576, 32768, 0],5134 [8192, 16384, 24576, 32768, 0],
5094 ];5135 ];
5095 5136
5137+/// Default CDF table `COEFF_BASE_LUMA_4_Q3` (AV1 spec 9.4 initial probabilities).
5096 pub const COEFF_BASE_LUMA_4_Q3: [[u16; 5]; 42] = [5138 pub const COEFF_BASE_LUMA_4_Q3: [[u16; 5]; 42] = [
5097 [7062, 16472, 22319, 32768, 0],5139 [7062, 16472, 22319, 32768, 0],
5098 [24538, 32261, 32674, 32768, 0],5140 [24538, 32261, 32674, 32768, 0],
@@ -5139,6 +5181,7 @@ pub const COEFF_BASE_LUMA_4_Q3: [[u16; 5]; 42] = [
5139 ];5181 ];
5140 5182
5141 // COEFF_BASE_EOB_LUMA_45183 // COEFF_BASE_EOB_LUMA_4
5184+/// Default CDF table `COEFF_BASE_EOB_LUMA_4_Q0` (AV1 spec 9.4 initial probabilities).
5142 pub const COEFF_BASE_EOB_LUMA_4_Q0: [[u16; 4]; 4] = [5185 pub const COEFF_BASE_EOB_LUMA_4_Q0: [[u16; 4]; 4] = [
5143 [17837, 29055, 32768, 0],5186 [17837, 29055, 32768, 0],
5144 [29600, 31446, 32768, 0],5187 [29600, 31446, 32768, 0],
@@ -5146,6 +5189,7 @@ pub const COEFF_BASE_EOB_LUMA_4_Q0: [[u16; 4]; 4] = [
5146 [24926, 28948, 32768, 0],5189 [24926, 28948, 32768, 0],
5147 ];5190 ];
5148 5191
5192+/// Default CDF table `COEFF_BASE_EOB_LUMA_4_Q1` (AV1 spec 9.4 initial probabilities).
5149 pub const COEFF_BASE_EOB_LUMA_4_Q1: [[u16; 4]; 4] = [5193 pub const COEFF_BASE_EOB_LUMA_4_Q1: [[u16; 4]; 4] = [
5150 [17560, 29888, 32768, 0],5194 [17560, 29888, 32768, 0],
5151 [29671, 31549, 32768, 0],5195 [29671, 31549, 32768, 0],
@@ -5153,6 +5197,7 @@ pub const COEFF_BASE_EOB_LUMA_4_Q1: [[u16; 4]; 4] = [
5153 [27286, 30006, 32768, 0],5197 [27286, 30006, 32768, 0],
5154 ];5198 ];
5155 5199
5200+/// Default CDF table `COEFF_BASE_EOB_LUMA_4` (AV1 spec 9.4 initial probabilities).
5156 pub const COEFF_BASE_EOB_LUMA_4: [[u16; 4]; 4] = [5201 pub const COEFF_BASE_EOB_LUMA_4: [[u16; 4]; 4] = [
5157 [20092, 30774, 32768, 0],5202 [20092, 30774, 32768, 0],
5158 [30695, 32020, 32768, 0],5203 [30695, 32020, 32768, 0],
@@ -5160,6 +5205,7 @@ pub const COEFF_BASE_EOB_LUMA_4: [[u16; 4]; 4] = [
5160 [28666, 30870, 32768, 0],5205 [28666, 30870, 32768, 0],
5161 ];5206 ];
5162 5207
5208+/// Default CDF table `COEFF_BASE_EOB_LUMA_4_Q3` (AV1 spec 9.4 initial probabilities).
5163 pub const COEFF_BASE_EOB_LUMA_4_Q3: [[u16; 4]; 4] = [5209 pub const COEFF_BASE_EOB_LUMA_4_Q3: [[u16; 4]; 4] = [
5164 [22497, 31198, 32768, 0],5210 [22497, 31198, 32768, 0],
5165 [31715, 32495, 32768, 0],5211 [31715, 32495, 32768, 0],
@@ -5168,6 +5214,7 @@ pub const COEFF_BASE_EOB_LUMA_4_Q3: [[u16; 4]; 4] = [
5168 ];5214 ];
5169 5215
5170 // COEFF_BR_LUMA_45216 // COEFF_BR_LUMA_4
5217+/// Default CDF table `COEFF_BR_LUMA_4_Q0` (AV1 spec 9.4 initial probabilities).
5171 pub const COEFF_BR_LUMA_4_Q0: [[u16; 5]; 21] = [5218 pub const COEFF_BR_LUMA_4_Q0: [[u16; 5]; 21] = [
5172 [14298, 20718, 24174, 32768, 0],5219 [14298, 20718, 24174, 32768, 0],
5173 [12536, 19601, 23789, 32768, 0],5220 [12536, 19601, 23789, 32768, 0],
@@ -5192,6 +5239,7 @@ pub const COEFF_BR_LUMA_4_Q0: [[u16; 5]; 21] = [
5192 [3034, 5860, 8462, 32768, 0],5239 [3034, 5860, 8462, 32768, 0],
5193 ];5240 ];
5194 5241
5242+/// Default CDF table `COEFF_BR_LUMA_4_Q1` (AV1 spec 9.4 initial probabilities).
5195 pub const COEFF_BR_LUMA_4_Q1: [[u16; 5]; 21] = [5243 pub const COEFF_BR_LUMA_4_Q1: [[u16; 5]; 21] = [
5196 [14995, 21341, 24749, 32768, 0],5244 [14995, 21341, 24749, 32768, 0],
5197 [13158, 20289, 24601, 32768, 0],5245 [13158, 20289, 24601, 32768, 0],
@@ -5216,6 +5264,7 @@ pub const COEFF_BR_LUMA_4_Q1: [[u16; 5]; 21] = [
5216 [3793, 7278, 10447, 32768, 0],5264 [3793, 7278, 10447, 32768, 0],
5217 ];5265 ];
5218 5266
5267+/// Default CDF table `COEFF_BR_LUMA_4` (AV1 spec 9.4 initial probabilities).
5219 pub const COEFF_BR_LUMA_4: [[u16; 5]; 21] = [5268 pub const COEFF_BR_LUMA_4: [[u16; 5]; 21] = [
5220 [16138, 22223, 25509, 32768, 0],5269 [16138, 22223, 25509, 32768, 0],
5221 [15347, 22430, 26332, 32768, 0],5270 [15347, 22430, 26332, 32768, 0],
@@ -5240,6 +5289,7 @@ pub const COEFF_BR_LUMA_4: [[u16; 5]; 21] = [
5240 [5413, 10335, 14498, 32768, 0],5289 [5413, 10335, 14498, 32768, 0],
5241 ];5290 ];
5242 5291
5292+/// Default CDF table `COEFF_BR_LUMA_4_Q3` (AV1 spec 9.4 initial probabilities).
5243 pub const COEFF_BR_LUMA_4_Q3: [[u16; 5]; 21] = [5293 pub const COEFF_BR_LUMA_4_Q3: [[u16; 5]; 21] = [
5244 [18315, 24289, 27551, 32768, 0],5294 [18315, 24289, 27551, 32768, 0],
5245 [16854, 24068, 27835, 32768, 0],5295 [16854, 24068, 27835, 32768, 0],
@@ -5295,79 +5345,115 @@ pub const INTRA_TX_TYPE_SET1_4: [[u16; 8]; 13] = [
5295 /// `DCTONLY`) hold no 1D type.5345 /// `DCTONLY`) hold no 1D type.
5296 pub const EOB_PT_256_LUMA_CLASS1_Q0: [u16; 10] =5346 pub const EOB_PT_256_LUMA_CLASS1_Q0: [u16; 10] =
5297 [998, 1850, 2998, 5604, 17341, 19888, 22899, 25583, 32768, 0];5347 [998, 1850, 2998, 5604, 17341, 19888, 22899, 25583, 32768, 0];
5348+/// Default CDF table `EOB_PT_256_LUMA_CLASS1_Q1` (AV1 spec 9.4 initial probabilities).
5298 pub const EOB_PT_256_LUMA_CLASS1_Q1: [u16; 10] =5349 pub const EOB_PT_256_LUMA_CLASS1_Q1: [u16; 10] =
5299 [399, 1019, 1749, 3038, 10444, 15546, 22739, 27294, 32768, 0];5350 [399, 1019, 1749, 3038, 10444, 15546, 22739, 27294, 32768, 0];
5351+/// Default CDF table `EOB_PT_256_LUMA_CLASS1` (AV1 spec 9.4 initial probabilities).
5300 pub const EOB_PT_256_LUMA_CLASS1: [u16; 10] =5352 pub const EOB_PT_256_LUMA_CLASS1: [u16; 10] =
5301 [1084, 2358, 3488, 5122, 11483, 18103, 26023, 29799, 32768, 0];5353 [1084, 2358, 3488, 5122, 11483, 18103, 26023, 29799, 32768, 0];
5354+/// Default CDF table `EOB_PT_256_LUMA_CLASS1_Q3` (AV1 spec 9.4 initial probabilities).
5302 pub const EOB_PT_256_LUMA_CLASS1_Q3: [u16; 10] =5355 pub const EOB_PT_256_LUMA_CLASS1_Q3: [u16; 10] =
5303 [2453, 4474, 6307, 8777, 16474, 22975, 29000, 31547, 32768, 0];5356 [2453, 4474, 6307, 8777, 16474, 22975, 29000, 31547, 32768, 0];
5304 5357
5358+/// Default CDF table `EOB_PT_256_CHROMA_CLASS1_Q0` (AV1 spec 9.4 initial probabilities).
5305 pub const EOB_PT_256_CHROMA_CLASS1_Q0: [u16; 10] =5359 pub const EOB_PT_256_CHROMA_CLASS1_Q0: [u16; 10] =
5306 [2203, 4130, 7435, 10739, 20652, 23681, 25609, 27261, 32768, 0];5360 [2203, 4130, 7435, 10739, 20652, 23681, 25609, 27261, 32768, 0];
5361+/// Default CDF table `EOB_PT_256_CHROMA_CLASS1_Q1` (AV1 spec 9.4 initial probabilities).
5307 pub const EOB_PT_256_CHROMA_CLASS1_Q1: [u16; 10] =5362 pub const EOB_PT_256_CHROMA_CLASS1_Q1: [u16; 10] =
5308 [1674, 3252, 5734, 10159, 22397, 23802, 24821, 30940, 32768, 0];5363 [1674, 3252, 5734, 10159, 22397, 23802, 24821, 30940, 32768, 0];
5364+/// Default CDF table `EOB_PT_256_CHROMA_CLASS1` (AV1 spec 9.4 initial probabilities).
5309 pub const EOB_PT_256_CHROMA_CLASS1: [u16; 10] =5365 pub const EOB_PT_256_CHROMA_CLASS1: [u16; 10] =
5310 [6571, 9610, 15516, 21826, 29092, 30829, 31842, 32708, 32768, 0];5366 [6571, 9610, 15516, 21826, 29092, 30829, 31842, 32708, 32768, 0];
5367+/// Default CDF table `EOB_PT_256_CHROMA_CLASS1_Q3` (AV1 spec 9.4 initial probabilities).
5311 pub const EOB_PT_256_CHROMA_CLASS1_Q3: [u16; 10] =5368 pub const EOB_PT_256_CHROMA_CLASS1_Q3: [u16; 10] =
5312 [9998, 17661, 25178, 28097, 31308, 32038, 32403, 32695, 32768, 0];5369 [9998, 17661, 25178, 28097, 31308, 32038, 32403, 32695, 32768, 0];
5313 5370
5371+/// Default CDF table `EOB_PT_64_CHROMA_CLASS1_Q0` (AV1 spec 9.4 initial probabilities).
5314 pub const EOB_PT_64_CHROMA_CLASS1_Q0: [u16; 8] =5372 pub const EOB_PT_64_CHROMA_CLASS1_Q0: [u16; 8] =
5315 [1563, 2700, 4876, 10911, 14706, 22480, 32768, 0];5373 [1563, 2700, 4876, 10911, 14706, 22480, 32768, 0];
5374+/// Default CDF table `EOB_PT_64_CHROMA_CLASS1_Q1` (AV1 spec 9.4 initial probabilities).
5316 pub const EOB_PT_64_CHROMA_CLASS1_Q1: [u16; 8] =5375 pub const EOB_PT_64_CHROMA_CLASS1_Q1: [u16; 8] =
5317 [1923, 3127, 5867, 9703, 14277, 27100, 32768, 0];5376 [1923, 3127, 5867, 9703, 14277, 27100, 32768, 0];
5377+/// Default CDF table `EOB_PT_64_CHROMA_CLASS1` (AV1 spec 9.4 initial probabilities).
5318 pub const EOB_PT_64_CHROMA_CLASS1: [u16; 8] =5378 pub const EOB_PT_64_CHROMA_CLASS1: [u16; 8] =
5319 [4034, 6290, 10235, 14982, 21214, 28491, 32768, 0];5379 [4034, 6290, 10235, 14982, 21214, 28491, 32768, 0];
5380+/// Default CDF table `EOB_PT_64_CHROMA_CLASS1_Q3` (AV1 spec 9.4 initial probabilities).
5320 pub const EOB_PT_64_CHROMA_CLASS1_Q3: [u16; 8] =5381 pub const EOB_PT_64_CHROMA_CLASS1_Q3: [u16; 8] =
5321 [8726, 12378, 19409, 26450, 30038, 32462, 32768, 0];5382 [8726, 12378, 19409, 26450, 30038, 32462, 32768, 0];
5322 5383
5384+/// Default CDF table `EOB_PT_16_CHROMA_CLASS1_Q0` (AV1 spec 9.4 initial probabilities).
5323 pub const EOB_PT_16_CHROMA_CLASS1_Q0: [u16; 6] = [1904, 3354, 7763, 14647, 32768, 0];5385 pub const EOB_PT_16_CHROMA_CLASS1_Q0: [u16; 6] = [1904, 3354, 7763, 14647, 32768, 0];
5386+/// Default CDF table `EOB_PT_16_CHROMA_CLASS1_Q1` (AV1 spec 9.4 initial probabilities).
5324 pub const EOB_PT_16_CHROMA_CLASS1_Q1: [u16; 6] = [2497, 4096, 8866, 16993, 32768, 0];5387 pub const EOB_PT_16_CHROMA_CLASS1_Q1: [u16; 6] = [2497, 4096, 8866, 16993, 32768, 0];
5388+/// Default CDF table `EOB_PT_16_CHROMA_CLASS1` (AV1 spec 9.4 initial probabilities).
5325 pub const EOB_PT_16_CHROMA_CLASS1: [u16; 6] = [3192, 5032, 10297, 19755, 32768, 0];5389 pub const EOB_PT_16_CHROMA_CLASS1: [u16; 6] = [3192, 5032, 10297, 19755, 32768, 0];
5390+/// Default CDF table `EOB_PT_16_CHROMA_CLASS1_Q3` (AV1 spec 9.4 initial probabilities).
5326 pub const EOB_PT_16_CHROMA_CLASS1_Q3: [u16; 6] = [7297, 10767, 19273, 28194, 32768, 0];5391 pub const EOB_PT_16_CHROMA_CLASS1_Q3: [u16; 6] = [7297, 10767, 19273, 28194, 32768, 0];
5327 5392
5328 /// `EOB_PT_128_LUMA`'s class-1 sibling (`av1_default_eob_multi128_cdfs[q][0][1]`),5393 /// `EOB_PT_128_LUMA`'s class-1 sibling (`av1_default_eob_multi128_cdfs[q][0][1]`),
5329 /// read by a 16x8/8x16 luma transform whose inherited `tx_type` is 1D5394 /// read by a 16x8/8x16 luma transform whose inherited `tx_type` is 1D
5330 /// (`TxbSet::LumaRect16x8`) -- machine-extracted, scripts/extract-eob-class1.py.5395 /// (`TxbSet::LumaRect16x8`) -- machine-extracted, scripts/extract-eob-class1.py.
5331 pub const EOB_PT_128_LUMA_CLASS1_Q0: [u16; 9] = [371, 699, 1254, 4830, 9479, 12562, 17497, 32768, 0];5396 pub const EOB_PT_128_LUMA_CLASS1_Q0: [u16; 9] = [371, 699, 1254, 4830, 9479, 12562, 17497, 32768, 0];
5397+/// Default CDF table `EOB_PT_128_LUMA_CLASS1_Q1` (AV1 spec 9.4 initial probabilities).
5332 pub const EOB_PT_128_LUMA_CLASS1_Q1: [u16; 9] = [217, 352, 618, 2303, 5261, 9969, 17472, 32768, 0];5398 pub const EOB_PT_128_LUMA_CLASS1_Q1: [u16; 9] = [217, 352, 618, 2303, 5261, 9969, 17472, 32768, 0];
5399+/// Default CDF table `EOB_PT_128_LUMA_CLASS1` (AV1 spec 9.4 initial probabilities).
5333 pub const EOB_PT_128_LUMA_CLASS1: [u16; 9] = [354, 558, 944, 2760, 7287, 14037, 21779, 32768, 0];5400 pub const EOB_PT_128_LUMA_CLASS1: [u16; 9] = [354, 558, 944, 2760, 7287, 14037, 21779, 32768, 0];
5401+/// Default CDF table `EOB_PT_128_LUMA_CLASS1_Q3` (AV1 spec 9.4 initial probabilities).
5334 pub const EOB_PT_128_LUMA_CLASS1_Q3: [u16; 9] = [886, 1731, 3271, 8469, 15569, 22126, 28383, 32768, 0];5402 pub const EOB_PT_128_LUMA_CLASS1_Q3: [u16; 9] = [886, 1731, 3271, 8469, 15569, 22126, 28383, 32768, 0];
5335 5403
5336 /// `EOB_PT_32_CHROMA`'s class-1 sibling (`av1_default_eob_multi32_cdfs[q][1][1]`),5404 /// `EOB_PT_32_CHROMA`'s class-1 sibling (`av1_default_eob_multi32_cdfs[q][1][1]`),
5337 /// read by an 8x4/4x8 chroma transform under a 1D luma `tx_type`5405 /// read by an 8x4/4x8 chroma transform under a 1D luma `tx_type`
5338 /// (`TxbSet::ChromaRect8x4`) -- machine-extracted, scripts/extract-eob-class1.py.5406 /// (`TxbSet::ChromaRect8x4`) -- machine-extracted, scripts/extract-eob-class1.py.
5339 pub const EOB_PT_32_CHROMA_CLASS1_Q0: [u16; 7] = [1786, 3179, 6902, 11357, 19054, 32768, 0];5407 pub const EOB_PT_32_CHROMA_CLASS1_Q0: [u16; 7] = [1786, 3179, 6902, 11357, 19054, 32768, 0];
5408+/// Default CDF table `EOB_PT_32_CHROMA_CLASS1_Q1` (AV1 spec 9.4 initial probabilities).
5340 pub const EOB_PT_32_CHROMA_CLASS1_Q1: [u16; 7] = [2578, 4124, 8181, 13670, 24234, 32768, 0];5409 pub const EOB_PT_32_CHROMA_CLASS1_Q1: [u16; 7] = [2578, 4124, 8181, 13670, 24234, 32768, 0];
5410+/// Default CDF table `EOB_PT_32_CHROMA_CLASS1` (AV1 spec 9.4 initial probabilities).
5341 pub const EOB_PT_32_CHROMA_CLASS1: [u16; 7] = [3542, 5502, 10415, 16760, 25644, 32768, 0];5411 pub const EOB_PT_32_CHROMA_CLASS1: [u16; 7] = [3542, 5502, 10415, 16760, 25644, 32768, 0];
5412+/// Default CDF table `EOB_PT_32_CHROMA_CLASS1_Q3` (AV1 spec 9.4 initial probabilities).
5342 pub const EOB_PT_32_CHROMA_CLASS1_Q3: [u16; 7] = [7699, 10897, 20891, 26926, 31628, 32768, 0];5413 pub const EOB_PT_32_CHROMA_CLASS1_Q3: [u16; 7] = [7699, 10897, 20891, 26926, 31628, 32768, 0];
5343 5414
5344 /// `EOB_PT_128_CHROMA`'s class-1 sibling (`av1_default_eob_multi128_cdfs[q][1][1]`).5415 /// `EOB_PT_128_CHROMA`'s class-1 sibling (`av1_default_eob_multi128_cdfs[q][1][1]`).
5345 pub const EOB_PT_128_CHROMA_CLASS1_Q0: [u16; 9] = [2054, 3472, 5869, 14232, 18242, 20590, 26752, 32768, 0];5416 pub const EOB_PT_128_CHROMA_CLASS1_Q0: [u16; 9] = [2054, 3472, 5869, 14232, 18242, 20590, 26752, 32768, 0];
5417+/// Default CDF table `EOB_PT_128_CHROMA_CLASS1_Q1` (AV1 spec 9.4 initial probabilities).
5346 pub const EOB_PT_128_CHROMA_CLASS1_Q1: [u16; 9] = [2310, 4160, 7471, 14997, 17931, 20768, 30240, 32768, 0];5418 pub const EOB_PT_128_CHROMA_CLASS1_Q1: [u16; 9] = [2310, 4160, 7471, 14997, 17931, 20768, 30240, 32768, 0];
5419+/// Default CDF table `EOB_PT_128_CHROMA_CLASS1` (AV1 spec 9.4 initial probabilities).
5347 pub const EOB_PT_128_CHROMA_CLASS1: [u16; 9] = [6275, 9889, 14769, 23164, 27988, 30493, 32272, 32768, 0];5420 pub const EOB_PT_128_CHROMA_CLASS1: [u16; 9] = [6275, 9889, 14769, 23164, 27988, 30493, 32272, 32768, 0];
5421+/// Default CDF table `EOB_PT_128_CHROMA_CLASS1_Q3` (AV1 spec 9.4 initial probabilities).
5348 pub const EOB_PT_128_CHROMA_CLASS1_Q3: [u16; 9] = [9165, 13282, 21150, 30286, 31894, 32571, 32712, 32768, 0];5422 pub const EOB_PT_128_CHROMA_CLASS1_Q3: [u16; 9] = [9165, 13282, 21150, 30286, 31894, 32571, 32712, 32768, 0];
5349 5423
5350 /// `EOB_PT_512_LUMA`'s class-1 sibling (`av1_default_eob_multi512_cdfs[q][0][1]`).5424 /// `EOB_PT_512_LUMA`'s class-1 sibling (`av1_default_eob_multi512_cdfs[q][0][1]`).
5351 pub const EOB_PT_512_LUMA_CLASS1_Q0: [u16; 11] = [3277, 6554, 9830, 13107, 16384, 19661, 22938, 26214, 29491, 32768, 0];5425 pub const EOB_PT_512_LUMA_CLASS1_Q0: [u16; 11] = [3277, 6554, 9830, 13107, 16384, 19661, 22938, 26214, 29491, 32768, 0];
5426+/// Default CDF table `EOB_PT_512_LUMA_CLASS1_Q1` (AV1 spec 9.4 initial probabilities).
5352 pub const EOB_PT_512_LUMA_CLASS1_Q1: [u16; 11] = [3277, 6554, 9830, 13107, 16384, 19661, 22938, 26214, 29491, 32768, 0];5427 pub const EOB_PT_512_LUMA_CLASS1_Q1: [u16; 11] = [3277, 6554, 9830, 13107, 16384, 19661, 22938, 26214, 29491, 32768, 0];
5428+/// Default CDF table `EOB_PT_512_LUMA_CLASS1` (AV1 spec 9.4 initial probabilities).
5353 pub const EOB_PT_512_LUMA_CLASS1: [u16; 11] = [3277, 6554, 9830, 13107, 16384, 19661, 22938, 26214, 29491, 32768, 0];5429 pub const EOB_PT_512_LUMA_CLASS1: [u16; 11] = [3277, 6554, 9830, 13107, 16384, 19661, 22938, 26214, 29491, 32768, 0];
5430+/// Default CDF table `EOB_PT_512_LUMA_CLASS1_Q3` (AV1 spec 9.4 initial probabilities).
5354 pub const EOB_PT_512_LUMA_CLASS1_Q3: [u16; 11] = [3277, 6554, 9830, 13107, 16384, 19661, 22938, 26214, 29491, 32768, 0];5431 pub const EOB_PT_512_LUMA_CLASS1_Q3: [u16; 11] = [3277, 6554, 9830, 13107, 16384, 19661, 22938, 26214, 29491, 32768, 0];
5355 5432
5356 /// `EOB_PT_512_CHROMA`'s class-1 sibling (`av1_default_eob_multi512_cdfs[q][1][1]`).5433 /// `EOB_PT_512_CHROMA`'s class-1 sibling (`av1_default_eob_multi512_cdfs[q][1][1]`).
5357 pub const EOB_PT_512_CHROMA_CLASS1_Q0: [u16; 11] = [3277, 6554, 9830, 13107, 16384, 19661, 22938, 26214, 29491, 32768, 0];5434 pub const EOB_PT_512_CHROMA_CLASS1_Q0: [u16; 11] = [3277, 6554, 9830, 13107, 16384, 19661, 22938, 26214, 29491, 32768, 0];
5435+/// Default CDF table `EOB_PT_512_CHROMA_CLASS1_Q1` (AV1 spec 9.4 initial probabilities).
5358 pub const EOB_PT_512_CHROMA_CLASS1_Q1: [u16; 11] = [3277, 6554, 9830, 13107, 16384, 19661, 22938, 26214, 29491, 32768, 0];5436 pub const EOB_PT_512_CHROMA_CLASS1_Q1: [u16; 11] = [3277, 6554, 9830, 13107, 16384, 19661, 22938, 26214, 29491, 32768, 0];
5437+/// Default CDF table `EOB_PT_512_CHROMA_CLASS1` (AV1 spec 9.4 initial probabilities).
5359 pub const EOB_PT_512_CHROMA_CLASS1: [u16; 11] = [3277, 6554, 9830, 13107, 16384, 19661, 22938, 26214, 29491, 32768, 0];5438 pub const EOB_PT_512_CHROMA_CLASS1: [u16; 11] = [3277, 6554, 9830, 13107, 16384, 19661, 22938, 26214, 29491, 32768, 0];
5439+/// Default CDF table `EOB_PT_512_CHROMA_CLASS1_Q3` (AV1 spec 9.4 initial probabilities).
5360 pub const EOB_PT_512_CHROMA_CLASS1_Q3: [u16; 11] = [3277, 6554, 9830, 13107, 16384, 19661, 22938, 26214, 29491, 32768, 0];5440 pub const EOB_PT_512_CHROMA_CLASS1_Q3: [u16; 11] = [3277, 6554, 9830, 13107, 16384, 19661, 22938, 26214, 29491, 32768, 0];
5361 5441
5362 /// `EOB_PT_1024_LUMA`'s class-1 sibling (`av1_default_eob_multi1024_cdfs[q][0][1]`).5442 /// `EOB_PT_1024_LUMA`'s class-1 sibling (`av1_default_eob_multi1024_cdfs[q][0][1]`).
5363 pub const EOB_PT_1024_LUMA_CLASS1_Q0: [u16; 12] = [2979, 5958, 8937, 11916, 14895, 17873, 20852, 23831, 26810, 29789, 32768, 0];5443 pub const EOB_PT_1024_LUMA_CLASS1_Q0: [u16; 12] = [2979, 5958, 8937, 11916, 14895, 17873, 20852, 23831, 26810, 29789, 32768, 0];
5444+/// Default CDF table `EOB_PT_1024_LUMA_CLASS1_Q1` (AV1 spec 9.4 initial probabilities).
5364 pub const EOB_PT_1024_LUMA_CLASS1_Q1: [u16; 12] = [2979, 5958, 8937, 11916, 14895, 17873, 20852, 23831, 26810, 29789, 32768, 0];5445 pub const EOB_PT_1024_LUMA_CLASS1_Q1: [u16; 12] = [2979, 5958, 8937, 11916, 14895, 17873, 20852, 23831, 26810, 29789, 32768, 0];
5446+/// Default CDF table `EOB_PT_1024_LUMA_CLASS1` (AV1 spec 9.4 initial probabilities).
5365 pub const EOB_PT_1024_LUMA_CLASS1: [u16; 12] = [2979, 5958, 8937, 11916, 14895, 17873, 20852, 23831, 26810, 29789, 32768, 0];5447 pub const EOB_PT_1024_LUMA_CLASS1: [u16; 12] = [2979, 5958, 8937, 11916, 14895, 17873, 20852, 23831, 26810, 29789, 32768, 0];
5448+/// Default CDF table `EOB_PT_1024_LUMA_CLASS1_Q3` (AV1 spec 9.4 initial probabilities).
5366 pub const EOB_PT_1024_LUMA_CLASS1_Q3: [u16; 12] = [2979, 5958, 8937, 11916, 14895, 17873, 20852, 23831, 26810, 29789, 32768, 0];5449 pub const EOB_PT_1024_LUMA_CLASS1_Q3: [u16; 12] = [2979, 5958, 8937, 11916, 14895, 17873, 20852, 23831, 26810, 29789, 32768, 0];
5367 5450
5368 /// `EOB_PT_1024_CHROMA`'s class-1 sibling (`av1_default_eob_multi1024_cdfs[q][1][1]`).5451 /// `EOB_PT_1024_CHROMA`'s class-1 sibling (`av1_default_eob_multi1024_cdfs[q][1][1]`).
5369 pub const EOB_PT_1024_CHROMA_CLASS1_Q0: [u16; 12] = [2979, 5958, 8937, 11916, 14895, 17873, 20852, 23831, 26810, 29789, 32768, 0];5452 pub const EOB_PT_1024_CHROMA_CLASS1_Q0: [u16; 12] = [2979, 5958, 8937, 11916, 14895, 17873, 20852, 23831, 26810, 29789, 32768, 0];
5453+/// Default CDF table `EOB_PT_1024_CHROMA_CLASS1_Q1` (AV1 spec 9.4 initial probabilities).
5370 pub const EOB_PT_1024_CHROMA_CLASS1_Q1: [u16; 12] = [2979, 5958, 8937, 11916, 14895, 17873, 20852, 23831, 26810, 29789, 32768, 0];5454 pub const EOB_PT_1024_CHROMA_CLASS1_Q1: [u16; 12] = [2979, 5958, 8937, 11916, 14895, 17873, 20852, 23831, 26810, 29789, 32768, 0];
5455+/// Default CDF table `EOB_PT_1024_CHROMA_CLASS1` (AV1 spec 9.4 initial probabilities).
5371 pub const EOB_PT_1024_CHROMA_CLASS1: [u16; 12] = [2979, 5958, 8937, 11916, 14895, 17873, 20852, 23831, 26810, 29789, 32768, 0];5456 pub const EOB_PT_1024_CHROMA_CLASS1: [u16; 12] = [2979, 5958, 8937, 11916, 14895, 17873, 20852, 23831, 26810, 29789, 32768, 0];
5457+/// Default CDF table `EOB_PT_1024_CHROMA_CLASS1_Q3` (AV1 spec 9.4 initial probabilities).
5372 pub const EOB_PT_1024_CHROMA_CLASS1_Q3: [u16; 12] = [2979, 5958, 8937, 11916, 14895, 17873, 20852, 23831, 26810, 29789, 32768, 0];5458 pub const EOB_PT_1024_CHROMA_CLASS1_Q3: [u16; 12] = [2979, 5958, 8937, 11916, 14895, 17873, 20852, 23831, 26810, 29789, 32768, 0];
5373 5459
crates/ec-av1/src/decode.rsmodified+191 -27
@@ -243,9 +243,9 @@ pub(crate) fn sb_mi_cur(fctx: &crate::decode::FrameCtx) -> u32 {
243 if sb128(fctx) { SB_MI * 2 } else { SB_MI }243 if sb128(fctx) { SB_MI * 2 } else { SB_MI }
244 }244 }
245 245
246-/// How many real 128-level partition symbols this decoder has read, and how246+// How many real 128-level partition symbols this decoder has read, and how
247-/// many superblocks resolved to `PARTITION_SPLIT` (coded or forced) -- the247+// many superblocks resolved to `PARTITION_SPLIT` (coded or forced) -- the
248-/// gate's proof a `--sb-size=128` stream exercised the 128 partition root.248+// gate's proof a `--sb-size=128` stream exercised the 128 partition root.
249 thread_local! {249 thread_local! {
250 static PART128_SYMBOLS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };250 static PART128_SYMBOLS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
251 static PART128_SPLIT_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };251 static PART128_SPLIT_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
@@ -255,16 +255,19 @@ thread_local! {
255 /// Current value of `PART128_GATHERED_SYMBOLS`: 128 roots that read the255 /// Current value of `PART128_GATHERED_SYMBOLS`: 128 roots that read the
256 /// half-out-of-frame gathered split_or_horz/split_or_vert symbol (spec256 /// half-out-of-frame gathered split_or_horz/split_or_vert symbol (spec
257 /// 5.11.4), which this decoder used to read and throw away.257 /// 5.11.4), which this decoder used to read and throw away.
258+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
258 pub(crate) fn part128_gathered_symbols() -> usize {259 pub(crate) fn part128_gathered_symbols() -> usize {
259 PART128_GATHERED_SYMBOLS.with(|c| c.get())260 PART128_GATHERED_SYMBOLS.with(|c| c.get())
260 }261 }
261 262
262 /// Current value of [`PART128_SYMBOLS`].263 /// Current value of [`PART128_SYMBOLS`].
264+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
263 pub(crate) fn part128_symbols() -> usize {265 pub(crate) fn part128_symbols() -> usize {
264 PART128_SYMBOLS.with(|c| c.get())266 PART128_SYMBOLS.with(|c| c.get())
265 }267 }
266 268
267 /// Current value of [`PART128_SPLIT_HITS`].269 /// Current value of [`PART128_SPLIT_HITS`].
270+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
268 pub(crate) fn part128_split_hits() -> usize {271 pub(crate) fn part128_split_hits() -> usize {
269 PART128_SPLIT_HITS.with(|c| c.get())272 PART128_SPLIT_HITS.with(|c| c.get())
270 }273 }
@@ -293,6 +296,7 @@ thread_local! {
293 }296 }
294 297
295 /// Current value of [`FILTER_INTRA_HITS`].298 /// Current value of [`FILTER_INTRA_HITS`].
299+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
296 pub(crate) fn filter_intra_hits() -> usize {300 pub(crate) fn filter_intra_hits() -> usize {
297 FILTER_INTRA_HITS.with(|c| c.get())301 FILTER_INTRA_HITS.with(|c| c.get())
298 }302 }
@@ -307,6 +311,7 @@ thread_local! {
307 }311 }
308 312
309 /// Current value of [`INTRA_IN_INTER_FILTER_INTRA_HITS`].313 /// Current value of [`INTRA_IN_INTER_FILTER_INTRA_HITS`].
314+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
310 pub(crate) fn intra_in_inter_filter_intra_hits() -> usize {315 pub(crate) fn intra_in_inter_filter_intra_hits() -> usize {
311 INTRA_IN_INTER_FILTER_INTRA_HITS.with(|c| c.get())316 INTRA_IN_INTER_FILTER_INTRA_HITS.with(|c| c.get())
312 }317 }
@@ -323,11 +328,13 @@ thread_local! {
323 }328 }
324 329
325 /// Current value of [`INTRA_IN_INTER_ANGLE_DELTA_Y_HITS`].330 /// Current value of [`INTRA_IN_INTER_ANGLE_DELTA_Y_HITS`].
331+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
326 pub(crate) fn intra_in_inter_angle_delta_y_hits() -> usize {332 pub(crate) fn intra_in_inter_angle_delta_y_hits() -> usize {
327 INTRA_IN_INTER_ANGLE_DELTA_Y_HITS.with(|c| c.get())333 INTRA_IN_INTER_ANGLE_DELTA_Y_HITS.with(|c| c.get())
328 }334 }
329 335
330 /// Current value of [`INTRA_IN_INTER_ANGLE_DELTA_UV_HITS`].336 /// Current value of [`INTRA_IN_INTER_ANGLE_DELTA_UV_HITS`].
337+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
331 pub(crate) fn intra_in_inter_angle_delta_uv_hits() -> usize {338 pub(crate) fn intra_in_inter_angle_delta_uv_hits() -> usize {
332 INTRA_IN_INTER_ANGLE_DELTA_UV_HITS.with(|c| c.get())339 INTRA_IN_INTER_ANGLE_DELTA_UV_HITS.with(|c| c.get())
333 }340 }
@@ -348,12 +355,14 @@ thread_local! {
348 355
349 /// Nonzero luma angle deltas coded by an intra 8x8 leaf inside an inter frame356 /// Nonzero luma angle deltas coded by an intra 8x8 leaf inside an inter frame
350 /// (lane-leaf8tx r1) -- counted only in [`decode_inter_block8`]'s intra arm.357 /// (lane-leaf8tx r1) -- counted only in [`decode_inter_block8`]'s intra arm.
358+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
351 pub(crate) fn intra_in_inter8_angle_delta_y_hits() -> usize {359 pub(crate) fn intra_in_inter8_angle_delta_y_hits() -> usize {
352 INTRA_IN_INTER8_ANGLE_DELTA_Y_HITS.with(|c| c.get())360 INTRA_IN_INTER8_ANGLE_DELTA_Y_HITS.with(|c| c.get())
353 }361 }
354 362
355 /// `(directional, smooth/paeth, CfL)` chroma modes coded by an intra 8x8 leaf363 /// `(directional, smooth/paeth, CfL)` chroma modes coded by an intra 8x8 leaf
356 /// inside an inter frame -- see [`INTRA_IN_INTER8_UV_DIR_HITS`].364 /// inside an inter frame -- see [`INTRA_IN_INTER8_UV_DIR_HITS`].
365+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
357 pub(crate) fn intra_in_inter8_uv_hits() -> (usize, usize, usize) {366 pub(crate) fn intra_in_inter8_uv_hits() -> (usize, usize, usize) {
358 (367 (
359 INTRA_IN_INTER8_UV_DIR_HITS.with(|c| c.get()),368 INTRA_IN_INTER8_UV_DIR_HITS.with(|c| c.get()),
@@ -442,6 +451,7 @@ thread_local! {
442 }451 }
443 452
444 /// Current value of [`WARP_PLANE_SUPPRESS_HITS`].453 /// Current value of [`WARP_PLANE_SUPPRESS_HITS`].
454+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
445 pub(crate) fn warp_plane_suppress_hits() -> usize {455 pub(crate) fn warp_plane_suppress_hits() -> usize {
446 WARP_PLANE_SUPPRESS_HITS.with(|c| c.get())456 WARP_PLANE_SUPPRESS_HITS.with(|c| c.get())
447 }457 }
@@ -460,6 +470,7 @@ fn warp_plane_allowed(w: usize, h: usize) -> bool {
460 }470 }
461 471
462 /// Current value of [`CDEF_IDX_HITS`].472 /// Current value of [`CDEF_IDX_HITS`].
473+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
463 pub(crate) fn cdef_idx_hits() -> usize {474 pub(crate) fn cdef_idx_hits() -> usize {
464 CDEF_IDX_HITS.with(|c| c.get())475 CDEF_IDX_HITS.with(|c| c.get())
465 }476 }
@@ -476,16 +487,19 @@ thread_local! {
476 }487 }
477 488
478 /// Current value of [`INTRA_IN_INTER_TXCTX_HITS`].489 /// Current value of [`INTRA_IN_INTER_TXCTX_HITS`].
490+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
479 pub(crate) fn intra_in_inter_txctx_hits() -> usize {491 pub(crate) fn intra_in_inter_txctx_hits() -> usize {
480 INTRA_IN_INTER_TXCTX_HITS.with(|c| c.get())492 INTRA_IN_INTER_TXCTX_HITS.with(|c| c.get())
481 }493 }
482 494
483 /// Current value of [`NON_CHROMA_REF_CTX_SKIP_HITS`].495 /// Current value of [`NON_CHROMA_REF_CTX_SKIP_HITS`].
496+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
484 pub(crate) fn non_chroma_ref_ctx_skip_hits() -> usize {497 pub(crate) fn non_chroma_ref_ctx_skip_hits() -> usize {
485 NON_CHROMA_REF_CTX_SKIP_HITS.with(|c| c.get())498 NON_CHROMA_REF_CTX_SKIP_HITS.with(|c| c.get())
486 }499 }
487 500
488 /// Current value of [`EDGE_FILTER_MI_FIX_HITS`].501 /// Current value of [`EDGE_FILTER_MI_FIX_HITS`].
502+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
489 pub(crate) fn edge_filter_mi_fix_hits() -> usize {503 pub(crate) fn edge_filter_mi_fix_hits() -> usize {
490 EDGE_FILTER_MI_FIX_HITS.with(|c| c.get())504 EDGE_FILTER_MI_FIX_HITS.with(|c| c.get())
491 }505 }
@@ -512,6 +526,7 @@ thread_local! {
512 }526 }
513 527
514 /// Current value of [`DELTA_Q_HITS`].528 /// Current value of [`DELTA_Q_HITS`].
529+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
515 pub(crate) fn delta_q_hits() -> usize {530 pub(crate) fn delta_q_hits() -> usize {
516 DELTA_Q_HITS.with(|c| c.get())531 DELTA_Q_HITS.with(|c| c.get())
517 }532 }
@@ -581,6 +596,7 @@ thread_local! {
581 }596 }
582 597
583 /// Current value of [`DELTA_LF_HITS`].598 /// Current value of [`DELTA_LF_HITS`].
599+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
584 pub(crate) fn delta_lf_hits() -> usize {600 pub(crate) fn delta_lf_hits() -> usize {
585 DELTA_LF_HITS.with(|c| c.get())601 DELTA_LF_HITS.with(|c| c.get())
586 }602 }
@@ -720,21 +736,25 @@ pub(crate) fn take_segment_ids(fctx: &crate::decode::FrameCtx) -> Vec<u8> {
720 }736 }
721 737
722 /// How many `segment_id` symbols have been read (never reset per frame).738 /// How many `segment_id` symbols have been read (never reset per frame).
739+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
723 pub(crate) fn segment_id_hits() -> usize {740 pub(crate) fn segment_id_hits() -> usize {
724 SEG_ID_HITS.with(|c| c.get())741 SEG_ID_HITS.with(|c| c.get())
725 }742 }
726 743
727 /// How many distinct segment ids any decoded block has carried.744 /// How many distinct segment ids any decoded block has carried.
745+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
728 pub(crate) fn segment_ids_seen() -> usize {746 pub(crate) fn segment_ids_seen() -> usize {
729 SEG_IDS_SEEN.with(|c| c.get().count_ones() as usize)747 SEG_IDS_SEEN.with(|c| c.get().count_ones() as usize)
730 }748 }
731 749
732 /// How many `seg_id_predicted` symbols have been read (temporal update).750 /// How many `seg_id_predicted` symbols have been read (temporal update).
751+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
733 pub(crate) fn segment_pred_hits() -> usize {752 pub(crate) fn segment_pred_hits() -> usize {
734 SEG_PRED_HITS.with(|c| c.get())753 SEG_PRED_HITS.with(|c| c.get())
735 }754 }
736 755
737 /// Resets the segmentation hit counters (gate setup).756 /// Resets the segmentation hit counters (gate setup).
757+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
738 pub(crate) fn reset_segment_hits() {758 pub(crate) fn reset_segment_hits() {
739 SEG_ID_HITS.with(|c| c.set(0));759 SEG_ID_HITS.with(|c| c.set(0));
740 SEG_IDS_SEEN.with(|c| c.set(0));760 SEG_IDS_SEEN.with(|c| c.set(0));
@@ -1006,6 +1026,7 @@ thread_local! {
1006 }1026 }
1007 1027
1008 /// Current value of [`SMOOTH_LUMA_HITS`].1028 /// Current value of [`SMOOTH_LUMA_HITS`].
1029+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1009 pub(crate) fn smooth_luma_hits() -> usize {1030 pub(crate) fn smooth_luma_hits() -> usize {
1010 SMOOTH_LUMA_HITS.with(|c| c.get())1031 SMOOTH_LUMA_HITS.with(|c| c.get())
1011 }1032 }
@@ -1022,6 +1043,7 @@ thread_local! {
1022 }1043 }
1023 1044
1024 /// Current value of [`SPLIT_TU_REACH_FIX_HITS`].1045 /// Current value of [`SPLIT_TU_REACH_FIX_HITS`].
1046+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1025 pub(crate) fn split_tu_reach_fix_hits() -> usize {1047 pub(crate) fn split_tu_reach_fix_hits() -> usize {
1026 SPLIT_TU_REACH_FIX_HITS.with(|c| c.get())1048 SPLIT_TU_REACH_FIX_HITS.with(|c| c.get())
1027 }1049 }
@@ -1063,6 +1085,7 @@ thread_local! {
1063 }1085 }
1064 1086
1065 /// Current value of [`SMOOTH_UV_HITS`].1087 /// Current value of [`SMOOTH_UV_HITS`].
1088+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1066 pub(crate) fn smooth_uv_hits() -> usize {1089 pub(crate) fn smooth_uv_hits() -> usize {
1067 SMOOTH_UV_HITS.with(|c| c.get())1090 SMOOTH_UV_HITS.with(|c| c.get())
1068 }1091 }
@@ -1077,6 +1100,7 @@ thread_local! {
1077 const { std::cell::Cell::new(0) };1100 const { std::cell::Cell::new(0) };
1078 }1101 }
1079 /// Current value of [`TILE_HITS`].1102 /// Current value of [`TILE_HITS`].
1103+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1080 pub(crate) fn tile_hits() -> usize {1104 pub(crate) fn tile_hits() -> usize {
1081 TILE_HITS.with(|c| c.get())1105 TILE_HITS.with(|c| c.get())
1082 }1106 }
@@ -1096,6 +1120,7 @@ static PREFILT_PICTURE_IDX: std::sync::atomic::AtomicUsize =
1096 std::sync::atomic::AtomicUsize::new(0);1120 std::sync::atomic::AtomicUsize::new(0);
1097 1121
1098 /// Current value of [`DEBLOCK_HITS`].1122 /// Current value of [`DEBLOCK_HITS`].
1123+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1099 pub(crate) fn deblock_hits() -> usize {1124 pub(crate) fn deblock_hits() -> usize {
1100 DEBLOCK_HITS.with(|c| c.get())1125 DEBLOCK_HITS.with(|c| c.get())
1101 }1126 }
@@ -1111,6 +1136,7 @@ thread_local! {
1111 }1136 }
1112 1137
1113 /// Current value of [`UNI_COMP_HITS`].1138 /// Current value of [`UNI_COMP_HITS`].
1139+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1114 pub(crate) fn uni_comp_hits() -> usize {1140 pub(crate) fn uni_comp_hits() -> usize {
1115 UNI_COMP_HITS.with(|c| c.get())1141 UNI_COMP_HITS.with(|c| c.get())
1116 }1142 }
@@ -1125,6 +1151,7 @@ thread_local! {
1125 }1151 }
1126 1152
1127 /// Current value of [`DIFFWTD_HITS`].1153 /// Current value of [`DIFFWTD_HITS`].
1154+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1128 pub(crate) fn diffwtd_hits() -> usize {1155 pub(crate) fn diffwtd_hits() -> usize {
1129 DIFFWTD_HITS.with(|c| c.get())1156 DIFFWTD_HITS.with(|c| c.get())
1130 }1157 }
@@ -1140,6 +1167,7 @@ thread_local! {
1140 }1167 }
1141 1168
1142 /// Current value of [`DIFFWTD_INFERRED_HITS`].1169 /// Current value of [`DIFFWTD_INFERRED_HITS`].
1170+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1143 pub(crate) fn diffwtd_inferred_hits() -> usize {1171 pub(crate) fn diffwtd_inferred_hits() -> usize {
1144 DIFFWTD_INFERRED_HITS.with(|c| c.get())1172 DIFFWTD_INFERRED_HITS.with(|c| c.get())
1145 }1173 }
@@ -1156,6 +1184,7 @@ thread_local! {
1156 }1184 }
1157 1185
1158 /// Current value of [`FWD_KF_HITS`].1186 /// Current value of [`FWD_KF_HITS`].
1187+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1159 pub(crate) fn fwd_kf_hits() -> usize {1188 pub(crate) fn fwd_kf_hits() -> usize {
1160 FWD_KF_HITS.with(|c| c.get())1189 FWD_KF_HITS.with(|c| c.get())
1161 }1190 }
@@ -1189,11 +1218,13 @@ thread_local! {
1189 }1218 }
1190 1219
1191 /// Current value of [`SQ_CHROMA_TX_HITS`].1220 /// Current value of [`SQ_CHROMA_TX_HITS`].
1221+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1192 pub(crate) fn sq_chroma_tx_hits() -> usize {1222 pub(crate) fn sq_chroma_tx_hits() -> usize {
1193 SQ_CHROMA_TX_HITS.with(|c| c.get())1223 SQ_CHROMA_TX_HITS.with(|c| c.get())
1194 }1224 }
1195 1225
1196 /// Current value of [`TX_DEPTH_HITS`].1226 /// Current value of [`TX_DEPTH_HITS`].
1227+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1197 pub(crate) fn tx_depth_hits() -> usize {1228 pub(crate) fn tx_depth_hits() -> usize {
1198 TX_DEPTH_HITS.with(|c| c.get())1229 TX_DEPTH_HITS.with(|c| c.get())
1199 }1230 }
@@ -1237,21 +1268,25 @@ thread_local! {
1237 }1268 }
1238 1269
1239 /// Current value of [`TXFM_SPLIT_READS`].1270 /// Current value of [`TXFM_SPLIT_READS`].
1271+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1240 pub(crate) fn txfm_split_reads() -> usize {1272 pub(crate) fn txfm_split_reads() -> usize {
1241 TXFM_SPLIT_READS.with(|c| c.get())1273 TXFM_SPLIT_READS.with(|c| c.get())
1242 }1274 }
1243 1275
1244 /// Current value of [`TXFM_SPLIT_HITS`].1276 /// Current value of [`TXFM_SPLIT_HITS`].
1277+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1245 pub(crate) fn txfm_split_hits() -> usize {1278 pub(crate) fn txfm_split_hits() -> usize {
1246 TXFM_SPLIT_HITS.with(|c| c.get())1279 TXFM_SPLIT_HITS.with(|c| c.get())
1247 }1280 }
1248 1281
1249 /// Current value of [`INTER_LEAF16_HORZ_HITS`] (lane-inter4 r3).1282 /// Current value of [`INTER_LEAF16_HORZ_HITS`] (lane-inter4 r3).
1283+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1250 pub(crate) fn inter_leaf16_horz_hits() -> usize {1284 pub(crate) fn inter_leaf16_horz_hits() -> usize {
1251 INTER_LEAF16_HORZ_HITS.with(|c| c.get())1285 INTER_LEAF16_HORZ_HITS.with(|c| c.get())
1252 }1286 }
1253 1287
1254 /// Current value of [`INTER_LEAF16_VERT_HITS`] (lane-inter4 r3).1288 /// Current value of [`INTER_LEAF16_VERT_HITS`] (lane-inter4 r3).
1289+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1255 pub(crate) fn inter_leaf16_vert_hits() -> usize {1290 pub(crate) fn inter_leaf16_vert_hits() -> usize {
1256 INTER_LEAF16_VERT_HITS.with(|c| c.get())1291 INTER_LEAF16_VERT_HITS.with(|c| c.get())
1257 }1292 }
@@ -1328,6 +1363,7 @@ thread_local! {
1328 }1363 }
1329 1364
1330 /// Current value of [`VERT_B_INTRA_HITS`].1365 /// Current value of [`VERT_B_INTRA_HITS`].
1366+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1331 pub(crate) fn vert_b_intra_hits() -> usize {1367 pub(crate) fn vert_b_intra_hits() -> usize {
1332 VERT_B_INTRA_HITS.with(|c| c.get())1368 VERT_B_INTRA_HITS.with(|c| c.get())
1333 }1369 }
@@ -1342,7 +1378,7 @@ thread_local! {
1342 static AB16_HITS: std::cell::Cell<[usize; 4]> = const { std::cell::Cell::new([0; 4]) };1378 static AB16_HITS: std::cell::Cell<[usize; 4]> = const { std::cell::Cell::new([0; 4]) };
1343 }1379 }
1344 1380
1345-/// [`AB16_HITS`] per arm (HORZ_A, HORZ_B, VERT_A, VERT_B at 16x16).1381+// [`AB16_HITS`] per arm (HORZ_A, HORZ_B, VERT_A, VERT_B at 16x16).
1346 thread_local! {1382 thread_local! {
1347 /// 4x4 transform units decoded inside an 8x8 square of a1383 /// 4x4 transform units decoded inside an 8x8 square of a
1348 /// `PARTITION_VERT_A`/`_B` -- the exact call that panicked before1384 /// `PARTITION_VERT_A`/`_B` -- the exact call that panicked before
@@ -1351,10 +1387,12 @@ thread_local! {
1351 static VERT_AB_TX4_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };1387 static VERT_AB_TX4_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
1352 }1388 }
1353 1389
1390+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1354 pub(crate) fn vert_ab_tx4_hits() -> usize {1391 pub(crate) fn vert_ab_tx4_hits() -> usize {
1355 VERT_AB_TX4_HITS.with(std::cell::Cell::get)1392 VERT_AB_TX4_HITS.with(std::cell::Cell::get)
1356 }1393 }
1357 1394
1395+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1358 pub(crate) fn ab16_hits_by_arm() -> [usize; 4] {1396 pub(crate) fn ab16_hits_by_arm() -> [usize; 4] {
1359 AB16_HITS.with(std::cell::Cell::get)1397 AB16_HITS.with(std::cell::Cell::get)
1360 }1398 }
@@ -1379,6 +1417,7 @@ thread_local! {
1379 }1417 }
1380 1418
1381 /// Current value of [`HORZ_VERT_INTRA_HITS`].1419 /// Current value of [`HORZ_VERT_INTRA_HITS`].
1420+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1382 pub(crate) fn horz_vert_intra_hits() -> usize {1421 pub(crate) fn horz_vert_intra_hits() -> usize {
1383 HORZ_VERT_INTRA_HITS.with(|c| c.get())1422 HORZ_VERT_INTRA_HITS.with(|c| c.get())
1384 }1423 }
@@ -1394,6 +1433,7 @@ thread_local! {
1394 }1433 }
1395 1434
1396 /// Current value of [`EDGE_RECT_STRIP_HITS`].1435 /// Current value of [`EDGE_RECT_STRIP_HITS`].
1436+#[allow(dead_code)] // gate counter accessor with no reader yet; the counter itself is live
1397 pub(crate) fn edge_rect_strip_hits() -> usize {1437 pub(crate) fn edge_rect_strip_hits() -> usize {
1398 EDGE_RECT_STRIP_HITS.with(|c| c.get())1438 EDGE_RECT_STRIP_HITS.with(|c| c.get())
1399 }1439 }
@@ -1447,11 +1487,13 @@ pub fn reset_inter_edge_strip_hits() {
1447 }1487 }
1448 1488
1449 /// Current value of [`EDGE_BOTH_CUT_HITS`] (`[16, 32, 64, 128]` levels).1489 /// Current value of [`EDGE_BOTH_CUT_HITS`] (`[16, 32, 64, 128]` levels).
1490+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1450 pub(crate) fn edge_both_cut_hits() -> [usize; 4] {1491 pub(crate) fn edge_both_cut_hits() -> [usize; 4] {
1451 EDGE_BOTH_CUT_HITS.with(|c| c.get())1492 EDGE_BOTH_CUT_HITS.with(|c| c.get())
1452 }1493 }
1453 1494
1454 /// Zeroes [`EDGE_BOTH_CUT_HITS`] so a gate can measure a per-attempt delta.1495 /// Zeroes [`EDGE_BOTH_CUT_HITS`] so a gate can measure a per-attempt delta.
1496+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1455 pub(crate) fn reset_edge_both_cut_hits() {1497 pub(crate) fn reset_edge_both_cut_hits() {
1456 EDGE_BOTH_CUT_HITS.with(|c| c.set([0; 4]));1498 EDGE_BOTH_CUT_HITS.with(|c| c.set([0; 4]));
1457 }1499 }
@@ -1466,6 +1508,7 @@ thread_local! {
1466 }1508 }
1467 1509
1468 /// Current value of [`RECT_SPLIT_TX_HITS`].1510 /// Current value of [`RECT_SPLIT_TX_HITS`].
1511+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1469 pub(crate) fn rect_split_tx_hits() -> usize {1512 pub(crate) fn rect_split_tx_hits() -> usize {
1470 RECT_SPLIT_TX_HITS.with(|c| c.get())1513 RECT_SPLIT_TX_HITS.with(|c| c.get())
1471 }1514 }
@@ -1482,6 +1525,7 @@ thread_local! {
1482 }1525 }
1483 1526
1484 /// Current value of [`RECT_SPLIT_SB_INTERIOR_TU_HITS`].1527 /// Current value of [`RECT_SPLIT_SB_INTERIOR_TU_HITS`].
1528+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1485 pub(crate) fn rect_split_sb_interior_tu_hits() -> usize {1529 pub(crate) fn rect_split_sb_interior_tu_hits() -> usize {
1486 RECT_SPLIT_SB_INTERIOR_TU_HITS.with(|c| c.get())1530 RECT_SPLIT_SB_INTERIOR_TU_HITS.with(|c| c.get())
1487 }1531 }
@@ -1498,6 +1542,7 @@ thread_local! {
1498 }1542 }
1499 1543
1500 /// Current value of [`RECT_SPLIT_CHROMA_SHAPE_HITS`] (32x8, 8x32, 8x4, 4x8).1544 /// Current value of [`RECT_SPLIT_CHROMA_SHAPE_HITS`] (32x8, 8x32, 8x4, 4x8).
1545+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1501 pub(crate) fn rect_split_chroma_shape_hits() -> [usize; 4] {1546 pub(crate) fn rect_split_chroma_shape_hits() -> [usize; 4] {
1502 RECT_SPLIT_CHROMA_SHAPE_HITS.with(|c| c.get())1547 RECT_SPLIT_CHROMA_SHAPE_HITS.with(|c| c.get())
1503 }1548 }
@@ -1512,6 +1557,7 @@ thread_local! {
1512 }1557 }
1513 1558
1514 /// Current value of [`FILTER_INTRA_RECT_HITS`].1559 /// Current value of [`FILTER_INTRA_RECT_HITS`].
1560+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1515 pub(crate) fn filter_intra_rect_hits() -> usize {1561 pub(crate) fn filter_intra_rect_hits() -> usize {
1516 FILTER_INTRA_RECT_HITS.with(|c| c.get())1562 FILTER_INTRA_RECT_HITS.with(|c| c.get())
1517 }1563 }
@@ -1532,11 +1578,13 @@ thread_local! {
1532 }1578 }
1533 1579
1534 /// Current value of [`FILTER_INTRA_RECT4_HORZ_HITS`] (32x8 strips).1580 /// Current value of [`FILTER_INTRA_RECT4_HORZ_HITS`] (32x8 strips).
1581+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1535 pub(crate) fn filter_intra_rect4_horz_hits() -> usize {1582 pub(crate) fn filter_intra_rect4_horz_hits() -> usize {
1536 FILTER_INTRA_RECT4_HORZ_HITS.with(|c| c.get())1583 FILTER_INTRA_RECT4_HORZ_HITS.with(|c| c.get())
1537 }1584 }
1538 1585
1539 /// Current value of [`FILTER_INTRA_RECT4_VERT_HITS`] (8x32 strips).1586 /// Current value of [`FILTER_INTRA_RECT4_VERT_HITS`] (8x32 strips).
1587+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1540 pub(crate) fn filter_intra_rect4_vert_hits() -> usize {1588 pub(crate) fn filter_intra_rect4_vert_hits() -> usize {
1541 FILTER_INTRA_RECT4_VERT_HITS.with(|c| c.get())1589 FILTER_INTRA_RECT4_VERT_HITS.with(|c| c.get())
1542 }1590 }
@@ -1551,6 +1599,7 @@ thread_local! {
1551 }1599 }
1552 1600
1553 /// Current value of [`RECT_COEFF_TU_HITS`].1601 /// Current value of [`RECT_COEFF_TU_HITS`].
1602+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1554 pub(crate) fn rect_coeff_tu_hits() -> usize {1603 pub(crate) fn rect_coeff_tu_hits() -> usize {
1555 RECT_COEFF_TU_HITS.with(|c| c.get())1604 RECT_COEFF_TU_HITS.with(|c| c.get())
1556 }1605 }
@@ -1559,6 +1608,7 @@ pub(crate) fn rect_coeff_tu_hits() -> usize {
1559 /// (`V_DCT`/`H_DCT`) -- [`TX_CLASS1_HITS`]'s rect-only half, so a gate can1608 /// (`V_DCT`/`H_DCT`) -- [`TX_CLASS1_HITS`]'s rect-only half, so a gate can
1560 /// pin that the 1D-class-on-a-RECT-transform path fired rather than settling1609 /// pin that the 1D-class-on-a-RECT-transform path fired rather than settling
1561 /// for the square reader's own 1D types.1610 /// for the square reader's own 1D types.
1611+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1562 pub(crate) fn rect_class1_hits() -> usize {1612 pub(crate) fn rect_class1_hits() -> usize {
1563 RECT_CLASS1_HITS.with(|c| c.get())1613 RECT_CLASS1_HITS.with(|c| c.get())
1564 }1614 }
@@ -1574,6 +1624,7 @@ thread_local! {
1574 }1624 }
1575 1625
1576 /// Current value of [`FILTER_INTRA_RECT_SUB16_HITS`].1626 /// Current value of [`FILTER_INTRA_RECT_SUB16_HITS`].
1627+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1577 pub(crate) fn filter_intra_rect_sub16_hits() -> usize {1628 pub(crate) fn filter_intra_rect_sub16_hits() -> usize {
1578 FILTER_INTRA_RECT_SUB16_HITS.with(|c| c.get())1629 FILTER_INTRA_RECT_SUB16_HITS.with(|c| c.get())
1579 }1630 }
@@ -1587,6 +1638,7 @@ thread_local! {
1587 }1638 }
1588 1639
1589 /// Current value of [`FILTER_INTRA_RECT_SUB8_HITS`].1640 /// Current value of [`FILTER_INTRA_RECT_SUB8_HITS`].
1641+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1590 pub(crate) fn filter_intra_rect_sub8_hits() -> usize {1642 pub(crate) fn filter_intra_rect_sub8_hits() -> usize {
1591 FILTER_INTRA_RECT_SUB8_HITS.with(|c| c.get())1643 FILTER_INTRA_RECT_SUB8_HITS.with(|c| c.get())
1592 }1644 }
@@ -1612,6 +1664,7 @@ thread_local! {
1612 }1664 }
1613 1665
1614 /// Current value of [`DIRECTIONAL_UV_HITS`].1666 /// Current value of [`DIRECTIONAL_UV_HITS`].
1667+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1615 pub(crate) fn directional_uv_hits() -> usize {1668 pub(crate) fn directional_uv_hits() -> usize {
1616 DIRECTIONAL_UV_HITS.with(|c| c.get())1669 DIRECTIONAL_UV_HITS.with(|c| c.get())
1617 }1670 }
@@ -1637,6 +1690,7 @@ thread_local! {
1637 }1690 }
1638 1691
1639 /// Current value of [`NON_LAST_REF_HITS`].1692 /// Current value of [`NON_LAST_REF_HITS`].
1693+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1640 pub(crate) fn non_last_ref_hits() -> usize {1694 pub(crate) fn non_last_ref_hits() -> usize {
1641 NON_LAST_REF_HITS.with(|c| c.get())1695 NON_LAST_REF_HITS.with(|c| c.get())
1642 }1696 }
@@ -1683,6 +1737,7 @@ thread_local! {
1683 }1737 }
1684 1738
1685 /// Current value of [`COMP_MODE_HITS`].1739 /// Current value of [`COMP_MODE_HITS`].
1740+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1686 pub(crate) fn comp_mode_hits() -> usize {1741 pub(crate) fn comp_mode_hits() -> usize {
1687 COMP_MODE_HITS.with(|c| c.get())1742 COMP_MODE_HITS.with(|c| c.get())
1688 }1743 }
@@ -1697,6 +1752,7 @@ thread_local! {
1697 }1752 }
1698 1753
1699 /// Current value of [`PALETTE_HITS`].1754 /// Current value of [`PALETTE_HITS`].
1755+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1700 pub(crate) fn palette_hits() -> usize {1756 pub(crate) fn palette_hits() -> usize {
1701 PALETTE_HITS.with(|c| c.get())1757 PALETTE_HITS.with(|c| c.get())
1702 }1758 }
@@ -1710,6 +1766,7 @@ thread_local! {
1710 }1766 }
1711 1767
1712 /// Current value of [`PALETTE_TILE_LEFT_HITS`].1768 /// Current value of [`PALETTE_TILE_LEFT_HITS`].
1769+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1713 pub(crate) fn palette_tile_left_hits() -> usize {1770 pub(crate) fn palette_tile_left_hits() -> usize {
1714 PALETTE_TILE_LEFT_HITS.with(|c| c.get())1771 PALETTE_TILE_LEFT_HITS.with(|c| c.get())
1715 }1772 }
@@ -1722,6 +1779,7 @@ thread_local! {
1722 }1779 }
1723 1780
1724 /// Current value of [`PALETTE_UV_HITS`].1781 /// Current value of [`PALETTE_UV_HITS`].
1782+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1725 pub(crate) fn palette_uv_hits() -> usize {1783 pub(crate) fn palette_uv_hits() -> usize {
1726 PALETTE_UV_HITS.with(|c| c.get())1784 PALETTE_UV_HITS.with(|c| c.get())
1727 }1785 }
@@ -1734,6 +1792,7 @@ thread_local! {
1734 }1792 }
1735 1793
1736 /// Current value of [`PALETTE_RECT_HITS`].1794 /// Current value of [`PALETTE_RECT_HITS`].
1795+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1737 pub(crate) fn palette_rect_hits() -> usize {1796 pub(crate) fn palette_rect_hits() -> usize {
1738 PALETTE_RECT_HITS.with(|c| c.get())1797 PALETTE_RECT_HITS.with(|c| c.get())
1739 }1798 }
@@ -1753,6 +1812,7 @@ thread_local! {
1753 }1812 }
1754 1813
1755 /// Current value of [`RECT_SCREEN_CONTENT_HITS`].1814 /// Current value of [`RECT_SCREEN_CONTENT_HITS`].
1815+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1756 pub(crate) fn rect_screen_content_hits() -> usize {1816 pub(crate) fn rect_screen_content_hits() -> usize {
1757 RECT_SCREEN_CONTENT_HITS.with(|c| c.get())1817 RECT_SCREEN_CONTENT_HITS.with(|c| c.get())
1758 }1818 }
@@ -1774,11 +1834,13 @@ thread_local! {
1774 }1834 }
1775 1835
1776 /// Current value of [`RECT4_PALETTE_HITS`].1836 /// Current value of [`RECT4_PALETTE_HITS`].
1837+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1777 pub(crate) fn rect4_palette_hits() -> usize {1838 pub(crate) fn rect4_palette_hits() -> usize {
1778 RECT4_PALETTE_HITS.with(|c| c.get())1839 RECT4_PALETTE_HITS.with(|c| c.get())
1779 }1840 }
1780 1841
1781 /// Current value of [`PALETTE_SPLIT_TX_HITS`].1842 /// Current value of [`PALETTE_SPLIT_TX_HITS`].
1843+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1782 pub(crate) fn palette_split_tx_hits() -> usize {1844 pub(crate) fn palette_split_tx_hits() -> usize {
1783 PALETTE_SPLIT_TX_HITS.with(|c| c.get())1845 PALETTE_SPLIT_TX_HITS.with(|c| c.get())
1784 }1846 }
@@ -1792,11 +1854,13 @@ thread_local! {
1792 }1854 }
1793 1855
1794 /// Current value of [`PALETTE_LEAF8_HITS`].1856 /// Current value of [`PALETTE_LEAF8_HITS`].
1857+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1795 pub(crate) fn palette_leaf8_hits() -> usize {1858 pub(crate) fn palette_leaf8_hits() -> usize {
1796 PALETTE_LEAF8_HITS.with(|c| c.get())1859 PALETTE_LEAF8_HITS.with(|c| c.get())
1797 }1860 }
1798 1861
1799 /// Zeroes [`PALETTE_LEAF8_HITS`] (per-attempt gate counting).1862 /// Zeroes [`PALETTE_LEAF8_HITS`] (per-attempt gate counting).
1863+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1800 pub(crate) fn reset_palette_leaf8_hits() {1864 pub(crate) fn reset_palette_leaf8_hits() {
1801 PALETTE_LEAF8_HITS.with(|c| c.set(0));1865 PALETTE_LEAF8_HITS.with(|c| c.set(0));
1802 }1866 }
@@ -1809,11 +1873,13 @@ thread_local! {
1809 }1873 }
1810 1874
1811 /// Current value of [`PALETTE_SB_STRIP_HITS`].1875 /// Current value of [`PALETTE_SB_STRIP_HITS`].
1876+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1812 pub(crate) fn palette_sb_strip_hits() -> usize {1877 pub(crate) fn palette_sb_strip_hits() -> usize {
1813 PALETTE_SB_STRIP_HITS.with(|c| c.get())1878 PALETTE_SB_STRIP_HITS.with(|c| c.get())
1814 }1879 }
1815 1880
1816 /// Zeroes [`PALETTE_SB_STRIP_HITS`] (per-attempt gate counting).1881 /// Zeroes [`PALETTE_SB_STRIP_HITS`] (per-attempt gate counting).
1882+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1817 pub(crate) fn reset_palette_sb_strip_hits() {1883 pub(crate) fn reset_palette_sb_strip_hits() {
1818 PALETTE_SB_STRIP_HITS.with(|c| c.set(0));1884 PALETTE_SB_STRIP_HITS.with(|c| c.set(0));
1819 }1885 }
@@ -1877,6 +1943,7 @@ thread_local! {
1877 }1943 }
1878 1944
1879 /// Current value of [`INTRA_IN_INTER_SPLIT_TX_HITS`], indexed 8/16/32/64.1945 /// Current value of [`INTRA_IN_INTER_SPLIT_TX_HITS`], indexed 8/16/32/64.
1946+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1880 pub(crate) fn intra_in_inter_split_tx_hits() -> [usize; 4] {1947 pub(crate) fn intra_in_inter_split_tx_hits() -> [usize; 4] {
1881 INTRA_IN_INTER_SPLIT_TX_HITS.with(std::cell::Cell::get)1948 INTRA_IN_INTER_SPLIT_TX_HITS.with(std::cell::Cell::get)
1882 }1949 }
@@ -1975,6 +2042,7 @@ pub(crate) fn rect_intrabc_reads() -> usize {
1975 }2042 }
1976 2043
1977 /// Zeroes [`RECT_INTRABC_READS`] (gate tests call this before a decode).2044 /// Zeroes [`RECT_INTRABC_READS`] (gate tests call this before a decode).
2045+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1978 pub(crate) fn reset_rect_intrabc_reads() {2046 pub(crate) fn reset_rect_intrabc_reads() {
1979 RECT_INTRABC_READS.with(|c| c.set(0));2047 RECT_INTRABC_READS.with(|c| c.set(0));
1980 }2048 }
@@ -1991,16 +2059,19 @@ pub(crate) fn leaf8_intrabc_hits() -> usize {
1991 }2059 }
1992 2060
1993 /// Zeroes [`LEAF8_INTRABC_HITS`] (gate tests call this before a decode).2061 /// Zeroes [`LEAF8_INTRABC_HITS`] (gate tests call this before a decode).
2062+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1994 pub(crate) fn reset_leaf8_intrabc_hits() {2063 pub(crate) fn reset_leaf8_intrabc_hits() {
1995 LEAF8_INTRABC_HITS.with(|c| c.set(0));2064 LEAF8_INTRABC_HITS.with(|c| c.set(0));
1996 }2065 }
1997 2066
1998 /// Current value of [`INTRABC_HITS`].2067 /// Current value of [`INTRABC_HITS`].
2068+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1999 pub(crate) fn intrabc_hits() -> usize {2069 pub(crate) fn intrabc_hits() -> usize {
2000 INTRABC_HITS.with(|c| c.get())2070 INTRABC_HITS.with(|c| c.get())
2001 }2071 }
2002 2072
2003 /// Zeroes [`INTRABC_HITS`] (gate tests call this before a decode).2073 /// Zeroes [`INTRABC_HITS`] (gate tests call this before a decode).
2074+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2004 pub(crate) fn reset_intrabc_hits() {2075 pub(crate) fn reset_intrabc_hits() {
2005 INTRABC_HITS.with(|c| c.set(0));2076 INTRABC_HITS.with(|c| c.set(0));
2006 }2077 }
@@ -2013,11 +2084,13 @@ thread_local! {
2013 }2084 }
2014 2085
2015 /// Current value of [`INTRABC_VARTX_HITS`].2086 /// Current value of [`INTRABC_VARTX_HITS`].
2087+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2016 pub(crate) fn intrabc_vartx_hits() -> usize {2088 pub(crate) fn intrabc_vartx_hits() -> usize {
2017 INTRABC_VARTX_HITS.with(|c| c.get())2089 INTRABC_VARTX_HITS.with(|c| c.get())
2018 }2090 }
2019 2091
2020 /// Zeroes [`INTRABC_VARTX_HITS`] (gate tests call this before a decode).2092 /// Zeroes [`INTRABC_VARTX_HITS`] (gate tests call this before a decode).
2093+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2021 pub(crate) fn reset_intrabc_vartx_hits() {2094 pub(crate) fn reset_intrabc_vartx_hits() {
2022 INTRABC_VARTX_HITS.with(|c| c.set(0));2095 INTRABC_VARTX_HITS.with(|c| c.set(0));
2023 }2096 }
@@ -2061,6 +2134,7 @@ thread_local! {
2061 }2134 }
2062 2135
2063 /// Current value of [`SKIP_MODE_HITS`].2136 /// Current value of [`SKIP_MODE_HITS`].
2137+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2064 pub(crate) fn skip_mode_hits() -> usize {2138 pub(crate) fn skip_mode_hits() -> usize {
2065 SKIP_MODE_HITS.with(|c| c.get())2139 SKIP_MODE_HITS.with(|c| c.get())
2066 }2140 }
@@ -2092,7 +2166,7 @@ pub fn fimv_alphabet_hits() -> usize {
2092 }2166 }
2093 2167
2094 // lane-fimv r1: how many frame headers this decoder has decoded with2168 // lane-fimv r1: how many frame headers this decoder has decoded with
2095-/// `force_integer_mv == 1` (bumped by `stream.rs` per frame). Lets a gate2169+// `force_integer_mv == 1` (bumped by `stream.rs` per frame). Lets a gate
2096 // prove the encoder really produced the header state under test rather than2170 // prove the encoder really produced the header state under test rather than
2097 // assume it.2171 // assume it.
2098 thread_local! {2172 thread_local! {
@@ -2111,6 +2185,7 @@ pub fn note_force_integer_mv_frame() {
2111 }2185 }
2112 2186
2113 /// Current value of [`OBMC_HITS`].2187 /// Current value of [`OBMC_HITS`].
2188+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2114 pub(crate) fn obmc_hits() -> usize {2189 pub(crate) fn obmc_hits() -> usize {
2115 OBMC_HITS.with(|c| c.get())2190 OBMC_HITS.with(|c| c.get())
2116 }2191 }
@@ -2126,6 +2201,7 @@ thread_local! {
2126 }2201 }
2127 2202
2128 /// Current value of [`OBMC_FILTER_BAND_READS`].2203 /// Current value of [`OBMC_FILTER_BAND_READS`].
2204+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2129 pub(crate) fn obmc_filter_band_reads() -> usize {2205 pub(crate) fn obmc_filter_band_reads() -> usize {
2130 OBMC_FILTER_BAND_READS.with(|c| c.get())2206 OBMC_FILTER_BAND_READS.with(|c| c.get())
2131 }2207 }
@@ -2149,6 +2225,7 @@ thread_local! {
2149 2225
2150 /// Current value of [`MIXED_SCALE_COMPOUND_HITS`]: compound blocks with one2226 /// Current value of [`MIXED_SCALE_COMPOUND_HITS`]: compound blocks with one
2151 /// scaled and one unscaled tap.2227 /// scaled and one unscaled tap.
2228+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2152 pub(crate) fn mixed_scale_compound_hits() -> usize {2229 pub(crate) fn mixed_scale_compound_hits() -> usize {
2153 MIXED_SCALE_COMPOUND_HITS.with(|c| c.get())2230 MIXED_SCALE_COMPOUND_HITS.with(|c| c.get())
2154 }2231 }
@@ -2157,11 +2234,13 @@ pub(crate) fn mixed_scale_compound_hits() -> usize {
2157 /// read the 3-symbol `motion_mode_cdf` but read the 2-symbol `obmc_cdf`2234 /// read the 3-symbol `motion_mode_cdf` but read the 2-symbol `obmc_cdf`
2158 /// instead because their reference is scaled (libaom `motion_mode_allowed`,2235 /// instead because their reference is scaled (libaom `motion_mode_allowed`,
2159 /// `blockd.h:1484`).2236 /// `blockd.h:1484`).
2237+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2160 pub(crate) fn scaled_warp_suppressed_hits() -> usize {2238 pub(crate) fn scaled_warp_suppressed_hits() -> usize {
2161 SCALED_WARP_SUPPRESSED_HITS.with(|c| c.get())2239 SCALED_WARP_SUPPRESSED_HITS.with(|c| c.get())
2162 }2240 }
2163 2241
2164 /// Current value of [`SCALED_COMPOUND_HITS`].2242 /// Current value of [`SCALED_COMPOUND_HITS`].
2243+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2165 pub(crate) fn scaled_compound_hits() -> usize {2244 pub(crate) fn scaled_compound_hits() -> usize {
2166 SCALED_COMPOUND_HITS.with(|c| c.get())2245 SCALED_COMPOUND_HITS.with(|c| c.get())
2167 }2246 }
@@ -2172,16 +2251,19 @@ pub fn scaled_warp_fallback_hits() -> usize {
2172 }2251 }
2173 2252
2174 /// Current value of [`SCALED_OBMC_HITS`].2253 /// Current value of [`SCALED_OBMC_HITS`].
2254+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2175 pub(crate) fn scaled_obmc_hits() -> usize {2255 pub(crate) fn scaled_obmc_hits() -> usize {
2176 SCALED_OBMC_HITS.with(|c| c.get())2256 SCALED_OBMC_HITS.with(|c| c.get())
2177 }2257 }
2178 2258
2179 /// Current value of [`SCALED_INTERINTRA_HITS`].2259 /// Current value of [`SCALED_INTERINTRA_HITS`].
2260+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2180 pub(crate) fn scaled_interintra_hits() -> usize {2261 pub(crate) fn scaled_interintra_hits() -> usize {
2181 SCALED_INTERINTRA_HITS.with(|c| c.get())2262 SCALED_INTERINTRA_HITS.with(|c| c.get())
2182 }2263 }
2183 2264
2184 /// Current value of [`SCALED_BLOCK8_HITS`].2265 /// Current value of [`SCALED_BLOCK8_HITS`].
2266+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2185 pub(crate) fn scaled_block8_hits() -> usize {2267 pub(crate) fn scaled_block8_hits() -> usize {
2186 SCALED_BLOCK8_HITS.with(|c| c.get())2268 SCALED_BLOCK8_HITS.with(|c| c.get())
2187 }2269 }
@@ -2211,11 +2293,13 @@ thread_local! {
2211 }2293 }
2212 2294
2213 /// Current value of [`DUAL_FILTER_DIFF_HITS`].2295 /// Current value of [`DUAL_FILTER_DIFF_HITS`].
2296+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2214 pub(crate) fn dual_filter_diff_hits() -> usize {2297 pub(crate) fn dual_filter_diff_hits() -> usize {
2215 DUAL_FILTER_DIFF_HITS.with(|c| c.get())2298 DUAL_FILTER_DIFF_HITS.with(|c| c.get())
2216 }2299 }
2217 2300
2218 /// Current value of [`COMPOUND8_FILTER_HITS`].2301 /// Current value of [`COMPOUND8_FILTER_HITS`].
2302+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2219 pub(crate) fn compound8_filter_hits() -> usize {2303 pub(crate) fn compound8_filter_hits() -> usize {
2220 COMPOUND8_FILTER_HITS.with(|c| c.get())2304 COMPOUND8_FILTER_HITS.with(|c| c.get())
2221 }2305 }
@@ -2232,6 +2316,7 @@ thread_local! {
2232 }2316 }
2233 2317
2234 /// Current value of [`WARP_SELECTED_HITS`].2318 /// Current value of [`WARP_SELECTED_HITS`].
2319+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2235 pub(crate) fn warp_selected_hits() -> usize {2320 pub(crate) fn warp_selected_hits() -> usize {
2236 WARP_SELECTED_HITS.with(|c| c.get())2321 WARP_SELECTED_HITS.with(|c| c.get())
2237 }2322 }
@@ -2247,6 +2332,7 @@ thread_local! {
2247 }2332 }
2248 2333
2249 /// Current value of [`COMPOUND_WARP_HITS`].2334 /// Current value of [`COMPOUND_WARP_HITS`].
2335+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2250 pub(crate) fn compound_warp_hits() -> usize {2336 pub(crate) fn compound_warp_hits() -> usize {
2251 COMPOUND_WARP_HITS.with(|c| c.get())2337 COMPOUND_WARP_HITS.with(|c| c.get())
2252 }2338 }
@@ -2261,6 +2347,7 @@ thread_local! {
2261 }2347 }
2262 2348
2263 /// Current value of [`COMPOUND_WARP_HITS_8`].2349 /// Current value of [`COMPOUND_WARP_HITS_8`].
2350+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2264 pub(crate) fn compound_warp_hits_8() -> usize {2351 pub(crate) fn compound_warp_hits_8() -> usize {
2265 COMPOUND_WARP_HITS_8.with(|c| c.get())2352 COMPOUND_WARP_HITS_8.with(|c| c.get())
2266 }2353 }
@@ -2276,6 +2363,7 @@ thread_local! {
2276 }2363 }
2277 2364
2278 /// Current value of [`AFFINE_GM_HITS`].2365 /// Current value of [`AFFINE_GM_HITS`].
2366+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2279 pub(crate) fn affine_gm_hits() -> usize {2367 pub(crate) fn affine_gm_hits() -> usize {
2280 AFFINE_GM_HITS.with(|c| c.get())2368 AFFINE_GM_HITS.with(|c| c.get())
2281 }2369 }
@@ -2321,11 +2409,13 @@ thread_local! {
2321 }2409 }
2322 2410
2323 /// Current value of [`GLOBALMV_HITS_8`].2411 /// Current value of [`GLOBALMV_HITS_8`].
2412+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2324 pub(crate) fn globalmv_hits_8() -> usize {2413 pub(crate) fn globalmv_hits_8() -> usize {
2325 GLOBALMV_HITS_8.with(|c| c.get())2414 GLOBALMV_HITS_8.with(|c| c.get())
2326 }2415 }
2327 2416
2328 /// Current value of [`WARP_HITS_8`].2417 /// Current value of [`WARP_HITS_8`].
2418+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2329 pub(crate) fn warp_hits_8() -> usize {2419 pub(crate) fn warp_hits_8() -> usize {
2330 WARP_HITS_8.with(|c| c.get())2420 WARP_HITS_8.with(|c| c.get())
2331 }2421 }
@@ -2339,6 +2429,7 @@ thread_local! {
2339 }2429 }
2340 2430
2341 /// Current value of [`INTERINTRA_HITS`].2431 /// Current value of [`INTERINTRA_HITS`].
2432+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2342 pub(crate) fn interintra_hits() -> usize {2433 pub(crate) fn interintra_hits() -> usize {
2343 INTERINTRA_HITS.with(|c| c.get())2434 INTERINTRA_HITS.with(|c| c.get())
2344 }2435 }
@@ -2368,6 +2459,7 @@ thread_local! {
2368 }2459 }
2369 2460
2370 /// Current value of [`MASKED_COMPOUND_HITS`].2461 /// Current value of [`MASKED_COMPOUND_HITS`].
2462+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2371 pub(crate) fn masked_compound_hits() -> usize {2463 pub(crate) fn masked_compound_hits() -> usize {
2372 MASKED_COMPOUND_HITS.with(|c| c.get())2464 MASKED_COMPOUND_HITS.with(|c| c.get())
2373 }2465 }
@@ -2383,6 +2475,7 @@ thread_local! {
2383 }2475 }
2384 2476
2385 /// Current value of [`RECT_MASKED_COMPOUND_HITS`].2477 /// Current value of [`RECT_MASKED_COMPOUND_HITS`].
2478+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2386 pub(crate) fn rect_masked_compound_hits() -> usize {2479 pub(crate) fn rect_masked_compound_hits() -> usize {
2387 RECT_MASKED_COMPOUND_HITS.with(|c| c.get())2480 RECT_MASKED_COMPOUND_HITS.with(|c| c.get())
2388 }2481 }
@@ -2397,6 +2490,7 @@ thread_local! {
2397 }2490 }
2398 2491
2399 /// Current value of [`WEDGE_HITS`].2492 /// Current value of [`WEDGE_HITS`].
2493+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2400 pub(crate) fn wedge_hits() -> usize {2494 pub(crate) fn wedge_hits() -> usize {
2401 WEDGE_HITS.with(|c| c.get())2495 WEDGE_HITS.with(|c| c.get())
2402 }2496 }
@@ -2411,6 +2505,7 @@ thread_local! {
2411 }2505 }
2412 2506
2413 /// Current value of [`WII_HITS`].2507 /// Current value of [`WII_HITS`].
2508+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2414 pub(crate) fn wii_hits() -> usize {2509 pub(crate) fn wii_hits() -> usize {
2415 WII_HITS.with(|c| c.get())2510 WII_HITS.with(|c| c.get())
2416 }2511 }
@@ -2425,6 +2520,7 @@ thread_local! {
2425 }2520 }
2426 2521
2427 /// Current value of [`NOCFL_UV_MODE_HITS`].2522 /// Current value of [`NOCFL_UV_MODE_HITS`].
2523+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2428 pub(crate) fn nocfl_uv_mode_hits() -> usize {2524 pub(crate) fn nocfl_uv_mode_hits() -> usize {
2429 NOCFL_UV_MODE_HITS.with(|c| c.get())2525 NOCFL_UV_MODE_HITS.with(|c| c.get())
2430 }2526 }
@@ -2495,11 +2591,13 @@ thread_local! {
2495 }2591 }
2496 2592
2497 /// Current value of [`OBMC_EDGE_SPAN_HITS`].2593 /// Current value of [`OBMC_EDGE_SPAN_HITS`].
2594+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2498 pub(crate) fn obmc_edge_span_hits() -> usize {2595 pub(crate) fn obmc_edge_span_hits() -> usize {
2499 OBMC_EDGE_SPAN_HITS.with(|c| c.get())2596 OBMC_EDGE_SPAN_HITS.with(|c| c.get())
2500 }2597 }
2501 2598
2502 /// Current value of [`OBMC_HITS_8`].2599 /// Current value of [`OBMC_HITS_8`].
2600+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2503 pub(crate) fn obmc_hits_8() -> usize {2601 pub(crate) fn obmc_hits_8() -> usize {
2504 OBMC_HITS_8.with(|c| c.get())2602 OBMC_HITS_8.with(|c| c.get())
2505 }2603 }
@@ -2517,6 +2615,7 @@ thread_local! {
2517 }2615 }
2518 2616
2519 /// Current value of [`EXTENDED_PARTITION_HITS`].2617 /// Current value of [`EXTENDED_PARTITION_HITS`].
2618+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2520 pub(crate) fn extended_partition_hits() -> usize {2619 pub(crate) fn extended_partition_hits() -> usize {
2521 EXTENDED_PARTITION_HITS.with(|c| c.get())2620 EXTENDED_PARTITION_HITS.with(|c| c.get())
2522 }2621 }
@@ -2531,6 +2630,7 @@ thread_local! {
2531 }2630 }
2532 2631
2533 /// Current value of [`RECT_PARTITION_HITS`].2632 /// Current value of [`RECT_PARTITION_HITS`].
2633+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2534 pub(crate) fn rect_partition_hits() -> usize {2634 pub(crate) fn rect_partition_hits() -> usize {
2535 RECT_PARTITION_HITS.with(|c| c.get())2635 RECT_PARTITION_HITS.with(|c| c.get())
2536 }2636 }
@@ -2580,6 +2680,7 @@ thread_local! {
2580 }2680 }
2581 2681
2582 /// Current value of [`INTER_SB_NONE_HITS`].2682 /// Current value of [`INTER_SB_NONE_HITS`].
2683+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2583 pub(crate) fn inter_sb_none_hits() -> usize {2684 pub(crate) fn inter_sb_none_hits() -> usize {
2584 INTER_SB_NONE_HITS.with(|c| c.get())2685 INTER_SB_NONE_HITS.with(|c| c.get())
2585 }2686 }
@@ -2594,6 +2695,7 @@ thread_local! {
2594 }2695 }
2595 2696
2596 /// Current value of [`INTER_SUB16_SPLIT_HITS`].2697 /// Current value of [`INTER_SUB16_SPLIT_HITS`].
2698+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2597 pub(crate) fn inter_sub16_split_hits() -> usize {2699 pub(crate) fn inter_sub16_split_hits() -> usize {
2598 INTER_SUB16_SPLIT_HITS.with(|c| c.get())2700 INTER_SUB16_SPLIT_HITS.with(|c| c.get())
2599 }2701 }
@@ -2634,6 +2736,7 @@ thread_local! {
2634 }2736 }
2635 2737
2636 /// Current value of [`RECT_COEFF_HITS`].2738 /// Current value of [`RECT_COEFF_HITS`].
2739+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2637 pub(crate) fn rect_coeff_hits() -> usize {2740 pub(crate) fn rect_coeff_hits() -> usize {
2638 RECT_COEFF_HITS.with(|c| c.get())2741 RECT_COEFF_HITS.with(|c| c.get())
2639 }2742 }
@@ -2647,6 +2750,7 @@ thread_local! {
2647 }2750 }
2648 2751
2649 /// Current value of [`RECT_LEAF_COEFF_HITS`].2752 /// Current value of [`RECT_LEAF_COEFF_HITS`].
2753+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2650 pub(crate) fn rect_leaf_coeff_hits() -> usize {2754 pub(crate) fn rect_leaf_coeff_hits() -> usize {
2651 RECT_LEAF_COEFF_HITS.with(|c| c.get())2755 RECT_LEAF_COEFF_HITS.with(|c| c.get())
2652 }2756 }
@@ -2663,6 +2767,7 @@ thread_local! {
2663 2767
2664 /// Current value of [`INTRA_RECT_IN_INTER_HITS`] for one shape class2768 /// Current value of [`INTRA_RECT_IN_INTER_HITS`] for one shape class
2665 /// (0 = 64x32/32x64, 1 = 32x16/16x32, 2 = 16x8/8x16).2769 /// (0 = 64x32/32x64, 1 = 32x16/16x32, 2 = 16x8/8x16).
2770+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2666 pub(crate) fn intra_rect_strip_in_inter_hits(class: usize) -> usize {2771 pub(crate) fn intra_rect_strip_in_inter_hits(class: usize) -> usize {
2667 INTRA_RECT_IN_INTER_HITS.with(|c| c.get()[class])2772 INTRA_RECT_IN_INTER_HITS.with(|c| c.get()[class])
2668 }2773 }
@@ -2703,16 +2808,19 @@ thread_local! {
2703 }2808 }
2704 2809
2705 /// Current value of [`INTRA_RECT_IN_INTER_SCREEN_HITS`].2810 /// Current value of [`INTRA_RECT_IN_INTER_SCREEN_HITS`].
2811+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2706 pub(crate) fn intra_rect_in_inter_screen_hits() -> usize {2812 pub(crate) fn intra_rect_in_inter_screen_hits() -> usize {
2707 INTRA_RECT_IN_INTER_SCREEN_HITS.with(std::cell::Cell::get)2813 INTRA_RECT_IN_INTER_SCREEN_HITS.with(std::cell::Cell::get)
2708 }2814 }
2709 2815
2710 /// Resets [`INTRA_RECT_IN_INTER_SCREEN_HITS`] before a decode.2816 /// Resets [`INTRA_RECT_IN_INTER_SCREEN_HITS`] before a decode.
2817+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2711 pub(crate) fn reset_intra_rect_in_inter_screen_hits() {2818 pub(crate) fn reset_intra_rect_in_inter_screen_hits() {
2712 INTRA_RECT_IN_INTER_SCREEN_HITS.with(|c| c.set(0));2819 INTRA_RECT_IN_INTER_SCREEN_HITS.with(|c| c.set(0));
2713 }2820 }
2714 2821
2715 /// Current value of [`INTRA_RECT_IN_INTER_SPLIT_TX_HITS`], indexed by tx depth.2822 /// Current value of [`INTRA_RECT_IN_INTER_SPLIT_TX_HITS`], indexed by tx depth.
2823+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2716 pub(crate) fn intra_rect_in_inter_split_tx_hits() -> [usize; 3] {2824 pub(crate) fn intra_rect_in_inter_split_tx_hits() -> [usize; 3] {
2717 INTRA_RECT_IN_INTER_SPLIT_TX_HITS.with(std::cell::Cell::get)2825 INTRA_RECT_IN_INTER_SPLIT_TX_HITS.with(std::cell::Cell::get)
2718 }2826 }
@@ -2726,6 +2834,7 @@ thread_local! {
2726 }2834 }
2727 2835
2728 /// Current value of [`INTRA_RECT_IN_INTER_TXCTX_OVERRIDE_HITS`].2836 /// Current value of [`INTRA_RECT_IN_INTER_TXCTX_OVERRIDE_HITS`].
2837+#[allow(dead_code)] // gate counter accessor with no reader yet; the counter itself is live
2729 pub(crate) fn intra_rect_in_inter_txctx_override_hits() -> usize {2838 pub(crate) fn intra_rect_in_inter_txctx_override_hits() -> usize {
2730 INTRA_RECT_IN_INTER_TXCTX_OVERRIDE_HITS.with(std::cell::Cell::get)2839 INTRA_RECT_IN_INTER_TXCTX_OVERRIDE_HITS.with(std::cell::Cell::get)
2731 }2840 }
@@ -2763,6 +2872,7 @@ thread_local! {
2763 }2872 }
2764 2873
2765 /// Current value of [`MODE_MI_OVERRIDE_HITS`].2874 /// Current value of [`MODE_MI_OVERRIDE_HITS`].
2875+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2766 pub(crate) fn mode_mi_override_hits() -> usize {2876 pub(crate) fn mode_mi_override_hits() -> usize {
2767 MODE_MI_OVERRIDE_HITS.with(|c| c.get())2877 MODE_MI_OVERRIDE_HITS.with(|c| c.get())
2768 }2878 }
@@ -2781,6 +2891,7 @@ thread_local! {
2781 }2891 }
2782 2892
2783 /// Current value of [`MODE_TILE_EDGE_COARSE_LEAKS`].2893 /// Current value of [`MODE_TILE_EDGE_COARSE_LEAKS`].
2894+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2784 pub(crate) fn mode_tile_edge_coarse_leaks() -> usize {2895 pub(crate) fn mode_tile_edge_coarse_leaks() -> usize {
2785 MODE_TILE_EDGE_COARSE_LEAKS.with(|c| c.get())2896 MODE_TILE_EDGE_COARSE_LEAKS.with(|c| c.get())
2786 }2897 }
@@ -2795,6 +2906,7 @@ thread_local! {
2795 }2906 }
2796 2907
2797 /// Current value of [`UV_MODE_MI_OVERRIDE_HITS`].2908 /// Current value of [`UV_MODE_MI_OVERRIDE_HITS`].
2909+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2798 pub(crate) fn uv_mode_mi_override_hits() -> usize {2910 pub(crate) fn uv_mode_mi_override_hits() -> usize {
2799 UV_MODE_MI_OVERRIDE_HITS.with(|c| c.get())2911 UV_MODE_MI_OVERRIDE_HITS.with(|c| c.get())
2800 }2912 }
@@ -2825,6 +2937,7 @@ thread_local! {
2825 }2937 }
2826 2938
2827 /// Current value of [`INTER_NEIGHBOUR_NOT_SMOOTH_HITS`].2939 /// Current value of [`INTER_NEIGHBOUR_NOT_SMOOTH_HITS`].
2940+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2828 pub(crate) fn inter_neighbour_not_smooth_hits() -> usize {2941 pub(crate) fn inter_neighbour_not_smooth_hits() -> usize {
2829 INTER_NEIGHBOUR_NOT_SMOOTH_HITS.with(|c| c.get())2942 INTER_NEIGHBOUR_NOT_SMOOTH_HITS.with(|c| c.get())
2830 }2943 }
@@ -2842,6 +2955,7 @@ thread_local! {
2842 }2955 }
2843 2956
2844 /// Current value of [`UV_TILE_EDGE_SUPPRESSED_HITS`].2957 /// Current value of [`UV_TILE_EDGE_SUPPRESSED_HITS`].
2958+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2845 pub(crate) fn uv_tile_edge_suppressed_hits() -> usize {2959 pub(crate) fn uv_tile_edge_suppressed_hits() -> usize {
2846 UV_TILE_EDGE_SUPPRESSED_HITS.with(|c| c.get())2960 UV_TILE_EDGE_SUPPRESSED_HITS.with(|c| c.get())
2847 }2961 }
@@ -2855,11 +2969,13 @@ thread_local! {
2855 }2969 }
2856 2970
2857 /// Current value of [`CFL_BLOCK_HITS`].2971 /// Current value of [`CFL_BLOCK_HITS`].
2972+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2858 pub(crate) fn cfl_block_hits() -> usize {2973 pub(crate) fn cfl_block_hits() -> usize {
2859 CFL_BLOCK_HITS.with(|c| c.get())2974 CFL_BLOCK_HITS.with(|c| c.get())
2860 }2975 }
2861 2976
2862 /// Current value of [`UV_ANGLE_DELTA_HITS`].2977 /// Current value of [`UV_ANGLE_DELTA_HITS`].
2978+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2863 pub(crate) fn uv_angle_delta_hits() -> usize {2979 pub(crate) fn uv_angle_delta_hits() -> usize {
2864 UV_ANGLE_DELTA_HITS.with(|c| c.get())2980 UV_ANGLE_DELTA_HITS.with(|c| c.get())
2865 }2981 }
@@ -2873,7 +2989,7 @@ thread_local! {
2873 const { std::cell::Cell::new(0) };2989 const { std::cell::Cell::new(0) };
2874 }2990 }
2875 2991
2876-/// Current value of [`SB_RECT_HITS`].2992+// Current value of [`SB_RECT_HITS`].
2877 // lane-hgkf r1: the frame-edge partition bit, one level each. Slot 0 = a2993 // lane-hgkf r1: the frame-edge partition bit, one level each. Slot 0 = a
2878 // 64-level gathered edge bit read as HORZ/VERT, 1 = the same bit read as2994 // 64-level gathered edge bit read as HORZ/VERT, 1 = the same bit read as
2879 // SPLIT, 2/3 = the 32-level pair. A gate asserting slot 0 or 2 proves the2995 // SPLIT, 2/3 = the 32-level pair. A gate asserting slot 0 or 2 proves the
@@ -2884,11 +3000,13 @@ thread_local! {
2884 }3000 }
2885 3001
2886 /// Current value of [`EDGE_PART_HITS`].3002 /// Current value of [`EDGE_PART_HITS`].
3003+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2887 pub(crate) fn edge_part_hits() -> [usize; 4] {3004 pub(crate) fn edge_part_hits() -> [usize; 4] {
2888 EDGE_PART_HITS.with(|c| c.get())3005 EDGE_PART_HITS.with(|c| c.get())
2889 }3006 }
2890 3007
2891 /// Reset [`EDGE_PART_HITS`] (a gate counts one stream at a time).3008 /// Reset [`EDGE_PART_HITS`] (a gate counts one stream at a time).
3009+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2892 pub(crate) fn reset_edge_part_hits() {3010 pub(crate) fn reset_edge_part_hits() {
2893 EDGE_PART_HITS.with(|c| c.set([0; 4]));3011 EDGE_PART_HITS.with(|c| c.set([0; 4]));
2894 }3012 }
@@ -2901,6 +3019,7 @@ fn bump_edge_part(slot: usize) {
2901 });3019 });
2902 }3020 }
2903 3021
3022+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2904 pub(crate) fn sb_rect_hits() -> usize {3023 pub(crate) fn sb_rect_hits() -> usize {
2905 SB_RECT_HITS.with(|c| c.get())3024 SB_RECT_HITS.with(|c| c.get())
2906 }3025 }
@@ -2924,6 +3043,7 @@ thread_local! {
2924 }3043 }
2925 3044
2926 /// Current value of [`EDGE32_HITS`].3045 /// Current value of [`EDGE32_HITS`].
3046+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2927 pub(crate) fn edge32_hits() -> [usize; 8] {3047 pub(crate) fn edge32_hits() -> [usize; 8] {
2928 EDGE32_HITS.with(|c| c.get())3048 EDGE32_HITS.with(|c| c.get())
2929 }3049 }
@@ -2954,6 +3074,7 @@ thread_local! {
2954 }3074 }
2955 3075
2956 /// Current value of [`SB_AB_HITS`], summed over the four arms.3076 /// Current value of [`SB_AB_HITS`], summed over the four arms.
3077+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2957 pub(crate) fn sb_ab_hits() -> usize {3078 pub(crate) fn sb_ab_hits() -> usize {
2958 SB_AB_HITS.with(|c| c.get().iter().sum())3079 SB_AB_HITS.with(|c| c.get().iter().sum())
2959 }3080 }
@@ -2962,6 +3083,7 @@ pub(crate) fn sb_ab_hits() -> usize {
2962 /// `_VERT_A`, `_VERT_B` order -- what the gate hard-asserts arm by arm, so a3083 /// `_VERT_A`, `_VERT_B` order -- what the gate hard-asserts arm by arm, so a
2963 /// run where aomenc's RD only ever picked (say) `HORZ_A` cannot pass off as3084 /// run where aomenc's RD only ever picked (say) `HORZ_A` cannot pass off as
2964 /// proof of all four.3085 /// proof of all four.
3086+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2965 pub(crate) fn sb_ab_hits_by_arm() -> [usize; 4] {3087 pub(crate) fn sb_ab_hits_by_arm() -> [usize; 4] {
2966 SB_AB_HITS.with(std::cell::Cell::get)3088 SB_AB_HITS.with(std::cell::Cell::get)
2967 }3089 }
@@ -2977,11 +3099,13 @@ thread_local! {
2977 }3099 }
2978 3100
2979 /// Current value of `SB_RECT4_HORZ_HITS` (64x16 strips decoded).3101 /// Current value of `SB_RECT4_HORZ_HITS` (64x16 strips decoded).
3102+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2980 pub(crate) fn sb_rect4_horz_hits() -> usize {3103 pub(crate) fn sb_rect4_horz_hits() -> usize {
2981 SB_RECT4_HORZ_HITS.with(|c| c.get())3104 SB_RECT4_HORZ_HITS.with(|c| c.get())
2982 }3105 }
2983 3106
2984 /// Current value of `SB_RECT4_VERT_HITS` (16x64 strips decoded).3107 /// Current value of `SB_RECT4_VERT_HITS` (16x64 strips decoded).
3108+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2985 pub(crate) fn sb_rect4_vert_hits() -> usize {3109 pub(crate) fn sb_rect4_vert_hits() -> usize {
2986 SB_RECT4_VERT_HITS.with(|c| c.get())3110 SB_RECT4_VERT_HITS.with(|c| c.get())
2987 }3111 }
@@ -3005,9 +3129,9 @@ thread_local! {
3005 static INTER_SB_VERT4_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };3129 static INTER_SB_VERT4_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
3006 }3130 }
3007 3131
3008-/// How many 32x32-level 1:4 strips actually read coefficients (non-skip):3132+// How many 32x32-level 1:4 strips actually read coefficients (non-skip):
3009-/// a gate that only counted strips would pass on an all-skip stream, which3133+// a gate that only counted strips would pass on an all-skip stream, which
3010-/// exercises none of the new scan/context tables.3134+// exercises none of the new scan/context tables.
3011 thread_local! {3135 thread_local! {
3012 static RECT4_COEFF_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };3136 static RECT4_COEFF_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
3013 }3137 }
@@ -3024,6 +3148,7 @@ thread_local! {
3024 }3148 }
3025 3149
3026 /// Current values of `RECT4_SPLIT_DEPTH1_HITS` / `RECT4_SPLIT_DEPTH2_HITS`.3150 /// Current values of `RECT4_SPLIT_DEPTH1_HITS` / `RECT4_SPLIT_DEPTH2_HITS`.
3151+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3027 pub(crate) fn rect4_split_depth_hits() -> (usize, usize) {3152 pub(crate) fn rect4_split_depth_hits() -> (usize, usize) {
3028 (3153 (
3029 RECT4_SPLIT_DEPTH1_HITS.with(|c| c.get()),3154 RECT4_SPLIT_DEPTH1_HITS.with(|c| c.get()),
@@ -3032,6 +3157,7 @@ pub(crate) fn rect4_split_depth_hits() -> (usize, usize) {
3032 }3157 }
3033 3158
3034 /// Current value of `SUB16_SPLIT_HITS`.3159 /// Current value of `SUB16_SPLIT_HITS`.
3160+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3035 pub(crate) fn sub16_split_hits() -> usize {3161 pub(crate) fn sub16_split_hits() -> usize {
3036 SUB16_SPLIT_HITS.with(|c| c.get())3162 SUB16_SPLIT_HITS.with(|c| c.get())
3037 }3163 }
@@ -3044,6 +3170,7 @@ thread_local! {
3044 }3170 }
3045 3171
3046 /// Current value of `RECT64_SPLIT_TXFM_PUBLISH_HITS`.3172 /// Current value of `RECT64_SPLIT_TXFM_PUBLISH_HITS`.
3173+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3047 pub(crate) fn rect64_split_txfm_publish_hits() -> usize {3174 pub(crate) fn rect64_split_txfm_publish_hits() -> usize {
3048 RECT64_SPLIT_TXFM_PUBLISH_HITS.with(|c| c.get())3175 RECT64_SPLIT_TXFM_PUBLISH_HITS.with(|c| c.get())
3049 }3176 }
@@ -3273,6 +3400,7 @@ thread_local! {
3273 }3400 }
3274 3401
3275 /// Current value of [`RECT64_QIDX_DRIFT_HITS`].3402 /// Current value of [`RECT64_QIDX_DRIFT_HITS`].
3403+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3276 pub(crate) fn rect64_qidx_drift_hits() -> usize {3404 pub(crate) fn rect64_qidx_drift_hits() -> usize {
3277 RECT64_QIDX_DRIFT_HITS.with(|c| c.get())3405 RECT64_QIDX_DRIFT_HITS.with(|c| c.get())
3278 }3406 }
@@ -3287,6 +3415,7 @@ thread_local! {
3287 }3415 }
3288 3416
3289 /// Current value of [`PARTAB_HITS`].3417 /// Current value of [`PARTAB_HITS`].
3418+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3290 pub(crate) fn partab_hits() -> usize {3419 pub(crate) fn partab_hits() -> usize {
3291 PARTAB_HITS.with(|c| c.get())3420 PARTAB_HITS.with(|c| c.get())
3292 }3421 }
@@ -3307,18 +3436,22 @@ thread_local! {
3307 }3436 }
3308 3437
3309 /// Current value of [`INTRA_HORZ_A_HITS`].3438 /// Current value of [`INTRA_HORZ_A_HITS`].
3439+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3310 pub(crate) fn intra_horz_a_hits() -> usize {3440 pub(crate) fn intra_horz_a_hits() -> usize {
3311 INTRA_HORZ_A_HITS.with(|c| c.get())3441 INTRA_HORZ_A_HITS.with(|c| c.get())
3312 }3442 }
3313 /// Current value of [`INTRA_HORZ_B_HITS`].3443 /// Current value of [`INTRA_HORZ_B_HITS`].
3444+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3314 pub(crate) fn intra_horz_b_hits() -> usize {3445 pub(crate) fn intra_horz_b_hits() -> usize {
3315 INTRA_HORZ_B_HITS.with(|c| c.get())3446 INTRA_HORZ_B_HITS.with(|c| c.get())
3316 }3447 }
3317 /// Current value of [`INTRA_VERT_A_HITS`].3448 /// Current value of [`INTRA_VERT_A_HITS`].
3449+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3318 pub(crate) fn intra_vert_a_hits() -> usize {3450 pub(crate) fn intra_vert_a_hits() -> usize {
3319 INTRA_VERT_A_HITS.with(|c| c.get())3451 INTRA_VERT_A_HITS.with(|c| c.get())
3320 }3452 }
3321 /// Current value of [`INTRA_VERT_B_HITS`].3453 /// Current value of [`INTRA_VERT_B_HITS`].
3454+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3322 pub(crate) fn intra_vert_b_hits() -> usize {3455 pub(crate) fn intra_vert_b_hits() -> usize {
3323 INTRA_VERT_B_HITS.with(|c| c.get())3456 INTRA_VERT_B_HITS.with(|c| c.get())
3324 }3457 }
@@ -3335,6 +3468,7 @@ thread_local! {
3335 }3468 }
3336 3469
3337 /// Current value of [`COMPOUND_MODE_HITS`].3470 /// Current value of [`COMPOUND_MODE_HITS`].
3471+#[allow(dead_code)] // gate counter accessor with no reader yet; the counter itself is live
3338 pub(crate) fn compound_mode_hits() -> usize {3472 pub(crate) fn compound_mode_hits() -> usize {
3339 COMPOUND_MODE_HITS.with(|c| c.get())3473 COMPOUND_MODE_HITS.with(|c| c.get())
3340 }3474 }
@@ -3352,12 +3486,14 @@ pub(crate) fn compound_mode_hits() -> usize {
3352 /// [`crate::motion_field::setup_motion_field`] yet, so this will read `0`3486 /// [`crate::motion_field::setup_motion_field`] yet, so this will read `0`
3353 /// against any real stream today. See the module doc on3487 /// against any real stream today. See the module doc on
3354 /// `crate::motion_field` and this crate's ledger for the remaining wiring.3488 /// `crate::motion_field` and this crate's ledger for the remaining wiring.
3489+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3355 pub(crate) fn tmv_hits() -> usize {3490 pub(crate) fn tmv_hits() -> usize {
3356 crate::mvstack::tmv_hits()3491 crate::mvstack::tmv_hits()
3357 }3492 }
3358 3493
3359 /// Current value of [`crate::mc::inter_pred_hits`] -- inter predictions3494 /// Current value of [`crate::mc::inter_pred_hits`] -- inter predictions
3360 /// produced on this thread, the 10-bit inter gate's firing proof.3495 /// produced on this thread, the 10-bit inter gate's firing proof.
3496+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3361 pub(crate) fn inter_pred_hits() -> usize {3497 pub(crate) fn inter_pred_hits() -> usize {
3362 crate::mc::inter_pred_hits()3498 crate::mc::inter_pred_hits()
3363 }3499 }
@@ -3465,6 +3601,7 @@ pub(crate) fn build_motion_field(
3465 3601
3466 /// Current value of the counter for `ref_frame` (`LAST2_FRAME`..=`ALTREF_FRAME`;3602 /// Current value of the counter for `ref_frame` (`LAST2_FRAME`..=`ALTREF_FRAME`;
3467 /// panics on `LAST_FRAME`/`INTRA_FRAME`/`NONE`, which have no counter here).3603 /// panics on `LAST_FRAME`/`INTRA_FRAME`/`NONE`, which have no counter here).
3604+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3468 pub(crate) fn ref_hits(ref_frame: i8) -> usize {3605 pub(crate) fn ref_hits(ref_frame: i8) -> usize {
3469 let c = match ref_frame {3606 let c = match ref_frame {
3470 LAST2_FRAME => &LAST2_HITS,3607 LAST2_FRAME => &LAST2_HITS,
@@ -3499,11 +3636,13 @@ pub(crate) fn set_enable_edge_filter(value: bool, fctx: &crate::decode::FrameCtx
3499 }3636 }
3500 3637
3501 /// Current value of [`ANGLE_DELTA_HITS`].3638 /// Current value of [`ANGLE_DELTA_HITS`].
3639+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3502 pub(crate) fn angle_delta_hits() -> usize {3640 pub(crate) fn angle_delta_hits() -> usize {
3503 ANGLE_DELTA_HITS.with(|c| c.get())3641 ANGLE_DELTA_HITS.with(|c| c.get())
3504 }3642 }
3505 3643
3506 /// Current value of [`TX_CLASS1_HITS`].3644 /// Current value of [`TX_CLASS1_HITS`].
3645+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3507 pub(crate) fn tx_class1_hits() -> usize {3646 pub(crate) fn tx_class1_hits() -> usize {
3508 TX_CLASS1_HITS.with(|c| c.get())3647 TX_CLASS1_HITS.with(|c| c.get())
3509 }3648 }
@@ -3592,6 +3731,7 @@ pub fn cdef_mixed_skip_units() -> usize {
3592 }3731 }
3593 3732
3594 /// Current value of `CDEF_SKIPPED_UNITS`.3733 /// Current value of `CDEF_SKIPPED_UNITS`.
3734+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3595 pub(crate) fn cdef_skipped_units() -> usize {3735 pub(crate) fn cdef_skipped_units() -> usize {
3596 CDEF_SKIPPED_UNITS.with(|c| c.get())3736 CDEF_SKIPPED_UNITS.with(|c| c.get())
3597 }3737 }
@@ -3603,16 +3743,19 @@ pub fn cdef_unwritten_skip_units() -> usize {
3603 }3743 }
3604 3744
3605 /// Current value of `INTER8_SKIP_BAND_HITS`.3745 /// Current value of `INTER8_SKIP_BAND_HITS`.
3746+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3606 pub(crate) fn inter8_skip_band_hits() -> usize {3747 pub(crate) fn inter8_skip_band_hits() -> usize {
3607 INTER8_SKIP_BAND_HITS.with(|c| c.get())3748 INTER8_SKIP_BAND_HITS.with(|c| c.get())
3608 }3749 }
3609 3750
3610 /// Current value of `CDEF_STRADDLE_UNITS`.3751 /// Current value of `CDEF_STRADDLE_UNITS`.
3752+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3611 pub(crate) fn cdef_straddle_units() -> usize {3753 pub(crate) fn cdef_straddle_units() -> usize {
3612 CDEF_STRADDLE_UNITS.with(|c| c.get())3754 CDEF_STRADDLE_UNITS.with(|c| c.get())
3613 }3755 }
3614 3756
3615 /// Current value of [`SUB8_SPLIT_HITS`].3757 /// Current value of [`SUB8_SPLIT_HITS`].
3758+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3616 pub(crate) fn sub8_split_hits() -> usize {3759 pub(crate) fn sub8_split_hits() -> usize {
3617 SUB8_SPLIT_HITS.with(|c| c.get())3760 SUB8_SPLIT_HITS.with(|c| c.get())
3618 }3761 }
@@ -3669,26 +3812,31 @@ thread_local! {
3669 }3812 }
3670 3813
3671 /// Current value of [`RECT8_SPLIT_TX_HITS`].3814 /// Current value of [`RECT8_SPLIT_TX_HITS`].
3815+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3672 pub(crate) fn rect8_split_tx_hits() -> usize {3816 pub(crate) fn rect8_split_tx_hits() -> usize {
3673 RECT8_SPLIT_TX_HITS.with(|c| c.get())3817 RECT8_SPLIT_TX_HITS.with(|c| c.get())
3674 }3818 }
3675 3819
3676 /// Current value of [`RECT_STRIP_PRED_HITS`].3820 /// Current value of [`RECT_STRIP_PRED_HITS`].
3821+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3677 pub(crate) fn rect_strip_pred_hits() -> usize {3822 pub(crate) fn rect_strip_pred_hits() -> usize {
3678 RECT_STRIP_PRED_HITS.with(|c| c.get())3823 RECT_STRIP_PRED_HITS.with(|c| c.get())
3679 }3824 }
3680 3825
3681 /// Current value of [`RECT_STRIP_REACH_HITS`].3826 /// Current value of [`RECT_STRIP_REACH_HITS`].
3827+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3682 pub(crate) fn rect_strip_reach_hits() -> usize {3828 pub(crate) fn rect_strip_reach_hits() -> usize {
3683 RECT_STRIP_REACH_HITS.with(|c| c.get())3829 RECT_STRIP_REACH_HITS.with(|c| c.get())
3684 }3830 }
3685 3831
3686 /// Current value of [`TX4X8_CODED_HITS`].3832 /// Current value of [`TX4X8_CODED_HITS`].
3833+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3687 pub(crate) fn tx4x8_coded_hits() -> usize {3834 pub(crate) fn tx4x8_coded_hits() -> usize {
3688 TX4X8_CODED_HITS.with(|c| c.get())3835 TX4X8_CODED_HITS.with(|c| c.get())
3689 }3836 }
3690 3837
3691 /// Current value of [`TX8X4_CODED_HITS`].3838 /// Current value of [`TX8X4_CODED_HITS`].
3839+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3692 pub(crate) fn tx8x4_coded_hits() -> usize {3840 pub(crate) fn tx8x4_coded_hits() -> usize {
3693 TX8X4_CODED_HITS.with(|c| c.get())3841 TX8X4_CODED_HITS.with(|c| c.get())
3694 }3842 }
@@ -3705,6 +3853,7 @@ thread_local! {
3705 }3853 }
3706 3854
3707 /// Current value of [`CHROMA_EOB_CLASS1_HITS`].3855 /// Current value of [`CHROMA_EOB_CLASS1_HITS`].
3856+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
3708 pub(crate) fn chroma_eob_class1_hits() -> usize {3857 pub(crate) fn chroma_eob_class1_hits() -> usize {
3709 CHROMA_EOB_CLASS1_HITS.with(|c| c.get())3858 CHROMA_EOB_CLASS1_HITS.with(|c| c.get())
3710 }3859 }
@@ -4680,7 +4829,7 @@ fn read_coeffs_rect(
4680 let pos = scan[scan_idx] as usize;4829 let pos = scan[scan_idx] as usize;
4681 let (row, col) = (pos / w, pos % w);4830 let (row, col) = (pos / w, pos % w);
4682 // libaom's column-major `coeff_idx`, for ladder comparison.4831 // libaom's column-major `coeff_idx`, for ladder comparison.
4683- let apos = col * h + row;4832+ let _apos = col * h + row;
4684 let level = if scan_idx == eob - 1 {4833 let level = if scan_idx == eob - 1 {
4685 let ctx = eob_coeff_ctx(scan_idx, w * h);4834 let ctx = eob_coeff_ctx(scan_idx, w * h);
4686 let v = dec.symbol(&mut coding.base_eob[ctx]) as i32 + 1;4835 let v = dec.symbol(&mut coding.base_eob[ctx]) as i32 + 1;
@@ -5014,6 +5163,7 @@ struct Neighbours {
5014 tile_col0_mi: usize,5163 tile_col0_mi: usize,
5015 }5164 }
5016 5165
5166+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
5017 impl Neighbours {5167 impl Neighbours {
5018 /// `cols`/`rows` are in [`SUB`] units; `mi_cols`/`mi_rows` are the frame's5168 /// `cols`/`rows` are in [`SUB`] units; `mi_cols`/`mi_rows` are the frame's
5019 /// true (unpadded) size in 4x4 mode-info units.5169 /// true (unpadded) size in 4x4 mode-info units.
@@ -5603,6 +5753,7 @@ impl Neighbours {
5603 /// "no neighbour"). `ref_frame` is `-1` for an intra block, else the5753 /// "no neighbour"). `ref_frame` is `-1` for an intra block, else the
5604 /// `1..=7` reference it coded (lane-av1refs's `single_ref_p*_ctx` needs5754 /// `1..=7` reference it coded (lane-av1refs's `single_ref_p*_ctx` needs
5605 /// the real value, not just `is_inter`).5755 /// the real value, not just `is_inter`).
5756+ #[allow(dead_code)] // read only from the `#[cfg(test)]` gates
5606 fn record_inter(5757 fn record_inter(
5607 &mut self,5758 &mut self,
5608 at: (usize, usize),5759 at: (usize, usize),
@@ -5622,6 +5773,7 @@ impl Neighbours {
5622 /// left-context span (its own height) differ, unlike every caller before5773 /// left-context span (its own height) differ, unlike every caller before
5623 /// this round (class neighbour-votes-all-its-fields).5774 /// this round (class neighbour-votes-all-its-fields).
5624 #[allow(clippy::too_many_arguments)]5775 #[allow(clippy::too_many_arguments)]
5776+ #[allow(dead_code)] // read only from the `#[cfg(test)]` gates
5625 fn record_inter_rect(5777 fn record_inter_rect(
5626 &mut self,5778 &mut self,
5627 at: (usize, usize),5779 at: (usize, usize),
@@ -5721,6 +5873,7 @@ impl Neighbours {
5721 /// this is the one caller that actually knows it) -- so the next block's5873 /// this is the one caller that actually knows it) -- so the next block's
5722 /// [`NeighbourRef`](crate::mvstack::NeighbourRef) sees a real compound5874 /// [`NeighbourRef`](crate::mvstack::NeighbourRef) sees a real compound
5723 /// neighbour instead of `record_inter`'s single-ref default.5875 /// neighbour instead of `record_inter`'s single-ref default.
5876+ #[allow(dead_code)] // read only from the `#[cfg(test)]` gates
5724 fn record_compound_ctx(5877 fn record_compound_ctx(
5725 &mut self,5878 &mut self,
5726 at: (usize, usize),5879 at: (usize, usize),
@@ -5735,6 +5888,7 @@ impl Neighbours {
5735 /// [`Self::record_compound_ctx`] with independent above/left extents,5888 /// [`Self::record_compound_ctx`] with independent above/left extents,
5736 /// mirroring [`Self::record_inter_rect`] (lane-partitions r1).5889 /// mirroring [`Self::record_inter_rect`] (lane-partitions r1).
5737 #[allow(clippy::too_many_arguments)]5890 #[allow(clippy::too_many_arguments)]
5891+ #[allow(dead_code)] // read only from the `#[cfg(test)]` gates
5738 fn record_compound_ctx_rect(5892 fn record_compound_ctx_rect(
5739 &mut self,5893 &mut self,
5740 at: (usize, usize),5894 at: (usize, usize),
@@ -9810,9 +9964,9 @@ fn decode_rect4_16(
9810 let (r, c) = at16;9964 let (r, c) = at16;
9811 let (mi_row0, mi_col0) = (r * (SUB / MI), c * (SUB / MI));9965 let (mi_row0, mi_col0) = (r * (SUB / MI), c * (SUB / MI));
9812 let (bw, bh) = if horz { (16, 4) } else { (4, 16) };9966 let (bw, bh) = if horz { (16, 4) } else { (4, 16) };
9813- let (mi_w, mi_h) = (bw / MI, bh / MI);9967+ let (_mi_w, _mi_h) = (bw / MI, bh / MI);
9814- let scan: &[u16] = if horz { &SCAN_16X4 } else { &SCAN_4X16 };9968+ let _scan: &[u16] = if horz { &SCAN_16X4 } else { &SCAN_4X16 };
9815- let chroma_scan: &[u16] = if horz { &SCAN_8X4 } else { &SCAN_4X8 };9969+ let _chroma_scan: &[u16] = if horz { &SCAN_8X4 } else { &SCAN_4X8 };
9816 let mut prev: Option<((usize, usize), usize)> = None;9970 let mut prev: Option<((usize, usize), usize)> = None;
9817 let mut last_mode = DC_PRED;9971 let mut last_mode = DC_PRED;
9818 let mut last_uv_mode = DC_PRED;9972 let mut last_uv_mode = DC_PRED;
@@ -11345,6 +11499,7 @@ fn cfl_scaled(alpha_q3: i32, ac_q3: i32) -> i32 {
11345 /// deblock/CDEF stages run, so the frame being dumped here is `idx - 1` --11499 /// deblock/CDEF stages run, so the frame being dumped here is `idx - 1` --
11346 /// without this every frame overwrote `.f0` and a per-frame bisection silently11500 /// without this every frame overwrote `.f0` and a per-frame bisection silently
11347 /// compared the LAST decoded frame (ledger, class stale-output-faked-measurement).11501 /// compared the LAST decoded frame (ledger, class stale-output-faked-measurement).
11502+#[allow(dead_code)] // gate counter accessor with no reader yet; the counter itself is live
11348 fn stage_dump_idx() -> usize {11503 fn stage_dump_idx() -> usize {
11349 PREFILT_PICTURE_IDX.load(std::sync::atomic::Ordering::SeqCst).saturating_sub(1)11504 PREFILT_PICTURE_IDX.load(std::sync::atomic::Ordering::SeqCst).saturating_sub(1)
11350 }11505 }
@@ -13347,7 +13502,6 @@ fn decode_leaf8(
13347 // 8x8 `mode` and reading its own fresh context off the earlier13502 // 8x8 `mode` and reading its own fresh context off the earlier
13348 // units in this same leaf (the same per-TU pattern `decode_block`'s13503 // units in this same leaf (the same per-TU pattern `decode_block`'s
13349 // multi-TU branch runs at bigger blocks).13504 // multi-TU branch runs at bigger blocks).
13350- luma_grid = vec![0i32; 64];
13351 for tu_row in 0..2 {13505 for tu_row in 0..2 {
13352 for tu_col in 0..2 {13506 for tu_col in 0..2 {
13353 let tu_mi = (leaf_mi.0 + tu_row, leaf_mi.1 + tu_col);13507 let tu_mi = (leaf_mi.0 + tu_row, leaf_mi.1 + tu_col);
@@ -14243,6 +14397,7 @@ fn cdef_msb(x: i32) -> i32 {
14243 14397
14244 /// Spec 7.15.3's `constrain`: how much of a neighbour's difference from the14398 /// Spec 7.15.3's `constrain`: how much of a neighbour's difference from the
14245 /// centre sample a filter tap is allowed to contribute.14399 /// centre sample a filter tap is allowed to contribute.
14400+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
14246 fn cdef_constrain(diff: i32, threshold: i32, damping: i32) -> i32 {14401 fn cdef_constrain(diff: i32, threshold: i32, damping: i32) -> i32 {
14247 if threshold == 0 {14402 if threshold == 0 {
14248 return 0;14403 return 0;
@@ -15016,6 +15171,7 @@ fn read_tx_size(
15016 /// transform and whether this unit already sits below it, times three, plus15171 /// transform and whether this unit already sits below it, times three, plus
15017 /// the two neighbour terms (whether the transform last written above/left of15172 /// the two neighbour terms (whether the transform last written above/left of
15018 /// this unit is narrower/shorter than the unit itself).15173 /// this unit is narrower/shorter than the unit itself).
15174+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
15019 fn txfm_partition_ctx(above_px: u8, left_px: u8, blk_max_px: usize, tx_px: usize) -> usize {15175 fn txfm_partition_ctx(above_px: u8, left_px: u8, blk_max_px: usize, tx_px: usize) -> usize {
15020 txfm_partition_ctx_rect(above_px, left_px, blk_max_px, tx_px, tx_px)15176 txfm_partition_ctx_rect(above_px, left_px, blk_max_px, tx_px, tx_px)
15021 }15177 }
@@ -15048,6 +15204,7 @@ fn txfm_partition_ctx_rect(
15048 /// `txfm_partition_update` (libaom `av1_common_int.h`): once a var-tx unit15204 /// `txfm_partition_update` (libaom `av1_common_int.h`): once a var-tx unit
15049 /// resolves, every mi cell its *parent* unit (`txb_px`) spans records the15205 /// resolves, every mi cell its *parent* unit (`txb_px`) spans records the
15050 /// resolved transform's own size.15206 /// resolved transform's own size.
15207+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
15051 fn txfm_partition_update(15208 fn txfm_partition_update(
15052 n: &mut Neighbours,15209 n: &mut Neighbours,
15053 at_mi: (usize, usize),15210 at_mi: (usize, usize),
@@ -16453,6 +16610,7 @@ fn deblock_thresholds(level: i32, sharpness: u8) -> (i32, i32, i32) {
16453 (2 * (level + 2) + lim, lim, level >> 4)16610 (2 * (level + 2) + lim, lim, level >> 4)
16454 }16611 }
16455 16612
16613+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
16456 fn sclamp(v: i32, fctx: &crate::decode::FrameCtx) -> i32 {16614 fn sclamp(v: i32, fctx: &crate::decode::FrameCtx) -> i32 {
16457 // libaom's `signed_char_clamp_high`: the clamp range scales with16615 // libaom's `signed_char_clamp_high`: the clamp range scales with
16458 // `128 << (bit_depth - 8)` alongside the centering constant below.16616 // `128 << (bit_depth - 8)` alongside the centering constant below.
@@ -17651,6 +17809,7 @@ fn apply_loop_restoration(
17651 /// 16x16, a directional mode's angle delta other than zero, chroma-from-luma),17809 /// 16x16, a directional mode's angle delta other than zero, chroma-from-luma),
17652 /// or when the tile payload runs out of the symbols this decode expects (a17810 /// or when the tile payload runs out of the symbols this decode expects (a
17653 /// genuinely foreign stream).17811 /// genuinely foreign stream).
17812+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
17654 pub(crate) fn decode_key_frame_tile(17813 pub(crate) fn decode_key_frame_tile(
17655 data: &[u8],17814 data: &[u8],
17656 mi_cols: u32,17815 mi_cols: u32,
@@ -17708,6 +17867,7 @@ pub(crate) fn decode_key_frame_tile(
17708 /// (see [`LAST_FRAME_WIDE_MARGIN`]) -- `stream.rs`'s superres path17867 /// (see [`LAST_FRAME_WIDE_MARGIN`]) -- `stream.rs`'s superres path
17709 /// reads this immediately after the call, before any other frame17868 /// reads this immediately after the call, before any other frame
17710 /// decode can overwrite it.17869 /// decode can overwrite it.
17870+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
17711 pub(crate) fn take_last_frame_wide_margin(fctx: &crate::decode::FrameCtx) -> Option<Picture> {17871 pub(crate) fn take_last_frame_wide_margin(fctx: &crate::decode::FrameCtx) -> Option<Picture> {
17712 fctx.last_frame_wide_margin.with(|m| m.borrow_mut().take())17872 fctx.last_frame_wide_margin.with(|m| m.borrow_mut().take())
17713 }17873 }
@@ -17764,13 +17924,12 @@ fn sb_visit_order(r0: u32, r1: u32, c0: u32, c1: u32, sb128: bool) -> Vec<(u32,
17764 out17924 out
17765 }17925 }
17766 17926
17767-/// lane-sb128 r2: the 128x128 superblock root, shared by the key-frame and17927+// lane-sb128 r2: the 128x128 superblock root, shared by the key-frame and
17768-/// the inter tile loop. Its loop-restoration units are read once for the whole17928+// the inter tile loop. Its loop-restoration units are read once for the whole
17769-/// 128x128 (spec 5.11.57 is called with the superblock's own size), then one17929+// 128x128 (spec 5.11.57 is called with the superblock's own size), then one
17770-/// partition symbol off the `BLOCK_128X128` CDF (8 symbols, no HORZ_4/VERT_4)17930+// partition symbol off the `BLOCK_128X128` CDF (8 symbols, no HORZ_4/VERT_4)
17771-/// decides the root -- only SPLIT recurses into the four 64x64 quadrants this17931+// decides the root -- only SPLIT recurses into the four 64x64 quadrants this
17772-/// decoder codes, the other seven arms refuse by name.17932+// decoder codes, the other seven arms refuse by name.
17773-#[allow(clippy::too_many_arguments)]
17774 thread_local! {17933 thread_local! {
17775 /// How many 128x128 superblock roots resolved to `PARTITION_NONE` -- one17934 /// How many 128x128 superblock roots resolved to `PARTITION_NONE` -- one
17776 /// whole 128x128 block (lane-sb128b r1's gate counter).17935 /// whole 128x128 block (lane-sb128b r1's gate counter).
@@ -17795,16 +17954,19 @@ pub(crate) fn part128_ab_hits() -> [usize; 4] {
17795 }17954 }
17796 17955
17797 /// [`PART128_NONE_HITS`], for a gate's own before/after delta.17956 /// [`PART128_NONE_HITS`], for a gate's own before/after delta.
17957+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
17798 pub(crate) fn part128_none_hits() -> usize {17958 pub(crate) fn part128_none_hits() -> usize {
17799 PART128_NONE_HITS.with(std::cell::Cell::get)17959 PART128_NONE_HITS.with(std::cell::Cell::get)
17800 }17960 }
17801 17961
17802 /// [`PART128_HORZ_HITS`], for a gate's own before/after delta.17962 /// [`PART128_HORZ_HITS`], for a gate's own before/after delta.
17963+#[allow(dead_code)] // gate counter accessor with no reader yet; the counter itself is live
17803 pub(crate) fn part128_horz_hits() -> usize {17964 pub(crate) fn part128_horz_hits() -> usize {
17804 PART128_HORZ_HITS.with(std::cell::Cell::get)17965 PART128_HORZ_HITS.with(std::cell::Cell::get)
17805 }17966 }
17806 17967
17807 /// [`PART128_VERT_HITS`], for a gate's own before/after delta.17968 /// [`PART128_VERT_HITS`], for a gate's own before/after delta.
17969+#[allow(dead_code)] // gate counter accessor with no reader yet; the counter itself is live
17808 pub(crate) fn part128_vert_hits() -> usize {17970 pub(crate) fn part128_vert_hits() -> usize {
17809 PART128_VERT_HITS.with(std::cell::Cell::get)17971 PART128_VERT_HITS.with(std::cell::Cell::get)
17810 }17972 }
@@ -17827,6 +17989,7 @@ thread_local! {
17827 }17989 }
17828 17990
17829 /// [`CHROMA_SPLIT_TX_HITS`], for a gate's own before/after delta.17991 /// [`CHROMA_SPLIT_TX_HITS`], for a gate's own before/after delta.
17992+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
17830 pub(crate) fn chroma_split_tx_hits() -> usize {17993 pub(crate) fn chroma_split_tx_hits() -> usize {
17831 CHROMA_SPLIT_TX_HITS.with(std::cell::Cell::get)17994 CHROMA_SPLIT_TX_HITS.with(std::cell::Cell::get)
17832 }17995 }
@@ -20422,7 +20585,7 @@ fn read_inter_plane(
20422 x: usize,20585 x: usize,
20423 y: usize,20586 y: usize,
20424 side: usize,20587 side: usize,
20425- base_q_idx: u8,20588+ _base_q_idx: u8,
20426 prediction: &[u16],20589 prediction: &[u16],
20427 // lane-chromau: this block's own luma transform's *actual coded*20590 // lane-chromau: this block's own luma transform's *actual coded*
20428 // `tx_type` -- `av1_get_tx_type` (libaom `blockd.h`): an inter block's20591 // `tx_type` -- `av1_get_tx_type` (libaom `blockd.h`): an inter block's
@@ -22123,7 +22286,7 @@ fn decode_inter_block(
22123 // 5.11.17), `Some` only when this block's var-tx tree resolved to more22286 // 5.11.17), `Some` only when this block's var-tx tree resolved to more
22124 // than one luma transform -- read back by the residual loop, the22287 // than one luma transform -- read back by the residual loop, the
22125 // coefficient-context write-back and the loop-filter grid fill below.22288 // coefficient-context write-back and the loop-filter grid fill below.
22126- let mut vartx_leaves: Option<Vec<(usize, usize, usize, usize)>> = None;22289+ let vartx_leaves: Option<Vec<(usize, usize, usize, usize)>>;
22127 // lane-t900 r22: this block's own palette state, stamped into the22290 // lane-t900 r22: this block's own palette state, stamped into the
22128 // mi-granular neighbour bands at the tail below for EVERY block --22291 // mi-granular neighbour bands at the tail below for EVERY block --
22129 // libaom's `MB_MODE_INFO.palette_size` is 0 on an inter block, and22292 // libaom's `MB_MODE_INFO.palette_size` is 0 on an inter block, and
@@ -22810,7 +22973,7 @@ fn decode_inter_block(
22810 );22973 );
22811 }22974 }
22812 let mut pred_y = vec![0u16; side * side];22975 let mut pred_y = vec![0u16; side * side];
22813- let mut diffwtd_mask_y = Vec::new();22976+ let mut diffwtd_mask_y;
22814 // lane-wedge r3: `mask_y` is the DIFFWTD buffer just computed OR22977 // lane-wedge r3: `mask_y` is the DIFFWTD buffer just computed OR
22815 // the wedge codebook lookup (comp_group_idx==1's two mutually22978 // the wedge codebook lookup (comp_group_idx==1's two mutually
22816 // exclusive branches) -- same [`mc::blend_masked_compound`] call22979 // exclusive branches) -- same [`mc::blend_masked_compound`] call
@@ -25668,7 +25831,7 @@ fn decode_inter_sub8_split4(
25668 neighbours.left_ref[rmi],25831 neighbours.left_ref[rmi],
25669 neighbours.left_ref1[rmi],25832 neighbours.left_ref1[rmi],
25670 );25833 );
25671- let (sref_y, sref_u, sref_v) = ref_planes(ref_frame, ref_y, ref_u, ref_v, other_refs)?;25834+ let (sref_y, _sref_u, _sref_v) = ref_planes(ref_frame, ref_y, ref_u, ref_v, other_refs)?;
25672 // lane-t900 r28: refusal lifted -- this sub-block's own reference may25835 // lane-t900 r28: refusal lifted -- this sub-block's own reference may
25673 // be scaled (superres); spec 7.11.3.3's walk is per reference, and25836 // be scaled (superres); spec 7.11.3.3's walk is per reference, and
25674 // each of the group's pieces (luma and its 2x2 chroma) carries its25837 // each of the group's pieces (luma and its 2x2 chroma) carries its
@@ -27226,7 +27389,7 @@ fn decode_inter_block8(
27226 // the one split a `BLOCK_8X8` can take (`read_block_tx_size` below) --27389 // the one split a `BLOCK_8X8` can take (`read_block_tx_size` below) --
27227 // read back by the luma residual read and the tail's neighbour/loop-filter27390 // read back by the luma residual read and the tail's neighbour/loop-filter
27228 // bookkeeping. Always `false` outside a `TxMode::Select` inter frame.27391 // bookkeeping. Always `false` outside a `TxMode::Select` inter frame.
27229- let mut split8 = false;27392+ let split8;
27230 const SIDE: usize = 8;27393 const SIDE: usize = 8;
27231 const CHROMA_SIDE: usize = 4;27394 const CHROMA_SIDE: usize = 4;
27232 27395
@@ -27710,7 +27873,7 @@ fn decode_inter_block8(
27710 );27873 );
27711 }27874 }
27712 let mut pred_y = vec![0u16; SIDE * SIDE];27875 let mut pred_y = vec![0u16; SIDE * SIDE];
27713- let mut diffwtd_mask_y = Vec::new();27876+ let mut diffwtd_mask_y;
27714 let mask_y: Option<&[u8]> = if let Some(mask_type) = diffwtd_mask_type {27877 let mask_y: Option<&[u8]> = if let Some(mask_type) = diffwtd_mask_type {
27715 diffwtd_mask_y = vec![0u8; SIDE * SIDE];27878 diffwtd_mask_y = vec![0u8; SIDE * SIDE];
27716 DIFFWTD_HITS.with(|c| c.set(c.get() + 1));27879 DIFFWTD_HITS.with(|c| c.set(c.get() + 1));
@@ -29142,6 +29305,7 @@ fn decode_inter_block8(
29142 /// or when `reference` is not this frame's own true size, or when the tile29305 /// or when `reference` is not this frame's own true size, or when the tile
29143 /// codes a 16x16 leaf whose own true edge cuts through it (round 2, same29306 /// codes a 16x16 leaf whose own true edge cuts through it (round 2, same
29144 /// refusal [`crate::tile`]'s writer gives its encoder).29307 /// refusal [`crate::tile`]'s writer gives its encoder).
29308+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
29145 pub(crate) fn decode_inter_frame_tile(29309 pub(crate) fn decode_inter_frame_tile(
29146 data: &[u8],29310 data: &[u8],
29147 mi_cols: u32,29311 mi_cols: u32,
crates/ec-av1/src/encode.rsmodified+16 -16
@@ -1859,9 +1859,9 @@ fn prune_top_k() -> Option<usize> {
1859 }1859 }
1860 }1860 }
1861 1861
1862-/// A per-thread override [`prune_top_k`] checks first, so one test can sweep1862+// A per-thread override [`prune_top_k`] checks first, so one test can sweep
1863-/// `top_k` in-process without mutating the environment (forbidden here --1863+// `top_k` in-process without mutating the environment (forbidden here --
1864-/// `#![forbid(unsafe_code)]` -- and racy across parallel tests besides).1864+// `#![forbid(unsafe_code)]` -- and racy across parallel tests besides).
1865 #[cfg(test)]1865 #[cfg(test)]
1866 thread_local! {1866 thread_local! {
1867 static TEST_TOP_K_OVERRIDE: std::cell::Cell<Option<Option<usize>>> =1867 static TEST_TOP_K_OVERRIDE: std::cell::Cell<Option<Option<usize>>> =
@@ -1898,8 +1898,8 @@ fn prune_top_k_inter() -> Option<usize> {
1898 }1898 }
1899 }1899 }
1900 1900
1901-/// A per-thread override [`prune_top_k_inter`] checks first, same reason as1901+// A per-thread override [`prune_top_k_inter`] checks first, same reason as
1902-/// [`TEST_TOP_K_OVERRIDE`].1902+// [`TEST_TOP_K_OVERRIDE`].
1903 #[cfg(test)]1903 #[cfg(test)]
1904 thread_local! {1904 thread_local! {
1905 static TEST_TOP_K_OVERRIDE_INTER: std::cell::Cell<Option<Option<usize>>> =1905 static TEST_TOP_K_OVERRIDE_INTER: std::cell::Cell<Option<Option<usize>>> =
@@ -1920,14 +1920,14 @@ fn set_test_top_k_override_inter(value: Option<usize>) {
1920 /// pruning them costs less quality here.1920 /// pruning them costs less quality here.
1921 const INTER_PRUNE_TOP_K: Option<usize> = Some(3);1921 const INTER_PRUNE_TOP_K: Option<usize> = Some(3);
1922 1922
1923-/// Per-thread nanosecond counters `stage_timing_breakdown_inter` (and1923+// Per-thread nanosecond counters `stage_timing_breakdown_inter` (and
1924-/// [`crate::mc::predict`], through [`stage_add`]) accumulate into, so an1924+// [`crate::mc::predict`], through [`stage_add`]) accumulate into, so an
1925-/// inter frame's cost can be attributed to a bucket without changing what1925+// inter frame's cost can be attributed to a bucket without changing what
1926-/// the search actually does. Index: 0 = whole-call time inside1926+// the search actually does. Index: 0 = whole-call time inside
1927-/// [`motion::search`] (includes bucket 1's time, run from inside it), 1 =1927+// [`motion::search`] (includes bucket 1's time, run from inside it), 1 =
1928-/// [`crate::mc::predict`] (every call, from the motion search's own1928+// [`crate::mc::predict`] (every call, from the motion search's own
1929-/// candidates and from a committed inter block's final prediction alike),1929+// candidates and from a committed inter block's final prediction alike),
1930-/// 2 = `forward_and_quantize` + `dequant_and_inverse`, 3 = `coeff_bits`.1930+// 2 = `forward_and_quantize` + `dequant_and_inverse`, 3 = `coeff_bits`.
1931 #[cfg(test)]1931 #[cfg(test)]
1932 thread_local! {1932 thread_local! {
1933 static STAGE_NS: [std::cell::Cell<u64>; 4] = [1933 static STAGE_NS: [std::cell::Cell<u64>; 4] = [
@@ -3512,7 +3512,7 @@ mod tests {
3512 x: usize,3512 x: usize,
3513 y: usize,3513 y: usize,
3514 width: usize,3514 width: usize,
3515- height: usize, fctx: &crate::decode::FrameCtx,3515+ height: usize, _fctx: &crate::decode::FrameCtx,
3516 ) -> (bool, bool) {3516 ) -> (bool, bool) {
3517 let (bw_log2, bh_log2) = ((bw / 4).ilog2() as usize, (bh / 4).ilog2() as usize);3517 let (bw_log2, bh_log2) = ((bw / 4).ilog2() as usize, (bh / 4).ilog2() as usize);
3518 let (_bw_unit, bh_unit) = (bw / 4, bh / 4);3518 let (_bw_unit, bh_unit) = (bw / 4, bh / 4);
@@ -3992,7 +3992,7 @@ mod tests {
3992 // col_off==0 (whole-transform) path, with MAX_MIB_SIZE_LOG2 = 5 (a3992 // col_off==0 (whole-transform) path, with MAX_MIB_SIZE_LOG2 = 5 (a
3993 // 128px reference grid) pinned as libaom pins it, independent of the3993 // 128px reference grid) pinned as libaom pins it, independent of the
3994 // 64px superblock this crate actually codes.3994 // 64px superblock this crate actually codes.
3995- fn libaom_top_right(side: usize, x: usize, y: usize, width: usize, height: usize) -> bool {3995+ fn libaom_top_right(side: usize, x: usize, y: usize, width: usize, _height: usize) -> bool {
3996 if y == 0 || x + side >= width {3996 if y == 0 || x + side >= width {
3997 return false;3997 return false;
3998 }3998 }
@@ -4017,7 +4017,7 @@ mod tests {
4017 (table[index / 8] >> (index % 8)) & 1 != 04017 (table[index / 8] >> (index % 8)) & 1 != 0
4018 }4018 }
4019 4019
4020- fn libaom_bottom_left(side: usize, x: usize, y: usize, height: usize, fctx: &crate::decode::FrameCtx) -> bool {4020+ fn libaom_bottom_left(side: usize, x: usize, y: usize, height: usize, _fctx: &crate::decode::FrameCtx) -> bool {
4021 if x == 0 || y + side >= height {4021 if x == 0 || y + side >= height {
4022 return false;4022 return false;
4023 }4023 }
crates/ec-av1/src/film_grain.rsmodified+2 -1
@@ -800,7 +800,7 @@ fn copy_area(
800 width: i32,800 width: i32,
801 height: i32, fctx: &crate::decode::FrameCtx,801 height: i32, fctx: &crate::decode::FrameCtx,
802 ) {802 ) {
803- let (grain_min, grain_max) = grain_range(fctx);803+ let (_grain_min, _grain_max) = grain_range(fctx);
804 for h in 0..height {804 for h in 0..height {
805 for w in 0..width {805 for w in 0..width {
806 let v = at(src, src_stride, src_row0 + h, src_col0 + w);806 let v = at(src, src_stride, src_row0 + h, src_col0 + w);
@@ -816,6 +816,7 @@ thread_local! {
816 }816 }
817 817
818 /// Current value of [`GRAIN_HITS`].818 /// Current value of [`GRAIN_HITS`].
819+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
819 pub(crate) fn grain_hits() -> usize {820 pub(crate) fn grain_hits() -> usize {
820 GRAIN_HITS.with(|c| c.get())821 GRAIN_HITS.with(|c| c.get())
821 }822 }
crates/ec-av1/src/intra.rsmodified+33 -30
@@ -206,35 +206,35 @@ impl Edges {
206 }206 }
207 }207 }
208 208
209-/// Predicts one `bw`-wide, `bh`-tall block into `dst`, row-major and209+// Predicts one `bw`-wide, `bh`-tall block into `dst`, row-major and
210-/// `bw * bh` long; `bw == bh` for a square block, the only shape every210+// `bw * bh` long; `bw == bh` for a square block, the only shape every
211-/// caller outside this lane's own tests passes.211+// caller outside this lane's own tests passes.
212-///212+//
213-/// `above` is the reconstructed row above the block and `left` its213+// `above` is the reconstructed row above the block and `left` its
214-/// reconstructed left column, each at least `bw`/`bh` samples long214+// reconstructed left column, each at least `bw`/`bh` samples long
215-/// respectively, and `corner` the sample diagonally above-left; `None` where215+// respectively, and `corner` the sample diagonally above-left; `None` where
216-/// the block sits against an edge of the frame. A directional mode reads out216+// the block sits against an edge of the frame. A directional mode reads out
217-/// to `bw + bh`: pass the samples above-right and below-left where the217+// to `bw + bh`: pass the samples above-right and below-left where the
218-/// decoder has them decoded, and the edge is extended by repetition where it218+// decoder has them decoded, and the edge is extended by repetition where it
219-/// does not, which is what the decoder's own clamp to `aboveLimit` and219+// does not, which is what the decoder's own clamp to `aboveLimit` and
220-/// `leftLimit` comes to.220+// `leftLimit` comes to.
221-///221+//
222-/// `angle_delta` (spec `AngleDeltaY`/`AngleDeltaUV`, `-MAX_ANGLE_DELTA` to222+// `angle_delta` (spec `AngleDeltaY`/`AngleDeltaUV`, `-MAX_ANGLE_DELTA` to
223-/// `MAX_ANGLE_DELTA`) steers every one of `V_PRED`, `H_PRED` and the six223+// `MAX_ANGLE_DELTA`) steers every one of `V_PRED`, `H_PRED` and the six
224-/// diagonal modes off their base angle by `ANGLE_STEP` degrees per unit (spec224+// diagonal modes off their base angle by `ANGLE_STEP` degrees per unit (spec
225-/// 7.11.2.1's `pAngle = Mode_To_Angle[mode] + angleDelta * ANGLE_STEP`);225+// 7.11.2.1's `pAngle = Mode_To_Angle[mode] + angleDelta * ANGLE_STEP`);
226-/// ignored (must be `0`) for the seven modes that carry no angle at all.226+// ignored (must be `0`) for the seven modes that carry no angle at all.
227-///227+//
228-/// `enable_edge_filter` is the sequence header's `enable_intra_edge_filter`228+// `enable_edge_filter` is the sequence header's `enable_intra_edge_filter`
229-/// (spec 7.11.2.4's own gate on the whole filter/upsample step); `smooth_neighbor`229+// (spec 7.11.2.4's own gate on the whole filter/upsample step); `smooth_neighbor`
230-/// is `get_intra_edge_filter_type` (spec 7.11.2.9, libaom `reconintra.c`) --230+// is `get_intra_edge_filter_type` (spec 7.11.2.9, libaom `reconintra.c`) --
231-/// whether the block above or to the left predicted with one of the three231+// whether the block above or to the left predicted with one of the three
232-/// smooth modes, which steers [`intra_edge_filter_strength`]'s threshold232+// smooth modes, which steers [`intra_edge_filter_strength`]'s threshold
233-/// table. Ignored outside the directional modes.233+// table. Ignored outside the directional modes.
234-///234+//
235-/// # Panics235+// # Panics
236-/// Panics on a mode this module does not predict, or when `dst` is not236+// Panics on a mode this module does not predict, or when `dst` is not
237-/// `bw * bh` long.237+// `bw * bh` long.
238 // lane-hbdgates r1: per-tool firing counters for the 10-bit gates. Each tool238 // lane-hbdgates r1: per-tool firing counters for the 10-bit gates. Each tool
239 // the coverage table tracks needs its OWN counter -- `smooth_uv_hits` lumps239 // the coverage table tracks needs its OWN counter -- `smooth_uv_hits` lumps
240 // SMOOTH..=PAETH together, so a paeth-only stream would have "proved" smooth240 // SMOOTH..=PAETH together, so a paeth-only stream would have "proved" smooth
@@ -246,17 +246,20 @@ thread_local! {
246 }246 }
247 247
248 /// How many blocks were predicted with SMOOTH/SMOOTH_V/SMOOTH_H on this thread.248 /// How many blocks were predicted with SMOOTH/SMOOTH_V/SMOOTH_H on this thread.
249+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
249 pub(crate) fn smooth_pred_hits() -> usize {250 pub(crate) fn smooth_pred_hits() -> usize {
250 SMOOTH_PRED_HITS.with(|c| c.get())251 SMOOTH_PRED_HITS.with(|c| c.get())
251 }252 }
252 253
253 /// How many blocks were predicted with PAETH_PRED on this thread.254 /// How many blocks were predicted with PAETH_PRED on this thread.
255+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
254 pub(crate) fn paeth_pred_hits() -> usize {256 pub(crate) fn paeth_pred_hits() -> usize {
255 PAETH_PRED_HITS.with(|c| c.get())257 PAETH_PRED_HITS.with(|c| c.get())
256 }258 }
257 259
258 /// How many directional edges [`filter_intra_edge`] actually smoothed260 /// How many directional edges [`filter_intra_edge`] actually smoothed
259 /// (strength != 0) on this thread -- the `--enable-intra-edge-filter` proof.261 /// (strength != 0) on this thread -- the `--enable-intra-edge-filter` proof.
262+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
260 pub(crate) fn intra_edge_filter_hits() -> usize {263 pub(crate) fn intra_edge_filter_hits() -> usize {
261 EDGE_FILTER_HITS.with(|c| c.get())264 EDGE_FILTER_HITS.with(|c| c.get())
262 }265 }
@@ -994,7 +997,7 @@ mod tests {
994 let fctx = &crate::decode::FrameCtx::new();997 let fctx = &crate::decode::FrameCtx::new();
995 // xorshift64*: a seeded stream, so a failure names one (shape, mode,998 // xorshift64*: a seeded stream, so a failure names one (shape, mode,
996 // seed) triple that reproduces.999 // seed) triple that reproduces.
997- let mut rng = |state: &mut u64| {1000+ let rng = |state: &mut u64| {
998 *state ^= *state << 13;1001 *state ^= *state << 13;
999 *state ^= *state >> 7;1002 *state ^= *state >> 7;
1000 *state ^= *state << 17;1003 *state ^= *state << 17;
crates/ec-av1/src/mc.rsmodified+4 -0
@@ -173,9 +173,13 @@ const SUBPEL_FILTERS_BILINEAR: [[i32; 8]; 16] = [
173 /// this type only ever names the resolved kernel, never `Switchable` itself.173 /// this type only ever names the resolved kernel, never `Switchable` itself.
174 #[derive(Clone, Copy, Debug, PartialEq, Eq)]174 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
175 pub enum InterpFilterKind {175 pub enum InterpFilterKind {
176+ /// The `Regular` interpolation kernel.
176 Regular,177 Regular,
178+ /// The `Smooth` interpolation kernel.
177 Smooth,179 Smooth,
180+ /// The `Sharp` interpolation kernel.
178 Sharp,181 Sharp,
182+ /// The `Bilinear` interpolation kernel.
179 Bilinear,183 Bilinear,
180 }184 }
181 185
crates/ec-av1/src/motion_field.rsmodified+1 -0
@@ -317,6 +317,7 @@ thread_local! {
317 317
318 /// Reads the counter above (gate318 /// Reads the counter above (gate
319 /// `a_real_aomenc_inter_sequence_with_forward_keyframes_and_temporal_mvs_decodes_pixel_exact`).319 /// `a_real_aomenc_inter_sequence_with_forward_keyframes_and_temporal_mvs_decodes_pixel_exact`).
320+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
320 pub fn refstamp_intra_frames() -> (usize, usize) {321 pub fn refstamp_intra_frames() -> (usize, usize) {
321 (322 (
322 REFSTAMP_INTRA_FRAMES.with(std::cell::Cell::get),323 REFSTAMP_INTRA_FRAMES.with(std::cell::Cell::get),
crates/ec-av1/src/mvstack.rsmodified+9 -5
@@ -88,6 +88,7 @@ static TMV_HITS: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize
88 /// The number of query blocks that received at least one temporal MV88 /// The number of query blocks that received at least one temporal MV
89 /// candidate so far, across every [`find_mv_stack_with_sign_bias`] call in89 /// candidate so far, across every [`find_mv_stack_with_sign_bias`] call in
90 /// this process.90 /// this process.
91+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
91 pub(crate) fn tmv_hits() -> usize {92 pub(crate) fn tmv_hits() -> usize {
92 TMV_HITS.load(std::sync::atomic::Ordering::Relaxed)93 TMV_HITS.load(std::sync::atomic::Ordering::Relaxed)
93 }94 }
@@ -108,16 +109,19 @@ static TILE_REACH_CLIPS: std::sync::atomic::AtomicUsize =
108 std::sync::atomic::AtomicUsize::new(0);109 std::sync::atomic::AtomicUsize::new(0);
109 110
110 /// [`COMP_GM_FILL_HITS`].111 /// [`COMP_GM_FILL_HITS`].
112+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
111 pub(crate) fn comp_gm_fill_hits() -> usize {113 pub(crate) fn comp_gm_fill_hits() -> usize {
112 COMP_GM_FILL_HITS.load(std::sync::atomic::Ordering::Relaxed)114 COMP_GM_FILL_HITS.load(std::sync::atomic::Ordering::Relaxed)
113 }115 }
114 116
115 /// [`STACK_FULL_DROPS`].117 /// [`STACK_FULL_DROPS`].
118+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
116 pub(crate) fn stack_full_drops() -> usize {119 pub(crate) fn stack_full_drops() -> usize {
117 STACK_FULL_DROPS.load(std::sync::atomic::Ordering::Relaxed)120 STACK_FULL_DROPS.load(std::sync::atomic::Ordering::Relaxed)
118 }121 }
119 122
120 /// [`TILE_REACH_CLIPS`].123 /// [`TILE_REACH_CLIPS`].
124+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
121 pub(crate) fn tile_reach_clips() -> usize {125 pub(crate) fn tile_reach_clips() -> usize {
122 TILE_REACH_CLIPS.load(std::sync::atomic::Ordering::Relaxed)126 TILE_REACH_CLIPS.load(std::sync::atomic::Ordering::Relaxed)
123 }127 }
@@ -799,11 +803,11 @@ fn scan_corner(
799 /// frame.803 /// frame.
800 const MV_BORDER: i32 = 16 << 3;804 const MV_BORDER: i32 = 16 << 3;
801 805
802-/// Clamps one candidate MV to the range spec 7.10.2.14 (libaom's806+// Clamps one candidate MV to the range spec 7.10.2.14 (libaom's
803-/// `clamp_mv_ref`) allows for a `bw4`-by-`bh4` block at `(mi_row, mi_col)` in807+// `clamp_mv_ref`) allows for a `bw4`-by-`bh4` block at `(mi_row, mi_col)` in
804-/// a `mi_cols`-by-`mi_rows` frame: the distance from the block's own edge to808+// a `mi_cols`-by-`mi_rows` frame: the distance from the block's own edge to
805-/// the matching frame edge, plus the block's own span and [`MV_BORDER`] of809+// the matching frame edge, plus the block's own span and [`MV_BORDER`] of
806-/// slack, in every direction.810+// slack, in every direction.
807 // lane-t900 r11: stack entries whose clamp window is narrowed by a NEGATIVE811 // lane-t900 r11: stack entries whose clamp window is narrowed by a NEGATIVE
808 // `mb_to_right_edge`/`mb_to_bottom_edge` -- i.e. blocks overhanging the frame's812 // `mb_to_right_edge`/`mb_to_bottom_edge` -- i.e. blocks overhanging the frame's
809 // right/bottom edge whose predictor the frame-edge clamp actually moves. Zero813 // right/bottom edge whose predictor the frame-edge clamp actually moves. Zero
crates/ec-av1/src/restoration.rsmodified+19 -12
@@ -79,7 +79,9 @@ fn decode_signed_subexp_with_ref_msac(dec: &mut SymbolDecoder, low: i32, high: i
79 decode_unsigned_subexp_with_ref_msac(dec, n, k, r) as i32 + low79 decode_unsigned_subexp_with_ref_msac(dec, n, k, r) as i32 + low
80 }80 }
81 81
82+#[allow(dead_code)] // gate counter accessor with no reader yet; the counter itself is live
82 const WIENER_HALFWIN: usize = 3;83 const WIENER_HALFWIN: usize = 3;
84+#[allow(dead_code)] // gate counter accessor with no reader yet; the counter itself is live
83 pub(crate) const WIENER_WIN: usize = 7;85 pub(crate) const WIENER_WIN: usize = 7;
84 const WIENER_TAP_MINV: [i32; 3] = [-5, -23, -17];86 const WIENER_TAP_MINV: [i32; 3] = [-5, -23, -17];
85 const WIENER_TAP_MAXV: [i32; 3] = [10, 8, 46];87 const WIENER_TAP_MAXV: [i32; 3] = [10, 8, 46];
@@ -363,49 +365,54 @@ pub(crate) fn read_lr(
363 }365 }
364 }366 }
365 367
366-/// r3 gate self-pin: how many units decoded a real (non-`None`) filter, by368+// r3 gate self-pin: how many units decoded a real (non-`None`) filter, by
367-/// kind -- proves a real `--enable-restoration=1` aomenc stream actually369+// kind -- proves a real `--enable-restoration=1` aomenc stream actually
368-/// exercises `read_lr_unit`'s Wiener/SGR/switchable arms, not just that the370+// exercises `read_lr_unit`'s Wiener/SGR/switchable arms, not just that the
369-/// symbol-count/refusal-string wiring compiles. Never reset -- summed across371+// symbol-count/refusal-string wiring compiles. Never reset -- summed across
370-/// a gate's whole attempt loop, matching `MASKED_COMPOUND_HITS`/`WEDGE_HITS`372+// a gate's whole attempt loop, matching `MASKED_COMPOUND_HITS`/`WEDGE_HITS`
371-/// (decode.rs) which this mirrors.373+// (decode.rs) which this mirrors.
372 thread_local! {374 thread_local! {
373 static WIENER_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };375 static WIENER_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
374 static SGRPROJ_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };376 static SGRPROJ_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
375 static SWITCHABLE_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };377 static SWITCHABLE_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
376 }378 }
377 379
378-/// lane-reelckf2 r1: how many *stripes* a real filter ran on with the frame's380+// lane-reelckf2 r1: how many *stripes* a real filter ran on with the frame's
379-/// own top row as their above boundary (`stripe_v_start == 0`, the 56-row381+// own top row as their above boundary (`stripe_v_start == 0`, the 56-row
380-/// first stripe of `RESTORATION_UNIT_OFFSET == 8`), and how many ran on a382+// first stripe of `RESTORATION_UNIT_OFFSET == 8`), and how many ran on a
381-/// short LAST stripe (`stripe_v_end == plane_h` with a partial height). Those383+// short LAST stripe (`stripe_v_end == plane_h` with a partial height). Those
382-/// are the two stripe shapes whose boundary substitution differs from every384+// are the two stripe shapes whose boundary substitution differs from every
383-/// interior stripe, and no gate size before this one had either.385+// interior stripe, and no gate size before this one had either.
384 thread_local! {386 thread_local! {
385 static LR_STRIPE0_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };387 static LR_STRIPE0_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
386 static LR_LAST_STRIPE_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };388 static LR_LAST_STRIPE_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
387 }389 }
388 390
389 /// Current value of [`LR_STRIPE0_HITS`].391 /// Current value of [`LR_STRIPE0_HITS`].
392+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
390 pub(crate) fn lr_stripe0_hits() -> usize {393 pub(crate) fn lr_stripe0_hits() -> usize {
391 LR_STRIPE0_HITS.with(|c| c.get())394 LR_STRIPE0_HITS.with(|c| c.get())
392 }395 }
393 /// Current value of [`LR_LAST_STRIPE_HITS`].396 /// Current value of [`LR_LAST_STRIPE_HITS`].
397+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
394 pub(crate) fn lr_last_stripe_hits() -> usize {398 pub(crate) fn lr_last_stripe_hits() -> usize {
395 LR_LAST_STRIPE_HITS.with(|c| c.get())399 LR_LAST_STRIPE_HITS.with(|c| c.get())
396 }400 }
397 401
398 /// Current value of [`WIENER_HITS`].402 /// Current value of [`WIENER_HITS`].
403+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
399 pub(crate) fn wiener_hits() -> usize {404 pub(crate) fn wiener_hits() -> usize {
400 WIENER_HITS.with(|c| c.get())405 WIENER_HITS.with(|c| c.get())
401 }406 }
402 /// Current value of [`SGRPROJ_HITS`].407 /// Current value of [`SGRPROJ_HITS`].
408+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
403 pub(crate) fn sgrproj_hits() -> usize {409 pub(crate) fn sgrproj_hits() -> usize {
404 SGRPROJ_HITS.with(|c| c.get())410 SGRPROJ_HITS.with(|c| c.get())
405 }411 }
406 /// Current value of [`SWITCHABLE_HITS`] -- bumped once per unit whose frame412 /// Current value of [`SWITCHABLE_HITS`] -- bumped once per unit whose frame
407 /// `restoration_type` is `Switchable`, regardless of which `RestoreType`413 /// `restoration_type` is `Switchable`, regardless of which `RestoreType`
408 /// (`None`/Wiener/Sgrproj) that unit's own symbol resolved to.414 /// (`None`/Wiener/Sgrproj) that unit's own symbol resolved to.
415+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
409 pub(crate) fn switchable_hits() -> usize {416 pub(crate) fn switchable_hits() -> usize {
410 SWITCHABLE_HITS.with(|c| c.get())417 SWITCHABLE_HITS.with(|c| c.get())
411 }418 }
crates/ec-av1/src/stream.rsmodified+29 -27
@@ -24,9 +24,11 @@ use ec_core::{Error, Result};
24 use crate::cdf_state::Cdfs;24 use crate::cdf_state::Cdfs;
25 use crate::decode;25 use crate::decode;
26 use crate::decode::{26 use crate::decode::{
27- decode_inter_frame_tile_with_cdfs, decode_key_frame_tile, decode_key_frame_tile_with_cdfs,27+ decode_inter_frame_tile_with_cdfs, decode_key_frame_tile_with_cdfs,
28 q_ctx_of,28 q_ctx_of,
29 };29 };
30+#[cfg(test)]
31+use crate::decode::decode_key_frame_tile;
30 use crate::encode::Picture;32 use crate::encode::Picture;
31 33
32 /// lane-midcut r1: `EC_AV1_NO_GRAIN=1` skips film grain synthesis at output, so a34 /// lane-midcut r1: `EC_AV1_NO_GRAIN=1` skips film grain synthesis at output, so a
@@ -36,13 +38,13 @@ fn no_grain() -> bool {
36 std::env::var_os("EC_AV1_NO_GRAIN").is_some()38 std::env::var_os("EC_AV1_NO_GRAIN").is_some()
37 }39 }
38 40
39-/// lane-hidden r1: where `EC_AV1_FINAL_DUMP`'s per-frame dump goes for the41+// lane-hidden r1: where `EC_AV1_FINAL_DUMP`'s per-frame dump goes for the
40-/// current thread, overriding the environment variable. Every ffmpeg/aomdec42+// current thread, overriding the environment variable. Every ffmpeg/aomdec
41-/// pixel gate in this repo compares SHOWN frames only (class43+// pixel gate in this repo compares SHOWN frames only (class
42-/// gate-blind-to-hidden-frames), so the hidden alt-ref frames a real aomenc44+// gate-blind-to-hidden-frames), so the hidden alt-ref frames a real aomenc
43-/// stream carries were never compared at all; the gate that does compare45+// stream carries were never compared at all; the gate that does compare
44-/// them needs a dump path that cannot race a sibling test's decode on46+// them needs a dump path that cannot race a sibling test's decode on
45-/// another thread, which a process-global env var cannot give.47+// another thread, which a process-global env var cannot give.
46 thread_local! {48 thread_local! {
47 static FINAL_DUMP_PREFIX: std::cell::RefCell<Option<String>> =49 static FINAL_DUMP_PREFIX: std::cell::RefCell<Option<String>> =
48 const { std::cell::RefCell::new(None) };50 const { std::cell::RefCell::new(None) };
@@ -200,6 +202,7 @@ pub fn obmc_pair_filter_hits() -> usize {
200 crate::decode::obmc_pair_filter_hits()202 crate::decode::obmc_pair_filter_hits()
201 }203 }
202 204
205+/// Gate counters for the 4x32/32x4 rectangular strips: `(horz, vert, coeff)` hits.
203 pub fn rect4_32_counters() -> (usize, usize, usize) {206 pub fn rect4_32_counters() -> (usize, usize, usize) {
204 (207 (
205 crate::decode::rect4_32_horz_hits(),208 crate::decode::rect4_32_horz_hits(),
@@ -26910,14 +26913,13 @@ mod tests {
26910 }26913 }
26911 26914
26912 fn edge32_gate(name: &str, flat_band: bool) {26915 fn edge32_gate(name: &str, flat_band: bool) {
26913- let NAME = name;
26914 let _gate_lock = lock_gate_counters();26916 let _gate_lock = lock_gate_counters();
26915 if !have_ffmpeg() {26917 if !have_ffmpeg() {
26916- eprintln!("SKIP {NAME}: no ffmpeg");26918+ eprintln!("SKIP {name}: no ffmpeg");
26917 return;26919 return;
26918 }26920 }
26919 if !have_aomenc() {26921 if !have_aomenc() {
26920- eprintln!("SKIP {NAME}: no aomenc at {}", aomenc_path().display());26922+ eprintln!("SKIP {name}: no aomenc at {}", aomenc_path().display());
26921 return;26923 return;
26922 }26924 }
26923 // (width, height, frames, ten_bit, tile_columns_log2)26925 // (width, height, frames, ten_bit, tile_columns_log2)
@@ -27029,7 +27031,7 @@ mod tests {
27029 .expect("ffmpeg failed to run");27031 .expect("ffmpeg failed to run");
27030 assert!(27032 assert!(
27031 y4m.status.success(),27033 y4m.status.success(),
27032- "{NAME}: ffmpeg fixture: {}",27034+ "{name}: ffmpeg fixture: {}",
27033 String::from_utf8_lossy(&y4m.stderr)27035 String::from_utf8_lossy(&y4m.stderr)
27034 );27036 );
27035 let cq_arg = format!("--cq-level={cq}");27037 let cq_arg = format!("--cq-level={cq}");
@@ -27085,7 +27087,7 @@ mod tests {
27085 let out = child.wait_with_output().expect("aomenc failed to run");27087 let out = child.wait_with_output().expect("aomenc failed to run");
27086 assert!(27088 assert!(
27087 out.status.success(),27089 out.status.success(),
27088- "{NAME}: aomenc refused the fixture: {}",27090+ "{name}: aomenc refused the fixture: {}",
27089 String::from_utf8_lossy(&out.stderr)27091 String::from_utf8_lossy(&out.stderr)
27090 );27092 );
27091 let stream = out.stdout;27093 let stream = out.stdout;
@@ -27093,7 +27095,7 @@ mod tests {
27093 assert_eq!(27095 assert_eq!(
27094 parsed_bit_depth(&stream),27096 parsed_bit_depth(&stream),
27095 10,27097 10,
27096- "{NAME}: aomenc did not write a 10-bit sequence header"27098+ "{name}: aomenc did not write a 10-bit sequence header"
27097 );27099 );
27098 }27100 }
27099 let tag = format!(27101 let tag = format!(
@@ -27106,7 +27108,7 @@ mod tests {
27106 // desync surfaces as a panic deep in mc.rs with no arm in the27108 // desync surfaces as a panic deep in mc.rs with no arm in the
27107 // message, and r8 spent a run bisecting arms by hand.27109 // message, and r8 spent a run bisecting arms by hand.
27108 if std::env::var_os("EC_GATE_VERBOSE").is_some() {27110 if std::env::var_os("EC_GATE_VERBOSE").is_some() {
27109- eprintln!("{NAME}: attempting {tag}");27111+ eprintln!("{name}: attempting {tag}");
27110 }27112 }
27111 let decoded = match decode_stream(&stream) {27113 let decoded = match decode_stream(&stream) {
27112 Ok(frames) => frames,27114 Ok(frames) => frames,
@@ -27114,7 +27116,7 @@ mod tests {
27114 let msg = e.to_string();27116 let msg = e.to_string();
27115 assert!(27117 assert!(
27116 msg.contains("unsupported"),27118 msg.contains("unsupported"),
27117- "{NAME} failed outright, not a named refusal ({tag}): {msg}"27119+ "{name} failed outright, not a named refusal ({tag}): {msg}"
27118 );27120 );
27119 refusals.push(format!("{tag}: {msg}"));27121 refusals.push(format!("{tag}: {msg}"));
27120 continue;27122 continue;
@@ -27131,7 +27133,7 @@ mod tests {
27131 assert_eq!(27133 assert_eq!(
27132 decoded.len(),27134 decoded.len(),
27133 reference.len(),27135 reference.len(),
27134- "{NAME}: {tag}: shown-frame count vs ffmpeg"27136+ "{name}: {tag}: shown-frame count vs ffmpeg"
27135 );27137 );
27136 for (i, (ours, theirs)) in decoded.iter().zip(reference.iter()).enumerate() {27138 for (i, (ours, theirs)) in decoded.iter().zip(reference.iter()).enumerate() {
27137 for (plane, a, b, w) in [27139 for (plane, a, b, w) in [
@@ -27149,10 +27151,10 @@ mod tests {
27149 *per_row.entry(k / w).or_default() += 1;27151 *per_row.entry(k / w).or_default() += 1;
27150 }27152 }
27151 }27153 }
27152- eprintln!("{NAME}: {tag} plane {plane} diffs per row: {per_row:?}");27154+ eprintln!("{name}: {tag} plane {plane} diffs per row: {per_row:?}");
27153 }27155 }
27154 panic!(27156 panic!(
27155- "{NAME}: {tag} frame {i} plane {plane}: {n} pixels differ, first \27157+ "{name}: {tag} frame {i} plane {plane}: {n} pixels differ, first \
27156 at row {} col {} (ours {} vs ffmpeg {}) [edge32={delta:?}]",27158 at row {} col {} (ours {} vs ffmpeg {}) [edge32={delta:?}]",
27157 d / w,27159 d / w,
27158 d % w,27160 d % w,
@@ -27174,23 +27176,23 @@ mod tests {
27174 }27176 }
27175 assert!(27177 assert!(
27176 compared > 0,27178 compared > 0,
27177- "{NAME}: every attempt hit a named refusal:\n{}",27179+ "{name}: every attempt hit a named refusal:\n{}",
27178 refusals.join("\n")27180 refusals.join("\n")
27179 );27181 );
27180 assert!(27182 assert!(
27181 !straddle || compared_multi_tile > 0,27183 !straddle || compared_multi_tile > 0,
27182- "{NAME}: every `--tile-columns=1` attempt hit a named refusal -- the \27184+ "{name}: every `--tile-columns=1` attempt hit a named refusal -- the \
27183 multi-tile twins compared nothing:\n{}",27185 multi-tile twins compared nothing:\n{}",
27184 refusals.join("\n")27186 refusals.join("\n")
27185 );27187 );
27186 assert!(27188 assert!(
27187 !straddle || straddle_units > 0,27189 !straddle || straddle_units > 0,
27188- "{NAME}: no FILTERED 8x8 CDEF unit crossed the cropped frame edge over \27190+ "{name}: no FILTERED 8x8 CDEF unit crossed the cropped frame edge over \
27189 {compared} compared attempts -- the straddling arms proved nothing"27191 {compared} compared attempts -- the straddling arms proved nothing"
27190 );27192 );
27191 assert!(27193 assert!(
27192 totals[0] + totals[1] + totals[4] + totals[5] > 0,27194 totals[0] + totals[1] + totals[4] + totals[5] > 0,
27193- "{NAME}: no frame-edge partition bit was read at all over \27195+ "{name}: no frame-edge partition bit was read at all over \
27194 {compared} compared attempts -- the gate proved nothing"27196 {compared} compared attempts -- the gate proved nothing"
27195 );27197 );
27196 // lane-golomb r3: the flat-band arm's ASSERT moved one level up. Until27198 // lane-golomb r3: the flat-band arm's ASSERT moved one level up. Until
@@ -27202,16 +27204,16 @@ mod tests {
27202 // content. Slots 6/7 are the strips actually decoded at the edge.27204 // content. Slots 6/7 are the strips actually decoded at the edge.
27203 assert!(27205 assert!(
27204 !flat_band || totals[6] > 0,27206 !flat_band || totals[6] > 0,
27205- "{NAME}: no 64x32 bottom-edge HORZ strip was decoded \27207+ "{name}: no 64x32 bottom-edge HORZ strip was decoded \
27206 (edge32={totals:?}, {compared} compared attempts)"27208 (edge32={totals:?}, {compared} compared attempts)"
27207 );27209 );
27208 assert!(27210 assert!(
27209 !flat_band || totals[7] > 0,27211 !flat_band || totals[7] > 0,
27210- "{NAME}: no 32x64 right-edge VERT strip was decoded \27212+ "{name}: no 32x64 right-edge VERT strip was decoded \
27211 (edge32={totals:?}, {compared} compared attempts)"27213 (edge32={totals:?}, {compared} compared attempts)"
27212 );27214 );
27213 eprintln!(27215 eprintln!(
27214- "{NAME}: {compared} pixel-exact attempts, 32-level edge bits \27216+ "{name}: {compared} pixel-exact attempts, 32-level edge bits \
27215 [horz_or_vert={} split={}] bottom-HORZ={} right-VERT={}, 64-level edge bits \27217 [horz_or_vert={} split={}] bottom-HORZ={} right-VERT={}, 64-level edge bits \
27216 [horz_or_vert={} split={}] bottom-HORZ={} right-VERT={}, \27218 [horz_or_vert={} split={}] bottom-HORZ={} right-VERT={}, \
27217 {straddle_units} straddling CDEF units, {} named refusals",27219 {straddle_units} straddling CDEF units, {} named refusals",
@@ -27226,7 +27228,7 @@ mod tests {
27226 refusals.len()27228 refusals.len()
27227 );27229 );
27228 for r in &refusals {27230 for r in &refusals {
27229- eprintln!("{NAME} refusal: {r}");27231+ eprintln!("{name} refusal: {r}");
27230 }27232 }
27231 }27233 }
27232 27234
crates/ec-av1/src/transform.rsmodified+2 -0
@@ -1029,6 +1029,7 @@ pub fn dequant_and_inverse(levels: &[i32], side: usize, bit_depth: u8, q_idx: i3
1029 /// undo, and nothing else: measuring the network's response to a unit1029 /// undo, and nothing else: measuring the network's response to a unit
1030 /// coefficient at every size gives the same `1 / (8 * sqrt(2))` per unit of1030 /// coefficient at every size gives the same `1 / (8 * sqrt(2))` per unit of
1031 /// `dqDenom`, which is what [`forward_transform_2d`] divides out.1031 /// `dqDenom`, which is what [`forward_transform_2d`] divides out.
1032+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1032 fn build_dct_basis(n: usize) -> Vec<f64> {1033 fn build_dct_basis(n: usize) -> Vec<f64> {
1033 let mut basis = vec![0.0f64; n * n];1034 let mut basis = vec![0.0f64; n * n];
1034 let scale = (2.0 / n as f64).sqrt();1035 let scale = (2.0 / n as f64).sqrt();
@@ -1050,6 +1051,7 @@ fn build_dct_basis(n: usize) -> Vec<f64> {
1050 /// one of the transform sizes this crate codes (4 to 64, a power of two), so1051 /// one of the transform sizes this crate codes (4 to 64, a power of two), so
1051 /// a small fixed table indexed by `log2(n)` covers every caller without a1052 /// a small fixed table indexed by `log2(n)` covers every caller without a
1052 /// hash lookup.1053 /// hash lookup.
1054+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1053 fn dct_basis(n: usize) -> &'static [f64] {1055 fn dct_basis(n: usize) -> &'static [f64] {
1054 use std::sync::OnceLock;1056 use std::sync::OnceLock;
1055 // log2(4)=2 .. log2(64)=6, so index by trailing_zeros() - 2.1057 // log2(4)=2 .. log2(64)=6, so index by trailing_zeros() - 2.
crates/ec-av1/src/wedge.rsmodified+4 -0
@@ -251,12 +251,16 @@ fn wedge_window(wedge_index: usize, neg: usize, bw: usize, bh: usize) -> (usize,
251 /// `stride x stride` plane (`stride = max(bw, bh)`) so a rectangular mask251 /// `stride x stride` plane (`stride = max(bw, bh)`) so a rectangular mask
252 /// indexes exactly like the square prediction buffer `decode.rs` blends252 /// indexes exactly like the square prediction buffer `decode.rs` blends
253 /// into. Only rows `0..bh` / columns `0..bw` are meaningful.253 /// into. Only rows `0..bh` / columns `0..bw` are meaningful.
254+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
254 pub struct WedgeCodebook {255 pub struct WedgeCodebook {
255 /// `[sign][wedge_index] -> stride*stride` bytes, row stride `stride`.256 /// `[sign][wedge_index] -> stride*stride` bytes, row stride `stride`.
256 masks: [[Vec<u8>; MAX_WEDGE_TYPES]; 2],257 masks: [[Vec<u8>; MAX_WEDGE_TYPES]; 2],
258+ #[allow(dead_code)] // read only from the `#[cfg(test)]` gates
257 pub bw: usize,259 pub bw: usize,
260+ #[allow(dead_code)] // read only from the `#[cfg(test)]` gates
258 pub bh: usize,261 pub bh: usize,
259 /// `max(bw, bh)` -- the row stride of every mask returned by [`Self::mask`].262 /// `max(bw, bh)` -- the row stride of every mask returned by [`Self::mask`].
263+ #[allow(dead_code)] // read only from the `#[cfg(test)]` gates
260 pub stride: usize,264 pub stride: usize,
261 }265 }
262 266