meta: Minor alteration of comment.
rsf: Start using frame.NewFrame.
The changes to frame are as follows:
* Frame struct no longer contains Footer. Instead NewFrame returns an error
if the CRC-16 verification fails.
* Implement NewFrame which parses audio frames. Each audio frame consists of
a frame header, one subframe per channel and a footer containing a CRC-16
checksum.
* Initial implementation of NewSubFrame which parses subframes. Currently
only the easiest case is fully supported.
- Constant encoding is fully supported.
- Fixed encoding can currently decode the "warm-up" samples. Rice0 and
rice1 still have to be implemented for full support.
- LPC - not yet implemented.
- Verbatim - not yet implemented. This one should be easy though.
* NewSubHeader has almost been fully implemented. Only
"wasted-bits-per-sample" remains.
Note: This code uses the bitstream Reader from "github.com/mewkiz/pkg/bit",
which is convenient but also inefficient. When decoding has been fully
implemented we should use profiling to find the bottlenecks.
- Renamed Decode to NewHeader and modified it so it only parses the frame header data.
- Implemented decoding of "UTF-8" coded integers.
- Use CRC-8 to verify the header data (hashutil/crc8).
- Removed CRC field from Header structure, since it should be enough to only return an error if the verification fails.
- Renamed BlockSizeInterChannelSamples to BlockSize, err on the side of brevity.
- Renamed ChannelAssignment to ChannelOrder and add corresponding iota constants.
rsf: Decode frame header using NewHeader.
- Corrected some comments.
- Added handling of NULL terminated strings.
- Renamed some return arguments, for instance:
- app instead of ap
- pic instead of p
rsf: Added MetaBlock type, which represents the header and body of a block.
- Added reference URL for metadata block types.
- Added pseudo code comments, documenting the on disk file format of
different metadata block types.
- Renamed a couple of struct members: from NumThings to ThingCount.
- Rename from NumSamples to SampleCount.
- Add pseudo code describing the on disk file format of different metadata
block types.
- More detailed error messages.
- Add VerifyPadding function.
rsf: Initial commit to use io.LimitedReader.
* Corrected parsing of MinFrameSize in NewStreamInfo (shift 24 bits right
instead of 32 bits).
* Move constant definitions closer to their intended use in NewStreamInfo.
* Simplified some error handling in NewStreamInfo:
- MinBlockSize
- MaxBlockSize
* Corrected error handling of SampleRate.
* Corrected error message for MaxBlockSize ("< 65535" was replaced with
"<= 65535").
* Change order of bits and mask.
- before: NumSamplesMask & bits.
- after: bits & NumSamplesMask.
* Simplify some expressions based on operator precedence, removing some
parentheses.
- before: uint8((BitsPerSampleMask&bits)>>36) + 1
- after: uint8(bits&BitsPerSampleMask>>36) + 1
* Add comments to the memers of BlockHeader and StreamInfo.
rsf: Minor alteration of newStream comment.
meta:
* Replace the parse method for all metadata block types with a function that
handles both allocation and parsing.
- before:
v = new(T)
func (v *T) parse(buf []byte) (err error)
- after:
func NewT(buf []byte) (v *T, err error)
* Move type definitions closer to the first function using them.
- For instance place the type definition of StreamInfo above the
NewStreamInfo function.
* Rewrite comments for exported identifiers according to godoc conventions.
* Rename DataHeader to BlockHeader.
* Add the type definition Type which is used to identify metadata block
types.
* Make BlockHeader.Length usage more convenient, by changing it's type from
uint32 to int.
* Rename buf (bytes.Buffer) to b, and rename block ([]byte) to buf.
* Use errors.New() instead of fmt.Errorf for errors that doesn't require
formatted output.
* Rename IsAllZero to isAllZero, since it doesn't have to be exported. Return
a bool instead of an error.
rsf:
* Renamed Stream.Metadata to Stream.MetaBlocks.
* Replace the parse method for all metadata block types with a function that
handles both allocation and parsing.
- before:
v = new(T)
func (v *T) parse(buf []byte) (err error)
- after:
func NewT(buf []byte) (v *T, err error)
* Replace headerTypes[header.BlockType].(type) switch statement with a
header.BlockType statement.