FFmpeg
Loading...
Searching...
No Matches
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 "libavutil/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 (AVRefStructOpaque unused, void *obj)
 
static int av_cold mpv_pic_init (AVRefStructOpaque opaque, void *obj)
 
static void av_cold mpv_pic_free (AVRefStructOpaque unused, void *obj)
 
av_cold AVRefStructPoolff_mpv_alloc_pic_pool (int init_progress)
 Allocate a pool of MPVPictures.
 
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.
 

Macro Definition Documentation

◆ EMU_EDGE_HEIGHT

#define EMU_EDGE_HEIGHT   (4 * 70)

Referenced by ff_mpv_framesize_alloc().

◆ GET_BUFFER

#define GET_BUFFER ( name,
buf_suffix,
idx_suffix )
Value:
do { \
pic->name ## buf_suffix idx_suffix = av_refstruct_pool_get(pools->name ## _pool); \
if (!pic->name ## buf_suffix idx_suffix) \
return AVERROR(ENOMEM); \
} while (0)
#define AVERROR(e)
Definition error.h:45
void * av_refstruct_pool_get(AVRefStructPool *pool)
Get an object from the pool, reusing an old one from the pool when available.
Definition refstruct.c:297

Referenced by alloc_picture_tables().

Function Documentation

◆ mpv_pic_reset()

static void mpv_pic_reset ( AVRefStructOpaque 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 ( AVRefStructOpaque 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 ( AVRefStructOpaque 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 AVRefStructPool * 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()

◆ 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().