1
1
mirror of https://github.com/wader/fq.git synced 2024-12-23 13:22:58 +03:00

Merge pull request #376 from wader/mp3_frame-fixes

mp3_frame: Add LSF support and fix incorrect main data handling
This commit is contained in:
Mattias Wadman 2022-08-17 21:45:18 +02:00 committed by GitHub
commit baa8ab9271
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
54 changed files with 1424 additions and 354 deletions

View File

@ -367,9 +367,9 @@ $ fq -d matroska dv mp3.mkv
0x230| c4 | . | original: 1 0x234.5-0x234.5 (0.1)
0x230| c4 | . | emphasis: "none" (0b0) 0x234.6-0x234.7 (0.2)
| | | side_info{}: 0x235-0x245.7 (17)
0x230| 00 00 | .. | main_data_end: 0 0x235-0x236 (1.1)
0x230| 00 | . | private_bits: 0 0x236.1-0x236.5 (0.5)
0x230| 00 0a | .. | share0: 0 0x236.6-0x237.1 (0.4)
0x230| 00 00 | .. | main_data_begin: 0 0x235-0x236 (1.1)
0x230| 00 | . | share: 0 0x236.1-0x236.5 (0.5)
0x230| 00 0a | .. | scfsi0: 0 0x236.6-0x237.1 (0.4)
| | | granules[0:2]: 0x237.2-0x245.7 (14.6)
| | | [0][0:1]: granule 0x237.2-0x23e.4 (7.3)
| | | [0]{}: channel 0x237.2-0x23e.4 (7.3)
@ -406,10 +406,9 @@ $ fq -d matroska dv mp3.mkv
0x240| 00 | . | preflag: 0 0x245.5-0x245.5 (0.1)
0x240| 00 | . | scalefac_scale: 0 0x245.6-0x245.6 (0.1)
0x240| 00 | . | count1table_select: 0 0x245.7-0x245.7 (0.1)
0x240| 07 aa c3 8e 33 85 d3 64 f1 a1| ....3..d..| data: raw bits 0x246-0x300.7 (187)
0x240| 07 aa c3 8e 33 85 d3 64 f1 a1| ....3..d..| audio_data: raw bits 0x246-0x300.7 (187)
0x250|c1 08 1c 58 1f 5e 1f 18 1c 46 04 1e 89 e5 b3 2e|...X.^...F......|
* |until 0x300.7 (187) | |
| | | other_data: raw bits 0x301-NA (0)
| | | crc_calculated: "2e0a" (raw bits) 0x301-NA (0)
| | | [3]{}: element 0x301-0x3d8.7 (216)
0x300| a3 | . | id: "simple_block" (0xa3) (Similar to Block, see (#block-structure), but without all the extra information, mostly used to reduced overhead when no extra feature is needed; see (#simpleblock-structure) on SimpleBlock Structure.) 0x301-0x301.7 (1)
@ -440,9 +439,9 @@ $ fq -d matroska dv mp3.mkv
0x300| c4 | . | original: 1 0x30b.5-0x30b.5 (0.1)
0x300| c4 | . | emphasis: "none" (0b0) 0x30b.6-0x30b.7 (0.2)
| | | side_info{}: 0x30c-0x31c.7 (17)
0x300| 04 82 | .. | main_data_end: 9 0x30c-0x30d (1.1)
0x300| 82 | . | private_bits: 0 0x30d.1-0x30d.5 (0.5)
0x300| 82 0a | .. | share0: 8 0x30d.6-0x30e.1 (0.4)
0x300| 04 82 | .. | main_data_begin: 9 0x30c-0x30d (1.1)
0x300| 82 | . | share: 0 0x30d.1-0x30d.5 (0.5)
0x300| 82 0a | .. | scfsi0: 8 0x30d.6-0x30e.1 (0.4)
| | | granules[0:2]: 0x30e.2-0x31c.7 (14.6)
| | | [0][0:1]: granule 0x30e.2-0x315.4 (7.3)
| | | [0]{}: channel 0x30e.2-0x315.4 (7.3)
@ -479,11 +478,9 @@ $ fq -d matroska dv mp3.mkv
0x310| 00 | . | preflag: 0 0x31c.5-0x31c.5 (0.1)
0x310| 00 | . | scalefac_scale: 0 0x31c.6-0x31c.6 (0.1)
0x310| 00 | . | count1table_select: 0 0x31c.7-0x31c.7 (0.1)
0x310| 01 d9 81| ...| data: raw bits 0x31d-0x3ce.7 (178)
0x310| 01 d9 81| ...| audio_data: raw bits 0x31d-0x3d8.7 (188)
0x320|38 05 c9 80 20 04 f1 80 8e 07 01 96 d2 b0 19 91|8... ...........|
* |until 0x3ce.7 (178) | |
0x3c0| 85| .| padding_byte: raw bits 0x3cf-0x3cf.7 (1)
0x3d0|62 08 3d a0 52 36 7f 26 17 |b.=.R6.&. | other_data: raw bits 0x3d0-0x3d8.7 (9)
* |until 0x3d8.7 (188) | |
| | | crc_calculated: "9950" (raw bits) 0x3d9-NA (0)
| | | [4]{}: element 0x3d9-0x4bf.7 (231)
0x3d0| a0 | . | id: "block_group" (0xa0) (Basic container of information containing a single Block and information specific to that Block.) 0x3d9-0x3d9.7 (1)
@ -519,9 +516,9 @@ $ fq -d matroska dv mp3.mkv
0x3e0| c4 | . | original: 1 0x3ec.5-0x3ec.5 (0.1)
0x3e0| c4 | . | emphasis: "none" (0b0) 0x3ec.6-0x3ec.7 (0.2)
| | | side_info{}: 0x3ed-0x3fd.7 (17)
0x3e0| 0d 80 | .. | main_data_end: 27 0x3ed-0x3ee (1.1)
0x3e0| 80 | . | private_bits: 0 0x3ee.1-0x3ee.5 (0.5)
0x3e0| 80 0d| ..| share0: 0 0x3ee.6-0x3ef.1 (0.4)
0x3e0| 0d 80 | .. | main_data_begin: 27 0x3ed-0x3ee (1.1)
0x3e0| 80 | . | share: 0 0x3ee.1-0x3ee.5 (0.5)
0x3e0| 80 0d| ..| scfsi0: 0 0x3ee.6-0x3ef.1 (0.4)
| | | granules[0:2]: 0x3ef.2-0x3fd.7 (14.6)
| | | [0][0:1]: granule 0x3ef.2-0x3f6.4 (7.3)
| | | [0]{}: channel 0x3ef.2-0x3f6.4 (7.3)
@ -558,13 +555,9 @@ $ fq -d matroska dv mp3.mkv
0x3f0| 00 | . | preflag: 0 0x3fd.5-0x3fd.5 (0.1)
0x3f0| 00 | . | scalefac_scale: 0 0x3fd.6-0x3fd.6 (0.1)
0x3f0| 00 | . | count1table_select: 0 0x3fd.7-0x3fd.7 (0.1)
0x3f0| 53 ca| S.| data: raw bits 0x3fe-0x49d.7 (160)
0x3f0| 53 ca| S.| audio_data: raw bits 0x3fe-0x4b9.7 (188)
0x400|1e 59 fd 29 ba 0b 84 d4 8a f8 8d cb a0 77 10 07|.Y.).........w..|
* |until 0x49d.7 (160) | |
0x490| 6a | j | padding_byte: raw bits 0x49e-0x49e.7 (1)
0x490| 4c| L| other_data: raw bits 0x49f-0x4b9.7 (27)
0x4a0|41 4d 45 33 2e 31 30 30 aa aa aa aa aa aa aa aa|AME3.100........|
0x4b0|aa aa aa aa aa aa aa aa aa aa |.......... |
* |until 0x4b9.7 (188) | |
| | | crc_calculated: "c36b" (raw bits) 0x4ba-NA (0)
| | | [1]{}: element 0x4ba-0x4bf.7 (6)
0x4b0| 75 a2 | u. | id: "discard_padding" (0x75a2) (Duration of the silent data added to the Block, expressed in Matroska Ticks -- ie in nanoseconds; see (#timestamp-ticks) (padding at the end of the Block for positive value, at the beginning of the Block for negative value). The duration of DiscardPadding is not calculated in the duration of the TrackEntry and **SHOULD** be discarded during playback.) 0x4ba-0x4bb.7 (2)

View File

@ -52,9 +52,9 @@ $ fq -d mp3 dv header-zeros-frames.mp3
0x030| c4 | . | original: 1 0x33.5-0x33.5 (0.1)
0x030| c4 | . | emphasis: "none" (0b0) 0x33.6-0x33.7 (0.2)
| | | side_info{}: 0x34-0x44.7 (17)
0x030| 00 00 | .. | main_data_end: 0 0x34-0x35 (1.1)
0x030| 00 | . | private_bits: 0 0x35.1-0x35.5 (0.5)
0x030| 00 0a | .. | share0: 0 0x35.6-0x36.1 (0.4)
0x030| 00 00 | .. | main_data_begin: 0 0x34-0x35 (1.1)
0x030| 00 | . | share: 0 0x35.1-0x35.5 (0.5)
0x030| 00 0a | .. | scfsi0: 0 0x35.6-0x36.1 (0.4)
| | | granules[0:2]: 0x36.2-0x44.7 (14.6)
| | | [0][0:1]: granule 0x36.2-0x3d.4 (7.3)
| | | [0]{}: channel 0x36.2-0x3d.4 (7.3)
@ -91,9 +91,8 @@ $ fq -d mp3 dv header-zeros-frames.mp3
0x040| 00 | . | preflag: 0 0x44.5-0x44.5 (0.1)
0x040| 00 | . | scalefac_scale: 0 0x44.6-0x44.6 (0.1)
0x040| 00 | . | count1table_select: 0 0x44.7-0x44.7 (0.1)
0x040| 07 aa c3 8e 33 85 d3 64 f1 a1 c1| ....3..d...| data: raw bits 0x45-0xff.7 (187)
0x040| 07 aa c3 8e 33 85 d3 64 f1 a1 c1| ....3..d...| audio_data: raw bits 0x45-0xff.7 (187)
0x050|08 1c 58 1f 5e 1f 18 1c 46 04 1e 89 e5 b3 2e 5a|..X.^...F......Z|
* |until 0xff.7 (end) (187) | |
| | | other_data: raw bits 0x100-NA (0)
| | | crc_calculated: "e5b0" (raw bits) 0x100-NA (0)
| | | footers[0:0]: 0x100-NA (0)

View File

@ -69,9 +69,9 @@ $ fq -d mp3 dv headerfooter.mp3
0x040|c4 |. | original: 1 0x40.5-0x40.5 (0.1)
0x040|c4 |. | emphasis: "none" (0b0) 0x40.6-0x40.7 (0.2)
| | | side_info{}: 0x41-0x51.7 (17)
0x040| 00 00 | .. | main_data_end: 0 0x41-0x42 (1.1)
0x040| 00 | . | private_bits: 0 0x42.1-0x42.5 (0.5)
0x040| 00 09 | .. | share0: 0 0x42.6-0x43.1 (0.4)
0x040| 00 00 | .. | main_data_begin: 0 0x41-0x42 (1.1)
0x040| 00 | . | share: 0 0x42.1-0x42.5 (0.5)
0x040| 00 09 | .. | scfsi0: 0 0x42.6-0x43.1 (0.4)
| | | granules[0:2]: 0x43.2-0x51.7 (14.6)
| | | [0][0:1]: granule 0x43.2-0x4a.4 (7.3)
| | | [0]{}: channel 0x43.2-0x4a.4 (7.3)
@ -104,10 +104,9 @@ $ fq -d mp3 dv headerfooter.mp3
0x050| c4 | . | preflag: 1 0x51.5-0x51.5 (0.1)
0x050| c4 | . | scalefac_scale: 0 0x51.6-0x51.6 (0.1)
0x050| c4 | . | count1table_select: 0 0x51.7-0x51.7 (0.1)
0x050| 00 5a b0 55 89 9a ad 48 5b 05 b0 42 03 50| .Z.U...H[..B.P| data: raw bits 0x52-0x10c.7 (187)
0x050| 00 5a b0 55 89 9a ad 48 5b 05 b0 42 03 50| .Z.U...H[..B.P| audio_data: raw bits 0x52-0x10c.7 (187)
0x060|26 02 66 42 ce b0 b4 da 23 1a 08 10 20 84 2c 10|&.fB....#... .,.|
* |until 0x10c.7 (187) | |
| | | other_data: raw bits 0x10d-NA (0)
| | | crc_calculated: "3c54" (raw bits) 0x10d-NA (0)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [1]{}: frame (mp3_frame) 0x10d-0x1dd.7 (209)
| | | header{}: 0x10d-0x110.7 (4)
@ -126,9 +125,9 @@ $ fq -d mp3 dv headerfooter.mp3
0x110|c4 |. | original: 1 0x110.5-0x110.5 (0.1)
0x110|c4 |. | emphasis: "none" (0b0) 0x110.6-0x110.7 (0.2)
| | | side_info{}: 0x111-0x121.7 (17)
0x110| 0d 03 | .. | main_data_end: 26 0x111-0x112 (1.1)
0x110| 03 | . | private_bits: 0 0x112.1-0x112.5 (0.5)
0x110| 03 c0 | .. | share0: 15 0x112.6-0x113.1 (0.4)
0x110| 0d 03 | .. | main_data_begin: 26 0x111-0x112 (1.1)
0x110| 03 | . | share: 0 0x112.1-0x112.5 (0.5)
0x110| 03 c0 | .. | scfsi0: 15 0x112.6-0x113.1 (0.4)
| | | granules[0:2]: 0x113.2-0x121.7 (14.6)
| | | [0][0:1]: granule 0x113.2-0x11a.4 (7.3)
| | | [0]{}: channel 0x113.2-0x11a.4 (7.3)
@ -161,12 +160,9 @@ $ fq -d mp3 dv headerfooter.mp3
0x120| 04 | . | preflag: 1 0x121.5-0x121.5 (0.1)
0x120| 04 | . | scalefac_scale: 0 0x121.6-0x121.6 (0.1)
0x120| 04 | . | count1table_select: 0 0x121.7-0x121.7 (0.1)
0x120| 55 55 55 55 55 55 55 55 55 55 55 55 55 55| UUUUUUUUUUUUUU| data: raw bits 0x122-0x1c2.7 (161)
0x120| 55 55 55 55 55 55 55 55 55 55 55 55 55 55| UUUUUUUUUUUUUU| audio_data: raw bits 0x122-0x1dd.7 (188)
0x130|55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55|UUUUUUUUUUUUUUUU|
* |until 0x1c2.7 (161) | |
0x1c0| 55 | U | padding_byte: raw bits 0x1c3-0x1c3.7 (1)
0x1c0| 55 55 55 55 55 55 55 55 55 55 55 55| UUUUUUUUUUUU| other_data: raw bits 0x1c4-0x1dd.7 (26)
0x1d0|55 55 55 55 55 55 55 55 55 55 55 55 55 55 |UUUUUUUUUUUUUU |
* |until 0x1dd.7 (188) | |
| | | crc_calculated: "ea58" (raw bits) 0x1de-NA (0)
| | | footers[0:1]: 0x1de-0x25d.7 (128)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [0]{}: footer (id3v1) 0x1de-0x25d.7 (128)

View File

@ -73,10 +73,10 @@ $ fq -d mp3 dv test.mp3
0x040|00 |. | original: 0 0x40.5-0x40.5 (0.1)
0x040|00 |. | emphasis: "none" (0b0) 0x40.6-0x40.7 (0.2)
| | | side_info{}: 0x41-0x60.7 (32)
0x040| 00 00 | .. | main_data_end: 0 0x41-0x42 (1.1)
0x040| 00 | . | private_bits: 0 0x42.1-0x42.3 (0.3)
0x040| 00 | . | share0: 0 0x42.4-0x42.7 (0.4)
0x040| 00 | . | share1: 0 0x43-0x43.3 (0.4)
0x040| 00 00 | .. | main_data_begin: 0 0x41-0x42 (1.1)
0x040| 00 | . | share: 0 0x42.1-0x42.3 (0.3)
0x040| 00 | . | scfsi0: 0 0x42.4-0x42.7 (0.4)
0x040| 00 | . | scfsi1: 0 0x43-0x43.3 (0.4)
| | | granules[0:2]: 0x43.4-0x60.7 (29.4)
| | | [0][0:2]: granule 0x43.4-0x52.1 (14.6)
| | | [0]{}: channel 0x43.4-0x4a.6 (7.3)
@ -272,7 +272,7 @@ $ fq -d mp3 dv test.mp3
0x0f0| 00 00 04 13 | .... | length: 1043 0xf5-0xf8.7 (4)
0x0f0| c2 aa | .. | music_crc: 49834 0xf9-0xfa.7 (2)
0x0f0| 7a 03 | z. | tag_crc: 31235 0xfb-0xfc.7 (2)
0x0f0| 00 00 00| ...| padding: raw bits 0xfd-0x10c.7 (16)
0x0f0| 00 00 00| ...| audio_data: raw bits 0xfd-0x10c.7 (16)
0x100|00 00 00 00 00 00 00 00 00 00 00 00 00 |............. |
| | | crc_calculated: "f7d3" (raw bits) 0x10d-NA (0)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [1]{}: frame (mp3_frame) 0x10d-0x2ad.7 (417)
@ -292,10 +292,10 @@ $ fq -d mp3 dv test.mp3
0x110|64 |d | original: 1 0x110.5-0x110.5 (0.1)
0x110|64 |d | emphasis: "none" (0b0) 0x110.6-0x110.7 (0.2)
| | | side_info{}: 0x111-0x130.7 (32)
0x110| 00 00 | .. | main_data_end: 0 0x111-0x112 (1.1)
0x110| 00 | . | private_bits: 0 0x112.1-0x112.3 (0.3)
0x110| 00 | . | share0: 0 0x112.4-0x112.7 (0.4)
0x110| 02 | . | share1: 0 0x113-0x113.3 (0.4)
0x110| 00 00 | .. | main_data_begin: 0 0x111-0x112 (1.1)
0x110| 00 | . | share: 0 0x112.1-0x112.3 (0.3)
0x110| 00 | . | scfsi0: 0 0x112.4-0x112.7 (0.4)
0x110| 02 | . | scfsi1: 0 0x113-0x113.3 (0.4)
| | | granules[0:2]: 0x113.4-0x130.7 (29.4)
| | | [0][0:2]: granule 0x113.4-0x122.1 (14.6)
| | | [0]{}: channel 0x113.4-0x11a.6 (7.3)
@ -365,10 +365,9 @@ $ fq -d mp3 dv test.mp3
0x130|00 |. | preflag: 0 0x130.5-0x130.5 (0.1)
0x130|00 |. | scalefac_scale: 0 0x130.6-0x130.6 (0.1)
0x130|00 |. | count1table_select: 0 0x130.7-0x130.7 (0.1)
0x130| 0a 6b 6d d8 c2 12 cd a0 0d bf 4d 03 01 8d 4c| .km.......M...L| data: raw bits 0x131-0x2ad.7 (381)
0x130| 0a 6b 6d d8 c2 12 cd a0 0d bf 4d 03 01 8d 4c| .km.......M...L| audio_data: raw bits 0x131-0x2ad.7 (381)
0x140|35 18 20 0c 1d db 6b 6d 7d df 7f e3 72 fb 62 10|5. ...km}...r.b.|
* |until 0x2ad.7 (381) | |
| | | other_data: raw bits 0x2ae-NA (0)
| | | crc_calculated: "1855" (raw bits) 0x2ae-NA (0)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [2]{}: frame (mp3_frame) 0x2ae-0x44f.7 (418)
| | | header{}: 0x2ae-0x2b1.7 (4)
@ -387,10 +386,10 @@ $ fq -d mp3 dv test.mp3
0x2b0| 64 | d | original: 1 0x2b1.5-0x2b1.5 (0.1)
0x2b0| 64 | d | emphasis: "none" (0b0) 0x2b1.6-0x2b1.7 (0.2)
| | | side_info{}: 0x2b2-0x2d1.7 (32)
0x2b0| 34 8f | 4. | main_data_end: 105 0x2b2-0x2b3 (1.1)
0x2b0| 8f | . | private_bits: 0 0x2b3.1-0x2b3.3 (0.3)
0x2b0| 8f | . | share0: 15 0x2b3.4-0x2b3.7 (0.4)
0x2b0| f3 | . | share1: 15 0x2b4-0x2b4.3 (0.4)
0x2b0| 34 8f | 4. | main_data_begin: 105 0x2b2-0x2b3 (1.1)
0x2b0| 8f | . | share: 0 0x2b3.1-0x2b3.3 (0.3)
0x2b0| 8f | . | scfsi0: 15 0x2b3.4-0x2b3.7 (0.4)
0x2b0| f3 | . | scfsi1: 15 0x2b4-0x2b4.3 (0.4)
| | | granules[0:2]: 0x2b4.4-0x2d1.7 (29.4)
| | | [0][0:2]: granule 0x2b4.4-0x2c3.1 (14.6)
| | | [0]{}: channel 0x2b4.4-0x2bb.6 (7.3)
@ -455,13 +454,9 @@ $ fq -d mp3 dv test.mp3
0x2d0| 04 | . | preflag: 1 0x2d1.5-0x2d1.5 (0.1)
0x2d0| 04 | . | scalefac_scale: 0 0x2d1.6-0x2d1.6 (0.1)
0x2d0| 04 | . | count1table_select: 0 0x2d1.7-0x2d1.7 (0.1)
0x2d0| 2e 31 30 30 55 55 55 55 55 55 55 55 55 55| .100UUUUUUUUUU| data: raw bits 0x2d2-0x3e5.7 (276)
0x2d0| 2e 31 30 30 55 55 55 55 55 55 55 55 55 55| .100UUUUUUUUUU| audio_data: raw bits 0x2d2-0x44f.7 (382)
0x2e0|55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55|UUUUUUUUUUUUUUUU|
* |until 0x3e5.7 (276) | |
0x3e0| 55 | U | padding_byte: raw bits 0x3e6-0x3e6.7 (1)
0x3e0| 55 55 55 55 55 55 55 55 55| UUUUUUUUU| other_data: raw bits 0x3e7-0x44f.7 (105)
0x3f0|55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55|UUUUUUUUUUUUUUUU|
* |until 0x44f.7 (105) | |
* |until 0x44f.7 (382) | |
| | | crc_calculated: "53c8" (raw bits) 0x450-NA (0)
| | | footers[0:1]: 0x450-0x4cf.7 (128)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [0]{}: footer (id3v1) 0x450-0x4cf.7 (128)

View File

@ -342,9 +342,9 @@ $ fq -d mp4 dv mp3.mp4
0x020| c4| .| original: 1 0x2f.5-0x2f.5 (0.1)
0x020| c4| .| emphasis: "none" (0b0) 0x2f.6-0x2f.7 (0.2)
| | | side_info{}: 0x30-0x40.7 (17)
0x030|00 00 |.. | main_data_end: 0 0x30-0x31 (1.1)
0x030| 00 | . | private_bits: 0 0x31.1-0x31.5 (0.5)
0x030| 00 0a | .. | share0: 0 0x31.6-0x32.1 (0.4)
0x030|00 00 |.. | main_data_begin: 0 0x30-0x31 (1.1)
0x030| 00 | . | share: 0 0x31.1-0x31.5 (0.5)
0x030| 00 0a | .. | scfsi0: 0 0x31.6-0x32.1 (0.4)
| | | granules[0:2]: 0x32.2-0x40.7 (14.6)
| | | [0][0:1]: granule 0x32.2-0x39.4 (7.3)
| | | [0]{}: channel 0x32.2-0x39.4 (7.3)
@ -381,10 +381,9 @@ $ fq -d mp4 dv mp3.mp4
0x040|00 |. | preflag: 0 0x40.5-0x40.5 (0.1)
0x040|00 |. | scalefac_scale: 0 0x40.6-0x40.6 (0.1)
0x040|00 |. | count1table_select: 0 0x40.7-0x40.7 (0.1)
0x040| 07 aa c3 8e 33 85 d3 64 f1 a1 c1 08 1c 58 1f| ....3..d.....X.| data: raw bits 0x41-0xfb.7 (187)
0x040| 07 aa c3 8e 33 85 d3 64 f1 a1 c1 08 1c 58 1f| ....3..d.....X.| audio_data: raw bits 0x41-0xfb.7 (187)
0x050|5e 1f 18 1c 46 04 1e 89 e5 b3 2e 5a 0f a8 3b 13|^...F......Z..;.|
* |until 0xfb.7 (187) | |
| | | other_data: raw bits 0xfc-NA (0)
| | | crc_calculated: "2e0a" (raw bits) 0xfc-NA (0)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [1]{}: sample (mp3_frame) 0xfc-0x1cc.7 (209)
| | | header{}: 0xfc-0xff.7 (4)
@ -403,9 +402,9 @@ $ fq -d mp4 dv mp3.mp4
0x0f0| c4| .| original: 1 0xff.5-0xff.5 (0.1)
0x0f0| c4| .| emphasis: "none" (0b0) 0xff.6-0xff.7 (0.2)
| | | side_info{}: 0x100-0x110.7 (17)
0x100|04 82 |.. | main_data_end: 9 0x100-0x101 (1.1)
0x100| 82 | . | private_bits: 0 0x101.1-0x101.5 (0.5)
0x100| 82 0a | .. | share0: 8 0x101.6-0x102.1 (0.4)
0x100|04 82 |.. | main_data_begin: 9 0x100-0x101 (1.1)
0x100| 82 | . | share: 0 0x101.1-0x101.5 (0.5)
0x100| 82 0a | .. | scfsi0: 8 0x101.6-0x102.1 (0.4)
| | | granules[0:2]: 0x102.2-0x110.7 (14.6)
| | | [0][0:1]: granule 0x102.2-0x109.4 (7.3)
| | | [0]{}: channel 0x102.2-0x109.4 (7.3)
@ -442,11 +441,9 @@ $ fq -d mp4 dv mp3.mp4
0x110|00 |. | preflag: 0 0x110.5-0x110.5 (0.1)
0x110|00 |. | scalefac_scale: 0 0x110.6-0x110.6 (0.1)
0x110|00 |. | count1table_select: 0 0x110.7-0x110.7 (0.1)
0x110| 01 d9 81 38 05 c9 80 20 04 f1 80 8e 07 01 96| ...8... .......| data: raw bits 0x111-0x1c2.7 (178)
0x110| 01 d9 81 38 05 c9 80 20 04 f1 80 8e 07 01 96| ...8... .......| audio_data: raw bits 0x111-0x1cc.7 (188)
0x120|d2 b0 19 91 ec 2a 39 85 70 0d c9 82 90 07 39 81|.....*9.p.....9.|
* |until 0x1c2.7 (178) | |
0x1c0| 85 | . | padding_byte: raw bits 0x1c3-0x1c3.7 (1)
0x1c0| 62 08 3d a0 52 36 7f 26 17 | b.=.R6.&. | other_data: raw bits 0x1c4-0x1cc.7 (9)
* |until 0x1cc.7 (188) | |
| | | crc_calculated: "9950" (raw bits) 0x1cd-NA (0)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [2]{}: sample (mp3_frame) 0x1cd-0x29d.7 (209)
| | | header{}: 0x1cd-0x1d0.7 (4)
@ -465,9 +462,9 @@ $ fq -d mp4 dv mp3.mp4
0x1d0|c4 |. | original: 1 0x1d0.5-0x1d0.5 (0.1)
0x1d0|c4 |. | emphasis: "none" (0b0) 0x1d0.6-0x1d0.7 (0.2)
| | | side_info{}: 0x1d1-0x1e1.7 (17)
0x1d0| 0d 80 | .. | main_data_end: 27 0x1d1-0x1d2 (1.1)
0x1d0| 80 | . | private_bits: 0 0x1d2.1-0x1d2.5 (0.5)
0x1d0| 80 0d | .. | share0: 0 0x1d2.6-0x1d3.1 (0.4)
0x1d0| 0d 80 | .. | main_data_begin: 27 0x1d1-0x1d2 (1.1)
0x1d0| 80 | . | share: 0 0x1d2.1-0x1d2.5 (0.5)
0x1d0| 80 0d | .. | scfsi0: 0 0x1d2.6-0x1d3.1 (0.4)
| | | granules[0:2]: 0x1d3.2-0x1e1.7 (14.6)
| | | [0][0:1]: granule 0x1d3.2-0x1da.4 (7.3)
| | | [0]{}: channel 0x1d3.2-0x1da.4 (7.3)
@ -504,12 +501,9 @@ $ fq -d mp4 dv mp3.mp4
0x1e0| 00 | . | preflag: 0 0x1e1.5-0x1e1.5 (0.1)
0x1e0| 00 | . | scalefac_scale: 0 0x1e1.6-0x1e1.6 (0.1)
0x1e0| 00 | . | count1table_select: 0 0x1e1.7-0x1e1.7 (0.1)
0x1e0| 53 ca 1e 59 fd 29 ba 0b 84 d4 8a f8 8d cb| S..Y.)........| data: raw bits 0x1e2-0x281.7 (160)
0x1e0| 53 ca 1e 59 fd 29 ba 0b 84 d4 8a f8 8d cb| S..Y.)........| audio_data: raw bits 0x1e2-0x29d.7 (188)
0x1f0|a0 77 10 07 47 8b 8c 7b 2e 82 33 01 c4 c0 04 9f|.w..G..{..3.....|
* |until 0x281.7 (160) | |
0x280| 6a | j | padding_byte: raw bits 0x282-0x282.7 (1)
0x280| 4c 41 4d 45 33 2e 31 30 30 aa aa aa aa| LAME3.100....| other_data: raw bits 0x283-0x29d.7 (27)
0x290|aa aa aa aa aa aa aa aa aa aa aa aa aa aa |.............. |
* |until 0x29d.7 (188) | |
| | | crc_calculated: "c36b" (raw bits) 0x29e-NA (0)
| | | id: 1 0x565-NA (0)
| | | data_foramt: "mp4a" 0x565-NA (0)

View File

@ -299,9 +299,9 @@ $ fq -d mp4 'dv' stz2.mp4
0x280| c4 | . | original: 1 0x287.5-0x287.5 (0.1)
0x280| c4 | . | emphasis: "none" (0b0) 0x287.6-0x287.7 (0.2)
| | | side_info{}: 0x288-0x298.7 (17)
0x280| 00 00 | .. | main_data_end: 0 0x288-0x289 (1.1)
0x280| 00 | . | private_bits: 0 0x289.1-0x289.5 (0.5)
0x280| 00 0a | .. | share0: 0 0x289.6-0x28a.1 (0.4)
0x280| 00 00 | .. | main_data_begin: 0 0x288-0x289 (1.1)
0x280| 00 | . | share: 0 0x289.1-0x289.5 (0.5)
0x280| 00 0a | .. | scfsi0: 0 0x289.6-0x28a.1 (0.4)
| | | granules[0:2]: 0x28a.2-0x298.7 (14.6)
| | | [0][0:1]: granule 0x28a.2-0x291.4 (7.3)
| | | [0]{}: channel 0x28a.2-0x291.4 (7.3)
@ -338,10 +338,9 @@ $ fq -d mp4 'dv' stz2.mp4
0x290| 00 | . | preflag: 0 0x298.5-0x298.5 (0.1)
0x290| 00 | . | scalefac_scale: 0 0x298.6-0x298.6 (0.1)
0x290| 00 | . | count1table_select: 0 0x298.7-0x298.7 (0.1)
0x290| 07 aa c3 8e 33 85 d3| ....3..| data: raw bits 0x299-0x353.7 (187)
0x290| 07 aa c3 8e 33 85 d3| ....3..| audio_data: raw bits 0x299-0x353.7 (187)
0x2a0|64 f1 a1 c1 08 1c 58 1f 5e 1f 18 1c 46 04 1e 89|d.....X.^...F...|
* |until 0x353.7 (187) | |
| | | other_data: raw bits 0x354-NA (0)
| | | crc_calculated: "2e0a" (raw bits) 0x354-NA (0)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [1]{}: sample (mp3_frame) 0x354-0x424.7 (209)
| | | header{}: 0x354-0x357.7 (4)
@ -360,9 +359,9 @@ $ fq -d mp4 'dv' stz2.mp4
0x350| c4 | . | original: 1 0x357.5-0x357.5 (0.1)
0x350| c4 | . | emphasis: "none" (0b0) 0x357.6-0x357.7 (0.2)
| | | side_info{}: 0x358-0x368.7 (17)
0x350| 04 82 | .. | main_data_end: 9 0x358-0x359 (1.1)
0x350| 82 | . | private_bits: 0 0x359.1-0x359.5 (0.5)
0x350| 82 0a | .. | share0: 8 0x359.6-0x35a.1 (0.4)
0x350| 04 82 | .. | main_data_begin: 9 0x358-0x359 (1.1)
0x350| 82 | . | share: 0 0x359.1-0x359.5 (0.5)
0x350| 82 0a | .. | scfsi0: 8 0x359.6-0x35a.1 (0.4)
| | | granules[0:2]: 0x35a.2-0x368.7 (14.6)
| | | [0][0:1]: granule 0x35a.2-0x361.4 (7.3)
| | | [0]{}: channel 0x35a.2-0x361.4 (7.3)
@ -399,12 +398,9 @@ $ fq -d mp4 'dv' stz2.mp4
0x360| 00 | . | preflag: 0 0x368.5-0x368.5 (0.1)
0x360| 00 | . | scalefac_scale: 0 0x368.6-0x368.6 (0.1)
0x360| 00 | . | count1table_select: 0 0x368.7-0x368.7 (0.1)
0x360| 01 d9 81 38 05 c9 80| ...8...| data: raw bits 0x369-0x41a.7 (178)
0x360| 01 d9 81 38 05 c9 80| ...8...| audio_data: raw bits 0x369-0x424.7 (188)
0x370|20 04 f1 80 8e 07 01 96 d2 b0 19 91 ec 2a 39 85| ............*9.|
* |until 0x41a.7 (178) | |
0x410| 85 | . | padding_byte: raw bits 0x41b-0x41b.7 (1)
0x410| 62 08 3d a0| b.=.| other_data: raw bits 0x41c-0x424.7 (9)
0x420|52 36 7f 26 17 |R6.&. |
* |until 0x424.7 (188) | |
| | | crc_calculated: "9950" (raw bits) 0x425-NA (0)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [2]{}: sample (mp3_frame) 0x425-0x4f5.7 (209)
| | | header{}: 0x425-0x428.7 (4)
@ -423,9 +419,9 @@ $ fq -d mp4 'dv' stz2.mp4
0x420| c4 | . | original: 1 0x428.5-0x428.5 (0.1)
0x420| c4 | . | emphasis: "none" (0b0) 0x428.6-0x428.7 (0.2)
| | | side_info{}: 0x429-0x439.7 (17)
0x420| 0d 80 | .. | main_data_end: 27 0x429-0x42a (1.1)
0x420| 80 | . | private_bits: 0 0x42a.1-0x42a.5 (0.5)
0x420| 80 0d | .. | share0: 0 0x42a.6-0x42b.1 (0.4)
0x420| 0d 80 | .. | main_data_begin: 27 0x429-0x42a (1.1)
0x420| 80 | . | share: 0 0x42a.1-0x42a.5 (0.5)
0x420| 80 0d | .. | scfsi0: 0 0x42a.6-0x42b.1 (0.4)
| | | granules[0:2]: 0x42b.2-0x439.7 (14.6)
| | | [0][0:1]: granule 0x42b.2-0x432.4 (7.3)
| | | [0]{}: channel 0x42b.2-0x432.4 (7.3)
@ -462,13 +458,9 @@ $ fq -d mp4 'dv' stz2.mp4
0x430| 00 | . | preflag: 0 0x439.5-0x439.5 (0.1)
0x430| 00 | . | scalefac_scale: 0 0x439.6-0x439.6 (0.1)
0x430| 00 | . | count1table_select: 0 0x439.7-0x439.7 (0.1)
0x430| 53 ca 1e 59 fd 29| S..Y.)| data: raw bits 0x43a-0x4d9.7 (160)
0x430| 53 ca 1e 59 fd 29| S..Y.)| audio_data: raw bits 0x43a-0x4f5.7 (188)
0x440|ba 0b 84 d4 8a f8 8d cb a0 77 10 07 47 8b 8c 7b|.........w..G..{|
* |until 0x4d9.7 (160) | |
0x4d0| 6a | j | padding_byte: raw bits 0x4da-0x4da.7 (1)
0x4d0| 4c 41 4d 45 33| LAME3| other_data: raw bits 0x4db-0x4f5.7 (27)
0x4e0|2e 31 30 30 aa aa aa aa aa aa aa aa aa aa aa aa|.100............|
0x4f0|aa aa aa aa aa aa |...... |
* |until 0x4f5.7 (188) | |
| | | crc_calculated: "c36b" (raw bits) 0x4f6-NA (0)
| | | id: 1 0x530-NA (0)
| | | data_foramt: "mp4a" 0x530-NA (0)

View File

@ -142,19 +142,20 @@ var protectionNames = scalar.BoolToDescription{
func frameDecode(d *decode.D, _ any) any {
const headerBytes = 4
var sideInfoBytes int64
var sideInfoBytes int
var isStereo bool
var paddingBytes uint64
var crcBytes int64
var paddingBytes int
var crcBytes int
var mpegVersionNr uint64
var mpegLayerNr uint64
var protectionAbsent bool
var bitRate uint64
var sampleRate uint64
var sampleCount int
var bitRate int
var sampleRate int
var channelsIndex uint64
var channelModeIndex uint64
var mainDataEnd uint64
var crcValue *decode.Value
var lsf bool // low sampling frequencies, 1 granule if true
d.FieldStruct("header", func(d *decode.D) {
d.FieldU11("sync", d.AssertU(0b111_1111_1111), scalar.ActualBin)
@ -165,6 +166,11 @@ func frameDecode(d *decode.D, _ any) any {
if mpegVersionNr == 0 {
d.Errorf("Unsupported mpeg version")
}
switch mpegVersion {
case mpegVersion2,
mpegVersion25:
lsf = true
}
mpegLayer := d.FieldU2("layer", mpegLayerNames)
mpegLayerNr = mpegLayerN[mpegLayer]
if mpegLayerNr != 3 {
@ -172,32 +178,33 @@ func frameDecode(d *decode.D, _ any) any {
mpegLayerNr = 3
}
// [mpeg layer][mpeg version]
var samplesFrameIndex = map[uint][4]uint{
0: [...]uint{0, 0, 0, 0},
1: [...]uint{0, 384, 384, 384},
2: [...]uint{0, 1152, 1152, 1152},
3: [...]uint{0, 1152, 576, 576},
var samplesFrameIndex = map[uint][4]int{
0: [...]int{0, 0, 0, 0},
1: [...]int{0, 384, 384, 384},
2: [...]int{0, 1152, 1152, 1152},
3: [...]int{0, 1152, 576, 576},
}
d.FieldValueU("sample_count", uint64(samplesFrameIndex[uint(mpegLayerNr)][uint(mpegVersionNr)]))
sampleCount = samplesFrameIndex[uint(mpegLayerNr)][uint(mpegVersionNr)]
d.FieldValueU("sample_count", uint64(sampleCount))
protection := d.FieldBool("protection_absent", protectionNames)
// note false mean has protection
hasCRC := !protection
// V1,L1 V1,L2 V1,L3 V2,L1 V2,L2 V2,L3 V2.5,L1 V2.5,L2 V2.5,L3
var bitRateIndex = map[uint][9]uint{
0b0001: [...]uint{32, 32, 32, 32, 8, 8, 32, 8, 8},
0b0010: [...]uint{64, 48, 40, 48, 16, 16, 48, 16, 16},
0b0011: [...]uint{96, 56, 48, 56, 24, 24, 56, 24, 24},
0b0100: [...]uint{128, 64, 56, 64, 32, 32, 64, 32, 32},
0b0101: [...]uint{160, 80, 64, 80, 40, 40, 80, 40, 40},
0b0110: [...]uint{192, 96, 80, 96, 48, 48, 96, 48, 48},
0b0111: [...]uint{224, 112, 96, 112, 56, 56, 112, 56, 56},
0b1000: [...]uint{256, 128, 112, 128, 64, 64, 128, 64, 64},
0b1001: [...]uint{288, 160, 128, 144, 80, 80, 144, 80, 80},
0b1010: [...]uint{320, 192, 160, 160, 96, 96, 160, 96, 96},
0b1011: [...]uint{352, 224, 192, 176, 112, 112, 176, 112, 112},
0b1100: [...]uint{384, 256, 224, 192, 128, 128, 192, 128, 128},
0b1101: [...]uint{416, 320, 256, 224, 144, 144, 224, 144, 144},
0b1110: [...]uint{448, 384, 320, 256, 160, 160, 256, 160, 160},
var bitRateIndex = map[int][9]int{
0b0001: [...]int{32, 32, 32, 32, 8, 8, 32, 8, 8},
0b0010: [...]int{64, 48, 40, 48, 16, 16, 48, 16, 16},
0b0011: [...]int{96, 56, 48, 56, 24, 24, 56, 24, 24},
0b0100: [...]int{128, 64, 56, 64, 32, 32, 64, 32, 32},
0b0101: [...]int{160, 80, 64, 80, 40, 40, 80, 40, 40},
0b0110: [...]int{192, 96, 80, 96, 48, 48, 96, 48, 48},
0b0111: [...]int{224, 112, 96, 112, 56, 56, 112, 56, 56},
0b1000: [...]int{256, 128, 112, 128, 64, 64, 128, 64, 64},
0b1001: [...]int{288, 160, 128, 144, 80, 80, 144, 80, 80},
0b1010: [...]int{320, 192, 160, 160, 96, 96, 160, 96, 96},
0b1011: [...]int{352, 224, 192, 176, 112, 112, 176, 112, 112},
0b1100: [...]int{384, 256, 224, 192, 128, 128, 192, 128, 128},
0b1101: [...]int{416, 320, 256, 224, 144, 144, 224, 144, 144},
0b1110: [...]int{448, 384, 320, 256, 160, 160, 256, 160, 160},
}
d.FieldU4("bitrate", scalar.Fn(func(s scalar.S) (scalar.S, error) {
u := s.ActualU()
@ -212,17 +219,17 @@ func frameDecode(d *decode.D, _ any) any {
if i >= 9 {
d.Fatalf("Invalid bitrate index")
}
bitRate = uint64(bitRateIndex[uint(u)][(mpegVersionNr-1)*3+(mpegLayerNr-1)]) * 1000
bitRate = bitRateIndex[int(u)][(mpegVersionNr-1)*3+(mpegLayerNr-1)] * 1000
s.Sym = bitRate
}
return s, nil
}))
// MPEG1 MPEG2 MPEG2.5
var sampleRateIndex = map[uint][3]uint{
0b00: [...]uint{44100, 22050, 11025},
0b01: [...]uint{48000, 24000, 12000},
0b10: [...]uint{32000, 16000, 8000},
var sampleRateIndex = map[uint][3]int{
0b00: [...]int{44100, 22050, 11025},
0b01: [...]int{48000, 24000, 12000},
0b10: [...]int{32000, 16000, 8000},
}
d.FieldU2("sample_rate", scalar.Fn(func(s scalar.S) (scalar.S, error) {
u := s.ActualU()
@ -230,16 +237,16 @@ func frameDecode(d *decode.D, _ any) any {
case 0b11:
s.Description = "reserved"
default:
sampleRate = uint64(sampleRateIndex[uint(u)][mpegVersionNr-1])
sampleRate = sampleRateIndex[uint(u)][mpegVersionNr-1]
s.Sym = sampleRate
}
return s, nil
}))
paddingBytes = d.FieldU1("padding", scalar.UToSymStr{
paddingBytes = int(d.FieldU1("padding", scalar.UToSymStr{
0: "not_padded",
1: "padded",
}, scalar.ActualBin)
}, scalar.ActualBin))
d.FieldU1("private")
channelsIndex = d.FieldU2("channels", scalar.UToSymStr{
0b00: "stereo",
@ -269,120 +276,102 @@ func frameDecode(d *decode.D, _ any) any {
}
})
// // [mono/stereo][mpeg version]
sideInfoIndex := map[bool][4]int{
false: {0, 17, 9, 9}, // mono
true: {0, 32, 17, 17}, // stereo
}
sideInfoBytes = sideInfoIndex[isStereo][int(mpegVersionNr)]
channelCount := 1
if isStereo {
channelCount = 2
}
// [mono/stereo][mpeg version]
sideInfoIndex := map[bool][4]int64{
false: {0, 17, 9, 9}, // mono
true: {0, 32, 17, 17}, // stereo
}
if mpegLayerNr == 3 {
sideInfoBytes = sideInfoIndex[isStereo][int(mpegVersionNr)]
granuleCount := 1
if !lsf {
granuleCount = 2
}
if sideInfoBytes != 0 {
d.FieldStruct("side_info", func(d *decode.D) {
mainDataEnd = d.FieldU9("main_data_end")
d.FieldStruct("side_info", func(d *decode.D) {
if lsf {
d.FieldU8("main_data_begin")
// TODO: naming
d.FieldU("private_bits", channelCount)
} else {
d.FieldU9("main_data_begin")
if isStereo {
d.FieldU3("private_bits")
// TODO: naming
d.FieldU3("share")
d.FieldU4("scfsi0")
d.FieldU4("scfsi1")
} else {
d.FieldU5("private_bits")
}
d.FieldU4("share0")
if isStereo {
d.FieldU4("share1")
// TODO: naming
d.FieldU5("share")
d.FieldU4("scfsi0")
}
}
// TODO: mpeg_version 2 use 1, otherwise 2
granuleCount := 2
d.FieldArray("granules", func(d *decode.D) {
for i := 0; i < granuleCount; i++ {
d.FieldArray("granule", func(d *decode.D) {
for j := 0; j < channelCount; j++ {
d.FieldStruct("channel", func(d *decode.D) {
// TODO: tables and interpret values a bit
d.FieldU12("part2_3_length")
d.FieldU9("big_values")
d.FieldU8("global_gain")
d.FieldArray("granules", func(d *decode.D) {
for i := 0; i < granuleCount; i++ {
d.FieldArray("granule", func(d *decode.D) {
for j := 0; j < channelCount; j++ {
d.FieldStruct("channel", func(d *decode.D) {
// TODO: tables and interpret values a bit
d.FieldU12("part2_3_length")
d.FieldU9("big_values")
d.FieldU8("global_gain")
if lsf {
d.FieldU9("scalefac_compress")
} else {
d.FieldU4("scalefac_compress")
blocksplitFlag := d.FieldU1("blocksplit_flag")
}
blocksplitFlag := d.FieldU1("blocksplit_flag")
if blocksplitFlag == 1 {
d.FieldU2("block_type", blockTypeNames)
d.FieldU1("switch_point")
d.FieldU5("table_select0")
d.FieldU5("table_select1")
d.FieldU3("subblock_gain0")
d.FieldU3("subblock_gain1")
d.FieldU3("subblock_gain2")
} else {
d.FieldU5("table_select0")
d.FieldU5("table_select1")
d.FieldU5("table_select2")
d.FieldU4("region_address1")
d.FieldU3("region_address2")
}
if blocksplitFlag == 1 {
d.FieldU2("block_type", blockTypeNames)
d.FieldU1("switch_point")
d.FieldU5("table_select0")
d.FieldU5("table_select1")
d.FieldU3("subblock_gain0")
d.FieldU3("subblock_gain1")
d.FieldU3("subblock_gain2")
} else {
d.FieldU5("table_select0")
d.FieldU5("table_select1")
d.FieldU5("table_select2")
d.FieldU4("region_address1")
d.FieldU3("region_address2")
}
if !lsf {
d.FieldU1("preflag")
d.FieldU1("scalefac_scale")
d.FieldU1("count1table_select")
})
}
})
}
})
}
d.FieldU1("scalefac_scale")
d.FieldU1("count1table_select")
})
}
})
}
})
}
})
if sampleRate == 0 {
d.Fatalf("zero sample rate")
}
calcFrameBytes := int64(144*bitRate/sampleRate + paddingBytes)
dataWithPaddingBytes := calcFrameBytes - headerBytes - crcBytes - sideInfoBytes
if dv, _, _ := d.TryFieldFormat("xing", xingHeader, nil); dv != nil {
// TODO: allow shorter?
paddingBytes := dataWithPaddingBytes - dv.Range.Len/8
d.FieldRawLen("padding", paddingBytes*8)
} else {
frameMainDataPartBytes := dataWithPaddingBytes - int64(mainDataEnd) - int64(paddingBytes)
followingFrameMainDataPartsBytes := int64(mainDataEnd)
// main data ends in previous frame
if frameMainDataPartBytes < 0 {
frameMainDataPartBytes = 0
followingFrameMainDataPartsBytes = dataWithPaddingBytes - int64(paddingBytes)
}
if frameMainDataPartBytes > 0 {
d.FieldRawLen("data", frameMainDataPartBytes*8)
}
// TODO: correct? part of main data or not? part of next main data?
if paddingBytes > 0 {
d.FieldRawLen("padding_byte", int64(paddingBytes)*8)
}
// TODO: better naming, main data does not always follow side info
// TODO: ancillary data between end of bitstream main data bits and start of next frames bitstream main data bits
followingFramesBytesLeft := d.BitsLeft() / 8
if followingFramesBytesLeft <= followingFrameMainDataPartsBytes {
followingFrameMainDataPartsBytes = followingFramesBytesLeft
}
d.FieldRawLen("other_data", followingFrameMainDataPartsBytes*8)
}
// total frame size
frameBytes := int((float64(sampleCount)/float64(sampleRate))*float64(bitRate)/8) + paddingBytes
// audio data size, may include audio data from other frames also if main_data_begin is used
restBytes := frameBytes - headerBytes - crcBytes - sideInfoBytes
d.FramedFn(int64(restBytes)*8, func(d *decode.D) {
_, _, _ = d.TryFieldFormat("xing", xingHeader, nil)
d.FieldRawLen("audio_data", d.BitsLeft())
})
crcHash := &checksum.CRC{Bits: 16, Current: 0xffff, Table: checksum.ANSI16Table}
// 2 bytes after sync and some other fields + all of side info
d.CopyBits(crcHash, d.BitBufRange(2*8, 2*8))
d.CopyBits(crcHash, d.BitBufRange(6*8, sideInfoBytes*8))
d.CopyBits(crcHash, d.BitBufRange(6*8, int64(sideInfoBytes)*8))
if crcValue != nil {
_ = crcValue.TryScalarFn(d.ValidateUBytes(crcHash.Sum(nil)))
@ -392,8 +381,8 @@ func frameDecode(d *decode.D, _ any) any {
return format.MP3FrameOut{
MPEGVersion: int(mpegVersionNr),
ProtectionAbsent: protectionAbsent,
BitRate: int(bitRate),
SampleRate: int(sampleRate),
BitRate: bitRate,
SampleRate: sampleRate,
ChannelsIndex: int(channelModeIndex),
ChannelModeIndex: int(channelModeIndex),
}

Binary file not shown.

View File

@ -0,0 +1,61 @@
$ fq -d mp3_frame dv mp3-frame-128000br-1ch-44100hz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3-frame-128000br-1ch-44100hz (mp3_frame) 0x0-0x1a0.7 (417)
| | | header{}: 0x0-0x3.7 (4)
0x000|ff fb |.. | sync: 0b11111111111 (valid) 0x0-0x1.2 (1.3)
0x000| fb | . | mpeg_version: "1" (3) (MPEG Version 1) 0x1.3-0x1.4 (0.2)
0x000| fb | . | layer: 3 (1) (MPEG Layer 3) 0x1.5-0x1.6 (0.2)
| | | sample_count: 1152 0x1.7-NA (0)
0x000| fb | . | protection_absent: true (No CRC) 0x1.7-0x1.7 (0.1)
0x000| 90 | . | bitrate: 128000 (9) 0x2-0x2.3 (0.4)
0x000| 90 | . | sample_rate: 44100 (0) 0x2.4-0x2.5 (0.2)
0x000| 90 | . | padding: "not_padded" (0b0) 0x2.6-0x2.6 (0.1)
0x000| 90 | . | private: 0 0x2.7-0x2.7 (0.1)
0x000| c4 | . | channels: "mono" (0b11) 0x3-0x3.1 (0.2)
0x000| c4 | . | channel_mode: "none" (0b0) 0x3.2-0x3.3 (0.2)
0x000| c4 | . | copyright: 0 0x3.4-0x3.4 (0.1)
0x000| c4 | . | original: 1 0x3.5-0x3.5 (0.1)
0x000| c4 | . | emphasis: "none" (0b0) 0x3.6-0x3.7 (0.2)
| | | side_info{}: 0x4-0x14.7 (17)
0x000| 00 00 | .. | main_data_begin: 0 0x4-0x5 (1.1)
0x000| 00 | . | share: 0 0x5.1-0x5.5 (0.5)
0x000| 00 14 | .. | scfsi0: 0 0x5.6-0x6.1 (0.4)
| | | granules[0:2]: 0x6.2-0x14.7 (14.6)
| | | [0][0:1]: granule 0x6.2-0xd.4 (7.3)
| | | [0]{}: channel 0x6.2-0xd.4 (7.3)
0x000| 14 54 | .T | part2_3_length: 1301 0x6.2-0x7.5 (1.4)
0x000| 54 95 | T. | big_values: 74 0x7.6-0x8.6 (1.1)
0x000| 95 20 | . | global_gain: 144 0x8.7-0x9.6 (1)
0x000| 20 55 | U | scalefac_compress: 2 0x9.7-0xa.2 (0.4)
0x000| 55 | U | blocksplit_flag: 1 0xa.3-0xa.3 (0.1)
0x000| 55 | U | block_type: "start block" (1) 0xa.4-0xa.5 (0.2)
0x000| 55 | U | switch_point: 0 0xa.6-0xa.6 (0.1)
0x000| 55 b7 | U. | table_select0: 27 0xa.7-0xb.3 (0.5)
0x000| b7 80 | .. | table_select1: 15 0xb.4-0xc (0.5)
0x000| 80 | . | subblock_gain0: 0 0xc.1-0xc.3 (0.3)
0x000| 80 | . | subblock_gain1: 0 0xc.4-0xc.6 (0.3)
0x000| 80 0b | .. | subblock_gain2: 0 0xc.7-0xd.1 (0.3)
0x000| 0b | . | preflag: 0 0xd.2-0xd.2 (0.1)
0x000| 0b | . | scalefac_scale: 0 0xd.3-0xd.3 (0.1)
0x000| 0b | . | count1table_select: 1 0xd.4-0xd.4 (0.1)
| | | [1][0:1]: granule 0xd.5-0x14.7 (7.3)
| | | [0]{}: channel 0xd.5-0x14.7 (7.3)
0x000| 0b 4f b3| .O.| part2_3_length: 1695 0xd.5-0xf (1.4)
0x000| b3| .| big_values: 204 0xf.1-0x10.1 (1.1)
0x010|2e |. |
0x010|2e 37 |.7 | global_gain: 184 0x10.2-0x11.1 (1)
0x010| 37 | 7 | scalefac_compress: 13 0x11.2-0x11.5 (0.4)
0x010| 37 | 7 | blocksplit_flag: 1 0x11.6-0x11.6 (0.1)
0x010| 37 33 | 73 | block_type: "3 short windows" (2) 0x11.7-0x12 (0.2)
0x010| 33 | 3 | switch_point: 0 0x12.1-0x12.1 (0.1)
0x010| 33 | 3 | table_select0: 25 0x12.2-0x12.6 (0.5)
0x010| 33 82 | 3. | table_select1: 24 0x12.7-0x13.3 (0.5)
0x010| 82 | . | subblock_gain0: 1 0x13.4-0x13.6 (0.3)
0x010| 82 0a | .. | subblock_gain1: 0 0x13.7-0x14.1 (0.3)
0x010| 0a | . | subblock_gain2: 1 0x14.2-0x14.4 (0.3)
0x010| 0a | . | preflag: 0 0x14.5-0x14.5 (0.1)
0x010| 0a | . | scalefac_scale: 1 0x14.6-0x14.6 (0.1)
0x010| 0a | . | count1table_select: 0 0x14.7-0x14.7 (0.1)
0x010| 05 90 13 83 81 37 d7 53 67 51 05| .....7.SgQ.| audio_data: raw bits 0x15-0x1a0.7 (396)
0x020|31 98 f2 b1 c1 52 1d d6 11 dd 52 1c 02 61 9d 8a|1....R....R..a..|
* |until 0x1a0.7 (end) (396) | |
| | | crc_calculated: "2b28" (raw bits) 0x1a1-NA (0)

Binary file not shown.

View File

@ -0,0 +1,61 @@
$ fq -d mp3_frame dv mp3-frame-128000br-1ch-48000hz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3-frame-128000br-1ch-48000hz (mp3_frame) 0x0-0x17f.7 (384)
| | | header{}: 0x0-0x3.7 (4)
0x000|ff fb |.. | sync: 0b11111111111 (valid) 0x0-0x1.2 (1.3)
0x000| fb | . | mpeg_version: "1" (3) (MPEG Version 1) 0x1.3-0x1.4 (0.2)
0x000| fb | . | layer: 3 (1) (MPEG Layer 3) 0x1.5-0x1.6 (0.2)
| | | sample_count: 1152 0x1.7-NA (0)
0x000| fb | . | protection_absent: true (No CRC) 0x1.7-0x1.7 (0.1)
0x000| 94 | . | bitrate: 128000 (9) 0x2-0x2.3 (0.4)
0x000| 94 | . | sample_rate: 48000 (1) 0x2.4-0x2.5 (0.2)
0x000| 94 | . | padding: "not_padded" (0b0) 0x2.6-0x2.6 (0.1)
0x000| 94 | . | private: 0 0x2.7-0x2.7 (0.1)
0x000| c4 | . | channels: "mono" (0b11) 0x3-0x3.1 (0.2)
0x000| c4 | . | channel_mode: "none" (0b0) 0x3.2-0x3.3 (0.2)
0x000| c4 | . | copyright: 0 0x3.4-0x3.4 (0.1)
0x000| c4 | . | original: 1 0x3.5-0x3.5 (0.1)
0x000| c4 | . | emphasis: "none" (0b0) 0x3.6-0x3.7 (0.2)
| | | side_info{}: 0x4-0x14.7 (17)
0x000| 00 00 | .. | main_data_begin: 0 0x4-0x5 (1.1)
0x000| 00 | . | share: 0 0x5.1-0x5.5 (0.5)
0x000| 00 12 | .. | scfsi0: 0 0x5.6-0x6.1 (0.4)
| | | granules[0:2]: 0x6.2-0x14.7 (14.6)
| | | [0][0:1]: granule 0x6.2-0xd.4 (7.3)
| | | [0]{}: channel 0x6.2-0xd.4 (7.3)
0x000| 12 ec | .. | part2_3_length: 1211 0x6.2-0x7.5 (1.4)
0x000| ec 59 | .Y | big_values: 44 0x7.6-0x8.6 (1.1)
0x000| 59 20 | Y | global_gain: 144 0x8.7-0x9.6 (1)
0x000| 20 35 | 5 | scalefac_compress: 1 0x9.7-0xa.2 (0.4)
0x000| 35 | 5 | blocksplit_flag: 1 0xa.3-0xa.3 (0.1)
0x000| 35 | 5 | block_type: "start block" (1) 0xa.4-0xa.5 (0.2)
0x000| 35 | 5 | switch_point: 0 0xa.6-0xa.6 (0.1)
0x000| 35 b7 | 5. | table_select0: 27 0xa.7-0xb.3 (0.5)
0x000| b7 80 | .. | table_select1: 15 0xb.4-0xc (0.5)
0x000| 80 | . | subblock_gain0: 0 0xc.1-0xc.3 (0.3)
0x000| 80 | . | subblock_gain1: 0 0xc.4-0xc.6 (0.3)
0x000| 80 0b | .. | subblock_gain2: 0 0xc.7-0xd.1 (0.3)
0x000| 0b | . | preflag: 0 0xd.2-0xd.2 (0.1)
0x000| 0b | . | scalefac_scale: 0 0xd.3-0xd.3 (0.1)
0x000| 0b | . | count1table_select: 1 0xd.4-0xd.4 (0.1)
| | | [1][0:1]: granule 0xd.5-0x14.7 (7.3)
| | | [0]{}: channel 0xd.5-0x14.7 (7.3)
0x000| 0b 05 2f| ../| part2_3_length: 1546 0xd.5-0xf (1.4)
0x000| 2f| /| big_values: 189 0xf.1-0x10.1 (1.1)
0x010|6c |l |
0x010|6c f7 |l. | global_gain: 179 0x10.2-0x11.1 (1)
0x010| f7 | . | scalefac_compress: 13 0x11.2-0x11.5 (0.4)
0x010| f7 | . | blocksplit_flag: 1 0x11.6-0x11.6 (0.1)
0x010| f7 31 | .1 | block_type: "3 short windows" (2) 0x11.7-0x12 (0.2)
0x010| 31 | 1 | switch_point: 0 0x12.1-0x12.1 (0.1)
0x010| 31 | 1 | table_select0: 24 0x12.2-0x12.6 (0.5)
0x010| 31 90 | 1. | table_select1: 25 0x12.7-0x13.3 (0.5)
0x010| 90 | . | subblock_gain0: 0 0x13.4-0x13.6 (0.3)
0x010| 90 02 | .. | subblock_gain1: 0 0x13.7-0x14.1 (0.3)
0x010| 02 | . | subblock_gain2: 0 0x14.2-0x14.4 (0.3)
0x010| 02 | . | preflag: 0 0x14.5-0x14.5 (0.1)
0x010| 02 | . | scalefac_scale: 1 0x14.6-0x14.6 (0.1)
0x010| 02 | . | count1table_select: 0 0x14.7-0x14.7 (0.1)
0x010| 18 0e 4e 34 e0 dc 4d 64 dc c1 45| ..N4..Md..E| audio_data: raw bits 0x15-0x17f.7 (363)
0x020|0d 29 e0 e7 2d 8f 13 18 ee 27 0d d9 08 04 a6 0d|.)..-....'......|
* |until 0x17f.7 (end) (363) | |
| | | crc_calculated: "24a4" (raw bits) 0x180-NA (0)

Binary file not shown.

View File

@ -0,0 +1,39 @@
$ fq -d mp3_frame dv mp3-frame-128000br-1ch-8000hz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3-frame-128000br-1ch-8000hz (mp3_frame) 0x0-0x23f.7 (576)
| | | header{}: 0x0-0x3.7 (4)
0x000|ff e3 |.. | sync: 0b11111111111 (valid) 0x0-0x1.2 (1.3)
0x000| e3 | . | mpeg_version: "2.5" (0) (MPEG Version 2.5) 0x1.3-0x1.4 (0.2)
0x000| e3 | . | layer: 3 (1) (MPEG Layer 3) 0x1.5-0x1.6 (0.2)
| | | sample_count: 576 0x1.7-NA (0)
0x000| e3 | . | protection_absent: true (No CRC) 0x1.7-0x1.7 (0.1)
0x000| 88 | . | bitrate: 64000 (8) 0x2-0x2.3 (0.4)
0x000| 88 | . | sample_rate: 8000 (2) 0x2.4-0x2.5 (0.2)
0x000| 88 | . | padding: "not_padded" (0b0) 0x2.6-0x2.6 (0.1)
0x000| 88 | . | private: 0 0x2.7-0x2.7 (0.1)
0x000| c4 | . | channels: "mono" (0b11) 0x3-0x3.1 (0.2)
0x000| c4 | . | channel_mode: "none" (0b0) 0x3.2-0x3.3 (0.2)
0x000| c4 | . | copyright: 0 0x3.4-0x3.4 (0.1)
0x000| c4 | . | original: 1 0x3.5-0x3.5 (0.1)
0x000| c4 | . | emphasis: "none" (0b0) 0x3.6-0x3.7 (0.2)
| | | side_info{}: 0x4-0xc.7 (9)
0x000| 00 | . | main_data_begin: 0 0x4-0x4.7 (1)
0x000| 71 | q | private_bits: 0 0x5-0x5 (0.1)
| | | granules[0:1]: 0x5.1-0xc.7 (7.7)
| | | [0][0:1]: granule 0x5.1-0xc.7 (7.7)
| | | [0]{}: channel 0x5.1-0xc.7 (7.7)
0x000| 71 ec | q. | part2_3_length: 3645 0x5.1-0x6.4 (1.4)
0x000| ec 6e | .n | big_values: 283 0x6.5-0x7.5 (1.1)
0x000| 6e 30 | n0 | global_gain: 140 0x7.6-0x8.5 (1)
0x000| 30 00 | 0. | scalefac_compress: 0 0x8.6-0x9.6 (1.1)
0x000| 00 | . | blocksplit_flag: 0 0x9.7-0x9.7 (0.1)
0x000| d7 | . | table_select0: 26 0xa-0xa.4 (0.5)
0x000| d7 72 | .r | table_select1: 29 0xa.5-0xb.1 (0.5)
0x000| 72 | r | table_select2: 25 0xb.2-0xb.6 (0.5)
0x000| 72 68 | rh | region_address1: 3 0xb.7-0xc.2 (0.4)
0x000| 68 | h | region_address2: 2 0xc.3-0xc.5 (0.3)
0x000| 68 | h | scalefac_scale: 0 0xc.6-0xc.6 (0.1)
0x000| 68 | h | count1table_select: 0 0xc.7-0xc.7 (0.1)
0x000| 39 f0 cd| 9..| audio_data: raw bits 0xd-0x23f.7 (563)
0x010|79 70 30 b3 06 4c d1 b5 38 32 4e 5c 53 6e 94 30|yp0..L..82N\Sn.0|
* |until 0x23f.7 (end) (563) | |
| | | crc_calculated: "a6be" (raw bits) 0x240-NA (0)

View File

@ -1,6 +1,5 @@
# ffmpeg -y -f lavfi -i sine -ac 2 -t 10ms -f mp3 file && fq file '.frame[1] | tobits' > mp3-frame-stereo
$ fq -d mp3_frame dv mp3-frame-stereo
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3-frame-stereo (mp3_frame) 0x0-0x1a0.7 (417)
$ fq -d mp3_frame dv mp3-frame-128000br-2ch-44100hz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3-frame-128000br-2ch-44100hz (mp3_frame) 0x0-0x1a0.7 (417)
| | | header{}: 0x0-0x3.7 (4)
0x000|ff fb |.. | sync: 0b11111111111 (valid) 0x0-0x1.2 (1.3)
0x000| fb | . | mpeg_version: "1" (3) (MPEG Version 1) 0x1.3-0x1.4 (0.2)
@ -17,10 +16,10 @@ $ fq -d mp3_frame dv mp3-frame-stereo
0x000| 64 | d | original: 1 0x3.5-0x3.5 (0.1)
0x000| 64 | d | emphasis: "none" (0b0) 0x3.6-0x3.7 (0.2)
| | | side_info{}: 0x4-0x23.7 (32)
0x000| 00 00 | .. | main_data_end: 0 0x4-0x5 (1.1)
0x000| 00 | . | private_bits: 0 0x5.1-0x5.3 (0.3)
0x000| 00 | . | share0: 0 0x5.4-0x5.7 (0.4)
0x000| 02 | . | share1: 0 0x6-0x6.3 (0.4)
0x000| 00 00 | .. | main_data_begin: 0 0x4-0x5 (1.1)
0x000| 00 | . | share: 0 0x5.1-0x5.3 (0.3)
0x000| 00 | . | scfsi0: 0 0x5.4-0x5.7 (0.4)
0x000| 02 | . | scfsi1: 0 0x6-0x6.3 (0.4)
| | | granules[0:2]: 0x6.4-0x23.7 (29.4)
| | | [0][0:2]: granule 0x6.4-0x15.1 (14.6)
| | | [0]{}: channel 0x6.4-0xd.6 (7.3)
@ -90,8 +89,7 @@ $ fq -d mp3_frame dv mp3-frame-stereo
0x020| 00 | . | preflag: 0 0x23.5-0x23.5 (0.1)
0x020| 00 | . | scalefac_scale: 0 0x23.6-0x23.6 (0.1)
0x020| 00 | . | count1table_select: 0 0x23.7-0x23.7 (0.1)
0x020| 0a 6b 6d d8 c2 12 cd a0 0d bf 4d 03| .km.......M.| data: raw bits 0x24-0x1a0.7 (381)
0x020| 0a 6b 6d d8 c2 12 cd a0 0d bf 4d 03| .km.......M.| audio_data: raw bits 0x24-0x1a0.7 (381)
0x030|01 8d 4c 35 18 20 0c 1d db 6b 6d 7d df 7f e3 72|..L5. ...km}...r|
* |until 0x1a0.7 (end) (381) | |
| | | other_data: raw bits 0x1a1-NA (0)
| | | crc_calculated: "1855" (raw bits) 0x1a1-NA (0)

Binary file not shown.

View File

@ -0,0 +1,95 @@
$ fq -d mp3_frame dv mp3-frame-128000br-2ch-48000hz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3-frame-128000br-2ch-48000hz (mp3_frame) 0x0-0x17f.7 (384)
| | | header{}: 0x0-0x3.7 (4)
0x000|ff fb |.. | sync: 0b11111111111 (valid) 0x0-0x1.2 (1.3)
0x000| fb | . | mpeg_version: "1" (3) (MPEG Version 1) 0x1.3-0x1.4 (0.2)
0x000| fb | . | layer: 3 (1) (MPEG Layer 3) 0x1.5-0x1.6 (0.2)
| | | sample_count: 1152 0x1.7-NA (0)
0x000| fb | . | protection_absent: true (No CRC) 0x1.7-0x1.7 (0.1)
0x000| 94 | . | bitrate: 128000 (9) 0x2-0x2.3 (0.4)
0x000| 94 | . | sample_rate: 48000 (1) 0x2.4-0x2.5 (0.2)
0x000| 94 | . | padding: "not_padded" (0b0) 0x2.6-0x2.6 (0.1)
0x000| 94 | . | private: 0 0x2.7-0x2.7 (0.1)
0x000| 64 | d | channels: "joint_stereo" (0b1) 0x3-0x3.1 (0.2)
0x000| 64 | d | channel_mode: "ms_stereo" (0b10) 0x3.2-0x3.3 (0.2)
0x000| 64 | d | copyright: 0 0x3.4-0x3.4 (0.1)
0x000| 64 | d | original: 1 0x3.5-0x3.5 (0.1)
0x000| 64 | d | emphasis: "none" (0b0) 0x3.6-0x3.7 (0.2)
| | | side_info{}: 0x4-0x23.7 (32)
0x000| 00 00 | .. | main_data_begin: 0 0x4-0x5 (1.1)
0x000| 00 | . | share: 0 0x5.1-0x5.3 (0.3)
0x000| 00 | . | scfsi0: 0 0x5.4-0x5.7 (0.4)
0x000| 02 | . | scfsi1: 0 0x6-0x6.3 (0.4)
| | | granules[0:2]: 0x6.4-0x23.7 (29.4)
| | | [0][0:2]: granule 0x6.4-0x15.1 (14.6)
| | | [0]{}: channel 0x6.4-0xd.6 (7.3)
0x000| 02 1c | .. | part2_3_length: 540 0x6.4-0x7.7 (1.4)
0x000| 08 50 | .P | big_values: 16 0x8-0x9 (1.1)
0x000| 50 bd | P. | global_gain: 161 0x9.1-0xa (1)
0x000| bd | . | scalefac_compress: 7 0xa.1-0xa.4 (0.4)
0x000| bd | . | blocksplit_flag: 1 0xa.5-0xa.5 (0.1)
0x000| bd | . | block_type: "start block" (1) 0xa.6-0xa.7 (0.2)
0x000| 3c | < | switch_point: 0 0xb-0xb (0.1)
0x000| 3c | < | table_select0: 15 0xb.1-0xb.5 (0.5)
0x000| 3c 60 | <` | table_select1: 3 0xb.6-0xc.2 (0.5)
0x000| 60 | ` | subblock_gain0: 0 0xc.3-0xc.5 (0.3)
0x000| 60 08 | `. | subblock_gain1: 0 0xc.6-0xd (0.3)
0x000| 08 | . | subblock_gain2: 0 0xd.1-0xd.3 (0.3)
0x000| 08 | . | preflag: 1 0xd.4-0xd.4 (0.1)
0x000| 08 | . | scalefac_scale: 0 0xd.5-0xd.5 (0.1)
0x000| 08 | . | count1table_select: 0 0xd.6-0xd.6 (0.1)
| | | [1]{}: channel 0xd.7-0x15.1 (7.3)
0x000| 08 00 00| ...| part2_3_length: 0 0xd.7-0xf.2 (1.4)
0x000| 00| .| big_values: 0 0xf.3-0x10.3 (1.1)
0x010|0d |. |
0x010|0d 20 |. | global_gain: 210 0x10.4-0x11.3 (1)
0x010| 20 | | scalefac_compress: 0 0x11.4-0x11.7 (0.4)
0x010| a0 | . | blocksplit_flag: 1 0x12-0x12 (0.1)
0x010| a0 | . | block_type: "start block" (1) 0x12.1-0x12.2 (0.2)
0x010| a0 | . | switch_point: 0 0x12.3-0x12.3 (0.1)
0x010| a0 00 | .. | table_select0: 0 0x12.4-0x13 (0.5)
0x010| 00 | . | table_select1: 0 0x13.1-0x13.5 (0.5)
0x010| 00 01 | .. | subblock_gain0: 0 0x13.6-0x14 (0.3)
0x010| 01 | . | subblock_gain1: 0 0x14.1-0x14.3 (0.3)
0x010| 01 | . | subblock_gain2: 0 0x14.4-0x14.6 (0.3)
0x010| 01 | . | preflag: 1 0x14.7-0x14.7 (0.1)
0x010| 16 | . | scalefac_scale: 0 0x15-0x15 (0.1)
0x010| 16 | . | count1table_select: 0 0x15.1-0x15.1 (0.1)
| | | [1][0:2]: granule 0x15.2-0x23.7 (14.6)
| | | [0]{}: channel 0x15.2-0x1c.4 (7.3)
0x010| 16 f1 | .. | part2_3_length: 1468 0x15.2-0x16.5 (1.4)
0x010| f1 7b | .{ | big_values: 189 0x16.6-0x17.6 (1.1)
0x010| 7b 5d | {] | global_gain: 174 0x17.7-0x18.6 (1)
0x010| 5d b9 | ]. | scalefac_compress: 13 0x18.7-0x19.2 (0.4)
0x010| b9 | . | blocksplit_flag: 1 0x19.3-0x19.3 (0.1)
0x010| b9 | . | block_type: "3 short windows" (2) 0x19.4-0x19.5 (0.2)
0x010| b9 | . | switch_point: 0 0x19.6-0x19.6 (0.1)
0x010| b9 89 | .. | table_select0: 24 0x19.7-0x1a.3 (0.5)
0x010| 89 00 | .. | table_select1: 18 0x1a.4-0x1b (0.5)
0x010| 00 | . | subblock_gain0: 0 0x1b.1-0x1b.3 (0.3)
0x010| 00 | . | subblock_gain1: 0 0x1b.4-0x1b.6 (0.3)
0x010| 00 10 | .. | subblock_gain2: 0 0x1b.7-0x1c.1 (0.3)
0x010| 10 | . | preflag: 0 0x1c.2-0x1c.2 (0.1)
0x010| 10 | . | scalefac_scale: 1 0x1c.3-0x1c.3 (0.1)
0x010| 10 | . | count1table_select: 0 0x1c.4-0x1c.4 (0.1)
| | | [1]{}: channel 0x1c.5-0x23.7 (7.3)
0x010| 10 00 00 | ... | part2_3_length: 0 0x1c.5-0x1e (1.4)
0x010| 00 34| .4| big_values: 0 0x1e.1-0x1f.1 (1.1)
0x010| 34| 4| global_gain: 210 0x1f.2-0x20.1 (1)
0x020|83 |. |
0x020|83 |. | scalefac_compress: 0 0x20.2-0x20.5 (0.4)
0x020|83 |. | blocksplit_flag: 1 0x20.6-0x20.6 (0.1)
0x020|83 00 |.. | block_type: "3 short windows" (2) 0x20.7-0x21 (0.2)
0x020| 00 | . | switch_point: 0 0x21.1-0x21.1 (0.1)
0x020| 00 | . | table_select0: 0 0x21.2-0x21.6 (0.5)
0x020| 00 00 | .. | table_select1: 0 0x21.7-0x22.3 (0.5)
0x020| 00 | . | subblock_gain0: 0 0x22.4-0x22.6 (0.3)
0x020| 00 00 | .. | subblock_gain1: 0 0x22.7-0x23.1 (0.3)
0x020| 00 | . | subblock_gain2: 0 0x23.2-0x23.4 (0.3)
0x020| 00 | . | preflag: 0 0x23.5-0x23.5 (0.1)
0x020| 00 | . | scalefac_scale: 0 0x23.6-0x23.6 (0.1)
0x020| 00 | . | count1table_select: 0 0x23.7-0x23.7 (0.1)
0x020| 00 25 df 6c 97 04 8c 43 cb 9b 10 dc| .%.l...C....| audio_data: raw bits 0x24-0x17f.7 (348)
0x030|02 e0 0b 00 60 1f 8a b8 6c 6a f6 77 ef c1 f0 40|....`...lj.w...@|
* |until 0x17f.7 (end) (348) | |
| | | crc_calculated: "9633" (raw bits) 0x180-NA (0)

Binary file not shown.

View File

@ -0,0 +1,53 @@
$ fq -d mp3_frame dv mp3-frame-128000br-2ch-8000hz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3-frame-128000br-2ch-8000hz (mp3_frame) 0x0-0x23f.7 (576)
| | | header{}: 0x0-0x3.7 (4)
0x000|ff e3 |.. | sync: 0b11111111111 (valid) 0x0-0x1.2 (1.3)
0x000| e3 | . | mpeg_version: "2.5" (0) (MPEG Version 2.5) 0x1.3-0x1.4 (0.2)
0x000| e3 | . | layer: 3 (1) (MPEG Layer 3) 0x1.5-0x1.6 (0.2)
| | | sample_count: 576 0x1.7-NA (0)
0x000| e3 | . | protection_absent: true (No CRC) 0x1.7-0x1.7 (0.1)
0x000| 88 | . | bitrate: 64000 (8) 0x2-0x2.3 (0.4)
0x000| 88 | . | sample_rate: 8000 (2) 0x2.4-0x2.5 (0.2)
0x000| 88 | . | padding: "not_padded" (0b0) 0x2.6-0x2.6 (0.1)
0x000| 88 | . | private: 0 0x2.7-0x2.7 (0.1)
0x000| 64 | d | channels: "joint_stereo" (0b1) 0x3-0x3.1 (0.2)
0x000| 64 | d | channel_mode: "ms_stereo" (0b10) 0x3.2-0x3.3 (0.2)
0x000| 64 | d | copyright: 0 0x3.4-0x3.4 (0.1)
0x000| 64 | d | original: 1 0x3.5-0x3.5 (0.1)
0x000| 64 | d | emphasis: "none" (0b0) 0x3.6-0x3.7 (0.2)
| | | side_info{}: 0x4-0x14.7 (17)
0x000| 00 | . | main_data_begin: 0 0x4-0x4.7 (1)
0x000| 26 | & | private_bits: 0 0x5-0x5.1 (0.2)
| | | granules[0:1]: 0x5.2-0x14.7 (15.6)
| | | [0][0:2]: granule 0x5.2-0x14.7 (15.6)
| | | [0]{}: channel 0x5.2-0xd (7.7)
0x000| 26 76 | &v | part2_3_length: 2461 0x5.2-0x6.5 (1.4)
0x000| 76 37 | v7 | big_values: 283 0x6.6-0x7.6 (1.1)
0x000| 37 2a | 7* | global_gain: 149 0x7.7-0x8.6 (1)
0x000| 2a 01 | *. | scalefac_compress: 1 0x8.7-0x9.7 (1.1)
0x000| 63 | c | blocksplit_flag: 0 0xa-0xa (0.1)
0x000| 63 | c | table_select0: 24 0xa.1-0xa.5 (0.5)
0x000| 63 6c | cl | table_select1: 27 0xa.6-0xb.2 (0.5)
0x000| 6c | l | table_select2: 12 0xb.3-0xb.7 (0.5)
0x000| 38 | 8 | region_address1: 3 0xc-0xc.3 (0.4)
0x000| 38 | 8 | region_address2: 4 0xc.4-0xc.6 (0.3)
0x000| 38 | 8 | scalefac_scale: 0 0xc.7-0xc.7 (0.1)
0x000| 00 | . | count1table_select: 0 0xd-0xd (0.1)
| | | [1]{}: channel 0xd.1-0x14.7 (7.7)
0x000| 00 00 | .. | part2_3_length: 0 0xd.1-0xe.4 (1.4)
0x000| 00 03| ..| big_values: 0 0xe.5-0xf.5 (1.1)
0x000| 03| .| global_gain: 210 0xf.6-0x10.5 (1)
0x010|48 |H |
0x010|48 00 |H. | scalefac_compress: 0 0x10.6-0x11.6 (1.1)
0x010| 00 | . | blocksplit_flag: 0 0x11.7-0x11.7 (0.1)
0x010| 00 | . | table_select0: 0 0x12-0x12.4 (0.5)
0x010| 00 00 | .. | table_select1: 0 0x12.5-0x13.1 (0.5)
0x010| 00 | . | table_select2: 0 0x13.2-0x13.6 (0.5)
0x010| 00 00 | .. | region_address1: 0 0x13.7-0x14.2 (0.4)
0x010| 00 | . | region_address2: 0 0x14.3-0x14.5 (0.3)
0x010| 00 | . | scalefac_scale: 0 0x14.6-0x14.6 (0.1)
0x010| 00 | . | count1table_select: 0 0x14.7-0x14.7 (0.1)
0x010| 81 94 28 6e ef b2 b2 eb 98 46 63| ..(n.....Fc| audio_data: raw bits 0x15-0x23f.7 (555)
0x020|09 76 db 7a ef 01 6e 0c 44 33 08 b7 8f 65 b6 90|.v.z..n.D3...e..|
* |until 0x23f.7 (end) (555) | |
| | | crc_calculated: "eae8" (raw bits) 0x240-NA (0)

Binary file not shown.

View File

@ -0,0 +1,61 @@
$ fq -d mp3_frame dv mp3-frame-320000br-1ch-44100hz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3-frame-320000br-1ch-44100hz (mp3_frame) 0x0-0x413.7 (1044)
| | | header{}: 0x0-0x3.7 (4)
0x000|ff fb |.. | sync: 0b11111111111 (valid) 0x0-0x1.2 (1.3)
0x000| fb | . | mpeg_version: "1" (3) (MPEG Version 1) 0x1.3-0x1.4 (0.2)
0x000| fb | . | layer: 3 (1) (MPEG Layer 3) 0x1.5-0x1.6 (0.2)
| | | sample_count: 1152 0x1.7-NA (0)
0x000| fb | . | protection_absent: true (No CRC) 0x1.7-0x1.7 (0.1)
0x000| e0 | . | bitrate: 320000 (14) 0x2-0x2.3 (0.4)
0x000| e0 | . | sample_rate: 44100 (0) 0x2.4-0x2.5 (0.2)
0x000| e0 | . | padding: "not_padded" (0b0) 0x2.6-0x2.6 (0.1)
0x000| e0 | . | private: 0 0x2.7-0x2.7 (0.1)
0x000| c4 | . | channels: "mono" (0b11) 0x3-0x3.1 (0.2)
0x000| c4 | . | channel_mode: "none" (0b0) 0x3.2-0x3.3 (0.2)
0x000| c4 | . | copyright: 0 0x3.4-0x3.4 (0.1)
0x000| c4 | . | original: 1 0x3.5-0x3.5 (0.1)
0x000| c4 | . | emphasis: "none" (0b0) 0x3.6-0x3.7 (0.2)
| | | side_info{}: 0x4-0x14.7 (17)
0x000| 00 00 | .. | main_data_begin: 0 0x4-0x5 (1.1)
0x000| 00 | . | share: 0 0x5.1-0x5.5 (0.5)
0x000| 00 33 | .3 | scfsi0: 0 0x5.6-0x6.1 (0.4)
| | | granules[0:2]: 0x6.2-0x14.7 (14.6)
| | | [0][0:1]: granule 0x6.2-0xd.4 (7.3)
| | | [0]{}: channel 0x6.2-0xd.4 (7.3)
0x000| 33 7a | 3z | part2_3_length: 3294 0x6.2-0x7.5 (1.4)
0x000| 7a 0b | z. | big_values: 261 0x7.6-0x8.6 (1.1)
0x000| 0b 06 | .. | global_gain: 131 0x8.7-0x9.6 (1)
0x000| 06 75 | .u | scalefac_compress: 3 0x9.7-0xa.2 (0.4)
0x000| 75 | u | blocksplit_flag: 1 0xa.3-0xa.3 (0.1)
0x000| 75 | u | block_type: "start block" (1) 0xa.4-0xa.5 (0.2)
0x000| 75 | u | switch_point: 0 0xa.6-0xa.6 (0.1)
0x000| 75 ed | u. | table_select0: 30 0xa.7-0xb.3 (0.5)
0x000| ed 00 | .. | table_select1: 26 0xb.4-0xc (0.5)
0x000| 00 | . | subblock_gain0: 0 0xc.1-0xc.3 (0.3)
0x000| 00 | . | subblock_gain1: 0 0xc.4-0xc.6 (0.3)
0x000| 00 0f | .. | subblock_gain2: 0 0xc.7-0xd.1 (0.3)
0x000| 0f | . | preflag: 0 0xd.2-0xd.2 (0.1)
0x000| 0f | . | scalefac_scale: 0 0xd.3-0xd.3 (0.1)
0x000| 0f | . | count1table_select: 1 0xd.4-0xd.4 (0.1)
| | | [1][0:1]: granule 0xd.5-0x14.7 (7.3)
| | | [0]{}: channel 0xd.5-0x14.7 (7.3)
0x000| 0f c5 c5| ...| part2_3_length: 3979 0xd.5-0xf (1.4)
0x000| c5| .| big_values: 279 0xf.1-0x10.1 (1.1)
0x010|e3 |. |
0x010|e3 03 |.. | global_gain: 140 0x10.2-0x11.1 (1)
0x010| 03 | . | scalefac_compress: 0 0x11.2-0x11.5 (0.4)
0x010| 03 | . | blocksplit_flag: 1 0x11.6-0x11.6 (0.1)
0x010| 03 3d | .= | block_type: "3 short windows" (2) 0x11.7-0x12 (0.2)
0x010| 3d | = | switch_point: 0 0x12.1-0x12.1 (0.1)
0x010| 3d | = | table_select0: 30 0x12.2-0x12.6 (0.5)
0x010| 3d b0 | =. | table_select1: 27 0x12.7-0x13.3 (0.5)
0x010| b0 | . | subblock_gain0: 0 0x13.4-0x13.6 (0.3)
0x010| b0 00 | .. | subblock_gain1: 0 0x13.7-0x14.1 (0.3)
0x010| 00 | . | subblock_gain2: 0 0x14.2-0x14.4 (0.3)
0x010| 00 | . | preflag: 0 0x14.5-0x14.5 (0.1)
0x010| 00 | . | scalefac_scale: 0 0x14.6-0x14.6 (0.1)
0x010| 00 | . | count1table_select: 0 0x14.7-0x14.7 (0.1)
0x010| 01 46 db 6c cd 9c d7 4c d1 cc 6c| .F.l...L..l| audio_data: raw bits 0x15-0x413.7 (1023)
0x020|cb 34 94 cc 65 41 9c c4 e0 9b 0c da 10 a0 d2 91|.4..eA..........|
* |until 0x413.7 (end) (1023) | |
| | | crc_calculated: "8629" (raw bits) 0x414-NA (0)

Binary file not shown.

View File

@ -0,0 +1,61 @@
$ fq -d mp3_frame dv mp3-frame-320000br-1ch-48000hz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3-frame-320000br-1ch-48000hz (mp3_frame) 0x0-0x3bf.7 (960)
| | | header{}: 0x0-0x3.7 (4)
0x000|ff fb |.. | sync: 0b11111111111 (valid) 0x0-0x1.2 (1.3)
0x000| fb | . | mpeg_version: "1" (3) (MPEG Version 1) 0x1.3-0x1.4 (0.2)
0x000| fb | . | layer: 3 (1) (MPEG Layer 3) 0x1.5-0x1.6 (0.2)
| | | sample_count: 1152 0x1.7-NA (0)
0x000| fb | . | protection_absent: true (No CRC) 0x1.7-0x1.7 (0.1)
0x000| e4 | . | bitrate: 320000 (14) 0x2-0x2.3 (0.4)
0x000| e4 | . | sample_rate: 48000 (1) 0x2.4-0x2.5 (0.2)
0x000| e4 | . | padding: "not_padded" (0b0) 0x2.6-0x2.6 (0.1)
0x000| e4 | . | private: 0 0x2.7-0x2.7 (0.1)
0x000| c4 | . | channels: "mono" (0b11) 0x3-0x3.1 (0.2)
0x000| c4 | . | channel_mode: "none" (0b0) 0x3.2-0x3.3 (0.2)
0x000| c4 | . | copyright: 0 0x3.4-0x3.4 (0.1)
0x000| c4 | . | original: 1 0x3.5-0x3.5 (0.1)
0x000| c4 | . | emphasis: "none" (0b0) 0x3.6-0x3.7 (0.2)
| | | side_info{}: 0x4-0x14.7 (17)
0x000| 00 00 | .. | main_data_begin: 0 0x4-0x5 (1.1)
0x000| 00 | . | share: 0 0x5.1-0x5.5 (0.5)
0x000| 00 2d | .- | scfsi0: 0 0x5.6-0x6.1 (0.4)
| | | granules[0:2]: 0x6.2-0x14.7 (14.6)
| | | [0][0:1]: granule 0x6.2-0xd.4 (7.3)
| | | [0]{}: channel 0x6.2-0xd.4 (7.3)
0x000| 2d 85 | -. | part2_3_length: 2913 0x6.2-0x7.5 (1.4)
0x000| 85 e3 | .. | big_values: 241 0x7.6-0x8.6 (1.1)
0x000| e3 0a | .. | global_gain: 133 0x8.7-0x9.6 (1)
0x000| 0a 75 | .u | scalefac_compress: 3 0x9.7-0xa.2 (0.4)
0x000| 75 | u | blocksplit_flag: 1 0xa.3-0xa.3 (0.1)
0x000| 75 | u | block_type: "start block" (1) 0xa.4-0xa.5 (0.2)
0x000| 75 | u | switch_point: 0 0xa.6-0xa.6 (0.1)
0x000| 75 dc | u. | table_select0: 29 0xa.7-0xb.3 (0.5)
0x000| dc 80 | .. | table_select1: 25 0xb.4-0xc (0.5)
0x000| 80 | . | subblock_gain0: 0 0xc.1-0xc.3 (0.3)
0x000| 80 | . | subblock_gain1: 0 0xc.4-0xc.6 (0.3)
0x000| 80 0f | .. | subblock_gain2: 0 0xc.7-0xd.1 (0.3)
0x000| 0f | . | preflag: 0 0xd.2-0xd.2 (0.1)
0x000| 0f | . | scalefac_scale: 0 0xd.3-0xd.3 (0.1)
0x000| 0f | . | count1table_select: 1 0xd.4-0xd.4 (0.1)
| | | [1][0:1]: granule 0xd.5-0x14.7 (7.3)
| | | [0]{}: channel 0xd.5-0x14.7 (7.3)
0x000| 0f d3 44| ..D| part2_3_length: 4006 0xd.5-0xf (1.4)
0x000| 44| D| big_values: 273 0xf.1-0x10.1 (1.1)
0x010|62 |b |
0x010|62 83 |b. | global_gain: 138 0x10.2-0x11.1 (1)
0x010| 83 | . | scalefac_compress: 0 0x11.2-0x11.5 (0.4)
0x010| 83 | . | blocksplit_flag: 1 0x11.6-0x11.6 (0.1)
0x010| 83 3f | .? | block_type: "3 short windows" (2) 0x11.7-0x12 (0.2)
0x010| 3f | ? | switch_point: 0 0x12.1-0x12.1 (0.1)
0x010| 3f | ? | table_select0: 31 0x12.2-0x12.6 (0.5)
0x010| 3f c0 | ?. | table_select1: 28 0x12.7-0x13.3 (0.5)
0x010| c0 | . | subblock_gain0: 0 0x13.4-0x13.6 (0.3)
0x010| c0 00 | .. | subblock_gain1: 0 0x13.7-0x14.1 (0.3)
0x010| 00 | . | subblock_gain2: 0 0x14.2-0x14.4 (0.3)
0x010| 00 | . | preflag: 0 0x14.5-0x14.5 (0.1)
0x010| 00 | . | scalefac_scale: 0 0x14.6-0x14.6 (0.1)
0x010| 00 | . | count1table_select: 0 0x14.7-0x14.7 (0.1)
0x010| 01 cb 23 90 ed fb 1c e9 79 2c de| ..#.....y,.| audio_data: raw bits 0x15-0x3bf.7 (939)
0x020|15 34 c7 52 e0 da 69 a8 f0 ad f0 fb ae f8 f8 4c|.4.R..i........L|
* |until 0x3bf.7 (end) (939) | |
| | | crc_calculated: "b64d" (raw bits) 0x3c0-NA (0)

Binary file not shown.

View File

@ -0,0 +1,39 @@
$ fq -d mp3_frame dv mp3-frame-320000br-1ch-8000hz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3-frame-320000br-1ch-8000hz (mp3_frame) 0x0-0x23f.7 (576)
| | | header{}: 0x0-0x3.7 (4)
0x000|ff e3 |.. | sync: 0b11111111111 (valid) 0x0-0x1.2 (1.3)
0x000| e3 | . | mpeg_version: "2.5" (0) (MPEG Version 2.5) 0x1.3-0x1.4 (0.2)
0x000| e3 | . | layer: 3 (1) (MPEG Layer 3) 0x1.5-0x1.6 (0.2)
| | | sample_count: 576 0x1.7-NA (0)
0x000| e3 | . | protection_absent: true (No CRC) 0x1.7-0x1.7 (0.1)
0x000| 88 | . | bitrate: 64000 (8) 0x2-0x2.3 (0.4)
0x000| 88 | . | sample_rate: 8000 (2) 0x2.4-0x2.5 (0.2)
0x000| 88 | . | padding: "not_padded" (0b0) 0x2.6-0x2.6 (0.1)
0x000| 88 | . | private: 0 0x2.7-0x2.7 (0.1)
0x000| c4 | . | channels: "mono" (0b11) 0x3-0x3.1 (0.2)
0x000| c4 | . | channel_mode: "none" (0b0) 0x3.2-0x3.3 (0.2)
0x000| c4 | . | copyright: 0 0x3.4-0x3.4 (0.1)
0x000| c4 | . | original: 1 0x3.5-0x3.5 (0.1)
0x000| c4 | . | emphasis: "none" (0b0) 0x3.6-0x3.7 (0.2)
| | | side_info{}: 0x4-0xc.7 (9)
0x000| 00 | . | main_data_begin: 0 0x4-0x4.7 (1)
0x000| 71 | q | private_bits: 0 0x5-0x5 (0.1)
| | | granules[0:1]: 0x5.1-0xc.7 (7.7)
| | | [0][0:1]: granule 0x5.1-0xc.7 (7.7)
| | | [0]{}: channel 0x5.1-0xc.7 (7.7)
0x000| 71 ec | q. | part2_3_length: 3645 0x5.1-0x6.4 (1.4)
0x000| ec 6e | .n | big_values: 283 0x6.5-0x7.5 (1.1)
0x000| 6e 30 | n0 | global_gain: 140 0x7.6-0x8.5 (1)
0x000| 30 00 | 0. | scalefac_compress: 0 0x8.6-0x9.6 (1.1)
0x000| 00 | . | blocksplit_flag: 0 0x9.7-0x9.7 (0.1)
0x000| d7 | . | table_select0: 26 0xa-0xa.4 (0.5)
0x000| d7 72 | .r | table_select1: 29 0xa.5-0xb.1 (0.5)
0x000| 72 | r | table_select2: 25 0xb.2-0xb.6 (0.5)
0x000| 72 68 | rh | region_address1: 3 0xb.7-0xc.2 (0.4)
0x000| 68 | h | region_address2: 2 0xc.3-0xc.5 (0.3)
0x000| 68 | h | scalefac_scale: 0 0xc.6-0xc.6 (0.1)
0x000| 68 | h | count1table_select: 0 0xc.7-0xc.7 (0.1)
0x000| 39 f0 cd| 9..| audio_data: raw bits 0xd-0x23f.7 (563)
0x010|79 70 30 b3 06 4c d1 b5 38 32 4e 5c 53 6e 94 30|yp0..L..82N\Sn.0|
* |until 0x23f.7 (end) (563) | |
| | | crc_calculated: "a6be" (raw bits) 0x240-NA (0)

Binary file not shown.

View File

@ -0,0 +1,95 @@
$ fq -d mp3_frame dv mp3-frame-320000br-2ch-44100hz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3-frame-320000br-2ch-44100hz (mp3_frame) 0x0-0x413.7 (1044)
| | | header{}: 0x0-0x3.7 (4)
0x000|ff fb |.. | sync: 0b11111111111 (valid) 0x0-0x1.2 (1.3)
0x000| fb | . | mpeg_version: "1" (3) (MPEG Version 1) 0x1.3-0x1.4 (0.2)
0x000| fb | . | layer: 3 (1) (MPEG Layer 3) 0x1.5-0x1.6 (0.2)
| | | sample_count: 1152 0x1.7-NA (0)
0x000| fb | . | protection_absent: true (No CRC) 0x1.7-0x1.7 (0.1)
0x000| e0 | . | bitrate: 320000 (14) 0x2-0x2.3 (0.4)
0x000| e0 | . | sample_rate: 44100 (0) 0x2.4-0x2.5 (0.2)
0x000| e0 | . | padding: "not_padded" (0b0) 0x2.6-0x2.6 (0.1)
0x000| e0 | . | private: 0 0x2.7-0x2.7 (0.1)
0x000| 64 | d | channels: "joint_stereo" (0b1) 0x3-0x3.1 (0.2)
0x000| 64 | d | channel_mode: "ms_stereo" (0b10) 0x3.2-0x3.3 (0.2)
0x000| 64 | d | copyright: 0 0x3.4-0x3.4 (0.1)
0x000| 64 | d | original: 1 0x3.5-0x3.5 (0.1)
0x000| 64 | d | emphasis: "none" (0b0) 0x3.6-0x3.7 (0.2)
| | | side_info{}: 0x4-0x23.7 (32)
0x000| 00 00 | .. | main_data_begin: 0 0x4-0x5 (1.1)
0x000| 00 | . | share: 0 0x5.1-0x5.3 (0.3)
0x000| 00 | . | scfsi0: 0 0x5.4-0x5.7 (0.4)
0x000| 08 | . | scfsi1: 0 0x6-0x6.3 (0.4)
| | | granules[0:2]: 0x6.4-0x23.7 (29.4)
| | | [0][0:2]: granule 0x6.4-0x15.1 (14.6)
| | | [0]{}: channel 0x6.4-0xd.6 (7.3)
0x000| 08 e4 | .. | part2_3_length: 2276 0x6.4-0x7.7 (1.4)
0x000| 6f 44 | oD | big_values: 222 0x8-0x9 (1.1)
0x000| 44 8d | D. | global_gain: 137 0x9.1-0xa (1)
0x000| 8d | . | scalefac_compress: 1 0xa.1-0xa.4 (0.4)
0x000| 8d | . | blocksplit_flag: 1 0xa.5-0xa.5 (0.1)
0x000| 8d | . | block_type: "start block" (1) 0xa.6-0xa.7 (0.2)
0x000| 77 | w | switch_point: 0 0xb-0xb (0.1)
0x000| 77 | w | table_select0: 29 0xb.1-0xb.5 (0.5)
0x000| 77 00 | w. | table_select1: 24 0xb.6-0xc.2 (0.5)
0x000| 00 | . | subblock_gain0: 0 0xc.3-0xc.5 (0.3)
0x000| 00 02 | .. | subblock_gain1: 0 0xc.6-0xd (0.3)
0x000| 02 | . | subblock_gain2: 0 0xd.1-0xd.3 (0.3)
0x000| 02 | . | preflag: 0 0xd.4-0xd.4 (0.1)
0x000| 02 | . | scalefac_scale: 0 0xd.5-0xd.5 (0.1)
0x000| 02 | . | count1table_select: 1 0xd.6-0xd.6 (0.1)
| | | [1]{}: channel 0xd.7-0x15.1 (7.3)
0x000| 02 00 00| ...| part2_3_length: 0 0xd.7-0xf.2 (1.4)
0x000| 00| .| big_values: 0 0xf.3-0x10.3 (1.1)
0x010|0d |. |
0x010|0d 20 |. | global_gain: 210 0x10.4-0x11.3 (1)
0x010| 20 | | scalefac_compress: 0 0x11.4-0x11.7 (0.4)
0x010| a0 | . | blocksplit_flag: 1 0x12-0x12 (0.1)
0x010| a0 | . | block_type: "start block" (1) 0x12.1-0x12.2 (0.2)
0x010| a0 | . | switch_point: 0 0x12.3-0x12.3 (0.1)
0x010| a0 00 | .. | table_select0: 0 0x12.4-0x13 (0.5)
0x010| 00 | . | table_select1: 0 0x13.1-0x13.5 (0.5)
0x010| 00 01 | .. | subblock_gain0: 0 0x13.6-0x14 (0.3)
0x010| 01 | . | subblock_gain1: 0 0x14.1-0x14.3 (0.3)
0x010| 01 | . | subblock_gain2: 0 0x14.4-0x14.6 (0.3)
0x010| 01 | . | preflag: 1 0x14.7-0x14.7 (0.1)
0x010| 3e | > | scalefac_scale: 0 0x15-0x15 (0.1)
0x010| 3e | > | count1table_select: 0 0x15.1-0x15.1 (0.1)
| | | [1][0:2]: granule 0x15.2-0x23.7 (14.6)
| | | [0]{}: channel 0x15.2-0x1c.4 (7.3)
0x010| 3e 46 | >F | part2_3_length: 3985 0x15.2-0x16.5 (1.4)
0x010| 46 2f | F/ | big_values: 279 0x16.6-0x17.6 (1.1)
0x010| 2f 18 | /. | global_gain: 140 0x17.7-0x18.6 (1)
0x010| 18 19 | .. | scalefac_compress: 0 0x18.7-0x19.2 (0.4)
0x010| 19 | . | blocksplit_flag: 1 0x19.3-0x19.3 (0.1)
0x010| 19 | . | block_type: "3 short windows" (2) 0x19.4-0x19.5 (0.2)
0x010| 19 | . | switch_point: 0 0x19.6-0x19.6 (0.1)
0x010| 19 ed | .. | table_select0: 30 0x19.7-0x1a.3 (0.5)
0x010| ed 80 | .. | table_select1: 27 0x1a.4-0x1b (0.5)
0x010| 80 | . | subblock_gain0: 0 0x1b.1-0x1b.3 (0.3)
0x010| 80 | . | subblock_gain1: 0 0x1b.4-0x1b.6 (0.3)
0x010| 80 00 | .. | subblock_gain2: 0 0x1b.7-0x1c.1 (0.3)
0x010| 00 | . | preflag: 0 0x1c.2-0x1c.2 (0.1)
0x010| 00 | . | scalefac_scale: 0 0x1c.3-0x1c.3 (0.1)
0x010| 00 | . | count1table_select: 0 0x1c.4-0x1c.4 (0.1)
| | | [1]{}: channel 0x1c.5-0x23.7 (7.3)
0x010| 00 00 00 | ... | part2_3_length: 0 0x1c.5-0x1e (1.4)
0x010| 00 34| .4| big_values: 0 0x1e.1-0x1f.1 (1.1)
0x010| 34| 4| global_gain: 210 0x1f.2-0x20.1 (1)
0x020|83 |. |
0x020|83 |. | scalefac_compress: 0 0x20.2-0x20.5 (0.4)
0x020|83 |. | blocksplit_flag: 1 0x20.6-0x20.6 (0.1)
0x020|83 00 |.. | block_type: "3 short windows" (2) 0x20.7-0x21 (0.2)
0x020| 00 | . | switch_point: 0 0x21.1-0x21.1 (0.1)
0x020| 00 | . | table_select0: 0 0x21.2-0x21.6 (0.5)
0x020| 00 00 | .. | table_select1: 0 0x21.7-0x22.3 (0.5)
0x020| 00 | . | subblock_gain0: 0 0x22.4-0x22.6 (0.3)
0x020| 00 00 | .. | subblock_gain1: 0 0x22.7-0x23.1 (0.3)
0x020| 00 | . | subblock_gain2: 0 0x23.2-0x23.4 (0.3)
0x020| 00 | . | preflag: 0 0x23.5-0x23.5 (0.1)
0x020| 00 | . | scalefac_scale: 0 0x23.6-0x23.6 (0.1)
0x020| 00 | . | count1table_select: 0 0x23.7-0x23.7 (0.1)
0x020| 1c 0d 7f 5e cd 71 57 4d 39 40 4c a9| ...^.qWM9@L.| audio_data: raw bits 0x24-0x413.7 (1008)
0x030|07 cc 7e 43 0d 80 76 0e 10 89 0e 10 75 0d 78 3d|..~C..v.....u.x=|
* |until 0x413.7 (end) (1008) | |
| | | crc_calculated: "a2ea" (raw bits) 0x414-NA (0)

Binary file not shown.

View File

@ -0,0 +1,95 @@
$ fq -d mp3_frame dv mp3-frame-320000br-2ch-48000hz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3-frame-320000br-2ch-48000hz (mp3_frame) 0x0-0x3bf.7 (960)
| | | header{}: 0x0-0x3.7 (4)
0x000|ff fb |.. | sync: 0b11111111111 (valid) 0x0-0x1.2 (1.3)
0x000| fb | . | mpeg_version: "1" (3) (MPEG Version 1) 0x1.3-0x1.4 (0.2)
0x000| fb | . | layer: 3 (1) (MPEG Layer 3) 0x1.5-0x1.6 (0.2)
| | | sample_count: 1152 0x1.7-NA (0)
0x000| fb | . | protection_absent: true (No CRC) 0x1.7-0x1.7 (0.1)
0x000| e4 | . | bitrate: 320000 (14) 0x2-0x2.3 (0.4)
0x000| e4 | . | sample_rate: 48000 (1) 0x2.4-0x2.5 (0.2)
0x000| e4 | . | padding: "not_padded" (0b0) 0x2.6-0x2.6 (0.1)
0x000| e4 | . | private: 0 0x2.7-0x2.7 (0.1)
0x000| 64 | d | channels: "joint_stereo" (0b1) 0x3-0x3.1 (0.2)
0x000| 64 | d | channel_mode: "ms_stereo" (0b10) 0x3.2-0x3.3 (0.2)
0x000| 64 | d | copyright: 0 0x3.4-0x3.4 (0.1)
0x000| 64 | d | original: 1 0x3.5-0x3.5 (0.1)
0x000| 64 | d | emphasis: "none" (0b0) 0x3.6-0x3.7 (0.2)
| | | side_info{}: 0x4-0x23.7 (32)
0x000| 00 00 | .. | main_data_begin: 0 0x4-0x5 (1.1)
0x000| 00 | . | share: 0 0x5.1-0x5.3 (0.3)
0x000| 00 | . | scfsi0: 0 0x5.4-0x5.7 (0.4)
0x000| 08 | . | scfsi1: 0 0x6-0x6.3 (0.4)
| | | granules[0:2]: 0x6.4-0x23.7 (29.4)
| | | [0][0:2]: granule 0x6.4-0x15.1 (14.6)
| | | [0]{}: channel 0x6.4-0xd.6 (7.3)
0x000| 08 68 | .h | part2_3_length: 2152 0x6.4-0x7.7 (1.4)
0x000| 71 44 | qD | big_values: 226 0x8-0x9 (1.1)
0x000| 44 85 | D. | global_gain: 137 0x9.1-0xa (1)
0x000| 85 | . | scalefac_compress: 0 0xa.1-0xa.4 (0.4)
0x000| 85 | . | blocksplit_flag: 1 0xa.5-0xa.5 (0.1)
0x000| 85 | . | block_type: "start block" (1) 0xa.6-0xa.7 (0.2)
0x000| 77 | w | switch_point: 0 0xb-0xb (0.1)
0x000| 77 | w | table_select0: 29 0xb.1-0xb.5 (0.5)
0x000| 77 00 | w. | table_select1: 24 0xb.6-0xc.2 (0.5)
0x000| 00 | . | subblock_gain0: 0 0xc.3-0xc.5 (0.3)
0x000| 00 02 | .. | subblock_gain1: 0 0xc.6-0xd (0.3)
0x000| 02 | . | subblock_gain2: 0 0xd.1-0xd.3 (0.3)
0x000| 02 | . | preflag: 0 0xd.4-0xd.4 (0.1)
0x000| 02 | . | scalefac_scale: 0 0xd.5-0xd.5 (0.1)
0x000| 02 | . | count1table_select: 1 0xd.6-0xd.6 (0.1)
| | | [1]{}: channel 0xd.7-0x15.1 (7.3)
0x000| 02 00 00| ...| part2_3_length: 0 0xd.7-0xf.2 (1.4)
0x000| 00| .| big_values: 0 0xf.3-0x10.3 (1.1)
0x010|0d |. |
0x010|0d 20 |. | global_gain: 210 0x10.4-0x11.3 (1)
0x010| 20 | | scalefac_compress: 0 0x11.4-0x11.7 (0.4)
0x010| a0 | . | blocksplit_flag: 1 0x12-0x12 (0.1)
0x010| a0 | . | block_type: "start block" (1) 0x12.1-0x12.2 (0.2)
0x010| a0 | . | switch_point: 0 0x12.3-0x12.3 (0.1)
0x010| a0 00 | .. | table_select0: 0 0x12.4-0x13 (0.5)
0x010| 00 | . | table_select1: 0 0x13.1-0x13.5 (0.5)
0x010| 00 01 | .. | subblock_gain0: 0 0x13.6-0x14 (0.3)
0x010| 01 | . | subblock_gain1: 0 0x14.1-0x14.3 (0.3)
0x010| 01 | . | subblock_gain2: 0 0x14.4-0x14.6 (0.3)
0x010| 01 | . | preflag: 1 0x14.7-0x14.7 (0.1)
0x010| 3c | < | scalefac_scale: 0 0x15-0x15 (0.1)
0x010| 3c | < | count1table_select: 0 0x15.1-0x15.1 (0.1)
| | | [1][0:2]: granule 0x15.2-0x23.7 (14.6)
| | | [0]{}: channel 0x15.2-0x1c.4 (7.3)
0x010| 3c 2e | <. | part2_3_length: 3851 0x15.2-0x16.5 (1.4)
0x010| 2e 23 | .# | big_values: 273 0x16.6-0x17.6 (1.1)
0x010| 23 16 | #. | global_gain: 139 0x17.7-0x18.6 (1)
0x010| 16 19 | .. | scalefac_compress: 0 0x18.7-0x19.2 (0.4)
0x010| 19 | . | blocksplit_flag: 1 0x19.3-0x19.3 (0.1)
0x010| 19 | . | block_type: "3 short windows" (2) 0x19.4-0x19.5 (0.2)
0x010| 19 | . | switch_point: 0 0x19.6-0x19.6 (0.1)
0x010| 19 ee | .. | table_select0: 30 0x19.7-0x1a.3 (0.5)
0x010| ee 00 | .. | table_select1: 28 0x1a.4-0x1b (0.5)
0x010| 00 | . | subblock_gain0: 0 0x1b.1-0x1b.3 (0.3)
0x010| 00 | . | subblock_gain1: 0 0x1b.4-0x1b.6 (0.3)
0x010| 00 00 | .. | subblock_gain2: 0 0x1b.7-0x1c.1 (0.3)
0x010| 00 | . | preflag: 0 0x1c.2-0x1c.2 (0.1)
0x010| 00 | . | scalefac_scale: 0 0x1c.3-0x1c.3 (0.1)
0x010| 00 | . | count1table_select: 0 0x1c.4-0x1c.4 (0.1)
| | | [1]{}: channel 0x1c.5-0x23.7 (7.3)
0x010| 00 00 00 | ... | part2_3_length: 0 0x1c.5-0x1e (1.4)
0x010| 00 34| .4| big_values: 0 0x1e.1-0x1f.1 (1.1)
0x010| 34| 4| global_gain: 210 0x1f.2-0x20.1 (1)
0x020|83 |. |
0x020|83 |. | scalefac_compress: 0 0x20.2-0x20.5 (0.4)
0x020|83 |. | blocksplit_flag: 1 0x20.6-0x20.6 (0.1)
0x020|83 00 |.. | block_type: "3 short windows" (2) 0x20.7-0x21 (0.2)
0x020| 00 | . | switch_point: 0 0x21.1-0x21.1 (0.1)
0x020| 00 | . | table_select0: 0 0x21.2-0x21.6 (0.5)
0x020| 00 00 | .. | table_select1: 0 0x21.7-0x22.3 (0.5)
0x020| 00 | . | subblock_gain0: 0 0x22.4-0x22.6 (0.3)
0x020| 00 00 | .. | subblock_gain1: 0 0x22.7-0x23.1 (0.3)
0x020| 00 | . | subblock_gain2: 0 0x23.2-0x23.4 (0.3)
0x020| 00 | . | preflag: 0 0x23.5-0x23.5 (0.1)
0x020| 00 | . | scalefac_scale: 0 0x23.6-0x23.6 (0.1)
0x020| 00 | . | count1table_select: 0 0x23.7-0x23.7 (0.1)
0x020| 36 a5 9b 35 fd 51 34 4c b9 30 ec 62| 6..5.Q4L.0.b| audio_data: raw bits 0x24-0x3bf.7 (924)
0x030|33 b9 64 37 0a 06 38 aa 2e 38 31 c4 35 78 d8 32|3.d7..8..81.5x.2|
* |until 0x3bf.7 (end) (924) | |
| | | crc_calculated: "d503" (raw bits) 0x3c0-NA (0)

Binary file not shown.

View File

@ -0,0 +1,53 @@
$ fq -d mp3_frame dv mp3-frame-320000br-2ch-8000hz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3-frame-320000br-2ch-8000hz (mp3_frame) 0x0-0x23f.7 (576)
| | | header{}: 0x0-0x3.7 (4)
0x000|ff e3 |.. | sync: 0b11111111111 (valid) 0x0-0x1.2 (1.3)
0x000| e3 | . | mpeg_version: "2.5" (0) (MPEG Version 2.5) 0x1.3-0x1.4 (0.2)
0x000| e3 | . | layer: 3 (1) (MPEG Layer 3) 0x1.5-0x1.6 (0.2)
| | | sample_count: 576 0x1.7-NA (0)
0x000| e3 | . | protection_absent: true (No CRC) 0x1.7-0x1.7 (0.1)
0x000| 88 | . | bitrate: 64000 (8) 0x2-0x2.3 (0.4)
0x000| 88 | . | sample_rate: 8000 (2) 0x2.4-0x2.5 (0.2)
0x000| 88 | . | padding: "not_padded" (0b0) 0x2.6-0x2.6 (0.1)
0x000| 88 | . | private: 0 0x2.7-0x2.7 (0.1)
0x000| 64 | d | channels: "joint_stereo" (0b1) 0x3-0x3.1 (0.2)
0x000| 64 | d | channel_mode: "ms_stereo" (0b10) 0x3.2-0x3.3 (0.2)
0x000| 64 | d | copyright: 0 0x3.4-0x3.4 (0.1)
0x000| 64 | d | original: 1 0x3.5-0x3.5 (0.1)
0x000| 64 | d | emphasis: "none" (0b0) 0x3.6-0x3.7 (0.2)
| | | side_info{}: 0x4-0x14.7 (17)
0x000| 00 | . | main_data_begin: 0 0x4-0x4.7 (1)
0x000| 26 | & | private_bits: 0 0x5-0x5.1 (0.2)
| | | granules[0:1]: 0x5.2-0x14.7 (15.6)
| | | [0][0:2]: granule 0x5.2-0x14.7 (15.6)
| | | [0]{}: channel 0x5.2-0xd (7.7)
0x000| 26 76 | &v | part2_3_length: 2461 0x5.2-0x6.5 (1.4)
0x000| 76 37 | v7 | big_values: 283 0x6.6-0x7.6 (1.1)
0x000| 37 2a | 7* | global_gain: 149 0x7.7-0x8.6 (1)
0x000| 2a 01 | *. | scalefac_compress: 1 0x8.7-0x9.7 (1.1)
0x000| 63 | c | blocksplit_flag: 0 0xa-0xa (0.1)
0x000| 63 | c | table_select0: 24 0xa.1-0xa.5 (0.5)
0x000| 63 6c | cl | table_select1: 27 0xa.6-0xb.2 (0.5)
0x000| 6c | l | table_select2: 12 0xb.3-0xb.7 (0.5)
0x000| 38 | 8 | region_address1: 3 0xc-0xc.3 (0.4)
0x000| 38 | 8 | region_address2: 4 0xc.4-0xc.6 (0.3)
0x000| 38 | 8 | scalefac_scale: 0 0xc.7-0xc.7 (0.1)
0x000| 00 | . | count1table_select: 0 0xd-0xd (0.1)
| | | [1]{}: channel 0xd.1-0x14.7 (7.7)
0x000| 00 00 | .. | part2_3_length: 0 0xd.1-0xe.4 (1.4)
0x000| 00 03| ..| big_values: 0 0xe.5-0xf.5 (1.1)
0x000| 03| .| global_gain: 210 0xf.6-0x10.5 (1)
0x010|48 |H |
0x010|48 00 |H. | scalefac_compress: 0 0x10.6-0x11.6 (1.1)
0x010| 00 | . | blocksplit_flag: 0 0x11.7-0x11.7 (0.1)
0x010| 00 | . | table_select0: 0 0x12-0x12.4 (0.5)
0x010| 00 00 | .. | table_select1: 0 0x12.5-0x13.1 (0.5)
0x010| 00 | . | table_select2: 0 0x13.2-0x13.6 (0.5)
0x010| 00 00 | .. | region_address1: 0 0x13.7-0x14.2 (0.4)
0x010| 00 | . | region_address2: 0 0x14.3-0x14.5 (0.3)
0x010| 00 | . | scalefac_scale: 0 0x14.6-0x14.6 (0.1)
0x010| 00 | . | count1table_select: 0 0x14.7-0x14.7 (0.1)
0x010| 81 94 28 6e ef b2 b2 eb 98 46 63| ..(n.....Fc| audio_data: raw bits 0x15-0x23f.7 (555)
0x020|09 76 db 7a ef 01 6e 0c 44 33 08 b7 8f 65 b6 90|.v.z..n.D3...e..|
* |until 0x23f.7 (end) (555) | |
| | | crc_calculated: "eae8" (raw bits) 0x240-NA (0)

Binary file not shown.

View File

@ -1,63 +1,61 @@
# ffmpeg -y -f lavfi -i sine -ac 1 -t 10ms -f mp3 file && fq file '.frame[1] | tobits' > mp3-frame-mono
$ fq -d mp3_frame dv mp3-frame-mono
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3-frame-mono (mp3_frame) 0x0-0xcf.7 (208)
$ fq -d mp3_frame dv mp3-frame-8000br-1ch-44100hz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3-frame-8000br-1ch-44100hz (mp3_frame) 0x0-0x67.7 (104)
| | | header{}: 0x0-0x3.7 (4)
0x00|ff fb |.. | sync: 0b11111111111 (valid) 0x0-0x1.2 (1.3)
0x00| fb | . | mpeg_version: "1" (3) (MPEG Version 1) 0x1.3-0x1.4 (0.2)
0x00| fb | . | layer: 3 (1) (MPEG Layer 3) 0x1.5-0x1.6 (0.2)
| | | sample_count: 1152 0x1.7-NA (0)
0x00| fb | . | protection_absent: true (No CRC) 0x1.7-0x1.7 (0.1)
0x00| 50 | P | bitrate: 64000 (5) 0x2-0x2.3 (0.4)
0x00| 50 | P | sample_rate: 44100 (0) 0x2.4-0x2.5 (0.2)
0x00| 50 | P | padding: "not_padded" (0b0) 0x2.6-0x2.6 (0.1)
0x00| 50 | P | private: 0 0x2.7-0x2.7 (0.1)
0x00| 10 | . | bitrate: 32000 (1) 0x2-0x2.3 (0.4)
0x00| 10 | . | sample_rate: 44100 (0) 0x2.4-0x2.5 (0.2)
0x00| 10 | . | padding: "not_padded" (0b0) 0x2.6-0x2.6 (0.1)
0x00| 10 | . | private: 0 0x2.7-0x2.7 (0.1)
0x00| c4 | . | channels: "mono" (0b11) 0x3-0x3.1 (0.2)
0x00| c4 | . | channel_mode: "none" (0b0) 0x3.2-0x3.3 (0.2)
0x00| c4 | . | copyright: 0 0x3.4-0x3.4 (0.1)
0x00| c4 | . | original: 1 0x3.5-0x3.5 (0.1)
0x00| c4 | . | emphasis: "none" (0b0) 0x3.6-0x3.7 (0.2)
| | | side_info{}: 0x4-0x14.7 (17)
0x00| 00 00 | .. | main_data_end: 0 0x4-0x5 (1.1)
0x00| 00 | . | private_bits: 0 0x5.1-0x5.5 (0.5)
0x00| 00 0a | .. | share0: 0 0x5.6-0x6.1 (0.4)
0x00| 00 00 | .. | main_data_begin: 0 0x4-0x5 (1.1)
0x00| 00 | . | share: 0 0x5.1-0x5.5 (0.5)
0x00| 00 04 | .. | scfsi0: 0 0x5.6-0x6.1 (0.4)
| | | granules[0:2]: 0x6.2-0x14.7 (14.6)
| | | [0][0:1]: granule 0x6.2-0xd.4 (7.3)
| | | [0]{}: channel 0x6.2-0xd.4 (7.3)
0x00| 0a 2c | ., | part2_3_length: 651 0x6.2-0x7.5 (1.4)
0x00| 2c 43 | ,C | big_values: 33 0x7.6-0x8.6 (1.1)
0x00| 43 2e | C. | global_gain: 151 0x8.7-0x9.6 (1)
0x00| 2e 55 | .U | scalefac_compress: 2 0x9.7-0xa.2 (0.4)
0x00| 55 | U | blocksplit_flag: 1 0xa.3-0xa.3 (0.1)
0x00| 55 | U | block_type: "start block" (1) 0xa.4-0xa.5 (0.2)
0x00| 55 | U | switch_point: 0 0xa.6-0xa.6 (0.1)
0x00| 55 94 | U. | table_select0: 25 0xa.7-0xb.3 (0.5)
0x00| 94 80 | .. | table_select1: 9 0xb.4-0xc (0.5)
0x00| 04 80 | .. | part2_3_length: 288 0x6.2-0x7.5 (1.4)
0x00| 80 25 | .% | big_values: 18 0x7.6-0x8.6 (1.1)
0x00| 25 3c | %< | global_gain: 158 0x8.7-0x9.6 (1)
0x00| 3c 35 | <5 | scalefac_compress: 1 0x9.7-0xa.2 (0.4)
0x00| 35 | 5 | blocksplit_flag: 1 0xa.3-0xa.3 (0.1)
0x00| 35 | 5 | block_type: "start block" (1) 0xa.4-0xa.5 (0.2)
0x00| 35 | 5 | switch_point: 0 0xa.6-0xa.6 (0.1)
0x00| 35 80 | 5. | table_select0: 24 0xa.7-0xb.3 (0.5)
0x00| 80 80 | .. | table_select1: 1 0xb.4-0xc (0.5)
0x00| 80 | . | subblock_gain0: 0 0xc.1-0xc.3 (0.3)
0x00| 80 | . | subblock_gain1: 0 0xc.4-0xc.6 (0.3)
0x00| 80 01 | .. | subblock_gain2: 0 0xc.7-0xd.1 (0.3)
0x00| 01 | . | preflag: 0 0xd.2-0xd.2 (0.1)
0x00| 01 | . | scalefac_scale: 0 0xd.3-0xd.3 (0.1)
0x00| 01 | . | count1table_select: 0 0xd.4-0xd.4 (0.1)
0x00| 80 18 | .. | subblock_gain2: 0 0xc.7-0xd.1 (0.3)
0x00| 18 | . | preflag: 0 0xd.2-0xd.2 (0.1)
0x00| 18 | . | scalefac_scale: 1 0xd.3-0xd.3 (0.1)
0x00| 18 | . | count1table_select: 1 0xd.4-0xd.4 (0.1)
| | | [1][0:1]: granule 0xd.5-0x14.7 (7.3)
| | | [0]{}: channel 0xd.5-0x14.7 (7.3)
0x00| 01 80 93| ...| part2_3_length: 769 0xd.5-0xf (1.4)
0x00| 93| .| big_values: 77 0xf.1-0x10.1 (1.1)
0x10|6b |k |
0x10|6b 27 |k' | global_gain: 172 0x10.2-0x11.1 (1)
0x10| 27 | ' | scalefac_compress: 9 0x11.2-0x11.5 (0.4)
0x10| 27 | ' | blocksplit_flag: 1 0x11.6-0x11.6 (0.1)
0x10| 27 30 | '0 | block_type: "3 short windows" (2) 0x11.7-0x12 (0.2)
0x10| 30 | 0 | switch_point: 0 0x12.1-0x12.1 (0.1)
0x10| 30 | 0 | table_select0: 24 0x12.2-0x12.6 (0.5)
0x10| 30 80 | 0. | table_select1: 8 0x12.7-0x13.3 (0.5)
0x00| 18 aa 8b| ...| part2_3_length: 341 0xd.5-0xf (1.4)
0x00| 8b| .| big_values: 45 0xf.1-0x10.1 (1.1)
0x10|69 |i |
0x10|69 c3 |i. | global_gain: 167 0x10.2-0x11.1 (1)
0x10| c3 | . | scalefac_compress: 0 0x11.2-0x11.5 (0.4)
0x10| c3 | . | blocksplit_flag: 1 0x11.6-0x11.6 (0.1)
0x10| c3 34 | .4 | block_type: "3 short windows" (2) 0x11.7-0x12 (0.2)
0x10| 34 | 4 | switch_point: 0 0x12.1-0x12.1 (0.1)
0x10| 34 | 4 | table_select0: 26 0x12.2-0x12.6 (0.5)
0x10| 34 80 | 4. | table_select1: 8 0x12.7-0x13.3 (0.5)
0x10| 80 | . | subblock_gain0: 0 0x13.4-0x13.6 (0.3)
0x10| 80 00 | .. | subblock_gain1: 0 0x13.7-0x14.1 (0.3)
0x10| 00 | . | subblock_gain2: 0 0x14.2-0x14.4 (0.3)
0x10| 00 | . | preflag: 0 0x14.5-0x14.5 (0.1)
0x10| 00 | . | scalefac_scale: 0 0x14.6-0x14.6 (0.1)
0x10| 00 | . | count1table_select: 0 0x14.7-0x14.7 (0.1)
0x10| 07 aa c3 8e 33 85 d3 64 f1 a1 c1| ....3..d...| data: raw bits 0x15-0xcf.7 (187)
0x20|08 1c 58 1f 5e 1f 18 1c 46 04 1e 89 e5 b3 2e 5a|..X.^...F......Z|
* |until 0xcf.7 (end) (187) | |
| | | other_data: raw bits 0xd0-NA (0)
| | | crc_calculated: "e5b0" (raw bits) 0xd0-NA (0)
0x10| 40 0b 4e 5c b4 53 79 d6 80 10 46| @.N\.Sy...F| audio_data: raw bits 0x15-0x67.7 (83)
0x20|63 19 84 5f 06 9e ff b9 6e 5b ff 0f c6 e9 ed 80|c.._....n[......|
* |until 0x67.7 (end) (83) | |
| | | crc_calculated: "b723" (raw bits) 0x68-NA (0)

Binary file not shown.

View File

@ -0,0 +1,61 @@
$ fq -d mp3_frame dv mp3-frame-8000br-1ch-48000hz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3-frame-8000br-1ch-48000hz (mp3_frame) 0x0-0x5f.7 (96)
| | | header{}: 0x0-0x3.7 (4)
0x00|ff fb |.. | sync: 0b11111111111 (valid) 0x0-0x1.2 (1.3)
0x00| fb | . | mpeg_version: "1" (3) (MPEG Version 1) 0x1.3-0x1.4 (0.2)
0x00| fb | . | layer: 3 (1) (MPEG Layer 3) 0x1.5-0x1.6 (0.2)
| | | sample_count: 1152 0x1.7-NA (0)
0x00| fb | . | protection_absent: true (No CRC) 0x1.7-0x1.7 (0.1)
0x00| 14 | . | bitrate: 32000 (1) 0x2-0x2.3 (0.4)
0x00| 14 | . | sample_rate: 48000 (1) 0x2.4-0x2.5 (0.2)
0x00| 14 | . | padding: "not_padded" (0b0) 0x2.6-0x2.6 (0.1)
0x00| 14 | . | private: 0 0x2.7-0x2.7 (0.1)
0x00| c4 | . | channels: "mono" (0b11) 0x3-0x3.1 (0.2)
0x00| c4 | . | channel_mode: "none" (0b0) 0x3.2-0x3.3 (0.2)
0x00| c4 | . | copyright: 0 0x3.4-0x3.4 (0.1)
0x00| c4 | . | original: 1 0x3.5-0x3.5 (0.1)
0x00| c4 | . | emphasis: "none" (0b0) 0x3.6-0x3.7 (0.2)
| | | side_info{}: 0x4-0x14.7 (17)
0x00| 00 00 | .. | main_data_begin: 0 0x4-0x5 (1.1)
0x00| 00 | . | share: 0 0x5.1-0x5.5 (0.5)
0x00| 00 04 | .. | scfsi0: 0 0x5.6-0x6.1 (0.4)
| | | granules[0:2]: 0x6.2-0x14.7 (14.6)
| | | [0][0:1]: granule 0x6.2-0xd.4 (7.3)
| | | [0]{}: channel 0x6.2-0xd.4 (7.3)
0x00| 04 14 | .. | part2_3_length: 261 0x6.2-0x7.5 (1.4)
0x00| 14 2f | ./ | big_values: 23 0x7.6-0x8.6 (1.1)
0x00| 2f 3a | /: | global_gain: 157 0x8.7-0x9.6 (1)
0x00| 3a 15 | :. | scalefac_compress: 0 0x9.7-0xa.2 (0.4)
0x00| 15 | . | blocksplit_flag: 1 0xa.3-0xa.3 (0.1)
0x00| 15 | . | block_type: "start block" (1) 0xa.4-0xa.5 (0.2)
0x00| 15 | . | switch_point: 0 0xa.6-0xa.6 (0.1)
0x00| 15 81 | .. | table_select0: 24 0xa.7-0xb.3 (0.5)
0x00| 81 80 | .. | table_select1: 3 0xb.4-0xc (0.5)
0x00| 80 | . | subblock_gain0: 0 0xc.1-0xc.3 (0.3)
0x00| 80 | . | subblock_gain1: 0 0xc.4-0xc.6 (0.3)
0x00| 80 08 | .. | subblock_gain2: 0 0xc.7-0xd.1 (0.3)
0x00| 08 | . | preflag: 0 0xd.2-0xd.2 (0.1)
0x00| 08 | . | scalefac_scale: 0 0xd.3-0xd.3 (0.1)
0x00| 08 | . | count1table_select: 1 0xd.4-0xd.4 (0.1)
| | | [1][0:1]: granule 0xd.5-0x14.7 (7.3)
| | | [0]{}: channel 0xd.5-0x14.7 (7.3)
0x00| 08 96 8a| ...| part2_3_length: 301 0xd.5-0xf (1.4)
0x00| 8a| .| big_values: 40 0xf.1-0x10.1 (1.1)
0x10|2d |- |
0x10|2d 13 |-. | global_gain: 180 0x10.2-0x11.1 (1)
0x10| 13 | . | scalefac_compress: 4 0x11.2-0x11.5 (0.4)
0x10| 13 | . | blocksplit_flag: 1 0x11.6-0x11.6 (0.1)
0x10| 13 1e | .. | block_type: "3 short windows" (2) 0x11.7-0x12 (0.2)
0x10| 1e | . | switch_point: 0 0x12.1-0x12.1 (0.1)
0x10| 1e | . | table_select0: 15 0x12.2-0x12.6 (0.5)
0x10| 1e 90 | .. | table_select1: 9 0x12.7-0x13.3 (0.5)
0x10| 90 | . | subblock_gain0: 0 0x13.4-0x13.6 (0.3)
0x10| 90 00 | .. | subblock_gain1: 0 0x13.7-0x14.1 (0.3)
0x10| 00 | . | subblock_gain2: 0 0x14.2-0x14.4 (0.3)
0x10| 00 | . | preflag: 0 0x14.5-0x14.5 (0.1)
0x10| 00 | . | scalefac_scale: 0 0x14.6-0x14.6 (0.1)
0x10| 00 | . | count1table_select: 0 0x14.7-0x14.7 (0.1)
0x10| 31 8c 0c 34 7f 7d 8b 70 64 51 b1| 1..4.}.pdQ.| audio_data: raw bits 0x15-0x5f.7 (75)
0x20|86 a2 17 41 d7 95 bb 6e 5b ff 0f c6 e9 ed a2 20|...A...n[...... |
* |until 0x5f.7 (end) (75) | |
| | | crc_calculated: "19b9" (raw bits) 0x60-NA (0)

Binary file not shown.

View File

@ -0,0 +1,39 @@
$ fq -d mp3_frame dv mp3-frame-8000br-1ch-8000hz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3-frame-8000br-1ch-8000hz (mp3_frame) 0x0-0x47.7 (72)
| | | header{}: 0x0-0x3.7 (4)
0x00|ff e3 |.. | sync: 0b11111111111 (valid) 0x0-0x1.2 (1.3)
0x00| e3 | . | mpeg_version: "2.5" (0) (MPEG Version 2.5) 0x1.3-0x1.4 (0.2)
0x00| e3 | . | layer: 3 (1) (MPEG Layer 3) 0x1.5-0x1.6 (0.2)
| | | sample_count: 576 0x1.7-NA (0)
0x00| e3 | . | protection_absent: true (No CRC) 0x1.7-0x1.7 (0.1)
0x00| 18 | . | bitrate: 8000 (1) 0x2-0x2.3 (0.4)
0x00| 18 | . | sample_rate: 8000 (2) 0x2.4-0x2.5 (0.2)
0x00| 18 | . | padding: "not_padded" (0b0) 0x2.6-0x2.6 (0.1)
0x00| 18 | . | private: 0 0x2.7-0x2.7 (0.1)
0x00| c4 | . | channels: "mono" (0b11) 0x3-0x3.1 (0.2)
0x00| c4 | . | channel_mode: "none" (0b0) 0x3.2-0x3.3 (0.2)
0x00| c4 | . | copyright: 0 0x3.4-0x3.4 (0.1)
0x00| c4 | . | original: 1 0x3.5-0x3.5 (0.1)
0x00| c4 | . | emphasis: "none" (0b0) 0x3.6-0x3.7 (0.2)
| | | side_info{}: 0x4-0xc.7 (9)
0x00| 00 | . | main_data_begin: 0 0x4-0x4.7 (1)
0x00| 0c | . | private_bits: 0 0x5-0x5 (0.1)
| | | granules[0:1]: 0x5.1-0xc.7 (7.7)
| | | [0][0:1]: granule 0x5.1-0xc.7 (7.7)
| | | [0]{}: channel 0x5.1-0xc.7 (7.7)
0x00| 0c 90 | .. | part2_3_length: 402 0x5.1-0x6.4 (1.4)
0x00| 90 8e | .. | big_values: 35 0x6.5-0x7.5 (1.1)
0x00| 8e c1 | .. | global_gain: 176 0x7.6-0x8.5 (1)
0x00| c1 b8 | .. | scalefac_compress: 220 0x8.6-0x9.6 (1.1)
0x00| b8 | . | blocksplit_flag: 0 0x9.7-0x9.7 (0.1)
0x00| 08 | . | table_select0: 1 0xa-0xa.4 (0.5)
0x00| 08 4c | .L | table_select1: 1 0xa.5-0xb.1 (0.5)
0x00| 4c | L | table_select2: 6 0xb.2-0xb.6 (0.5)
0x00| 4c 0c | L. | region_address1: 0 0xb.7-0xc.2 (0.4)
0x00| 0c | . | region_address2: 3 0xc.3-0xc.5 (0.3)
0x00| 0c | . | scalefac_scale: 0 0xc.6-0xc.6 (0.1)
0x00| 0c | . | count1table_select: 0 0xc.7-0xc.7 (0.1)
0x00| 64 00 9d| d..| audio_data: raw bits 0xd-0x47.7 (59)
0x10|db fe 1f 98 df 20 03 e6 3f 31 81 19 e4 c0 64 d3|..... ..?1....d.|
* |until 0x47.7 (end) (59) | |
| | | crc_calculated: "8213" (raw bits) 0x48-NA (0)

Binary file not shown.

View File

@ -0,0 +1,95 @@
$ fq -d mp3_frame dv mp3-frame-8000br-2ch-44100hz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3-frame-8000br-2ch-44100hz (mp3_frame) 0x0-0x67.7 (104)
| | | header{}: 0x0-0x3.7 (4)
0x00|ff fb |.. | sync: 0b11111111111 (valid) 0x0-0x1.2 (1.3)
0x00| fb | . | mpeg_version: "1" (3) (MPEG Version 1) 0x1.3-0x1.4 (0.2)
0x00| fb | . | layer: 3 (1) (MPEG Layer 3) 0x1.5-0x1.6 (0.2)
| | | sample_count: 1152 0x1.7-NA (0)
0x00| fb | . | protection_absent: true (No CRC) 0x1.7-0x1.7 (0.1)
0x00| 10 | . | bitrate: 32000 (1) 0x2-0x2.3 (0.4)
0x00| 10 | . | sample_rate: 44100 (0) 0x2.4-0x2.5 (0.2)
0x00| 10 | . | padding: "not_padded" (0b0) 0x2.6-0x2.6 (0.1)
0x00| 10 | . | private: 0 0x2.7-0x2.7 (0.1)
0x00| 64 | d | channels: "joint_stereo" (0b1) 0x3-0x3.1 (0.2)
0x00| 64 | d | channel_mode: "ms_stereo" (0b10) 0x3.2-0x3.3 (0.2)
0x00| 64 | d | copyright: 0 0x3.4-0x3.4 (0.1)
0x00| 64 | d | original: 1 0x3.5-0x3.5 (0.1)
0x00| 64 | d | emphasis: "none" (0b0) 0x3.6-0x3.7 (0.2)
| | | side_info{}: 0x4-0x23.7 (32)
0x00| 00 00 | .. | main_data_begin: 0 0x4-0x5 (1.1)
0x00| 00 | . | share: 0 0x5.1-0x5.3 (0.3)
0x00| 00 | . | scfsi0: 0 0x5.4-0x5.7 (0.4)
0x00| 00 | . | scfsi1: 0 0x6-0x6.3 (0.4)
| | | granules[0:2]: 0x6.4-0x23.7 (29.4)
| | | [0][0:2]: granule 0x6.4-0x15.1 (14.6)
| | | [0]{}: channel 0x6.4-0xd.6 (7.3)
0x00| 00 76 | .v | part2_3_length: 118 0x6.4-0x7.7 (1.4)
0x00| 04 d8 | .. | big_values: 9 0x8-0x9 (1.1)
0x00| d8 25 | .% | global_gain: 176 0x9.1-0xa (1)
0x00| 25 | % | scalefac_compress: 4 0xa.1-0xa.4 (0.4)
0x00| 25 | % | blocksplit_flag: 1 0xa.5-0xa.5 (0.1)
0x00| 25 | % | block_type: "start block" (1) 0xa.6-0xa.7 (0.2)
0x00| 0c | . | switch_point: 0 0xb-0xb (0.1)
0x00| 0c | . | table_select0: 3 0xb.1-0xb.5 (0.5)
0x00| 0c 00 | .. | table_select1: 0 0xb.6-0xc.2 (0.5)
0x00| 00 | . | subblock_gain0: 0 0xc.3-0xc.5 (0.3)
0x00| 00 0a | .. | subblock_gain1: 0 0xc.6-0xd (0.3)
0x00| 0a | . | subblock_gain2: 0 0xd.1-0xd.3 (0.3)
0x00| 0a | . | preflag: 1 0xd.4-0xd.4 (0.1)
0x00| 0a | . | scalefac_scale: 0 0xd.5-0xd.5 (0.1)
0x00| 0a | . | count1table_select: 1 0xd.6-0xd.6 (0.1)
| | | [1]{}: channel 0xd.7-0x15.1 (7.3)
0x00| 0a 00 00| ...| part2_3_length: 0 0xd.7-0xf.2 (1.4)
0x00| 00| .| big_values: 0 0xf.3-0x10.3 (1.1)
0x10|0d |. |
0x10|0d 20 |. | global_gain: 210 0x10.4-0x11.3 (1)
0x10| 20 | | scalefac_compress: 0 0x11.4-0x11.7 (0.4)
0x10| a0 | . | blocksplit_flag: 1 0x12-0x12 (0.1)
0x10| a0 | . | block_type: "start block" (1) 0x12.1-0x12.2 (0.2)
0x10| a0 | . | switch_point: 0 0x12.3-0x12.3 (0.1)
0x10| a0 00 | .. | table_select0: 0 0x12.4-0x13 (0.5)
0x10| 00 | . | table_select1: 0 0x13.1-0x13.5 (0.5)
0x10| 00 01 | .. | subblock_gain0: 0 0x13.6-0x14 (0.3)
0x10| 01 | . | subblock_gain1: 0 0x14.1-0x14.3 (0.3)
0x10| 01 | . | subblock_gain2: 0 0x14.4-0x14.6 (0.3)
0x10| 01 | . | preflag: 1 0x14.7-0x14.7 (0.1)
0x10| 04 | . | scalefac_scale: 0 0x15-0x15 (0.1)
0x10| 04 | . | count1table_select: 0 0x15.1-0x15.1 (0.1)
| | | [1][0:2]: granule 0x15.2-0x23.7 (14.6)
| | | [0]{}: channel 0x15.2-0x1c.4 (7.3)
0x10| 04 30 | .0 | part2_3_length: 268 0x15.2-0x16.5 (1.4)
0x10| 30 3f | 0? | big_values: 31 0x16.6-0x17.6 (1.1)
0x10| 3f 66 | ?f | global_gain: 179 0x17.7-0x18.6 (1)
0x10| 66 98 | f. | scalefac_compress: 4 0x18.7-0x19.2 (0.4)
0x10| 98 | . | blocksplit_flag: 1 0x19.3-0x19.3 (0.1)
0x10| 98 | . | block_type: "3 short windows" (2) 0x19.4-0x19.5 (0.2)
0x10| 98 | . | switch_point: 0 0x19.6-0x19.6 (0.1)
0x10| 98 f4 | .. | table_select0: 15 0x19.7-0x1a.3 (0.5)
0x10| f4 00 | .. | table_select1: 8 0x1a.4-0x1b (0.5)
0x10| 00 | . | subblock_gain0: 0 0x1b.1-0x1b.3 (0.3)
0x10| 00 | . | subblock_gain1: 0 0x1b.4-0x1b.6 (0.3)
0x10| 00 00 | .. | subblock_gain2: 0 0x1b.7-0x1c.1 (0.3)
0x10| 00 | . | preflag: 0 0x1c.2-0x1c.2 (0.1)
0x10| 00 | . | scalefac_scale: 0 0x1c.3-0x1c.3 (0.1)
0x10| 00 | . | count1table_select: 0 0x1c.4-0x1c.4 (0.1)
| | | [1]{}: channel 0x1c.5-0x23.7 (7.3)
0x10| 00 00 00 | ... | part2_3_length: 0 0x1c.5-0x1e (1.4)
0x10| 00 34| .4| big_values: 0 0x1e.1-0x1f.1 (1.1)
0x10| 34| 4| global_gain: 210 0x1f.2-0x20.1 (1)
0x20|83 |. |
0x20|83 |. | scalefac_compress: 0 0x20.2-0x20.5 (0.4)
0x20|83 |. | blocksplit_flag: 1 0x20.6-0x20.6 (0.1)
0x20|83 00 |.. | block_type: "3 short windows" (2) 0x20.7-0x21 (0.2)
0x20| 00 | . | switch_point: 0 0x21.1-0x21.1 (0.1)
0x20| 00 | . | table_select0: 0 0x21.2-0x21.6 (0.5)
0x20| 00 00 | .. | table_select1: 0 0x21.7-0x22.3 (0.5)
0x20| 00 | . | subblock_gain0: 0 0x22.4-0x22.6 (0.3)
0x20| 00 00 | .. | subblock_gain1: 0 0x22.7-0x23.1 (0.3)
0x20| 00 | . | subblock_gain2: 0 0x23.2-0x23.4 (0.3)
0x20| 00 | . | preflag: 0 0x23.5-0x23.5 (0.1)
0x20| 00 | . | scalefac_scale: 0 0x23.6-0x23.6 (0.1)
0x20| 00 | . | count1table_select: 0 0x23.7-0x23.7 (0.1)
0x20| 00 00 53 d8 3b b9 c4 00 10 8f 0f 3d| ..S.;......=| audio_data: raw bits 0x24-0x67.7 (68)
0x30|fa c0 00 00 00 ff ff e0 e0 08 42 0d 42 04 f9 b4|..........B.B...|
* |until 0x67.7 (end) (68) | |
| | | crc_calculated: "b123" (raw bits) 0x68-NA (0)

Binary file not shown.

View File

@ -0,0 +1,95 @@
$ fq -d mp3_frame dv mp3-frame-8000br-2ch-48000hz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3-frame-8000br-2ch-48000hz (mp3_frame) 0x0-0x5f.7 (96)
| | | header{}: 0x0-0x3.7 (4)
0x00|ff fb |.. | sync: 0b11111111111 (valid) 0x0-0x1.2 (1.3)
0x00| fb | . | mpeg_version: "1" (3) (MPEG Version 1) 0x1.3-0x1.4 (0.2)
0x00| fb | . | layer: 3 (1) (MPEG Layer 3) 0x1.5-0x1.6 (0.2)
| | | sample_count: 1152 0x1.7-NA (0)
0x00| fb | . | protection_absent: true (No CRC) 0x1.7-0x1.7 (0.1)
0x00| 14 | . | bitrate: 32000 (1) 0x2-0x2.3 (0.4)
0x00| 14 | . | sample_rate: 48000 (1) 0x2.4-0x2.5 (0.2)
0x00| 14 | . | padding: "not_padded" (0b0) 0x2.6-0x2.6 (0.1)
0x00| 14 | . | private: 0 0x2.7-0x2.7 (0.1)
0x00| 64 | d | channels: "joint_stereo" (0b1) 0x3-0x3.1 (0.2)
0x00| 64 | d | channel_mode: "ms_stereo" (0b10) 0x3.2-0x3.3 (0.2)
0x00| 64 | d | copyright: 0 0x3.4-0x3.4 (0.1)
0x00| 64 | d | original: 1 0x3.5-0x3.5 (0.1)
0x00| 64 | d | emphasis: "none" (0b0) 0x3.6-0x3.7 (0.2)
| | | side_info{}: 0x4-0x23.7 (32)
0x00| 00 00 | .. | main_data_begin: 0 0x4-0x5 (1.1)
0x00| 00 | . | share: 0 0x5.1-0x5.3 (0.3)
0x00| 00 | . | scfsi0: 0 0x5.4-0x5.7 (0.4)
0x00| 00 | . | scfsi1: 0 0x6-0x6.3 (0.4)
| | | granules[0:2]: 0x6.4-0x23.7 (29.4)
| | | [0][0:2]: granule 0x6.4-0x15.1 (14.6)
| | | [0]{}: channel 0x6.4-0xd.6 (7.3)
0x00| 00 67 | .g | part2_3_length: 103 0x6.4-0x7.7 (1.4)
0x00| 00 d9 | .. | big_values: 1 0x8-0x9 (1.1)
0x00| d9 25 | .% | global_gain: 178 0x9.1-0xa (1)
0x00| 25 | % | scalefac_compress: 4 0xa.1-0xa.4 (0.4)
0x00| 25 | % | blocksplit_flag: 1 0xa.5-0xa.5 (0.1)
0x00| 25 | % | block_type: "start block" (1) 0xa.6-0xa.7 (0.2)
0x00| 04 | . | switch_point: 0 0xb-0xb (0.1)
0x00| 04 | . | table_select0: 1 0xb.1-0xb.5 (0.5)
0x00| 04 00 | .. | table_select1: 0 0xb.6-0xc.2 (0.5)
0x00| 00 | . | subblock_gain0: 0 0xc.3-0xc.5 (0.3)
0x00| 00 0a | .. | subblock_gain1: 0 0xc.6-0xd (0.3)
0x00| 0a | . | subblock_gain2: 0 0xd.1-0xd.3 (0.3)
0x00| 0a | . | preflag: 1 0xd.4-0xd.4 (0.1)
0x00| 0a | . | scalefac_scale: 0 0xd.5-0xd.5 (0.1)
0x00| 0a | . | count1table_select: 1 0xd.6-0xd.6 (0.1)
| | | [1]{}: channel 0xd.7-0x15.1 (7.3)
0x00| 0a 00 00| ...| part2_3_length: 0 0xd.7-0xf.2 (1.4)
0x00| 00| .| big_values: 0 0xf.3-0x10.3 (1.1)
0x10|0d |. |
0x10|0d 20 |. | global_gain: 210 0x10.4-0x11.3 (1)
0x10| 20 | | scalefac_compress: 0 0x11.4-0x11.7 (0.4)
0x10| a0 | . | blocksplit_flag: 1 0x12-0x12 (0.1)
0x10| a0 | . | block_type: "start block" (1) 0x12.1-0x12.2 (0.2)
0x10| a0 | . | switch_point: 0 0x12.3-0x12.3 (0.1)
0x10| a0 00 | .. | table_select0: 0 0x12.4-0x13 (0.5)
0x10| 00 | . | table_select1: 0 0x13.1-0x13.5 (0.5)
0x10| 00 01 | .. | subblock_gain0: 0 0x13.6-0x14 (0.3)
0x10| 01 | . | subblock_gain1: 0 0x14.1-0x14.3 (0.3)
0x10| 01 | . | subblock_gain2: 0 0x14.4-0x14.6 (0.3)
0x10| 01 | . | preflag: 1 0x14.7-0x14.7 (0.1)
0x10| 03 | . | scalefac_scale: 0 0x15-0x15 (0.1)
0x10| 03 | . | count1table_select: 0 0x15.1-0x15.1 (0.1)
| | | [1][0:2]: granule 0x15.2-0x23.7 (14.6)
| | | [0]{}: channel 0x15.2-0x1c.4 (7.3)
0x10| 03 b4 | .. | part2_3_length: 237 0x15.2-0x16.5 (1.4)
0x10| b4 3f | .? | big_values: 31 0x16.6-0x17.6 (1.1)
0x10| 3f 52 | ?R | global_gain: 169 0x17.7-0x18.6 (1)
0x10| 52 19 | R. | scalefac_compress: 0 0x18.7-0x19.2 (0.4)
0x10| 19 | . | blocksplit_flag: 1 0x19.3-0x19.3 (0.1)
0x10| 19 | . | block_type: "3 short windows" (2) 0x19.4-0x19.5 (0.2)
0x10| 19 | . | switch_point: 0 0x19.6-0x19.6 (0.1)
0x10| 19 92 | .. | table_select0: 25 0x19.7-0x1a.3 (0.5)
0x10| 92 80 | .. | table_select1: 5 0x1a.4-0x1b (0.5)
0x10| 80 | . | subblock_gain0: 0 0x1b.1-0x1b.3 (0.3)
0x10| 80 | . | subblock_gain1: 0 0x1b.4-0x1b.6 (0.3)
0x10| 80 00 | .. | subblock_gain2: 0 0x1b.7-0x1c.1 (0.3)
0x10| 00 | . | preflag: 0 0x1c.2-0x1c.2 (0.1)
0x10| 00 | . | scalefac_scale: 0 0x1c.3-0x1c.3 (0.1)
0x10| 00 | . | count1table_select: 0 0x1c.4-0x1c.4 (0.1)
| | | [1]{}: channel 0x1c.5-0x23.7 (7.3)
0x10| 00 00 00 | ... | part2_3_length: 0 0x1c.5-0x1e (1.4)
0x10| 00 34| .4| big_values: 0 0x1e.1-0x1f.1 (1.1)
0x10| 34| 4| global_gain: 210 0x1f.2-0x20.1 (1)
0x20|83 |. |
0x20|83 |. | scalefac_compress: 0 0x20.2-0x20.5 (0.4)
0x20|83 |. | blocksplit_flag: 1 0x20.6-0x20.6 (0.1)
0x20|83 00 |.. | block_type: "3 short windows" (2) 0x20.7-0x21 (0.2)
0x20| 00 | . | switch_point: 0 0x21.1-0x21.1 (0.1)
0x20| 00 | . | table_select0: 0 0x21.2-0x21.6 (0.5)
0x20| 00 00 | .. | table_select1: 0 0x21.7-0x22.3 (0.5)
0x20| 00 | . | subblock_gain0: 0 0x22.4-0x22.6 (0.3)
0x20| 00 00 | .. | subblock_gain1: 0 0x22.7-0x23.1 (0.3)
0x20| 00 | . | subblock_gain2: 0 0x23.2-0x23.4 (0.3)
0x20| 00 | . | preflag: 0 0x23.5-0x23.5 (0.1)
0x20| 00 | . | scalefac_scale: 0 0x23.6-0x23.6 (0.1)
0x20| 00 | . | count1table_select: 0 0x23.7-0x23.7 (0.1)
0x20| 00 00 d8 fc 0c 7e 00 02 3e 3b ff 5c| .....~..>;.\| audio_data: raw bits 0x24-0x5f.7 (60)
0x30|10 be 8c 39 9f 53 16 f5 76 6a 2a 2d 2c d1 11 bd|...9.S..vj*-,...|
* |until 0x5f.7 (end) (60) | |
| | | crc_calculated: "d083" (raw bits) 0x60-NA (0)

Binary file not shown.

View File

@ -0,0 +1,53 @@
$ fq -d mp3_frame dv mp3-frame-8000br-2ch-8000hz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3-frame-8000br-2ch-8000hz (mp3_frame) 0x0-0x47.7 (72)
| | | header{}: 0x0-0x3.7 (4)
0x00|ff e3 |.. | sync: 0b11111111111 (valid) 0x0-0x1.2 (1.3)
0x00| e3 | . | mpeg_version: "2.5" (0) (MPEG Version 2.5) 0x1.3-0x1.4 (0.2)
0x00| e3 | . | layer: 3 (1) (MPEG Layer 3) 0x1.5-0x1.6 (0.2)
| | | sample_count: 576 0x1.7-NA (0)
0x00| e3 | . | protection_absent: true (No CRC) 0x1.7-0x1.7 (0.1)
0x00| 18 | . | bitrate: 8000 (1) 0x2-0x2.3 (0.4)
0x00| 18 | . | sample_rate: 8000 (2) 0x2.4-0x2.5 (0.2)
0x00| 18 | . | padding: "not_padded" (0b0) 0x2.6-0x2.6 (0.1)
0x00| 18 | . | private: 0 0x2.7-0x2.7 (0.1)
0x00| 64 | d | channels: "joint_stereo" (0b1) 0x3-0x3.1 (0.2)
0x00| 64 | d | channel_mode: "ms_stereo" (0b10) 0x3.2-0x3.3 (0.2)
0x00| 64 | d | copyright: 0 0x3.4-0x3.4 (0.1)
0x00| 64 | d | original: 1 0x3.5-0x3.5 (0.1)
0x00| 64 | d | emphasis: "none" (0b0) 0x3.6-0x3.7 (0.2)
| | | side_info{}: 0x4-0x14.7 (17)
0x00| 00 | . | main_data_begin: 0 0x4-0x4.7 (1)
0x00| 03 | . | private_bits: 0 0x5-0x5.1 (0.2)
| | | granules[0:1]: 0x5.2-0x14.7 (15.6)
| | | [0][0:2]: granule 0x5.2-0x14.7 (15.6)
| | | [0]{}: channel 0x5.2-0xd (7.7)
0x00| 03 ac | .. | part2_3_length: 235 0x5.2-0x6.5 (1.4)
0x00| ac 01 | .. | big_values: 0 0x6.6-0x7.6 (1.1)
0x00| 01 79 | .y | global_gain: 188 0x7.7-0x8.6 (1)
0x00| 79 2c | y, | scalefac_compress: 300 0x8.7-0x9.7 (1.1)
0x00| 04 | . | blocksplit_flag: 0 0xa-0xa (0.1)
0x00| 04 | . | table_select0: 1 0xa.1-0xa.5 (0.5)
0x00| 04 22 | ." | table_select1: 1 0xa.6-0xb.2 (0.5)
0x00| 22 | " | table_select2: 2 0xb.3-0xb.7 (0.5)
0x00| 01 | . | region_address1: 0 0xc-0xc.3 (0.4)
0x00| 01 | . | region_address2: 0 0xc.4-0xc.6 (0.3)
0x00| 01 | . | scalefac_scale: 1 0xc.7-0xc.7 (0.1)
0x00| 00 | . | count1table_select: 0 0xd-0xd (0.1)
| | | [1]{}: channel 0xd.1-0x14.7 (7.7)
0x00| 00 00 | .. | part2_3_length: 0 0xd.1-0xe.4 (1.4)
0x00| 00 03| ..| big_values: 0 0xe.5-0xf.5 (1.1)
0x00| 03| .| global_gain: 210 0xf.6-0x10.5 (1)
0x10|48 |H |
0x10|48 00 |H. | scalefac_compress: 0 0x10.6-0x11.6 (1.1)
0x10| 00 | . | blocksplit_flag: 0 0x11.7-0x11.7 (0.1)
0x10| 00 | . | table_select0: 0 0x12-0x12.4 (0.5)
0x10| 00 00 | .. | table_select1: 0 0x12.5-0x13.1 (0.5)
0x10| 00 | . | table_select2: 0 0x13.2-0x13.6 (0.5)
0x10| 00 00 | .. | region_address1: 0 0x13.7-0x14.2 (0.4)
0x10| 00 | . | region_address2: 0 0x14.3-0x14.5 (0.3)
0x10| 00 | . | scalefac_scale: 0 0x14.6-0x14.6 (0.1)
0x10| 00 | . | count1table_select: 0 0x14.7-0x14.7 (0.1)
0x10| 92 34 1c a3 60 00 3f 13 87 ea 04| .4..`.?....| audio_data: raw bits 0x15-0x47.7 (51)
0x20|1d 59 fc a7 a6 18 d6 fc 10 ff f7 97 88 27 16 7f|.Y...........'..|
* |until 0x47.7 (end) (51) | |
| | | crc_calculated: "5197" (raw bits) 0x48-NA (0)

Binary file not shown.

View File

@ -1,5 +1,61 @@
# ffmpeg -f lavfi -i sine -t 10ms -f wav pipe:1 | lame - - | fq - '.frame[1] | tobits' > mp3-frame-mono-crc
$ fq -d mp3_frame '.header.crc | verbose' mp3-frame-mono-crc
exitcode: 3
stderr:
error: arg: function not defined: verbose/0
$ fq -d mp3_frame dv mp3-frame-mono-crc
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3-frame-mono-crc (mp3_frame) 0x0-0xd0.7 (209)
| | | header{}: 0x0-0x5.7 (6)
0x00|ff fa |.. | sync: 0b11111111111 (valid) 0x0-0x1.2 (1.3)
0x00| fa | . | mpeg_version: "1" (3) (MPEG Version 1) 0x1.3-0x1.4 (0.2)
0x00| fa | . | layer: 3 (1) (MPEG Layer 3) 0x1.5-0x1.6 (0.2)
| | | sample_count: 1152 0x1.7-NA (0)
0x00| fa | . | protection_absent: false (Has CRC) 0x1.7-0x1.7 (0.1)
0x00| 52 | R | bitrate: 64000 (5) 0x2-0x2.3 (0.4)
0x00| 52 | R | sample_rate: 44100 (0) 0x2.4-0x2.5 (0.2)
0x00| 52 | R | padding: "padded" (0b1) 0x2.6-0x2.6 (0.1)
0x00| 52 | R | private: 0 0x2.7-0x2.7 (0.1)
0x00| c4 | . | channels: "mono" (0b11) 0x3-0x3.1 (0.2)
0x00| c4 | . | channel_mode: "none" (0b0) 0x3.2-0x3.3 (0.2)
0x00| c4 | . | copyright: 0 0x3.4-0x3.4 (0.1)
0x00| c4 | . | original: 1 0x3.5-0x3.5 (0.1)
0x00| c4 | . | emphasis: "none" (0b0) 0x3.6-0x3.7 (0.2)
0x00| 2c b9 | ,. | crc: 0x2cb9 (valid) 0x4-0x5.7 (2)
| | | side_info{}: 0x6-0x16.7 (17)
0x00| 07 83 | .. | main_data_begin: 15 0x6-0x7 (1.1)
0x00| 83 | . | share: 0 0x7.1-0x7.5 (0.5)
0x00| 83 c9 | .. | scfsi0: 15 0x7.6-0x8.1 (0.4)
| | | granules[0:2]: 0x8.2-0x16.7 (14.6)
| | | [0][0:1]: granule 0x8.2-0xf.4 (7.3)
| | | [0]{}: channel 0x8.2-0xf.4 (7.3)
0x00| c9 14 | .. | part2_3_length: 581 0x8.2-0x9.5 (1.4)
0x00| 14 39 | .9 | big_values: 28 0x9.6-0xa.6 (1.1)
0x00| 39 29 | 9) | global_gain: 148 0xa.7-0xb.6 (1)
0x00| 29 3c | )< | scalefac_compress: 9 0xb.7-0xc.2 (0.4)
0x00| 3c | < | blocksplit_flag: 1 0xc.3-0xc.3 (0.1)
0x00| 3c | < | block_type: "end" (3) 0xc.4-0xc.5 (0.2)
0x00| 3c | < | switch_point: 0 0xc.6-0xc.6 (0.1)
0x00| 3c c3 | <. | table_select0: 12 0xc.7-0xd.3 (0.5)
0x00| c3 00 | .. | table_select1: 6 0xd.4-0xe (0.5)
0x00| 00 | . | subblock_gain0: 0 0xe.1-0xe.3 (0.3)
0x00| 00 | . | subblock_gain1: 0 0xe.4-0xe.6 (0.3)
0x00| 00 00| ..| subblock_gain2: 0 0xe.7-0xf.1 (0.3)
0x00| 00| .| preflag: 0 0xf.2-0xf.2 (0.1)
0x00| 00| .| scalefac_scale: 0 0xf.3-0xf.3 (0.1)
0x00| 00| .| count1table_select: 0 0xf.4-0xf.4 (0.1)
| | | [1][0:1]: granule 0xf.5-0x16.7 (7.3)
| | | [0]{}: channel 0xf.5-0x16.7 (7.3)
0x00| 00| .| part2_3_length: 0 0xf.5-0x11 (1.4)
0x10|00 00 |.. |
0x10| 00 34 | .4 | big_values: 0 0x11.1-0x12.1 (1.1)
0x10| 34 80 | 4. | global_gain: 210 0x12.2-0x13.1 (1)
0x10| 80 | . | scalefac_compress: 0 0x13.2-0x13.5 (0.4)
0x10| 80 | . | blocksplit_flag: 0 0x13.6-0x13.6 (0.1)
0x10| 80 00 | .. | table_select0: 0 0x13.7-0x14.3 (0.5)
0x10| 00 00 | .. | table_select1: 0 0x14.4-0x15 (0.5)
0x10| 00 | . | table_select2: 0 0x15.1-0x15.5 (0.5)
0x10| 00 04 | .. | region_address1: 0 0x15.6-0x16.1 (0.4)
0x10| 04 | . | region_address2: 0 0x16.2-0x16.4 (0.3)
0x10| 04 | . | preflag: 1 0x16.5-0x16.5 (0.1)
0x10| 04 | . | scalefac_scale: 0 0x16.6-0x16.6 (0.1)
0x10| 04 | . | count1table_select: 0 0x16.7-0x16.7 (0.1)
0x10| 58 c9 20 d4 29 52 98 c8 c8| X. .)R...| audio_data: raw bits 0x17-0xd0.7 (186)
0x20|f9 13 80 40 24 bc 91 23 42 50 56 0d 18 11 03 41|...@$..#BPV....A|
* |until 0xd0.7 (end) (186) | |
| | | crc_calculated: "2cb9" (raw bits) 0xd1-NA (0)

15
format/mpeg/testdata/mp3-frame.sh vendored Normal file
View File

@ -0,0 +1,15 @@
#!/bin/sh
# 8 16 24 32 40 48 56 64 80 96 112 128 144 160 256 320
for br in 8000 128000 320000; do
for ch in 1 2; do
# 48000 44100 32000 22050 24000 16000 11025 12000 8000
for hz in 48000 44100 8000; do
f="mp3-frame-${br}br-${ch}ch-${hz}hz"
ffmpeg -y -f lavfi -i sine -ar $hz -b:a $br -ac $ch -t 10ms -id3v2_version 0 -write_xing 0 -f mp3 $f.temp
fq -d raw 'tobytes[0:nth(1;match([0xff,0xe3],[0xff,0xfb]; "g")).offset // .size]' $f.temp >$f
rm $f.temp
echo "\$ fq -d mp3_frame dv $f" >$f.fqtest
done
done
done

View File

@ -35,7 +35,7 @@ $ fq -d mp3 '.frames[]._bits[0:12] | tonumber' test.mp3
4095
$ fq -d mp3 '.headers[0].magic._bits[0:24] | tostring' test.mp3
"ID3"
$ fq -d mp3 '.frames[0].padding | ("", "md5", "base64", "snippet") as $f | tovalue({bits_format: $f})' test.mp3
$ fq -d mp3 '.frames[0].audio_data | ("", "md5", "base64", "snippet") as $f | tovalue({bits_format: $f})' test.mp3
"<5>AAAAAAA="
"ca9c491ac66b2c62500882e93f3719a8"
"AAAAAAA="
@ -236,7 +236,7 @@ mp3> .frames[1] | tobytesrange | ., .start, .stop, .size, .[4:17], (tobits, toby
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0xe0| 00 00 0a 2c 43 2e 55 94 80| ...,C.U..|.: raw bits 0xe7-0xf3.7 (13)
0xf0|01 80 93 6b |...k |
mp3> .frames[1].data | tobytes | match([0x33, 0x85]), first(scan([0x33, 0x85]) | tohex), first(splits([0x33, 0x85]) | tohex)
mp3> .frames[1].audio_data | tobytes | match([0x33, 0x85]), first(scan([0x33, 0x85]) | tohex), first(splits([0x33, 0x85]) | tohex)
{
"captures": [],
"length": 2,

View File

@ -59,7 +59,7 @@ mp3> .frames[0] | dv({depth: 1, addrbase: 10})
064|00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15|0123456789012345| xing{}: (xing) 66-221.7 (156)
080|02 57 00 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6|.W..............|
* |until 221.7 (156) | |
208| 00 00| ..| padding: raw bits 222-226.7 (5)
208| 00 00| ..| audio_data: raw bits 222-226.7 (5)
224|00 00 00 |... |
| | | crc_calculated: "827a" (raw bits) 227-NA (0)
mp3> .frames[0] | dv({depth: 1, sizebase: 16})
@ -71,7 +71,7 @@ mp3> .frames[0] | dv({depth: 1, sizebase: 16})
0x40|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| xing{}: (xing) 0x42-0xdd.7 (0x9c)
0x50|02 57 00 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6|.W..............|
* |until 0xdd.7 (0x9c) | |
0xd0| 00 00| ..| padding: raw bits 0xde-0xe2.7 (0x5)
0xd0| 00 00| ..| audio_data: raw bits 0xde-0xe2.7 (0x5)
0xe0|00 00 00 |... |
| | | crc_calculated: "827a" (raw bits) 0xe3-NA (0x0)
mp3> .frames[0].xing | "d", d, "da", da, "dd", dd, "dv", dv, "ddv", ddv

View File

@ -34,8 +34,7 @@ $ fq -d mp3 '{(.headers[0].magic): 123}' test.mp3
}
$ fq -d mp3 '.frames | group_by(.side_info | {b: .main_data_end}) | map(length)' test.mp3
[
2,
1
3
]
$ fq -d mp3 '.frames | map(.header) | group_by(.bitrate)' test.mp3
[
@ -193,6 +192,7 @@ $ fq -d mp3 '.frames | map(.header) | max_by(.bitrate)' test.mp3
0x1b0| c4 | . | emphasis: "none" (0b0)
$ fq -d mp3 '.frames[0] | . + .header | keys, .bitrate' test.mp3
[
"audio_data",
"bitrate",
"channel_mode",
"channels",
@ -216,6 +216,7 @@ $ fq -d mp3 '.frames[0] | . + .header | keys, .bitrate' test.mp3
0x20| 40| @|.frames[0].header.bitrate: 56000 (4)
$ fq -d mp3 '[.frames[0] | ., .header] | add | keys, .bitrate' test.mp3
[
"audio_data",
"bitrate",
"channel_mode",
"channels",
@ -243,14 +244,14 @@ $ fq -d mp3 '.frames[0] | keys' test.mp3
"header",
"side_info",
"xing",
"padding",
"audio_data",
"crc_calculated"
]
$ fq -d mp3 '.frames[0] | to_entries[].key' test.mp3
"header"
"side_info"
"xing"
"padding"
"audio_data"
"crc_calculated"
# xml, csv does string normalization, make sure it works with nested JQValue:s
# TODO: move this test as it depends on xml

View File

@ -7,9 +7,9 @@ mp3> grep(44100, "ID", "^ID3$", "^ID.?$", "Info", "magic", "\u00ff", [0x49, 0x44
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x1b0| 52 | R |.frames[2].header.sample_rate: 44100 (0)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x1c0| 11 4b 36 4a 08 83 58 c9| .K6J..X.|.frames[2].data: raw bits
0x1c0| 11 4b 36 4a 08 83 58 c9| .K6J..X.|.frames[2].audio_data: raw bits
0x1d0|20 d4 29 52 98 c8 c8 f9 13 80 40 24 bc 91 23 42| .)R......@$..#B|
* |until 0x279.7 (178) | |
* |until 0x283.7 (end) (188) | |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x0|49 44 33 |ID3 |.headers[0].magic: "ID3" (valid)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
@ -40,9 +40,9 @@ mp3> fgrep(44100, "ID", "^ID3$", "^ID.?$", "Info", "magic", "\u00ff", [0x49, 0x4
0x0|49 44 33 |ID3 |.headers[0].magic: "ID3" (valid)
mp3> bgrep(44100, "ID", "^ID3$", "^ID.?$", "Info", "magic", "\u00ff", [0x49, 0x44])
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x1c0| 11 4b 36 4a 08 83 58 c9| .K6J..X.|.frames[2].data: raw bits
0x1c0| 11 4b 36 4a 08 83 58 c9| .K6J..X.|.frames[2].audio_data: raw bits
0x1d0|20 d4 29 52 98 c8 c8 f9 13 80 40 24 bc 91 23 42| .)R......@$..#B|
* |until 0x279.7 (178) | |
* |until 0x283.7 (end) (188) | |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x0|49 44 33 |ID3 |.headers[0].magic: "ID3" (valid)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|

View File

@ -1,5 +1,5 @@
$ fq -i -d mp3 . test.mp3
mp3> .frames[1].data | tobytes | match("3\u0085"; "b")
mp3> .frames[1].audio_data | tobytes | match("3\u0085"; "b")
{
"captures": [],
"length": 2,

View File

@ -96,7 +96,7 @@ mp3> $f[]
0x40|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| xing{}: (xing)
0x50|02 57 00 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6|.W..............|
* |until 0xdd.7 (156) | |
0xd0| 00 00| ..| padding: raw bits
0xd0| 00 00| ..| audio_data: raw bits
0xe0|00 00 00 |... |
| | | crc_calculated: "827a" (raw bits)
mp3> ^D

View File

@ -190,6 +190,7 @@ mp3> .headers[0] = 1
"footers": [],
"frames": [
{
"audio_data": "<5>AAAAAAA=",
"crc_calculated": "827a",
"header": {
"bitrate": 56000,
@ -207,7 +208,6 @@ mp3> .headers[0] = 1
"sample_rate": 44100,
"sync": 2047
},
"padding": "<5>AAAAAAA=",
"side_info": {
"granules": [
[
@ -245,9 +245,9 @@ mp3> .headers[0] = 1
}
]
],
"main_data_end": 0,
"private_bits": 0,
"share0": 0
"main_data_begin": 0,
"scfsi0": 0,
"share": 0
},
"xing": {
"bytes": 599,
@ -386,8 +386,8 @@ mp3> .headers[0] = 1
}
},
{
"audio_data": "<187>B6rDjjOF02TxocEIHFgfXh8YHEYEHonlsy5aD6g7E2vw+GBQFAQDAoJEDE5o0aNsH3iAEAQxOD/BB050+c5fznL+7p93Lg+D4Ph8EAxKAMH9IAH///555554T7EPKQdc5TdRYNYihmqWGn6jVTNuL+Em0eAKJCYbPQRwVHtKrRk2Hogmi3/vFJwLDWJ//++4IUY5R/oJnyoaCgV9HgUESINnfuTyoCETQkEv/+OQSYPWtQkEQMCZSqCIEQ==",
"crc_calculated": "e5b0",
"data": "<187>B6rDjjOF02TxocEIHFgfXh8YHEYEHonlsy5aD6g7E2vw+GBQFAQDAoJEDE5o0aNsH3iAEAQxOD/BB050+c5fznL+7p93Lg+D4Ph8EAxKAMH9IAH///555554T7EPKQdc5TdRYNYihmqWGn6jVTNuL+Em0eAKJCYbPQRwVHtKrRk2Hogmi3/vFJwLDWJ//++4IUY5R/oJnyoaCgV9HgUESINnfuTyoCETQkEv/+OQSYPWtQkEQMCZSqCIEQ==",
"header": {
"bitrate": 64000,
"channel_mode": "none",
@ -404,7 +404,6 @@ mp3> .headers[0] = 1
"sample_rate": 44100,
"sync": 2047
},
"other_data": "<0>",
"side_info": {
"granules": [
[
@ -446,14 +445,14 @@ mp3> .headers[0] = 1
}
]
],
"main_data_end": 0,
"private_bits": 0,
"share0": 0
"main_data_begin": 0,
"scfsi0": 0,
"share": 0
}
},
{
"audio_data": "<188>EUs2SgiDWMkg1ClSmMjI+ROAQCS8kSNCUFYNGBEDQd6wVWCsRHiwdgr6P4lOlXKBqDUqdWdiL/BXlj3Ev//xEkxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo=",
"crc_calculated": "61fd",
"data": "<178>EUs2SgiDWMkg1ClSmMjI+ROAQCS8kSNCUFYNGBEDQd6wVWCsRHiwdgr6P4lOlXKBqDUqdWdiL/BXlj3Ev//xEkxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqg==",
"header": {
"bitrate": 64000,
"channel_mode": "none",
@ -470,8 +469,6 @@ mp3> .headers[0] = 1
"sample_rate": 44100,
"sync": 2047
},
"other_data": "<9>qqqqqqqqqqqq",
"padding_byte": "<1>qg==",
"side_info": {
"granules": [
[
@ -511,9 +508,9 @@ mp3> .headers[0] = 1
}
]
],
"main_data_end": 9,
"private_bits": 0,
"share0": 15
"main_data_begin": 9,
"scfsi0": 15,
"share": 0
}
}
],
@ -528,6 +525,7 @@ mp3> .headers[0] |= empty
"footers": [],
"frames": [
{
"audio_data": "<5>AAAAAAA=",
"crc_calculated": "827a",
"header": {
"bitrate": 56000,
@ -545,7 +543,6 @@ mp3> .headers[0] |= empty
"sample_rate": 44100,
"sync": 2047
},
"padding": "<5>AAAAAAA=",
"side_info": {
"granules": [
[
@ -583,9 +580,9 @@ mp3> .headers[0] |= empty
}
]
],
"main_data_end": 0,
"private_bits": 0,
"share0": 0
"main_data_begin": 0,
"scfsi0": 0,
"share": 0
},
"xing": {
"bytes": 599,
@ -724,8 +721,8 @@ mp3> .headers[0] |= empty
}
},
{
"audio_data": "<187>B6rDjjOF02TxocEIHFgfXh8YHEYEHonlsy5aD6g7E2vw+GBQFAQDAoJEDE5o0aNsH3iAEAQxOD/BB050+c5fznL+7p93Lg+D4Ph8EAxKAMH9IAH///555554T7EPKQdc5TdRYNYihmqWGn6jVTNuL+Em0eAKJCYbPQRwVHtKrRk2Hogmi3/vFJwLDWJ//++4IUY5R/oJnyoaCgV9HgUESINnfuTyoCETQkEv/+OQSYPWtQkEQMCZSqCIEQ==",
"crc_calculated": "e5b0",
"data": "<187>B6rDjjOF02TxocEIHFgfXh8YHEYEHonlsy5aD6g7E2vw+GBQFAQDAoJEDE5o0aNsH3iAEAQxOD/BB050+c5fznL+7p93Lg+D4Ph8EAxKAMH9IAH///555554T7EPKQdc5TdRYNYihmqWGn6jVTNuL+Em0eAKJCYbPQRwVHtKrRk2Hogmi3/vFJwLDWJ//++4IUY5R/oJnyoaCgV9HgUESINnfuTyoCETQkEv/+OQSYPWtQkEQMCZSqCIEQ==",
"header": {
"bitrate": 64000,
"channel_mode": "none",
@ -742,7 +739,6 @@ mp3> .headers[0] |= empty
"sample_rate": 44100,
"sync": 2047
},
"other_data": "<0>",
"side_info": {
"granules": [
[
@ -784,14 +780,14 @@ mp3> .headers[0] |= empty
}
]
],
"main_data_end": 0,
"private_bits": 0,
"share0": 0
"main_data_begin": 0,
"scfsi0": 0,
"share": 0
}
},
{
"audio_data": "<188>EUs2SgiDWMkg1ClSmMjI+ROAQCS8kSNCUFYNGBEDQd6wVWCsRHiwdgr6P4lOlXKBqDUqdWdiL/BXlj3Ev//xEkxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo=",
"crc_calculated": "61fd",
"data": "<178>EUs2SgiDWMkg1ClSmMjI+ROAQCS8kSNCUFYNGBEDQd6wVWCsRHiwdgr6P4lOlXKBqDUqdWdiL/BXlj3Ev//xEkxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqg==",
"header": {
"bitrate": 64000,
"channel_mode": "none",
@ -808,8 +804,6 @@ mp3> .headers[0] |= empty
"sample_rate": 44100,
"sync": 2047
},
"other_data": "<9>qqqqqqqqqqqq",
"padding_byte": "<1>qg==",
"side_info": {
"granules": [
[
@ -849,9 +843,9 @@ mp3> .headers[0] |= empty
}
]
],
"main_data_end": 9,
"private_bits": 0,
"share0": 15
"main_data_begin": 9,
"scfsi0": 15,
"share": 0
}
}
],

View File

@ -109,6 +109,7 @@ mp3> .headers[0].flags.a = 1
"footers": [],
"frames": [
{
"audio_data": "<5>AAAAAAA=",
"crc_calculated": "827a",
"header": {
"bitrate": 56000,
@ -126,7 +127,6 @@ mp3> .headers[0].flags.a = 1
"sample_rate": 44100,
"sync": 2047
},
"padding": "<5>AAAAAAA=",
"side_info": {
"granules": [
[
@ -164,9 +164,9 @@ mp3> .headers[0].flags.a = 1
}
]
],
"main_data_end": 0,
"private_bits": 0,
"share0": 0
"main_data_begin": 0,
"scfsi0": 0,
"share": 0
},
"xing": {
"bytes": 599,
@ -305,8 +305,8 @@ mp3> .headers[0].flags.a = 1
}
},
{
"audio_data": "<187>B6rDjjOF02TxocEIHFgfXh8YHEYEHonlsy5aD6g7E2vw+GBQFAQDAoJEDE5o0aNsH3iAEAQxOD/BB050+c5fznL+7p93Lg+D4Ph8EAxKAMH9IAH///555554T7EPKQdc5TdRYNYihmqWGn6jVTNuL+Em0eAKJCYbPQRwVHtKrRk2Hogmi3/vFJwLDWJ//++4IUY5R/oJnyoaCgV9HgUESINnfuTyoCETQkEv/+OQSYPWtQkEQMCZSqCIEQ==",
"crc_calculated": "e5b0",
"data": "<187>B6rDjjOF02TxocEIHFgfXh8YHEYEHonlsy5aD6g7E2vw+GBQFAQDAoJEDE5o0aNsH3iAEAQxOD/BB050+c5fznL+7p93Lg+D4Ph8EAxKAMH9IAH///555554T7EPKQdc5TdRYNYihmqWGn6jVTNuL+Em0eAKJCYbPQRwVHtKrRk2Hogmi3/vFJwLDWJ//++4IUY5R/oJnyoaCgV9HgUESINnfuTyoCETQkEv/+OQSYPWtQkEQMCZSqCIEQ==",
"header": {
"bitrate": 64000,
"channel_mode": "none",
@ -323,7 +323,6 @@ mp3> .headers[0].flags.a = 1
"sample_rate": 44100,
"sync": 2047
},
"other_data": "<0>",
"side_info": {
"granules": [
[
@ -365,14 +364,14 @@ mp3> .headers[0].flags.a = 1
}
]
],
"main_data_end": 0,
"private_bits": 0,
"share0": 0
"main_data_begin": 0,
"scfsi0": 0,
"share": 0
}
},
{
"audio_data": "<188>EUs2SgiDWMkg1ClSmMjI+ROAQCS8kSNCUFYNGBEDQd6wVWCsRHiwdgr6P4lOlXKBqDUqdWdiL/BXlj3Ev//xEkxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo=",
"crc_calculated": "61fd",
"data": "<178>EUs2SgiDWMkg1ClSmMjI+ROAQCS8kSNCUFYNGBEDQd6wVWCsRHiwdgr6P4lOlXKBqDUqdWdiL/BXlj3Ev//xEkxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqg==",
"header": {
"bitrate": 64000,
"channel_mode": "none",
@ -389,8 +388,6 @@ mp3> .headers[0].flags.a = 1
"sample_rate": 44100,
"sync": 2047
},
"other_data": "<9>qqqqqqqqqqqq",
"padding_byte": "<1>qg==",
"side_info": {
"granules": [
[
@ -430,9 +427,9 @@ mp3> .headers[0].flags.a = 1
}
]
],
"main_data_end": 9,
"private_bits": 0,
"share0": 15
"main_data_begin": 9,
"scfsi0": 15,
"share": 0
}
}
],
@ -481,6 +478,7 @@ mp3> .headers[0].flags.a |= empty
"footers": [],
"frames": [
{
"audio_data": "<5>AAAAAAA=",
"crc_calculated": "827a",
"header": {
"bitrate": 56000,
@ -498,7 +496,6 @@ mp3> .headers[0].flags.a |= empty
"sample_rate": 44100,
"sync": 2047
},
"padding": "<5>AAAAAAA=",
"side_info": {
"granules": [
[
@ -536,9 +533,9 @@ mp3> .headers[0].flags.a |= empty
}
]
],
"main_data_end": 0,
"private_bits": 0,
"share0": 0
"main_data_begin": 0,
"scfsi0": 0,
"share": 0
},
"xing": {
"bytes": 599,
@ -677,8 +674,8 @@ mp3> .headers[0].flags.a |= empty
}
},
{
"audio_data": "<187>B6rDjjOF02TxocEIHFgfXh8YHEYEHonlsy5aD6g7E2vw+GBQFAQDAoJEDE5o0aNsH3iAEAQxOD/BB050+c5fznL+7p93Lg+D4Ph8EAxKAMH9IAH///555554T7EPKQdc5TdRYNYihmqWGn6jVTNuL+Em0eAKJCYbPQRwVHtKrRk2Hogmi3/vFJwLDWJ//++4IUY5R/oJnyoaCgV9HgUESINnfuTyoCETQkEv/+OQSYPWtQkEQMCZSqCIEQ==",
"crc_calculated": "e5b0",
"data": "<187>B6rDjjOF02TxocEIHFgfXh8YHEYEHonlsy5aD6g7E2vw+GBQFAQDAoJEDE5o0aNsH3iAEAQxOD/BB050+c5fznL+7p93Lg+D4Ph8EAxKAMH9IAH///555554T7EPKQdc5TdRYNYihmqWGn6jVTNuL+Em0eAKJCYbPQRwVHtKrRk2Hogmi3/vFJwLDWJ//++4IUY5R/oJnyoaCgV9HgUESINnfuTyoCETQkEv/+OQSYPWtQkEQMCZSqCIEQ==",
"header": {
"bitrate": 64000,
"channel_mode": "none",
@ -695,7 +692,6 @@ mp3> .headers[0].flags.a |= empty
"sample_rate": 44100,
"sync": 2047
},
"other_data": "<0>",
"side_info": {
"granules": [
[
@ -737,14 +733,14 @@ mp3> .headers[0].flags.a |= empty
}
]
],
"main_data_end": 0,
"private_bits": 0,
"share0": 0
"main_data_begin": 0,
"scfsi0": 0,
"share": 0
}
},
{
"audio_data": "<188>EUs2SgiDWMkg1ClSmMjI+ROAQCS8kSNCUFYNGBEDQd6wVWCsRHiwdgr6P4lOlXKBqDUqdWdiL/BXlj3Ev//xEkxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo=",
"crc_calculated": "61fd",
"data": "<178>EUs2SgiDWMkg1ClSmMjI+ROAQCS8kSNCUFYNGBEDQd6wVWCsRHiwdgr6P4lOlXKBqDUqdWdiL/BXlj3Ev//xEkxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqg==",
"header": {
"bitrate": 64000,
"channel_mode": "none",
@ -761,8 +757,6 @@ mp3> .headers[0].flags.a |= empty
"sample_rate": 44100,
"sync": 2047
},
"other_data": "<9>qqqqqqqqqqqq",
"padding_byte": "<1>qg==",
"side_info": {
"granules": [
[
@ -802,9 +796,9 @@ mp3> .headers[0].flags.a |= empty
}
]
],
"main_data_end": 9,
"private_bits": 0,
"share0": 15
"main_data_begin": 9,
"scfsi0": 15,
"share": 0
}
}
],