Template
149 lines
5.5 KiB
C
149 lines
5.5 KiB
C
/*!
|
|
************************************************************************
|
|
* \file ferc_internals.h
|
|
*
|
|
* \brief
|
|
* Internal function for ferc API
|
|
*
|
|
*
|
|
* \author
|
|
* - Jo���o Carreira
|
|
*
|
|
************************************************************************
|
|
*/
|
|
|
|
#ifndef _FERC_INTERNALS_H_
|
|
#define _FERC_INTERNALS_H_
|
|
|
|
#include "defines.h"
|
|
#include "global.h"
|
|
#include "mbuffer.h"
|
|
|
|
#define MAX_PEL_VALUE 255
|
|
#define THRESHOLD_DISP 62
|
|
|
|
|
|
/*! Definition of search modes */
|
|
static enum search_frame {
|
|
CLOSEST_ALL = 0,
|
|
CLOSEST_RECEIVED = 1,
|
|
CLOSEST_FUTURE = 2,
|
|
EXACT = 3,
|
|
WELL_RECEIVED_STEREO = 4,
|
|
};
|
|
|
|
/*! Motion vector concealment modes implemented */
|
|
enum {
|
|
ZERO_MV = 0,
|
|
PREVIOUS = 1,
|
|
AVERAGE = 2,
|
|
MEDIAN = 3,
|
|
};
|
|
|
|
struct ConcealNode {
|
|
StorablePicture* picture;
|
|
int MissPoc;
|
|
// int MissView;
|
|
struct ConcealNode *next;
|
|
};
|
|
|
|
|
|
typedef struct conceal_params
|
|
{
|
|
|
|
int use_DisparityProjection;
|
|
//int use_InterMotionCopy;
|
|
//int use_IntraMotionCopy;
|
|
|
|
//! Concealment Mode
|
|
int ConcealmentMode;
|
|
//! Concealment Function
|
|
void (*ConcealFuction) (VideoParameters *p_Vid,
|
|
StorablePicture *Source, StorablePicture *Dest );
|
|
|
|
int conceal_slice_type;
|
|
int flag_bad_poc_calculation;
|
|
|
|
// picture error concealment
|
|
// concealment_head points to first node in list, concealment_end points to
|
|
// last node in list. Initialize both to NULL, meaning no nodes in list yet
|
|
#if (MVC_EXTENSION_ENABLE)
|
|
struct ConcealNode *ConcealHead[MAX_VIEW_NUM];
|
|
// struct concealment_node *concealment_end[MAX_VIEW_NUM];
|
|
#else
|
|
struct ConcealNode *ConcealHead[1];
|
|
// struct concealment_node *concealment_end;
|
|
#endif
|
|
|
|
int last_out_frame_no[MAX_VIEW_NUM];
|
|
struct frame_store *last_out_fs[MAX_VIEW_NUM];
|
|
|
|
int fercPOCinDpb[MAX_VIEW_NUM][100];
|
|
|
|
}ConcealParameters;
|
|
|
|
|
|
struct partial_mv_double
|
|
{
|
|
double mv_x;
|
|
double mv_y;
|
|
};
|
|
struct partial_mv
|
|
{
|
|
struct partial_mv_double mv;
|
|
char ref_idx;
|
|
};
|
|
|
|
|
|
typedef struct motion_prop_info
|
|
{
|
|
PicMotionParams ***mv_info;
|
|
int **mv_info_count;
|
|
int ***mv_info_count_lists;
|
|
int Temporal_Ref_Idx;
|
|
int Spatial_Ref_Idx;
|
|
}MotionPropInfo;
|
|
|
|
extern int sort_by_frame_num_up( const void *arg1, const void *arg2 );
|
|
extern int sort_by_poc_up( const void *arg1, const void *arg2 );
|
|
extern int sort_mv_abs_up( const void *arg1, const void *arg2 );
|
|
|
|
extern void MeanFilter( imgpel **initial_matrix, imgpel **filtrated_matrix, int size_x, int size_y, int kernel_size );
|
|
extern void MedianFilter( imgpel **initial_matrix, imgpel **filtrated_matrix, int size_x, int size_y, int kernel_size );
|
|
extern void ConcealMotionVector(VideoParameters *p_Vid, StorablePicture *Dest, Slice *Slice, int y_block4x4, int x_block4x4,int method, int list, int conc_mv[3], int temporal_idx);
|
|
|
|
extern void buildPredblockRegionYUV(VideoParameters *p_Vid, StorablePicture *ref_picture, Macroblock *currMB, int *mv,int x, int y, imgpel *pMB, int Block_Size, imgpel **tmp_block, int have_temp);
|
|
extern void EnhancedbuildPredblock4x4YUV(VideoParameters *p_Vid, int *mv, int x, int y, imgpel *predMB, int list, int current_mb_nr, imgpel **tmp_block);
|
|
extern void EnhancedbuildPredblockRegionYUV(VideoParameters *p_Vid, int *mv, int x, int y, imgpel *predMB, int list, int current_mb_nr, int BlockSize, imgpel **tmp_block);
|
|
extern void ferc_bi_prediction(imgpel *mb_pred, imgpel *block_l0, uint8 value_l0, imgpel *block_l1, uint8 value_l1, int ver_block_size, int hor_block_size, int have_uv);
|
|
extern void copyPredblockRegionYUVDestination(StorablePicture *Destination, imgpel *predBlock, int x, int y, int BLockSize);
|
|
|
|
|
|
extern StorablePicture *fercGetPictureForConcealFromDpb(DecodedPictureBuffer *p_Dpb, int poc, int search_view_id, int search_mode, int search_concealed, unsigned int *position);
|
|
|
|
|
|
//! Motion Estimation function
|
|
extern int blockMatch(const imgpel* refFrame, int stepBytesRF /*stride*/, const imgpel* curBlock,
|
|
int stepBytesCB /*stride*/, int* matchBlock /*results*/, int frameWidth, int frameHeight, int block_size);
|
|
|
|
extern int blockMatch16x16SSE4(const imgpel* refFrame, int stepBytesRF, const imgpel* curBlock,
|
|
int stepBytesCB, int* matchBlock, int frameWidth, int frameHeight, int block_size);
|
|
|
|
extern int blockMatch4x4SSE2(const imgpel* refFrame, int stepBytesRF, const imgpel* curBlock,
|
|
int stepBytesCB, int* matchBlock, int frameWidth, int frameHeight, int BlockSize);
|
|
|
|
|
|
//External Concelament Functions
|
|
extern void Conceal_by_FrameCopy (VideoParameters *p_Vid, StorablePicture *Source, StorablePicture *Dest);
|
|
extern void Conceal_by_MotionCopy_Ref (VideoParameters *p_Vid, StorablePicture *Source, StorablePicture *Dest);
|
|
//extern void Conceal_by_MotionCopyEnhanced (VideoParameters *p_Vid, StorablePicture *Source, StorablePicture *Dest);
|
|
extern void Conceal_by_IntraInterMotionCopy (VideoParameters *p_Vid, StorablePicture *Source, StorablePicture *Dest);
|
|
extern void Conceal_by_IntraInterMotionCopyBaseViewBased (VideoParameters *p_Vid, StorablePicture *Source/*Ignored*/, StorablePicture *Dest);
|
|
extern void Conceal_by_InteractiveIntraInterMotionCopy (VideoParameters *p_Vid, StorablePicture *Source/*Ignored*/, StorablePicture *Dest);
|
|
extern void Conceal_by_IntraInterMotionCopy_V2 (VideoParameters *p_Vid, StorablePicture *Source/*Ignored*/, StorablePicture *Dest);
|
|
|
|
extern void Conceal_by_DisparityBasedFrameDifferenceProjection (VideoParameters *p_Vid, StorablePicture *Source, StorablePicture *Dest);
|
|
extern void Conceal_by_InterViewSimilarityMotion (VideoParameters *p_Vid, StorablePicture *Source, StorablePicture *Dest);
|
|
|
|
#endif
|