2 * WavPack shared functions
4 * This file is part of FFmpeg.
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26 #define WV_HEADER_SIZE 32
28 #define WV_FLAG_INITIAL_BLOCK (1 << 11)
29 #define WV_FLAG_FINAL_BLOCK (1 << 12)
31 // specs say that maximum block size is 1Mb
32 #define WV_BLOCK_LIMIT 1048576
34 typedef struct WvHeader {
35 uint32_t blocksize; //< size of the block data (excluding the header)
36 uint16_t version; //< bitstream version
37 uint32_t total_samples; //< total number of samples in the stream
38 uint32_t block_idx; //< index of the first sample in this block
39 uint32_t samples; //< number of samples in this block
47 * Parse a WavPack block header.
49 * @param wv this struct will be filled with parse header information
50 * @param data header data, must be WV_HEADER_SIZE bytes long
52 * @return 0 on success, a negative AVERROR code on failure
54 int ff_wv_parse_header(WvHeader *wv, const uint8_t *data);
56 #endif /* AVFORMAT_WV_H */