Changes between Version 29 and Version 30 of SV8Specification
- Timestamp:
- 02/15/07 01:41:26 (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SV8Specification
v29 v30 2 2 = SV8 specification draft = 3 3 4 Nota : All fields, unless explicitely specified otherwise are read and written in Big-Endian order , independently of the underlying architecture.4 Nota : All fields, unless explicitely specified otherwise are read and written in Big-Endian order. 5 5 6 6 == File magic number == 7 7 8 8 Magic number is on 32bits and is equal to 'MPCK' or 0x4D50434B[[BR]] 9 New value so old decoders will happily skip such files.10 9 11 == Blockformatting ==10 == Packet formatting == 12 11 13 All blocks are formated using Key / Length / Value.[[BR]]14 Key is 16 bits long. It's the block ID.[[BR]]15 Length is a variablesize field using the same values as [http://svn.mplayerhq.hu/mplayer/trunk/DOCS/tech/nut.txt?view=markup nut] :[[BR]]12 All packets are formatted using Key / Size / Payload.[[BR]] 13 Keys are 16 bits long. It's equivalent to the packet ID or type.[[BR]] 14 Size is a variable-size field using the same values as [http://svn.mplayerhq.hu/mplayer/trunk/DOCS/tech/nut.txt?view=markup nut] :[[BR]] 16 15 {{{ 17 16 bits, big-endian … … 23 22 }}} 24 23 25 The length is the size of the block in bytes, including the key and size fields. So the minimum length of a block is 3 bytes.[[BR]]26 The value is the block content. Its size can be 0.[[BR]]27 All unused bits in a block MUST be 0.[[BR]]24 Size defines the packet length in bytes, including the Key and Size fields. So the minimum length of a block is 3 bytes.[[BR]] 25 The payload is the actual packet data. Its size can be null.[[BR]] 26 All unused bits in a packet MUST be null.[[BR]] 28 27 29 || '''Field''' || ''' length (bits)''' || '''Value''' ||28 || '''Field''' || '''Size (bits)''' || '''Payload''' || 30 29 || Key || 16 || "EX" || 31 || Length|| n*8; 0 < n < 10 || 0x1A ||32 || Value || Length* 8 || "example" ||30 || Size || n*8; 0 < n < 10 || 0x1A || 31 || Payload || Size * 8 || "example" || 33 32 34 33 35 == Summary of reserved blockkeys ==34 == Summary of reserved packet keys == 36 35 37 || '''Block name''' || '''Key''' || '''Mandatory''' || 38 || Stream information || SI || yes || 39 || Encoder information || EI || no || 40 || Audio data || AD || yes || 41 || Seek Pointer || SP || no || 36 || '''Packet Name''' || '''Key''' || '''Mandatory''' || 37 || Stream Header || SH || yes || 38 || Replaygain || RG || yes || 39 || Encoder Info || EI || no || 40 || Edition || ED || no || 41 || Seek Table Offset || SO || no || 42 || Audio Packet || AP || yes || 42 43 || Seek Table || ST || no || 43 || Edition || ED || no ||44 44 || Stream End || SE || yes || 45 45 46 == Stream information block==46 == Stream Header Packet == 47 47 48 This blockkey is "SI".[[BR]]49 This block contains the informations needed to decode the stream. This block is mandatory and must be written before the first audio block.[[BR]]48 This packet key is "SI".[[BR]] 49 It contains the informations needed to decode the stream. This block is mandatory and must be written before the first audio packet.[[BR]] 50 50 51 || '''Field''' || ''' length (bits)''' || '''Value''' || '''comment''' ||51 || '''Field''' || '''Size (bits)''' || '''Payload''' || '''Comment''' || 52 52 || CRC || 32 || || CRC 32 of the block (this field excluded). 0 = invalid || 53 || Info length || n*8; 0 < n < 10 || || length (in bytes) from this field (included) to the ReplayGain version field || 54 || Stream version || 8 || 8 || bitstream version || 55 || Sample count || n*8; 0 < n < 10 || || number of samples in the stream. 0 = unknow || 56 || Sample frequency || 3 || 0..7 || see table below || 57 || Channel count || 4 || 1..16 || number of channels in the stream || 58 || Max used bands || 5 || 1..32 || maximum number of bands used in the file || 59 || MS used || 1 || || MidSideStereo || 60 || Audio block frames || 3 || 0..7 || number of frames in an audio block is : 4^Value^ (1..16384) || 61 || ReplayGain version || 8 || || The replay gain version - must be aligned on a byte - || 62 || Title gain || 16 || || The loudness calculated for the title, ''and not the gain that the player must apply'' || 63 || Title peak || 16 || || || 64 || Album gain || 16 || || The loudness calculated for the album || 65 || Album peak || 16 || || || 53 || Stream version || 8 || 8 || Bitstream version || 54 || Sample count || n*8; 0 < n < 10 || || Number of samples in the stream. 0 = unknown || 55 || Sample frequency || 3 || 0..7 || See table below || 56 || Channel count || 4 || 1..16 || Number of channels in the stream || 57 || Max used bands || 5 || 1..32 || Maximum number of bands used in the file || 58 || MS used || 1 || || True if Mid Side Stereo is enabled || 59 || Audio block frames || 3 || 0..7 || Number of frames per audio packet (4^value=(1..16384)) || 66 60 67 61 Do we need to specify the channel position ? Is there standard positions / order of the channels ? … … 76 70 The CRC used is this one : [http://www.w3.org/TR/PNG/#D-CRCAppendix http://www.w3.org/TR/PNG/#D-CRCAppendix]. 77 71 72 == Replaygain Packet == 73 74 This packet key is "RG".[[BR]] 75 It contains the necessary data needed to apply replaygain on the current stream. This packet is mandatory and must be written before the first audio packet.[[BR]] 76 77 || '''Field''' || '''Size (bits)''' || '''Payload''' || '''Comment''' || 78 || ReplayGain version || 8 || || The replay gain version - must be aligned on a byte - || 79 || Title gain || 16 || || The loudness calculated for the title, ''and not the gain that the player must apply'' || 80 || Title peak || 16 || || || 81 || Album gain || 16 || || The loudness calculated for the album || 82 || Album peak || 16 || || || 83 78 84 The replay gain values are stored in dB in Q8.8 format (maybe Q7.9 or relative to the max value for the bitdepth is better ?).[[BR]] 79 85 86 == Encoder Info Packet == 80 87 81 == Encoder infomations == 88 This packet key is "EI".[[BR]] 82 89 83 This block key is "EI". 84 85 || '''Field''' || '''length (bits)''' || '''Value''' || '''comment''' || 86 || profile used || 7 || 0..15.875 || quality in 4.3 format || 87 || PNS used || 1 || || || 88 || MajorNumber || 4 || || || 89 || MinorNumber || 8 || || even = release, odd = unstable || 90 || Implementation || 4 || || || 91 || Build || 8 || || || 92 93 == Audio data block == 94 95 This block key is "AD".[[BR]] 96 This block contains audio frames. The first frame is a key frame.[[BR]] 97 98 || '''Field''' || '''length (bits)''' || '''Value''' || '''comment''' || 99 || audio frames || ? || || n (or less if last block) frames of audio data as defined in SI block || 90 || '''Field''' || '''Size (bits)''' || '''Payload''' || '''Comment''' || 91 || Profile || 7 || 0..15.875 || quality in 4.3 format || 92 || PNS tool || 1 || True if enabled || || 93 || Major || 8 || 1 || Major version || 94 || Minor || 8 || 17 || Minor version, even numbers for stable version, odd when unstable || 95 || Build || 8 || 3 || Build || 100 96 101 97 102 == Seek Pointer Block==98 == Edition Packet == 103 99 104 This block key is "SP".[[BR]]105 Th is block contains a pointer to the seek table block.106 || '''Field''' || '''length (bits)''' || '''Value''' || '''comment''' || 107 || pointer || n*8; 0 < n < 10 || || number of bytes from this block header to the "ST" block header || 100 This packet key is "ED"[[BR]] 101 The SV8 stream allow only to start decoding on first packet frame, so cutting the stream require to cut on packet boundaries. This packet 102 provides more precise cutting possibilities.[[BR]] 103 This packet must be written before the first audio packet. 108 104 109 == Seek Table Block == 105 || '''Field''' || '''Size (bits)''' || '''Payload''' || '''Comment''' || 106 || Beginning silence || n*8; 0 < n < 10 || || Number of samples to skip at the beginning of the stream || 107 || End silence || n*8; 0 < n < 10 || || Number of samples to skip at the end of the stream || 110 108 111 This block key is "ST".[[BR]]112 109 113 || '''Field''' || '''length (bits)''' || '''Value''' || '''comment''' || 114 || Seek Count || n*8; 0 < n < 10 || || number of seek elements in this table || 115 || Seek Distance || 4 || 0..15 || distance between referenced blocks = 2^Value^ || 116 || Seek Datas || ? || || || 110 == Seek Table Offset Packet == 117 111 118 Format of seek datas :[[BR]] 112 This packet key is "SO".[[BR]] 113 It contains an offset to the seek table packet. 119 114 120 - The reference for the seek offset is the musepack magic number[[BR]] 121 - The first 2 values are stored using the same code as the block length code.[[BR]] 122 - The next values are coded as :[[BR]] 115 || '''Field''' || '''Size (bits)''' || '''Payload''' || '''Comment''' || 116 || Offset || n*8; 0 < n < 10 || || Offset from this packet to the seek table packet || 117 118 119 == Audio Packet == 120 121 This packet key is "AP".[[BR]] 122 It contains audio frames. The first frame is a key frame.[[BR]] 123 124 || '''Field''' || '''Size (bits)''' || '''Payload''' || '''Comment''' || 125 || Audio Frames || ? || || n (or less if last packet) frames of audio as defined in SH packet || 126 127 128 == Seek Table Packet == 129 130 This packet key is "ST".[[BR]] 131 132 || '''Field''' || '''Size (bits)''' || '''Payload''' || '''Comment''' || 133 || Seek Count || n*8; 0 < n < 10 || || Number of seek elements in this table || 134 || Seek Distance || 4 || 0..15 || Distance between referenced blocks = 2^Value^ || 135 || Seek Data || ? || || || 136 137 Format of seek data :[[BR]] 138 139 - Reference offset for seeking is the musepack magic number[[BR]] 140 - First 2 values are stored using the same code as the packet size code.[[BR]] 141 - Next values are coded as :[[BR]] 123 142 {{{ 124 143 code = value(n) - 2*value(n-1) + value(n-2) … … 130 149 131 150 132 == Security Block==151 == Security Packet == 133 152 134 153 Checksum (MD5, SHA1) or error correcting code (LDPC).[[BR]] 135 154 To be defined later. May be better to keep security features external only. 136 155 137 == Edition Block ==138 156 139 The SV8 stream allow only to start decoding on first block frame, so cutting the stream require to cut on block boundaries. This block 140 provides more precise cutting possibilities.[[BR]] 141 This block must be written before the first audio block.[[BR]] 142 This block key is "ED"[[BR]] 157 == Stream End Packet == 143 158 144 || '''Field''' || '''length (bits)''' || '''Value''' || '''comment''' || 145 || Beginning silence || n*8; 0 < n < 10 || || number of samples to skip at the beginning of the stream || 146 || End silence || n*8; 0 < n < 10 || || number of samples to skip at the end of the stream || 159 This packet key is "SE".[[BR]] 160 Recommended packet size is 3 bytes.[[BR]] 161 This packet is mandatory and must be the last stream packet. Tags, if present, must be written after this packet. 147 162 148 == End Block ==149 150 This block key is "SE".[[BR]]151 The recommanded block lenth is 3 bytes.[[BR]]152 This block is mandatory and must be the last block of the stream. Tags are written after this block.153 163 154 164 == Streaming == 155 165 156 This file format can be used for streaming. The "SI" block is used as synchronization marker. The decoder will scan for a "SI" block and check the block CRC. Once the decoder is synchronized, it will start decoding. It's up to the streaming server to choose when to send "SI" block.[[BR]] 157 There is currently no way to send tags during playback. This must be changed (a tag block ?). 166 This file format can be used for streaming. The "SH" block is (can?) used as synchronization marker. The decoder will scan for a "SH" block and check its CRC. Once the decoder is synchronized, it will start decoding. It's up to the streaming server to choose when to send "SH" block.[[BR]] 167 There is currently no way to send tags during playback. This must be changed (a tag packet ?). 168 158 169 159 170 == Tags == 160 171 161 No block must be written after the end blockto allow tagging by other applications.[[BR]]172 No packet must be written after the stream end packet to allow tagging by other applications.[[BR]] 162 173 Remarks about tagging? Incompatibilities?[[BR]]