Go to the documentation of this file.
48 if (!(
s->extra_samples =
av_malloc(8 * 3 * 4)))
66 static const uint32_t frequencies[4] = { 48000, 96000, 44100, 32000 };
71 if (
s->last_header == header_int)
85 s->extra_sample_count = 0;
91 "PCM DVD unsupported sample depth %i\n",
113 s->samples_per_block = 1;
122 s->samples_per_block = 4 / avctx->
channels;
123 s->groups_per_block = 1;
128 s->samples_per_block = 1;
129 s->groups_per_block = 2;
135 s->samples_per_block = 4;
143 "pcm_dvd_parse_header: %d channels, %d bits per sample, %d Hz, %"PRId64
" bit/s\n",
147 s->last_header = header_int;
153 void *dst,
int blocks)
156 int16_t *dst16 = dst;
167 dst16 += blocks *
s->block_size / 2;
171 *dst16++ = bytestream2_get_be16u(&gb);
179 for (
i = 2;
i;
i--) {
180 dst32[0] = bytestream2_get_be16u(&gb) << 16;
181 dst32[1] = bytestream2_get_be16u(&gb) << 16;
182 t = bytestream2_get_byteu(&gb);
183 *dst32++ += (t & 0xf0) << 8;
184 *dst32++ += (t & 0x0f) << 12;
189 for (
i =
s->groups_per_block;
i;
i--) {
190 dst32[0] = bytestream2_get_be16u(&gb) << 16;
191 dst32[1] = bytestream2_get_be16u(&gb) << 16;
192 dst32[2] = bytestream2_get_be16u(&gb) << 16;
193 dst32[3] = bytestream2_get_be16u(&gb) << 16;
194 t = bytestream2_get_byteu(&gb);
195 *dst32++ += (t & 0xf0) << 8;
196 *dst32++ += (t & 0x0f) << 12;
197 t = bytestream2_get_byteu(&gb);
198 *dst32++ += (t & 0xf0) << 8;
199 *dst32++ += (t & 0x0f) << 12;
207 for (
i = 2;
i;
i--) {
208 dst32[0] = bytestream2_get_be16u(&gb) << 16;
209 dst32[1] = bytestream2_get_be16u(&gb) << 16;
210 *dst32++ += bytestream2_get_byteu(&gb) << 8;
211 *dst32++ += bytestream2_get_byteu(&gb) << 8;
216 for (
i =
s->groups_per_block;
i;
i--) {
217 dst32[0] = bytestream2_get_be16u(&gb) << 16;
218 dst32[1] = bytestream2_get_be16u(&gb) << 16;
219 dst32[2] = bytestream2_get_be16u(&gb) << 16;
220 dst32[3] = bytestream2_get_be16u(&gb) << 16;
221 *dst32++ += bytestream2_get_byteu(&gb) << 8;
222 *dst32++ += bytestream2_get_byteu(&gb) << 8;
223 *dst32++ += bytestream2_get_byteu(&gb) << 8;
224 *dst32++ += bytestream2_get_byteu(&gb) << 8;
235 int *got_frame_ptr,
AVPacket *avpkt)
239 int buf_size = avpkt->
size;
252 if (
s->last_block_size &&
s->last_block_size !=
s->block_size) {
254 s->extra_sample_count = 0;
256 s->last_block_size =
s->block_size;
260 blocks = (buf_size +
s->extra_sample_count) /
s->block_size;
263 frame->nb_samples = blocks *
s->samples_per_block;
266 dst =
frame->data[0];
269 if (
s->extra_sample_count) {
270 int missing_samples =
s->block_size -
s->extra_sample_count;
271 if (buf_size >= missing_samples) {
272 memcpy(
s->extra_samples +
s->extra_sample_count,
src,
275 src += missing_samples;
276 buf_size -= missing_samples;
277 s->extra_sample_count = 0;
281 memcpy(
s->extra_samples +
s->extra_sample_count,
src, buf_size);
282 s->extra_sample_count += buf_size;
290 buf_size -= blocks *
s->block_size;
295 src += blocks *
s->block_size;
296 memcpy(
s->extra_samples,
src, buf_size);
297 s->extra_sample_count = buf_size;
#define AV_LOG_WARNING
Something somehow does not look correct.
static av_cold int init(AVCodecContext *avctx)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
int sample_rate
samples per second
static enum AVSampleFormat sample_fmts[]
This structure describes decoded (raw) audio or video data.
AVCodec ff_pcm_dvd_decoder
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new samples
static av_cold int pcm_dvd_decode_uninit(AVCodecContext *avctx)
#define FF_DEBUG_PICT_INFO
static int pcm_dvd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
int64_t bit_rate
the average bitrate
static void * pcm_dvd_decode_samples(AVCodecContext *avctx, const uint8_t *src, void *dst, int blocks)
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
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() for allocating buffers and supports custom allocators.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
enum AVSampleFormat sample_fmt
audio sample format
static const uint8_t header[24]
int channels
number of audio channels
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
#define i(width, name, range_min, range_max)
AVSampleFormat
Audio sample formats.
@ AV_SAMPLE_FMT_S16
signed 16 bits
const char * name
Name of the codec implementation.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
main external API structure.
static int pcm_dvd_parse_header(AVCodecContext *avctx, const uint8_t *header)
This structure stores compressed data.
static av_cold int pcm_dvd_decode_init(AVCodecContext *avctx)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
@ AV_SAMPLE_FMT_S32
signed 32 bits