astyle all cpp files
This commit is contained in:
@@ -259,9 +259,9 @@ uint32_t WelsCPUFeatureDetect (int32_t* pNumberOfLogicProcessors) {
|
|||||||
while (fgets (buf, sizeof (buf), f)) {
|
while (fgets (buf, sizeof (buf), f)) {
|
||||||
if (!strncmp (buf, "Features", strlen ("Features"))) {
|
if (!strncmp (buf, "Features", strlen ("Features"))) {
|
||||||
// The asimd and fp features are listed on 64 bit ARMv8 kernels
|
// The asimd and fp features are listed on 64 bit ARMv8 kernels
|
||||||
if (strstr (buf, " neon ") || strstr(buf, " asimd "))
|
if (strstr (buf, " neon ") || strstr (buf, " asimd "))
|
||||||
flags |= WELS_CPU_NEON;
|
flags |= WELS_CPU_NEON;
|
||||||
if (strstr (buf, " vfpv3 ") || strstr(buf, " fp "))
|
if (strstr (buf, " vfpv3 ") || strstr (buf, " fp "))
|
||||||
flags |= WELS_CPU_VFPv3;
|
flags |= WELS_CPU_VFPv3;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -667,7 +667,7 @@ int ProcessEncoding (ISVCEncoder* pPtrEnc, int argc, char** argv, bool bConfigFi
|
|||||||
int iParsedNum = 1;
|
int iParsedNum = 1;
|
||||||
|
|
||||||
memset (&sFbi, 0, sizeof (SFrameBSInfo));
|
memset (&sFbi, 0, sizeof (SFrameBSInfo));
|
||||||
pPtrEnc->GetDefaultParams(&sSvcParam);
|
pPtrEnc->GetDefaultParams (&sSvcParam);
|
||||||
memset (&fs.sRecFileName[0][0], 0, sizeof (fs.sRecFileName));
|
memset (&fs.sRecFileName[0][0], 0, sizeof (fs.sRecFileName));
|
||||||
|
|
||||||
FillSpecificParameters (sSvcParam);
|
FillSpecificParameters (sSvcParam);
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
|
|||||||
bool bExtensionFlag = false;
|
bool bExtensionFlag = false;
|
||||||
int32_t iErr = ERR_NONE;
|
int32_t iErr = ERR_NONE;
|
||||||
int32_t iBitSize = 0;
|
int32_t iBitSize = 0;
|
||||||
SLogContext* pLogCtx = &(pCtx->sLogCtx);
|
SLogContext* pLogCtx = & (pCtx->sLogCtx);
|
||||||
pNalUnitHeader->eNalUnitType = NAL_UNIT_UNSPEC_0;//SHOULD init it. because pCtx->sCurNalHead is common variable.
|
pNalUnitHeader->eNalUnitType = NAL_UNIT_UNSPEC_0;//SHOULD init it. because pCtx->sCurNalHead is common variable.
|
||||||
|
|
||||||
//remove the consecutive ZERO at the end of current NAL in the reverse order.--2011.6.1
|
//remove the consecutive ZERO at the end of current NAL in the reverse order.--2011.6.1
|
||||||
@@ -622,7 +622,8 @@ int32_t DecodeSpsSvcExt (PWelsDecoderContext pCtx, PSubsetSps pSpsExt, PBitStrin
|
|||||||
WELS_READ_VERIFY (BsGetBits (pBs, 2, &uiCode)); //extended_spatial_scalability_idc
|
WELS_READ_VERIFY (BsGetBits (pBs, 2, &uiCode)); //extended_spatial_scalability_idc
|
||||||
pExt->uiExtendedSpatialScalability = uiCode;
|
pExt->uiExtendedSpatialScalability = uiCode;
|
||||||
if (pExt->uiExtendedSpatialScalability > 2) {
|
if (pExt->uiExtendedSpatialScalability > 2) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "DecodeSpsSvcExt():extended_spatial_scalability (%d) != 0, ESS not supported!\n",
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
|
||||||
|
"DecodeSpsSvcExt():extended_spatial_scalability (%d) != 0, ESS not supported!\n",
|
||||||
pExt->uiExtendedSpatialScalability);
|
pExt->uiExtendedSpatialScalability);
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_ESS);
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_ESS);
|
||||||
}
|
}
|
||||||
@@ -810,7 +811,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
|
|||||||
uiLevelIdc = uiCode;
|
uiLevelIdc = uiCode;
|
||||||
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //seq_parameter_set_id
|
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //seq_parameter_set_id
|
||||||
if (uiCode >= MAX_SPS_COUNT) { // Modified to check invalid negative iSpsId, 12/1/2009
|
if (uiCode >= MAX_SPS_COUNT) { // Modified to check invalid negative iSpsId, 12/1/2009
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, " iSpsId is out of range! \n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " iSpsId is out of range! \n");
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_SPS_ID_OVERFLOW);
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_SPS_ID_OVERFLOW);
|
||||||
}
|
}
|
||||||
iSpsId = uiCode;
|
iSpsId = uiCode;
|
||||||
@@ -819,7 +820,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
|
|||||||
memset (pSubsetSps, 0, sizeof (SSubsetSps));
|
memset (pSubsetSps, 0, sizeof (SSubsetSps));
|
||||||
const SLevelLimits* pSLevelLimits = GetLevelLimits (uiLevelIdc, bConstraintSetFlags[3]);
|
const SLevelLimits* pSLevelLimits = GetLevelLimits (uiLevelIdc, bConstraintSetFlags[3]);
|
||||||
if (NULL == pSLevelLimits) {
|
if (NULL == pSLevelLimits) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): level_idx (%d).\n", uiLevelIdc);
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): level_idx (%d).\n", uiLevelIdc);
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
|
||||||
} else pSps->pSLevelLimits = pSLevelLimits;
|
} else pSps->pSLevelLimits = pSLevelLimits;
|
||||||
// syntax elements in default
|
// syntax elements in default
|
||||||
@@ -837,20 +838,21 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
|
|||||||
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //chroma_format_idc
|
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //chroma_format_idc
|
||||||
pSps->uiChromaFormatIdc = uiCode;
|
pSps->uiChromaFormatIdc = uiCode;
|
||||||
if (pSps->uiChromaFormatIdc != 1) {
|
if (pSps->uiChromaFormatIdc != 1) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): chroma_format_idc (%d) = 1 supported.\n", pSps->uiChromaFormatIdc);
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): chroma_format_idc (%d) = 1 supported.\n",
|
||||||
|
pSps->uiChromaFormatIdc);
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
|
||||||
}
|
}
|
||||||
pSps->uiChromaArrayType = pSps->uiChromaFormatIdc;
|
pSps->uiChromaArrayType = pSps->uiChromaFormatIdc;
|
||||||
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //bit_depth_luma_minus8
|
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //bit_depth_luma_minus8
|
||||||
if (uiCode != 0) {
|
if (uiCode != 0) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): bit_depth_luma (%d) Only 8 bit supported.\n", 8 + uiCode);
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): bit_depth_luma (%d) Only 8 bit supported.\n", 8 + uiCode);
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
|
||||||
}
|
}
|
||||||
pSps->uiBitDepthLuma = 8;
|
pSps->uiBitDepthLuma = 8;
|
||||||
|
|
||||||
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //bit_depth_chroma_minus8
|
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //bit_depth_chroma_minus8
|
||||||
if (uiCode != 0) {
|
if (uiCode != 0) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): bit_depth_chroma (%d). Only 8 bit supported.\n", 8 + uiCode);
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): bit_depth_chroma (%d). Only 8 bit supported.\n", 8 + uiCode);
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
|
||||||
}
|
}
|
||||||
pSps->uiBitDepthChroma = 8;
|
pSps->uiBitDepthChroma = 8;
|
||||||
@@ -861,7 +863,8 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
|
|||||||
pSps->bSeqScalingMatrixPresentFlag = !!uiCode;
|
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
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): seq_scaling_matrix_present_flag (%d). Feature not supported.\n",
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
|
||||||
|
"ParseSps(): seq_scaling_matrix_present_flag (%d). Feature not supported.\n",
|
||||||
pSps->bSeqScalingMatrixPresentFlag);
|
pSps->bSeqScalingMatrixPresentFlag);
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
|
||||||
}
|
}
|
||||||
@@ -899,7 +902,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pSps->uiPocType > 2) {
|
if (pSps->uiPocType > 2) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, " illegal pic_order_cnt_type: %d ! \n", pSps->uiPocType);
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " illegal pic_order_cnt_type: %d ! \n", pSps->uiPocType);
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_POC_TYPE);
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_POC_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -910,24 +913,24 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
|
|||||||
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_width_in_mbs_minus1
|
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_width_in_mbs_minus1
|
||||||
pSps->iMbWidth = PIC_WIDTH_IN_MBS_OFFSET + uiCode;
|
pSps->iMbWidth = PIC_WIDTH_IN_MBS_OFFSET + uiCode;
|
||||||
if (pSps->iMbWidth > MAX_MB_SIZE) {
|
if (pSps->iMbWidth > MAX_MB_SIZE) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "pic_width_in_mbs(%d) exceeds the maximum allowed!\n", pSps->iMbWidth);
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "pic_width_in_mbs(%d) exceeds the maximum allowed!\n", pSps->iMbWidth);
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE);
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE);
|
||||||
}
|
}
|
||||||
if (((uint64_t)pSps->iMbWidth * (uint64_t)pSps->iMbWidth) > (uint64_t) (8 * pSLevelLimits->iMaxFS)) {
|
if (((uint64_t)pSps->iMbWidth * (uint64_t)pSps->iMbWidth) > (uint64_t) (8 * pSLevelLimits->iMaxFS)) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, " the pic_width_in_mbs exceeds the level limits!\n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " the pic_width_in_mbs exceeds the level limits!\n");
|
||||||
}
|
}
|
||||||
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_height_in_map_units_minus1
|
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_height_in_map_units_minus1
|
||||||
pSps->iMbHeight = PIC_HEIGHT_IN_MAP_UNITS_OFFSET + uiCode;
|
pSps->iMbHeight = PIC_HEIGHT_IN_MAP_UNITS_OFFSET + uiCode;
|
||||||
if (pSps->iMbHeight > MAX_MB_SIZE) {
|
if (pSps->iMbHeight > MAX_MB_SIZE) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "pic_height_in_mbs(%d) exceeds the maximum allowed!\n", pSps->iMbHeight);
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "pic_height_in_mbs(%d) exceeds the maximum allowed!\n", pSps->iMbHeight);
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE);
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE);
|
||||||
}
|
}
|
||||||
if (((uint64_t)pSps->iMbHeight * (uint64_t)pSps->iMbHeight) > (uint64_t) (8 * pSLevelLimits->iMaxFS)) {
|
if (((uint64_t)pSps->iMbHeight * (uint64_t)pSps->iMbHeight) > (uint64_t) (8 * pSLevelLimits->iMaxFS)) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, " the pic_height_in_mbs exceeds the level limits!\n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " the pic_height_in_mbs exceeds the level limits!\n");
|
||||||
}
|
}
|
||||||
uint32_t uiTmp32 = pSps->iMbWidth * pSps->iMbHeight;
|
uint32_t uiTmp32 = pSps->iMbWidth * pSps->iMbHeight;
|
||||||
if (uiTmp32 > (uint32_t)pSLevelLimits->iMaxFS) {
|
if (uiTmp32 > (uint32_t)pSLevelLimits->iMaxFS) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, " the total count of mb exceeds the level limits!\n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " the total count of mb exceeds the level limits!\n");
|
||||||
}
|
}
|
||||||
pSps->uiTotalMbCount = uiTmp32;
|
pSps->uiTotalMbCount = uiTmp32;
|
||||||
WELS_CHECK_SE_UPPER_ERROR (pSps->iNumRefFrames, SPS_MAX_NUM_REF_FRAMES_MAX, "max_num_ref_frames",
|
WELS_CHECK_SE_UPPER_ERROR (pSps->iNumRefFrames, SPS_MAX_NUM_REF_FRAMES_MAX, "max_num_ref_frames",
|
||||||
@@ -938,12 +941,13 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
|
|||||||
if (uiMaxDpbFrames > SPS_MAX_NUM_REF_FRAMES_MAX)
|
if (uiMaxDpbFrames > SPS_MAX_NUM_REF_FRAMES_MAX)
|
||||||
uiMaxDpbFrames = SPS_MAX_NUM_REF_FRAMES_MAX;
|
uiMaxDpbFrames = SPS_MAX_NUM_REF_FRAMES_MAX;
|
||||||
if ((uint32_t)pSps->iNumRefFrames > uiMaxDpbFrames) {
|
if ((uint32_t)pSps->iNumRefFrames > uiMaxDpbFrames) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, " max_num_ref_frames exceeds level limits!\n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " max_num_ref_frames exceeds level limits!\n");
|
||||||
}
|
}
|
||||||
WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //frame_mbs_only_flag
|
WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //frame_mbs_only_flag
|
||||||
pSps->bFrameMbsOnlyFlag = !!uiCode;
|
pSps->bFrameMbsOnlyFlag = !!uiCode;
|
||||||
if (!pSps->bFrameMbsOnlyFlag) {
|
if (!pSps->bFrameMbsOnlyFlag) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): frame_mbs_only_flag (%d) not supported.\n", pSps->bFrameMbsOnlyFlag);
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): frame_mbs_only_flag (%d) not supported.\n",
|
||||||
|
pSps->bFrameMbsOnlyFlag);
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_MBAFF);
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_MBAFF);
|
||||||
}
|
}
|
||||||
WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //direct_8x8_inference_flag
|
WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //direct_8x8_inference_flag
|
||||||
@@ -956,14 +960,14 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
|
|||||||
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_right_offset
|
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_right_offset
|
||||||
pSps->sFrameCrop.iRightOffset = uiCode;
|
pSps->sFrameCrop.iRightOffset = uiCode;
|
||||||
if ((pSps->sFrameCrop.iLeftOffset + pSps->sFrameCrop.iRightOffset) > ((int32_t)pSps->iMbWidth * 16 / 2)) {
|
if ((pSps->sFrameCrop.iLeftOffset + pSps->sFrameCrop.iRightOffset) > ((int32_t)pSps->iMbWidth * 16 / 2)) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "frame_crop_left_offset + frame_crop_right_offset exceeds limits!\n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "frame_crop_left_offset + frame_crop_right_offset exceeds limits!\n");
|
||||||
}
|
}
|
||||||
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_top_offset
|
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_top_offset
|
||||||
pSps->sFrameCrop.iTopOffset = uiCode;
|
pSps->sFrameCrop.iTopOffset = uiCode;
|
||||||
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_bottom_offset
|
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_bottom_offset
|
||||||
pSps->sFrameCrop.iBottomOffset = uiCode;
|
pSps->sFrameCrop.iBottomOffset = uiCode;
|
||||||
if ((pSps->sFrameCrop.iTopOffset + pSps->sFrameCrop.iBottomOffset) > ((int32_t)pSps->iMbHeight * 16 / 2)) {
|
if ((pSps->sFrameCrop.iTopOffset + pSps->sFrameCrop.iBottomOffset) > ((int32_t)pSps->iMbHeight * 16 / 2)) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "frame_crop_top_offset + frame_crop_right_offset exceeds limits!\n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "frame_crop_top_offset + frame_crop_right_offset exceeds limits!\n");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pSps->sFrameCrop.iLeftOffset = 0; // frame_crop_left_offset
|
pSps->sFrameCrop.iLeftOffset = 0; // frame_crop_left_offset
|
||||||
@@ -1100,7 +1104,7 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux)
|
|||||||
WELS_READ_VERIFY (BsGetUe (pBsAux, &uiCode)); //slice_group_map_type
|
WELS_READ_VERIFY (BsGetUe (pBsAux, &uiCode)); //slice_group_map_type
|
||||||
pPps->uiSliceGroupMapType = uiCode;
|
pPps->uiSliceGroupMapType = uiCode;
|
||||||
if (pPps->uiSliceGroupMapType > 1) {
|
if (pPps->uiSliceGroupMapType > 1) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "ParsePps(): slice_group_map_type (%d): support only 0,1.\n",
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParsePps(): slice_group_map_type (%d): support only 0,1.\n",
|
||||||
pPps->uiSliceGroupMapType);
|
pPps->uiSliceGroupMapType);
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_FMOTYPE);
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_FMOTYPE);
|
||||||
}
|
}
|
||||||
@@ -1132,7 +1136,8 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux)
|
|||||||
WELS_READ_VERIFY (BsGetBits (pBsAux, 2, &uiCode)); //weighted_bipred_idc
|
WELS_READ_VERIFY (BsGetBits (pBsAux, 2, &uiCode)); //weighted_bipred_idc
|
||||||
pPps->uiWeightedBipredIdc = uiCode;
|
pPps->uiWeightedBipredIdc = uiCode;
|
||||||
if (pPps->bWeightedPredFlag || pPps->uiWeightedBipredIdc != 0) {
|
if (pPps->bWeightedPredFlag || pPps->uiWeightedBipredIdc != 0) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "ParsePps(): weighted_pred_flag (%d) weighted_bipred_idc (%d) neither supported.\n",
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
|
||||||
|
"ParsePps(): weighted_pred_flag (%d) weighted_bipred_idc (%d) neither supported.\n",
|
||||||
pPps->bWeightedPredFlag, pPps->uiWeightedBipredIdc);
|
pPps->bWeightedPredFlag, pPps->uiWeightedBipredIdc);
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_WP);
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_WP);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,8 @@ int32_t WelsTargetSliceConstruction (PWelsDecoderContext pCtx) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (WelsTargetMbConstruction (pCtx)) {
|
if (WelsTargetMbConstruction (pCtx)) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "WelsTargetSliceConstruction():::MB(%d, %d) construction error. pCurSlice_type:%d\n",
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
|
||||||
|
"WelsTargetSliceConstruction():::MB(%d, %d) construction error. pCurSlice_type:%d\n",
|
||||||
pCurLayer->iMbX, pCurLayer->iMbY, pCurSlice->eSliceType);
|
pCurLayer->iMbX, pCurLayer->iMbY, pCurSlice->eSliceType);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@@ -103,7 +104,8 @@ int32_t WelsTargetSliceConstruction (PWelsDecoderContext pCtx) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pCtx->iTotalNumMbRec > iTotalMbTargetLayer) {
|
if (pCtx->iTotalNumMbRec > iTotalMbTargetLayer) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "WelsTargetSliceConstruction():::pCtx->iTotalNumMbRec:%d, iTotalMbTargetLayer:%d\n",
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
|
||||||
|
"WelsTargetSliceConstruction():::pCtx->iTotalNumMbRec:%d, iTotalMbTargetLayer:%d\n",
|
||||||
pCtx->iTotalNumMbRec, iTotalMbTargetLayer);
|
pCtx->iTotalNumMbRec, iTotalMbTargetLayer);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@@ -285,7 +287,7 @@ int32_t WelsTargetMbConstruction (PWelsDecoderContext pCtx) {
|
|||||||
WelsMbInterConstruction (pCtx, pCurLayer);
|
WelsMbInterConstruction (pCtx, pCurLayer);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "WelsTargetMbConstruction():::::Unknown MB type: %d\n",
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "WelsTargetMbConstruction():::::Unknown MB type: %d\n",
|
||||||
pCurLayer->pMbType[pCurLayer->iMbXyIndex]);
|
pCurLayer->pMbType[pCurLayer->iMbXyIndex]);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -416,7 +418,7 @@ int32_t WelsDecodeSlice (PWelsDecoderContext pCtx, bool bFirstSliceInLayer, PNal
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (iUsedBits > pBs->iBits) { //When BS incomplete, as long as find it, SHOULD stop decoding to avoid mosaic or crash.
|
if (iUsedBits > pBs->iBits) { //When BS incomplete, as long as find it, SHOULD stop decoding to avoid mosaic or crash.
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING,
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
|
||||||
"WelsDecodeSlice()::::pBs incomplete, iUsedBits:%"PRId64" > pBs->iBits:%d, MUST stop decoding.\n",
|
"WelsDecodeSlice()::::pBs incomplete, iUsedBits:%"PRId64" > pBs->iBits:%d, MUST stop decoding.\n",
|
||||||
(int64_t) iUsedBits, pBs->iBits);
|
(int64_t) iUsedBits, pBs->iBits);
|
||||||
return -1;
|
return -1;
|
||||||
@@ -584,7 +586,8 @@ int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx) {
|
|||||||
return ERR_INFO_INVALID_QP;
|
return ERR_INFO_INVALID_QP;
|
||||||
}
|
}
|
||||||
pSlice->iLastMbQp = pCurLayer->pLumaQp[iMbXy];
|
pSlice->iLastMbQp = pCurLayer->pLumaQp[iMbXy];
|
||||||
pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQpTable[WELS_CLIP3 (pSlice->iLastMbQp + pSliceHeader->pPps->iChromaQpIndexOffset, 0,
|
pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQpTable[WELS_CLIP3 (pSlice->iLastMbQp +
|
||||||
|
pSliceHeader->pPps->iChromaQpIndexOffset, 0,
|
||||||
51)];
|
51)];
|
||||||
|
|
||||||
|
|
||||||
@@ -687,7 +690,8 @@ int32_t WelsDecodeMbCavlcISlice (PWelsDecoderContext pCtx, PNalUnit pNalCur) {
|
|||||||
if (!iBaseModeFlag) {
|
if (!iBaseModeFlag) {
|
||||||
iRet = WelsActualDecodeMbCavlcISlice (pCtx);
|
iRet = WelsActualDecodeMbCavlcISlice (pCtx);
|
||||||
} else {
|
} else {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "iBaseModeFlag (%d) != 0, inter-layer prediction not supported.\n", iBaseModeFlag);
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "iBaseModeFlag (%d) != 0, inter-layer prediction not supported.\n",
|
||||||
|
iBaseModeFlag);
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_UNSUPPORTED_ILP);
|
return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_UNSUPPORTED_ILP);
|
||||||
}
|
}
|
||||||
if (iRet) { //occur error when parsing, MUST STOP decoding
|
if (iRet) { //occur error when parsing, MUST STOP decoding
|
||||||
@@ -743,7 +747,7 @@ int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx) {
|
|||||||
if (pCurLayer->pResidualPredFlag[iMbXy] == 0) {
|
if (pCurLayer->pResidualPredFlag[iMbXy] == 0) {
|
||||||
pCurLayer->pInterPredictionDoneFlag[iMbXy] = 0;
|
pCurLayer->pInterPredictionDoneFlag[iMbXy] = 0;
|
||||||
} else {
|
} else {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "residual_pred_flag = 1 not supported.\n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "residual_pred_flag = 1 not supported.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else { //intra MB type
|
} else { //intra MB type
|
||||||
@@ -887,7 +891,8 @@ int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx) {
|
|||||||
return ERR_INFO_INVALID_QP;
|
return ERR_INFO_INVALID_QP;
|
||||||
}
|
}
|
||||||
pSlice->iLastMbQp = pCurLayer->pLumaQp[iMbXy];
|
pSlice->iLastMbQp = pCurLayer->pLumaQp[iMbXy];
|
||||||
pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQpTable[WELS_CLIP3 (pSlice->iLastMbQp + pSliceHeader->pPps->iChromaQpIndexOffset, 0,
|
pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQpTable[WELS_CLIP3 (pSlice->iLastMbQp +
|
||||||
|
pSliceHeader->pPps->iChromaQpIndexOffset, 0,
|
||||||
51)];
|
51)];
|
||||||
|
|
||||||
BsStartCavlc (pBs);
|
BsStartCavlc (pBs);
|
||||||
@@ -1039,7 +1044,8 @@ int32_t WelsDecodeMbCavlcPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur) {
|
|||||||
if (!iBaseModeFlag) {
|
if (!iBaseModeFlag) {
|
||||||
iRet = WelsActualDecodeMbCavlcPSlice (pCtx);
|
iRet = WelsActualDecodeMbCavlcPSlice (pCtx);
|
||||||
} else {
|
} else {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "iBaseModeFlag (%d) != 0, inter-layer prediction not supported.\n", iBaseModeFlag);
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "iBaseModeFlag (%d) != 0, inter-layer prediction not supported.\n",
|
||||||
|
iBaseModeFlag);
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_UNSUPPORTED_ILP);
|
return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_UNSUPPORTED_ILP);
|
||||||
}
|
}
|
||||||
if (iRet) { //occur error when parsing, MUST STOP decoding
|
if (iRet) { //occur error when parsing, MUST STOP decoding
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ int32_t DecoderConfigParam (PWelsDecoderContext pCtx, const SDecodingParam* kpPa
|
|||||||
pCtx->eVideoType = VIDEO_BITSTREAM_DEFAULT;
|
pCtx->eVideoType = VIDEO_BITSTREAM_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_INFO, "eVideoType: %d\n", pCtx->eVideoType);
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO, "eVideoType: %d\n", pCtx->eVideoType);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -605,14 +605,16 @@ int32_t SyncPictureResolutionExt (PWelsDecoderContext pCtx, const int32_t kiMbWi
|
|||||||
|
|
||||||
iErr = WelsRequestMem (pCtx, kiMbWidth, kiMbHeight); // common memory used
|
iErr = WelsRequestMem (pCtx, kiMbWidth, kiMbHeight); // common memory used
|
||||||
if (ERR_NONE != iErr) {
|
if (ERR_NONE != iErr) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "SyncPictureResolutionExt()::WelsRequestMem--buffer allocated failure.\n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
|
||||||
|
"SyncPictureResolutionExt()::WelsRequestMem--buffer allocated failure.\n");
|
||||||
pCtx->iErrorCode = dsOutOfMemory;
|
pCtx->iErrorCode = dsOutOfMemory;
|
||||||
return iErr;
|
return iErr;
|
||||||
}
|
}
|
||||||
|
|
||||||
iErr = InitialDqLayersContext (pCtx, kiPicWidth, kiPicHeight);
|
iErr = InitialDqLayersContext (pCtx, kiPicWidth, kiPicHeight);
|
||||||
if (ERR_NONE != iErr) {
|
if (ERR_NONE != iErr) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "SyncPictureResolutionExt()::InitialDqLayersContext--buffer allocated failure.\n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
|
||||||
|
"SyncPictureResolutionExt()::InitialDqLayersContext--buffer allocated failure.\n");
|
||||||
pCtx->iErrorCode = dsOutOfMemory;
|
pCtx->iErrorCode = dsOutOfMemory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,8 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t
|
|||||||
bFrameCompleteFlag = false; //return later after output buffer is done
|
bFrameCompleteFlag = false; //return later after output buffer is done
|
||||||
if (pCtx->bInstantDecFlag) //no-delay decoding, wait for new slice
|
if (pCtx->bInstantDecFlag) //no-delay decoding, wait for new slice
|
||||||
return -1;
|
return -1;
|
||||||
} else if (pCurDq->sLayerInfo.sNalHeaderExt.bIdrFlag && (pCtx->iErrorCode == dsErrorFree)) { //complete non-ECed IDR frame done
|
} else if (pCurDq->sLayerInfo.sNalHeaderExt.bIdrFlag
|
||||||
|
&& (pCtx->iErrorCode == dsErrorFree)) { //complete non-ECed IDR frame done
|
||||||
pCtx->bDecErrorConedFlag = false;
|
pCtx->bDecErrorConedFlag = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ int32_t WelsInitRefList (PWelsDecoderContext pCtx, int32_t iPoc) {
|
|||||||
pRef->uiTemporalId = pRef->uiQualityId = 0;
|
pRef->uiTemporalId = pRef->uiQualityId = 0;
|
||||||
AddShortTermToList (&pCtx->sRefPic, pRef);
|
AddShortTermToList (&pCtx->sRefPic, pRef);
|
||||||
} else {
|
} else {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "WelsInitRefList()::PrefetchPic for EC errors.\n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "WelsInitRefList()::PrefetchPic for EC errors.\n");
|
||||||
pCtx->iErrorCode |= dsOutOfMemory;
|
pCtx->iErrorCode |= dsOutOfMemory;
|
||||||
return ERR_INFO_REF_COUNT_OVERFLOW;
|
return ERR_INFO_REF_COUNT_OVERFLOW;
|
||||||
}
|
}
|
||||||
@@ -187,7 +187,7 @@ int32_t WelsReorderRefList (PWelsDecoderContext pCtx) {
|
|||||||
if (ppRefList[i]->iFrameNum == iPredFrameNum && !ppRefList[i]->bIsLongRef) {
|
if (ppRefList[i]->iFrameNum == iPredFrameNum && !ppRefList[i]->bIsLongRef) {
|
||||||
if ((pNalHeaderExt->uiQualityId == ppRefList[i]->uiQualityId)
|
if ((pNalHeaderExt->uiQualityId == ppRefList[i]->uiQualityId)
|
||||||
&& (pSliceHeader->iSpsId != ppRefList[i]->iSpsId)) { //check;
|
&& (pSliceHeader->iSpsId != ppRefList[i]->iSpsId)) { //check;
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "WelsReorderRefList()::::BASE LAYER::::iSpsId:%d, ref_sps_id:%d\n",
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "WelsReorderRefList()::::BASE LAYER::::iSpsId:%d, ref_sps_id:%d\n",
|
||||||
pSliceHeader->iSpsId, ppRefList[i]->iSpsId);
|
pSliceHeader->iSpsId, ppRefList[i]->iSpsId);
|
||||||
pCtx->iErrorCode = dsNoParamSets; //cross-IDR reference frame selection, SHOULD request IDR.--
|
pCtx->iErrorCode = dsNoParamSets; //cross-IDR reference frame selection, SHOULD request IDR.--
|
||||||
return ERR_INFO_REFERENCE_PIC_LOST;
|
return ERR_INFO_REFERENCE_PIC_LOST;
|
||||||
@@ -204,7 +204,7 @@ int32_t WelsReorderRefList (PWelsDecoderContext pCtx) {
|
|||||||
pRefPicListReorderSyn->sReorderingSyn[LIST_0][iReorderingIndex].uiLongTermPicNum) {
|
pRefPicListReorderSyn->sReorderingSyn[LIST_0][iReorderingIndex].uiLongTermPicNum) {
|
||||||
if ((pNalHeaderExt->uiQualityId == ppRefList[i]->uiQualityId)
|
if ((pNalHeaderExt->uiQualityId == ppRefList[i]->uiQualityId)
|
||||||
&& (pSliceHeader->iSpsId != ppRefList[i]->iSpsId)) { //check;
|
&& (pSliceHeader->iSpsId != ppRefList[i]->iSpsId)) { //check;
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "WelsReorderRefList()::::BASE LAYER::::iSpsId:%d, ref_sps_id:%d\n",
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "WelsReorderRefList()::::BASE LAYER::::iSpsId:%d, ref_sps_id:%d\n",
|
||||||
pSliceHeader->iSpsId, ppRefList[i]->iSpsId);
|
pSliceHeader->iSpsId, ppRefList[i]->iSpsId);
|
||||||
pCtx->iErrorCode = dsNoParamSets; //cross-IDR reference frame selection, SHOULD request IDR.--
|
pCtx->iErrorCode = dsNoParamSets; //cross-IDR reference frame selection, SHOULD request IDR.--
|
||||||
return ERR_INFO_REFERENCE_PIC_LOST;
|
return ERR_INFO_REFERENCE_PIC_LOST;
|
||||||
@@ -328,13 +328,13 @@ static int32_t MMCOProcess (PWelsDecoderContext pCtx, uint32_t uiMmcoType,
|
|||||||
case MMCO_SHORT2UNUSED:
|
case MMCO_SHORT2UNUSED:
|
||||||
pPic = WelsDelShortFromListSetUnref (pRefPic, iShortFrameNum);
|
pPic = WelsDelShortFromListSetUnref (pRefPic, iShortFrameNum);
|
||||||
if (pPic == NULL) {
|
if (pPic == NULL) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "MMCO_SHORT2UNUSED: delete a empty entry from short term list\n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "MMCO_SHORT2UNUSED: delete a empty entry from short term list\n");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MMCO_LONG2UNUSED:
|
case MMCO_LONG2UNUSED:
|
||||||
pPic = WelsDelLongFromListSetUnref (pRefPic, uiLongTermPicNum);
|
pPic = WelsDelLongFromListSetUnref (pRefPic, uiLongTermPicNum);
|
||||||
if (pPic == NULL) {
|
if (pPic == NULL) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "MMCO_LONG2UNUSED: delete a empty entry from long term list\n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "MMCO_LONG2UNUSED: delete a empty entry from long term list\n");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MMCO_SHORT2LONG:
|
case MMCO_SHORT2LONG:
|
||||||
@@ -343,14 +343,14 @@ static int32_t MMCOProcess (PWelsDecoderContext pCtx, uint32_t uiMmcoType,
|
|||||||
}
|
}
|
||||||
pPic = WelsDelShortFromList (pRefPic, iShortFrameNum);
|
pPic = WelsDelShortFromList (pRefPic, iShortFrameNum);
|
||||||
if (pPic == NULL) {
|
if (pPic == NULL) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "MMCO_LONG2LONG: delete a empty entry from short term list\n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "MMCO_LONG2LONG: delete a empty entry from short term list\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
WelsDelLongFromListSetUnref (pRefPic, iLongTermFrameIdx);
|
WelsDelLongFromListSetUnref (pRefPic, iLongTermFrameIdx);
|
||||||
#ifdef LONG_TERM_REF
|
#ifdef LONG_TERM_REF
|
||||||
pCtx->bCurAuContainLtrMarkSeFlag = true;
|
pCtx->bCurAuContainLtrMarkSeFlag = true;
|
||||||
pCtx->iFrameNumOfAuMarkedLtr = iShortFrameNum;
|
pCtx->iFrameNumOfAuMarkedLtr = iShortFrameNum;
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_INFO, "ex_mark_avc():::MMCO_SHORT2LONG:::LTR marking....iFrameNum: %d\n",
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO, "ex_mark_avc():::MMCO_SHORT2LONG:::LTR marking....iFrameNum: %d\n",
|
||||||
pCtx->iFrameNumOfAuMarkedLtr);
|
pCtx->iFrameNumOfAuMarkedLtr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -379,7 +379,8 @@ static int32_t MMCOProcess (PWelsDecoderContext pCtx, uint32_t uiMmcoType,
|
|||||||
#ifdef LONG_TERM_REF
|
#ifdef LONG_TERM_REF
|
||||||
pCtx->bCurAuContainLtrMarkSeFlag = true;
|
pCtx->bCurAuContainLtrMarkSeFlag = true;
|
||||||
pCtx->iFrameNumOfAuMarkedLtr = pCtx->iFrameNum;
|
pCtx->iFrameNumOfAuMarkedLtr = pCtx->iFrameNum;
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_INFO, "ex_mark_avc():::MMCO_LONG:::LTR marking....iFrameNum: %d\n", pCtx->iFrameNum);
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO, "ex_mark_avc():::MMCO_LONG:::LTR marking....iFrameNum: %d\n",
|
||||||
|
pCtx->iFrameNum);
|
||||||
#endif
|
#endif
|
||||||
iRet = AddLongTermToList (pRefPic, pCtx->pDec, iLongTermFrameIdx);
|
iRet = AddLongTermToList (pRefPic, pCtx->pDec, iLongTermFrameIdx);
|
||||||
break;
|
break;
|
||||||
@@ -564,7 +565,7 @@ static int32_t RemainOneBufferInDpbForEC (PWelsDecoderContext pCtx) {
|
|||||||
}
|
}
|
||||||
if (pRefPic->uiShortRefCount[0] + pRefPic->uiLongRefCount[0] >=
|
if (pRefPic->uiShortRefCount[0] + pRefPic->uiLongRefCount[0] >=
|
||||||
pCtx->pSps->iNumRefFrames) { //fail to remain one empty buffer in DPB
|
pCtx->pSps->iNumRefFrames) { //fail to remain one empty buffer in DPB
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "RemainOneBufferInDpbForEC(): empty one DPB failed for EC!\n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "RemainOneBufferInDpbForEC(): empty one DPB failed for EC!\n");
|
||||||
iRet = ERR_INFO_REF_COUNT_OVERFLOW;
|
iRet = ERR_INFO_REF_COUNT_OVERFLOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1011,7 +1011,7 @@ int32_t ParseInterInfo (PWelsDecoderContext pCtx, int16_t iMvArray[LIST_A][30][M
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "inter parse: iMotionPredFlag = 1 not supported. \n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "inter parse: iMotionPredFlag = 1 not supported. \n");
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_UNSUPPORTED_ILP);
|
return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_UNSUPPORTED_ILP);
|
||||||
}
|
}
|
||||||
PredMv (iMvArray, iRefIdxArray, 0, 4, iRefIdx, iMv);
|
PredMv (iMvArray, iRefIdxArray, 0, 4, iRefIdx, iMv);
|
||||||
@@ -1035,7 +1035,7 @@ int32_t ParseInterInfo (PWelsDecoderContext pCtx, int16_t iMvArray[LIST_A][30][M
|
|||||||
|
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
if (iMotionPredFlag[i]) {
|
if (iMotionPredFlag[i]) {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "inter parse: iMotionPredFlag = 1 not supported. \n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "inter parse: iMotionPredFlag = 1 not supported. \n");
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_UNSUPPORTED_ILP);
|
return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_UNSUPPORTED_ILP);
|
||||||
}
|
}
|
||||||
WELS_READ_VERIFY (BsGetTe0 (pBs, iRefCount[0], &uiCode)); //ref_idx_l0[ mbPartIdx ]
|
WELS_READ_VERIFY (BsGetTe0 (pBs, iRefCount[0], &uiCode)); //ref_idx_l0[ mbPartIdx ]
|
||||||
@@ -1083,7 +1083,7 @@ int32_t ParseInterInfo (PWelsDecoderContext pCtx, int16_t iMvArray[LIST_A][30][M
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "inter parse: iMotionPredFlag = 1 not supported. \n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "inter parse: iMotionPredFlag = 1 not supported. \n");
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_UNSUPPORTED_ILP);
|
return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_UNSUPPORTED_ILP);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1152,7 +1152,7 @@ int32_t ParseInterInfo (PWelsDecoderContext pCtx, int16_t iMvArray[LIST_A][30][M
|
|||||||
pCurDqLayer->pRefIndex[0][iMbXy][uiScan4Idx ] = pCurDqLayer->pRefIndex[0][iMbXy][uiScan4Idx + 1] =
|
pCurDqLayer->pRefIndex[0][iMbXy][uiScan4Idx ] = pCurDqLayer->pRefIndex[0][iMbXy][uiScan4Idx + 1] =
|
||||||
pCurDqLayer->pRefIndex[0][iMbXy][uiScan4Idx + 4] = pCurDqLayer->pRefIndex[0][iMbXy][uiScan4Idx + 5] = iRefIdx[i];
|
pCurDqLayer->pRefIndex[0][iMbXy][uiScan4Idx + 4] = pCurDqLayer->pRefIndex[0][iMbXy][uiScan4Idx + 5] = iRefIdx[i];
|
||||||
} else {
|
} else {
|
||||||
WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "inter parse: iMotionPredFlag = 1 not supported. \n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "inter parse: iMotionPredFlag = 1 not supported. \n");
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_UNSUPPORTED_ILP);
|
return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_UNSUPPORTED_ILP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -243,13 +243,15 @@ void GeneralBilinearAccurateDownsamplerWrap_neon (uint8_t* pDst, const int32_t k
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_NEON_AARCH64
|
#ifdef HAVE_NEON_AARCH64
|
||||||
void GeneralBilinearAccurateDownsamplerWrap_AArch64_neon (uint8_t* pDst, const int32_t kiDstStride, const int32_t kiDstWidth, const int32_t kiDstHeight,
|
void GeneralBilinearAccurateDownsamplerWrap_AArch64_neon (uint8_t* pDst, const int32_t kiDstStride,
|
||||||
|
const int32_t kiDstWidth, const int32_t kiDstHeight,
|
||||||
uint8_t* pSrc, const int32_t kiSrcStride, const int32_t kiSrcWidth, const int32_t kiSrcHeight) {
|
uint8_t* pSrc, const int32_t kiSrcStride, const int32_t kiSrcWidth, const int32_t kiSrcHeight) {
|
||||||
const int32_t kiScaleBit = 15;
|
const int32_t kiScaleBit = 15;
|
||||||
const uint32_t kuiScale = (1 << kiScaleBit);
|
const uint32_t kuiScale = (1 << kiScaleBit);
|
||||||
uint32_t uiScalex = WELS_ROUND ((float)kiSrcWidth / (float)kiDstWidth * kuiScale);
|
uint32_t uiScalex = WELS_ROUND ((float)kiSrcWidth / (float)kiDstWidth * kuiScale);
|
||||||
uint32_t uiScaley = WELS_ROUND ((float)kiSrcHeight / (float)kiDstHeight * kuiScale);
|
uint32_t uiScaley = WELS_ROUND ((float)kiSrcHeight / (float)kiDstHeight * kuiScale);
|
||||||
GeneralBilinearAccurateDownsampler_AArch64_neon (pDst, kiDstStride, kiDstWidth, kiDstHeight, pSrc, kiSrcStride, uiScalex, uiScaley);
|
GeneralBilinearAccurateDownsampler_AArch64_neon (pDst, kiDstStride, kiDstWidth, kiDstHeight, pSrc, kiSrcStride,
|
||||||
|
uiScalex, uiScaley);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
WELSVP_NAMESPACE_END
|
WELSVP_NAMESPACE_END
|
||||||
|
|||||||
@@ -156,10 +156,10 @@ void WelsDequantHadamard2x2DcAnchor (int16_t* pDct, int16_t iMF) {
|
|||||||
const int16_t iDelU = pDct[0] - pDct[2];
|
const int16_t iDelU = pDct[0] - pDct[2];
|
||||||
const int16_t iSumD = pDct[1] + pDct[3];
|
const int16_t iSumD = pDct[1] + pDct[3];
|
||||||
const int16_t iDelD = pDct[1] - pDct[3];
|
const int16_t iDelD = pDct[1] - pDct[3];
|
||||||
pDct[0] = ((iSumU + iSumD) * iMF)>>1;
|
pDct[0] = ((iSumU + iSumD) * iMF) >> 1;
|
||||||
pDct[1] = ((iSumU - iSumD) * iMF)>>1;
|
pDct[1] = ((iSumU - iSumD) * iMF) >> 1;
|
||||||
pDct[2] = ((iDelU + iDelD) * iMF)>>1;
|
pDct[2] = ((iDelU + iDelD) * iMF) >> 1;
|
||||||
pDct[3] = ((iDelU - iDelD) * iMF)>>1;
|
pDct[3] = ((iDelU - iDelD) * iMF) >> 1;
|
||||||
}
|
}
|
||||||
TEST (DecodeMbAuxTest, WelsDequantIHadamard2x2Dc) {
|
TEST (DecodeMbAuxTest, WelsDequantIHadamard2x2Dc) {
|
||||||
int16_t iDct[4], iRefDct[4];
|
int16_t iDct[4], iRefDct[4];
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ using namespace WelsSVCEnc;
|
|||||||
#define MEMORYZEROTEST_NUM 1000
|
#define MEMORYZEROTEST_NUM 1000
|
||||||
|
|
||||||
TEST (SetMemZeroFunTest, WelsSetMemZero) {
|
TEST (SetMemZeroFunTest, WelsSetMemZero) {
|
||||||
int32_t iLen =64;
|
int32_t iLen = 64;
|
||||||
int32_t iCpuCores = 0;
|
int32_t iCpuCores = 0;
|
||||||
SWelsFuncPtrList sFuncPtrList;
|
SWelsFuncPtrList sFuncPtrList;
|
||||||
uint32_t uiCpuFlag = WelsCPUFeatureDetect (&iCpuCores);
|
uint32_t uiCpuFlag = WelsCPUFeatureDetect (&iCpuCores);
|
||||||
@@ -48,45 +48,45 @@ TEST (SetMemZeroFunTest, WelsSetMemZero) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ENFORCE_STACK_ALIGN_2D (uint8_t, pInputAlign, 2, 64*101, 16)
|
ENFORCE_STACK_ALIGN_2D (uint8_t, pInputAlign, 2, 64 * 101, 16)
|
||||||
|
|
||||||
for (int32_t k = 0; k < MEMORYZEROTEST_NUM; k++) {
|
for (int32_t k = 0; k < MEMORYZEROTEST_NUM; k++) {
|
||||||
memset(pInputAlign[0], 255, 64*101);
|
memset (pInputAlign[0], 255, 64 * 101);
|
||||||
memset(pInputAlign[1], 255, 64*101);
|
memset (pInputAlign[1], 255, 64 * 101);
|
||||||
iLen = 64*(1+(rand()%100));
|
iLen = 64 * (1 + (rand() % 100));
|
||||||
WelsSetMemZero_c(pInputAlign[0],iLen);
|
WelsSetMemZero_c (pInputAlign[0], iLen);
|
||||||
sFuncPtrList.pfSetMemZeroSize64Aligned16(pInputAlign[1],iLen);
|
sFuncPtrList.pfSetMemZeroSize64Aligned16 (pInputAlign[1], iLen);
|
||||||
for (int32_t i = 0 ; i < 64*101; i++) {
|
for (int32_t i = 0 ; i < 64 * 101; i++) {
|
||||||
ASSERT_EQ (pInputAlign[0][i], pInputAlign[1][i]);
|
ASSERT_EQ (pInputAlign[0][i], pInputAlign[1][i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32_t k = 0; k < MEMORYZEROTEST_NUM; k++) {
|
for (int32_t k = 0; k < MEMORYZEROTEST_NUM; k++) {
|
||||||
memset(pInputAlign[0], 255, 64*101);
|
memset (pInputAlign[0], 255, 64 * 101);
|
||||||
memset(pInputAlign[1], 255, 64*101);
|
memset (pInputAlign[1], 255, 64 * 101);
|
||||||
iLen = 64*(1+(rand()%100));
|
iLen = 64 * (1 + (rand() % 100));
|
||||||
WelsSetMemZero_c(pInputAlign[0]+1,iLen);
|
WelsSetMemZero_c (pInputAlign[0] + 1, iLen);
|
||||||
sFuncPtrList.pfSetMemZeroSize64(pInputAlign[1]+1,iLen);
|
sFuncPtrList.pfSetMemZeroSize64 (pInputAlign[1] + 1, iLen);
|
||||||
for (int32_t i = 0 ; i < 64*101; i++) {
|
for (int32_t i = 0 ; i < 64 * 101; i++) {
|
||||||
ASSERT_EQ (pInputAlign[0][i], pInputAlign[1][i]);
|
ASSERT_EQ (pInputAlign[0][i], pInputAlign[1][i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(pInputAlign[0], 255, 64*101);
|
memset (pInputAlign[0], 255, 64 * 101);
|
||||||
memset(pInputAlign[1], 255, 64*101);
|
memset (pInputAlign[1], 255, 64 * 101);
|
||||||
iLen = 32;
|
iLen = 32;
|
||||||
WelsSetMemZero_c(pInputAlign[0]+1,iLen);
|
WelsSetMemZero_c (pInputAlign[0] + 1, iLen);
|
||||||
sFuncPtrList.pfSetMemZeroSize8(pInputAlign[1]+1,iLen);
|
sFuncPtrList.pfSetMemZeroSize8 (pInputAlign[1] + 1, iLen);
|
||||||
for (int32_t i = 0 ; i < 64*101; i++) {
|
for (int32_t i = 0 ; i < 64 * 101; i++) {
|
||||||
ASSERT_EQ (pInputAlign[0][i], pInputAlign[1][i]);
|
ASSERT_EQ (pInputAlign[0][i], pInputAlign[1][i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(pInputAlign[0], 255, 64*101);
|
memset (pInputAlign[0], 255, 64 * 101);
|
||||||
memset(pInputAlign[1], 255, 64*101);
|
memset (pInputAlign[1], 255, 64 * 101);
|
||||||
iLen = 24;
|
iLen = 24;
|
||||||
WelsSetMemZero_c(pInputAlign[0]+1,iLen);
|
WelsSetMemZero_c (pInputAlign[0] + 1, iLen);
|
||||||
sFuncPtrList.pfSetMemZeroSize8(pInputAlign[1]+1,iLen);
|
sFuncPtrList.pfSetMemZeroSize8 (pInputAlign[1] + 1, iLen);
|
||||||
for (int32_t i = 0 ; i < 64*101; i++) {
|
for (int32_t i = 0 ; i < 64 * 101; i++) {
|
||||||
ASSERT_EQ (pInputAlign[0][i], pInputAlign[1][i]);
|
ASSERT_EQ (pInputAlign[0][i], pInputAlign[1][i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user