forge
Explore
Log in

Don't you dare go Hollow

U19: move gen_dts_tables.py and gen_h263_tables.py next to their outputs (paths in headers updated, output bytes unchanged)

Browse files at this commit

eafdbd597e8f2f74dc321513fb4f26c40b6fc515Ahmet Kaan GümüşParent: f3d33ad
tools/gen_dts_tables.py → crates/ec-dts/gen_dts_tables.pyrenamed+3 -3
@@ -7,7 +7,7 @@ https://www.etsi.org/deliver/etsi_ts/102100_102199/102114/01.06.01_60/ts_102114v
77
88 Usage:
99 pdftotext -layout ts_102114v010601p.pdf ts102114.txt
10- python3 -I tools/gen_dts_tables.py ts102114.txt \
10+ python3 -I crates/ec-dts/gen_dts_tables.py ts102114.txt \
1111 crates/ec-dts/src/tables_data.rs crates/ec-dts/tests/spec_ts102114_tables.txt
1212
1313 The spec text (decimal commas, "1 926" style thousands separators) is parsed
@@ -254,7 +254,7 @@ def main():
254254 # ---- write the raw spec numbers
255255 with open(out_spec, 'w') as f:
256256 f.write('# Numbers exactly as printed in ETSI TS 102 114 V1.6.1 (2019-08), Annex D / clause 5.\n')
257- f.write('# Written by tools/gen_dts_tables.py; decimal commas written as points.\n')
257+ f.write('# Written by crates/ec-dts/gen_dts_tables.py; decimal commas written as points.\n')
258258 f.write('# table NAME | clause | values... (invalid entries kept as the word "invalid")\n')
259259 f.write('# huff TABLE | clause | level:length:code ... (code = value of the code word)\n')
260260 for name, cl, vals in raw:
@@ -281,7 +281,7 @@ def main():
281281 R = {n: v for n, _, v in raw}
282282 out.append('//! Constant tables for DTS Coherent Acoustics (ETSI TS 102 114).')
283283 out.append('//!')
284- out.append('//! GENERATED by tools/gen_dts_tables.py from the numeric tables of')
284+ out.append('//! GENERATED by crates/ec-dts/gen_dts_tables.py from the numeric tables of')
285285 out.append('//! ETSI TS 102 114 V1.6.1 (2019-08); the clause of each table is named on')
286286 out.append('//! it. The raw printed numbers are committed in')
287287 out.append('//! tests/spec_ts102114_tables.txt and tests/spec_tables.rs checks every')
crates/ec-dts/src/lib.rsmodified+1 -1
@@ -29,7 +29,7 @@
2929 //! [`Error::Unsupported`] naming what and why. No input panics.
3030 //!
3131 //! The constant tables in [`tables_data`] are generated by
32-//! `tools/gen_dts_tables.py` from the numeric tables printed in ETSI TS 102 114
32+//! `crates/ec-dts/gen_dts_tables.py` from the numeric tables printed in ETSI TS 102 114
3333 //! V1.6.1 and checked against them by `tests/spec_tables.rs`; the few tables
3434 //! the standard does not print usably are in `tables_residual.rs`.
3535
crates/ec-dts/src/tables_data.rsmodified+1 -1
@@ -1,6 +1,6 @@
11 //! Constant tables for DTS Coherent Acoustics (ETSI TS 102 114).
22 //!
3-//! GENERATED by tools/gen_dts_tables.py from the numeric tables of
3+//! GENERATED by crates/ec-dts/gen_dts_tables.py from the numeric tables of
44 //! ETSI TS 102 114 V1.6.1 (2019-08); the clause of each table is named on
55 //! it. The raw printed numbers are committed in
66 //! tests/spec_ts102114_tables.txt and tests/spec_tables.rs checks every
crates/ec-dts/tests/spec_tables.rsmodified+1 -1
@@ -1,6 +1,6 @@
11 //! The constant tables in `tables_data.rs` against the numbers printed in
22 //! ETSI TS 102 114 V1.6.1 (2019-08), committed in `spec_ts102114_tables.txt`
3-//! (written by `tools/gen_dts_tables.py`, with the clause of every table).
3+//! (written by `crates/ec-dts/gen_dts_tables.py`, with the clause of every table).
44 //!
55 //! The conversions from printed number to Rust value are repeated here
66 //! independently of the generator.
crates/ec-dts/tests/spec_ts102114_tables.txtmodified+1 -1
@@ -1,5 +1,5 @@
11 # Numbers exactly as printed in ETSI TS 102 114 V1.6.1 (2019-08), Annex D / clause 5.
2-# Written by tools/gen_dts_tables.py; decimal commas written as points.
2+# Written by crates/ec-dts/gen_dts_tables.py; decimal commas written as points.
33 # table NAME | clause | values... (invalid entries kept as the word "invalid")
44 # huff TABLE | clause | level:length:code ... (code = value of the code word)
55 table QUANT_LEVELS | Table 5-26 | 0 3 5 7 9 13 17 25 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152 4194304 8388608
tools/gen_h263_tables.py → crates/ec-mpeg4/gen_h263_tables.pyrenamed+2 -2
@@ -3,7 +3,7 @@
33
44 Usage:
55 pdftotext -layout T-REC-H.263-200501-I!!PDF-E.pdf h263.txt
6- python3 -I tools/gen_h263_tables.py h263.txt crates/ec-mpeg4/src/h263data.rs
6+ python3 -I crates/ec-mpeg4/gen_h263_tables.py h263.txt crates/ec-mpeg4/src/h263data.rs
77 rustfmt --edition 2021 crates/ec-mpeg4/src/h263data.rs
88
99 The PDF is freely downloadable from https://www.itu.int/rec/T-REC-H.263 and is the
@@ -277,7 +277,7 @@ def arr1(name, ty, a, doc):
277277 w(f"pub const {name}: [{ty}; {len(a)}] = [" + ", ".join(str(x) for x in a) + "];\n")
278278
279279
280-w("""// Generated by tools/gen_h263_tables.py from the text of ITU-T Rec. H.263 (01/2005)
280+w("""// Generated by crates/ec-mpeg4/gen_h263_tables.py from the text of ITU-T Rec. H.263 (01/2005)
281281 // (https://www.itu.int/rec/T-REC-H.263). Do not edit by hand.
282282 //
283283 // Every table in this file is transcribed from the Recommendation; the clause or table
crates/ec-mpeg4/src/h263data.rsmodified+1 -1
@@ -1,4 +1,4 @@
1-// Generated by tools/gen_h263_tables.py from the text of ITU-T Rec. H.263 (01/2005)
1+// Generated by crates/ec-mpeg4/gen_h263_tables.py from the text of ITU-T Rec. H.263 (01/2005)
22 // (https://www.itu.int/rec/T-REC-H.263). Do not edit by hand.
33 //
44 // Every table in this file is transcribed from the Recommendation; the clause or table