#ifndef WELS_SLICE_H__
#define WELS_SLICE_H__
#include "typedefs.h"
#include "wels_const.h"
#include "wels_common_basis.h"
#include "picture.h"
#include "parameter_sets.h"
namespace WelsDec {
typedef struct TagRefPicListReorderSyntax {
struct {
uint32_t uiAbsDiffPicNumMinus1;
uint16_t uiLongTermPicNum;
uint16_t uiReorderingOfPicNumsIdc;
} sReorderingSyn[LIST_A][MAX_REF_PIC_COUNT + 1];
bool bRefPicListReorderingFlag[LIST_A];
} SRefPicListReorderSyn, *PRefPicListReorderSyn;
typedef struct TagPredWeightTabSyntax {
uint32_t uiLumaLog2WeightDenom;
uint32_t uiChromaLog2WeightDenom;
struct {
int32_t iLumaWeight[MAX_REF_PIC_COUNT];
int32_t iLumaOffset[MAX_REF_PIC_COUNT];
int32_t iChromaWeight[MAX_REF_PIC_COUNT][2];
int32_t iChromaOffset[MAX_REF_PIC_COUNT][2];
bool bLumaWeightFlag;
bool bChromaWeightFlag;
} sPredList[LIST_A];
int32_t iImplicitWeight[MAX_REF_PIC_COUNT][MAX_REF_PIC_COUNT];
} SPredWeightTabSyn, *PPredWeightTabSyn;
typedef struct TagRefPicMarking {
struct {
uint32_t uiMmcoType;
int32_t iShortFrameNum;
int32_t iDiffOfPicNum;
uint32_t uiLongTermPicNum;
int32_t iLongTermFrameIdx;
int32_t iMaxLongTermFrameIdx;
} sMmcoRef[MAX_MMCO_COUNT];
bool bNoOutputOfPriorPicsFlag;
bool bLongTermRefFlag;
bool bAdaptiveRefPicMarkingModeFlag;
} SRefPicMarking, *PRefPicMarking;
typedef struct TagRefBasePicMarkingSyn {
struct {
uint32_t uiMmcoType;
int32_t iShortFrameNum;
uint32_t uiDiffOfPicNums;
uint32_t uiLongTermPicNum; } mmco_base[MAX_MMCO_COUNT];
bool bAdaptiveRefBasePicMarkingModeFlag;
} SRefBasePicMarking, *PRefBasePicMarking;
typedef struct TagSliceHeaders {
int32_t iFirstMbInSlice;
int32_t iFrameNum;
int32_t iPicOrderCntLsb;
int32_t iDeltaPicOrderCntBottom;
int32_t iDeltaPicOrderCnt[2];
int32_t iRedundantPicCnt;
int32_t iDirectSpatialMvPredFlag; int32_t uiRefCount[LIST_A];
int32_t iSliceQpDelta; int32_t iSliceQp;
int32_t iSliceQsDelta; uint32_t uiDisableDeblockingFilterIdc;
int32_t iSliceAlphaC0Offset;
int32_t iSliceBetaOffset;
int32_t iSliceGroupChangeCycle;
PSps pSps;
PPps pPps;
int32_t iSpsId;
int32_t iPpsId;
bool bIdrFlag;
SRefPicListReorderSyn pRefPicListReordering; SPredWeightTabSyn sPredWeightTable;
int32_t iCabacInitIdc;
int32_t iMbWidth; int32_t iMbHeight; SRefPicMarking sRefMarking;
uint16_t uiIdrPicId;
EWelsSliceType eSliceType;
bool bNumRefIdxActiveOverrideFlag;
bool bFieldPicFlag; bool bBottomFiledFlag; uint8_t uiPadding1Byte;
bool bSpForSwitchFlag; int16_t iPadding2Bytes;
} SSliceHeader, *PSliceHeader;
typedef struct TagSliceHeaderExt {
SSliceHeader sSliceHeader;
PSubsetSps pSubsetSps;
uint32_t uiDisableInterLayerDeblockingFilterIdc;
int32_t iInterLayerSliceAlphaC0Offset;
int32_t iInterLayerSliceBetaOffset;
int32_t iScaledRefLayerPicWidthInSampleLuma;
int32_t iScaledRefLayerPicHeightInSampleLuma;
SRefBasePicMarking sRefBasePicMarking;
bool bBasePredWeightTableFlag;
bool bStoreRefBasePicFlag;
bool bConstrainedIntraResamplingFlag;
bool bSliceSkipFlag;
bool bAdaptiveBaseModeFlag;
bool bDefaultBaseModeFlag;
bool bAdaptiveMotionPredFlag;
bool bDefaultMotionPredFlag;
bool bAdaptiveResidualPredFlag;
bool bDefaultResidualPredFlag;
bool bTCoeffLevelPredFlag;
uint8_t uiRefLayerChromaPhaseXPlus1Flag;
uint8_t uiRefLayerChromaPhaseYPlus1;
uint8_t uiRefLayerDqId;
uint8_t uiScanIdxStart;
uint8_t uiScanIdxEnd;
} SSliceHeaderExt, *PSliceHeaderExt;
typedef struct TagSlice {
SSliceHeaderExt sSliceHeaderExt;
int32_t iLastMbQp;
int32_t iMbSkipRun;
int32_t iTotalMbInCurSlice;
bool bSliceHeaderExtFlag;
uint8_t eSliceType;
uint8_t uiPadding[2];
int32_t iLastDeltaQp;
int16_t iMvScale[LIST_A][MAX_DPB_COUNT]; } SSlice, *PSlice;
}
#endif