Skip to content

Commit 1fd0705

Browse files
committed
Added new section on EFM decode tools
1 parent 112b8a1 commit 1fd0705

File tree

10 files changed

+1378
-380
lines changed

10 files changed

+1378
-380
lines changed

wiki-default/Development/tools-metadata-format.md

Lines changed: 447 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# efm-decoder-audio
2+
3+
**EFM Data24 to Audio Decoder**
4+
5+
## Overview
6+
7+
efm-decoder-audio converts Data24 sections into 16-bit stereo PCM audio according to IEC 60908 specifications. This tool handles the final stage of audio decoding for CD audio and LaserDisc digital audio tracks, producing standard WAV files with detailed metadata.
8+
9+
## Usage
10+
11+
```bash
12+
efm-decoder-audio [options] <input.d24> <output.wav>
13+
```
14+
15+
## Options
16+
17+
### Standard Options
18+
19+
- `-h, --help` - Display help information
20+
- `-v, --version` - Display version information
21+
- `-d, --debug` - Show debug output
22+
- `-q, --quiet` - Suppress info and warning messages
23+
24+
### Audio Processing
25+
26+
- `--audacity-labels` - Output WAV metadata as Audacity labels
27+
- `--no-audio-concealment` - Do not conceal errors in the audio data
28+
- `--zero-pad` - Zero pad the audio data from 00:00:00
29+
- `--no-wav-header` - Output raw audio data without WAV header
30+
31+
### Debug Options
32+
33+
- `--show-audio` - Show Audio frame data
34+
- `--show-audio-debug` - Show Data24 to audio decoding debug
35+
- `--show-audio-correction-debug` - Show Audio correction debug
36+
- `--show-all-debug` - Show all decoding debug
37+
38+
### Arguments
39+
40+
- `input` - Input Data24 section file (from efm-decoder-d24)
41+
- `output` - Output WAV audio file
42+
43+
## Processing Pipeline
44+
45+
The decoding sequence performed by efm-decoder-audio:
46+
47+
1. **Data24 Sections** → Input from efm-decoder-d24 (or stdin via Unix pipes)
48+
2. **Audio Frame Extraction** → Extract 16-bit stereo samples
49+
3. **Error Concealment** → Interpolate or silence corrupted samples
50+
4. **WAV Generation** → Standard 44.1kHz 16-bit stereo output
51+
5. **Metadata Export** → Optional Audacity label file generation
52+
53+
**Unix Pipelining**: efm-decoder-audio supports stdin/stdout using `-`, allowing direct connection to other EFM decoder tools without intermediate files.
54+
55+
## Audio Output Format
56+
57+
### WAV Specifications
58+
59+
- **Sample Rate**: 44.1 kHz (44,100 samples/second)
60+
- **Bit Depth**: 16-bit signed integer
61+
- **Channels**: 2 (stereo)
62+
- **Format**: Standard WAV with proper headers
63+
64+
### Quality Metrics
65+
66+
Each Data24 section (1/75 second) produces:
67+
- 588 stereo sample pairs (44,100 ÷ 75 = 588)
68+
- 2,352 bytes of audio data per section
69+
- Total data rate: 176.4 KB/second
70+
71+
## Error Concealment
72+
73+
The tool provides sophisticated error handling:
74+
75+
### Concealment Methods
76+
77+
- **Interpolation**: Average of adjacent valid samples
78+
- **Silencing**: Zero amplitude for uncorrectable errors
79+
- **Detection**: Flags all concealed/silenced regions
80+
81+
### Concealment Control
82+
83+
- Default behavior performs automatic concealment for best audio quality
84+
- Use `--no-audio-concealment` option to disable concealment
85+
86+
## Metadata Output
87+
88+
### Audacity Labels Format
89+
90+
When `--audacity-labels` is specified, generates a .txt file containing:
91+
- **Timestamp precision**: Millisecond accuracy for individual samples
92+
- **Error locations**: Concealed and silenced sample positions
93+
- **Track information**: CD track boundaries (when available)
94+
- **Time codes**: Both Audacity time and CDDA format timestamps
95+
96+
### Example Metadata
97+
98+
```
99+
2038.365964 2038.366100 Silenced: 33:58:27
100+
0.000000 175.333333 Track: 01 [00:00:00-02:53:25]
101+
175.346667 470.520000 Track: 02 [00:00:00-04:55:13]
102+
```
103+
104+
## Pipeline Integration
105+
106+
### Input Requirements
107+
108+
- Data24 sections from efm-decoder-d24
109+
- Properly error-corrected data (CIRC processing completed)
110+
111+
### Common Workflows
112+
113+
#### Standard Audio Extraction
114+
115+
```bash
116+
# Complete pipeline for audio using Unix pipes
117+
efm-decoder-f2 input.efm - | efm-decoder-d24 - - | efm-decoder-audio - output.wav --audacity-labels
118+
119+
# Alternative: step by step with files
120+
efm-decoder-f2 input.efm temp.f2
121+
efm-decoder-d24 temp.f2 temp.d24
122+
efm-decoder-audio temp.d24 output.wav --audacity-labels
123+
```
124+
125+
#### Multi-Source Quality Enhancement
126+
127+
```bash
128+
# Stack multiple sources first
129+
efm-stacker-f2 source1.f2 source2.f2 source3.f2 stacked.f2
130+
efm-decoder-d24 stacked.f2 stacked.d24
131+
efm-decoder-audio stacked.d24 output.wav --audacity-labels
132+
```
133+
134+
## Performance Considerations
135+
136+
- Real-time processing: ~75x faster than real-time on modern hardware
137+
- Memory usage: Minimal (processes sections sequentially)
138+
- Quality depends heavily on CIRC correction effectiveness from efm-decoder-d24
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# efm-decoder-d24
2+
3+
**EFM F2 Section to Data24 Section Decoder**
4+
5+
## Overview
6+
7+
efm-decoder-d24 takes F2 sections as input (from efm-decoder-f2) and decodes them into Data24 sections. This tool performs the critical CIRC error correction (C1 and C2) and unscrambling according to ECMA-130 specifications.
8+
9+
Data24 sections are an intermediate format that can be interpreted as either audio data (IEC 60908) or sector-based data (ECMA-130).
10+
11+
## Usage
12+
13+
```bash
14+
efm-decoder-d24 [options] <input.f2> <output.d24>
15+
```
16+
17+
## Options
18+
19+
- `-h, --help` - Display help information
20+
- `-v, --version` - Display version information
21+
- `-d, --debug` - Show debug output
22+
- `-q, --quiet` - Suppress info and warning messages
23+
- `--show-f1` - Show F1 frame data
24+
- `--show-data24` - Show Data24 frame data
25+
- `--show-f2-debug` - Show F2 to F1 decoding debug
26+
- `--show-f1-debug` - Show F1 to Data24 decoding debug
27+
- `--show-all-debug` - Show all debug options
28+
29+
### Arguments
30+
31+
- `input` - Input F2 section file (from efm-decoder-f2)
32+
- `output` - Output Data24 section file
33+
34+
## Processing Pipeline
35+
36+
The decoding sequence performed by efm-decoder-d24:
37+
38+
1. **F2 Sections** → Input from efm-decoder-f2 (or stdin via Unix pipes)
39+
2. **F1 Sections** → CIRC error correction applied
40+
3. **Data24 Sections** → Byte order corrected, ready for final decoding
41+
42+
**Unix Pipelining**: efm-decoder-d24 supports stdin/stdout using `-`, allowing seamless integration in EFM processing pipelines.
43+
44+
## Technical Details
45+
46+
### CIRC Error Correction
47+
48+
The tool implements Cross-Interleaved Reed-Solomon Code (CIRC) error correction:
49+
- **C1 Correction**: First level error correction
50+
- **C2 Correction**: Second level error correction
51+
- **Unscrambling**: Data de-interleaving according to ECMA-130
52+
53+
### Data24 Format
54+
55+
Data24 sections consist of:
56+
- 98 frames per section (representing 1/75th second)
57+
- 24 bytes per frame (2352 bytes total per section)
58+
- Corrected byte order (unlike F1 frames which have reversed byte order)
59+
- Preserved section metadata from F2 input
60+
61+
### Error Handling
62+
63+
The CIRC system can:
64+
- **Detect** up to 4 symbol errors per codeword
65+
- **Correct** up to 2 symbol errors per codeword
66+
- **Flag** uncorrectable errors for concealment by downstream tools
67+
68+
## Output Format
69+
70+
Data24 sections can be processed by either:
71+
- `efm-decoder-audio` - For audio decoding (CD audio, LaserDisc digital audio)
72+
- `efm-decoder-data` - For data decoding (Domesday LaserDiscs, CD-ROM data)
73+
74+
## Performance Notes
75+
76+
- CIRC correction is computationally intensive
77+
- Error correction effectiveness depends on input quality
78+
- Heavily damaged sections may require multiple source stacking (efm-stacker-f2)
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# efm-decoder-data
2+
3+
**EFM Data24 to Binary Data Decoder**
4+
5+
## Overview
6+
7+
efm-decoder-data converts Data24 sections into ECMA-130 compliant binary data sectors. This tool handles data-mode EFM decoding for applications like Domesday LaserDiscs and CD-ROM data, performing Reed-Solomon Product Code (RSPC) error correction and producing raw binary output.
8+
9+
## Usage
10+
11+
```bash
12+
efm-decoder-data [options] <input.d24> <output.bin>
13+
```
14+
15+
## Options
16+
17+
- `-h, --help` - Display help information
18+
- `-v, --version` - Display version information
19+
- `-d, --debug` - Show debug output
20+
- `-q, --quiet` - Suppress info and warning messages
21+
- `--output-metadata` - Output bad sector map metadata file
22+
- `--show-rawsector` - Show raw sector frame data
23+
- `--show-rawsector-debug` - Show Data24 to raw sector decoding debug
24+
- `--show-sector-debug` - Show raw sector to sector decoding debug
25+
- `--show-sector-correction-debug` - Show sector correction debug
26+
- `--show-all-debug` - Show all decoding debug
27+
28+
### Arguments
29+
30+
- `input` - Input Data24 section file (from efm-decoder-d24)
31+
- `output` - Output binary data file
32+
33+
## Processing Pipeline
34+
35+
The decoding sequence performed by efm-decoder-data:
36+
37+
1. **Data24 Sections** → Input from efm-decoder-d24 (or stdin via Unix pipes, 2352 bytes per section)
38+
2. **Raw Sectors** → Extract 2048-byte data sectors from each section
39+
3. **RSPC Error Correction** → Reed-Solomon Product Code correction
40+
4. **Sector Validation** → Mark sectors as valid or invalid
41+
5. **Binary Output** → Continuous binary data stream
42+
43+
**Unix Pipelining**: efm-decoder-data supports stdin/stdout using `-`, enabling direct data extraction from EFM processing pipelines.
44+
45+
## Technical Details
46+
47+
### Data Format Conversion
48+
49+
- **Input**: Data24 sections (2352 bytes each, representing 1/75 second)
50+
- **Processing**: Strip EFM parity and error correction overhead
51+
- **Output**: Pure data sectors (2048 bytes each)
52+
- **Efficiency**: ~87% data efficiency (2048/2352)
53+
54+
### RSPC Error Correction
55+
56+
Implements Reed-Solomon Product Code correction according to ECMA-130:
57+
- **Q Parity**: Outer code correction
58+
- **P Parity**: Inner code correction
59+
- **Sector-level**: All-or-nothing correction per 2048-byte sector
60+
- **Unscrambling**: Data de-interleaving for error correction
61+
62+
### Error Handling
63+
64+
Unlike audio decoding, data decoding is binary:
65+
- **Valid sectors**: Fully corrected, guaranteed accuracy
66+
- **Invalid sectors**: Uncorrectable, flagged in metadata
67+
- **No concealment**: Corrupted data is not interpolated
68+
69+
## Metadata Output
70+
71+
### Bad Sector Map
72+
73+
When `--output-metadata` is specified, creates a text file listing invalid sector addresses:
74+
75+
```
76+
28
77+
29
78+
30
79+
31
80+
```
81+
82+
Each number represents a 2048-byte sector that could not be corrected.
83+
84+
### Format
85+
86+
- One sector address per line
87+
- Addresses are sequential (starting from 0)
88+
- Only invalid/uncorrectable sectors are listed
89+
- Can be used by downstream tools for error handling
90+
91+
## Pipeline Integration
92+
93+
### Input Requirements
94+
95+
- Data24 sections from efm-decoder-d24
96+
- CIRC-corrected data (first-stage error correction completed)
97+
98+
### Common Workflows
99+
100+
#### Standard Data Extraction
101+
102+
```bash
103+
# Complete pipeline for data using Unix pipes
104+
efm-decoder-f2 input.efm - | efm-decoder-d24 - - | efm-decoder-data - output.bin --output-metadata
105+
106+
# Alternative: step by step with files
107+
efm-decoder-f2 input.efm temp.f2
108+
efm-decoder-d24 temp.f2 temp.d24
109+
efm-decoder-data temp.d24 output.bin --output-metadata
110+
```
111+
112+
#### Domesday LaserDisc Workflow
113+
114+
```bash
115+
# Extract data then verify VFS structure
116+
efm-decoder-data domesday.d24 domesday.bin --output-metadata
117+
vfs-verifier domesday.bin domesday_metadata.txt
118+
```
119+
120+
#### Multi-Source Data Recovery
121+
122+
```bash
123+
# Stack sources for better error correction
124+
efm-stacker-f2 disc1.f2 disc2.f2 disc3.f2 stacked.f2
125+
efm-decoder-d24 stacked.f2 stacked.d24
126+
efm-decoder-data stacked.d24 recovered.bin --output-metadata
127+
```
128+
129+
## Output Verification
130+
131+
The extracted binary data can be verified using:
132+
- `vfs-verifier` - For Domesday LaserDisc VFS structures
133+
- Standard file analysis tools
134+
- Checksum verification (if reference data available)

0 commit comments

Comments
 (0)