65 static const uint32_t frequencies[4] = { 48000, 96000, 44100, 32000 };
67 int header_int = (header[0] & 0xe0) | (header[1] << 8) | (header[2] << 16);
74 av_dlog(avctx,
"pcm_dvd_parse_header: header = %02x%02x%02x\n",
75 header[0], header[1], header[2]);
96 avctx->
sample_rate = frequencies[header[1] >> 4 & 3];
99 avctx->
channels = 1 + (header[1] & 7);
139 "pcm_dvd_parse_header: %d channels, %d bits per sample, %d Hz, %d bit/s\n",
149 void *dst,
int blocks)
152 int16_t *dst16 = dst;
168 *dst16++ = bytestream2_get_be16u(&gb);
175 dst32[0] = bytestream2_get_be16u(&gb) << 16;
176 dst32[1] = bytestream2_get_be16u(&gb) << 16;
177 dst32[2] = bytestream2_get_be16u(&gb) << 16;
178 dst32[3] = bytestream2_get_be16u(&gb) << 16;
179 t = bytestream2_get_byteu(&gb);
180 *dst32++ += (t & 0xf0) << 8;
181 *dst32++ += (t & 0x0f) << 12;
182 t = bytestream2_get_byteu(&gb);
183 *dst32++ += (t & 0xf0) << 8;
184 *dst32++ += (t & 0x0f) << 12;
191 dst32[0] = bytestream2_get_be16u(&gb) << 16;
192 dst32[1] = bytestream2_get_be16u(&gb) << 16;
193 dst32[2] = bytestream2_get_be16u(&gb) << 16;
194 dst32[3] = bytestream2_get_be16u(&gb) << 16;
195 *dst32++ += bytestream2_get_byteu(&gb) << 8;
196 *dst32++ += bytestream2_get_byteu(&gb) << 8;
197 *dst32++ += bytestream2_get_byteu(&gb) << 8;
198 *dst32++ += bytestream2_get_byteu(&gb) << 8;
208 int *got_frame_ptr,
AVPacket *avpkt)
212 int buf_size = avpkt->
size;
236 dst = frame->
data[0];
241 if (buf_size >= missing_samples) {
245 src += missing_samples;
246 buf_size -= missing_samples;
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
static av_cold int pcm_dvd_decode_uninit(AVCodecContext *avctx)
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
av_dlog(ac->avr,"%d samples - audio_convert: %s to %s (%s)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic?ac->func_descr_generic:ac->func_descr)
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
enum AVSampleFormat sample_fmt
audio sample format
const char * name
Name of the codec implementation.
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
static void * pcm_dvd_decode_samples(AVCodecContext *avctx, const uint8_t *src, void *dst, int blocks)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int pcm_dvd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
Libavcodec external API header.
int bit_rate
the average bitrate
void * av_malloc(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
if(ac->has_optimized_func)
AVSampleFormat
Audio Sample Formats.
int sample_rate
samples per second
main external API structure.
static void close(AVCodecParserContext *s)
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#define FF_DEBUG_PICT_INFO
static av_cold int pcm_dvd_decode_init(AVCodecContext *avctx)
common internal api header.
static av_cold int init(AVCodecParserContext *s)
int channels
number of audio channels
This structure stores compressed data.
int nb_samples
number of audio samples (per channel) described by this frame
static int pcm_dvd_parse_header(AVCodecContext *avctx, const uint8_t *header)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AVCodec ff_pcm_dvd_decoder