51 s->is_pal =
s->block_size == 8640;
58 const unsigned a =
s->is_pal ? 18 : 15;
59 const unsigned b = 3 *
a;
61 s->shuffle[
i] = 80 * ((21 * (
i % 3) + 9 * (
i / 3) + ((
i /
a) % 3)) %
b) +
62 (2 +
s->is_12bit) * (
i /
b) + 8;
70 uint16_t
shift, result;
77 }
else if (
shift < 0x8) {
92 const uint8_t *
src =
pkt->data;
96 if (
pkt->size <
s->block_size)
104 for (
i = 0;
i <
frame->nb_samples;
i++) {
105 const uint8_t *v = &
src[
s->shuffle[
i]];
118 return s->block_size;
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
const FFCodec ff_dvaudio_decoder
Libavcodec external API header.
#define i(width, name, range_min, range_max)
Public libavutil channel layout APIs header.
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
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)
static av_cold int decode_init(AVCodecContext *avctx)
static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *pkt)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AV_CHANNEL_LAYOUT_STEREO
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.
@ AV_SAMPLE_FMT_S16
signed 16 bits
static av_cold int decode_init(AVCodecContext *avctx)
static int decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt)
static int shift(int a, int b)
#define FF_ARRAY_ELEMS(a)
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
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 block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs.
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.