81 { -1, -1, -1, -1, 2, 4, 6, 8 },
82 { -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 4, 6, 8, 10, 13, 16 }
95 unsigned int min_channels = 1;
96 unsigned int max_channels = 2;
169 step_index = av_clip(step_index, 0, 88);
176 diff = ((2 * delta + 1) * step) >> shift;
178 if (sign) predictor -= diff;
179 else predictor += diff;
195 step_index = av_clip(step_index, 0, 88);
198 if (nibble & 4) diff +=
step;
199 if (nibble & 2) diff += step >> 1;
200 if (nibble & 1) diff += step >> 2;
218 predictor += ((nibble & 0x08)?(nibble - 0x10):(nibble)) * c->
idelta;
221 c->
sample1 = av_clip_int16(predictor);
230 int sign,
delta, diff;
238 diff = ((2 * delta + 1) * c->
step) >> 3;
244 c->
step = av_clip(new_step, 511, 32767);
251 int sign,
delta, diff;
253 sign = nibble & (1<<(size-1));
254 delta = nibble & ((1<<(size-1))-1);
255 diff = delta << (7 + c->
step + shift);
261 if (delta >= (2*size - 3) && c->
step < 3)
263 else if (delta == 0 && c->
step > 0)
279 c->
step = av_clip(c->
step, 127, 24567);
292 out0 += sample_offset;
296 out1 += sample_offset;
299 shift = 12 - (in[4+i*2] & 15);
300 filter = in[4+i*2] >> 4;
303 "Invalid XA-ADPCM filter %d (max. allowed is 4)\n",
317 s = ( t<<shift ) + ((s_1*f0 + s_2*f1+32)>>6);
319 s_1 = av_clip_int16(s);
330 shift = 12 - (in[5+i*2] & 15);
331 filter = in[5+i*2] >> 4;
334 "Invalid XA-ADPCM filter %d (max. allowed is 4)\n",
345 s = ( t<<shift ) + ((s_1*f0 + s_2*f1+32)>>6);
347 s_1 = av_clip_int16(s);
359 out0 += 28 * (3 - channels);
360 out1 += 28 * (3 - channels);
371 int k0, signmask, nb_bits, count;
372 int size = buf_size*8;
380 k0 = 1 << (nb_bits-2);
381 signmask = 1 << (nb_bits-1);
384 for (i = 0; i < avctx->
channels; i++) {
392 for (i = 0; i < avctx->
channels; i++) {
407 if (delta & signmask)
433 int buf_size,
int *coded_samples)
438 int has_coded_samples = 0;
446 if (buf_size < 76 * ch)
451 if (buf_size < 34 * ch)
461 nb_samples = buf_size * 2 / ch;
476 return (buf_size - header_size) * 2 / ch;
481 has_coded_samples = 1;
482 *coded_samples = bytestream2_get_le32(gb);
483 *coded_samples -= *coded_samples % 28;
484 nb_samples = (buf_size - 12) / 30 * 28;
487 has_coded_samples = 1;
488 *coded_samples = bytestream2_get_le32(gb);
489 nb_samples = (buf_size - (4 + 8 * ch)) * 2 / ch;
492 nb_samples = (buf_size - ch) / ch * 2;
499 has_coded_samples = 1;
502 header_size = 4 + 9 * ch;
503 *coded_samples = bytestream2_get_le32(gb);
506 header_size = 4 + 5 * ch;
507 *coded_samples = bytestream2_get_le32(gb);
510 header_size = 4 + 5 * ch;
511 *coded_samples = bytestream2_get_be32(gb);
514 *coded_samples -= *coded_samples % 28;
515 nb_samples = (buf_size - header_size) * 2 / ch;
516 nb_samples -= nb_samples % 28;
521 nb_samples = ((buf_size - 16) * 2 / 3 * 4) / ch;
526 nb_samples = 1 + (buf_size - 4 * ch) * 2 / ch;
531 nb_samples = 1 + (buf_size - 4 * ch) / (4 * ch) * 8;
536 nb_samples = 2 + (buf_size - 7 * ch) * 2 / ch;
542 int samples_per_byte;
552 nb_samples += buf_size * samples_per_byte / ch;
557 int buf_bits = buf_size * 8 - 2;
558 int nbits = (bytestream2_get_byte(gb) >> 6) + 2;
559 int block_hdr_size = 22 * ch;
560 int block_size = block_hdr_size + nbits * ch * 4095;
561 int nblocks = buf_bits / block_size;
562 int bits_left = buf_bits - nblocks * block_size;
563 nb_samples = nblocks * 4096;
564 if (bits_left >= block_hdr_size)
565 nb_samples += 1 + (bits_left - block_hdr_size) / (nbits * ch);
569 has_coded_samples = 1;
571 *coded_samples = bytestream2_get_be32(gb);
572 *coded_samples -= *coded_samples % 14;
573 nb_samples = (buf_size - 80) / (8 * ch) * 14;
576 nb_samples = (buf_size / 128) * 224 / ch;
581 if (has_coded_samples && (*coded_samples <= 0 || *coded_samples > nb_samples))
588 int *got_frame_ptr,
AVPacket *avpkt)
592 int buf_size = avpkt->
size;
595 int n, m, channel, i;
600 int nb_samples, coded_samples, ret;
604 nb_samples =
get_nb_samples(avctx, &gb, buf_size, &coded_samples);
605 if (nb_samples <= 0) {
616 samples = (
short *)frame->
data[0];
622 if (coded_samples != nb_samples)
624 frame->
nb_samples = nb_samples = coded_samples;
633 for (channel = 0; channel < avctx->
channels; channel++) {
636 cs = &(c->
status[channel]);
640 predictor =
sign_extend(bytestream2_get_be16u(&gb), 16);
641 step_index = predictor & 0x7F;
662 samples = samples_p[channel];
664 for (m = 0; m < 64; m += 2) {
665 int byte = bytestream2_get_byteu(&gb);
684 for (n = 0; n < (nb_samples - 1) / 8; n++) {
685 for (i = 0; i < avctx->
channels; i++) {
687 samples = &samples_p[i][1 + n * 8];
688 for (m = 0; m < 8; m += 2) {
689 int v = bytestream2_get_byteu(&gb);
697 for (i = 0; i < avctx->
channels; i++)
700 for (i = 0; i < avctx->
channels; i++) {
709 for (i = 0; i < avctx->
channels; i++) {
710 samples = (int16_t *)frame->
data[i];
712 for (n = nb_samples >> 1; n > 0; n--) {
713 int v = bytestream2_get_byteu(&gb);
723 block_predictor = bytestream2_get_byteu(&gb);
724 if (block_predictor > 6) {
732 block_predictor = bytestream2_get_byteu(&gb);
733 if (block_predictor > 6) {
755 for(n = (nb_samples - 2) >> (1 - st); n > 0; n--) {
756 int byte = bytestream2_get_byteu(&gb);
763 for (channel = 0; channel < avctx->
channels; channel++) {
773 for (n = (nb_samples >> (1 - st)) - 1; n > 0; n--) {
774 int v = bytestream2_get_byteu(&gb);
783 int decode_top_nibble_next = 0;
785 const int16_t *samples_end = samples + avctx->
channels * nb_samples;
801 #define DK3_GET_NEXT_NIBBLE() \ 802 if (decode_top_nibble_next) { \ 803 nibble = last_byte >> 4; \ 804 decode_top_nibble_next = 0; \ 806 last_byte = bytestream2_get_byteu(&gb); \ 807 nibble = last_byte & 0x0F; \ 808 decode_top_nibble_next = 1; \ 811 while (samples < samples_end) {
841 for (channel = 0; channel < avctx->
channels; channel++) {
852 for (n = nb_samples >> (1 - st); n > 0; n--) {
854 int v = bytestream2_get_byteu(&gb);
869 int v = bytestream2_get_byteu(&gb);
876 for (channel = 0; channel < avctx->
channels; channel++) {
877 int16_t *smp = samples_p[channel];
879 for (n = nb_samples / 2; n > 0; n--) {
880 int v = bytestream2_get_byteu(&gb);
886 for (n = nb_samples / 2; n > 0; n--) {
887 for (channel = 0; channel < avctx->
channels; channel++) {
888 int v = bytestream2_get_byteu(&gb);
899 int16_t *out0 = samples_p[0];
900 int16_t *out1 = samples_p[1];
901 int samples_per_block = 28 * (3 - avctx->
channels) * 4;
902 int sample_offset = 0;
906 avctx->
channels, sample_offset)) < 0)
909 sample_offset += samples_per_block;
914 for (i=0; i<=st; i++) {
922 for (i=0; i<=st; i++)
925 for (n = nb_samples >> (1 - st); n > 0; n--) {
926 int byte = bytestream2_get_byteu(&gb);
932 for (n = nb_samples >> (1 - st); n > 0; n--) {
933 int byte = bytestream2_get_byteu(&gb);
940 int previous_left_sample, previous_right_sample;
941 int current_left_sample, current_right_sample;
942 int next_left_sample, next_right_sample;
943 int coeff1l, coeff2l, coeff1r, coeff2r;
944 int shift_left, shift_right;
949 current_left_sample =
sign_extend(bytestream2_get_le16u(&gb), 16);
950 previous_left_sample =
sign_extend(bytestream2_get_le16u(&gb), 16);
951 current_right_sample =
sign_extend(bytestream2_get_le16u(&gb), 16);
952 previous_right_sample =
sign_extend(bytestream2_get_le16u(&gb), 16);
954 for (count1 = 0; count1 < nb_samples / 28; count1++) {
955 int byte = bytestream2_get_byteu(&gb);
961 byte = bytestream2_get_byteu(&gb);
962 shift_left = 20 - (byte >> 4);
963 shift_right = 20 - (byte & 0x0F);
965 for (count2 = 0; count2 < 28; count2++) {
966 byte = bytestream2_get_byteu(&gb);
967 next_left_sample =
sign_extend(byte >> 4, 4) << shift_left;
968 next_right_sample =
sign_extend(byte, 4) << shift_right;
970 next_left_sample = (next_left_sample +
971 (current_left_sample * coeff1l) +
972 (previous_left_sample * coeff2l) + 0x80) >> 8;
973 next_right_sample = (next_right_sample +
974 (current_right_sample * coeff1r) +
975 (previous_right_sample * coeff2r) + 0x80) >> 8;
977 previous_left_sample = current_left_sample;
978 current_left_sample = av_clip_int16(next_left_sample);
979 previous_right_sample = current_right_sample;
980 current_right_sample = av_clip_int16(next_right_sample);
981 *samples++ = current_left_sample;
982 *samples++ = current_right_sample;
992 int coeff[2][2], shift[2];
994 for(channel = 0; channel < avctx->
channels; channel++) {
995 int byte = bytestream2_get_byteu(&gb);
998 shift[channel] = 20 - (byte & 0x0F);
1000 for (count1 = 0; count1 < nb_samples / 2; count1++) {
1003 byte[0] = bytestream2_get_byteu(&gb);
1004 if (st) byte[1] = bytestream2_get_byteu(&gb);
1005 for(i = 4; i >= 0; i-=4) {
1006 for(channel = 0; channel < avctx->
channels; channel++) {
1010 c->
status[channel].
sample2 * coeff[channel][1] + 0x80) >> 8;
1028 int previous_sample, current_sample, next_sample;
1031 unsigned int channel;
1036 for (channel=0; channel<avctx->
channels; channel++)
1037 offsets[channel] = (big_endian ? bytestream2_get_be32(&gb) :
1038 bytestream2_get_le32(&gb)) +
1041 for (channel=0; channel<avctx->
channels; channel++) {
1043 samplesC = samples_p[channel];
1046 current_sample =
sign_extend(bytestream2_get_le16(&gb), 16);
1047 previous_sample =
sign_extend(bytestream2_get_le16(&gb), 16);
1053 for (count1 = 0; count1 < nb_samples / 28; count1++) {
1054 int byte = bytestream2_get_byte(&gb);
1056 current_sample =
sign_extend(bytestream2_get_be16(&gb), 16);
1057 previous_sample =
sign_extend(bytestream2_get_be16(&gb), 16);
1059 for (count2=0; count2<28; count2++)
1060 *samplesC++ =
sign_extend(bytestream2_get_be16(&gb), 16);
1064 shift = 20 - (byte & 0x0F);
1066 for (count2=0; count2<28; count2++) {
1070 byte = bytestream2_get_byte(&gb);
1074 next_sample += (current_sample * coeff1) +
1075 (previous_sample * coeff2);
1076 next_sample = av_clip_int16(next_sample >> 8);
1078 previous_sample = current_sample;
1079 current_sample = next_sample;
1080 *samplesC++ = current_sample;
1086 }
else if (count != count1) {
1088 count =
FFMAX(count, count1);
1102 for (channel=0; channel<avctx->
channels; channel++) {
1103 int coeff[2][4], shift[4];
1104 int16_t *s = samples_p[channel];
1105 for (n = 0; n < 4; n++, s += 32) {
1106 int val =
sign_extend(bytestream2_get_le16u(&gb), 16);
1111 val =
sign_extend(bytestream2_get_le16u(&gb), 16);
1112 shift[n] = 20 - (val & 0x0F);
1116 for (m=2; m<32; m+=2) {
1117 s = &samples_p[channel][m];
1118 for (n = 0; n < 4; n++, s += 32) {
1120 int byte = bytestream2_get_byteu(&gb);
1123 pred = s[-1] * coeff[0][n] + s[-2] * coeff[1][n];
1124 s[0] = av_clip_int16((level + pred + 0x80) >> 8);
1127 pred = s[0] * coeff[0][n] + s[-1] * coeff[1][n];
1128 s[1] = av_clip_int16((level + pred + 0x80) >> 8);
1150 for (n = nb_samples >> (1 - st); n > 0; n--) {
1151 int hi, lo, v = bytestream2_get_byteu(&gb);
1166 for (n = nb_samples >> (1 - st); n > 0; n--) {
1167 int v = bytestream2_get_byteu(&gb);
1177 *samples++ = 128 * (bytestream2_get_byteu(&gb) - 0x80);
1179 *samples++ = 128 * (bytestream2_get_byteu(&gb) - 0x80);
1184 for (n = nb_samples >> (1 - st); n > 0; n--) {
1185 int byte = bytestream2_get_byteu(&gb);
1192 for (n = nb_samples / 3; n > 0; n--) {
1193 int byte = bytestream2_get_byteu(&gb);
1197 (byte >> 2) & 0x07, 3, 0);
1202 for (n = nb_samples >> (2 - st); n > 0; n--) {
1203 int byte = bytestream2_get_byteu(&gb);
1207 (byte >> 4) & 0x03, 2, 2);
1209 (byte >> 2) & 0x03, 2, 2);
1220 for (n = nb_samples >> (1 - st); n > 0; n--) {
1221 int v = bytestream2_get_byteu(&gb);
1232 for (i = 0; i < 2; i++)
1233 for (n = 0; n < 16; n++)
1234 table[i][n] =
sign_extend(bytestream2_get_be16u(&gb), 16);
1237 for (i = 0; i < 2; i++)
1238 for (n = 0; n < 2; n++)
1239 prev[i][n] =
sign_extend(bytestream2_get_be16u(&gb), 16);
1241 for (ch = 0; ch <= st; ch++) {
1242 samples = samples_p[ch];
1245 for (i = 0; i < nb_samples / 14; i++) {
1246 int byte = bytestream2_get_byteu(&gb);
1247 int index = (byte >> 4) & 7;
1248 unsigned int exp = byte & 0x0F;
1249 int factor1 = table[ch][index * 2];
1250 int factor2 = table[ch][index * 2 + 1];
1253 for (n = 0; n < 14; n++) {
1259 byte = bytestream2_get_byteu(&gb);
1263 sampledat = ((prev[ch][0]*factor1
1264 + prev[ch][1]*factor2) >> 11) + (sampledat << exp);
1265 *samples = av_clip_int16(sampledat);
1266 prev[ch][1] = prev[ch][0];
1267 prev[ch][0] = *samples++;
1292 #define ADPCM_DECODER(id_, sample_fmts_, name_, long_name_) \ 1293 AVCodec ff_ ## name_ ## _decoder = { \ 1295 .long_name = NULL_IF_CONFIG_SMALL(long_name_), \ 1296 .type = AVMEDIA_TYPE_AUDIO, \ 1298 .priv_data_size = sizeof(ADPCMDecodeContext), \ 1299 .init = adpcm_decode_init, \ 1300 .decode = adpcm_decode_frame, \ 1301 .capabilities = CODEC_CAP_DR1, \ 1302 .sample_fmts = sample_fmts_, \ const struct AVCodec * codec
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static short adpcm_sbpro_expand_nibble(ADPCMChannelStatus *c, char nibble, int size, int shift)
This structure describes decoded (raw) audio or video data.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define AV_LOG_WARNING
Something somehow does not look correct.
static short adpcm_ct_expand_nibble(ADPCMChannelStatus *c, char nibble)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static enum AVSampleFormat sample_fmts_s16[]
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
static int get_sbits(GetBitContext *s, int n)
const uint8_t ff_adpcm_AdaptCoeff1[]
Divided by 4 to fit in 8-bit integers.
enum AVSampleFormat sample_fmt
audio sample format
static av_cold int adpcm_decode_init(AVCodecContext *avctx)
static void adpcm_swf_decode(AVCodecContext *avctx, const uint8_t *buf, int buf_size, int16_t *samples)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static const int xa_adpcm_table[5][2]
static int get_bits_count(const GetBitContext *s)
static av_always_inline void bytestream2_skipu(GetByteContext *g, unsigned int size)
bitstream reader API header.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
static void predictor(uint8_t *src, int size)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
ADPCM encoder/decoder common header.
static short adpcm_yamaha_expand_nibble(ADPCMChannelStatus *c, unsigned char nibble)
static const int ea_adpcm_table[]
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(const int16_t *) pi >> 8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(const int32_t *) pi >> 24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31)))) #define SET_CONV_FUNC_GROUP(ofmt, ifmt) static void set_generic_function(AudioConvert *ac) { } void ff_audio_convert_free(AudioConvert **ac) { if(! *ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);} AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map) { AudioConvert *ac;int in_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) return NULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method !=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt) > 2) { ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc) { av_free(ac);return NULL;} return ac;} in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar) { ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar ? ac->channels :1;} else if(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;else ac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);return ac;} int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in) { int use_generic=1;int len=in->nb_samples;int p;if(ac->dc) { av_dlog(ac->avr, "%d samples - audio_convert: %s to %s (dithered)\", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));return ff_convert_dither(ac-> in
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
const int16_t ff_adpcm_step_table[89]
This is the step table.
static int adpcm_ima_qt_expand_nibble(ADPCMChannelStatus *c, int nibble, int shift)
static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g)
void av_log(void *avcl, int level, const char *fmt,...)
ADPCMChannelStatus status[6]
static void filter(MpegAudioContext *s, int ch, const short *samples, int incr)
const int8_t ff_adpcm_index_table[16]
static int xa_decode(AVCodecContext *avctx, int16_t *out0, int16_t *out1, const uint8_t *in, ADPCMChannelStatus *left, ADPCMChannelStatus *right, int channels, int sample_offset)
const int8_t ff_adpcm_AdaptCoeff2[]
Divided by 4 to fit in 8-bit integers.
int vqa_version
VQA version.
static enum AVSampleFormat sample_fmts_s16p[]
static short adpcm_ima_expand_nibble(ADPCMChannelStatus *c, char nibble, int shift)
static const float pred[4]
static const int swf_index_tables[4][16]
static av_always_inline int bytestream2_tell(GetByteContext *g)
const int16_t ff_adpcm_AdaptationTable[]
Libavcodec external API header.
AVSampleFormat
Audio Sample Formats.
static short adpcm_ms_expand_nibble(ADPCMChannelStatus *c, int nibble)
main external API structure.
#define DK3_GET_NEXT_NIBBLE()
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
static av_const int sign_extend(int val, unsigned bits)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb, int buf_size, int *coded_samples)
Get the number of samples that will be decoded from the packet.
const int8_t ff_adpcm_yamaha_difflookup[]
common internal api header.
const int16_t ff_adpcm_yamaha_indexscale[]
static int adpcm_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
int channels
number of audio channels
static av_always_inline int bytestream2_seek(GetByteContext *g, int offset, int whence)
static enum AVSampleFormat sample_fmts_both[]
uint8_t ** extended_data
pointers to the data planes/channels.
This structure stores compressed data.
int nb_samples
number of audio samples (per channel) described by this frame
#define ADPCM_DECODER(id_, sample_fmts_, name_, long_name_)