BCWAV: Difference between revisions
No edit summary |
Steveice10 (talk | contribs) No edit summary |
||
Line 24: | Line 24: | ||
| 0x000 || 4 || Magic (CWAV) | | 0x000 || 4 || Magic (CWAV) | ||
|- | |- | ||
| 0x004 || 2 || | | 0x004 || 2 || Endianness (0xFEFF = little, 0xFFFE = big) | ||
|- | |- | ||
| 0x006 || 2 || | | 0x006 || 2 || Header Size (0x40) | ||
|- | |- | ||
| 0x008 || 4 || | | 0x008 || 4 || Version (0x02010000) | ||
|- | |- | ||
| 0x00C || 4 || File | | 0x00C || 4 || File Size | ||
|- | |- | ||
| 0x010 || | | 0x010 || 2 || Number of Blocks (2) | ||
|- | |- | ||
| | | 0x012 || 2 || Reserved | ||
|- | |- | ||
| | | 0x014 || 12 || [[BCWAV#Info Block|Info Block]] [[BCWAV#Sized Reference|Sized Reference]] (Offset relative to start of file) | ||
|- | |- | ||
| | | 0x020 || 12 || [[BCWAV#Data Block|Data Block]] [[BCWAV#Sized Reference|Sized Reference]] (Offset relative to start of file) | ||
|- | |- | ||
| | | 0x02C || 20 || Padding | ||
|} | |||
=== Block Header === | |||
{| class="wikitable" border="1" | |||
|- | |||
! OFFSET !! SIZE !! DESCRIPTION | |||
|- | |||
| 0x000 || 4 || Magic | |||
|- | |||
| 0x004 || 4 || Size | |||
|} | |||
==== Block Types ==== | |||
{| class="wikitable" border="1" | |||
|- | |- | ||
! MAGIC !! TYPE | |||
|- | |- | ||
| | | INFO || [[BCWAV#Info Block|Info Block]] | ||
|- | |- | ||
| | | DATA || [[BCWAV#Data Block|Data Block]] | ||
|} | |} | ||
=== | === Info Block === | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 55: | Line 71: | ||
! OFFSET !! SIZE !! DESCRIPTION | ! OFFSET !! SIZE !! DESCRIPTION | ||
|- | |- | ||
| 0x000 || | | 0x000 || 8 || [[BCWAV#Block Header|Block Header]] | ||
|- | |- | ||
| | | 0x008 || 1 || [[BCWAV#Encoding|Encoding]] | ||
|- | |- | ||
| | | 0x009 || 1 || Loop (0 = don't loop, 1 = loop) | ||
|- | |||
| 0x00A || 2 || Padding | |||
|- | |- | ||
| 0x00C || 4 || Sample Rate | | 0x00C || 4 || Sample Rate | ||
|- | |- | ||
| 0x010 || 4 || | | 0x010 || 4 || Loop Start Frame | ||
|- | |||
| 0x014 || 4 || Loop End Frame | |||
|- | |||
| 0x018 || 4 || Reserved | |||
|- | |||
| 0x01C || 4 + Count * 8 || [[BCWAV#Channel Info|Channel Info]] [[BCWAV#Reference Table|Reference Table]] | |||
|} | |||
=== Data Block === | |||
{| class="wikitable" border="1" | |||
|- | |||
! OFFSET !! SIZE !! DESCRIPTION | |||
|- | |||
| 0x000 || 8 || [[BCWAV#Block Header|Block Header]] | |||
|- | |||
| 0x008 || [[BCWAV#Block Header|Block Header]] Size - 8 || Data | |||
|} | |||
=== Encoding === | |||
{| class="wikitable" border="1" | |||
|- | |||
! VALUE !! DESCRIPTION | |||
|- | |||
| 0 || PCM8 | |||
|- | |||
| 1 || PCM16 | |||
|- | |||
| 2 || DSP ADPCM | |||
|- | |||
| 3 || IMA ADPCM | |||
|} | |||
=== Channel Info === | |||
{| class="wikitable" border="1" | |||
|- | |||
! OFFSET !! SIZE !! DESCRIPTION | |||
|- | |||
| 0x000 || 8 || Samples [[BCWAV#Reference|Reference]] (Offset relative to [[BCWAV#Data Block|Data Block]] Data field) | |||
|- | |||
| 0x008 || 8 || ADPCM Info [[BCWAV#Reference|Reference]] (Offset relative to [[BCWAV#Channel Info|Channel Info]] start) | |||
|- | |||
| 0x010 || 4 || Reserved | |||
|} | |||
=== DSP ADPCM Info === | |||
{| class="wikitable" border="1" | |||
|- | |||
! OFFSET !! SIZE !! DESCRIPTION | |||
|- | |||
| 0x000 || 32 || [[BCWAV#DSP ADPCM Param|Param]] | |||
|- | |||
| 0x020 || 6 || [[BCWAV#DSP ADPCM Context|Context]] | |||
|- | |||
| 0x026 || 6 || Loop [[BCWAV#DSP ADPCM Context|Context]] | |||
|} | |||
=== DSP ADPCM Param === | |||
{| class="wikitable" border="1" | |||
|- | |||
! OFFSET !! SIZE !! DESCRIPTION | |||
|- | |- | ||
| | | 0x000 || 32 || 16-bit Coefficients | ||
|} | |||
=== DSP ADPCM Context === | |||
{| class="wikitable" border="1" | |||
|- | |- | ||
! OFFSET !! SIZE !! DESCRIPTION | |||
|- | |- | ||
| | | 0x000 || 1 || 4-bit Predictor + 4-bit Scale | ||
|- | |- | ||
| | | 0x001 || 1 || Reserved | ||
|- | |- | ||
| | | 0x002 || 2 || Previous Sample | ||
|- | |||
| 0x004 || 2 || Second Previous Sample | |||
|} | |} | ||
=== IMA ADPCM Info === | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 82: | Line 172: | ||
! OFFSET !! SIZE !! DESCRIPTION | ! OFFSET !! SIZE !! DESCRIPTION | ||
|- | |- | ||
| 0x000 || 4 || | | 0x000 || 4 || [[BCWAV#IMA ADPCM Context|Context]] | ||
|- | |- | ||
| 0x004 || 4 || | | 0x004 || 4 || Loop [[BCWAV#IMA ADPCM Context|Context]] | ||
|} | |} | ||
=== IMA ADPCM Context === | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 93: | Line 183: | ||
! OFFSET !! SIZE !! DESCRIPTION | ! OFFSET !! SIZE !! DESCRIPTION | ||
|- | |- | ||
| 0x000 || | | 0x000 || 2 || Data | ||
|- | |||
| 0x002 || 1 || Table Index | |||
|- | |||
| 0x003 || 1 || Padding | |||
|} | |||
=== Reference Table === | |||
{| class="wikitable" border="1" | |||
|- | |- | ||
! OFFSET !! SIZE !! DESCRIPTION | |||
|- | |- | ||
| | | 0x000 || 4 || Count | ||
|- | |- | ||
| | | 0x004 || Count * 8 || [[BCWAV#Reference|References]] (Offsets relative to Count field) | ||
|} | |} | ||
=== Sized Reference === | |||
{| class="wikitable" border="1" | |||
|- | |||
! OFFSET !! SIZE !! DESCRIPTION | |||
|- | |||
| 0x000 || 8 || [[BCWAV#Reference|Reference]] | |||
|- | |||
| 0x008 || 4 || Size | |||
|} | |||
=== | === Reference === | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 109: | Line 218: | ||
! OFFSET !! SIZE !! DESCRIPTION | ! OFFSET !! SIZE !! DESCRIPTION | ||
|- | |- | ||
| 0x000 || 4 || | | 0x000 || 2 || Type ID | ||
|- | |||
| 0x002 || 2 || Padding | |||
|- | |||
| 0x004 || 4 || Offset | |||
|} | |||
==== Reference Types ==== | |||
{| class="wikitable" border="1" | |||
|- | |||
! ID !! TYPE | |||
|- | |||
| 0x0300 || [[BCWAV#DSP ADPCM Info|DSP ADPCM Info]] | |||
|- | |||
| 0x0301 || [[BCWAV#IMA ADPCM Info|IMA ADPCM Info]] | |||
|- | |||
| 0x7000 || [[BCWAV#Info Block|Info Block]] | |||
|- | |||
| 0x7001 || [[BCWAV#Data Block|Data Block]] | |||
|- | |- | ||
| | | 0x7100 || [[BCWAV#Channel Info|Channel Info]] | ||
|} | |} |