41 -9, -8, -6, -5, -4, -3, -2, -1,
42 0, 1, 2, 3, 4, 5, 6, 8
57 const uint8_t *buf = avpkt->
data;
58 int buf_size = avpkt->
size;
77 if (in_size > buf_size) {
86 samples =
frame->data[0];
95 while (samples < samples_end && buf - avpkt->
data < buf_size) {
104 case 0: smp = 4 * (count + 1);
break;
105 case 1: smp = 2 * (count + 1);
break;
106 case 2: smp = (count & 0x20) ? 1 : count + 1;
break;
107 default: smp = count + 1;
break;
109 if (samples_end - samples < smp)
113 size = ((
code == 2 && (count & 0x20)) ||
code == 3) ? 0 : count + 1;
114 if ((buf - avpkt->
data) +
size > buf_size)
119 for (count++; count > 0; count--) {
136 for (count++; count > 0; count--) {
155 memcpy(samples, buf, smp);
162 memset(samples,
sample, smp);
const FFCodec ff_ws_snd1_decoder
Libavcodec external API header.
Public libavutil channel layout APIs header.
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
common internal and external API header
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
@ AV_CODEC_ID_WESTWOOD_SND1
#define AV_CHANNEL_LAYOUT_MONO
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
@ AV_SAMPLE_FMT_U8
unsigned 8 bits
An AVChannelLayout holds information about the channel layout of audio data.
main external API structure.
AVChannelLayout ch_layout
Audio channel layout.
enum AVSampleFormat sample_fmt
audio sample format
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.
static const int8_t ws_adpcm_4bit[]
static av_cold int ws_snd_decode_init(AVCodecContext *avctx)
static int ws_snd_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)