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 commiteafdbd597e8f2f74dc321513fb4f26c40b6fc515Parent: f3d33ad7 changed files +10 -10
- tools/gen_dts_tables.py → crates/ec-dts/gen_dts_tables.py +3 -3
- crates/ec-dts/src/lib.rs +1 -1
- crates/ec-dts/src/tables_data.rs +1 -1
- crates/ec-dts/tests/spec_tables.rs +1 -1
- crates/ec-dts/tests/spec_ts102114_tables.txt +1 -1
- tools/gen_h263_tables.py → crates/ec-mpeg4/gen_h263_tables.py +2 -2
- crates/ec-mpeg4/src/h263data.rs +1 -1
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 | ||
| 7 | 7 | |
| 8 | 8 | Usage: |
| 9 | 9 | 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 \ | |
| 11 | 11 | crates/ec-dts/src/tables_data.rs crates/ec-dts/tests/spec_ts102114_tables.txt |
| 12 | 12 | |
| 13 | 13 | The spec text (decimal commas, "1 926" style thousands separators) is parsed |
| @@ -254,7 +254,7 @@ def main(): | ||
| 254 | 254 | # ---- write the raw spec numbers |
| 255 | 255 | with open(out_spec, 'w') as f: |
| 256 | 256 | 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') | |
| 258 | 258 | f.write('# table NAME | clause | values... (invalid entries kept as the word "invalid")\n') |
| 259 | 259 | f.write('# huff TABLE | clause | level:length:code ... (code = value of the code word)\n') |
| 260 | 260 | for name, cl, vals in raw: |
| @@ -281,7 +281,7 @@ def main(): | ||
| 281 | 281 | R = {n: v for n, _, v in raw} |
| 282 | 282 | out.append('//! Constant tables for DTS Coherent Acoustics (ETSI TS 102 114).') |
| 283 | 283 | 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') | |
| 285 | 285 | out.append('//! ETSI TS 102 114 V1.6.1 (2019-08); the clause of each table is named on') |
| 286 | 286 | out.append('//! it. The raw printed numbers are committed in') |
| 287 | 287 | 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 @@ | ||
| 29 | 29 | //! [`Error::Unsupported`] naming what and why. No input panics. |
| 30 | 30 | //! |
| 31 | 31 | //! 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 | |
| 33 | 33 | //! V1.6.1 and checked against them by `tests/spec_tables.rs`; the few tables |
| 34 | 34 | //! the standard does not print usably are in `tables_residual.rs`. |
| 35 | 35 |
crates/ec-dts/src/tables_data.rsmodified+1 -1
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | //! Constant tables for DTS Coherent Acoustics (ETSI TS 102 114). |
| 2 | 2 | //! |
| 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 | |
| 4 | 4 | //! ETSI TS 102 114 V1.6.1 (2019-08); the clause of each table is named on |
| 5 | 5 | //! it. The raw printed numbers are committed in |
| 6 | 6 | //! 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 @@ | ||
| 1 | 1 | //! The constant tables in `tables_data.rs` against the numbers printed in |
| 2 | 2 | //! 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). | |
| 4 | 4 | //! |
| 5 | 5 | //! The conversions from printed number to Rust value are repeated here |
| 6 | 6 | //! independently of the generator. |
crates/ec-dts/tests/spec_ts102114_tables.txtmodified+1 -1
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | # 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. | |
| 3 | 3 | # table NAME | clause | values... (invalid entries kept as the word "invalid") |
| 4 | 4 | # huff TABLE | clause | level:length:code ... (code = value of the code word) |
| 5 | 5 | 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 @@ | ||
| 3 | 3 | |
| 4 | 4 | Usage: |
| 5 | 5 | 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 | |
| 7 | 7 | rustfmt --edition 2021 crates/ec-mpeg4/src/h263data.rs |
| 8 | 8 | |
| 9 | 9 | 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): | ||
| 277 | 277 | w(f"pub const {name}: [{ty}; {len(a)}] = [" + ", ".join(str(x) for x in a) + "];\n") |
| 278 | 278 | |
| 279 | 279 | |
| 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) | |
| 281 | 281 | // (https://www.itu.int/rec/T-REC-H.263). Do not edit by hand. |
| 282 | 282 | // |
| 283 | 283 | // 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) | |
| 2 | 2 | // (https://www.itu.int/rec/T-REC-H.263). Do not edit by hand. |
| 3 | 3 | // |
| 4 | 4 | // Every table in this file is transcribed from the Recommendation; the clause or table |