19 #include <wavpack/wavpack.h>
30 #define WV_DEFAULT_BLOCK_SIZE 32768
61 WavpackGetErrorMessage(s->
wv));
68 ret = WavpackFlushSamples(s->
wv);
71 WavpackGetErrorMessage(s->
wv));
104 memcpy(s->
pkt->
data + offset, data, count);
114 WavpackConfig config = { 0 };
126 config.bytes_per_sample = 4;
127 config.bits_per_sample = 32;
130 config.num_channels = avctx->
channels;
135 config.flags |= CONFIG_VERY_HIGH_FLAG;
148 config.flags |= CONFIG_HIGH_FLAG;
150 config.flags |= CONFIG_FAST_FLAG;
153 ret = WavpackSetConfiguration(s->
wv, &config, -1);
157 ret = WavpackPackInit(s->
wv);
167 WavpackGetErrorMessage(s->
wv));
168 WavpackCloseFile(s->
wv);
176 WavpackCloseFile(s->
wv);
184 .
name =
"libwavpack",
194 .wrapper_name =
"libwavpack",
void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts, int64_t *duration)
Remove frame(s) from the queue.
#define FF_COMPRESSION_DEFAULT
This structure describes decoded (raw) audio or video data.
static av_cold int wavpack_encode_init(AVCodecContext *avctx)
ptrdiff_t const GLvoid * data
static av_cold int init(AVCodecContext *avctx)
Macro definitions for various function/variable attributes.
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
av_cold void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq)
Initialize AudioFrameQueue.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int wavpack_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_output)
static av_cold int wavpack_encode_close(AVCodecContext *avctx)
const char * name
Name of the codec implementation.
static const uint8_t offset[127][2]
int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f)
Add a frame to the queue.
uint64_t channel_layout
Audio channel layout.
#define AV_CODEC_CAP_SMALL_LAST_FRAME
Codec can be fed a final frame with a smaller size.
#define WV_DEFAULT_BLOCK_SIZE
int frame_size
Number of samples per channel in an audio frame.
Libavcodec external API header.
AVSampleFormat
Audio sample formats.
int sample_rate
samples per second
main external API structure.
Describe the class of an AVClass context structure.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static int encode_callback(void *id, void *data, int32_t count)
common internal api header.
int av_grow_packet(AVPacket *pkt, int grow_by)
Increase packet size, correctly zeroing padding.
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
AVCodec ff_libwavpack_encoder
int channels
number of audio channels
void ff_af_queue_close(AudioFrameQueue *afq)
Close AudioFrameQueue.
static enum AVSampleFormat sample_fmts[]
This structure stores compressed data.
int nb_samples
number of audio samples (per channel) described by this frame
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...