From eafdbd597e8f2f74dc321513fb4f26c40b6fc515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 2 Dec 2026 13:38:56 +0300 Subject: [PATCH] U19: move gen_dts_tables.py and gen_h263_tables.py next to their outputs (paths in headers updated, output bytes unchanged) --- {tools => crates/ec-dts}/gen_dts_tables.py | 6 +++--- crates/ec-dts/src/lib.rs | 2 +- crates/ec-dts/src/tables_data.rs | 2 +- crates/ec-dts/tests/spec_tables.rs | 2 +- crates/ec-dts/tests/spec_ts102114_tables.txt | 2 +- {tools => crates/ec-mpeg4}/gen_h263_tables.py | 4 ++-- crates/ec-mpeg4/src/h263data.rs | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) rename {tools => crates/ec-dts}/gen_dts_tables.py (98%) rename {tools => crates/ec-mpeg4}/gen_h263_tables.py (99%) diff --git a/tools/gen_dts_tables.py b/crates/ec-dts/gen_dts_tables.py similarity index 98% rename from tools/gen_dts_tables.py rename to crates/ec-dts/gen_dts_tables.py index 02053af3..bfb60fd3 100644 --- a/tools/gen_dts_tables.py +++ b/crates/ec-dts/gen_dts_tables.py @@ -7,7 +7,7 @@ https://www.etsi.org/deliver/etsi_ts/102100_102199/102114/01.06.01_60/ts_102114v Usage: pdftotext -layout ts_102114v010601p.pdf ts102114.txt - python3 -I tools/gen_dts_tables.py ts102114.txt \ + python3 -I crates/ec-dts/gen_dts_tables.py ts102114.txt \ crates/ec-dts/src/tables_data.rs crates/ec-dts/tests/spec_ts102114_tables.txt The spec text (decimal commas, "1 926" style thousands separators) is parsed @@ -254,7 +254,7 @@ def main(): # ---- write the raw spec numbers with open(out_spec, 'w') as f: f.write('# Numbers exactly as printed in ETSI TS 102 114 V1.6.1 (2019-08), Annex D / clause 5.\n') - f.write('# Written by tools/gen_dts_tables.py; decimal commas written as points.\n') + f.write('# Written by crates/ec-dts/gen_dts_tables.py; decimal commas written as points.\n') f.write('# table NAME | clause | values... (invalid entries kept as the word "invalid")\n') f.write('# huff TABLE | clause | level:length:code ... (code = value of the code word)\n') for name, cl, vals in raw: @@ -281,7 +281,7 @@ def main(): R = {n: v for n, _, v in raw} out.append('//! Constant tables for DTS Coherent Acoustics (ETSI TS 102 114).') out.append('//!') - out.append('//! GENERATED by tools/gen_dts_tables.py from the numeric tables of') + out.append('//! GENERATED by crates/ec-dts/gen_dts_tables.py from the numeric tables of') out.append('//! ETSI TS 102 114 V1.6.1 (2019-08); the clause of each table is named on') out.append('//! it. The raw printed numbers are committed in') out.append('//! tests/spec_ts102114_tables.txt and tests/spec_tables.rs checks every') diff --git a/crates/ec-dts/src/lib.rs b/crates/ec-dts/src/lib.rs index 043e0635..c7a2e338 100644 --- a/crates/ec-dts/src/lib.rs +++ b/crates/ec-dts/src/lib.rs @@ -29,7 +29,7 @@ //! [`Error::Unsupported`] naming what and why. No input panics. //! //! The constant tables in [`tables_data`] are generated by -//! `tools/gen_dts_tables.py` from the numeric tables printed in ETSI TS 102 114 +//! `crates/ec-dts/gen_dts_tables.py` from the numeric tables printed in ETSI TS 102 114 //! V1.6.1 and checked against them by `tests/spec_tables.rs`; the few tables //! the standard does not print usably are in `tables_residual.rs`. diff --git a/crates/ec-dts/src/tables_data.rs b/crates/ec-dts/src/tables_data.rs index be713780..75e7acf8 100644 --- a/crates/ec-dts/src/tables_data.rs +++ b/crates/ec-dts/src/tables_data.rs @@ -1,6 +1,6 @@ //! Constant tables for DTS Coherent Acoustics (ETSI TS 102 114). //! -//! GENERATED by tools/gen_dts_tables.py from the numeric tables of +//! GENERATED by crates/ec-dts/gen_dts_tables.py from the numeric tables of //! ETSI TS 102 114 V1.6.1 (2019-08); the clause of each table is named on //! it. The raw printed numbers are committed in //! tests/spec_ts102114_tables.txt and tests/spec_tables.rs checks every diff --git a/crates/ec-dts/tests/spec_tables.rs b/crates/ec-dts/tests/spec_tables.rs index c2950f50..3f650cde 100644 --- a/crates/ec-dts/tests/spec_tables.rs +++ b/crates/ec-dts/tests/spec_tables.rs @@ -1,6 +1,6 @@ //! The constant tables in `tables_data.rs` against the numbers printed in //! ETSI TS 102 114 V1.6.1 (2019-08), committed in `spec_ts102114_tables.txt` -//! (written by `tools/gen_dts_tables.py`, with the clause of every table). +//! (written by `crates/ec-dts/gen_dts_tables.py`, with the clause of every table). //! //! The conversions from printed number to Rust value are repeated here //! independently of the generator. diff --git a/crates/ec-dts/tests/spec_ts102114_tables.txt b/crates/ec-dts/tests/spec_ts102114_tables.txt index 75523480..d0d4dd4b 100644 --- a/crates/ec-dts/tests/spec_ts102114_tables.txt +++ b/crates/ec-dts/tests/spec_ts102114_tables.txt @@ -1,5 +1,5 @@ # Numbers exactly as printed in ETSI TS 102 114 V1.6.1 (2019-08), Annex D / clause 5. -# Written by tools/gen_dts_tables.py; decimal commas written as points. +# Written by crates/ec-dts/gen_dts_tables.py; decimal commas written as points. # table NAME | clause | values... (invalid entries kept as the word "invalid") # huff TABLE | clause | level:length:code ... (code = value of the code word) 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 diff --git a/tools/gen_h263_tables.py b/crates/ec-mpeg4/gen_h263_tables.py similarity index 99% rename from tools/gen_h263_tables.py rename to crates/ec-mpeg4/gen_h263_tables.py index 02b54efd..0ead1e56 100644 --- a/tools/gen_h263_tables.py +++ b/crates/ec-mpeg4/gen_h263_tables.py @@ -3,7 +3,7 @@ Usage: pdftotext -layout T-REC-H.263-200501-I!!PDF-E.pdf h263.txt - python3 -I tools/gen_h263_tables.py h263.txt crates/ec-mpeg4/src/h263data.rs + python3 -I crates/ec-mpeg4/gen_h263_tables.py h263.txt crates/ec-mpeg4/src/h263data.rs rustfmt --edition 2021 crates/ec-mpeg4/src/h263data.rs 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): w(f"pub const {name}: [{ty}; {len(a)}] = [" + ", ".join(str(x) for x in a) + "];\n") -w("""// Generated by tools/gen_h263_tables.py from the text of ITU-T Rec. H.263 (01/2005) +w("""// Generated by crates/ec-mpeg4/gen_h263_tables.py from the text of ITU-T Rec. H.263 (01/2005) // (https://www.itu.int/rec/T-REC-H.263). Do not edit by hand. // // Every table in this file is transcribed from the Recommendation; the clause or table diff --git a/crates/ec-mpeg4/src/h263data.rs b/crates/ec-mpeg4/src/h263data.rs index 5a4317e7..8d693d3f 100644 --- a/crates/ec-mpeg4/src/h263data.rs +++ b/crates/ec-mpeg4/src/h263data.rs @@ -1,4 +1,4 @@ -// Generated by tools/gen_h263_tables.py from the text of ITU-T Rec. H.263 (01/2005) +// Generated by crates/ec-mpeg4/gen_h263_tables.py from the text of ITU-T Rec. H.263 (01/2005) // (https://www.itu.int/rec/T-REC-H.263). Do not edit by hand. // // Every table in this file is transcribed from the Recommendation; the clause or table