40 -9, -8, -6, -5, -4, -3, -2, -1,
41 0, 1, 2, 3, 4, 5, 6, 8
58 int buf_size = avpkt->
size;
77 if (in_size > buf_size) {
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);
Libavcodec external API header.
audio channel layout utility functions
common internal and external API header
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#define AV_CH_LAYOUT_MONO
#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 AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
main external API structure.
enum AVSampleFormat sample_fmt
audio sample format
int channels
number of audio channels
uint64_t channel_layout
Audio channel layout.
const char * name
Name of the codec implementation.
This structure describes decoded (raw) audio or video data.
int nb_samples
number of audio samples (per channel) described by this frame
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
This structure stores compressed data.
static const int8_t ws_adpcm_4bit[]
static int ws_snd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
static av_cold int ws_snd_decode_init(AVCodecContext *avctx)
AVCodec ff_ws_snd1_decoder