2012-06-05 11:01:47 +00:00
|
|
|
/**
|
|
|
|
* Part of HEVC Encoder
|
2013-04-16 08:23:03 +00:00
|
|
|
* By Marko Viitanen ( fador at iki.fi ), Tampere University of Technology, Department of Pervasive Computing.
|
2012-06-05 11:01:47 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*! \file picture.h
|
|
|
|
\brief Picture header
|
|
|
|
\author Marko Viitanen
|
2013-04-09 12:59:12 +00:00
|
|
|
\date 2013-04
|
2012-06-05 11:01:47 +00:00
|
|
|
|
|
|
|
Contains all picture related functions and structs
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PICTURE_H_
|
|
|
|
#define _PICTURE_H_
|
|
|
|
|
|
|
|
|
2013-03-12 15:06:21 +00:00
|
|
|
/* Functions */
|
2013-03-25 15:17:24 +00:00
|
|
|
uint32_t SAD64x64(int16_t *block,uint32_t stride1,int16_t* block2, uint32_t stride2);
|
2013-03-12 15:06:21 +00:00
|
|
|
uint32_t SAD32x32(int16_t *block,uint32_t stride1,int16_t* block2, uint32_t stride2);
|
|
|
|
uint32_t SAD16x16(int16_t *block,uint32_t stride1,int16_t* block2, uint32_t stride2);
|
2013-03-14 15:55:06 +00:00
|
|
|
uint32_t SAD8x8(int16_t *block,uint32_t stride1,int16_t* block2, uint32_t stride2);
|
|
|
|
uint32_t SAD4x4(int16_t *block,uint32_t stride1,int16_t* block2, uint32_t stride2);
|
2013-04-05 13:27:18 +00:00
|
|
|
double imagePSNR(uint8_t *frame1, uint8_t *frame2, int32_t x, int32_t y);
|
2013-03-12 15:06:21 +00:00
|
|
|
|
2012-06-05 11:01:47 +00:00
|
|
|
/** \defgroup picture_group Picture handler group
|
|
|
|
* This group contains all picture related stuff
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2012-06-11 15:43:29 +00:00
|
|
|
enum { CU_NOTSET = 0,CU_PCM, CU_SKIP, CU_SPLIT, CU_INTRA, CU_INTER };
|
2012-06-11 12:26:32 +00:00
|
|
|
|
2013-05-16 12:27:54 +00:00
|
|
|
#define GET_SPLITDATA(CU,curDepth) ((CU)->depth > curDepth)
|
2012-06-11 12:39:18 +00:00
|
|
|
#define SET_SPLITDATA(CU,flag) { (CU)->split=(flag); }
|
2012-06-11 12:26:32 +00:00
|
|
|
|
|
|
|
/*!
|
2013-04-10 13:55:31 +00:00
|
|
|
\brief Struct for CU intra info
|
2012-06-11 12:26:32 +00:00
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
2013-04-18 11:04:15 +00:00
|
|
|
int8_t mode;
|
2012-06-11 12:26:32 +00:00
|
|
|
uint32_t cost;
|
|
|
|
} CU_info_intra;
|
|
|
|
|
2013-04-10 13:55:31 +00:00
|
|
|
/*!
|
|
|
|
\brief Struct for CU inter info
|
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
2013-04-18 11:04:15 +00:00
|
|
|
int8_t mode;
|
2013-04-10 13:55:31 +00:00
|
|
|
uint32_t cost;
|
|
|
|
int16_t mv[2];
|
|
|
|
} CU_info_inter;
|
|
|
|
|
2012-06-11 12:26:32 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Struct for CU info
|
|
|
|
*/
|
|
|
|
typedef struct
|
2013-04-17 14:08:52 +00:00
|
|
|
{
|
2013-04-18 11:04:15 +00:00
|
|
|
int8_t type;
|
|
|
|
int8_t depth;
|
2013-04-10 13:55:31 +00:00
|
|
|
int8_t coded;
|
2013-03-12 15:06:21 +00:00
|
|
|
CU_info_intra intra;
|
2013-04-10 13:55:31 +00:00
|
|
|
CU_info_inter inter;
|
2013-04-18 11:04:15 +00:00
|
|
|
int8_t split;
|
2012-06-11 12:26:32 +00:00
|
|
|
} CU_info;
|
|
|
|
|
2012-06-05 11:01:47 +00:00
|
|
|
/*!
|
|
|
|
\brief Struct which contains all picture data
|
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
uint8_t* yData; /*!< \brief Pointer to Y-data */
|
|
|
|
uint8_t* uData; /*!< \brief Pointer to U-data */
|
|
|
|
uint8_t* vData; /*!< \brief Pointer to V-data */
|
2012-06-11 15:43:29 +00:00
|
|
|
|
|
|
|
uint8_t* yRecData; /*!< \brief Pointer to reconstructed Y-data */
|
|
|
|
uint8_t* uRecData; /*!< \brief Pointer to reconstructed U-data */
|
|
|
|
uint8_t* vRecData; /*!< \brief Pointer to reconstructed V-data */
|
|
|
|
|
2013-06-12 12:41:57 +00:00
|
|
|
int32_t width; /*!< \brief Picture width */
|
|
|
|
int32_t height; /*!< \brief Picture height */
|
|
|
|
int32_t height_in_LCU; /*!< \brief input picture width in LCU*/
|
|
|
|
int32_t width_in_LCU; /*!< \brief input picture height in LCU */
|
2012-06-05 11:01:47 +00:00
|
|
|
uint8_t referenced; /*!< \brief Is this picture referenced */
|
2012-06-11 12:26:32 +00:00
|
|
|
CU_info** CU; /*!< \brief info for each CU at each depth */
|
|
|
|
uint8_t type;
|
2013-03-11 10:06:08 +00:00
|
|
|
uint8_t slicetype;
|
2012-06-05 11:01:47 +00:00
|
|
|
} picture;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Struct which contains array of picture structs
|
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
picture** pics; /*!< \brief Pointer to array of picture pointers */
|
|
|
|
unsigned int size; /*!< \brief Array size */
|
|
|
|
unsigned int used_size;
|
|
|
|
|
|
|
|
} picture_list;
|
|
|
|
|
|
|
|
|
|
|
|
picture_list *picture_list_init(int size);
|
|
|
|
int picture_list_resize(picture_list *list, int size);
|
|
|
|
int picture_list_destroy(picture_list *list);
|
|
|
|
|
|
|
|
int picture_destroy(picture *pic);
|
|
|
|
|
2013-04-17 14:08:52 +00:00
|
|
|
void picture_setBlockCoded(picture* pic,uint32_t xCtb, uint32_t yCtb, uint8_t depth, int8_t coded);
|
2013-04-18 11:04:15 +00:00
|
|
|
void picture_setBlockSplit(picture* pic,uint32_t xCtb, uint32_t yCtb, uint8_t depth, int8_t split);
|
2012-06-05 11:01:47 +00:00
|
|
|
|
2012-06-06 11:09:28 +00:00
|
|
|
enum { SLICE_P = 0, SLICE_B = 1, SLICE_I = 2 };
|
|
|
|
|
2013-08-02 13:35:30 +00:00
|
|
|
enum { REF_PIC_LIST_0 = 0,REF_PIC_LIST_1 = 1,REF_PIC_LIST_X = 100 };
|
|
|
|
|
2012-06-06 11:09:28 +00:00
|
|
|
|
2012-06-05 11:01:47 +00:00
|
|
|
/** @} */ // end of group1
|
|
|
|
|
|
|
|
#endif
|