FFmpeg  4.0
Macros | Functions
mpegpicture.c File Reference
#include <stdint.h>
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "motion_est.h"
#include "mpegpicture.h"
#include "mpegutils.h"

Go to the source code of this file.

Macros

#define MAKE_WRITABLE(table)
 
#define UPDATE_TABLE(table)
 

Functions

static int make_tables_writable (Picture *pic)
 
int ff_mpeg_framesize_alloc (AVCodecContext *avctx, MotionEstContext *me, ScratchpadContext *sc, int linesize)
 
static int alloc_frame_buffer (AVCodecContext *avctx, Picture *pic, MotionEstContext *me, ScratchpadContext *sc, int chroma_x_shift, int chroma_y_shift, int linesize, int uvlinesize)
 Allocate a frame buffer. More...
 
static int alloc_picture_tables (AVCodecContext *avctx, Picture *pic, int encoding, int out_format, int mb_stride, int mb_width, int mb_height, int b8_stride)
 
int ff_alloc_picture (AVCodecContext *avctx, Picture *pic, MotionEstContext *me, ScratchpadContext *sc, int shared, int encoding, int chroma_x_shift, int chroma_y_shift, int out_format, int mb_stride, int mb_width, int mb_height, int b8_stride, ptrdiff_t *linesize, ptrdiff_t *uvlinesize)
 Allocate a Picture. More...
 
void ff_mpeg_unref_picture (AVCodecContext *avctx, Picture *pic)
 Deallocate a picture. More...
 
int ff_update_picture_tables (Picture *dst, Picture *src)
 
int ff_mpeg_ref_picture (AVCodecContext *avctx, Picture *dst, Picture *src)
 
static int pic_is_unused (Picture *pic)
 
static int find_unused_picture (AVCodecContext *avctx, Picture *picture, int shared)
 
int ff_find_unused_picture (AVCodecContext *avctx, Picture *picture, int shared)
 
void ff_free_picture_tables (Picture *pic)
 

Macro Definition Documentation

◆ MAKE_WRITABLE

#define MAKE_WRITABLE (   table)
Value:
do {\
if (pic->table &&\
(ret = av_buffer_make_writable(&pic->table)) < 0)\
return ret;\
} while (0)
int av_buffer_make_writable(AVBufferRef **pbuf)
Create a writable reference from a given buffer reference, avoiding data copy if possible.
Definition: buffer.c:151

Referenced by make_tables_writable().

◆ UPDATE_TABLE

#define UPDATE_TABLE (   table)
Value:
do { \
if (src->table && \
(!dst->table || dst->table->buffer != src->table->buffer)) { \
av_buffer_unref(&dst->table); \
dst->table = av_buffer_ref(src->table); \
if (!dst->table) { \
ff_free_picture_tables(dst); \
return AVERROR(ENOMEM); \
} \
} \
} while (0)
#define src
Definition: vp8dsp.c:254
#define AVERROR(e)
Definition: error.h:43
AVBufferRef * av_buffer_ref(AVBufferRef *buf)
Create a new reference to an AVBuffer.
Definition: buffer.c:93

Referenced by ff_update_picture_tables().

Function Documentation

◆ make_tables_writable()

static int make_tables_writable ( Picture pic)
static

Definition at line 32 of file mpegpicture.c.

Referenced by ff_alloc_picture().

◆ ff_mpeg_framesize_alloc()

int ff_mpeg_framesize_alloc ( AVCodecContext avctx,
MotionEstContext me,
ScratchpadContext sc,
int  linesize 
)

◆ alloc_frame_buffer()

static int alloc_frame_buffer ( AVCodecContext avctx,
Picture pic,
MotionEstContext me,
ScratchpadContext sc,
int  chroma_x_shift,
int  chroma_y_shift,
int  linesize,
int  uvlinesize 
)
static

Allocate a frame buffer.

Definition at line 95 of file mpegpicture.c.

Referenced by ff_alloc_picture().

◆ alloc_picture_tables()

static int alloc_picture_tables ( AVCodecContext avctx,
Picture pic,
int  encoding,
int  out_format,
int  mb_stride,
int  mb_width,
int  mb_height,
int  b8_stride 
)
static

Definition at line 181 of file mpegpicture.c.

Referenced by ff_alloc_picture().

◆ ff_alloc_picture()

int ff_alloc_picture ( AVCodecContext avctx,
Picture pic,
MotionEstContext me,
ScratchpadContext sc,
int  shared,
int  encoding,
int  chroma_x_shift,
int  chroma_y_shift,
int  out_format,
int  mb_stride,
int  mb_width,
int  mb_height,
int  b8_stride,
ptrdiff_t *  linesize,
ptrdiff_t *  uvlinesize 
)

Allocate a Picture.

The pixels are allocated/set by calling get_buffer() if shared = 0

Definition at line 231 of file mpegpicture.c.

Referenced by alloc_picture().

◆ ff_mpeg_unref_picture()

void ff_mpeg_unref_picture ( AVCodecContext avctx,
Picture pic 
)

◆ ff_update_picture_tables()

int ff_update_picture_tables ( Picture dst,
Picture src 
)

Definition at line 316 of file mpegpicture.c.

Referenced by ff_mpeg_ref_picture().

◆ ff_mpeg_ref_picture()

int ff_mpeg_ref_picture ( AVCodecContext avctx,
Picture dst,
Picture src 
)

◆ pic_is_unused()

static int pic_is_unused ( Picture pic)
inlinestatic

Definition at line 404 of file mpegpicture.c.

Referenced by find_unused_picture().

◆ find_unused_picture()

static int find_unused_picture ( AVCodecContext avctx,
Picture picture,
int  shared 
)
static

Definition at line 413 of file mpegpicture.c.

Referenced by ff_find_unused_picture().

◆ ff_find_unused_picture()

int ff_find_unused_picture ( AVCodecContext avctx,
Picture picture,
int  shared 
)

◆ ff_free_picture_tables()

void ff_free_picture_tables ( Picture pic)