First issue: reliable frame detection
- Using only the 16-bit frame header gives many many false positive frame start matches.
- Using the frame header + frame CRC-16 gives a handful of false positives.
- The only reliable way seems to be a full frame header validation including the header CRC-8, along with checking the CRC-16 for the whole frame.
- Frame headers are variable-sized from 6 bytes to 16 bytes.
- The whole frame can be as small as 11 bytes, and silent frames are often less than 16 bytes.
- ff_combine_frame() only keeps up to 8 bytes of state information
- read first header to get starting point for block size/channels/bps
- estimate maximum frame size
- buffer enough data for maximum frame
- detect next header
- update maximum frame size with header info
- update buffer
- return frame start and size
- goto 3
No comments:
Post a Comment