44 for (
int i = 0;
i < 2;
i++) {
70 int ret, init_progress = (uintptr_t)opaque.
nc;
94 (
void*)(uintptr_t)init_progress,
101 memset(pic, 0,
sizeof(*pic));
114 for (
int i = 0;
i < 2;
i++) {
132 memset(wpic, 0,
sizeof(*wpic));
141# define EMU_EDGE_HEIGHT (4 * 70)
142 int linesizeabs =
FFABS(linesize);
143 int alloc_size =
FFALIGN(linesizeabs + 64, 32);
145 if (linesizeabs <= sc->linesize)
151 if (linesizeabs < 24) {
182 ptrdiff_t *linesizep, ptrdiff_t *uvlinesizep)
184 ptrdiff_t linesize = *linesizep, uvlinesize = *uvlinesizep;
186 if ((linesize && linesize !=
f->linesize[0]) ||
187 (uvlinesize && uvlinesize !=
f->linesize[1])) {
189 "linesize=%td/%d uvlinesize=%td/%d)\n",
190 linesize,
f->linesize[0],
191 uvlinesize,
f->linesize[1]);
196 f->linesize[1] !=
f->linesize[2]) {
200 *linesizep =
f->linesize[0];
201 *uvlinesizep =
f->linesize[1];
209#define GET_BUFFER(name, buf_suffix, idx_suffix) do { \
210 pic->name ## buf_suffix idx_suffix = av_refstruct_pool_get(pools->name ## _pool); \
211 if (!pic->name ## buf_suffix idx_suffix) \
212 return AVERROR(ENOMEM); \
219 for (
int i = 0;
i < 2;
i++) {
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
Libavcodec external API header.
#define i(width, name, range_min, range_max)
common internal and external API header
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
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.
int av_image_check_size2(unsigned int w, unsigned int h, int64_t max_pixels, enum AVPixelFormat pix_fmt, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of a plane of an image with...
#define FF_ALLOCZ_TYPED_ARRAY(p, nelem)
Memory handling functions.
void ff_mpv_unref_picture(MPVWorkPicture *pic)
void ff_mpv_workpic_from_pic(MPVWorkPicture *wpic, MPVPicture *pic)
int ff_mpv_pic_check_linesize(void *logctx, const AVFrame *f, ptrdiff_t *linesizep, ptrdiff_t *uvlinesizep)
static void mpv_pic_reset(AVRefStructOpaque unused, void *obj)
static int alloc_picture_tables(BufferPoolContext *pools, MPVPicture *pic, int mb_height)
int ff_mpv_alloc_pic_accessories(AVCodecContext *avctx, MPVWorkPicture *wpic, ScratchpadContext *sc, BufferPoolContext *pools, int mb_height)
Allocate an MPVPicture's accessories (but not the AVFrame's buffer itself) and set the MPVWorkPicture...
av_cold AVRefStructPool * ff_mpv_alloc_pic_pool(int init_progress)
Allocate a pool of MPVPictures.
static void set_workpic_from_pic(MPVWorkPicture *wpic, const MPVPicture *pic)
static int av_cold mpv_pic_init(AVRefStructOpaque opaque, void *obj)
#define GET_BUFFER(name, buf_suffix, idx_suffix)
static void av_cold mpv_pic_free(AVRefStructOpaque unused, void *obj)
void ff_mpv_replace_picture(MPVWorkPicture *dst, const MPVWorkPicture *src)
int ff_mpv_framesize_alloc(AVCodecContext *avctx, ScratchpadContext *sc, int linesize)
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
void av_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...
void av_refstruct_replace(void *dstp, const void *src)
Ensure *dstp refers to the same object as src.
#define AV_REFSTRUCT_POOL_FLAG_FREE_ON_INIT_ERROR
If this flag is set and both init_cb and free_entry_cb callbacks are provided, then free_cb will be c...
static AVRefStructPool * av_refstruct_pool_alloc_ext(size_t size, unsigned flags, void *opaque, int(*init_cb)(AVRefStructOpaque opaque, void *obj), void(*reset_cb)(AVRefStructOpaque opaque, void *obj), void(*free_entry_cb)(AVRefStructOpaque opaque, void *obj), void(*free_cb)(AVRefStructOpaque opaque))
A wrapper around av_refstruct_pool_alloc_ext_c() for the common case of a non-const qualified opaque.
main external API structure.
int64_t max_pixels
The number of pixels per image to maximally accept.
const struct AVHWAccel * hwaccel
Hardware accelerator in use.
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...
AVRefStructPool is an API for a thread-safe pool of objects managed via the RefStruct API.
struct AVRefStructPool * mbskip_table_pool
int alloc_mb_width
mb_width used to allocate tables
struct AVRefStructPool * motion_val_pool
int alloc_mb_stride
mb_stride used to allocate tables
int16_t(*[2] motion_val_base)[2]
int dummy
Picture is a dummy and should not be output.
uint32_t * mb_type
types and macros are defined in mpegutils.h
int display_picture_number
int field_picture
whether or not the picture was encoded in separate fields
void * hwaccel_picture_private
RefStruct reference for hardware accelerator private data.
int mb_height
mb_height of the tables
int mb_stride
mb_stride of the tables
int16_t(*[2] motion_val)[2]
int mb_width
mb_width of the tables
int8_t * qscale_table_base
uint32_t * mb_type
types and macros are defined in mpegutils.h
MPVPicture * ptr
RefStruct reference.
int16_t(*[2] motion_val)[2]
ptrdiff_t linesize[MPV_MAX_PLANES]
uint8_t * data[MPV_MAX_PLANES]
int linesize
linesize that the buffers in this context have been allocated for
uint8_t * edge_emu_buffer
temporary buffer for if MVs point to out-of-frame data
uint8_t * obmc_scratchpad
uint8_t * scratchpad_buf
the other *_scratchpad point into this buffer
av_cold void ff_thread_progress_destroy(ThreadProgress *pro)
Destroy a ThreadProgress.
av_cold int ff_thread_progress_init(ThreadProgress *pro, int init_mode)
Initialize a ThreadProgress.
static void ff_thread_progress_reset(ThreadProgress *pro)
Reset the ThreadProgress.progress counter; must only be called if the ThreadProgress is not in use in...
RefStruct is an API for creating reference-counted objects with minimal overhead.