FFmpeg
Macros | Functions
mpegvideo_motion.c File Reference
#include "config_components.h"
#include "libavutil/avassert.h"
#include "libavutil/internal.h"
#include "libavutil/mem_internal.h"
#include "avcodec.h"
#include "h261.h"
#include "mpegutils.h"
#include "mpegvideo.h"
#include "mpeg4videodec.h"
#include "qpeldsp.h"
#include "wmv2.h"

Go to the source code of this file.

Macros

#define OBMC_FILTER(x, t, l, m, r, b)   dst[x]= (t*top[x] + l*left[x] + m*mid[x] + r*right[x] + b*bottom[x] + 4)>>3
 
#define OBMC_FILTER4(x, t, l, m, r, b)
 
#define MID   0
 

Functions

static int hpel_motion (MpegEncContext *s, uint8_t *dest, uint8_t *src, int src_x, int src_y, const op_pixels_func *pix_op, int motion_x, int motion_y)
 
static av_always_inline void mpeg_motion_internal (MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int field_based, int bottom_field, int field_select, uint8_t *const *ref_picture, const op_pixels_func(*pix_op)[4], int motion_x, int motion_y, int h, int is_mpeg12, int is_16x8, int mb_y)
 
static void mpeg_motion (MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int field_select, uint8_t *const *ref_picture, const op_pixels_func(*pix_op)[4], int motion_x, int motion_y, int h, int is_16x8, int mb_y)
 
static void mpeg_motion_field (MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int bottom_field, int field_select, uint8_t *const *ref_picture, const op_pixels_func(*pix_op)[4], int motion_x, int motion_y, int mb_y)
 
static void put_obmc (uint8_t *dst, uint8_t *const src[5], int stride)
 
static void obmc_motion (MpegEncContext *s, uint8_t *dest, uint8_t *src, int src_x, int src_y, const op_pixels_func *pix_op, int16_t mv[5][2])
 
static void qpel_motion (MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int field_based, int bottom_field, int field_select, uint8_t *const *ref_picture, const op_pixels_func(*pix_op)[4], const qpel_mc_func(*qpix_op)[16], int motion_x, int motion_y, int h)
 
static void chroma_4mv_motion (MpegEncContext *s, uint8_t *dest_cb, uint8_t *dest_cr, uint8_t *const *ref_picture, const op_pixels_func *pix_op, int mx, int my)
 H.263 chroma 4mv motion compensation. More...
 
static void prefetch_motion (MpegEncContext *s, uint8_t *const *pix, int dir)
 
static void apply_obmc (MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, uint8_t *const *ref_picture, const op_pixels_func(*pix_op)[4])
 
static void apply_8x8 (MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int dir, uint8_t *const *ref_picture, const qpel_mc_func(*qpix_op)[16], const op_pixels_func(*pix_op)[4])
 
static av_always_inline void mpv_motion_internal (MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int dir, uint8_t *const *ref_picture, const op_pixels_func(*pix_op)[4], const qpel_mc_func(*qpix_op)[16], int is_mpeg12)
 motion compensation of a single macroblock More...
 
void ff_mpv_motion (MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int dir, uint8_t *const *ref_picture, const op_pixels_func(*pix_op)[4], const qpel_mc_func(*qpix_op)[16])
 

Macro Definition Documentation

◆ OBMC_FILTER

#define OBMC_FILTER (   x,
  t,
  l,
  m,
  r,
  b 
)    dst[x]= (t*top[x] + l*left[x] + m*mid[x] + r*right[x] + b*bottom[x] + 4)>>3

◆ OBMC_FILTER4

#define OBMC_FILTER4 (   x,
  t,
  l,
  m,
  r,
  b 
)
Value:
OBMC_FILTER(x , t, l, m, r, b);\
OBMC_FILTER(x+1 , t, l, m, r, b);\
OBMC_FILTER(x +stride, t, l, m, r, b);\
OBMC_FILTER(x+1+stride, t, l, m, r, b);

◆ MID

#define MID   0

Function Documentation

◆ hpel_motion()

static int hpel_motion ( MpegEncContext s,
uint8_t *  dest,
uint8_t *  src,
int  src_x,
int  src_y,
const op_pixels_func pix_op,
int  motion_x,
int  motion_y 
)
inlinestatic

Definition at line 38 of file mpegvideo_motion.c.

Referenced by apply_8x8(), and obmc_motion().

◆ mpeg_motion_internal()

static av_always_inline void mpeg_motion_internal ( MpegEncContext s,
uint8_t *  dest_y,
uint8_t *  dest_cb,
uint8_t *  dest_cr,
int  field_based,
int  bottom_field,
int  field_select,
uint8_t *const *  ref_picture,
const op_pixels_func(*)  pix_op[4],
int  motion_x,
int  motion_y,
int  h,
int  is_mpeg12,
int  is_16x8,
int  mb_y 
)
static

Definition at line 74 of file mpegvideo_motion.c.

Referenced by mpeg_motion(), and mpeg_motion_field().

◆ mpeg_motion()

static void mpeg_motion ( MpegEncContext s,
uint8_t *  dest_y,
uint8_t *  dest_cb,
uint8_t *  dest_cr,
int  field_select,
uint8_t *const *  ref_picture,
const op_pixels_func(*)  pix_op[4],
int  motion_x,
int  motion_y,
int  h,
int  is_16x8,
int  mb_y 
)
static

Definition at line 219 of file mpegvideo_motion.c.

Referenced by mpv_motion_internal().

◆ mpeg_motion_field()

static void mpeg_motion_field ( MpegEncContext s,
uint8_t *  dest_y,
uint8_t *  dest_cb,
uint8_t *  dest_cr,
int  bottom_field,
int  field_select,
uint8_t *const *  ref_picture,
const op_pixels_func(*)  pix_op[4],
int  motion_x,
int  motion_y,
int  mb_y 
)
static

Definition at line 237 of file mpegvideo_motion.c.

Referenced by mpv_motion_internal().

◆ put_obmc()

static void put_obmc ( uint8_t *  dst,
uint8_t *const  src[5],
int  stride 
)
inlinestatic

Definition at line 257 of file mpegvideo_motion.c.

Referenced by obmc_motion().

◆ obmc_motion()

static void obmc_motion ( MpegEncContext s,
uint8_t *  dest,
uint8_t *  src,
int  src_x,
int  src_y,
const op_pixels_func pix_op,
int16_t  mv[5][2] 
)
inlinestatic

Definition at line 310 of file mpegvideo_motion.c.

Referenced by apply_obmc().

◆ qpel_motion()

static void qpel_motion ( MpegEncContext s,
uint8_t *  dest_y,
uint8_t *  dest_cb,
uint8_t *  dest_cr,
int  field_based,
int  bottom_field,
int  field_select,
uint8_t *const *  ref_picture,
const op_pixels_func(*)  pix_op[4],
const qpel_mc_func(*)  qpix_op[16],
int  motion_x,
int  motion_y,
int  h 
)
inlinestatic

Definition at line 336 of file mpegvideo_motion.c.

Referenced by mpv_motion_internal().

◆ chroma_4mv_motion()

static void chroma_4mv_motion ( MpegEncContext s,
uint8_t *  dest_cb,
uint8_t *  dest_cr,
uint8_t *const *  ref_picture,
const op_pixels_func pix_op,
int  mx,
int  my 
)
static

H.263 chroma 4mv motion compensation.

Definition at line 443 of file mpegvideo_motion.c.

Referenced by apply_8x8(), and apply_obmc().

◆ prefetch_motion()

static void prefetch_motion ( MpegEncContext s,
uint8_t *const *  pix,
int  dir 
)
inlinestatic

Definition at line 495 of file mpegvideo_motion.c.

Referenced by ff_mpv_motion().

◆ apply_obmc()

static void apply_obmc ( MpegEncContext s,
uint8_t *  dest_y,
uint8_t *  dest_cb,
uint8_t *  dest_cr,
uint8_t *const *  ref_picture,
const op_pixels_func(*)  pix_op[4] 
)
inlinestatic

Definition at line 509 of file mpegvideo_motion.c.

Referenced by mpv_motion_internal().

◆ apply_8x8()

static void apply_8x8 ( MpegEncContext s,
uint8_t *  dest_y,
uint8_t *  dest_cb,
uint8_t *  dest_cr,
int  dir,
uint8_t *const *  ref_picture,
const qpel_mc_func(*)  qpix_op[16],
const op_pixels_func(*)  pix_op[4] 
)
inlinestatic

Definition at line 596 of file mpegvideo_motion.c.

Referenced by mpv_motion_internal().

◆ mpv_motion_internal()

static av_always_inline void mpv_motion_internal ( MpegEncContext s,
uint8_t *  dest_y,
uint8_t *  dest_cb,
uint8_t *  dest_cr,
int  dir,
uint8_t *const *  ref_picture,
const op_pixels_func(*)  pix_op[4],
const qpel_mc_func(*)  qpix_op[16],
int  is_mpeg12 
)
static

motion compensation of a single macroblock

Parameters
scontext
dest_yluma destination pointer
dest_cbchroma cb/u destination pointer
dest_crchroma cr/v destination pointer
dirdirection (0->forward, 1->backward)
ref_picturearray[3] of pointers to the 3 planes of the reference picture
pix_ophalfpel motion compensation function (average or put normally)
qpix_opqpel motion compensation function (average or put normally) the motion vectors are taken from s->mv and the MV type from s->mv_type

Definition at line 681 of file mpegvideo_motion.c.

Referenced by ff_mpv_motion().

◆ ff_mpv_motion()

void ff_mpv_motion ( MpegEncContext s,
uint8_t *  dest_y,
uint8_t *  dest_cb,
uint8_t *  dest_cr,
int  dir,
uint8_t *const *  ref_picture,
const op_pixels_func(*)  pix_op[4],
const qpel_mc_func(*)  qpix_op[16] 
)

Definition at line 819 of file mpegvideo_motion.c.

Referenced by encode_mb_internal(), and mpv_reconstruct_mb_internal().

r
const char * r
Definition: vf_curves.c:127
b
#define b
Definition: input.c:41
OBMC_FILTER
#define OBMC_FILTER(x, t, l, m, r, b)
stride
#define stride
Definition: h264pred_template.c:537