Go to the documentation of this file.
24 #define BITSTREAM_READER_LE
73 #define WV_MAX_FRAME_DECODERS 14
86 #define LEVEL_DECAY(a) (((a) + 0x80) >> 8)
95 e = (1 << (p + 1)) - k - 1;
106 for (
i = 0;
i <=
ctx->stereo_in;
i++) {
107 if (
ctx->ch[
i].bitrate_acc > UINT_MAX -
ctx->ch[
i].bitrate_delta)
109 ctx->ch[
i].bitrate_acc +=
ctx->ch[
i].bitrate_delta;
110 br[
i] =
ctx->ch[
i].bitrate_acc >> 16;
113 if (
ctx->stereo_in &&
ctx->hybrid_bitrate) {
114 int balance = (sl[1] - sl[0] + br[1] + 1) >> 1;
115 if (balance > br[0]) {
118 }
else if (-balance > br[0]) {
122 br[1] = br[0] + balance;
123 br[0] = br[0] - balance;
126 for (
i = 0;
i <=
ctx->stereo_in;
i++) {
127 if (
ctx->hybrid_bitrate) {
128 if (sl[
i] - br[
i] > -0x100)
131 ctx->ch[
i].error_limit = 0;
149 if ((
ctx->ch[0].median[0] < 2
U) && (
ctx->ch[1].median[0] < 2
U) &&
150 !
ctx->zero && !
ctx->one) {
169 memset(
ctx->ch[0].median, 0,
sizeof(
ctx->ch[0].median));
170 memset(
ctx->ch[1].median, 0,
sizeof(
ctx->ch[1].median));
234 if (!
c->error_limit) {
235 if (add >= 0x2000000U) {
243 int mid = (
base * 2
U + add + 1) >> 1;
244 while (add >
c->error_limit) {
248 add -= (mid - (unsigned)
base);
251 add = mid - (unsigned)
base - 1;
252 mid = (
base * 2
U + add + 1) >> 1;
257 if (
ctx->hybrid_bitrate)
276 S *= 1 <<
s->extra_bits;
278 if (
s->got_extra_bits &&
281 *crc = *crc * 9 + (
S & 0xffff) * 3 + ((
unsigned)
S >> 16);
285 bit = (
S &
s->and) |
s->or;
289 bit = av_clip(
bit,
s->hybrid_minclip,
s->hybrid_maxclip);
291 return bit <<
s->post_shift;
302 int exp =
s->float_max_exp;
304 if (
s->got_extra_bits) {
305 const int max_bits = 1 + 23 + 8 + 1;
313 S *= 1
U <<
s->float_shift;
317 if (
S >= 0x1000000U) {
318 if (
s->got_extra_bits &&
get_bits1(&
s->gb_extra_bits))
325 exp =
s->float_max_exp;
333 (
s->got_extra_bits &&
337 }
else if (
s->got_extra_bits &&
343 exp =
s->float_max_exp;
352 if (
s->float_max_exp >= 25)
362 *crc = *crc * 27 +
S * 9 +
exp * 3 + sign;
364 value.u = (sign << 31) | (
exp << 23) |
S;
371 s->sc.crc =
s->extra_sc.crc = 0xFFFFFFFF;
375 uint32_t crc_extra_bits)
381 if (
s->got_extra_bits && crc_extra_bits !=
s->crc_extra_bits) {
390 void *dst_l,
void *dst_r,
const int type)
396 uint32_t crc =
s->sc.crc;
397 uint32_t crc_extra_bits =
s->extra_sc.crc;
398 int16_t *dst16_l = dst_l;
399 int16_t *dst16_r = dst_r;
402 float *dstfl_l = dst_l;
403 float *dstfl_r = dst_r;
405 s->one =
s->zero =
s->zeroes = 0;
413 for (
i = 0;
i <
s->terms;
i++) {
414 t =
s->decorr[
i].value;
418 A = 2
U *
s->decorr[
i].samplesA[0] -
s->decorr[
i].samplesA[1];
419 B = 2
U *
s->decorr[
i].samplesB[0] -
s->decorr[
i].samplesB[1];
421 A = (
int)(3
U *
s->decorr[
i].samplesA[0] -
s->decorr[
i].samplesA[1]) >> 1;
422 B = (
int)(3
U *
s->decorr[
i].samplesB[0] -
s->decorr[
i].samplesB[1]) >> 1;
424 s->decorr[
i].samplesA[1] =
s->decorr[
i].samplesA[0];
425 s->decorr[
i].samplesB[1] =
s->decorr[
i].samplesB[0];
428 A =
s->decorr[
i].samplesA[pos];
429 B =
s->decorr[
i].samplesB[pos];
433 L2 =
L + ((
s->decorr[
i].weightA * (int64_t)
A + 512) >> 10);
434 R2 =
R + ((
s->decorr[
i].weightB * (int64_t)
B + 512) >> 10);
436 L2 =
L + (unsigned)((
int)(
s->decorr[
i].weightA * (unsigned)
A + 512) >> 10);
437 R2 =
R + (unsigned)((
int)(
s->decorr[
i].weightB * (unsigned)
B + 512) >> 10);
440 s->decorr[
i].weightA -= ((((
L ^
A) >> 30) & 2) - 1) *
s->decorr[
i].delta;
442 s->decorr[
i].weightB -= ((((
R ^
B) >> 30) & 2) - 1) *
s->decorr[
i].delta;
443 s->decorr[
i].samplesA[j] =
L =
L2;
444 s->decorr[
i].samplesB[j] =
R =
R2;
445 }
else if (t == -1) {
447 L2 =
L + ((
s->decorr[
i].weightA * (int64_t)
s->decorr[
i].samplesA[0] + 512) >> 10);
449 L2 =
L + (unsigned)((
int)(
s->decorr[
i].weightA * (unsigned)
s->decorr[
i].samplesA[0] + 512) >> 10);
453 R2 =
R + ((
s->decorr[
i].weightB * (int64_t)
L2 + 512) >> 10);
455 R2 =
R + (unsigned)((
int)(
s->decorr[
i].weightB * (unsigned)
L2 + 512) >> 10);
458 s->decorr[
i].samplesA[0] =
R;
461 R2 =
R + ((
s->decorr[
i].weightB * (int64_t)
s->decorr[
i].samplesB[0] + 512) >> 10);
463 R2 =
R + (unsigned)((
int)(
s->decorr[
i].weightB * (unsigned)
s->decorr[
i].samplesB[0] + 512) >> 10);
468 R2 =
s->decorr[
i].samplesA[0];
469 s->decorr[
i].samplesA[0] =
R;
473 L2 =
L + ((
s->decorr[
i].weightA * (int64_t)
R2 + 512) >> 10);
475 L2 =
L + (unsigned)((
int)(
s->decorr[
i].weightA * (unsigned)
R2 + 512) >> 10);
478 s->decorr[
i].samplesB[0] =
L;
491 L += (unsigned)(
R -= (
unsigned)(
L >> 1));
492 crc = (crc * 3 +
L) * 3 +
R;
505 }
while (!last && count < s->
samples);
509 if (last && count < s->
samples) {
523 void *dst,
const int type)
529 uint32_t crc =
s->sc.crc;
530 uint32_t crc_extra_bits =
s->extra_sc.crc;
531 int16_t *dst16 = dst;
535 s->one =
s->zero =
s->zeroes = 0;
541 for (
i = 0;
i <
s->terms;
i++) {
542 t =
s->decorr[
i].value;
545 A = 2
U *
s->decorr[
i].samplesA[0] -
s->decorr[
i].samplesA[1];
547 A = (
int)(3
U *
s->decorr[
i].samplesA[0] -
s->decorr[
i].samplesA[1]) >> 1;
548 s->decorr[
i].samplesA[1] =
s->decorr[
i].samplesA[0];
551 A =
s->decorr[
i].samplesA[pos];
555 S =
T + ((
s->decorr[
i].weightA * (int64_t)
A + 512) >> 10);
557 S =
T + (unsigned)((
int)(
s->decorr[
i].weightA * (unsigned)
A + 512) >> 10);
559 s->decorr[
i].weightA -= ((((
T ^
A) >> 30) & 2) - 1) *
s->decorr[
i].delta;
560 s->decorr[
i].samplesA[j] =
T =
S;
573 }
while (!last && count < s->
samples);
577 if (last && count < s->
samples) {
597 if (!
c->fdec[
c->fdec_num])
600 c->fdec[
c->fdec_num - 1]->avctx =
c->avctx;
631 for (
i = 0;
i <
s->fdec_num;
i++)
645 void *samples_l =
NULL, *samples_r =
NULL;
647 int got_terms = 0, got_weights = 0, got_samples = 0,
648 got_entropy = 0, got_bs = 0, got_float = 0, got_hybrid = 0;
649 int i, j,
id,
size, ssize, weights, t;
650 int bpp, chan = 0, chmask = 0, orig_bpp,
sample_rate = 0;
658 s = wc->
fdec[block_no];
666 memset(
s->ch, 0,
sizeof(
s->ch));
668 s->and =
s->or =
s->shift = 0;
669 s->got_extra_bits = 0;
673 s->samples = bytestream2_get_le32(&gb);
676 "a sequence: %d and %d\n", wc->
samples,
s->samples);
679 s->frame_flags = bytestream2_get_le32(&gb);
681 orig_bpp = ((
s->frame_flags & 0x03) + 1) << 3;
689 s->post_shift = bpp * 8 - orig_bpp + ((
s->frame_flags >> 13) & 0x1f);
690 if (
s->post_shift < 0 ||
s->post_shift > 31) {
693 s->hybrid_maxclip = ((1LL << (orig_bpp - 1)) - 1);
694 s->hybrid_minclip = ((-1UL << (orig_bpp - 1)));
695 s->CRC = bytestream2_get_le32(&gb);
699 id = bytestream2_get_byte(&gb);
700 size = bytestream2_get_byte(&gb);
702 size |= (bytestream2_get_byte(&gb)) << 8;
703 size |= (bytestream2_get_byte(&gb)) << 16;
711 "Got incorrect block %02X with size %i\n",
id,
size);
716 "Block size %i is out of bounds\n",
size);
728 for (
i = 0;
i <
s->terms;
i++) {
730 s->decorr[
s->terms -
i - 1].value = (
val & 0x1F) - 5;
731 s->decorr[
s->terms -
i - 1].delta =
val >> 5;
740 weights =
size >>
s->stereo_in;
741 if (weights >
MAX_TERMS || weights >
s->terms) {
746 for (
i = 0;
i < weights;
i++) {
747 t = (int8_t)bytestream2_get_byte(&gb);
748 s->decorr[
s->terms -
i - 1].weightA = t * (1 << 3);
749 if (
s->decorr[
s->terms -
i - 1].weightA > 0)
750 s->decorr[
s->terms -
i - 1].weightA +=
751 (
s->decorr[
s->terms -
i - 1].weightA + 64) >> 7;
753 t = (int8_t)bytestream2_get_byte(&gb);
754 s->decorr[
s->terms -
i - 1].weightB = t * (1 << 3);
755 if (
s->decorr[
s->terms -
i - 1].weightB > 0)
756 s->decorr[
s->terms -
i - 1].weightB +=
757 (
s->decorr[
s->terms -
i - 1].weightB + 64) >> 7;
768 for (
i =
s->terms - 1; (
i >= 0) && (t <
size);
i--) {
769 if (
s->decorr[
i].value > 8) {
770 s->decorr[
i].samplesA[0] =
771 wp_exp2(bytestream2_get_le16(&gb));
772 s->decorr[
i].samplesA[1] =
773 wp_exp2(bytestream2_get_le16(&gb));
776 s->decorr[
i].samplesB[0] =
777 wp_exp2(bytestream2_get_le16(&gb));
778 s->decorr[
i].samplesB[1] =
779 wp_exp2(bytestream2_get_le16(&gb));
783 }
else if (
s->decorr[
i].value < 0) {
784 s->decorr[
i].samplesA[0] =
785 wp_exp2(bytestream2_get_le16(&gb));
786 s->decorr[
i].samplesB[0] =
787 wp_exp2(bytestream2_get_le16(&gb));
790 for (j = 0; j <
s->decorr[
i].value; j++) {
791 s->decorr[
i].samplesA[j] =
792 wp_exp2(bytestream2_get_le16(&gb));
794 s->decorr[
i].samplesB[j] =
795 wp_exp2(bytestream2_get_le16(&gb));
798 t +=
s->decorr[
i].value * 2 * (
s->stereo_in + 1);
804 if (
size != 6 * (
s->stereo_in + 1)) {
806 "Entropy vars size should be %i, got %i.\n",
807 6 * (
s->stereo_in + 1),
size);
811 for (j = 0; j <=
s->stereo_in; j++)
812 for (
i = 0;
i < 3;
i++) {
813 s->ch[j].median[
i] =
wp_exp2(bytestream2_get_le16(&gb));
818 if (
s->hybrid_bitrate) {
819 for (
i = 0;
i <=
s->stereo_in;
i++) {
820 s->ch[
i].slow_level =
wp_exp2(bytestream2_get_le16(&gb));
824 for (
i = 0;
i < (
s->stereo_in + 1);
i++) {
825 s->ch[
i].bitrate_acc = bytestream2_get_le16(&gb) << 16;
829 for (
i = 0;
i < (
s->stereo_in + 1);
i++) {
830 s->ch[
i].bitrate_delta =
831 wp_exp2((int16_t)bytestream2_get_le16(&gb));
834 for (
i = 0;
i < (
s->stereo_in + 1);
i++)
835 s->ch[
i].bitrate_delta = 0;
843 "Invalid INT32INFO, size = %i\n",
851 "Invalid INT32INFO, extra_bits = %d (> 30)\n",
val[0]);
854 s->extra_bits =
val[0];
866 "Invalid INT32INFO, shift = %d (> 31)\n",
s->shift);
867 s->and =
s->or =
s->shift = 0;
872 if (
s->hybrid && bpp == 4 &&
s->post_shift < 8 &&
s->shift > 8) {
875 s->hybrid_maxclip >>= 8;
876 s->hybrid_minclip >>= 8;
883 "Invalid FLOATINFO, size = %i\n",
size);
887 s->float_flag = bytestream2_get_byte(&gb);
888 s->float_shift = bytestream2_get_byte(&gb);
889 s->float_max_exp = bytestream2_get_byte(&gb);
890 if (
s->float_shift > 31) {
892 "Invalid FLOATINFO, shift = %d (> 31)\n",
s->float_shift);
901 s->sc.size =
size * 8;
904 s->data_size =
size * 8;
916 s->extra_sc.size =
size * 8;
921 s->got_extra_bits = 1;
926 "Insufficient channel information\n");
929 chan = bytestream2_get_byte(&gb);
932 chmask = bytestream2_get_byte(&gb);
935 chmask = bytestream2_get_le16(&gb);
938 chmask = bytestream2_get_le24(&gb);
941 chmask = bytestream2_get_le32(&gb);
944 size = bytestream2_get_byte(&gb);
945 chan |= (bytestream2_get_byte(&gb) & 0xF) << 8;
949 " instead of %i.\n", chan, avctx->
channels);
950 chmask = bytestream2_get_le24(&gb);
953 size = bytestream2_get_byte(&gb);
954 chan |= (bytestream2_get_byte(&gb) & 0xF) << 8;
958 " instead of %i.\n", chan, avctx->
channels);
959 chmask = bytestream2_get_le32(&gb);
998 if (
s->hybrid && !got_hybrid) {
1012 const int wanted =
s->samples *
s->extra_bits <<
s->stereo_in;
1013 if (
size < wanted) {
1015 s->got_extra_bits = 0;
1020 int sr = (
s->frame_flags >> 23) & 0
xf;
1042 frame->nb_samples =
s->samples + 1;
1045 frame->nb_samples =
s->samples;
1069 memcpy(samples_r, samples_l, bpp *
s->samples);
1080 for (
i = 0;
i <
s->fdec_num;
i++)
1085 int *got_frame_ptr,
AVPacket *avpkt)
1089 int buf_size = avpkt->
size;
1108 if (frame_flags & 0x80) {
1110 }
else if ((frame_flags & 0x03) <= 1) {
1117 while (buf_size > 0) {
1123 if (frame_size <= 0 || frame_size > buf_size) {
1125 "Block %d has invalid size (size %d vs. %d bytes left)\n",
#define WV_HYBRID_BITRATE
@ AV_SAMPLE_FMT_FLTP
float, planar
#define AV_LOG_WARNING
Something somehow does not look correct.
F H1 F F H1 F F F F H1<-F-------F-------F v v v H2 H3 H2 ^ ^ ^ F-------F-------F-> H1<-F-------F-------F|||||||||F H1 F|||||||||F H1 Funavailable fullpel samples(outside the picture for example) shall be equalto the closest available fullpel sampleSmaller pel interpolation:--------------------------if diag_mc is set then points which lie on a line between 2 vertically, horizontally or diagonally adjacent halfpel points shall be interpolatedlinearly with rounding to nearest and halfway values rounded up.points which lie on 2 diagonals at the same time should only use the onediagonal not containing the fullpel point F--> O q O<--h1-> O q O<--F v \/v \/v O O O O O O O|/|\|q q q q q|/|\|O O O O O O O ^/\ ^/\ ^ h2--> O q O<--h3-> O q O<--h2 v \/v \/v O O O O O O O|\|/|q q q q q|\|/|O O O O O O O ^/\ ^/\ ^ F--> O q O<--h1-> O q O<--Fthe remaining points shall be bilinearly interpolated from theup to 4 surrounding halfpel and fullpel points, again rounding should be tonearest and halfway values rounded upcompliant Snow decoders MUST support 1-1/8 pel luma and 1/2-1/16 pel chromainterpolation at leastOverlapped block motion compensation:-------------------------------------FIXMELL band prediction:===================Each sample in the LL0 subband is predicted by the median of the left, top andleft+top-topleft samples, samples outside the subband shall be considered tobe 0. To reverse this prediction in the decoder apply the following.for(y=0;y< height;y++){ for(x=0;x< width;x++){ sample[y][x]+=median(sample[y-1][x], sample[y][x-1], sample[y-1][x]+sample[y][x-1]-sample[y-1][x-1]);}}sample[-1][ *]=sample[ *][-1]=0;width, height here are the width and height of the LL0 subband not of the finalvideoDequantization:===============FIXMEWavelet Transform:==================Snow supports 2 wavelet transforms, the symmetric biorthogonal 5/3 integertransform and an integer approximation of the symmetric biorthogonal 9/7daubechies wavelet.2D IDWT(inverse discrete wavelet transform) --------------------------------------------The 2D IDWT applies a 2D filter recursively, each time combining the4 lowest frequency subbands into a single subband until only 1 subbandremains.The 2D filter is done by first applying a 1D filter in the vertical directionand then applying it in the horizontal one. --------------- --------------- --------------- ---------------|LL0|HL0|||||||||||||---+---|HL1||L0|H0|HL1||LL1|HL1|||||LH0|HH0|||||||||||||-------+-------|-> L1 H1 LH1 HH1 LH1 HH1 LH1 HH1 L2
static av_cold int init(AVCodecContext *avctx)
static int get_bits_left(GetBitContext *gb)
uint64_t channel_layout
Audio channel layout.
int sample_rate
samples per second
#define u(width, name, range_min, range_max)
#define AV_CH_LAYOUT_MONO
int err_recognition
Error recognition; may misdetect some more or less valid parts as errors.
static void wavpack_decode_flush(AVCodecContext *avctx)
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
#define WV_FLT_SHIFT_ONES
This structure describes decoded (raw) audio or video data.
@ AV_SAMPLE_FMT_S32P
signed 32 bits, planar
static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g)
#define bit(string, value)
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static int update_error_limit(WavpackFrameContext *ctx)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
AVCodec ff_wavpack_decoder
#define AV_CH_LAYOUT_STEREO
static av_always_inline int wp_log2(uint32_t val)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static int wavpack_decode_block(AVCodecContext *avctx, int block_no, AVFrame *frame, const uint8_t *buf, int buf_size)
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
static const int wv_rates[16]
static av_always_inline int wp_exp2(int16_t val)
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
static void flush(AVCodecContext *avctx)
static unsigned int get_bits1(GetBitContext *s)
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
static void wv_reset_saved_context(WavpackFrameContext *s)
#define ONLY_IF_THREADS_ENABLED(x)
Define a function with only the non-default version specified.
int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
Wrapper around get_buffer() for frame-multithreaded codecs.
#define AV_EF_EXPLODE
abort decoding on minor error detection
static int get_unary_0_33(GetBitContext *gb)
Get unary code terminated by a 0 with a maximum length of 33.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
static int wv_get_value_integer(WavpackFrameContext *s, uint32_t *crc, unsigned S)
static void error(const char *err)
static av_always_inline int bytestream2_tell(GetByteContext *g)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static int wv_check_crc(WavpackFrameContext *s, uint32_t crc, uint32_t crc_extra_bits)
static int wavpack_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
enum AVSampleFormat sample_fmt
audio sample format
the pkt_dts and pkt_pts fields in AVFrame will work as usual Restrictions on codec whose streams don t reset across will not work because their bitstreams cannot be decoded in parallel *The contents of buffers must not be read before as well as code calling up to before the decode process starts Call have add an init_thread_copy() which re-allocates them for other threads. Add AV_CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little speed gain at this point but it should work. If there are inter-frame dependencies
const char const char void * val
#define WV_FLT_SHIFT_SENT
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
WavpackFrameContext * fdec[WV_MAX_FRAME_DECODERS]
static int wv_unpack_stereo(WavpackFrameContext *s, GetBitContext *gb, void *dst_l, void *dst_r, const int type)
int channels
number of audio channels
static int wv_unpack_mono(WavpackFrameContext *s, GetBitContext *gb, void *dst, const int type)
#define i(width, name, range_min, range_max)
static av_cold int wavpack_decode_end(AVCodecContext *avctx)
int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt)
Return number of bytes per sample.
#define xf(width, name, var, range_min, range_max, subs,...)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
#define WV_FLT_SHIFT_SAME
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
static av_always_inline unsigned get_tail(GetBitContext *gb, int k)
const char * name
Name of the codec implementation.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
#define AV_EF_CRCCHECK
Verify checksums embedded in the bitstream (could be of either encoded or decoded data,...
#define WV_MAX_FRAME_DECODERS
#define AV_INPUT_BUFFER_PADDING_SIZE
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
GetBitContext gb_extra_bits
static av_cold int wavpack_decode_init(AVCodecContext *avctx)
main external API structure.
#define UPDATE_WEIGHT_CLIP(weight, delta, samples, in)
static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb, int channel, int *last)
static float wv_get_value_float(WavpackFrameContext *s, uint32_t *crc, int S)
Filter the word “frame” indicates either a video frame or a group of audio samples
static int shift(int a, int b)
static av_cold int wv_alloc_frame_context(WavpackContext *c)
static av_always_inline int get_bitsz(GetBitContext *s, int n)
Read 0-25 bits.
This structure stores compressed data.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.