h264_mvpred.h File Reference

H.264 / AVC / MPEG4 part10 motion vector predicion. More...

#include "internal.h"
#include "avcodec.h"
#include "h264.h"
#include "libavutil/avassert.h"
Include dependency graph for h264_mvpred.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SET_DIAG_MV(MV_OP, REF_OP, XY, Y4)
 
#define FIX_MV_MBAFF(type, refn, mvn, idx)
 
#define MAP_MVS
 
#define MAP_F2F(idx, mb_type)
 
#define MAP_F2F(idx, mb_type)
 

Functions

static av_always_inline int fetch_diagonal_mv (H264Context *h, const int16_t **C, int i, int list, int part_width)
 
static av_always_inline void pred_motion (H264Context *const h, int n, int part_width, int list, int ref, int *const mx, int *const my)
 Get the predicted MV. More...
 
static av_always_inline void pred_16x8_motion (H264Context *const h, int n, int list, int ref, int *const mx, int *const my)
 Get the directionally predicted 16x8 MV. More...
 
static av_always_inline void pred_8x16_motion (H264Context *const h, int n, int list, int ref, int *const mx, int *const my)
 Get the directionally predicted 8x16 MV. More...
 
static av_always_inline void pred_pskip_motion (H264Context *const h)
 
static void fill_decode_neighbors (H264Context *h, int mb_type)
 
static void fill_decode_caches (H264Context *h, int mb_type)
 
static void av_unused decode_mb_skip (H264Context *h)
 decodes a P_SKIP or B_SKIP macroblock More...
 

Detailed Description

H.264 / AVC / MPEG4 part10 motion vector predicion.

Author
Michael Niedermayer micha.nosp@m.elni.nosp@m.@gmx..nosp@m.at

Definition in file h264_mvpred.h.

Macro Definition Documentation

#define FIX_MV_MBAFF (   type,
  refn,
  mvn,
  idx 
)
Value:
if (FRAME_MBAFF(h)) { \
if (MB_FIELD(h)) { \
refn <<= 1; \
AV_COPY32(mvbuf[idx], mvn); \
mvbuf[idx][1] /= 2; \
mvn = mvbuf[idx]; \
} \
} else { \
refn >>= 1; \
AV_COPY32(mvbuf[idx], mvn); \
mvbuf[idx][1] <<= 1; \
mvn = mvbuf[idx]; \
} \
} \
}
#define AV_COPY32(d, s)
Definition: intreadwrite.h:578
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
#define IS_INTERLACED(a)
Definition: mpegvideo.h:142
#define MB_FIELD(h)
Definition: h264.h:65
#define type
#define FRAME_MBAFF(h)
Definition: h264.h:66

Definition at line 232 of file h264_mvpred.h.

Referenced by pred_pskip_motion().

#define MAP_F2F (   idx,
  mb_type 
)
Value:
if (!IS_INTERLACED(mb_type) && h->ref_cache[list][idx] >= 0) { \
h->ref_cache[list][idx] <<= 1; \
h->mv_cache[list][idx][1] /= 2; \
h->mvd_cache[list][idx][1] >>= 1; \
}
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFilterBuffer 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 list
#define IS_INTERLACED(a)
Definition: mpegvideo.h:142
#define MAP_F2F (   idx,
  mb_type 
)
Value:
if (IS_INTERLACED(mb_type) && h->ref_cache[list][idx] >= 0) { \
h->ref_cache[list][idx] >>= 1; \
h->mv_cache[list][idx][1] <<= 1; \
h->mvd_cache[list][idx][1] <<= 1; \
}
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFilterBuffer 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 list
#define IS_INTERLACED(a)
Definition: mpegvideo.h:142
#define MAP_MVS
Value:
MAP_F2F(scan8[0] - 1 - 1 * 8, topleft_type) \
MAP_F2F(scan8[0] + 0 - 1 * 8, top_type) \
MAP_F2F(scan8[0] + 1 - 1 * 8, top_type) \
MAP_F2F(scan8[0] + 2 - 1 * 8, top_type) \
MAP_F2F(scan8[0] + 3 - 1 * 8, top_type) \
MAP_F2F(scan8[0] + 4 - 1 * 8, topright_type) \
MAP_F2F(scan8[0] - 1 + 0 * 8, left_type[LTOP]) \
MAP_F2F(scan8[0] - 1 + 1 * 8, left_type[LTOP]) \
MAP_F2F(scan8[0] - 1 + 2 * 8, left_type[LBOT]) \
MAP_F2F(scan8[0] - 1 + 3 * 8, left_type[LBOT])
static const uint8_t scan8[16 *3+3]
Definition: h264.h:812
#define MAP_F2F(idx, mb_type)
#define LTOP
Definition: h264.h:69
#define LBOT
Definition: h264.h:70

Referenced by fill_decode_caches().

#define SET_DIAG_MV (   MV_OP,
  REF_OP,
  XY,
  Y4 
)
Value:
const int xy = XY, y4 = Y4; \
const int mb_type = mb_types[xy + (y4 >> 2) * h->mb_stride]; \
if (!USES_LIST(mb_type, list)) \
return LIST_NOT_USED; \
mv = h->cur_pic_ptr->motion_val[list][h->mb2b_xy[xy] + 3 + y4 * h->b_stride]; \
h->mv_cache[list][scan8[0] - 2][0] = mv[0]; \
h->mv_cache[list][scan8[0] - 2][1] = mv[1] MV_OP; \
return h->cur_pic_ptr->ref_index[list][4 * xy + 1 + (y4 & ~1)] REF_OP;
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFilterBuffer 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 list
#define USES_LIST(a, list)
does this mb use listX, note does not work if subMBs
Definition: mpegvideo.h:156
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
static const uint8_t scan8[16 *3+3]
Definition: h264.h:812
static const int8_t mv[256][2]
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame This method is called when a frame is wanted on an output For an it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return it should return
#define LIST_NOT_USED
Definition: h264.h:338

Referenced by fetch_diagonal_mv().

Function Documentation

static void av_unused decode_mb_skip ( H264Context h)
static

decodes a P_SKIP or B_SKIP macroblock

Definition at line 796 of file h264_mvpred.h.

Referenced by ff_h264_decode_mb_cabac(), and ff_h264_decode_mb_cavlc().

static av_always_inline int fetch_diagonal_mv ( H264Context h,
const int16_t **  C,
int  i,
int  list,
int  part_width 
)
static

Definition at line 37 of file h264_mvpred.h.

Referenced by pred_8x16_motion(), and pred_motion().

static void fill_decode_caches ( H264Context h,
int  mb_type 
)
static

Definition at line 438 of file h264_mvpred.h.

Referenced by decode_mb_skip(), ff_h264_decode_mb_cabac(), and ff_h264_decode_mb_cavlc().

static void fill_decode_neighbors ( H264Context h,
int  mb_type 
)
static

Definition at line 349 of file h264_mvpred.h.

Referenced by decode_mb_skip(), ff_h264_decode_mb_cabac(), and ff_h264_decode_mb_cavlc().

static av_always_inline void pred_16x8_motion ( H264Context *const  h,
int  n,
int  list,
int  ref,
int *const  mx,
int *const  my 
)
static

Get the directionally predicted 16x8 MV.

Parameters
nthe block index
mxthe x component of the predicted motion vector
mythe y component of the predicted motion vector

Definition at line 156 of file h264_mvpred.h.

Referenced by ff_h264_decode_mb_cabac(), and ff_h264_decode_mb_cavlc().

static av_always_inline void pred_8x16_motion ( H264Context *const  h,
int  n,
int  list,
int  ref,
int *const  mx,
int *const  my 
)
static

Get the directionally predicted 8x16 MV.

Parameters
nthe block index
mxthe x component of the predicted motion vector
mythe y component of the predicted motion vector

Definition at line 196 of file h264_mvpred.h.

Referenced by ff_h264_decode_mb_cabac(), and ff_h264_decode_mb_cavlc().

static av_always_inline void pred_motion ( H264Context *const  h,
int  n,
int  part_width,
int  list,
int  ref,
int *const  mx,
int *const  my 
)
static

Get the predicted MV.

Parameters
nthe block index
part_widththe width of the partition (4, 8,16) -> (1, 2, 4)
mxthe x component of the predicted motion vector
mythe y component of the predicted motion vector

Definition at line 93 of file h264_mvpred.h.

Referenced by ff_h264_decode_mb_cabac(), ff_h264_decode_mb_cavlc(), pred_16x8_motion(), pred_8x16_motion(), and svq3_mc_dir().

static av_always_inline void pred_pskip_motion ( H264Context *const  h)
static

Definition at line 251 of file h264_mvpred.h.

Referenced by decode_mb_skip().