51 int packets = 0,
frames = 0, first_packet = 0, eof = 0,
ret;
57 const int at_limit =
limit && packets ==
limit;
59 if (at_limit && !next_path)
63 if (
limit && !at_limit)
87 first_packet = packets + eof;
97 (
const uint8_t *
const *)
frame->data,
107 printf(
"first output after %d packet(s) plus thread delay\n",
108 first_packet -
ctx->delay);
110 printf(
"%d frames, checksum %08" PRIx32
"\n",
frames, checksum);
134 ctx->thread_count = threads;
138 fprintf(stderr,
"Could not activate frame threading\n");
153 threads = atoi(argv[1]);
182 for (
int video_delay = 0; video_delay <= 1; video_delay++) {
Public header for Adler-32 hash function implementation.
static AVCodecContext * open_decoder(int threads, int video_delay)
static void decode(AVCodecContext *ctx, const char *path, const char *next_path, int limit, int report)
static AVFormatContext * ctx
Libavcodec external API header.
#define FF_THREAD_FRAME
Decode more than one frame at once.
AVCodecParameters * avcodec_parameters_alloc(void)
void avcodec_parameters_free(AVCodecParameters **ppar)
int avcodec_parameters_to_context(AVCodecContext *codec, const AVCodecParameters *par)
__device__ int printf(const char *,...)
int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
Initialize the AVCodecContext to use the given AVCodec.
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
const AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
void avcodec_free_context(AVCodecContext **avctx)
Free the codec context and everything associated with it and write NULL to the provided pointer.
int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
Alias for avcodec_receive_frame_flags(avctx, frame, 0).
int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt)
Supply raw packet data as input to a decoder.
void avcodec_flush_buffers(AVCodecContext *avctx)
Reset the internal codec state / flush internal buffers.
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
const AVInputFormat * av_find_input_format(const char *short_name)
Find AVInputFormat based on the short name of the input format.
int av_read_frame(AVFormatContext *s, AVPacket *pkt)
Return the next frame of a stream.
int avformat_open_input(AVFormatContext **ps, const char *url, const AVInputFormat *fmt, AVDictionary **options)
Open an input stream and read the header.
void avformat_close_input(AVFormatContext **s)
Close an opened input AVFormatContext.
AVAdler av_adler32_update(AVAdler adler, const uint8_t *buf, size_t len)
Calculate the Adler32 checksum of a buffer.
#define AVERROR_EOF
End of file.
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_log_set_level(int level)
Set the log level.
int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height, int align)
Return the size in bytes of the amount of data required to store an image with the given parameters.
int av_image_copy_to_buffer(uint8_t *dst, int dst_size, const uint8_t *const src_data[4], const int src_linesize[4], enum AVPixelFormat pix_fmt, int width, int height, int align)
Copy image data from an image into a buffer.
Memory handling functions.
#define check(x, y, S, v)
main external API structure.
This struct describes the properties of an encoded stream.
enum AVMediaType codec_type
General type of the encoded data.
int video_delay
Number of delayed frames.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.
static double limit(double x)