#ifndef DE265_MOTION_H
#define DE265_MOTION_H
#include <stdint.h>
class base_context;
class slice_segment_header;
class MotionVector
{
public:
int16_t x,y;
};
class PBMotion
{
public:
uint8_t predFlag[2];
int8_t refIdx[2];
MotionVector mv[2];
bool operator==(const PBMotion&) const;
};
class PBMotionCoding
{
public:
int8_t refIdx[2];
int16_t mvd[2][2];
uint8_t inter_pred_idc : 2;
uint8_t mvp_l0_flag : 1;
uint8_t mvp_l1_flag : 1;
uint8_t merge_flag : 1;
uint8_t merge_idx : 3;
};
void get_merge_candidate_list(base_context* ctx,
const slice_segment_header* shdr,
struct de265_image* img,
int xC,int yC, int xP,int yP,
int nCS, int nPbW,int nPbH, int partIdx,
PBMotion* mergeCandList);
void get_merge_candidate_list_from_tree(class encoder_context* ectx,
const slice_segment_header* shdr,
int xC,int yC, int xP,int yP,
int nCS, int nPbW,int nPbH, int partIdx,
PBMotion* mergeCandList);
void generate_inter_prediction_samples(base_context* ctx,
const slice_segment_header* shdr,
struct de265_image* img,
int xC,int yC,
int xB,int yB,
int nCS, int nPbW,int nPbH,
const PBMotion* vi);
void fill_luma_motion_vector_predictors(base_context* ctx,
const slice_segment_header* shdr,
de265_image* img,
int xC,int yC,int nCS,int xP,int yP,
int nPbW,int nPbH, int l,
int refIdx, int partIdx,
MotionVector out_mvpList[2]);
void decode_prediction_unit(base_context* ctx,const slice_segment_header* shdr,
de265_image* img, const PBMotionCoding& motion,
int xC,int yC, int xB,int yB, int nCS, int nPbW,int nPbH, int partIdx);
#endif