FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
hevc_mvs.c File Reference
#include "hevc.h"

Go to the source code of this file.

Macros

#define MIN_TB_ADDR_ZS(x, y)   s->pps->min_tb_addr_zs[(y) * (s->sps->tb_mask+2) + (x)]
 
#define MATCH(x)   (A.x == B.x)
 
#define CHECK_MVSET(l)
 
#define TAB_MVF(x, y)   tab_mvf[(y) * min_pu_width + x]
 
#define TAB_MVF_PU(v)   TAB_MVF(x ## v ## _pu, y ## v ## _pu)
 
#define DERIVE_TEMPORAL_COLOCATED_MVS
 
#define AVAILABLE(cand, v)   (cand && !(TAB_MVF_PU(v).pred_flag == PF_INTRA))
 
#define PRED_BLOCK_AVAILABLE(v)
 
#define COMPARE_MV_REFIDX(a, b)   compareMVrefidx(TAB_MVF_PU(a), TAB_MVF_PU(b))
 
#define MP_MX(v, pred, mx)
 
#define MP_MX_LT(v, pred, mx)
 

Functions

void ff_hevc_set_neighbour_available (HEVCContext *s, int x0, int y0, int nPbW, int nPbH)
 
static int z_scan_block_avail (HEVCContext *s, int xCurr, int yCurr, int xN, int yN)
 
static int same_prediction_block (HEVCLocalContext *lc, int log2_cb_size, int x0, int y0, int nPbW, int nPbH, int xA1, int yA1, int partIdx)
 
static int check_prediction_block_available (HEVCContext *s, int log2_cb_size, int x0, int y0, int nPbW, int nPbH, int xA1, int yA1, int partIdx)
 
static int isDiffMER (HEVCContext *s, int xN, int yN, int xP, int yP)
 
static int compareMVrefidx (struct MvField A, struct MvField B)
 
static av_always_inline void mv_scale (Mv *dst, Mv *src, int td, int tb)
 
static int check_mvset (Mv *mvLXCol, Mv *mvCol, int colPic, int poc, RefPicList *refPicList, int X, int refIdxLx, RefPicList *refPicList_col, int listCol, int refidxCol)
 
static int derive_temporal_colocated_mvs (HEVCContext *s, MvField temp_col, int refIdxLx, Mv *mvLXCol, int X, int colPic, RefPicList *refPicList_col)
 
static int temporal_luma_motion_vector (HEVCContext *s, int x0, int y0, int nPbW, int nPbH, int refIdxLx, Mv *mvLXCol, int X)
 
static void derive_spatial_merge_candidates (HEVCContext *s, int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int singleMCLFlag, int part_idx, int merge_idx, struct MvField mergecandlist[])
 
void ff_hevc_luma_mv_merge_mode (HEVCContext *s, int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int part_idx, int merge_idx, MvField *mv)
 
static av_always_inline void dist_scale (HEVCContext *s, Mv *mv, int min_pu_width, int x, int y, int elist, int ref_idx_curr, int ref_idx)
 
static int mv_mp_mode_mx (HEVCContext *s, int x, int y, int pred_flag_index, Mv *mv, int ref_idx_curr, int ref_idx)
 
static int mv_mp_mode_mx_lt (HEVCContext *s, int x, int y, int pred_flag_index, Mv *mv, int ref_idx_curr, int ref_idx)
 
void ff_hevc_luma_mv_mvp_mode (HEVCContext *s, int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int part_idx, int merge_idx, MvField *mv, int mvp_lx_flag, int LX)
 

Variables

static const uint8_t l0_l1_cand_idx [12][2]
 

Macro Definition Documentation

#define MIN_TB_ADDR_ZS (   x,
  y 
)    s->pps->min_tb_addr_zs[(y) * (s->sps->tb_mask+2) + (x)]

Referenced by intra_pred(), and z_scan_block_avail().

#define MATCH (   x)    (A.x == B.x)

Definition at line 128 of file hevc_mvs.c.

Referenced by compareMVrefidx().

#define CHECK_MVSET (   l)
Value:
check_mvset(mvLXCol, temp_col.mv + l, \
colPic, s->poc, \
refPicList, X, refIdxLx, \
refPicList_col, L ## l, temp_col.ref_idx[l])

Definition at line 189 of file hevc_mvs.c.

Referenced by derive_temporal_colocated_mvs().

#define TAB_MVF (   x,
  y 
)    tab_mvf[(y) * min_pu_width + x]
#define TAB_MVF_PU (   v)    TAB_MVF(x ## v ## _pu, y ## v ## _pu)

Definition at line 238 of file hevc_mvs.c.

Referenced by derive_spatial_merge_candidates().

#define DERIVE_TEMPORAL_COLOCATED_MVS
Value:
refIdxLx, mvLXCol, X, colPic, \

Definition at line 241 of file hevc_mvs.c.

Referenced by temporal_luma_motion_vector().

#define AVAILABLE (   cand,
  v 
)    (cand && !(TAB_MVF_PU(v).pred_flag == PF_INTRA))

Definition at line 300 of file hevc_mvs.c.

Referenced by derive_spatial_merge_candidates(), and ff_hevc_luma_mv_mvp_mode().

#define PRED_BLOCK_AVAILABLE (   v)
Value:
x0, y0, nPbW, nPbH, \
x ## v, y ## v, part_idx)

Definition at line 303 of file hevc_mvs.c.

Referenced by derive_spatial_merge_candidates(), and ff_hevc_luma_mv_mvp_mode().

#define COMPARE_MV_REFIDX (   a,
  b 
)    compareMVrefidx(TAB_MVF_PU(a), TAB_MVF_PU(b))

Definition at line 308 of file hevc_mvs.c.

Referenced by derive_spatial_merge_candidates().

#define MP_MX (   v,
  pred,
  mx 
)
Value:
mv_mp_mode_mx(s, x ## v ## _pu, y ## v ## _pu, pred, \
&mx, ref_idx_curr, ref_idx)

Definition at line 633 of file hevc_mvs.c.

Referenced by ff_hevc_luma_mv_mvp_mode().

#define MP_MX_LT (   v,
  pred,
  mx 
)
Value:
mv_mp_mode_mx_lt(s, x ## v ## _pu, y ## v ## _pu, pred, \
&mx, ref_idx_curr, ref_idx)

Definition at line 637 of file hevc_mvs.c.

Referenced by ff_hevc_luma_mv_mvp_mode().

Function Documentation

void ff_hevc_set_neighbour_available ( HEVCContext s,
int  x0,
int  y0,
int  nPbW,
int  nPbH 
)

Definition at line 41 of file hevc_mvs.c.

Referenced by ff_hevc_luma_mv_merge_mode(), hls_prediction_unit(), and hls_transform_unit().

static int z_scan_block_avail ( HEVCContext s,
int  xCurr,
int  yCurr,
int  xN,
int  yN 
)
static

Definition at line 64 of file hevc_mvs.c.

Referenced by check_prediction_block_available().

static int same_prediction_block ( HEVCLocalContext lc,
int  log2_cb_size,
int  x0,
int  y0,
int  nPbW,
int  nPbH,
int  xA1,
int  yA1,
int  partIdx 
)
static

Definition at line 91 of file hevc_mvs.c.

Referenced by check_prediction_block_available().

static int check_prediction_block_available ( HEVCContext s,
int  log2_cb_size,
int  x0,
int  y0,
int  nPbW,
int  nPbH,
int  xA1,
int  yA1,
int  partIdx 
)
static

Definition at line 104 of file hevc_mvs.c.

static int isDiffMER ( HEVCContext s,
int  xN,
int  yN,
int  xP,
int  yP 
)
static

Definition at line 120 of file hevc_mvs.c.

Referenced by derive_spatial_merge_candidates().

static int compareMVrefidx ( struct MvField  A,
struct MvField  B 
)
static

Definition at line 131 of file hevc_mvs.c.

static av_always_inline void mv_scale ( Mv dst,
Mv src,
int  td,
int  tb 
)
static

Definition at line 148 of file hevc_mvs.c.

Referenced by check_mvset(), decode_mb_info(), dist_scale(), estimate_motion_b(), and ivi_scale_mv().

static int check_mvset ( Mv mvLXCol,
Mv mvCol,
int  colPic,
int  poc,
RefPicList refPicList,
int  X,
int  refIdxLx,
RefPicList refPicList_col,
int  listCol,
int  refidxCol 
)
static

Definition at line 162 of file hevc_mvs.c.

static int derive_temporal_colocated_mvs ( HEVCContext s,
MvField  temp_col,
int  refIdxLx,
Mv mvLXCol,
int  X,
int  colPic,
RefPicList refPicList_col 
)
static

Definition at line 196 of file hevc_mvs.c.

static int temporal_luma_motion_vector ( HEVCContext s,
int  x0,
int  y0,
int  nPbW,
int  nPbH,
int  refIdxLx,
Mv mvLXCol,
int  X 
)
static

Definition at line 249 of file hevc_mvs.c.

Referenced by derive_spatial_merge_candidates(), and ff_hevc_luma_mv_mvp_mode().

static void derive_spatial_merge_candidates ( HEVCContext s,
int  x0,
int  y0,
int  nPbW,
int  nPbH,
int  log2_cb_size,
int  singleMCLFlag,
int  part_idx,
int  merge_idx,
struct MvField  mergecandlist[] 
)
static

Definition at line 314 of file hevc_mvs.c.

Referenced by ff_hevc_luma_mv_merge_mode().

void ff_hevc_luma_mv_merge_mode ( HEVCContext s,
int  x0,
int  y0,
int  nPbW,
int  nPbH,
int  log2_cb_size,
int  part_idx,
int  merge_idx,
MvField mv 
)

Definition at line 542 of file hevc_mvs.c.

Referenced by hls_prediction_unit().

static av_always_inline void dist_scale ( HEVCContext s,
Mv mv,
int  min_pu_width,
int  x,
int  y,
int  elist,
int  ref_idx_curr,
int  ref_idx 
)
static

Definition at line 575 of file hevc_mvs.c.

Referenced by mv_mp_mode_mx_lt().

static int mv_mp_mode_mx ( HEVCContext s,
int  x,
int  y,
int  pred_flag_index,
Mv mv,
int  ref_idx_curr,
int  ref_idx 
)
static

Definition at line 592 of file hevc_mvs.c.

static int mv_mp_mode_mx_lt ( HEVCContext s,
int  x,
int  y,
int  pred_flag_index,
Mv mv,
int  ref_idx_curr,
int  ref_idx 
)
static

Definition at line 608 of file hevc_mvs.c.

void ff_hevc_luma_mv_mvp_mode ( HEVCContext s,
int  x0,
int  y0,
int  nPbW,
int  nPbH,
int  log2_cb_size,
int  part_idx,
int  merge_idx,
MvField mv,
int  mvp_lx_flag,
int  LX 
)

Definition at line 641 of file hevc_mvs.c.

Referenced by hls_prediction_unit().

Variable Documentation

const uint8_t l0_l1_cand_idx[12][2]
static
Initial value:
= {
{ 0, 1, },
{ 1, 0, },
{ 0, 2, },
{ 2, 0, },
{ 1, 2, },
{ 2, 1, },
{ 0, 3, },
{ 3, 0, },
{ 1, 3, },
{ 3, 1, },
{ 2, 3, },
{ 3, 2, },
}

Definition at line 26 of file hevc_mvs.c.

Referenced by derive_spatial_merge_candidates().