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] = [
1919 [711, 966, 1172, 32448, 32538, 32617, 32664, 32768, 0],
2020 ];
2121
22+/// Default CDF table `PARTITION_W64` (AV1 spec 9.4 initial probabilities).
2223 pub const PARTITION_W64: [[u16; 11]; 4] = [
2324 [
2425 20137, 21547, 23078, 29566, 29837, 30261, 30524, 30892, 31724, 32768, 0,
@@ -63,6 +64,7 @@ pub const TXFM_PARTITION: [[u16; 3]; 21] = [
6364 [16088, 32768, 0],
6465 ];
6566
67+/// Default CDF table `SKIP` (AV1 spec 9.4 initial probabilities).
6668 pub const SKIP: [[u16; 3]; 3] = [[31671, 32768, 0], [16515, 32768, 0], [4576, 32768, 0]];
6769
6870 /// `Default_Intra_Frame_Y_Mode_Cdf` (spec 9.4): the thirteen luma intra
@@ -698,6 +700,7 @@ pub const SEGMENT_ID: [[u16; 9]; 3] = [
698700 /// `seg_id_predicted`, indexed by `AboveSegPredContext + LeftSegPredContext`.
699701 pub const SEGMENT_PRED: [[u16; 3]; 3] = [[16384, 32768, 0]; 3];
700702
703+/// Default CDF table `DELTA_Q` (AV1 spec 9.4 initial probabilities).
701704 pub const DELTA_Q: [u16; 5] = [28160, 32120, 32677, 32768, 0];
702705 /// `default_delta_lf_cdf` -- see [`DELTA_Q`]'s doc.
703706 pub const DELTA_LF: [u16; 5] = DELTA_Q;
@@ -3186,8 +3189,11 @@ pub const TXB_SKIP_CHROMA_32_Q3: [[u16; 3]; 3] =
31863189 /// 128x128 block's four TX_32X32 chroma units -- the offset-7 rows above are
31873190 /// every other case (lane-sb128b r3).
31883191 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).
31893193 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).
31903195 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).
31913197 pub const TXB_SKIP_CHROMA_32_BIG_Q3: [[u16; 3]; 3] = [[1806, 32768, 0], [14645, 32768, 0], [25336, 32768, 0]];
31923198 /// EOB_EXTRA_LUMA_16, q-context 3: the same table as [`EOB_EXTRA_LUMA_16`], for `base_q_idx` 121..=255.
31933199 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,
38863892 /// (`av1_default_eob_multi64_cdfs[q][0][1]`), for an 8x8 luma TU whose
38873893 /// `tx_type` resolves `V_DCT`/`H_DCT`.
38883894 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).
38893896 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).
38903898 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).
38913900 pub const EOB_PT_64_LUMA_CLASS1_Q3: [u16; 8] = [1289, 2320, 3971, 7926, 14153, 24291, 32768, 0];
38923901
38933902 /// 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] = [
46834692 [26308, 32768, 0],
46844693 [32537, 32768, 0],
46854694 ];
4695+/// Default CDF table `TXB_SKIP_LUMA_8_Q1_CTX` (AV1 spec 9.4 initial probabilities).
46864696 pub const TXB_SKIP_LUMA_8_Q1_CTX: [[u16; 3]; 7] = [
46874697 [31782, 32768, 0],
46884698 [1836, 32768, 0],
@@ -4692,6 +4702,7 @@ pub const TXB_SKIP_LUMA_8_Q1_CTX: [[u16; 3]; 7] = [
46924702 [27518, 32768, 0],
46934703 [32399, 32768, 0],
46944704 ];
4705+/// Default CDF table `TXB_SKIP_LUMA_8_CTX` (AV1 spec 9.4 initial probabilities).
46954706 pub const TXB_SKIP_LUMA_8_CTX: [[u16; 3]; 7] = [
46964707 [31957, 32768, 0],
46974708 [3230, 32768, 0],
@@ -4701,6 +4712,7 @@ pub const TXB_SKIP_LUMA_8_CTX: [[u16; 3]; 7] = [
47014712 [26536, 32768, 0],
47024713 [31986, 32768, 0],
47034714 ];
4715+/// Default CDF table `TXB_SKIP_LUMA_8_Q3_CTX` (AV1 spec 9.4 initial probabilities).
47044716 pub const TXB_SKIP_LUMA_8_Q3_CTX: [[u16; 3]; 7] = [
47054717 [31903, 32768, 0],
47064718 [2044, 32768, 0],
@@ -4710,6 +4722,7 @@ pub const TXB_SKIP_LUMA_8_Q3_CTX: [[u16; 3]; 7] = [
47104722 [24168, 32768, 0],
47114723 [31037, 32768, 0],
47124724 ];
4725+/// Default CDF table `TXB_SKIP_LUMA_16_Q0_CTX` (AV1 spec 9.4 initial probabilities).
47134726 pub const TXB_SKIP_LUMA_16_Q0_CTX: [[u16; 3]; 7] = [
47144727 [29957, 32768, 0],
47154728 [5391, 32768, 0],
@@ -4719,6 +4732,7 @@ pub const TXB_SKIP_LUMA_16_Q0_CTX: [[u16; 3]; 7] = [
47194732 [25822, 32768, 0],
47204733 [32197, 32768, 0],
47214734 ];
4735+/// Default CDF table `TXB_SKIP_LUMA_16_Q1_CTX` (AV1 spec 9.4 initial probabilities).
47224736 pub const TXB_SKIP_LUMA_16_Q1_CTX: [[u16; 3]; 7] = [
47234737 [31901, 32768, 0],
47244738 [10311, 32768, 0],
@@ -4728,6 +4742,7 @@ pub const TXB_SKIP_LUMA_16_Q1_CTX: [[u16; 3]; 7] = [
47284742 [27914, 32768, 0],
47294743 [32296, 32768, 0],
47304744 ];
4745+/// Default CDF table `TXB_SKIP_LUMA_16_CTX` (AV1 spec 9.4 initial probabilities).
47314746 pub const TXB_SKIP_LUMA_16_CTX: [[u16; 3]; 7] = [
47324747 [32363, 32768, 0],
47334748 [10692, 32768, 0],
@@ -4737,6 +4752,7 @@ pub const TXB_SKIP_LUMA_16_CTX: [[u16; 3]; 7] = [
47374752 [28312, 32768, 0],
47384753 [32169, 32768, 0],
47394754 ];
4755+/// Default CDF table `TXB_SKIP_LUMA_16_Q3_CTX` (AV1 spec 9.4 initial probabilities).
47404756 pub const TXB_SKIP_LUMA_16_Q3_CTX: [[u16; 3]; 7] = [
47414757 [32510, 32768, 0],
47424758 [8430, 32768, 0],
@@ -4746,6 +4762,7 @@ pub const TXB_SKIP_LUMA_16_Q3_CTX: [[u16; 3]; 7] = [
47464762 [28789, 32768, 0],
47474763 [32139, 32768, 0],
47484764 ];
4765+/// Default CDF table `TXB_SKIP_LUMA_32_Q0_CTX` (AV1 spec 9.4 initial probabilities).
47494766 pub const TXB_SKIP_LUMA_32_Q0_CTX: [[u16; 3]; 7] = [
47504767 [17920, 32768, 0],
47514768 [1818, 32768, 0],
@@ -4755,6 +4772,7 @@ pub const TXB_SKIP_LUMA_32_Q0_CTX: [[u16; 3]; 7] = [
47554772 [31554, 32768, 0],
47564773 [32624, 32768, 0],
47574774 ];
4775+/// Default CDF table `TXB_SKIP_LUMA_32_Q1_CTX` (AV1 spec 9.4 initial probabilities).
47584776 pub const TXB_SKIP_LUMA_32_Q1_CTX: [[u16; 3]; 7] = [
47594777 [26726, 32768, 0],
47604778 [1045, 32768, 0],
@@ -4764,6 +4782,7 @@ pub const TXB_SKIP_LUMA_32_Q1_CTX: [[u16; 3]; 7] = [
47644782 [25970, 32768, 0],
47654783 [31938, 32768, 0],
47664784 ];
4785+/// Default CDF table `TXB_SKIP_LUMA_32_CTX` (AV1 spec 9.4 initial probabilities).
47674786 pub const TXB_SKIP_LUMA_32_CTX: [[u16; 3]; 7] = [
47684787 [30669, 32768, 0],
47694788 [3832, 32768, 0],
@@ -4773,6 +4792,7 @@ pub const TXB_SKIP_LUMA_32_CTX: [[u16; 3]; 7] = [
47734792 [23313, 32768, 0],
47744793 [31330, 32768, 0],
47754794 ];
4795+/// Default CDF table `TXB_SKIP_LUMA_32_Q3_CTX` (AV1 spec 9.4 initial probabilities).
47764796 pub const TXB_SKIP_LUMA_32_Q3_CTX: [[u16; 3]; 7] = [
47774797 [31671, 32768, 0],
47784798 [2056, 32768, 0],
@@ -4782,6 +4802,7 @@ pub const TXB_SKIP_LUMA_32_Q3_CTX: [[u16; 3]; 7] = [
47824802 [24715, 32768, 0],
47834803 [31484, 32768, 0],
47844804 ];
4805+/// Default CDF table `TXB_SKIP_LUMA_64_Q0_CTX` (AV1 spec 9.4 initial probabilities).
47854806 pub const TXB_SKIP_LUMA_64_Q0_CTX: [[u16; 3]; 7] = [
47864807 [6308, 32768, 0],
47874808 [117, 32768, 0],
@@ -4791,6 +4812,7 @@ pub const TXB_SKIP_LUMA_64_Q0_CTX: [[u16; 3]; 7] = [
47914812 [10923, 32768, 0],
47924813 [30247, 32768, 0],
47934814 ];
4815+/// Default CDF table `TXB_SKIP_LUMA_64_Q1_CTX` (AV1 spec 9.4 initial probabilities).
47944816 pub const TXB_SKIP_LUMA_64_Q1_CTX: [[u16; 3]; 7] = [
47954817 [26584, 32768, 0],
47964818 [188, 32768, 0],
@@ -4800,6 +4822,7 @@ pub const TXB_SKIP_LUMA_64_Q1_CTX: [[u16; 3]; 7] = [
48004822 [30583, 32768, 0],
48014823 [32608, 32768, 0],
48024824 ];
4825+/// Default CDF table `TXB_SKIP_LUMA_64_CTX` (AV1 spec 9.4 initial probabilities).
48034826 pub const TXB_SKIP_LUMA_64_CTX: [[u16; 3]; 7] = [
48044827 [28573, 32768, 0],
48054828 [3183, 32768, 0],
@@ -4809,6 +4832,7 @@ pub const TXB_SKIP_LUMA_64_CTX: [[u16; 3]; 7] = [
48094832 [27832, 32768, 0],
48104833 [32387, 32768, 0],
48114834 ];
4835+/// Default CDF table `TXB_SKIP_LUMA_64_Q3_CTX` (AV1 spec 9.4 initial probabilities).
48124836 pub const TXB_SKIP_LUMA_64_Q3_CTX: [[u16; 3]; 7] = [
48134837 [31539, 32768, 0],
48144838 [8433, 32768, 0],
@@ -4838,6 +4862,7 @@ pub const TXB_SKIP_LUMA_4_Q0_CTX: [[u16; 3]; 7] = [
48384862 [27473, 32768, 0],
48394863 [32487, 32768, 0],
48404864 ];
4865+/// Default CDF table `TXB_SKIP_LUMA_4_Q1_CTX` (AV1 spec 9.4 initial probabilities).
48414866 pub const TXB_SKIP_LUMA_4_Q1_CTX: [[u16; 3]; 7] = [
48424867 [30371, 32768, 0],
48434868 [7570, 32768, 0],
@@ -4847,6 +4872,7 @@ pub const TXB_SKIP_LUMA_4_Q1_CTX: [[u16; 3]; 7] = [
48474872 [27067, 32768, 0],
48484873 [32013, 32768, 0],
48494874 ];
4875+/// Default CDF table `TXB_SKIP_LUMA_4_CTX` (AV1 spec 9.4 initial probabilities).
48504876 pub const TXB_SKIP_LUMA_4_CTX: [[u16; 3]; 7] = [
48514877 [29614, 32768, 0],
48524878 [9068, 32768, 0],
@@ -4856,6 +4882,7 @@ pub const TXB_SKIP_LUMA_4_CTX: [[u16; 3]; 7] = [
48564882 [24619, 32768, 0],
48574883 [30642, 32768, 0],
48584884 ];
4885+/// Default CDF table `TXB_SKIP_LUMA_4_Q3_CTX` (AV1 spec 9.4 initial probabilities).
48594886 pub const TXB_SKIP_LUMA_4_Q3_CTX: [[u16; 3]; 7] = [
48604887 [26887, 32768, 0],
48614888 [6729, 32768, 0],
@@ -4869,8 +4896,11 @@ pub const TXB_SKIP_LUMA_4_Q3_CTX: [[u16; 3]; 7] = [
48694896 /// The end-of-block group of a 4x4 luma transform (`av1_default_eob_multi16_cdfs`,
48704897 /// `PLANE_TYPES` idx0 luma).
48714898 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).
48724900 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).
48734902 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).
48744904 pub const EOB_PT_16_LUMA_Q3: [u16; 6] = [6708, 8958, 14746, 22133, 32768, 0];
48754905
48764906 /// 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,
49034933 /// [`EOB_PT_32_LUMA_CLASS1_Q0`]'s q-context 3 sibling.
49044934 pub const EOB_PT_32_LUMA_CLASS1_Q3: [u16; 7] = [1156, 1702, 3675, 9274, 20539, 32768, 0];
49054935
4936+/// Default CDF table `EOB_PT_16_LUMA_CLASS1_Q0` (AV1 spec 9.4 initial probabilities).
49064937 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).
49074939 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).
49084941 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).
49094943 pub const EOB_PT_16_LUMA_CLASS1_Q3: [u16; 6] = [1222, 2074, 4783, 15410, 32768, 0];
49104944
49114945 // EOB_EXTRA_LUMA_4
4946+/// Default CDF table `EOB_EXTRA_LUMA_4_Q0` (AV1 spec 9.4 initial probabilities).
49124947 pub const EOB_EXTRA_LUMA_4_Q0: [[u16; 3]; 9] = [
49134948 [16961, 32768, 0],
49144949 [17223, 32768, 0],
@@ -4921,6 +4956,7 @@ pub const EOB_EXTRA_LUMA_4_Q0: [[u16; 3]; 9] = [
49214956 [16384, 32768, 0],
49224957 ];
49234958
4959+/// Default CDF table `EOB_EXTRA_LUMA_4_Q1` (AV1 spec 9.4 initial probabilities).
49244960 pub const EOB_EXTRA_LUMA_4_Q1: [[u16; 3]; 9] = [
49254961 [17471, 32768, 0],
49264962 [20223, 32768, 0],
@@ -4933,6 +4969,7 @@ pub const EOB_EXTRA_LUMA_4_Q1: [[u16; 3]; 9] = [
49334969 [16384, 32768, 0],
49344970 ];
49354971
4972+/// Default CDF table `EOB_EXTRA_LUMA_4` (AV1 spec 9.4 initial probabilities).
49364973 pub const EOB_EXTRA_LUMA_4: [[u16; 3]; 9] = [
49374974 [18983, 32768, 0],
49384975 [20512, 32768, 0],
@@ -4945,6 +4982,7 @@ pub const EOB_EXTRA_LUMA_4: [[u16; 3]; 9] = [
49454982 [16384, 32768, 0],
49464983 ];
49474984
4985+/// Default CDF table `EOB_EXTRA_LUMA_4_Q3` (AV1 spec 9.4 initial probabilities).
49484986 pub const EOB_EXTRA_LUMA_4_Q3: [[u16; 3]; 9] = [
49494987 [20177, 32768, 0],
49504988 [20789, 32768, 0],
@@ -4958,6 +4996,7 @@ pub const EOB_EXTRA_LUMA_4_Q3: [[u16; 3]; 9] = [
49584996 ];
49594997
49604998 // COEFF_BASE_LUMA_4
4999+/// Default CDF table `COEFF_BASE_LUMA_4_Q0` (AV1 spec 9.4 initial probabilities).
49615000 pub const COEFF_BASE_LUMA_4_Q0: [[u16; 5]; 42] = [
49625001 [4034, 8930, 12727, 32768, 0],
49635002 [18082, 29741, 31877, 32768, 0],
@@ -5003,6 +5042,7 @@ pub const COEFF_BASE_LUMA_4_Q0: [[u16; 5]; 42] = [
50035042 [8192, 16384, 24576, 32768, 0],
50045043 ];
50055044
5045+/// Default CDF table `COEFF_BASE_LUMA_4_Q1` (AV1 spec 9.4 initial probabilities).
50065046 pub const COEFF_BASE_LUMA_4_Q1: [[u16; 5]; 42] = [
50075047 [6041, 11854, 15927, 32768, 0],
50085048 [20326, 30905, 32251, 32768, 0],
@@ -5048,6 +5088,7 @@ pub const COEFF_BASE_LUMA_4_Q1: [[u16; 5]; 42] = [
50485088 [8192, 16384, 24576, 32768, 0],
50495089 ];
50505090
5091+/// Default CDF table `COEFF_BASE_LUMA_4` (AV1 spec 9.4 initial probabilities).
50515092 pub const COEFF_BASE_LUMA_4: [[u16; 5]; 42] = [
50525093 [8896, 16227, 20630, 32768, 0],
50535094 [23629, 31782, 32527, 32768, 0],
@@ -5093,6 +5134,7 @@ pub const COEFF_BASE_LUMA_4: [[u16; 5]; 42] = [
50935134 [8192, 16384, 24576, 32768, 0],
50945135 ];
50955136
5137+/// Default CDF table `COEFF_BASE_LUMA_4_Q3` (AV1 spec 9.4 initial probabilities).
50965138 pub const COEFF_BASE_LUMA_4_Q3: [[u16; 5]; 42] = [
50975139 [7062, 16472, 22319, 32768, 0],
50985140 [24538, 32261, 32674, 32768, 0],
@@ -5139,6 +5181,7 @@ pub const COEFF_BASE_LUMA_4_Q3: [[u16; 5]; 42] = [
51395181 ];
51405182
51415183 // COEFF_BASE_EOB_LUMA_4
5184+/// Default CDF table `COEFF_BASE_EOB_LUMA_4_Q0` (AV1 spec 9.4 initial probabilities).
51425185 pub const COEFF_BASE_EOB_LUMA_4_Q0: [[u16; 4]; 4] = [
51435186 [17837, 29055, 32768, 0],
51445187 [29600, 31446, 32768, 0],
@@ -5146,6 +5189,7 @@ pub const COEFF_BASE_EOB_LUMA_4_Q0: [[u16; 4]; 4] = [
51465189 [24926, 28948, 32768, 0],
51475190 ];
51485191
5192+/// Default CDF table `COEFF_BASE_EOB_LUMA_4_Q1` (AV1 spec 9.4 initial probabilities).
51495193 pub const COEFF_BASE_EOB_LUMA_4_Q1: [[u16; 4]; 4] = [
51505194 [17560, 29888, 32768, 0],
51515195 [29671, 31549, 32768, 0],
@@ -5153,6 +5197,7 @@ pub const COEFF_BASE_EOB_LUMA_4_Q1: [[u16; 4]; 4] = [
51535197 [27286, 30006, 32768, 0],
51545198 ];
51555199
5200+/// Default CDF table `COEFF_BASE_EOB_LUMA_4` (AV1 spec 9.4 initial probabilities).
51565201 pub const COEFF_BASE_EOB_LUMA_4: [[u16; 4]; 4] = [
51575202 [20092, 30774, 32768, 0],
51585203 [30695, 32020, 32768, 0],
@@ -5160,6 +5205,7 @@ pub const COEFF_BASE_EOB_LUMA_4: [[u16; 4]; 4] = [
51605205 [28666, 30870, 32768, 0],
51615206 ];
51625207
5208+/// Default CDF table `COEFF_BASE_EOB_LUMA_4_Q3` (AV1 spec 9.4 initial probabilities).
51635209 pub const COEFF_BASE_EOB_LUMA_4_Q3: [[u16; 4]; 4] = [
51645210 [22497, 31198, 32768, 0],
51655211 [31715, 32495, 32768, 0],
@@ -5168,6 +5214,7 @@ pub const COEFF_BASE_EOB_LUMA_4_Q3: [[u16; 4]; 4] = [
51685214 ];
51695215
51705216 // COEFF_BR_LUMA_4
5217+/// Default CDF table `COEFF_BR_LUMA_4_Q0` (AV1 spec 9.4 initial probabilities).
51715218 pub const COEFF_BR_LUMA_4_Q0: [[u16; 5]; 21] = [
51725219 [14298, 20718, 24174, 32768, 0],
51735220 [12536, 19601, 23789, 32768, 0],
@@ -5192,6 +5239,7 @@ pub const COEFF_BR_LUMA_4_Q0: [[u16; 5]; 21] = [
51925239 [3034, 5860, 8462, 32768, 0],
51935240 ];
51945241
5242+/// Default CDF table `COEFF_BR_LUMA_4_Q1` (AV1 spec 9.4 initial probabilities).
51955243 pub const COEFF_BR_LUMA_4_Q1: [[u16; 5]; 21] = [
51965244 [14995, 21341, 24749, 32768, 0],
51975245 [13158, 20289, 24601, 32768, 0],
@@ -5216,6 +5264,7 @@ pub const COEFF_BR_LUMA_4_Q1: [[u16; 5]; 21] = [
52165264 [3793, 7278, 10447, 32768, 0],
52175265 ];
52185266
5267+/// Default CDF table `COEFF_BR_LUMA_4` (AV1 spec 9.4 initial probabilities).
52195268 pub const COEFF_BR_LUMA_4: [[u16; 5]; 21] = [
52205269 [16138, 22223, 25509, 32768, 0],
52215270 [15347, 22430, 26332, 32768, 0],
@@ -5240,6 +5289,7 @@ pub const COEFF_BR_LUMA_4: [[u16; 5]; 21] = [
52405289 [5413, 10335, 14498, 32768, 0],
52415290 ];
52425291
5292+/// Default CDF table `COEFF_BR_LUMA_4_Q3` (AV1 spec 9.4 initial probabilities).
52435293 pub const COEFF_BR_LUMA_4_Q3: [[u16; 5]; 21] = [
52445294 [18315, 24289, 27551, 32768, 0],
52455295 [16854, 24068, 27835, 32768, 0],
@@ -5295,79 +5345,115 @@ pub const INTRA_TX_TYPE_SET1_4: [[u16; 8]; 13] = [
52955345 /// `DCTONLY`) hold no 1D type.
52965346 pub const EOB_PT_256_LUMA_CLASS1_Q0: [u16; 10] =
52975347 [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).
52985349 pub const EOB_PT_256_LUMA_CLASS1_Q1: [u16; 10] =
52995350 [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).
53005352 pub const EOB_PT_256_LUMA_CLASS1: [u16; 10] =
53015353 [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).
53025355 pub const EOB_PT_256_LUMA_CLASS1_Q3: [u16; 10] =
53035356 [2453, 4474, 6307, 8777, 16474, 22975, 29000, 31547, 32768, 0];
53045357
5358+/// Default CDF table `EOB_PT_256_CHROMA_CLASS1_Q0` (AV1 spec 9.4 initial probabilities).
53055359 pub const EOB_PT_256_CHROMA_CLASS1_Q0: [u16; 10] =
53065360 [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).
53075362 pub const EOB_PT_256_CHROMA_CLASS1_Q1: [u16; 10] =
53085363 [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).
53095365 pub const EOB_PT_256_CHROMA_CLASS1: [u16; 10] =
53105366 [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).
53115368 pub const EOB_PT_256_CHROMA_CLASS1_Q3: [u16; 10] =
53125369 [9998, 17661, 25178, 28097, 31308, 32038, 32403, 32695, 32768, 0];
53135370
5371+/// Default CDF table `EOB_PT_64_CHROMA_CLASS1_Q0` (AV1 spec 9.4 initial probabilities).
53145372 pub const EOB_PT_64_CHROMA_CLASS1_Q0: [u16; 8] =
53155373 [1563, 2700, 4876, 10911, 14706, 22480, 32768, 0];
5374+/// Default CDF table `EOB_PT_64_CHROMA_CLASS1_Q1` (AV1 spec 9.4 initial probabilities).
53165375 pub const EOB_PT_64_CHROMA_CLASS1_Q1: [u16; 8] =
53175376 [1923, 3127, 5867, 9703, 14277, 27100, 32768, 0];
5377+/// Default CDF table `EOB_PT_64_CHROMA_CLASS1` (AV1 spec 9.4 initial probabilities).
53185378 pub const EOB_PT_64_CHROMA_CLASS1: [u16; 8] =
53195379 [4034, 6290, 10235, 14982, 21214, 28491, 32768, 0];
5380+/// Default CDF table `EOB_PT_64_CHROMA_CLASS1_Q3` (AV1 spec 9.4 initial probabilities).
53205381 pub const EOB_PT_64_CHROMA_CLASS1_Q3: [u16; 8] =
53215382 [8726, 12378, 19409, 26450, 30038, 32462, 32768, 0];
53225383
5384+/// Default CDF table `EOB_PT_16_CHROMA_CLASS1_Q0` (AV1 spec 9.4 initial probabilities).
53235385 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).
53245387 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).
53255389 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).
53265391 pub const EOB_PT_16_CHROMA_CLASS1_Q3: [u16; 6] = [7297, 10767, 19273, 28194, 32768, 0];
53275392
53285393 /// `EOB_PT_128_LUMA`'s class-1 sibling (`av1_default_eob_multi128_cdfs[q][0][1]`),
53295394 /// read by a 16x8/8x16 luma transform whose inherited `tx_type` is 1D
53305395 /// (`TxbSet::LumaRect16x8`) -- machine-extracted, scripts/extract-eob-class1.py.
53315396 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).
53325398 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).
53335400 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).
53345402 pub const EOB_PT_128_LUMA_CLASS1_Q3: [u16; 9] = [886, 1731, 3271, 8469, 15569, 22126, 28383, 32768, 0];
53355403
53365404 /// `EOB_PT_32_CHROMA`'s class-1 sibling (`av1_default_eob_multi32_cdfs[q][1][1]`),
53375405 /// read by an 8x4/4x8 chroma transform under a 1D luma `tx_type`
53385406 /// (`TxbSet::ChromaRect8x4`) -- machine-extracted, scripts/extract-eob-class1.py.
53395407 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).
53405409 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).
53415411 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).
53425413 pub const EOB_PT_32_CHROMA_CLASS1_Q3: [u16; 7] = [7699, 10897, 20891, 26926, 31628, 32768, 0];
53435414
53445415 /// `EOB_PT_128_CHROMA`'s class-1 sibling (`av1_default_eob_multi128_cdfs[q][1][1]`).
53455416 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).
53465418 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).
53475420 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).
53485422 pub const EOB_PT_128_CHROMA_CLASS1_Q3: [u16; 9] = [9165, 13282, 21150, 30286, 31894, 32571, 32712, 32768, 0];
53495423
53505424 /// `EOB_PT_512_LUMA`'s class-1 sibling (`av1_default_eob_multi512_cdfs[q][0][1]`).
53515425 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).
53525427 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).
53535429 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).
53545431 pub const EOB_PT_512_LUMA_CLASS1_Q3: [u16; 11] = [3277, 6554, 9830, 13107, 16384, 19661, 22938, 26214, 29491, 32768, 0];
53555432
53565433 /// `EOB_PT_512_CHROMA`'s class-1 sibling (`av1_default_eob_multi512_cdfs[q][1][1]`).
53575434 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).
53585436 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).
53595438 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).
53605440 pub const EOB_PT_512_CHROMA_CLASS1_Q3: [u16; 11] = [3277, 6554, 9830, 13107, 16384, 19661, 22938, 26214, 29491, 32768, 0];
53615441
53625442 /// `EOB_PT_1024_LUMA`'s class-1 sibling (`av1_default_eob_multi1024_cdfs[q][0][1]`).
53635443 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).
53645445 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).
53655447 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).
53665449 pub const EOB_PT_1024_LUMA_CLASS1_Q3: [u16; 12] = [2979, 5958, 8937, 11916, 14895, 17873, 20852, 23831, 26810, 29789, 32768, 0];
53675450
53685451 /// `EOB_PT_1024_CHROMA`'s class-1 sibling (`av1_default_eob_multi1024_cdfs[q][1][1]`).
53695452 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).
53705454 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).
53715456 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).
53725458 pub const EOB_PT_1024_CHROMA_CLASS1_Q3: [u16; 12] = [2979, 5958, 8937, 11916, 14895, 17873, 20852, 23831, 26810, 29789, 32768, 0];
53735459
crates/ec-av1/src/decode.rsmodified+191 -27
@@ -243,9 +243,9 @@ pub(crate) fn sb_mi_cur(fctx: &crate::decode::FrameCtx) -> u32 {
243243 if sb128(fctx) { SB_MI * 2 } else { SB_MI }
244244 }
245245
246-/// How many real 128-level partition symbols this decoder has read, and how
247-/// many superblocks resolved to `PARTITION_SPLIT` (coded or forced) -- the
248-/// gate's proof a `--sb-size=128` stream exercised the 128 partition root.
246+// How many real 128-level partition symbols this decoder has read, and how
247+// many superblocks resolved to `PARTITION_SPLIT` (coded or forced) -- the
248+// gate's proof a `--sb-size=128` stream exercised the 128 partition root.
249249 thread_local! {
250250 static PART128_SYMBOLS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
251251 static PART128_SPLIT_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
@@ -255,16 +255,19 @@ thread_local! {
255255 /// Current value of `PART128_GATHERED_SYMBOLS`: 128 roots that read the
256256 /// half-out-of-frame gathered split_or_horz/split_or_vert symbol (spec
257257 /// 5.11.4), which this decoder used to read and throw away.
258+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
258259 pub(crate) fn part128_gathered_symbols() -> usize {
259260 PART128_GATHERED_SYMBOLS.with(|c| c.get())
260261 }
261262
262263 /// Current value of [`PART128_SYMBOLS`].
264+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
263265 pub(crate) fn part128_symbols() -> usize {
264266 PART128_SYMBOLS.with(|c| c.get())
265267 }
266268
267269 /// Current value of [`PART128_SPLIT_HITS`].
270+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
268271 pub(crate) fn part128_split_hits() -> usize {
269272 PART128_SPLIT_HITS.with(|c| c.get())
270273 }
@@ -293,6 +296,7 @@ thread_local! {
293296 }
294297
295298 /// Current value of [`FILTER_INTRA_HITS`].
299+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
296300 pub(crate) fn filter_intra_hits() -> usize {
297301 FILTER_INTRA_HITS.with(|c| c.get())
298302 }
@@ -307,6 +311,7 @@ thread_local! {
307311 }
308312
309313 /// Current value of [`INTRA_IN_INTER_FILTER_INTRA_HITS`].
314+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
310315 pub(crate) fn intra_in_inter_filter_intra_hits() -> usize {
311316 INTRA_IN_INTER_FILTER_INTRA_HITS.with(|c| c.get())
312317 }
@@ -323,11 +328,13 @@ thread_local! {
323328 }
324329
325330 /// Current value of [`INTRA_IN_INTER_ANGLE_DELTA_Y_HITS`].
331+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
326332 pub(crate) fn intra_in_inter_angle_delta_y_hits() -> usize {
327333 INTRA_IN_INTER_ANGLE_DELTA_Y_HITS.with(|c| c.get())
328334 }
329335
330336 /// Current value of [`INTRA_IN_INTER_ANGLE_DELTA_UV_HITS`].
337+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
331338 pub(crate) fn intra_in_inter_angle_delta_uv_hits() -> usize {
332339 INTRA_IN_INTER_ANGLE_DELTA_UV_HITS.with(|c| c.get())
333340 }
@@ -348,12 +355,14 @@ thread_local! {
348355
349356 /// Nonzero luma angle deltas coded by an intra 8x8 leaf inside an inter frame
350357 /// (lane-leaf8tx r1) -- counted only in [`decode_inter_block8`]'s intra arm.
358+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
351359 pub(crate) fn intra_in_inter8_angle_delta_y_hits() -> usize {
352360 INTRA_IN_INTER8_ANGLE_DELTA_Y_HITS.with(|c| c.get())
353361 }
354362
355363 /// `(directional, smooth/paeth, CfL)` chroma modes coded by an intra 8x8 leaf
356364 /// inside an inter frame -- see [`INTRA_IN_INTER8_UV_DIR_HITS`].
365+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
357366 pub(crate) fn intra_in_inter8_uv_hits() -> (usize, usize, usize) {
358367 (
359368 INTRA_IN_INTER8_UV_DIR_HITS.with(|c| c.get()),
@@ -442,6 +451,7 @@ thread_local! {
442451 }
443452
444453 /// Current value of [`WARP_PLANE_SUPPRESS_HITS`].
454+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
445455 pub(crate) fn warp_plane_suppress_hits() -> usize {
446456 WARP_PLANE_SUPPRESS_HITS.with(|c| c.get())
447457 }
@@ -460,6 +470,7 @@ fn warp_plane_allowed(w: usize, h: usize) -> bool {
460470 }
461471
462472 /// Current value of [`CDEF_IDX_HITS`].
473+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
463474 pub(crate) fn cdef_idx_hits() -> usize {
464475 CDEF_IDX_HITS.with(|c| c.get())
465476 }
@@ -476,16 +487,19 @@ thread_local! {
476487 }
477488
478489 /// Current value of [`INTRA_IN_INTER_TXCTX_HITS`].
490+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
479491 pub(crate) fn intra_in_inter_txctx_hits() -> usize {
480492 INTRA_IN_INTER_TXCTX_HITS.with(|c| c.get())
481493 }
482494
483495 /// Current value of [`NON_CHROMA_REF_CTX_SKIP_HITS`].
496+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
484497 pub(crate) fn non_chroma_ref_ctx_skip_hits() -> usize {
485498 NON_CHROMA_REF_CTX_SKIP_HITS.with(|c| c.get())
486499 }
487500
488501 /// Current value of [`EDGE_FILTER_MI_FIX_HITS`].
502+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
489503 pub(crate) fn edge_filter_mi_fix_hits() -> usize {
490504 EDGE_FILTER_MI_FIX_HITS.with(|c| c.get())
491505 }
@@ -512,6 +526,7 @@ thread_local! {
512526 }
513527
514528 /// Current value of [`DELTA_Q_HITS`].
529+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
515530 pub(crate) fn delta_q_hits() -> usize {
516531 DELTA_Q_HITS.with(|c| c.get())
517532 }
@@ -581,6 +596,7 @@ thread_local! {
581596 }
582597
583598 /// Current value of [`DELTA_LF_HITS`].
599+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
584600 pub(crate) fn delta_lf_hits() -> usize {
585601 DELTA_LF_HITS.with(|c| c.get())
586602 }
@@ -720,21 +736,25 @@ pub(crate) fn take_segment_ids(fctx: &crate::decode::FrameCtx) -> Vec<u8> {
720736 }
721737
722738 /// How many `segment_id` symbols have been read (never reset per frame).
739+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
723740 pub(crate) fn segment_id_hits() -> usize {
724741 SEG_ID_HITS.with(|c| c.get())
725742 }
726743
727744 /// How many distinct segment ids any decoded block has carried.
745+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
728746 pub(crate) fn segment_ids_seen() -> usize {
729747 SEG_IDS_SEEN.with(|c| c.get().count_ones() as usize)
730748 }
731749
732750 /// How many `seg_id_predicted` symbols have been read (temporal update).
751+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
733752 pub(crate) fn segment_pred_hits() -> usize {
734753 SEG_PRED_HITS.with(|c| c.get())
735754 }
736755
737756 /// Resets the segmentation hit counters (gate setup).
757+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
738758 pub(crate) fn reset_segment_hits() {
739759 SEG_ID_HITS.with(|c| c.set(0));
740760 SEG_IDS_SEEN.with(|c| c.set(0));
@@ -1006,6 +1026,7 @@ thread_local! {
10061026 }
10071027
10081028 /// Current value of [`SMOOTH_LUMA_HITS`].
1029+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
10091030 pub(crate) fn smooth_luma_hits() -> usize {
10101031 SMOOTH_LUMA_HITS.with(|c| c.get())
10111032 }
@@ -1022,6 +1043,7 @@ thread_local! {
10221043 }
10231044
10241045 /// Current value of [`SPLIT_TU_REACH_FIX_HITS`].
1046+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
10251047 pub(crate) fn split_tu_reach_fix_hits() -> usize {
10261048 SPLIT_TU_REACH_FIX_HITS.with(|c| c.get())
10271049 }
@@ -1063,6 +1085,7 @@ thread_local! {
10631085 }
10641086
10651087 /// Current value of [`SMOOTH_UV_HITS`].
1088+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
10661089 pub(crate) fn smooth_uv_hits() -> usize {
10671090 SMOOTH_UV_HITS.with(|c| c.get())
10681091 }
@@ -1077,6 +1100,7 @@ thread_local! {
10771100 const { std::cell::Cell::new(0) };
10781101 }
10791102 /// Current value of [`TILE_HITS`].
1103+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
10801104 pub(crate) fn tile_hits() -> usize {
10811105 TILE_HITS.with(|c| c.get())
10821106 }
@@ -1096,6 +1120,7 @@ static PREFILT_PICTURE_IDX: std::sync::atomic::AtomicUsize =
10961120 std::sync::atomic::AtomicUsize::new(0);
10971121
10981122 /// Current value of [`DEBLOCK_HITS`].
1123+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
10991124 pub(crate) fn deblock_hits() -> usize {
11001125 DEBLOCK_HITS.with(|c| c.get())
11011126 }
@@ -1111,6 +1136,7 @@ thread_local! {
11111136 }
11121137
11131138 /// Current value of [`UNI_COMP_HITS`].
1139+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
11141140 pub(crate) fn uni_comp_hits() -> usize {
11151141 UNI_COMP_HITS.with(|c| c.get())
11161142 }
@@ -1125,6 +1151,7 @@ thread_local! {
11251151 }
11261152
11271153 /// Current value of [`DIFFWTD_HITS`].
1154+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
11281155 pub(crate) fn diffwtd_hits() -> usize {
11291156 DIFFWTD_HITS.with(|c| c.get())
11301157 }
@@ -1140,6 +1167,7 @@ thread_local! {
11401167 }
11411168
11421169 /// Current value of [`DIFFWTD_INFERRED_HITS`].
1170+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
11431171 pub(crate) fn diffwtd_inferred_hits() -> usize {
11441172 DIFFWTD_INFERRED_HITS.with(|c| c.get())
11451173 }
@@ -1156,6 +1184,7 @@ thread_local! {
11561184 }
11571185
11581186 /// Current value of [`FWD_KF_HITS`].
1187+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
11591188 pub(crate) fn fwd_kf_hits() -> usize {
11601189 FWD_KF_HITS.with(|c| c.get())
11611190 }
@@ -1189,11 +1218,13 @@ thread_local! {
11891218 }
11901219
11911220 /// Current value of [`SQ_CHROMA_TX_HITS`].
1221+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
11921222 pub(crate) fn sq_chroma_tx_hits() -> usize {
11931223 SQ_CHROMA_TX_HITS.with(|c| c.get())
11941224 }
11951225
11961226 /// Current value of [`TX_DEPTH_HITS`].
1227+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
11971228 pub(crate) fn tx_depth_hits() -> usize {
11981229 TX_DEPTH_HITS.with(|c| c.get())
11991230 }
@@ -1237,21 +1268,25 @@ thread_local! {
12371268 }
12381269
12391270 /// Current value of [`TXFM_SPLIT_READS`].
1271+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
12401272 pub(crate) fn txfm_split_reads() -> usize {
12411273 TXFM_SPLIT_READS.with(|c| c.get())
12421274 }
12431275
12441276 /// Current value of [`TXFM_SPLIT_HITS`].
1277+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
12451278 pub(crate) fn txfm_split_hits() -> usize {
12461279 TXFM_SPLIT_HITS.with(|c| c.get())
12471280 }
12481281
12491282 /// Current value of [`INTER_LEAF16_HORZ_HITS`] (lane-inter4 r3).
1283+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
12501284 pub(crate) fn inter_leaf16_horz_hits() -> usize {
12511285 INTER_LEAF16_HORZ_HITS.with(|c| c.get())
12521286 }
12531287
12541288 /// Current value of [`INTER_LEAF16_VERT_HITS`] (lane-inter4 r3).
1289+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
12551290 pub(crate) fn inter_leaf16_vert_hits() -> usize {
12561291 INTER_LEAF16_VERT_HITS.with(|c| c.get())
12571292 }
@@ -1328,6 +1363,7 @@ thread_local! {
13281363 }
13291364
13301365 /// Current value of [`VERT_B_INTRA_HITS`].
1366+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
13311367 pub(crate) fn vert_b_intra_hits() -> usize {
13321368 VERT_B_INTRA_HITS.with(|c| c.get())
13331369 }
@@ -1342,7 +1378,7 @@ thread_local! {
13421378 static AB16_HITS: std::cell::Cell<[usize; 4]> = const { std::cell::Cell::new([0; 4]) };
13431379 }
13441380
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).
13461382 thread_local! {
13471383 /// 4x4 transform units decoded inside an 8x8 square of a
13481384 /// `PARTITION_VERT_A`/`_B` -- the exact call that panicked before
@@ -1351,10 +1387,12 @@ thread_local! {
13511387 static VERT_AB_TX4_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
13521388 }
13531389
1390+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
13541391 pub(crate) fn vert_ab_tx4_hits() -> usize {
13551392 VERT_AB_TX4_HITS.with(std::cell::Cell::get)
13561393 }
13571394
1395+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
13581396 pub(crate) fn ab16_hits_by_arm() -> [usize; 4] {
13591397 AB16_HITS.with(std::cell::Cell::get)
13601398 }
@@ -1379,6 +1417,7 @@ thread_local! {
13791417 }
13801418
13811419 /// Current value of [`HORZ_VERT_INTRA_HITS`].
1420+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
13821421 pub(crate) fn horz_vert_intra_hits() -> usize {
13831422 HORZ_VERT_INTRA_HITS.with(|c| c.get())
13841423 }
@@ -1394,6 +1433,7 @@ thread_local! {
13941433 }
13951434
13961435 /// Current value of [`EDGE_RECT_STRIP_HITS`].
1436+#[allow(dead_code)] // gate counter accessor with no reader yet; the counter itself is live
13971437 pub(crate) fn edge_rect_strip_hits() -> usize {
13981438 EDGE_RECT_STRIP_HITS.with(|c| c.get())
13991439 }
@@ -1447,11 +1487,13 @@ pub fn reset_inter_edge_strip_hits() {
14471487 }
14481488
14491489 /// Current value of [`EDGE_BOTH_CUT_HITS`] (`[16, 32, 64, 128]` levels).
1490+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
14501491 pub(crate) fn edge_both_cut_hits() -> [usize; 4] {
14511492 EDGE_BOTH_CUT_HITS.with(|c| c.get())
14521493 }
14531494
14541495 /// 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
14551497 pub(crate) fn reset_edge_both_cut_hits() {
14561498 EDGE_BOTH_CUT_HITS.with(|c| c.set([0; 4]));
14571499 }
@@ -1466,6 +1508,7 @@ thread_local! {
14661508 }
14671509
14681510 /// Current value of [`RECT_SPLIT_TX_HITS`].
1511+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
14691512 pub(crate) fn rect_split_tx_hits() -> usize {
14701513 RECT_SPLIT_TX_HITS.with(|c| c.get())
14711514 }
@@ -1482,6 +1525,7 @@ thread_local! {
14821525 }
14831526
14841527 /// Current value of [`RECT_SPLIT_SB_INTERIOR_TU_HITS`].
1528+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
14851529 pub(crate) fn rect_split_sb_interior_tu_hits() -> usize {
14861530 RECT_SPLIT_SB_INTERIOR_TU_HITS.with(|c| c.get())
14871531 }
@@ -1498,6 +1542,7 @@ thread_local! {
14981542 }
14991543
15001544 /// Current value of [`RECT_SPLIT_CHROMA_SHAPE_HITS`] (32x8, 8x32, 8x4, 4x8).
1545+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
15011546 pub(crate) fn rect_split_chroma_shape_hits() -> [usize; 4] {
15021547 RECT_SPLIT_CHROMA_SHAPE_HITS.with(|c| c.get())
15031548 }
@@ -1512,6 +1557,7 @@ thread_local! {
15121557 }
15131558
15141559 /// Current value of [`FILTER_INTRA_RECT_HITS`].
1560+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
15151561 pub(crate) fn filter_intra_rect_hits() -> usize {
15161562 FILTER_INTRA_RECT_HITS.with(|c| c.get())
15171563 }
@@ -1532,11 +1578,13 @@ thread_local! {
15321578 }
15331579
15341580 /// Current value of [`FILTER_INTRA_RECT4_HORZ_HITS`] (32x8 strips).
1581+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
15351582 pub(crate) fn filter_intra_rect4_horz_hits() -> usize {
15361583 FILTER_INTRA_RECT4_HORZ_HITS.with(|c| c.get())
15371584 }
15381585
15391586 /// Current value of [`FILTER_INTRA_RECT4_VERT_HITS`] (8x32 strips).
1587+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
15401588 pub(crate) fn filter_intra_rect4_vert_hits() -> usize {
15411589 FILTER_INTRA_RECT4_VERT_HITS.with(|c| c.get())
15421590 }
@@ -1551,6 +1599,7 @@ thread_local! {
15511599 }
15521600
15531601 /// Current value of [`RECT_COEFF_TU_HITS`].
1602+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
15541603 pub(crate) fn rect_coeff_tu_hits() -> usize {
15551604 RECT_COEFF_TU_HITS.with(|c| c.get())
15561605 }
@@ -1559,6 +1608,7 @@ pub(crate) fn rect_coeff_tu_hits() -> usize {
15591608 /// (`V_DCT`/`H_DCT`) -- [`TX_CLASS1_HITS`]'s rect-only half, so a gate can
15601609 /// pin that the 1D-class-on-a-RECT-transform path fired rather than settling
15611610 /// for the square reader's own 1D types.
1611+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
15621612 pub(crate) fn rect_class1_hits() -> usize {
15631613 RECT_CLASS1_HITS.with(|c| c.get())
15641614 }
@@ -1574,6 +1624,7 @@ thread_local! {
15741624 }
15751625
15761626 /// Current value of [`FILTER_INTRA_RECT_SUB16_HITS`].
1627+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
15771628 pub(crate) fn filter_intra_rect_sub16_hits() -> usize {
15781629 FILTER_INTRA_RECT_SUB16_HITS.with(|c| c.get())
15791630 }
@@ -1587,6 +1638,7 @@ thread_local! {
15871638 }
15881639
15891640 /// Current value of [`FILTER_INTRA_RECT_SUB8_HITS`].
1641+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
15901642 pub(crate) fn filter_intra_rect_sub8_hits() -> usize {
15911643 FILTER_INTRA_RECT_SUB8_HITS.with(|c| c.get())
15921644 }
@@ -1612,6 +1664,7 @@ thread_local! {
16121664 }
16131665
16141666 /// Current value of [`DIRECTIONAL_UV_HITS`].
1667+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
16151668 pub(crate) fn directional_uv_hits() -> usize {
16161669 DIRECTIONAL_UV_HITS.with(|c| c.get())
16171670 }
@@ -1637,6 +1690,7 @@ thread_local! {
16371690 }
16381691
16391692 /// Current value of [`NON_LAST_REF_HITS`].
1693+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
16401694 pub(crate) fn non_last_ref_hits() -> usize {
16411695 NON_LAST_REF_HITS.with(|c| c.get())
16421696 }
@@ -1683,6 +1737,7 @@ thread_local! {
16831737 }
16841738
16851739 /// Current value of [`COMP_MODE_HITS`].
1740+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
16861741 pub(crate) fn comp_mode_hits() -> usize {
16871742 COMP_MODE_HITS.with(|c| c.get())
16881743 }
@@ -1697,6 +1752,7 @@ thread_local! {
16971752 }
16981753
16991754 /// Current value of [`PALETTE_HITS`].
1755+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
17001756 pub(crate) fn palette_hits() -> usize {
17011757 PALETTE_HITS.with(|c| c.get())
17021758 }
@@ -1710,6 +1766,7 @@ thread_local! {
17101766 }
17111767
17121768 /// Current value of [`PALETTE_TILE_LEFT_HITS`].
1769+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
17131770 pub(crate) fn palette_tile_left_hits() -> usize {
17141771 PALETTE_TILE_LEFT_HITS.with(|c| c.get())
17151772 }
@@ -1722,6 +1779,7 @@ thread_local! {
17221779 }
17231780
17241781 /// Current value of [`PALETTE_UV_HITS`].
1782+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
17251783 pub(crate) fn palette_uv_hits() -> usize {
17261784 PALETTE_UV_HITS.with(|c| c.get())
17271785 }
@@ -1734,6 +1792,7 @@ thread_local! {
17341792 }
17351793
17361794 /// Current value of [`PALETTE_RECT_HITS`].
1795+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
17371796 pub(crate) fn palette_rect_hits() -> usize {
17381797 PALETTE_RECT_HITS.with(|c| c.get())
17391798 }
@@ -1753,6 +1812,7 @@ thread_local! {
17531812 }
17541813
17551814 /// Current value of [`RECT_SCREEN_CONTENT_HITS`].
1815+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
17561816 pub(crate) fn rect_screen_content_hits() -> usize {
17571817 RECT_SCREEN_CONTENT_HITS.with(|c| c.get())
17581818 }
@@ -1774,11 +1834,13 @@ thread_local! {
17741834 }
17751835
17761836 /// Current value of [`RECT4_PALETTE_HITS`].
1837+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
17771838 pub(crate) fn rect4_palette_hits() -> usize {
17781839 RECT4_PALETTE_HITS.with(|c| c.get())
17791840 }
17801841
17811842 /// Current value of [`PALETTE_SPLIT_TX_HITS`].
1843+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
17821844 pub(crate) fn palette_split_tx_hits() -> usize {
17831845 PALETTE_SPLIT_TX_HITS.with(|c| c.get())
17841846 }
@@ -1792,11 +1854,13 @@ thread_local! {
17921854 }
17931855
17941856 /// Current value of [`PALETTE_LEAF8_HITS`].
1857+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
17951858 pub(crate) fn palette_leaf8_hits() -> usize {
17961859 PALETTE_LEAF8_HITS.with(|c| c.get())
17971860 }
17981861
17991862 /// Zeroes [`PALETTE_LEAF8_HITS`] (per-attempt gate counting).
1863+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
18001864 pub(crate) fn reset_palette_leaf8_hits() {
18011865 PALETTE_LEAF8_HITS.with(|c| c.set(0));
18021866 }
@@ -1809,11 +1873,13 @@ thread_local! {
18091873 }
18101874
18111875 /// Current value of [`PALETTE_SB_STRIP_HITS`].
1876+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
18121877 pub(crate) fn palette_sb_strip_hits() -> usize {
18131878 PALETTE_SB_STRIP_HITS.with(|c| c.get())
18141879 }
18151880
18161881 /// Zeroes [`PALETTE_SB_STRIP_HITS`] (per-attempt gate counting).
1882+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
18171883 pub(crate) fn reset_palette_sb_strip_hits() {
18181884 PALETTE_SB_STRIP_HITS.with(|c| c.set(0));
18191885 }
@@ -1877,6 +1943,7 @@ thread_local! {
18771943 }
18781944
18791945 /// 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
18801947 pub(crate) fn intra_in_inter_split_tx_hits() -> [usize; 4] {
18811948 INTRA_IN_INTER_SPLIT_TX_HITS.with(std::cell::Cell::get)
18821949 }
@@ -1975,6 +2042,7 @@ pub(crate) fn rect_intrabc_reads() -> usize {
19752042 }
19762043
19772044 /// Zeroes [`RECT_INTRABC_READS`] (gate tests call this before a decode).
2045+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
19782046 pub(crate) fn reset_rect_intrabc_reads() {
19792047 RECT_INTRABC_READS.with(|c| c.set(0));
19802048 }
@@ -1991,16 +2059,19 @@ pub(crate) fn leaf8_intrabc_hits() -> usize {
19912059 }
19922060
19932061 /// Zeroes [`LEAF8_INTRABC_HITS`] (gate tests call this before a decode).
2062+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
19942063 pub(crate) fn reset_leaf8_intrabc_hits() {
19952064 LEAF8_INTRABC_HITS.with(|c| c.set(0));
19962065 }
19972066
19982067 /// Current value of [`INTRABC_HITS`].
2068+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
19992069 pub(crate) fn intrabc_hits() -> usize {
20002070 INTRABC_HITS.with(|c| c.get())
20012071 }
20022072
20032073 /// Zeroes [`INTRABC_HITS`] (gate tests call this before a decode).
2074+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
20042075 pub(crate) fn reset_intrabc_hits() {
20052076 INTRABC_HITS.with(|c| c.set(0));
20062077 }
@@ -2013,11 +2084,13 @@ thread_local! {
20132084 }
20142085
20152086 /// Current value of [`INTRABC_VARTX_HITS`].
2087+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
20162088 pub(crate) fn intrabc_vartx_hits() -> usize {
20172089 INTRABC_VARTX_HITS.with(|c| c.get())
20182090 }
20192091
20202092 /// Zeroes [`INTRABC_VARTX_HITS`] (gate tests call this before a decode).
2093+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
20212094 pub(crate) fn reset_intrabc_vartx_hits() {
20222095 INTRABC_VARTX_HITS.with(|c| c.set(0));
20232096 }
@@ -2061,6 +2134,7 @@ thread_local! {
20612134 }
20622135
20632136 /// Current value of [`SKIP_MODE_HITS`].
2137+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
20642138 pub(crate) fn skip_mode_hits() -> usize {
20652139 SKIP_MODE_HITS.with(|c| c.get())
20662140 }
@@ -2092,7 +2166,7 @@ pub fn fimv_alphabet_hits() -> usize {
20922166 }
20932167
20942168 // 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 gate
2169+// `force_integer_mv == 1` (bumped by `stream.rs` per frame). Lets a gate
20962170 // prove the encoder really produced the header state under test rather than
20972171 // assume it.
20982172 thread_local! {
@@ -2111,6 +2185,7 @@ pub fn note_force_integer_mv_frame() {
21112185 }
21122186
21132187 /// Current value of [`OBMC_HITS`].
2188+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
21142189 pub(crate) fn obmc_hits() -> usize {
21152190 OBMC_HITS.with(|c| c.get())
21162191 }
@@ -2126,6 +2201,7 @@ thread_local! {
21262201 }
21272202
21282203 /// Current value of [`OBMC_FILTER_BAND_READS`].
2204+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
21292205 pub(crate) fn obmc_filter_band_reads() -> usize {
21302206 OBMC_FILTER_BAND_READS.with(|c| c.get())
21312207 }
@@ -2149,6 +2225,7 @@ thread_local! {
21492225
21502226 /// Current value of [`MIXED_SCALE_COMPOUND_HITS`]: compound blocks with one
21512227 /// scaled and one unscaled tap.
2228+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
21522229 pub(crate) fn mixed_scale_compound_hits() -> usize {
21532230 MIXED_SCALE_COMPOUND_HITS.with(|c| c.get())
21542231 }
@@ -2157,11 +2234,13 @@ pub(crate) fn mixed_scale_compound_hits() -> usize {
21572234 /// read the 3-symbol `motion_mode_cdf` but read the 2-symbol `obmc_cdf`
21582235 /// instead because their reference is scaled (libaom `motion_mode_allowed`,
21592236 /// `blockd.h:1484`).
2237+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
21602238 pub(crate) fn scaled_warp_suppressed_hits() -> usize {
21612239 SCALED_WARP_SUPPRESSED_HITS.with(|c| c.get())
21622240 }
21632241
21642242 /// Current value of [`SCALED_COMPOUND_HITS`].
2243+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
21652244 pub(crate) fn scaled_compound_hits() -> usize {
21662245 SCALED_COMPOUND_HITS.with(|c| c.get())
21672246 }
@@ -2172,16 +2251,19 @@ pub fn scaled_warp_fallback_hits() -> usize {
21722251 }
21732252
21742253 /// Current value of [`SCALED_OBMC_HITS`].
2254+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
21752255 pub(crate) fn scaled_obmc_hits() -> usize {
21762256 SCALED_OBMC_HITS.with(|c| c.get())
21772257 }
21782258
21792259 /// Current value of [`SCALED_INTERINTRA_HITS`].
2260+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
21802261 pub(crate) fn scaled_interintra_hits() -> usize {
21812262 SCALED_INTERINTRA_HITS.with(|c| c.get())
21822263 }
21832264
21842265 /// Current value of [`SCALED_BLOCK8_HITS`].
2266+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
21852267 pub(crate) fn scaled_block8_hits() -> usize {
21862268 SCALED_BLOCK8_HITS.with(|c| c.get())
21872269 }
@@ -2211,11 +2293,13 @@ thread_local! {
22112293 }
22122294
22132295 /// Current value of [`DUAL_FILTER_DIFF_HITS`].
2296+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
22142297 pub(crate) fn dual_filter_diff_hits() -> usize {
22152298 DUAL_FILTER_DIFF_HITS.with(|c| c.get())
22162299 }
22172300
22182301 /// Current value of [`COMPOUND8_FILTER_HITS`].
2302+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
22192303 pub(crate) fn compound8_filter_hits() -> usize {
22202304 COMPOUND8_FILTER_HITS.with(|c| c.get())
22212305 }
@@ -2232,6 +2316,7 @@ thread_local! {
22322316 }
22332317
22342318 /// Current value of [`WARP_SELECTED_HITS`].
2319+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
22352320 pub(crate) fn warp_selected_hits() -> usize {
22362321 WARP_SELECTED_HITS.with(|c| c.get())
22372322 }
@@ -2247,6 +2332,7 @@ thread_local! {
22472332 }
22482333
22492334 /// Current value of [`COMPOUND_WARP_HITS`].
2335+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
22502336 pub(crate) fn compound_warp_hits() -> usize {
22512337 COMPOUND_WARP_HITS.with(|c| c.get())
22522338 }
@@ -2261,6 +2347,7 @@ thread_local! {
22612347 }
22622348
22632349 /// Current value of [`COMPOUND_WARP_HITS_8`].
2350+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
22642351 pub(crate) fn compound_warp_hits_8() -> usize {
22652352 COMPOUND_WARP_HITS_8.with(|c| c.get())
22662353 }
@@ -2276,6 +2363,7 @@ thread_local! {
22762363 }
22772364
22782365 /// Current value of [`AFFINE_GM_HITS`].
2366+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
22792367 pub(crate) fn affine_gm_hits() -> usize {
22802368 AFFINE_GM_HITS.with(|c| c.get())
22812369 }
@@ -2321,11 +2409,13 @@ thread_local! {
23212409 }
23222410
23232411 /// Current value of [`GLOBALMV_HITS_8`].
2412+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
23242413 pub(crate) fn globalmv_hits_8() -> usize {
23252414 GLOBALMV_HITS_8.with(|c| c.get())
23262415 }
23272416
23282417 /// Current value of [`WARP_HITS_8`].
2418+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
23292419 pub(crate) fn warp_hits_8() -> usize {
23302420 WARP_HITS_8.with(|c| c.get())
23312421 }
@@ -2339,6 +2429,7 @@ thread_local! {
23392429 }
23402430
23412431 /// Current value of [`INTERINTRA_HITS`].
2432+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
23422433 pub(crate) fn interintra_hits() -> usize {
23432434 INTERINTRA_HITS.with(|c| c.get())
23442435 }
@@ -2368,6 +2459,7 @@ thread_local! {
23682459 }
23692460
23702461 /// Current value of [`MASKED_COMPOUND_HITS`].
2462+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
23712463 pub(crate) fn masked_compound_hits() -> usize {
23722464 MASKED_COMPOUND_HITS.with(|c| c.get())
23732465 }
@@ -2383,6 +2475,7 @@ thread_local! {
23832475 }
23842476
23852477 /// Current value of [`RECT_MASKED_COMPOUND_HITS`].
2478+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
23862479 pub(crate) fn rect_masked_compound_hits() -> usize {
23872480 RECT_MASKED_COMPOUND_HITS.with(|c| c.get())
23882481 }
@@ -2397,6 +2490,7 @@ thread_local! {
23972490 }
23982491
23992492 /// Current value of [`WEDGE_HITS`].
2493+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
24002494 pub(crate) fn wedge_hits() -> usize {
24012495 WEDGE_HITS.with(|c| c.get())
24022496 }
@@ -2411,6 +2505,7 @@ thread_local! {
24112505 }
24122506
24132507 /// Current value of [`WII_HITS`].
2508+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
24142509 pub(crate) fn wii_hits() -> usize {
24152510 WII_HITS.with(|c| c.get())
24162511 }
@@ -2425,6 +2520,7 @@ thread_local! {
24252520 }
24262521
24272522 /// Current value of [`NOCFL_UV_MODE_HITS`].
2523+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
24282524 pub(crate) fn nocfl_uv_mode_hits() -> usize {
24292525 NOCFL_UV_MODE_HITS.with(|c| c.get())
24302526 }
@@ -2495,11 +2591,13 @@ thread_local! {
24952591 }
24962592
24972593 /// Current value of [`OBMC_EDGE_SPAN_HITS`].
2594+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
24982595 pub(crate) fn obmc_edge_span_hits() -> usize {
24992596 OBMC_EDGE_SPAN_HITS.with(|c| c.get())
25002597 }
25012598
25022599 /// Current value of [`OBMC_HITS_8`].
2600+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
25032601 pub(crate) fn obmc_hits_8() -> usize {
25042602 OBMC_HITS_8.with(|c| c.get())
25052603 }
@@ -2517,6 +2615,7 @@ thread_local! {
25172615 }
25182616
25192617 /// Current value of [`EXTENDED_PARTITION_HITS`].
2618+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
25202619 pub(crate) fn extended_partition_hits() -> usize {
25212620 EXTENDED_PARTITION_HITS.with(|c| c.get())
25222621 }
@@ -2531,6 +2630,7 @@ thread_local! {
25312630 }
25322631
25332632 /// Current value of [`RECT_PARTITION_HITS`].
2633+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
25342634 pub(crate) fn rect_partition_hits() -> usize {
25352635 RECT_PARTITION_HITS.with(|c| c.get())
25362636 }
@@ -2580,6 +2680,7 @@ thread_local! {
25802680 }
25812681
25822682 /// Current value of [`INTER_SB_NONE_HITS`].
2683+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
25832684 pub(crate) fn inter_sb_none_hits() -> usize {
25842685 INTER_SB_NONE_HITS.with(|c| c.get())
25852686 }
@@ -2594,6 +2695,7 @@ thread_local! {
25942695 }
25952696
25962697 /// Current value of [`INTER_SUB16_SPLIT_HITS`].
2698+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
25972699 pub(crate) fn inter_sub16_split_hits() -> usize {
25982700 INTER_SUB16_SPLIT_HITS.with(|c| c.get())
25992701 }
@@ -2634,6 +2736,7 @@ thread_local! {
26342736 }
26352737
26362738 /// Current value of [`RECT_COEFF_HITS`].
2739+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
26372740 pub(crate) fn rect_coeff_hits() -> usize {
26382741 RECT_COEFF_HITS.with(|c| c.get())
26392742 }
@@ -2647,6 +2750,7 @@ thread_local! {
26472750 }
26482751
26492752 /// Current value of [`RECT_LEAF_COEFF_HITS`].
2753+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
26502754 pub(crate) fn rect_leaf_coeff_hits() -> usize {
26512755 RECT_LEAF_COEFF_HITS.with(|c| c.get())
26522756 }
@@ -2663,6 +2767,7 @@ thread_local! {
26632767
26642768 /// Current value of [`INTRA_RECT_IN_INTER_HITS`] for one shape class
26652769 /// (0 = 64x32/32x64, 1 = 32x16/16x32, 2 = 16x8/8x16).
2770+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
26662771 pub(crate) fn intra_rect_strip_in_inter_hits(class: usize) -> usize {
26672772 INTRA_RECT_IN_INTER_HITS.with(|c| c.get()[class])
26682773 }
@@ -2703,16 +2808,19 @@ thread_local! {
27032808 }
27042809
27052810 /// Current value of [`INTRA_RECT_IN_INTER_SCREEN_HITS`].
2811+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
27062812 pub(crate) fn intra_rect_in_inter_screen_hits() -> usize {
27072813 INTRA_RECT_IN_INTER_SCREEN_HITS.with(std::cell::Cell::get)
27082814 }
27092815
27102816 /// Resets [`INTRA_RECT_IN_INTER_SCREEN_HITS`] before a decode.
2817+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
27112818 pub(crate) fn reset_intra_rect_in_inter_screen_hits() {
27122819 INTRA_RECT_IN_INTER_SCREEN_HITS.with(|c| c.set(0));
27132820 }
27142821
27152822 /// 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
27162824 pub(crate) fn intra_rect_in_inter_split_tx_hits() -> [usize; 3] {
27172825 INTRA_RECT_IN_INTER_SPLIT_TX_HITS.with(std::cell::Cell::get)
27182826 }
@@ -2726,6 +2834,7 @@ thread_local! {
27262834 }
27272835
27282836 /// 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
27292838 pub(crate) fn intra_rect_in_inter_txctx_override_hits() -> usize {
27302839 INTRA_RECT_IN_INTER_TXCTX_OVERRIDE_HITS.with(std::cell::Cell::get)
27312840 }
@@ -2763,6 +2872,7 @@ thread_local! {
27632872 }
27642873
27652874 /// Current value of [`MODE_MI_OVERRIDE_HITS`].
2875+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
27662876 pub(crate) fn mode_mi_override_hits() -> usize {
27672877 MODE_MI_OVERRIDE_HITS.with(|c| c.get())
27682878 }
@@ -2781,6 +2891,7 @@ thread_local! {
27812891 }
27822892
27832893 /// Current value of [`MODE_TILE_EDGE_COARSE_LEAKS`].
2894+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
27842895 pub(crate) fn mode_tile_edge_coarse_leaks() -> usize {
27852896 MODE_TILE_EDGE_COARSE_LEAKS.with(|c| c.get())
27862897 }
@@ -2795,6 +2906,7 @@ thread_local! {
27952906 }
27962907
27972908 /// Current value of [`UV_MODE_MI_OVERRIDE_HITS`].
2909+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
27982910 pub(crate) fn uv_mode_mi_override_hits() -> usize {
27992911 UV_MODE_MI_OVERRIDE_HITS.with(|c| c.get())
28002912 }
@@ -2825,6 +2937,7 @@ thread_local! {
28252937 }
28262938
28272939 /// Current value of [`INTER_NEIGHBOUR_NOT_SMOOTH_HITS`].
2940+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
28282941 pub(crate) fn inter_neighbour_not_smooth_hits() -> usize {
28292942 INTER_NEIGHBOUR_NOT_SMOOTH_HITS.with(|c| c.get())
28302943 }
@@ -2842,6 +2955,7 @@ thread_local! {
28422955 }
28432956
28442957 /// Current value of [`UV_TILE_EDGE_SUPPRESSED_HITS`].
2958+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
28452959 pub(crate) fn uv_tile_edge_suppressed_hits() -> usize {
28462960 UV_TILE_EDGE_SUPPRESSED_HITS.with(|c| c.get())
28472961 }
@@ -2855,11 +2969,13 @@ thread_local! {
28552969 }
28562970
28572971 /// Current value of [`CFL_BLOCK_HITS`].
2972+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
28582973 pub(crate) fn cfl_block_hits() -> usize {
28592974 CFL_BLOCK_HITS.with(|c| c.get())
28602975 }
28612976
28622977 /// Current value of [`UV_ANGLE_DELTA_HITS`].
2978+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
28632979 pub(crate) fn uv_angle_delta_hits() -> usize {
28642980 UV_ANGLE_DELTA_HITS.with(|c| c.get())
28652981 }
@@ -2873,7 +2989,7 @@ thread_local! {
28732989 const { std::cell::Cell::new(0) };
28742990 }
28752991
2876-/// Current value of [`SB_RECT_HITS`].
2992+// Current value of [`SB_RECT_HITS`].
28772993 // lane-hgkf r1: the frame-edge partition bit, one level each. Slot 0 = a
28782994 // 64-level gathered edge bit read as HORZ/VERT, 1 = the same bit read as
28792995 // SPLIT, 2/3 = the 32-level pair. A gate asserting slot 0 or 2 proves the
@@ -2884,11 +3000,13 @@ thread_local! {
28843000 }
28853001
28863002 /// Current value of [`EDGE_PART_HITS`].
3003+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
28873004 pub(crate) fn edge_part_hits() -> [usize; 4] {
28883005 EDGE_PART_HITS.with(|c| c.get())
28893006 }
28903007
28913008 /// Reset [`EDGE_PART_HITS`] (a gate counts one stream at a time).
3009+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
28923010 pub(crate) fn reset_edge_part_hits() {
28933011 EDGE_PART_HITS.with(|c| c.set([0; 4]));
28943012 }
@@ -2901,6 +3019,7 @@ fn bump_edge_part(slot: usize) {
29013019 });
29023020 }
29033021
3022+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
29043023 pub(crate) fn sb_rect_hits() -> usize {
29053024 SB_RECT_HITS.with(|c| c.get())
29063025 }
@@ -2924,6 +3043,7 @@ thread_local! {
29243043 }
29253044
29263045 /// Current value of [`EDGE32_HITS`].
3046+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
29273047 pub(crate) fn edge32_hits() -> [usize; 8] {
29283048 EDGE32_HITS.with(|c| c.get())
29293049 }
@@ -2954,6 +3074,7 @@ thread_local! {
29543074 }
29553075
29563076 /// Current value of [`SB_AB_HITS`], summed over the four arms.
3077+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
29573078 pub(crate) fn sb_ab_hits() -> usize {
29583079 SB_AB_HITS.with(|c| c.get().iter().sum())
29593080 }
@@ -2962,6 +3083,7 @@ pub(crate) fn sb_ab_hits() -> usize {
29623083 /// `_VERT_A`, `_VERT_B` order -- what the gate hard-asserts arm by arm, so a
29633084 /// run where aomenc's RD only ever picked (say) `HORZ_A` cannot pass off as
29643085 /// proof of all four.
3086+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
29653087 pub(crate) fn sb_ab_hits_by_arm() -> [usize; 4] {
29663088 SB_AB_HITS.with(std::cell::Cell::get)
29673089 }
@@ -2977,11 +3099,13 @@ thread_local! {
29773099 }
29783100
29793101 /// Current value of `SB_RECT4_HORZ_HITS` (64x16 strips decoded).
3102+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
29803103 pub(crate) fn sb_rect4_horz_hits() -> usize {
29813104 SB_RECT4_HORZ_HITS.with(|c| c.get())
29823105 }
29833106
29843107 /// Current value of `SB_RECT4_VERT_HITS` (16x64 strips decoded).
3108+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
29853109 pub(crate) fn sb_rect4_vert_hits() -> usize {
29863110 SB_RECT4_VERT_HITS.with(|c| c.get())
29873111 }
@@ -3005,9 +3129,9 @@ thread_local! {
30053129 static INTER_SB_VERT4_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
30063130 }
30073131
3008-/// 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, which
3010-/// exercises none of the new scan/context tables.
3132+// How many 32x32-level 1:4 strips actually read coefficients (non-skip):
3133+// a gate that only counted strips would pass on an all-skip stream, which
3134+// exercises none of the new scan/context tables.
30113135 thread_local! {
30123136 static RECT4_COEFF_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
30133137 }
@@ -3024,6 +3148,7 @@ thread_local! {
30243148 }
30253149
30263150 /// Current values of `RECT4_SPLIT_DEPTH1_HITS` / `RECT4_SPLIT_DEPTH2_HITS`.
3151+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
30273152 pub(crate) fn rect4_split_depth_hits() -> (usize, usize) {
30283153 (
30293154 RECT4_SPLIT_DEPTH1_HITS.with(|c| c.get()),
@@ -3032,6 +3157,7 @@ pub(crate) fn rect4_split_depth_hits() -> (usize, usize) {
30323157 }
30333158
30343159 /// Current value of `SUB16_SPLIT_HITS`.
3160+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
30353161 pub(crate) fn sub16_split_hits() -> usize {
30363162 SUB16_SPLIT_HITS.with(|c| c.get())
30373163 }
@@ -3044,6 +3170,7 @@ thread_local! {
30443170 }
30453171
30463172 /// Current value of `RECT64_SPLIT_TXFM_PUBLISH_HITS`.
3173+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
30473174 pub(crate) fn rect64_split_txfm_publish_hits() -> usize {
30483175 RECT64_SPLIT_TXFM_PUBLISH_HITS.with(|c| c.get())
30493176 }
@@ -3273,6 +3400,7 @@ thread_local! {
32733400 }
32743401
32753402 /// Current value of [`RECT64_QIDX_DRIFT_HITS`].
3403+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
32763404 pub(crate) fn rect64_qidx_drift_hits() -> usize {
32773405 RECT64_QIDX_DRIFT_HITS.with(|c| c.get())
32783406 }
@@ -3287,6 +3415,7 @@ thread_local! {
32873415 }
32883416
32893417 /// Current value of [`PARTAB_HITS`].
3418+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
32903419 pub(crate) fn partab_hits() -> usize {
32913420 PARTAB_HITS.with(|c| c.get())
32923421 }
@@ -3307,18 +3436,22 @@ thread_local! {
33073436 }
33083437
33093438 /// Current value of [`INTRA_HORZ_A_HITS`].
3439+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
33103440 pub(crate) fn intra_horz_a_hits() -> usize {
33113441 INTRA_HORZ_A_HITS.with(|c| c.get())
33123442 }
33133443 /// Current value of [`INTRA_HORZ_B_HITS`].
3444+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
33143445 pub(crate) fn intra_horz_b_hits() -> usize {
33153446 INTRA_HORZ_B_HITS.with(|c| c.get())
33163447 }
33173448 /// Current value of [`INTRA_VERT_A_HITS`].
3449+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
33183450 pub(crate) fn intra_vert_a_hits() -> usize {
33193451 INTRA_VERT_A_HITS.with(|c| c.get())
33203452 }
33213453 /// Current value of [`INTRA_VERT_B_HITS`].
3454+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
33223455 pub(crate) fn intra_vert_b_hits() -> usize {
33233456 INTRA_VERT_B_HITS.with(|c| c.get())
33243457 }
@@ -3335,6 +3468,7 @@ thread_local! {
33353468 }
33363469
33373470 /// Current value of [`COMPOUND_MODE_HITS`].
3471+#[allow(dead_code)] // gate counter accessor with no reader yet; the counter itself is live
33383472 pub(crate) fn compound_mode_hits() -> usize {
33393473 COMPOUND_MODE_HITS.with(|c| c.get())
33403474 }
@@ -3352,12 +3486,14 @@ pub(crate) fn compound_mode_hits() -> usize {
33523486 /// [`crate::motion_field::setup_motion_field`] yet, so this will read `0`
33533487 /// against any real stream today. See the module doc on
33543488 /// `crate::motion_field` and this crate's ledger for the remaining wiring.
3489+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
33553490 pub(crate) fn tmv_hits() -> usize {
33563491 crate::mvstack::tmv_hits()
33573492 }
33583493
33593494 /// Current value of [`crate::mc::inter_pred_hits`] -- inter predictions
33603495 /// produced on this thread, the 10-bit inter gate's firing proof.
3496+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
33613497 pub(crate) fn inter_pred_hits() -> usize {
33623498 crate::mc::inter_pred_hits()
33633499 }
@@ -3465,6 +3601,7 @@ pub(crate) fn build_motion_field(
34653601
34663602 /// Current value of the counter for `ref_frame` (`LAST2_FRAME`..=`ALTREF_FRAME`;
34673603 /// panics on `LAST_FRAME`/`INTRA_FRAME`/`NONE`, which have no counter here).
3604+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
34683605 pub(crate) fn ref_hits(ref_frame: i8) -> usize {
34693606 let c = match ref_frame {
34703607 LAST2_FRAME => &LAST2_HITS,
@@ -3499,11 +3636,13 @@ pub(crate) fn set_enable_edge_filter(value: bool, fctx: &crate::decode::FrameCtx
34993636 }
35003637
35013638 /// Current value of [`ANGLE_DELTA_HITS`].
3639+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
35023640 pub(crate) fn angle_delta_hits() -> usize {
35033641 ANGLE_DELTA_HITS.with(|c| c.get())
35043642 }
35053643
35063644 /// Current value of [`TX_CLASS1_HITS`].
3645+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
35073646 pub(crate) fn tx_class1_hits() -> usize {
35083647 TX_CLASS1_HITS.with(|c| c.get())
35093648 }
@@ -3592,6 +3731,7 @@ pub fn cdef_mixed_skip_units() -> usize {
35923731 }
35933732
35943733 /// Current value of `CDEF_SKIPPED_UNITS`.
3734+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
35953735 pub(crate) fn cdef_skipped_units() -> usize {
35963736 CDEF_SKIPPED_UNITS.with(|c| c.get())
35973737 }
@@ -3603,16 +3743,19 @@ pub fn cdef_unwritten_skip_units() -> usize {
36033743 }
36043744
36053745 /// Current value of `INTER8_SKIP_BAND_HITS`.
3746+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
36063747 pub(crate) fn inter8_skip_band_hits() -> usize {
36073748 INTER8_SKIP_BAND_HITS.with(|c| c.get())
36083749 }
36093750
36103751 /// Current value of `CDEF_STRADDLE_UNITS`.
3752+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
36113753 pub(crate) fn cdef_straddle_units() -> usize {
36123754 CDEF_STRADDLE_UNITS.with(|c| c.get())
36133755 }
36143756
36153757 /// Current value of [`SUB8_SPLIT_HITS`].
3758+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
36163759 pub(crate) fn sub8_split_hits() -> usize {
36173760 SUB8_SPLIT_HITS.with(|c| c.get())
36183761 }
@@ -3669,26 +3812,31 @@ thread_local! {
36693812 }
36703813
36713814 /// Current value of [`RECT8_SPLIT_TX_HITS`].
3815+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
36723816 pub(crate) fn rect8_split_tx_hits() -> usize {
36733817 RECT8_SPLIT_TX_HITS.with(|c| c.get())
36743818 }
36753819
36763820 /// Current value of [`RECT_STRIP_PRED_HITS`].
3821+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
36773822 pub(crate) fn rect_strip_pred_hits() -> usize {
36783823 RECT_STRIP_PRED_HITS.with(|c| c.get())
36793824 }
36803825
36813826 /// Current value of [`RECT_STRIP_REACH_HITS`].
3827+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
36823828 pub(crate) fn rect_strip_reach_hits() -> usize {
36833829 RECT_STRIP_REACH_HITS.with(|c| c.get())
36843830 }
36853831
36863832 /// Current value of [`TX4X8_CODED_HITS`].
3833+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
36873834 pub(crate) fn tx4x8_coded_hits() -> usize {
36883835 TX4X8_CODED_HITS.with(|c| c.get())
36893836 }
36903837
36913838 /// Current value of [`TX8X4_CODED_HITS`].
3839+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
36923840 pub(crate) fn tx8x4_coded_hits() -> usize {
36933841 TX8X4_CODED_HITS.with(|c| c.get())
36943842 }
@@ -3705,6 +3853,7 @@ thread_local! {
37053853 }
37063854
37073855 /// Current value of [`CHROMA_EOB_CLASS1_HITS`].
3856+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
37083857 pub(crate) fn chroma_eob_class1_hits() -> usize {
37093858 CHROMA_EOB_CLASS1_HITS.with(|c| c.get())
37103859 }
@@ -4680,7 +4829,7 @@ fn read_coeffs_rect(
46804829 let pos = scan[scan_idx] as usize;
46814830 let (row, col) = (pos / w, pos % w);
46824831 // libaom's column-major `coeff_idx`, for ladder comparison.
4683- let apos = col * h + row;
4832+ let _apos = col * h + row;
46844833 let level = if scan_idx == eob - 1 {
46854834 let ctx = eob_coeff_ctx(scan_idx, w * h);
46864835 let v = dec.symbol(&mut coding.base_eob[ctx]) as i32 + 1;
@@ -5014,6 +5163,7 @@ struct Neighbours {
50145163 tile_col0_mi: usize,
50155164 }
50165165
5166+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
50175167 impl Neighbours {
50185168 /// `cols`/`rows` are in [`SUB`] units; `mi_cols`/`mi_rows` are the frame's
50195169 /// true (unpadded) size in 4x4 mode-info units.
@@ -5603,6 +5753,7 @@ impl Neighbours {
56035753 /// "no neighbour"). `ref_frame` is `-1` for an intra block, else the
56045754 /// `1..=7` reference it coded (lane-av1refs's `single_ref_p*_ctx` needs
56055755 /// the real value, not just `is_inter`).
5756+ #[allow(dead_code)] // read only from the `#[cfg(test)]` gates
56065757 fn record_inter(
56075758 &mut self,
56085759 at: (usize, usize),
@@ -5622,6 +5773,7 @@ impl Neighbours {
56225773 /// left-context span (its own height) differ, unlike every caller before
56235774 /// this round (class neighbour-votes-all-its-fields).
56245775 #[allow(clippy::too_many_arguments)]
5776+ #[allow(dead_code)] // read only from the `#[cfg(test)]` gates
56255777 fn record_inter_rect(
56265778 &mut self,
56275779 at: (usize, usize),
@@ -5721,6 +5873,7 @@ impl Neighbours {
57215873 /// this is the one caller that actually knows it) -- so the next block's
57225874 /// [`NeighbourRef`](crate::mvstack::NeighbourRef) sees a real compound
57235875 /// neighbour instead of `record_inter`'s single-ref default.
5876+ #[allow(dead_code)] // read only from the `#[cfg(test)]` gates
57245877 fn record_compound_ctx(
57255878 &mut self,
57265879 at: (usize, usize),
@@ -5735,6 +5888,7 @@ impl Neighbours {
57355888 /// [`Self::record_compound_ctx`] with independent above/left extents,
57365889 /// mirroring [`Self::record_inter_rect`] (lane-partitions r1).
57375890 #[allow(clippy::too_many_arguments)]
5891+ #[allow(dead_code)] // read only from the `#[cfg(test)]` gates
57385892 fn record_compound_ctx_rect(
57395893 &mut self,
57405894 at: (usize, usize),
@@ -9810,9 +9964,9 @@ fn decode_rect4_16(
98109964 let (r, c) = at16;
98119965 let (mi_row0, mi_col0) = (r * (SUB / MI), c * (SUB / MI));
98129966 let (bw, bh) = if horz { (16, 4) } else { (4, 16) };
9813- let (mi_w, mi_h) = (bw / MI, bh / MI);
9814- let scan: &[u16] = if horz { &SCAN_16X4 } else { &SCAN_4X16 };
9815- let chroma_scan: &[u16] = if horz { &SCAN_8X4 } else { &SCAN_4X8 };
9967+ let (_mi_w, _mi_h) = (bw / MI, bh / MI);
9968+ let _scan: &[u16] = if horz { &SCAN_16X4 } else { &SCAN_4X16 };
9969+ let _chroma_scan: &[u16] = if horz { &SCAN_8X4 } else { &SCAN_4X8 };
98169970 let mut prev: Option<((usize, usize), usize)> = None;
98179971 let mut last_mode = DC_PRED;
98189972 let mut last_uv_mode = DC_PRED;
@@ -11345,6 +11499,7 @@ fn cfl_scaled(alpha_q3: i32, ac_q3: i32) -> i32 {
1134511499 /// deblock/CDEF stages run, so the frame being dumped here is `idx - 1` --
1134611500 /// without this every frame overwrote `.f0` and a per-frame bisection silently
1134711501 /// 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
1134811503 fn stage_dump_idx() -> usize {
1134911504 PREFILT_PICTURE_IDX.load(std::sync::atomic::Ordering::SeqCst).saturating_sub(1)
1135011505 }
@@ -13347,7 +13502,6 @@ fn decode_leaf8(
1334713502 // 8x8 `mode` and reading its own fresh context off the earlier
1334813503 // units in this same leaf (the same per-TU pattern `decode_block`'s
1334913504 // multi-TU branch runs at bigger blocks).
13350- luma_grid = vec![0i32; 64];
1335113505 for tu_row in 0..2 {
1335213506 for tu_col in 0..2 {
1335313507 let tu_mi = (leaf_mi.0 + tu_row, leaf_mi.1 + tu_col);
@@ -14243,6 +14397,7 @@ fn cdef_msb(x: i32) -> i32 {
1424314397
1424414398 /// Spec 7.15.3's `constrain`: how much of a neighbour's difference from the
1424514399 /// centre sample a filter tap is allowed to contribute.
14400+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1424614401 fn cdef_constrain(diff: i32, threshold: i32, damping: i32) -> i32 {
1424714402 if threshold == 0 {
1424814403 return 0;
@@ -15016,6 +15171,7 @@ fn read_tx_size(
1501615171 /// transform and whether this unit already sits below it, times three, plus
1501715172 /// the two neighbour terms (whether the transform last written above/left of
1501815173 /// this unit is narrower/shorter than the unit itself).
15174+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1501915175 fn txfm_partition_ctx(above_px: u8, left_px: u8, blk_max_px: usize, tx_px: usize) -> usize {
1502015176 txfm_partition_ctx_rect(above_px, left_px, blk_max_px, tx_px, tx_px)
1502115177 }
@@ -15048,6 +15204,7 @@ fn txfm_partition_ctx_rect(
1504815204 /// `txfm_partition_update` (libaom `av1_common_int.h`): once a var-tx unit
1504915205 /// resolves, every mi cell its *parent* unit (`txb_px`) spans records the
1505015206 /// resolved transform's own size.
15207+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1505115208 fn txfm_partition_update(
1505215209 n: &mut Neighbours,
1505315210 at_mi: (usize, usize),
@@ -16453,6 +16610,7 @@ fn deblock_thresholds(level: i32, sharpness: u8) -> (i32, i32, i32) {
1645316610 (2 * (level + 2) + lim, lim, level >> 4)
1645416611 }
1645516612
16613+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1645616614 fn sclamp(v: i32, fctx: &crate::decode::FrameCtx) -> i32 {
1645716615 // libaom's `signed_char_clamp_high`: the clamp range scales with
1645816616 // `128 << (bit_depth - 8)` alongside the centering constant below.
@@ -17651,6 +17809,7 @@ fn apply_loop_restoration(
1765117809 /// 16x16, a directional mode's angle delta other than zero, chroma-from-luma),
1765217810 /// or when the tile payload runs out of the symbols this decode expects (a
1765317811 /// genuinely foreign stream).
17812+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1765417813 pub(crate) fn decode_key_frame_tile(
1765517814 data: &[u8],
1765617815 mi_cols: u32,
@@ -17708,6 +17867,7 @@ pub(crate) fn decode_key_frame_tile(
1770817867 /// (see [`LAST_FRAME_WIDE_MARGIN`]) -- `stream.rs`'s superres path
1770917868 /// reads this immediately after the call, before any other frame
1771017869 /// decode can overwrite it.
17870+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1771117871 pub(crate) fn take_last_frame_wide_margin(fctx: &crate::decode::FrameCtx) -> Option<Picture> {
1771217872 fctx.last_frame_wide_margin.with(|m| m.borrow_mut().take())
1771317873 }
@@ -17764,13 +17924,12 @@ fn sb_visit_order(r0: u32, r1: u32, c0: u32, c1: u32, sb128: bool) -> Vec<(u32,
1776417924 out
1776517925 }
1776617926
17767-/// 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 whole
17769-/// 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)
17771-/// decides the root -- only SPLIT recurses into the four 64x64 quadrants this
17772-/// decoder codes, the other seven arms refuse by name.
17773-#[allow(clippy::too_many_arguments)]
17927+// lane-sb128 r2: the 128x128 superblock root, shared by the key-frame and
17928+// the inter tile loop. Its loop-restoration units are read once for the whole
17929+// 128x128 (spec 5.11.57 is called with the superblock's own size), then one
17930+// partition symbol off the `BLOCK_128X128` CDF (8 symbols, no HORZ_4/VERT_4)
17931+// decides the root -- only SPLIT recurses into the four 64x64 quadrants this
17932+// decoder codes, the other seven arms refuse by name.
1777417933 thread_local! {
1777517934 /// How many 128x128 superblock roots resolved to `PARTITION_NONE` -- one
1777617935 /// whole 128x128 block (lane-sb128b r1's gate counter).
@@ -17795,16 +17954,19 @@ pub(crate) fn part128_ab_hits() -> [usize; 4] {
1779517954 }
1779617955
1779717956 /// [`PART128_NONE_HITS`], for a gate's own before/after delta.
17957+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1779817958 pub(crate) fn part128_none_hits() -> usize {
1779917959 PART128_NONE_HITS.with(std::cell::Cell::get)
1780017960 }
1780117961
1780217962 /// [`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
1780317964 pub(crate) fn part128_horz_hits() -> usize {
1780417965 PART128_HORZ_HITS.with(std::cell::Cell::get)
1780517966 }
1780617967
1780717968 /// [`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
1780817970 pub(crate) fn part128_vert_hits() -> usize {
1780917971 PART128_VERT_HITS.with(std::cell::Cell::get)
1781017972 }
@@ -17827,6 +17989,7 @@ thread_local! {
1782717989 }
1782817990
1782917991 /// [`CHROMA_SPLIT_TX_HITS`], for a gate's own before/after delta.
17992+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
1783017993 pub(crate) fn chroma_split_tx_hits() -> usize {
1783117994 CHROMA_SPLIT_TX_HITS.with(std::cell::Cell::get)
1783217995 }
@@ -20422,7 +20585,7 @@ fn read_inter_plane(
2042220585 x: usize,
2042320586 y: usize,
2042420587 side: usize,
20425- base_q_idx: u8,
20588+ _base_q_idx: u8,
2042620589 prediction: &[u16],
2042720590 // lane-chromau: this block's own luma transform's *actual coded*
2042820591 // `tx_type` -- `av1_get_tx_type` (libaom `blockd.h`): an inter block's
@@ -22123,7 +22286,7 @@ fn decode_inter_block(
2212322286 // 5.11.17), `Some` only when this block's var-tx tree resolved to more
2212422287 // than one luma transform -- read back by the residual loop, the
2212522288 // 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)>>;
2212722290 // lane-t900 r22: this block's own palette state, stamped into the
2212822291 // mi-granular neighbour bands at the tail below for EVERY block --
2212922292 // libaom's `MB_MODE_INFO.palette_size` is 0 on an inter block, and
@@ -22810,7 +22973,7 @@ fn decode_inter_block(
2281022973 );
2281122974 }
2281222975 let mut pred_y = vec![0u16; side * side];
22813- let mut diffwtd_mask_y = Vec::new();
22976+ let mut diffwtd_mask_y;
2281422977 // lane-wedge r3: `mask_y` is the DIFFWTD buffer just computed OR
2281522978 // the wedge codebook lookup (comp_group_idx==1's two mutually
2281622979 // exclusive branches) -- same [`mc::blend_masked_compound`] call
@@ -25668,7 +25831,7 @@ fn decode_inter_sub8_split4(
2566825831 neighbours.left_ref[rmi],
2566925832 neighbours.left_ref1[rmi],
2567025833 );
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)?;
2567225835 // lane-t900 r28: refusal lifted -- this sub-block's own reference may
2567325836 // be scaled (superres); spec 7.11.3.3's walk is per reference, and
2567425837 // each of the group's pieces (luma and its 2x2 chroma) carries its
@@ -27226,7 +27389,7 @@ fn decode_inter_block8(
2722627389 // the one split a `BLOCK_8X8` can take (`read_block_tx_size` below) --
2722727390 // read back by the luma residual read and the tail's neighbour/loop-filter
2722827391 // bookkeeping. Always `false` outside a `TxMode::Select` inter frame.
27229- let mut split8 = false;
27392+ let split8;
2723027393 const SIDE: usize = 8;
2723127394 const CHROMA_SIDE: usize = 4;
2723227395
@@ -27710,7 +27873,7 @@ fn decode_inter_block8(
2771027873 );
2771127874 }
2771227875 let mut pred_y = vec![0u16; SIDE * SIDE];
27713- let mut diffwtd_mask_y = Vec::new();
27876+ let mut diffwtd_mask_y;
2771427877 let mask_y: Option<&[u8]> = if let Some(mask_type) = diffwtd_mask_type {
2771527878 diffwtd_mask_y = vec![0u8; SIDE * SIDE];
2771627879 DIFFWTD_HITS.with(|c| c.set(c.get() + 1));
@@ -29142,6 +29305,7 @@ fn decode_inter_block8(
2914229305 /// or when `reference` is not this frame's own true size, or when the tile
2914329306 /// codes a 16x16 leaf whose own true edge cuts through it (round 2, same
2914429307 /// refusal [`crate::tile`]'s writer gives its encoder).
29308+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2914529309 pub(crate) fn decode_inter_frame_tile(
2914629310 data: &[u8],
2914729311 mi_cols: u32,
crates/ec-av1/src/encode.rsmodified+16 -16
@@ -1859,9 +1859,9 @@ fn prune_top_k() -> Option<usize> {
18591859 }
18601860 }
18611861
1862-/// 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 --
1864-/// `#![forbid(unsafe_code)]` -- and racy across parallel tests besides).
1862+// 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 --
1864+// `#![forbid(unsafe_code)]` -- and racy across parallel tests besides).
18651865 #[cfg(test)]
18661866 thread_local! {
18671867 static TEST_TOP_K_OVERRIDE: std::cell::Cell<Option<Option<usize>>> =
@@ -1898,8 +1898,8 @@ fn prune_top_k_inter() -> Option<usize> {
18981898 }
18991899 }
19001900
1901-/// A per-thread override [`prune_top_k_inter`] checks first, same reason as
1902-/// [`TEST_TOP_K_OVERRIDE`].
1901+// A per-thread override [`prune_top_k_inter`] checks first, same reason as
1902+// [`TEST_TOP_K_OVERRIDE`].
19031903 #[cfg(test)]
19041904 thread_local! {
19051905 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>) {
19201920 /// pruning them costs less quality here.
19211921 const INTER_PRUNE_TOP_K: Option<usize> = Some(3);
19221922
1923-/// Per-thread nanosecond counters `stage_timing_breakdown_inter` (and
1924-/// [`crate::mc::predict`], through [`stage_add`]) accumulate into, so an
1925-/// inter frame's cost can be attributed to a bucket without changing what
1926-/// the search actually does. Index: 0 = whole-call time inside
1927-/// [`motion::search`] (includes bucket 1's time, run from inside it), 1 =
1928-/// [`crate::mc::predict`] (every call, from the motion search's own
1929-/// candidates and from a committed inter block's final prediction alike),
1930-/// 2 = `forward_and_quantize` + `dequant_and_inverse`, 3 = `coeff_bits`.
1923+// Per-thread nanosecond counters `stage_timing_breakdown_inter` (and
1924+// [`crate::mc::predict`], through [`stage_add`]) accumulate into, so an
1925+// inter frame's cost can be attributed to a bucket without changing what
1926+// the search actually does. Index: 0 = whole-call time inside
1927+// [`motion::search`] (includes bucket 1's time, run from inside it), 1 =
1928+// [`crate::mc::predict`] (every call, from the motion search's own
1929+// candidates and from a committed inter block's final prediction alike),
1930+// 2 = `forward_and_quantize` + `dequant_and_inverse`, 3 = `coeff_bits`.
19311931 #[cfg(test)]
19321932 thread_local! {
19331933 static STAGE_NS: [std::cell::Cell<u64>; 4] = [
@@ -3512,7 +3512,7 @@ mod tests {
35123512 x: usize,
35133513 y: usize,
35143514 width: usize,
3515- height: usize, fctx: &crate::decode::FrameCtx,
3515+ height: usize, _fctx: &crate::decode::FrameCtx,
35163516 ) -> (bool, bool) {
35173517 let (bw_log2, bh_log2) = ((bw / 4).ilog2() as usize, (bh / 4).ilog2() as usize);
35183518 let (_bw_unit, bh_unit) = (bw / 4, bh / 4);
@@ -3992,7 +3992,7 @@ mod tests {
39923992 // col_off==0 (whole-transform) path, with MAX_MIB_SIZE_LOG2 = 5 (a
39933993 // 128px reference grid) pinned as libaom pins it, independent of the
39943994 // 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 {
39963996 if y == 0 || x + side >= width {
39973997 return false;
39983998 }
@@ -4017,7 +4017,7 @@ mod tests {
40174017 (table[index / 8] >> (index % 8)) & 1 != 0
40184018 }
40194019
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 {
40214021 if x == 0 || y + side >= height {
40224022 return false;
40234023 }
crates/ec-av1/src/film_grain.rsmodified+2 -1
@@ -800,7 +800,7 @@ fn copy_area(
800800 width: i32,
801801 height: i32, fctx: &crate::decode::FrameCtx,
802802 ) {
803- let (grain_min, grain_max) = grain_range(fctx);
803+ let (_grain_min, _grain_max) = grain_range(fctx);
804804 for h in 0..height {
805805 for w in 0..width {
806806 let v = at(src, src_stride, src_row0 + h, src_col0 + w);
@@ -816,6 +816,7 @@ thread_local! {
816816 }
817817
818818 /// Current value of [`GRAIN_HITS`].
819+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
819820 pub(crate) fn grain_hits() -> usize {
820821 GRAIN_HITS.with(|c| c.get())
821822 }
crates/ec-av1/src/intra.rsmodified+33 -30
@@ -206,35 +206,35 @@ impl Edges {
206206 }
207207 }
208208
209-/// 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 every
211-/// caller outside this lane's own tests passes.
212-///
213-/// `above` is the reconstructed row above the block and `left` its
214-/// reconstructed left column, each at least `bw`/`bh` samples long
215-/// respectively, and `corner` the sample diagonally above-left; `None` where
216-/// 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 the
218-/// 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` and
220-/// `leftLimit` comes to.
221-///
222-/// `angle_delta` (spec `AngleDeltaY`/`AngleDeltaUV`, `-MAX_ANGLE_DELTA` to
223-/// `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 (spec
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.
227-///
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`
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 three
232-/// smooth modes, which steers [`intra_edge_filter_strength`]'s threshold
233-/// table. Ignored outside the directional modes.
234-///
235-/// # Panics
236-/// Panics on a mode this module does not predict, or when `dst` is not
237-/// `bw * bh` long.
209+// 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 every
211+// caller outside this lane's own tests passes.
212+//
213+// `above` is the reconstructed row above the block and `left` its
214+// reconstructed left column, each at least `bw`/`bh` samples long
215+// respectively, and `corner` the sample diagonally above-left; `None` where
216+// 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 the
218+// 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` and
220+// `leftLimit` comes to.
221+//
222+// `angle_delta` (spec `AngleDeltaY`/`AngleDeltaUV`, `-MAX_ANGLE_DELTA` to
223+// `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 (spec
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.
227+//
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`
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 three
232+// smooth modes, which steers [`intra_edge_filter_strength`]'s threshold
233+// table. Ignored outside the directional modes.
234+//
235+// # Panics
236+// Panics on a mode this module does not predict, or when `dst` is not
237+// `bw * bh` long.
238238 // lane-hbdgates r1: per-tool firing counters for the 10-bit gates. Each tool
239239 // the coverage table tracks needs its OWN counter -- `smooth_uv_hits` lumps
240240 // SMOOTH..=PAETH together, so a paeth-only stream would have "proved" smooth
@@ -246,17 +246,20 @@ thread_local! {
246246 }
247247
248248 /// 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
249250 pub(crate) fn smooth_pred_hits() -> usize {
250251 SMOOTH_PRED_HITS.with(|c| c.get())
251252 }
252253
253254 /// How many blocks were predicted with PAETH_PRED on this thread.
255+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
254256 pub(crate) fn paeth_pred_hits() -> usize {
255257 PAETH_PRED_HITS.with(|c| c.get())
256258 }
257259
258260 /// How many directional edges [`filter_intra_edge`] actually smoothed
259261 /// (strength != 0) on this thread -- the `--enable-intra-edge-filter` proof.
262+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
260263 pub(crate) fn intra_edge_filter_hits() -> usize {
261264 EDGE_FILTER_HITS.with(|c| c.get())
262265 }
@@ -994,7 +997,7 @@ mod tests {
994997 let fctx = &crate::decode::FrameCtx::new();
995998 // xorshift64*: a seeded stream, so a failure names one (shape, mode,
996999 // seed) triple that reproduces.
997- let mut rng = |state: &mut u64| {
1000+ let rng = |state: &mut u64| {
9981001 *state ^= *state << 13;
9991002 *state ^= *state >> 7;
10001003 *state ^= *state << 17;
crates/ec-av1/src/mc.rsmodified+4 -0
@@ -173,9 +173,13 @@ const SUBPEL_FILTERS_BILINEAR: [[i32; 8]; 16] = [
173173 /// this type only ever names the resolved kernel, never `Switchable` itself.
174174 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
175175 pub enum InterpFilterKind {
176+ /// The `Regular` interpolation kernel.
176177 Regular,
178+ /// The `Smooth` interpolation kernel.
177179 Smooth,
180+ /// The `Sharp` interpolation kernel.
178181 Sharp,
182+ /// The `Bilinear` interpolation kernel.
179183 Bilinear,
180184 }
181185
crates/ec-av1/src/motion_field.rsmodified+1 -0
@@ -317,6 +317,7 @@ thread_local! {
317317
318318 /// Reads the counter above (gate
319319 /// `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
320321 pub fn refstamp_intra_frames() -> (usize, usize) {
321322 (
322323 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
8888 /// The number of query blocks that received at least one temporal MV
8989 /// candidate so far, across every [`find_mv_stack_with_sign_bias`] call in
9090 /// this process.
91+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
9192 pub(crate) fn tmv_hits() -> usize {
9293 TMV_HITS.load(std::sync::atomic::Ordering::Relaxed)
9394 }
@@ -108,16 +109,19 @@ static TILE_REACH_CLIPS: std::sync::atomic::AtomicUsize =
108109 std::sync::atomic::AtomicUsize::new(0);
109110
110111 /// [`COMP_GM_FILL_HITS`].
112+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
111113 pub(crate) fn comp_gm_fill_hits() -> usize {
112114 COMP_GM_FILL_HITS.load(std::sync::atomic::Ordering::Relaxed)
113115 }
114116
115117 /// [`STACK_FULL_DROPS`].
118+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
116119 pub(crate) fn stack_full_drops() -> usize {
117120 STACK_FULL_DROPS.load(std::sync::atomic::Ordering::Relaxed)
118121 }
119122
120123 /// [`TILE_REACH_CLIPS`].
124+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
121125 pub(crate) fn tile_reach_clips() -> usize {
122126 TILE_REACH_CLIPS.load(std::sync::atomic::Ordering::Relaxed)
123127 }
@@ -799,11 +803,11 @@ fn scan_corner(
799803 /// frame.
800804 const MV_BORDER: i32 = 16 << 3;
801805
802-/// 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)` in
804-/// 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`] of
806-/// slack, in every direction.
806+// Clamps one candidate MV to the range spec 7.10.2.14 (libaom's
807+// `clamp_mv_ref`) allows for a `bw4`-by-`bh4` block at `(mi_row, mi_col)` in
808+// a `mi_cols`-by-`mi_rows` frame: the distance from the block's own edge to
809+// the matching frame edge, plus the block's own span and [`MV_BORDER`] of
810+// slack, in every direction.
807811 // lane-t900 r11: stack entries whose clamp window is narrowed by a NEGATIVE
808812 // `mb_to_right_edge`/`mb_to_bottom_edge` -- i.e. blocks overhanging the frame's
809813 // 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
7979 decode_unsigned_subexp_with_ref_msac(dec, n, k, r) as i32 + low
8080 }
8181
82+#[allow(dead_code)] // gate counter accessor with no reader yet; the counter itself is live
8283 const WIENER_HALFWIN: usize = 3;
84+#[allow(dead_code)] // gate counter accessor with no reader yet; the counter itself is live
8385 pub(crate) const WIENER_WIN: usize = 7;
8486 const WIENER_TAP_MINV: [i32; 3] = [-5, -23, -17];
8587 const WIENER_TAP_MAXV: [i32; 3] = [10, 8, 46];
@@ -363,49 +365,54 @@ pub(crate) fn read_lr(
363365 }
364366 }
365367
366-/// r3 gate self-pin: how many units decoded a real (non-`None`) filter, by
367-/// kind -- proves a real `--enable-restoration=1` aomenc stream actually
368-/// exercises `read_lr_unit`'s Wiener/SGR/switchable arms, not just that the
369-/// symbol-count/refusal-string wiring compiles. Never reset -- summed across
370-/// a gate's whole attempt loop, matching `MASKED_COMPOUND_HITS`/`WEDGE_HITS`
371-/// (decode.rs) which this mirrors.
368+// r3 gate self-pin: how many units decoded a real (non-`None`) filter, by
369+// kind -- proves a real `--enable-restoration=1` aomenc stream actually
370+// exercises `read_lr_unit`'s Wiener/SGR/switchable arms, not just that the
371+// symbol-count/refusal-string wiring compiles. Never reset -- summed across
372+// a gate's whole attempt loop, matching `MASKED_COMPOUND_HITS`/`WEDGE_HITS`
373+// (decode.rs) which this mirrors.
372374 thread_local! {
373375 static WIENER_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
374376 static SGRPROJ_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
375377 static SWITCHABLE_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
376378 }
377379
378-/// 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-row
380-/// 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). Those
382-/// are the two stripe shapes whose boundary substitution differs from every
383-/// interior stripe, and no gate size before this one had either.
380+// lane-reelckf2 r1: how many *stripes* a real filter ran on with the frame's
381+// own top row as their above boundary (`stripe_v_start == 0`, the 56-row
382+// first stripe of `RESTORATION_UNIT_OFFSET == 8`), and how many ran on a
383+// short LAST stripe (`stripe_v_end == plane_h` with a partial height). Those
384+// are the two stripe shapes whose boundary substitution differs from every
385+// interior stripe, and no gate size before this one had either.
384386 thread_local! {
385387 static LR_STRIPE0_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
386388 static LR_LAST_STRIPE_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
387389 }
388390
389391 /// Current value of [`LR_STRIPE0_HITS`].
392+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
390393 pub(crate) fn lr_stripe0_hits() -> usize {
391394 LR_STRIPE0_HITS.with(|c| c.get())
392395 }
393396 /// Current value of [`LR_LAST_STRIPE_HITS`].
397+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
394398 pub(crate) fn lr_last_stripe_hits() -> usize {
395399 LR_LAST_STRIPE_HITS.with(|c| c.get())
396400 }
397401
398402 /// Current value of [`WIENER_HITS`].
403+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
399404 pub(crate) fn wiener_hits() -> usize {
400405 WIENER_HITS.with(|c| c.get())
401406 }
402407 /// Current value of [`SGRPROJ_HITS`].
408+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
403409 pub(crate) fn sgrproj_hits() -> usize {
404410 SGRPROJ_HITS.with(|c| c.get())
405411 }
406412 /// Current value of [`SWITCHABLE_HITS`] -- bumped once per unit whose frame
407413 /// `restoration_type` is `Switchable`, regardless of which `RestoreType`
408414 /// (`None`/Wiener/Sgrproj) that unit's own symbol resolved to.
415+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
409416 pub(crate) fn switchable_hits() -> usize {
410417 SWITCHABLE_HITS.with(|c| c.get())
411418 }
crates/ec-av1/src/stream.rsmodified+29 -27
@@ -24,9 +24,11 @@ use ec_core::{Error, Result};
2424 use crate::cdf_state::Cdfs;
2525 use crate::decode;
2626 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,
2828 q_ctx_of,
2929 };
30+#[cfg(test)]
31+use crate::decode::decode_key_frame_tile;
3032 use crate::encode::Picture;
3133
3234 /// lane-midcut r1: `EC_AV1_NO_GRAIN=1` skips film grain synthesis at output, so a
@@ -36,13 +38,13 @@ fn no_grain() -> bool {
3638 std::env::var_os("EC_AV1_NO_GRAIN").is_some()
3739 }
3840
39-/// lane-hidden r1: where `EC_AV1_FINAL_DUMP`'s per-frame dump goes for the
40-/// current thread, overriding the environment variable. Every ffmpeg/aomdec
41-/// pixel gate in this repo compares SHOWN frames only (class
42-/// 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 compare
44-/// 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.
41+// lane-hidden r1: where `EC_AV1_FINAL_DUMP`'s per-frame dump goes for the
42+// current thread, overriding the environment variable. Every ffmpeg/aomdec
43+// pixel gate in this repo compares SHOWN frames only (class
44+// gate-blind-to-hidden-frames), so the hidden alt-ref frames a real aomenc
45+// stream carries were never compared at all; the gate that does compare
46+// them needs a dump path that cannot race a sibling test's decode on
47+// another thread, which a process-global env var cannot give.
4648 thread_local! {
4749 static FINAL_DUMP_PREFIX: std::cell::RefCell<Option<String>> =
4850 const { std::cell::RefCell::new(None) };
@@ -200,6 +202,7 @@ pub fn obmc_pair_filter_hits() -> usize {
200202 crate::decode::obmc_pair_filter_hits()
201203 }
202204
205+/// Gate counters for the 4x32/32x4 rectangular strips: `(horz, vert, coeff)` hits.
203206 pub fn rect4_32_counters() -> (usize, usize, usize) {
204207 (
205208 crate::decode::rect4_32_horz_hits(),
@@ -26910,14 +26913,13 @@ mod tests {
2691026913 }
2691126914
2691226915 fn edge32_gate(name: &str, flat_band: bool) {
26913- let NAME = name;
2691426916 let _gate_lock = lock_gate_counters();
2691526917 if !have_ffmpeg() {
26916- eprintln!("SKIP {NAME}: no ffmpeg");
26918+ eprintln!("SKIP {name}: no ffmpeg");
2691726919 return;
2691826920 }
2691926921 if !have_aomenc() {
26920- eprintln!("SKIP {NAME}: no aomenc at {}", aomenc_path().display());
26922+ eprintln!("SKIP {name}: no aomenc at {}", aomenc_path().display());
2692126923 return;
2692226924 }
2692326925 // (width, height, frames, ten_bit, tile_columns_log2)
@@ -27029,7 +27031,7 @@ mod tests {
2702927031 .expect("ffmpeg failed to run");
2703027032 assert!(
2703127033 y4m.status.success(),
27032- "{NAME}: ffmpeg fixture: {}",
27034+ "{name}: ffmpeg fixture: {}",
2703327035 String::from_utf8_lossy(&y4m.stderr)
2703427036 );
2703527037 let cq_arg = format!("--cq-level={cq}");
@@ -27085,7 +27087,7 @@ mod tests {
2708527087 let out = child.wait_with_output().expect("aomenc failed to run");
2708627088 assert!(
2708727089 out.status.success(),
27088- "{NAME}: aomenc refused the fixture: {}",
27090+ "{name}: aomenc refused the fixture: {}",
2708927091 String::from_utf8_lossy(&out.stderr)
2709027092 );
2709127093 let stream = out.stdout;
@@ -27093,7 +27095,7 @@ mod tests {
2709327095 assert_eq!(
2709427096 parsed_bit_depth(&stream),
2709527097 10,
27096- "{NAME}: aomenc did not write a 10-bit sequence header"
27098+ "{name}: aomenc did not write a 10-bit sequence header"
2709727099 );
2709827100 }
2709927101 let tag = format!(
@@ -27106,7 +27108,7 @@ mod tests {
2710627108 // desync surfaces as a panic deep in mc.rs with no arm in the
2710727109 // message, and r8 spent a run bisecting arms by hand.
2710827110 if std::env::var_os("EC_GATE_VERBOSE").is_some() {
27109- eprintln!("{NAME}: attempting {tag}");
27111+ eprintln!("{name}: attempting {tag}");
2711027112 }
2711127113 let decoded = match decode_stream(&stream) {
2711227114 Ok(frames) => frames,
@@ -27114,7 +27116,7 @@ mod tests {
2711427116 let msg = e.to_string();
2711527117 assert!(
2711627118 msg.contains("unsupported"),
27117- "{NAME} failed outright, not a named refusal ({tag}): {msg}"
27119+ "{name} failed outright, not a named refusal ({tag}): {msg}"
2711827120 );
2711927121 refusals.push(format!("{tag}: {msg}"));
2712027122 continue;
@@ -27131,7 +27133,7 @@ mod tests {
2713127133 assert_eq!(
2713227134 decoded.len(),
2713327135 reference.len(),
27134- "{NAME}: {tag}: shown-frame count vs ffmpeg"
27136+ "{name}: {tag}: shown-frame count vs ffmpeg"
2713527137 );
2713627138 for (i, (ours, theirs)) in decoded.iter().zip(reference.iter()).enumerate() {
2713727139 for (plane, a, b, w) in [
@@ -27149,10 +27151,10 @@ mod tests {
2714927151 *per_row.entry(k / w).or_default() += 1;
2715027152 }
2715127153 }
27152- eprintln!("{NAME}: {tag} plane {plane} diffs per row: {per_row:?}");
27154+ eprintln!("{name}: {tag} plane {plane} diffs per row: {per_row:?}");
2715327155 }
2715427156 panic!(
27155- "{NAME}: {tag} frame {i} plane {plane}: {n} pixels differ, first \
27157+ "{name}: {tag} frame {i} plane {plane}: {n} pixels differ, first \
2715627158 at row {} col {} (ours {} vs ffmpeg {}) [edge32={delta:?}]",
2715727159 d / w,
2715827160 d % w,
@@ -27174,23 +27176,23 @@ mod tests {
2717427176 }
2717527177 assert!(
2717627178 compared > 0,
27177- "{NAME}: every attempt hit a named refusal:\n{}",
27179+ "{name}: every attempt hit a named refusal:\n{}",
2717827180 refusals.join("\n")
2717927181 );
2718027182 assert!(
2718127183 !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 \
2718327185 multi-tile twins compared nothing:\n{}",
2718427186 refusals.join("\n")
2718527187 );
2718627188 assert!(
2718727189 !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 \
2718927191 {compared} compared attempts -- the straddling arms proved nothing"
2719027192 );
2719127193 assert!(
2719227194 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 \
2719427196 {compared} compared attempts -- the gate proved nothing"
2719527197 );
2719627198 // lane-golomb r3: the flat-band arm's ASSERT moved one level up. Until
@@ -27202,16 +27204,16 @@ mod tests {
2720227204 // content. Slots 6/7 are the strips actually decoded at the edge.
2720327205 assert!(
2720427206 !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 \
2720627208 (edge32={totals:?}, {compared} compared attempts)"
2720727209 );
2720827210 assert!(
2720927211 !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 \
2721127213 (edge32={totals:?}, {compared} compared attempts)"
2721227214 );
2721327215 eprintln!(
27214- "{NAME}: {compared} pixel-exact attempts, 32-level edge bits \
27216+ "{name}: {compared} pixel-exact attempts, 32-level edge bits \
2721527217 [horz_or_vert={} split={}] bottom-HORZ={} right-VERT={}, 64-level edge bits \
2721627218 [horz_or_vert={} split={}] bottom-HORZ={} right-VERT={}, \
2721727219 {straddle_units} straddling CDEF units, {} named refusals",
@@ -27226,7 +27228,7 @@ mod tests {
2722627228 refusals.len()
2722727229 );
2722827230 for r in &refusals {
27229- eprintln!("{NAME} refusal: {r}");
27231+ eprintln!("{name} refusal: {r}");
2723027232 }
2723127233 }
2723227234
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
10291029 /// undo, and nothing else: measuring the network's response to a unit
10301030 /// coefficient at every size gives the same `1 / (8 * sqrt(2))` per unit of
10311031 /// `dqDenom`, which is what [`forward_transform_2d`] divides out.
1032+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
10321033 fn build_dct_basis(n: usize) -> Vec<f64> {
10331034 let mut basis = vec![0.0f64; n * n];
10341035 let scale = (2.0 / n as f64).sqrt();
@@ -1050,6 +1051,7 @@ fn build_dct_basis(n: usize) -> Vec<f64> {
10501051 /// one of the transform sizes this crate codes (4 to 64, a power of two), so
10511052 /// a small fixed table indexed by `log2(n)` covers every caller without a
10521053 /// hash lookup.
1054+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
10531055 fn dct_basis(n: usize) -> &'static [f64] {
10541056 use std::sync::OnceLock;
10551057 // 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,
251251 /// `stride x stride` plane (`stride = max(bw, bh)`) so a rectangular mask
252252 /// indexes exactly like the square prediction buffer `decode.rs` blends
253253 /// into. Only rows `0..bh` / columns `0..bw` are meaningful.
254+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
254255 pub struct WedgeCodebook {
255256 /// `[sign][wedge_index] -> stride*stride` bytes, row stride `stride`.
256257 masks: [[Vec<u8>; MAX_WEDGE_TYPES]; 2],
258+ #[allow(dead_code)] // read only from the `#[cfg(test)]` gates
257259 pub bw: usize,
260+ #[allow(dead_code)] // read only from the `#[cfg(test)]` gates
258261 pub bh: usize,
259262 /// `max(bw, bh)` -- the row stride of every mask returned by [`Self::mask`].
263+ #[allow(dead_code)] // read only from the `#[cfg(test)]` gates
260264 pub stride: usize,
261265 }
262266