FFmpeg
Macros | Functions
mpegpicture.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/mem.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "mpegpicture.h"
#include "refstruct.h"

Go to the source code of this file.

Macros

#define EMU_EDGE_HEIGHT   (4 * 70)
 
#define GET_BUFFER(name, buf_suffix, idx_suffix)
 

Functions

static void mpv_pic_reset (FFRefStructOpaque unused, void *obj)
 
static int av_cold mpv_pic_init (FFRefStructOpaque opaque, void *obj)
 
static void av_cold mpv_pic_free (FFRefStructOpaque unused, void *obj)
 
av_cold FFRefStructPoolff_mpv_alloc_pic_pool (int init_progress)
 Allocate a pool of MPVPictures. More...
 
void ff_mpv_unref_picture (MPVWorkPicture *pic)
 
static void set_workpic_from_pic (MPVWorkPicture *wpic, const MPVPicture *pic)
 
void ff_mpv_replace_picture (MPVWorkPicture *dst, const MPVWorkPicture *src)
 
void ff_mpv_workpic_from_pic (MPVWorkPicture *wpic, MPVPicture *pic)
 
int ff_mpv_framesize_alloc (AVCodecContext *avctx, ScratchpadContext *sc, int linesize)
 
int ff_mpv_pic_check_linesize (void *logctx, const AVFrame *f, ptrdiff_t *linesizep, ptrdiff_t *uvlinesizep)
 
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's fields. More...
 

Macro Definition Documentation

◆ EMU_EDGE_HEIGHT

#define EMU_EDGE_HEIGHT   (4 * 70)

◆ GET_BUFFER

#define GET_BUFFER (   name,
  buf_suffix,
  idx_suffix 
)
Value:
do { \
pic->name ## buf_suffix idx_suffix = ff_refstruct_pool_get(pools->name ## _pool); \
if (!pic->name ## buf_suffix idx_suffix) \
return AVERROR(ENOMEM); \
} while (0)

Function Documentation

◆ mpv_pic_reset()

static void mpv_pic_reset ( FFRefStructOpaque  unused,
void *  obj 
)
static

Definition at line 31 of file mpegpicture.c.

Referenced by ff_mpv_alloc_pic_pool().

◆ mpv_pic_init()

static int av_cold mpv_pic_init ( FFRefStructOpaque  opaque,
void *  obj 
)
static

Definition at line 67 of file mpegpicture.c.

Referenced by ff_mpv_alloc_pic_pool().

◆ mpv_pic_free()

static void av_cold mpv_pic_free ( FFRefStructOpaque  unused,
void *  obj 
)
static

Definition at line 82 of file mpegpicture.c.

Referenced by ff_mpv_alloc_pic_pool().

◆ ff_mpv_alloc_pic_pool()

av_cold FFRefStructPool* ff_mpv_alloc_pic_pool ( int  init_progress)

Allocate a pool of MPVPictures.

Definition at line 90 of file mpegpicture.c.

Referenced by ff_mpv_decode_init(), and ff_mpv_encode_init().

◆ ff_mpv_unref_picture()

void ff_mpv_unref_picture ( MPVWorkPicture pic)

◆ set_workpic_from_pic()

static void set_workpic_from_pic ( MPVWorkPicture wpic,
const MPVPicture pic 
)
static

Definition at line 104 of file mpegpicture.c.

Referenced by ff_mpv_alloc_pic_accessories(), and ff_mpv_workpic_from_pic().

◆ ff_mpv_replace_picture()

void ff_mpv_replace_picture ( MPVWorkPicture dst,
const MPVWorkPicture src 
)

Definition at line 121 of file mpegpicture.c.

Referenced by ff_mpeg_update_thread_context(), and frame_start().

◆ ff_mpv_workpic_from_pic()

void ff_mpv_workpic_from_pic ( MPVWorkPicture wpic,
MPVPicture pic 
)

Definition at line 128 of file mpegpicture.c.

Referenced by ff_mpv_frame_start().

◆ ff_mpv_framesize_alloc()

int ff_mpv_framesize_alloc ( AVCodecContext avctx,
ScratchpadContext sc,
int  linesize 
)

Definition at line 138 of file mpegpicture.c.

Referenced by ff_mpv_alloc_pic_accessories(), and ff_update_duplicate_context().

◆ ff_mpv_pic_check_linesize()

int ff_mpv_pic_check_linesize ( void *  logctx,
const AVFrame f,
ptrdiff_t *  linesizep,
ptrdiff_t *  uvlinesizep 
)

Definition at line 181 of file mpegpicture.c.

Referenced by alloc_picture(), and prepare_picture().

◆ alloc_picture_tables()

static int alloc_picture_tables ( BufferPoolContext pools,
MPVPicture pic,
int  mb_height 
)
static

Definition at line 206 of file mpegpicture.c.

Referenced by ff_mpv_alloc_pic_accessories().

◆ ff_mpv_alloc_pic_accessories()

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's fields.

Definition at line 237 of file mpegpicture.c.

Referenced by alloc_picture(), and select_input_picture().

AVERROR
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
ff_refstruct_pool_get
void * ff_refstruct_pool_get(FFRefStructPool *pool)
Get an object from the pool, reusing an old one from the pool when available.
Definition: refstruct.c:297