Go to the documentation of this file.
38 (max_frames == 0 ||
decoder->frame_number < max_frames)) {
43 return (
ret == ret_done) ? 0 :
ret;
45 fprintf(stdout,
"frame %d\n",
decoder->frame_number - 1);
51 fprintf(stdout,
"AVVideoEncParams %d\n", par->
type);
52 fprintf(stdout,
"qp %d\n", par->
qp);
56 fprintf(stdout,
"delta_qp[%d][%d] %"PRId32
"\n",
i, j, par->
delta_qp[
i][j]);
60 fprintf(stdout,
"nb_blocks %d\n", par->
nb_blocks);
64 fprintf(stdout,
"block %d %d:%d %dx%d %"PRId32
"\n",
65 i,
b->src_x,
b->src_y,
b->w,
b->h,
b->delta_qp);
72 if (max_frames &&
decoder->frame_number == max_frames)
76 return (max_frames == 0 ||
decoder->frame_number < max_frames) ? 0 : 1;
85 if (stream_idx < 0 || stream_idx >= demuxer->
nb_streams)
103 int main(
int argc,
char **argv)
112 unsigned int stream_idx, max_frames;
113 const char *filename, *thread_type =
NULL, *nb_threads =
NULL;
117 fprintf(stderr,
"Usage: %s <input file> <stream index> <max frame count> [<thread count> <thread type>]\n", argv[0]);
122 stream_idx = strtol(argv[2],
NULL, 0);
123 max_frames = strtol(argv[3],
NULL, 0);
125 nb_threads = argv[4];
126 thread_type = argv[5];
135 fprintf(stderr,
"Error opening input file: %d\n",
ret);
141 fprintf(stderr,
"Error initializing decoder\n");
163 fprintf(stderr,
"Error decoding: %d\n",
ret);
170 fprintf(stderr,
"Error decoding: %d\n",
ret);
172 }
else if (
ret > 0) {
182 fprintf(stderr,
"Error flushing: %d\n",
ret);
int32_t qp
Base quantisation parameter for the frame.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
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
AVFrameSideData * av_frame_get_side_data(const AVFrame *frame, enum AVFrameSideDataType type)
#define AVERROR_EOF
End of file.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
This structure describes decoded (raw) audio or video data.
AVStream ** streams
A list of all streams in the file.
int av_read_frame(AVFormatContext *s, AVPacket *pkt)
Return the next frame of a stream.
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
void avformat_close_input(AVFormatContext **s)
Close an opened input AVFormatContext.
static const chunk_decoder decoder[8]
int32_t delta_qp[4][2]
Quantisation parameter offset from the base (per-frame) qp for a given plane (first index) and AC/DC ...
Video encoding parameters for a given frame.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
#define FF_ARRAY_ELEMS(a)
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
Return decoded output data from a decoder.
enum AVVideoEncParamsType type
Type of the parameters (the codec they are used with).
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static void flush(AVCodecContext *avctx)
static int decoder_init(AVFormatContext *demuxer, int stream_idx, AVCodecContext **dec, AVDictionary **opts)
void avcodec_free_context(AVCodecContext **avctx)
Free the codec context and everything associated with it and write NULL to the provided pointer.
int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
Initialize the AVCodecContext to use the given AVCodec.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
unsigned int nb_blocks
Number of blocks in the array.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt)
Supply raw packet data as input to a decoder.
int avformat_open_input(AVFormatContext **ps, const char *url, ff_const59 AVInputFormat *fmt, AVDictionary **options)
Open an input stream and read the header.
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
Data structure for storing block-level encoding information.
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
AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
main external API structure.
@ AV_FRAME_DATA_VIDEO_ENC_PARAMS
Encoding parameters for a video frame, as described by AVVideoEncParams.
#define AVERROR_DECODER_NOT_FOUND
Decoder not found.
Structure to hold side data for an AVFrame.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
static av_always_inline AVVideoBlockParams * av_video_enc_params_block(AVVideoEncParams *par, unsigned int idx)
static int decode_read(AVCodecContext *decoder, AVFrame *frame, int flush, int max_frames)
int main(int argc, char **argv)