mpegvideo_motion.c File Reference
#include <string.h>
#include "libavutil/avassert.h"
#include "libavutil/internal.h"
#include "avcodec.h"
#include "dsputil.h"
#include "h261.h"
#include "mpegvideo.h"
#include "mjpegenc.h"
#include "msmpeg4.h"
#include <limits.h>
Include dependency graph for mpegvideo_motion.c:

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 void gmc1_motion (MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, uint8_t **ref_picture)
 
static void gmc_motion (MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, uint8_t **ref_picture)
 
static int hpel_motion (MpegEncContext *s, uint8_t *dest, uint8_t *src, int src_x, int src_y, 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 **ref_picture, op_pixels_func(*pix_op)[4], int motion_x, int motion_y, int h, int is_mpeg12, 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 **ref_picture, op_pixels_func(*pix_op)[4], int motion_x, int motion_y, int h, 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 **ref_picture, op_pixels_func(*pix_op)[4], int motion_x, int motion_y, int h, int mb_y)
 
static void put_obmc (uint8_t *dst, uint8_t *src[5], int stride)
 
static void obmc_motion (MpegEncContext *s, uint8_t *dest, uint8_t *src, int src_x, int src_y, 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 **ref_picture, op_pixels_func(*pix_op)[4], 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 **ref_picture, op_pixels_func *pix_op, int mx, int my)
 h263 chroma 4mv motion compensation. More...
 
static void prefetch_motion (MpegEncContext *s, uint8_t **pix, int dir)
 
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 **ref_picture, op_pixels_func(*pix_op)[4], 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 **ref_picture, op_pixels_func(*pix_op)[4], qpel_mc_func(*qpix_op)[16])
 

Macro Definition Documentation

#define MID   0

Referenced by obmc_motion().

#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

Referenced by put_obmc().

#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);
int stride
Definition: mace.c:144
window constants for m
#define b
Definition: input.c:42
Discrete Time axis x
const char * r
Definition: vf_curves.c:94
t
Definition: genspecsines3.m:6
#define OBMC_FILTER(x, t, l, m, r, b)

Referenced by put_obmc().

Function Documentation

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

h263 chroma 4mv motion compensation.

Definition at line 548 of file mpegvideo_motion.c.

Referenced by MPV_motion_internal().

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

Definition at line 880 of file mpegvideo_motion.c.

Referenced by encode_mb_internal(), and MPV_decode_mb_internal().

static void gmc1_motion ( MpegEncContext s,
uint8_t dest_y,
uint8_t dest_cb,
uint8_t dest_cr,
uint8_t **  ref_picture 
)
static

Definition at line 36 of file mpegvideo_motion.c.

Referenced by MPV_motion_internal().

static void gmc_motion ( MpegEncContext s,
uint8_t dest_y,
uint8_t dest_cb,
uint8_t dest_cr,
uint8_t **  ref_picture 
)
static

Definition at line 118 of file mpegvideo_motion.c.

Referenced by MPV_motion_internal().

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

Definition at line 174 of file mpegvideo_motion.c.

Referenced by MPV_motion_internal(), and obmc_motion().

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

Definition at line 336 of file mpegvideo_motion.c.

Referenced by MPV_motion_internal().

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 **  ref_picture,
op_pixels_func(*)  pix_op[4],
int  motion_x,
int  motion_y,
int  h,
int  mb_y 
)
static

Definition at line 354 of file mpegvideo_motion.c.

Referenced by MPV_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 **  ref_picture,
op_pixels_func(*)  pix_op[4],
int  motion_x,
int  motion_y,
int  h,
int  is_mpeg12,
int  mb_y 
)
static

Definition at line 209 of file mpegvideo_motion.c.

Referenced by mpeg_motion(), and mpeg_motion_field().

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 **  ref_picture,
op_pixels_func(*)  pix_op[4],
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 623 of file mpegvideo_motion.c.

Referenced by ff_MPV_motion().

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

Definition at line 426 of file mpegvideo_motion.c.

Referenced by MPV_motion_internal().

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

Definition at line 599 of file mpegvideo_motion.c.

Referenced by MPV_motion_internal().

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

Definition at line 374 of file mpegvideo_motion.c.

Referenced by obmc_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 **  ref_picture,
op_pixels_func(*)  pix_op[4],
qpel_mc_func(*)  qpix_op[16],
int  motion_x,
int  motion_y,
int  h 
)
inlinestatic

Definition at line 453 of file mpegvideo_motion.c.

Referenced by MPV_motion_internal().