mirror of
https://github.com/wader/fq.git
synced 2024-12-18 02:41:44 +03:00
cf15661e9c
Some mpeg versions use LSF (low sampling frequency) when encoding low sample rates which changes a bit how the side info is layed out. Also skip trying to separate data and other_data as after reading up a bit on how main data begin and bit reservoir works i think it was done incorrectly. To know the real audio data length i think you need to decode the huffman tables. Instead just have a "audio_data" field which are the bits with audo data for current and possibly following frames.
96 lines
11 KiB
Plaintext
96 lines
11 KiB
Plaintext
$ 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)
|