Compare commits

...

18 Commits

Author SHA1 Message Date
sijchen
0bb2131291 Merge pull request #1964 from sijchen/fixff
disable ECed output for nodelay decoding
2015-06-02 13:33:31 +08:00
huili2
d2b241b9ed disable ECed output for nodelay decoding 2015-05-28 17:25:03 +08:00
sijchen
4adf9cd6dd Merge pull request #1877 from ruil2/vui_base1.4
fix vui writting
2015-03-25 15:43:00 +08:00
ruil2
343c7f2923 fix vui writting 2015-03-25 14:31:37 +08:00
sijchen
bdb850d29e Merge pull request #1873 from huili2/fix_1145964_v14
fix order of null pointer protection
2015-03-25 11:17:11 +08:00
huili2
d3ff712c15 fix order of null pointer protection 2015-03-24 18:55:13 -07:00
sijchen
52cb8c1135 Merge pull request #1866 from ruil2/flag_change
Flag change
2015-03-18 16:55:22 +08:00
ruil2
440689458a update tables and update ut for different return value 2015-03-18 16:15:40 +08:00
ruil2
dc8471894b update bGapsInFrameNumValueAllowedFlag according to parameters setting 2015-03-18 16:15:25 +08:00
ruil2
3cbcc043f9 Merge pull request #1855 from sijchen/fix_rc14
[Encoder] fix a variable usage in RC
2015-03-16 17:20:54 +08:00
Sijia Chen
f0732c2c76 fix an uninitialization in RC when slice-increasing 2015-03-16 16:11:52 +08:00
Sijia Chen
f3005bbe37 fix the usage of a rc variable 2015-03-16 16:11:33 +08:00
sijchen
56fc515b02 Merge pull request #1851 from ruil2/vui-update
update vui parameters
2015-03-16 09:15:38 +08:00
ruil2
51a38ab17a update vui parameters 2015-03-13 19:08:08 +08:00
sijchen
e8db09fb56 Merge pull request #1848 from ruil2/vui-1.4
add VUI for base layer
2015-03-13 16:56:25 +08:00
ruil2
366b012d68 add VUI for base layer 2015-03-13 16:54:24 +08:00
huili2
26aeb3494c Merge pull request #1839 from dongzha/v.14
disable some HP tools in V1.4
2015-03-06 13:41:01 +08:00
dong zhang
0bc453423c disable some HP tools in V1.4 2015-03-06 11:22:39 +08:00
18 changed files with 7838 additions and 7788 deletions

View File

@ -46,6 +46,7 @@
#include "parameter_sets.h"
#include "decoder_context.h"
#define DISABLE_HP_BRANCH_1_4
namespace WelsDec {
/*!

View File

@ -960,11 +960,13 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //chroma_format_idc
pSps->uiChromaFormatIdc = uiCode;
// if (pSps->uiChromaFormatIdc != 1) {
// WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): chroma_format_idc (%d) = 1 supported.",
// pSps->uiChromaFormatIdc);
// return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
// }
#ifdef DISABLE_HP_BRANCH_1_4
if (pSps->uiChromaFormatIdc != 1) {
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): chroma_format_idc (%d) = 1 supported.",
pSps->uiChromaFormatIdc);
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
}
#endif
if (pSps->uiChromaFormatIdc > 1) {
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): chroma_format_idc (%d) <=1 supported.",
pSps->uiChromaFormatIdc);
@ -991,16 +993,18 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //seq_scaling_matrix_present_flag
pSps->bSeqScalingMatrixPresentFlag = !!uiCode;
if (pSps->bSeqScalingMatrixPresentFlag)// For high profile, it is not used in current application. FIXME
if (pSps->bSeqScalingMatrixPresentFlag) {// For high profile, it is not used in current application. FIXME
#ifndef DISABLE_HP_BRANCH_1_4
WELS_READ_VERIFY (ParseScalingList (pSps, pBs, 0, pSps->bSeqScalingListPresentFlag, pSps->iScalingList4x4,
pSps->iScalingList8x8));
//if exist, to parse scalinglist matrix value
// WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
// "ParseSps(): seq_scaling_matrix_present_flag (%d). Feature not supported.",
// pSps->bSeqScalingMatrixPresentFlag);
//return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
#else
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
"ParseSps(): seq_scaling_matrix_present_flag (%d). Feature not supported.",
pSps->bSeqScalingMatrixPresentFlag);
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
#endif
}
}
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //log2_max_frame_num_minus4
WELS_CHECK_SE_UPPER_ERROR (uiCode, SPS_LOG2_MAX_FRAME_NUM_MINUS4_MAX, "log2_max_frame_num_minus4",
@ -1353,13 +1357,21 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux,
pPps->bWeightedPredFlag = !!uiCode;
WELS_READ_VERIFY (BsGetBits (pBsAux, 2, &uiCode)); //weighted_bipred_idc
pPps->uiWeightedBipredIdc = uiCode;
#ifdef DISABLE_HP_BRANCH_1_4
if (pPps->bWeightedPredFlag || pPps->uiWeightedBipredIdc != 0) {
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
"ParsePps(): weighted_pred_flag (%d) weighted_bipred_idc (%d) neither supported.\n",
pPps->bWeightedPredFlag, pPps->uiWeightedBipredIdc);
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_WP);
}
#else
if (pPps->uiWeightedBipredIdc != 0) {
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
"ParsePps(): weighted_bipred_idc (%d) not supported.\n",
pPps->uiWeightedBipredIdc);
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_WP);
}
#endif
WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode)); //pic_init_qp_minus26
pPps->iPicInitQp = PIC_INIT_QP_OFFSET + iCode;
WELS_CHECK_SE_BOTH_ERROR (pPps->iPicInitQp, PPS_PIC_INIT_QP_QS_MIN, PPS_PIC_INIT_QP_QS_MAX, "pic_init_qp_minus26 + 26",
@ -1381,28 +1393,27 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux,
pPps->bRedundantPicCntPresentFlag = !!uiCode;
/*TODO: to judge whether going on to parse*/
//going on to parse high profile syntax, need fix me
if (0) {
WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode));
pPps->bTransform_8x8_mode_flag = !!uiCode;
WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode));
pPps->bPicScalingMatrixPresentFlag = !!uiCode;
if (pPps->bPicScalingMatrixPresentFlag) {
if (pCtx->bSpsAvailFlags[pPps->iSpsId])
WELS_READ_VERIFY (ParseScalingList (&pCtx->sSpsBuffer[pPps->iSpsId], pBsAux, 1, pPps->bPicScalingListPresentFlag,
#ifndef DISABLE_HP_BRANCH_1_4
WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode));
pPps->bTransform_8x8_mode_flag = !!uiCode;
WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode));
pPps->bPicScalingMatrixPresentFlag = !!uiCode;
if (pPps->bPicScalingMatrixPresentFlag) {
if (pCtx->bSpsAvailFlags[pPps->iSpsId])
WELS_READ_VERIFY (ParseScalingList (&pCtx->sSpsBuffer[pPps->iSpsId], pBsAux, 1, pPps->bPicScalingListPresentFlag,
pPps->iScalingList4x4, pPps->iScalingList8x8));
else {
pCtx->bSpsLatePps = true;
WELS_READ_VERIFY (ParseScalingList (NULL, pBsAux, 1, pPps->bPicScalingListPresentFlag, pPps->iScalingList4x4,
pPps->iScalingList8x8));
}
else {
pCtx->bSpsLatePps = true;
WELS_READ_VERIFY (ParseScalingList (NULL, pBsAux, 1, pPps->bPicScalingListPresentFlag, pPps->iScalingList4x4,
pPps->iScalingList8x8));
}
//add second chroma qp parsing process
WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode)); //chroma_qp_index_offset,cr
pPps->iChromaQpIndexOffset[1] = iCode;
WELS_CHECK_SE_BOTH_ERROR (pPps->iChromaQpIndexOffset[1], PPS_CHROMA_QP_INDEX_OFFSET_MIN, PPS_CHROMA_QP_INDEX_OFFSET_MAX,
"second_chroma_qp_index_offset", GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_CHROMA_QP_INDEX_OFFSET));
}
//add second chroma qp parsing process
WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode)); //chroma_qp_index_offset,cr
pPps->iChromaQpIndexOffset[1] = iCode;
WELS_CHECK_SE_BOTH_ERROR (pPps->iChromaQpIndexOffset[1], PPS_CHROMA_QP_INDEX_OFFSET_MIN, PPS_CHROMA_QP_INDEX_OFFSET_MAX,
"second_chroma_qp_index_offset", GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_CHROMA_QP_INDEX_OFFSET));
#endif
if (pCtx->pAccessUnitList->uiAvailUnitsNum > 0) {
PNalUnit pLastNalUnit = pCtx->pAccessUnitList->pNalUnitsList[pCtx->pAccessUnitList->uiAvailUnitsNum - 1];
PPps pLastPps = pLastNalUnit->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pPps;

View File

@ -426,7 +426,7 @@ int32_t WelsRequestMem (PWelsDecoderContext pCtx, const int32_t kiMbWidth, const
if (pCtx->pCabacDecEngine == NULL)
pCtx->pCabacDecEngine = (SWelsCabacDecEngine*) WelsMallocz (sizeof (SWelsCabacDecEngine), "pCtx->pCabacDecEngine");
WELS_VERIFY_RETURN_IF (ERR_INFO_OUT_OF_MEMORY, (NULL == pCtx->pCabacDecEngine))
return ERR_NONE;
}

View File

@ -1265,8 +1265,6 @@ int32_t InitialDqLayersContext (PWelsDecoderContext pCtx, const int32_t kiMaxWid
int8_t) * MB_PARTITION_SIZE, "pCtx->sMb.pSubMbType[]");
pCtx->sMb.pSliceIdc[i] = (int32_t*) WelsMallocz (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int32_t),
"pCtx->sMb.pSliceIdc[]"); // using int32_t for slice_idc, 4/21/2010
if (pCtx->sMb.pSliceIdc[i] != NULL)
memset (pCtx->sMb.pSliceIdc[i], 0xff, (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int32_t)));
pCtx->sMb.pResidualPredFlag[i] = (int8_t*) WelsMallocz (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t),
"pCtx->sMb.pResidualPredFlag[]");
//pCtx->sMb.pMotionPredFlag[i] = (uint8_t *) WelsMallocz(pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof(uint8_t), "pCtx->sMb.pMotionPredFlag[]");
@ -1303,6 +1301,8 @@ int32_t InitialDqLayersContext (PWelsDecoderContext pCtx, const int32_t kiMaxWid
)
)
memset (pCtx->sMb.pSliceIdc[i], 0xff, (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int32_t)));
pCtx->pDqLayersList[i] = pDq;
++ i;
} while (i < LAYER_NUM_EXCHANGEABLE);

View File

@ -90,9 +90,9 @@ PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth, const
} else {
pPic->pBuffer[0] = static_cast<uint8_t*> (WelsMallocz (iLumaSize /* luma */
+ (iChromaSize << 1) /* Cb,Cr */, "_pic->buffer[0]"));
memset (pPic->pBuffer[0], 128, (iLumaSize + (iChromaSize << 1)));
WELS_VERIFY_RETURN_PROC_IF (NULL, NULL == pPic->pBuffer[0], FreePicture (pPic));
memset (pPic->pBuffer[0], 128, (iLumaSize + (iChromaSize << 1)));
pPic->iLinesize[0] = iPicWidth;
pPic->iLinesize[1] = pPic->iLinesize[2] = iPicChromaWidth;
pPic->pBuffer[1] = pPic->pBuffer[0] + iLumaSize;

View File

@ -399,14 +399,8 @@ DECODING_STATE CWelsDecoder::DecodeFrameNoDelay (const unsigned char* kpSrc,
unsigned char** ppDst,
SBufferInfo* pDstInfo) {
int iRet;
SBufferInfo sTmpBufferInfo;
iRet = (int) DecodeFrame2 (kpSrc, kiSrcLen, ppDst, pDstInfo);
memcpy (&sTmpBufferInfo, pDstInfo, sizeof (SBufferInfo));
iRet |= DecodeFrame2 (NULL, 0, ppDst, pDstInfo);
if ((pDstInfo->iBufferStatus == 0) && (sTmpBufferInfo.iBufferStatus == 1)) {
memcpy (pDstInfo, &sTmpBufferInfo, sizeof (SBufferInfo));
}
return (DECODING_STATE) iRet;
}

View File

@ -107,7 +107,7 @@ int32_t WelsWritePpsSyntax (SWelsPPS* pPps, SBitStringAux* pBitStringAux, SParaS
int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialLayerInternal* pLayerParamInternal,
const uint32_t kuiIntraPeriod, const int32_t kiNumRefFrame,
const uint32_t kiSpsId, const bool kbEnableFrameCropping, bool bEnableRc,
const int32_t kiDlayerCount);
const int32_t kiDlayerCount,bool bSVCBaselayer);
/*!
* \brief initialize subset pSps based on configurable parameters in svc
@ -121,7 +121,8 @@ int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialL
int32_t WelsInitSubsetSps (SSubsetSps* pSubsetSps, SSpatialLayerConfig* pLayerParam,
SSpatialLayerInternal* pLayerParamInternal,
const uint32_t kuiIntraPeriod, const int32_t kiNumRefFrame,
const uint32_t kiSpsId, const bool kbEnableFrameCropping, bool bEnableRc);
const uint32_t kiSpsId, const bool kbEnableFrameCropping, bool bEnableRc,
const int32_t kiDlayerCount);
/*!
* \brief initialize pPps based on configurable parameters and pSps(subset pSps) in svc
@ -161,6 +162,7 @@ int32_t WelsAdjustLevel (SSpatialLayerConfig* pSpatialLayer);
int32_t FindExistingSps (SWelsSvcCodingParam* pParam, const bool kbUseSubsetSps, const int32_t iDlayerIndex,
const int32_t iDlayerCount, const int32_t iSpsNumInUse,
SWelsSPS* pSpsArray,
SSubsetSps* pSubsetArray);
SSubsetSps* pSubsetArray,
bool bSVCBaselayer);
}
#endif//WELS_ACCESS_UNIT_PARSER_H__

View File

@ -68,14 +68,14 @@ uint8_t iLevelIdc;
// uint8_t uiBitDepthChroma; //=8
/* TO BE CONTINUE: POC type 1 */
// bool bDeltaPicOrderAlwaysZeroFlag;
// bool bGapsInFrameNumValueAllowedFlag; //=true
bool bGapsInFrameNumValueAllowedFlag;
// bool bFrameMbsOnlyFlag;
// bool bMbaffFlag; // MB Adapative Frame Field
// bool bDirect8x8InferenceFlag;
bool bFrameCroppingFlag;
// bool bVuiParamPresentFlag;
bool bVuiParamPresentFlag;
// bool bTimingInfoPresentFlag;
// bool bFixedFrameRateFlag;

View File

@ -196,6 +196,32 @@ static inline ELevelIdc WelsGetLevelIdc (const SWelsSPS* kpSps, float fFrameRate
return LEVEL_5_1; //final decision: select the biggest level
}
int32_t WelsWriteVUI (SWelsSPS* pSps, SBitStringAux* pBitStringAux) {
SBitStringAux* pLocalBitStringAux = pBitStringAux;
assert (pSps != NULL && pBitStringAux != NULL);
BsWriteOneBit (pLocalBitStringAux, false); //aspect_ratio_info_present_flag
BsWriteOneBit (pLocalBitStringAux, false); //overscan_info_present_flag
BsWriteOneBit (pLocalBitStringAux, false); //video_signal_type_present_flag
BsWriteOneBit (pLocalBitStringAux, false); //chroma_loc_info_present_flag
BsWriteOneBit (pLocalBitStringAux, false); //timing_info_present_flag
BsWriteOneBit (pLocalBitStringAux, false); //nal_hrd_parameters_present_flag
BsWriteOneBit (pLocalBitStringAux, false); //vcl_hrd_parameters_present_flag
BsWriteOneBit (pLocalBitStringAux, false); //pic_struct_present_flag
BsWriteOneBit (pLocalBitStringAux, true); //bitstream_restriction_flag
//
BsWriteOneBit (pLocalBitStringAux, true); //motion_vectors_over_pic_boundaries_flag
BsWriteUE (pLocalBitStringAux, 0); //max_bytes_per_pic_denom
BsWriteUE (pLocalBitStringAux, 0); //max_bits_per_mb_denom
BsWriteUE (pLocalBitStringAux, 16); //log2_max_mv_length_horizontal
BsWriteUE (pLocalBitStringAux, 16); //log2_max_mv_length_vertical
BsWriteUE (pLocalBitStringAux, 0); //max_num_reorder_frames
BsWriteUE (pLocalBitStringAux, pSps->iNumRefFrames); //max_dec_frame_buffering
return 0;
}
/*!
*************************************************************************************
@ -210,7 +236,7 @@ static inline ELevelIdc WelsGetLevelIdc (const SWelsSPS* kpSps, float fFrameRate
* \note Call it in case EWelsNalUnitType is SPS.
*************************************************************************************
*/
int32_t WelsWriteSpsSyntax (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_t* pSpsIdDelta) {
int32_t WelsWriteSpsSyntax (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_t* pSpsIdDelta, bool bBaseLayer) {
SBitStringAux* pLocalBitStringAux = pBitStringAux;
assert (pSps != NULL && pBitStringAux != NULL);
@ -241,7 +267,7 @@ int32_t WelsWriteSpsSyntax (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_
BsWriteUE (pLocalBitStringAux, pSps->iLog2MaxPocLsb - 4); // log2_max_pic_order_cnt_lsb_minus4
BsWriteUE (pLocalBitStringAux, pSps->iNumRefFrames); // max_num_ref_frames
BsWriteOneBit (pLocalBitStringAux, true/*pSps->bGapsInFrameNumValueAllowedFlag*/); // bGapsInFrameNumValueAllowedFlag
BsWriteOneBit (pLocalBitStringAux, pSps->bGapsInFrameNumValueAllowedFlag); //gaps_in_frame_numvalue_allowed_flag
BsWriteUE (pLocalBitStringAux, pSps->iMbWidth - 1); // pic_width_in_mbs_minus1
BsWriteUE (pLocalBitStringAux, pSps->iMbHeight - 1); // pic_height_in_map_units_minus1
BsWriteOneBit (pLocalBitStringAux, true/*pSps->bFrameMbsOnlyFlag*/); // bFrameMbsOnlyFlag
@ -254,15 +280,18 @@ int32_t WelsWriteSpsSyntax (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_
BsWriteUE (pLocalBitStringAux, pSps->sFrameCrop.iCropTop); // frame_crop_top_offset
BsWriteUE (pLocalBitStringAux, pSps->sFrameCrop.iCropBottom); // frame_crop_bottom_offset
}
BsWriteOneBit (pLocalBitStringAux, 0/*pSps->bVuiParamPresentFlag*/); // vui_parameters_present_flag
if (bBaseLayer) {
BsWriteOneBit (pLocalBitStringAux, true); // vui_parameters_present_flag
WelsWriteVUI (pSps, pBitStringAux);
} else {
BsWriteOneBit (pLocalBitStringAux, false);
}
return 0;
}
int32_t WelsWriteSpsNal (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_t* pSpsIdDelta) {
WelsWriteSpsSyntax (pSps, pBitStringAux, pSpsIdDelta);
WelsWriteSpsSyntax (pSps, pBitStringAux, pSpsIdDelta, true);
BsRbspTrailingBits (pBitStringAux);
@ -286,7 +315,7 @@ int32_t WelsWriteSpsNal (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_t*
int32_t WelsWriteSubsetSpsSyntax (SSubsetSps* pSubsetSps, SBitStringAux* pBitStringAux , int32_t* pSpsIdDelta) {
SWelsSPS* pSps = &pSubsetSps->pSps;
WelsWriteSpsSyntax (pSps, pBitStringAux, pSpsIdDelta);
WelsWriteSpsSyntax (pSps, pBitStringAux, pSpsIdDelta, false);
if (pSps->uiProfileIdc == PRO_SCALABLE_BASELINE || pSps->uiProfileIdc == PRO_SCALABLE_HIGH) {
SSpsSvcExt* pSubsetSpsExt = &pSubsetSps->sSpsSvcExt;
@ -437,7 +466,7 @@ static inline bool WelsGetPaddingOffset (int32_t iActualWidth, int32_t iActualHe
int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialLayerInternal* pLayerParamInternal,
const uint32_t kuiIntraPeriod, const int32_t kiNumRefFrame,
const uint32_t kuiSpsId, const bool kbEnableFrameCropping, bool bEnableRc,
const int32_t kiDlayerCount) {
const int32_t kiDlayerCount, bool bSVCBaselayer) {
memset (pSps, 0, sizeof (SWelsSPS));
pSps->uiSpsId = kuiSpsId;
pSps->iMbWidth = (pLayerParam->iVideoWidth + 15) >> 4;
@ -456,7 +485,6 @@ int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialL
} else {
pSps->bFrameCroppingFlag = false;
}
pSps->uiProfileIdc = pLayerParam->uiProfileIdc ? pLayerParam->uiProfileIdc : PRO_BASELINE;
if (pLayerParam->uiProfileIdc == PRO_BASELINE) {
pSps->bConstraintSet0Flag = true;
@ -464,7 +492,7 @@ int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialL
if (pLayerParam->uiProfileIdc <= PRO_MAIN) {
pSps->bConstraintSet1Flag = true;
}
if (kiDlayerCount > 1) {
if ((kiDlayerCount > 1) && bSVCBaselayer) {
pSps->bConstraintSet2Flag = true;
}
@ -481,6 +509,14 @@ int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialL
pLayerParam->uiLevelIdc = uiLevel;
}
pSps->iLevelIdc = g_kuiLevelMaps[pLayerParam->uiLevelIdc - 1];
//bGapsInFrameNumValueAllowedFlag is false when only spatial layer number and temporal layer number is 1, and ltr is 0.
if ((kiDlayerCount == 1) && (pSps->iNumRefFrames == 1))
pSps->bGapsInFrameNumValueAllowedFlag = false;
else
pSps->bGapsInFrameNumValueAllowedFlag = true;
pSps->bVuiParamPresentFlag = true;
return 0;
}
@ -488,13 +524,14 @@ int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialL
int32_t WelsInitSubsetSps (SSubsetSps* pSubsetSps, SSpatialLayerConfig* pLayerParam,
SSpatialLayerInternal* pLayerParamInternal,
const uint32_t kuiIntraPeriod, const int32_t kiNumRefFrame,
const uint32_t kuiSpsId, const bool kbEnableFrameCropping, bool bEnableRc) {
const uint32_t kuiSpsId, const bool kbEnableFrameCropping, bool bEnableRc,
const int32_t kiDlayerCount) {
SWelsSPS* pSps = &pSubsetSps->pSps;
memset (pSubsetSps, 0, sizeof (SSubsetSps));
WelsInitSps (pSps, pLayerParam, pLayerParamInternal, kuiIntraPeriod, kiNumRefFrame, kuiSpsId, kbEnableFrameCropping,
bEnableRc, 1);
bEnableRc, kiDlayerCount, false);
pSps->uiProfileIdc = (pLayerParam->uiProfileIdc >= PRO_SCALABLE_BASELINE) ? pLayerParam->uiProfileIdc :
PRO_SCALABLE_BASELINE;

View File

@ -898,7 +898,7 @@ void FreeMbCache (SMbCache* pMbCache, CMemoryAlign* pMa) {
static int32_t WelsGenerateNewSps (sWelsEncCtx* pCtx, const bool kbUseSubsetSps, const int32_t iDlayerIndex,
const int32_t iDlayerCount, const int32_t kiSpsId,
SWelsSPS*& pSps, SSubsetSps*& pSubsetSps) {
SWelsSPS*& pSps, SSubsetSps*& pSubsetSps, bool bSVCBaselayer) {
int32_t iRet = 0;
if (!kbUseSubsetSps) {
@ -914,11 +914,12 @@ static int32_t WelsGenerateNewSps (sWelsEncCtx* pCtx, const bool kbUseSubsetSps,
if (!kbUseSubsetSps) {
iRet = WelsInitSps (pSps, pDlayerParam, &pParam->sDependencyLayers[iDlayerIndex], pParam->uiIntraPeriod,
pParam->iMaxNumRefFrame,
kiSpsId, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE, iDlayerCount);
kiSpsId, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE, iDlayerCount,
bSVCBaselayer);
} else {
iRet = WelsInitSubsetSps (pSubsetSps, pDlayerParam, &pParam->sDependencyLayers[iDlayerIndex], pParam->uiIntraPeriod,
pParam->iMaxNumRefFrame,
kiSpsId, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE);
kiSpsId, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE, iDlayerCount);
}
return iRet;
}
@ -978,7 +979,7 @@ static bool CheckMatchedSubsetSps (SSubsetSps* const pSubsetSps1, SSubsetSps* co
int32_t FindExistingSps (SWelsSvcCodingParam* pParam, const bool kbUseSubsetSps, const int32_t iDlayerIndex,
const int32_t iDlayerCount, const int32_t iSpsNumInUse,
SWelsSPS* pSpsArray,
SSubsetSps* pSubsetArray) {
SSubsetSps* pSubsetArray, bool bSVCBaseLayer) {
SSpatialLayerConfig* pDlayerParam = &pParam->sSpatialLayers[iDlayerIndex];
assert (iSpsNumInUse <= MAX_SPS_COUNT);
@ -986,7 +987,8 @@ int32_t FindExistingSps (SWelsSvcCodingParam* pParam, const bool kbUseSubsetSps,
SWelsSPS sTmpSps;
WelsInitSps (&sTmpSps, pDlayerParam, &pParam->sDependencyLayers[iDlayerIndex], pParam->uiIntraPeriod,
pParam->iMaxNumRefFrame,
0, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE, iDlayerCount);
0, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE, iDlayerCount,
bSVCBaseLayer);
for (int32_t iId = 0; iId < iSpsNumInUse; iId++) {
if (CheckMatchedSps (&sTmpSps, &pSpsArray[iId])) {
return iId;
@ -996,7 +998,7 @@ int32_t FindExistingSps (SWelsSvcCodingParam* pParam, const bool kbUseSubsetSps,
SSubsetSps sTmpSubsetSps;
WelsInitSubsetSps (&sTmpSubsetSps, pDlayerParam, &pParam->sDependencyLayers[iDlayerIndex], pParam->uiIntraPeriod,
pParam->iMaxNumRefFrame,
0, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE);
0, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE, iDlayerCount);
for (int32_t iId = 0; iId < iSpsNumInUse; iId++) {
if (CheckMatchedSubsetSps (&sTmpSubsetSps, &pSubsetArray[iId])) {
@ -1258,19 +1260,20 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p
SDqIdc* pDqIdc = & (*ppCtx)->pDqIdcMap[iDlayerIndex];
const bool bUseSubsetSps = (!pParam->bSimulcastAVC) && (iDlayerIndex > BASE_DEPENDENCY_ID);
SSpatialLayerConfig* pDlayerParam = &pParam->sSpatialLayers[iDlayerIndex];
bool bSvcBaselayer = (!pParam->bSimulcastAVC) && (iDlayerCount > BASE_DEPENDENCY_ID)
&& (iDlayerIndex == BASE_DEPENDENCY_ID);
pDqIdc->uiSpatialId = iDlayerIndex;
if (! (SPS_LISTING & pParam->eSpsPpsIdStrategy)) {
WelsGenerateNewSps (*ppCtx, bUseSubsetSps, iDlayerIndex,
iDlayerCount, iSpsId, pSps, pSubsetSps);
iDlayerCount, iSpsId, pSps, pSubsetSps, bSvcBaselayer);
} else {
//SPS_LISTING_AND_PPS_INCREASING == pParam->eSpsPpsIdStrategy
//check if the current param can fit in an existing SPS
const int32_t kiFoundSpsId = FindExistingSps ((*ppCtx)->pSvcParam, bUseSubsetSps, iDlayerIndex, iDlayerCount,
bUseSubsetSps ? ((*ppCtx)->sPSOVector.uiInUseSubsetSpsNum) : ((*ppCtx)->sPSOVector.uiInUseSpsNum),
(*ppCtx)->pSpsArray,
(*ppCtx)->pSubsetArray);
(*ppCtx)->pSubsetArray, bSvcBaselayer);
if (INVALID_ID != kiFoundSpsId) {
@ -1309,7 +1312,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p
}
WelsGenerateNewSps (*ppCtx, bUseSubsetSps, iDlayerIndex,
iDlayerCount, iSpsId, pSps, pSubsetSps);
iDlayerCount, iSpsId, pSps, pSubsetSps, bSvcBaselayer);
}
}
@ -4097,7 +4100,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
pCtx->pFuncList->pfRc.pfWelsRcPictureInfoUpdate (pCtx, iLayerSize);
RcTraceFrameBits (pCtx, pSrcPic->uiTimeStamp);
pCtx->pDecPic->iFrameAverageQp = pCtx->pWelsSvcRc->iAverageFrameQp;
pCtx->pDecPic->iFrameAverageQp = pCtx->pWelsSvcRc[iDidIdx].iAverageFrameQp;
//update scc related
pCtx->pFuncList->pfUpdateFMESwitch (pCtx->pCurDqLayer);
@ -4763,17 +4766,19 @@ int32_t DynSliceRealloc (sWelsEncCtx* pCtx,
pMA->WelsFree (pCurLayer->pSliceEncCtx->pCountMbNumInSlice, "pSliceSeg->pCountMbNumInSlice");
pCurLayer->pSliceEncCtx->pCountMbNumInSlice = pCountMbNumInSlice;
//deal with rate control variables
const int32_t kiCurDid = pCtx->uiDependencyId;
SRCSlicing* pSlcingOverRc = (SRCSlicing*)pMA->WelsMalloc (iMaxSliceNum * sizeof (SRCSlicing), "SlicingOverRC");
if (NULL == pSlcingOverRc) {
WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR,
"CWelsH264SVCEncoder::DynSliceRealloc: realloc pSlcingOverRc not successful");
return ENC_RETURN_MEMALLOCERR;
}
memcpy (pSlcingOverRc, pCtx->pWelsSvcRc->pSlicingOverRc, sizeof (SRCSlicing) * iMaxSliceNumOld);
memcpy (pSlcingOverRc, pCtx->pWelsSvcRc[kiCurDid].pSlicingOverRc, sizeof (SRCSlicing) * iMaxSliceNumOld);
uiSliceIdx = iMaxSliceNumOld;
SRCSlicing* pSORC = &pSlcingOverRc[uiSliceIdx];
const int32_t kiBitsPerMb = WELS_DIV_ROUND (pCtx->pWelsSvcRc->iTargetBits * INT_MULTIPLY,
pCtx->pWelsSvcRc->iNumberMbFrame);
const int32_t kiBitsPerMb = WELS_DIV_ROUND (pCtx->pWelsSvcRc[kiCurDid].iTargetBits * INT_MULTIPLY,
pCtx->pWelsSvcRc[kiCurDid].iNumberMbFrame);
while (uiSliceIdx < iMaxSliceNum) {
pSORC->iComplexityIndexSlice = 0;
pSORC->iCalculatedQpSlice = pCtx->iGlobalQp;
@ -4786,8 +4791,8 @@ int32_t DynSliceRealloc (sWelsEncCtx* pCtx,
pSORC ++;
uiSliceIdx ++;
}
pMA->WelsFree (pCtx->pWelsSvcRc->pSlicingOverRc, "SlicingOverRC");
pCtx->pWelsSvcRc->pSlicingOverRc = pSlcingOverRc;
pMA->WelsFree (pCtx->pWelsSvcRc[kiCurDid].pSlicingOverRc, "SlicingOverRC");
pCtx->pWelsSvcRc[kiCurDid].pSlicingOverRc = pSlcingOverRc;
if (pCtx->iMaxSliceCount < iMaxSliceNum)
pCtx->iMaxSliceCount = iMaxSliceNum;

View File

@ -91,7 +91,7 @@ class DecodeEncodeTest : public ::testing::TestWithParam<DecodeEncodeFileParam>,
BufferedData buf_;
};
void DecEncFileParamToParamExt (DecodeEncodeFileParam * pDecEncFileParam, SEncParamExt* pEnxParamExt) {
void DecEncFileParamToParamExt (DecodeEncodeFileParam* pDecEncFileParam, SEncParamExt* pEnxParamExt) {
ASSERT_TRUE (NULL != pDecEncFileParam && NULL != pEnxParamExt);
pEnxParamExt->iPicWidth = pDecEncFileParam->width;
@ -107,14 +107,14 @@ void DecEncFileParamToParamExt (DecodeEncodeFileParam * pDecEncFileParam, SEncPa
pEnxParamExt->iEntropyCodingModeFlag = 0;
for (int i = 0; i < pEnxParamExt->iSpatialLayerNum; i++) {
pEnxParamExt->sSpatialLayers[i].sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
pEnxParamExt->sSpatialLayers[i].sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
}
}
TEST_P (DecodeEncodeTest, CompareOutput) {
DecodeEncodeFileParam p = GetParam();
SEncParamExt EnxParamExt;
DecEncFileParamToParamExt(&p,&EnxParamExt);
DecEncFileParamToParamExt (&p, &EnxParamExt);
#if defined(ANDROID_NDK)
std::string filename = std::string ("/sdcard/") + p.fileName;
@ -130,8 +130,8 @@ TEST_P (DecodeEncodeTest, CompareOutput) {
}
}
static const DecodeEncodeFileParam kFileParamArray[] = {
{"res/test_vd_1d.264", "63fe502aa2d63869cc888592e4984b3d6e8c3bef", 320, 192, 12.0f},
{"res/test_vd_rc.264", "fda7fdfbef853ec7aaf3e236dcfa7c0ba9c2314a", 320, 192, 12.0f},
{"res/test_vd_1d.264", "9d4d682679a0746edda2824687f00ba6db91a2a8", 320, 192, 12.0f},
{"res/test_vd_rc.264", "23dab419a16c6e894518ca93444666e9336aef63", 320, 192, 12.0f},
};

View File

@ -1707,7 +1707,7 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificFrameChange) {
EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //no output
rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction
//Ref picture is ECed, so current status is ECed, when EC disable, NO output
EXPECT_TRUE ((rv & 32) != 0);
EXPECT_TRUE (rv != 0);
EXPECT_EQ (dstBufInfo_.iBufferStatus, 0);
iIdx++;
@ -2513,7 +2513,7 @@ const uint32_t kiHeight = 96; //DO NOT CHANGE!
const uint32_t kiFrameRate = 12; //DO NOT CHANGE!
const uint32_t kiFrameNum = 100; //DO NOT CHANGE!
const char* pHashStr[] = { //DO NOT CHANGE!
"d1c255a57aa2c5e1192a90680c00e6ee3e73fe59",
"058076b265686fc85b2b99cf7a53106f216f16c3",
"f350001c333902029800bd291fbed915a4bdf19a",
"eb9d853b7daec03052c4850027ac94adc84c3a7e"
};

View File

@ -56,7 +56,7 @@ void EncFileParamToParamExt (EncodeFileParam* pEncFileParam, SEncParamExt* pEnxP
pEnxParamExt->iEntropyCodingModeFlag = pEncFileParam->bCabac ? 1 : 0;
for (int i = 0; i < pEnxParamExt->iSpatialLayerNum; i++) {
pEnxParamExt->sSpatialLayers[i].sSliceCfg.uiSliceMode = pEncFileParam->eSliceMode;
pEnxParamExt->sSpatialLayers[i].sSliceCfg.uiSliceMode = pEncFileParam->eSliceMode;
}
}
@ -90,7 +90,7 @@ TEST_P (EncoderOutputTest, CompareOutput) {
std::string filename = std::string ("/sdcard/") + p.pkcFileName;
EncodeFile (p.pkcFileName, &EnxParamExt, this);
#else
EncodeFile (p.pkcFileName, &EnxParamExt, this);
EncodeFile (p.pkcFileName, &EnxParamExt, this);
#endif
//will remove this after screen content algorithms are ready,
//because the bitstream output will vary when the different algorithms are added.
@ -103,65 +103,65 @@ TEST_P (EncoderOutputTest, CompareOutput) {
static const EncodeFileParam kFileParamArray[] = {
{
"res/CiscoVT2people_320x192_12fps.yuv",
"16b145cf76a677d87240ef6c8efff0ff8d3a2f3a", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, false, 1, false, false, false
"e36b6169dcb5bbb90e64291250ec65995d62c846", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, false, 1, false, false, false
},
{
"res/CiscoVT2people_160x96_6fps.yuv",
"874ab77ba13f199d70b67cd75f8e23baf482c1ed", CAMERA_VIDEO_REAL_TIME, 160, 96, 6.0f, SM_SINGLE_SLICE, false, 1, false, false, false
"04c73f202a29befd57ee49d242688f3e6ddfecbc", CAMERA_VIDEO_REAL_TIME, 160, 96, 6.0f, SM_SINGLE_SLICE, false, 1, false, false, false
},
{
"res/Static_152_100.yuv",
"73b40ad71e1f1ffbbd5425de2b094ccbdfa798a6", CAMERA_VIDEO_REAL_TIME, 152, 100, 6.0f, SM_SINGLE_SLICE, false, 1, false, false, false
"c959ae52c5469bfc37bb31870c6a7259a1bb1917", CAMERA_VIDEO_REAL_TIME, 152, 100, 6.0f, SM_SINGLE_SLICE, false, 1, false, false, false
},
{
"res/CiscoVT2people_320x192_12fps.yuv",
"c1b187be92a35ac8f4f9724b594559e0394c1df8", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_ROWMB_SLICE, false, 1, false, false, false // One slice per MB row
"f03ca6a679cd12c90542e351eabfce0d902ffad2", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_ROWMB_SLICE, false, 1, false, false, false // One slice per MB row
},
{
"res/CiscoVT2people_320x192_12fps.yuv",
"959a94ea684bf37eaf39909f6460e02b50ad0a5f", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, true, 1, false, false, false
"c7f37486e00c1f18715c7aaf10444f03111418cf", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, true, 1, false, false, false
},
{
"res/CiscoVT2people_320x192_12fps.yuv",
"684e6d141ada776892bdb01ee93efe475983ed36", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, false, 2, false, false, false
"c493a8087050d2993f39ad1081940dd707e6fb3e", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, false, 2, false, false, false
},
{
"res/Cisco_Absolute_Power_1280x720_30fps.yuv",
"27a595af0e9598feb4dc1403fd99affddfa51f46", CAMERA_VIDEO_REAL_TIME, 1280, 720, 30.0f, SM_DYN_SLICE, false, 1, false, false, false
"6cc7d08b2a80fc2836396808f919f9b5d4ee1d97", CAMERA_VIDEO_REAL_TIME, 1280, 720, 30.0f, SM_DYN_SLICE, false, 1, false, false, false
},
{
"res/Cisco_Absolute_Power_1280x720_30fps.yuv",
"68c3220e49b7a57d563faf7c99a870ab34a23400", CAMERA_VIDEO_REAL_TIME, 1280, 720, 30.0f, SM_SINGLE_SLICE, false, 4, false, false, false
"cd10602a951712c1b93bef82a445415723e52af6", CAMERA_VIDEO_REAL_TIME, 1280, 720, 30.0f, SM_SINGLE_SLICE, false, 4, false, false, false
},
// the following values may be adjusted for times since we start tuning the strategy
{
"res/CiscoVT2people_320x192_12fps.yuv",
"1645c417562c5249e58b49b6e467d8b53febb226", SCREEN_CONTENT_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, false, 1, false, false, false
"9b8ba682313ed9cd0512563859e050942a3e776e", SCREEN_CONTENT_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, false, 1, false, false, false
},
{
"res/CiscoVT2people_160x96_6fps.yuv",
"51fc38d467509f94e85f9678f11429220e46d862", SCREEN_CONTENT_REAL_TIME, 160, 96, 6.0f, SM_SINGLE_SLICE, false, 1, false, false, false
"2706c61e9459196b4161f4bbb9444a08308ae8c5", SCREEN_CONTENT_REAL_TIME, 160, 96, 6.0f, SM_SINGLE_SLICE, false, 1, false, false, false
},
{
"res/Static_152_100.yuv",
"1af33ad3d8c40756ef1f6074c019a06535c35ab0", SCREEN_CONTENT_REAL_TIME, 152, 100, 6.0f, SM_SINGLE_SLICE, false, 1, false, false, false
"d8457a47946e91b01310d8de9afa21ac00df8edb", SCREEN_CONTENT_REAL_TIME, 152, 100, 6.0f, SM_SINGLE_SLICE, false, 1, false, false, false
},
{
"res/Cisco_Absolute_Power_1280x720_30fps.yuv",
"e032f8f8b153f37e614676735074cdce843032de", SCREEN_CONTENT_REAL_TIME, 1280, 720, 30.0f, SM_DYN_SLICE, false, 1, false, false, false
"116663b5a00f000ab40e95b6202563e3cb4ce488", SCREEN_CONTENT_REAL_TIME, 1280, 720, 30.0f, SM_DYN_SLICE, false, 1, false, false, false
},
//for different strategy
{
"res/Cisco_Absolute_Power_1280x720_30fps.yuv",
"28e290b204257eae5c735b2b96491358ec14221e", SCREEN_CONTENT_REAL_TIME, 1280, 720, 30.0f, SM_DYN_SLICE, false, 1, true, true, false
"6b981e68a6e0b03a8b769fdd39ec5838380bc4d2", SCREEN_CONTENT_REAL_TIME, 1280, 720, 30.0f, SM_DYN_SLICE, false, 1, true, true, false
},
{
"res/CiscoVT2people_320x192_12fps.yuv",
"59e51ffc741172df4a729d7fc1f85645885311a5", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, false, 1, false, false, true //turn on cabac
"7aaab6ef2dc5f95c3a2869979eba59553936e36f", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, false, 1, false, false, true //turn on cabac
},
{
"res/Cisco_Absolute_Power_1280x720_30fps.yuv",
"f4361779554ae66ce62308f1e01218369ca0edf4", CAMERA_VIDEO_REAL_TIME, 1280, 720, 30.0f, SM_DYN_SLICE, false, 1, false, false, true
"bb8ee13f829fa593b77760afdeb1215d0a577ee1", CAMERA_VIDEO_REAL_TIME, 1280, 720, 30.0f, SM_DYN_SLICE, false, 1, false, false, true
},
};

View File

@ -272,7 +272,7 @@ void DecoderParseSyntaxTest::TestScalingList() {
//TEST here for whole tests
TEST_F (DecoderParseSyntaxTest, DecoderParseSyntaxTestAll) {
TestScalingList();
//TestScalingList(); Disable ScalingUTTest in Branch1.4
}

View File

@ -73,18 +73,18 @@ TEST_F (ParameterSetStrategyTest, FindExistingSps) {
pDlayerParam = & (sParam1.sSpatialLayers[iDlayerIndex]);
iRet = WelsInitSps (m_pSpsArrayPointer, pDlayerParam, &sParam1.sDependencyLayers[iDlayerIndex], sParam1.uiIntraPeriod,
sParam1.iMaxNumRefFrame,
iCurSpsId, sParam1.bEnableFrameCroppingFlag, sParam1.iRCMode != RC_OFF_MODE, iDlayerCount);
iCurSpsId, sParam1.bEnableFrameCroppingFlag, sParam1.iRCMode != RC_OFF_MODE, iDlayerCount, false);
// try finding #0
iFoundId = FindExistingSps (&sParam1, bUseSubsetSps, iDlayerIndex, iDlayerCount, iCurSpsInUse,
m_pSpsArray, m_pSubsetArray);
m_pSpsArray, m_pSubsetArray, false);
EXPECT_EQ (iFoundId, iCurSpsId);
// try not finding
SWelsSvcCodingParam sParam2 = sParam1;
sParam2.iMaxNumRefFrame ++;
iFoundId = FindExistingSps (&sParam2, bUseSubsetSps, iDlayerIndex, iDlayerCount, iCurSpsInUse,
m_pSpsArray, m_pSubsetArray);
m_pSpsArray, m_pSubsetArray, false);
EXPECT_EQ (iFoundId, INVALID_ID);
// add new sps
@ -93,17 +93,17 @@ TEST_F (ParameterSetStrategyTest, FindExistingSps) {
pDlayerParam = & (sParam2.sSpatialLayers[iDlayerIndex]);
iRet = WelsInitSps (m_pSpsArrayPointer, pDlayerParam, &sParam2.sDependencyLayers[iDlayerIndex], sParam2.uiIntraPeriod,
sParam2.iMaxNumRefFrame,
iCurSpsId, sParam2.bEnableFrameCroppingFlag, sParam2.iRCMode != RC_OFF_MODE, iDlayerCount);
iCurSpsId, sParam2.bEnableFrameCroppingFlag, sParam2.iRCMode != RC_OFF_MODE, iDlayerCount, false);
iCurSpsInUse = 2;
// try finding #1
iFoundId = FindExistingSps (&sParam2, bUseSubsetSps, iDlayerIndex, iDlayerCount, iCurSpsInUse,
m_pSpsArray, m_pSubsetArray);
m_pSpsArray, m_pSubsetArray, false);
EXPECT_EQ (iFoundId, iCurSpsId);
// try finding #0
iFoundId = FindExistingSps (&sParam1, bUseSubsetSps, iDlayerIndex, iDlayerCount, iCurSpsInUse,
m_pSpsArray, m_pSubsetArray);
m_pSpsArray, m_pSubsetArray, false);
EXPECT_EQ (iFoundId, 0);
// try not finding
@ -115,7 +115,7 @@ TEST_F (ParameterSetStrategyTest, FindExistingSps) {
}
iFoundId = FindExistingSps (&sParam2, bUseSubsetSps, iDlayerIndex, iDlayerCount, iCurSpsInUse,
m_pSpsArray, m_pSubsetArray);
m_pSpsArray, m_pSubsetArray, false);
EXPECT_EQ (iFoundId, INVALID_ID);
(void) iRet; // Not using iRet at the moment
}