FFmpeg
Macros | Functions | Variables
mvs.c File Reference
#include "hevc.h"
#include "hevcdec.h"
#include "progressframe.h"

Go to the source code of this file.

Macros

#define MIN_TB_ADDR_ZS(x, y)   pps->min_tb_addr_zs[(y) * (sps->tb_mask+2) + (x)]
 
#define MATCH_MV(x)   (AV_RN32A(&A.x) == AV_RN32A(&B.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)
 
#define DERIVE_TEMPORAL_COLOCATED_MVS
 
#define AVAILABLE(cand, v)   (cand && !(TAB_MVF_PU(v).pred_flag == PF_INTRA))
 
#define PRED_BLOCK_AVAILABLE(v)   z_scan_block_avail(pps, sps, x0, y0, x ## v, y ## v)
 
#define COMPARE_MV_REFIDX(a, b)   compare_mv_ref_idx(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 (HEVCLocalContext *lc, int x0, int y0, int nPbW, int nPbH, int log2_ctb_size)
 
static av_always_inline int z_scan_block_avail (const HEVCPPS *pps, const HEVCSPS *sps, int xCurr, int yCurr, int xN, int yN)
 
static av_always_inline int is_diff_mer (const HEVCPPS *pps, int xN, int yN, int xP, int yP)
 
static av_always_inline int compare_mv_ref_idx (struct MvField A, struct MvField B)
 
static av_always_inline void mv_scale (Mv *dst, const Mv *src, int td, int tb)
 
static int check_mvset (Mv *mvLXCol, const Mv *mvCol, int colPic, int poc, const RefPicList *refPicList, int X, int refIdxLx, const RefPicList *refPicList_col, int listCol, int refidxCol)
 
static int derive_temporal_colocated_mvs (const HEVCContext *s, MvField temp_col, int refIdxLx, Mv *mvLXCol, int X, int colPic, const RefPicList *refPicList_col)
 
static int temporal_luma_motion_vector (const HEVCContext *s, const HEVCSPS *sps, int x0, int y0, int nPbW, int nPbH, int refIdxLx, Mv *mvLXCol, int X)
 
static void derive_spatial_merge_candidates (HEVCLocalContext *lc, const HEVCContext *s, const HEVCPPS *pps, const HEVCSPS *sps, 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 (HEVCLocalContext *lc, const HEVCPPS *pps, 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 (const 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 (const HEVCContext *s, const HEVCSPS *sps, int x, int y, int pred_flag_index, Mv *mv, int ref_idx_curr, int ref_idx)
 
static int mv_mp_mode_mx_lt (const HEVCContext *s, const HEVCSPS *sps, int x, int y, int pred_flag_index, Mv *mv, int ref_idx_curr, int ref_idx)
 
void ff_hevc_luma_mv_mvp_mode (HEVCLocalContext *lc, const HEVCPPS *pps, 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

◆ MIN_TB_ADDR_ZS

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

◆ MATCH_MV

#define MATCH_MV (   x)    (AV_RN32A(&A.x) == AV_RN32A(&B.x))

Definition at line 95 of file mvs.c.

◆ MATCH

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

Definition at line 96 of file mvs.c.

◆ CHECK_MVSET

#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 157 of file mvs.c.

◆ TAB_MVF

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

Definition at line 204 of file mvs.c.

◆ TAB_MVF_PU

#define TAB_MVF_PU (   v)
Value:
TAB_MVF(((x ## v) >> sps->log2_min_pu_size), \
((y ## v) >> sps->log2_min_pu_size))

Definition at line 207 of file mvs.c.

◆ DERIVE_TEMPORAL_COLOCATED_MVS

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

Definition at line 211 of file mvs.c.

◆ AVAILABLE

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

Definition at line 275 of file mvs.c.

◆ PRED_BLOCK_AVAILABLE

#define PRED_BLOCK_AVAILABLE (   v)    z_scan_block_avail(pps, sps, x0, y0, x ## v, y ## v)

Definition at line 278 of file mvs.c.

◆ COMPARE_MV_REFIDX

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

Definition at line 281 of file mvs.c.

◆ MP_MX

#define MP_MX (   v,
  pred,
  mx 
)
Value:
(x ## v) >> sps->log2_min_pu_size, \
(y ## v) >> sps->log2_min_pu_size, \
pred, &mx, ref_idx_curr, ref_idx)

Definition at line 577 of file mvs.c.

◆ MP_MX_LT

#define MP_MX_LT (   v,
  pred,
  mx 
)
Value:
(x ## v) >> sps->log2_min_pu_size, \
(y ## v) >> sps->log2_min_pu_size, \
pred, &mx, ref_idx_curr, ref_idx)

Definition at line 583 of file mvs.c.

Function Documentation

◆ ff_hevc_set_neighbour_available()

void ff_hevc_set_neighbour_available ( HEVCLocalContext lc,
int  x0,
int  y0,
int  nPbW,
int  nPbH,
int  log2_ctb_size 
)

Definition at line 43 of file mvs.c.

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

◆ z_scan_block_avail()

static av_always_inline int z_scan_block_avail ( const HEVCPPS pps,
const HEVCSPS sps,
int  xCurr,
int  yCurr,
int  xN,
int  yN 
)
static

Definition at line 65 of file mvs.c.

◆ is_diff_mer()

static av_always_inline int is_diff_mer ( const HEVCPPS pps,
int  xN,
int  yN,
int  xP,
int  yP 
)
static

Definition at line 87 of file mvs.c.

Referenced by derive_spatial_merge_candidates().

◆ compare_mv_ref_idx()

static av_always_inline int compare_mv_ref_idx ( struct MvField  A,
struct MvField  B 
)
static

Definition at line 99 of file mvs.c.

◆ mv_scale()

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

◆ check_mvset()

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

Definition at line 130 of file mvs.c.

◆ derive_temporal_colocated_mvs()

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

Definition at line 164 of file mvs.c.

◆ temporal_luma_motion_vector()

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

Definition at line 219 of file mvs.c.

Referenced by derive_spatial_merge_candidates(), and ff_hevc_luma_mv_mvp_mode().

◆ derive_spatial_merge_candidates()

static void derive_spatial_merge_candidates ( HEVCLocalContext lc,
const HEVCContext s,
const HEVCPPS pps,
const HEVCSPS sps,
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 287 of file mvs.c.

Referenced by ff_hevc_luma_mv_merge_mode().

◆ ff_hevc_luma_mv_merge_mode()

void ff_hevc_luma_mv_merge_mode ( HEVCLocalContext lc,
const HEVCPPS pps,
int  x0,
int  y0,
int  nPbW,
int  nPbH,
int  log2_cb_size,
int  part_idx,
int  merge_idx,
MvField mv 
)

Definition at line 482 of file mvs.c.

Referenced by hls_prediction_unit().

◆ dist_scale()

static av_always_inline void dist_scale ( const 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 517 of file mvs.c.

Referenced by mv_mp_mode_mx_lt().

◆ mv_mp_mode_mx()

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

Definition at line 534 of file mvs.c.

◆ mv_mp_mode_mx_lt()

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

Definition at line 551 of file mvs.c.

◆ ff_hevc_luma_mv_mvp_mode()

void ff_hevc_luma_mv_mvp_mode ( HEVCLocalContext lc,
const HEVCPPS pps,
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 589 of file mvs.c.

Referenced by hevc_luma_mv_mvp_mode().

Variable Documentation

◆ l0_l1_cand_idx

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 28 of file mvs.c.

Referenced by derive_spatial_merge_candidates().

ff_hevc_get_ref_list
const RefPicList * ff_hevc_get_ref_list(const HEVCFrame *frame, int x0, int y0)
Definition: refs.c:54
mx
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t mx
Definition: dsp.h:53
check_mvset
static int check_mvset(Mv *mvLXCol, const Mv *mvCol, int colPic, int poc, const RefPicList *refPicList, int X, int refIdxLx, const RefPicList *refPicList_col, int listCol, int refidxCol)
Definition: mvs.c:130
mv_mp_mode_mx
static int mv_mp_mode_mx(const HEVCContext *s, const HEVCSPS *sps, int x, int y, int pred_flag_index, Mv *mv, int ref_idx_curr, int ref_idx)
Definition: mvs.c:534
s
#define s(width, name)
Definition: cbs_vp9.c:198
mv_mp_mode_mx_lt
static int mv_mp_mode_mx_lt(const HEVCContext *s, const HEVCSPS *sps, int x, int y, int pred_flag_index, Mv *mv, int ref_idx_curr, int ref_idx)
Definition: mvs.c:551
TAB_MVF
#define TAB_MVF(x, y)
Definition: mvs.c:204
pred
static const float pred[4]
Definition: siprdata.h:259
sps
static int FUNC() sps(CodedBitstreamContext *ctx, RWContext *rw, H264RawSPS *current)
Definition: cbs_h264_syntax_template.c:260
ref
static int ref[MAX_W *MAX_W]
Definition: jpeg2000dwt.c:112
L
#define L(x)
Definition: vpx_arith.h:36
X
@ X
Definition: vf_addroi.c:27
derive_temporal_colocated_mvs
static int derive_temporal_colocated_mvs(const HEVCContext *s, MvField temp_col, int refIdxLx, Mv *mvLXCol, int X, int colPic, const RefPicList *refPicList_col)
Definition: mvs.c:164