54 s->is_pal =
s->block_size == 8640;
60 const unsigned a =
s->is_pal ? 18 : 15;
61 const unsigned b = 3 *
a;
63 s->shuffle[
i] = 80 * ((21 * (
i % 3) + 9 * (
i / 3) + ((
i /
a) % 3)) %
b) +
64 (2 +
s->is_12bit) * (
i /
b) + 8;
72 uint16_t
shift, result;
77 if (shift < 0x2 || shift > 0xd) {
79 }
else if (
shift < 0x8) {
115 *dst++ =
AV_RB16(&v[
s->is_pal ? 4320 : 3600]);
121 return s->block_size;
Libavcodec external API header.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
static int dv_get_audio_sample_count(const uint8_t *buffer, int dsf)
static uint16_t dv_audio_12to16(uint16_t sample)
AVCodec ff_dvaudio_decoder
static av_cold int decode_init(AVCodecContext *avctx)
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *pkt)
#define AV_CH_LAYOUT_STEREO
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
@ AV_SAMPLE_FMT_S16
signed 16 bits
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define FF_ARRAY_ELEMS(a)
static int shift(int a, int b)
main external API structure.
enum AVSampleFormat sample_fmt
audio sample format
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
int channels
number of audio channels
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs.
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.