79 const uint8_t *
src[4];
103 fprintf(stderr,
"mismatch frame %"PRId64
" seed %u\n",
119 const char *filename;
124 "Usage: %s <input file> <dst width> <dst height> <dst pixfmt> [<random seed>] \n",
129 memset(&pd, 0,
sizeof(pd));
147 for (
int i = 0;
i < 2;
i++) {
150 fprintf(stderr,
"Error allocating frames\n");
160 fprintf(stderr,
"Error allocating frame data\n");
165 for (
int j = 0; j < 4 &&
frame->data[j]; j++) {
167 memset(
frame->data[j], 0,
174 ret =
ds_open(&dc, filename, 0);
176 fprintf(stderr,
"Error opening the file\n");
Libavcodec external API header.
#define i(width, name, range_min, range_max)
common internal and external API header
int ds_open(DecodeContext *dc, const char *url, int stream_idx)
void ds_free(DecodeContext *dc)
int ds_run(DecodeContext *dc)
static enum AVPixelFormat pix_fmt
static av_always_inline int process_frame(AVTextFormatContext *tfc, InputFile *ifile, AVFrame *frame, const AVPacket *pkt, int *packet_new)
uint32_t av_get_random_seed(void)
Get a seed to use in conjunction with random functions.
int av_frame_get_buffer(AVFrame *frame, int align)
Allocate new buffer(s) for audio or video data.
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.
int attribute_align_arg sws_scale(SwsContext *sws, const uint8_t *const srcSlice[], const int srcStride[], int srcSliceY, int srcSliceH, uint8_t *const dst[], const int dstStride[])
swscale wrapper, so we don't need to export the SwsContext.
SwsContext * sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat, int dstW, int dstH, enum AVPixelFormat dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param)
Allocate and return an SwsContext.
void sws_freeContext(SwsContext *swsContext)
Free the swscaler context swsContext.
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
static int shift(int a, int b)
int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
Utility function to access log2_chroma_w log2_chroma_h from the pixel format AVPixFmtDescriptor.
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
AVPixelFormat
Pixel format.
static int process_frame(DecodeContext *dc, AVFrame *frame)
#define FF_ARRAY_ELEMS(a)
int64_t frame_num
Frame counter, set by libavcodec.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
Context structure for the Lagged Fibonacci PRNG.
int(* process_frame)(struct DecodeContext *dc, AVFrame *frame)
struct SwsContext * scaler
Main external API structure.
static int slice_start(SliceContext *sc, VVCContext *s, VVCFrameContext *fc, const CodedBitstreamUnit *unit, const int is_first_slice)