Merge pull request #1116 from huili2/astyle_cpp

astyle all cpp files
This commit is contained in:
ruil2 2014-07-09 11:14:24 +08:00
commit 5861de98f5
14 changed files with 141 additions and 124 deletions

View File

@ -259,9 +259,9 @@ uint32_t WelsCPUFeatureDetect (int32_t* pNumberOfLogicProcessors) {
while (fgets (buf, sizeof (buf), f)) {
if (!strncmp (buf, "Features", strlen ("Features"))) {
// 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;
if (strstr (buf, " vfpv3 ") || strstr(buf, " fp "))
if (strstr (buf, " vfpv3 ") || strstr (buf, " fp "))
flags |= WELS_CPU_VFPv3;
break;
}

View File

@ -667,7 +667,7 @@ int ProcessEncoding (ISVCEncoder* pPtrEnc, int argc, char** argv, bool bConfigFi
int iParsedNum = 1;
memset (&sFbi, 0, sizeof (SFrameBSInfo));
pPtrEnc->GetDefaultParams(&sSvcParam);
pPtrEnc->GetDefaultParams (&sSvcParam);
memset (&fs.sRecFileName[0][0], 0, sizeof (fs.sRecFileName));
FillSpecificParameters (sSvcParam);

View File

@ -111,7 +111,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
bool bExtensionFlag = false;
int32_t iErr = ERR_NONE;
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.
//remove the consecutive ZERO at the end of current NAL in the reverse order.--2011.6.1
@ -145,8 +145,8 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
|| pCtx->bSpsExistAheadFlag)) {
if (pCtx->bPrintFrameErrorTraceFlag) {
WelsLog (pLogCtx, WELS_LOG_WARNING,
"parse_nal(), no exist Sequence Parameter Sets ahead of sequence when try to decode NAL(type:%d).\n",
pNalUnitHeader->eNalUnitType);
"parse_nal(), no exist Sequence Parameter Sets ahead of sequence when try to decode NAL(type:%d).\n",
pNalUnitHeader->eNalUnitType);
}
pCtx->iErrorCode = dsNoParamSets;
return NULL;
@ -155,8 +155,8 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
|| pCtx->bPpsExistAheadFlag)) {
if (pCtx->bPrintFrameErrorTraceFlag) {
WelsLog (pLogCtx, WELS_LOG_WARNING,
"parse_nal(), no exist Picture Parameter Sets ahead of sequence when try to decode NAL(type:%d).\n",
pNalUnitHeader->eNalUnitType);
"parse_nal(), no exist Picture Parameter Sets ahead of sequence when try to decode NAL(type:%d).\n",
pNalUnitHeader->eNalUnitType);
}
pCtx->iErrorCode = dsNoParamSets;
return NULL;
@ -166,8 +166,8 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
|| pCtx->bPpsExistAheadFlag))) {
if (pCtx->bPrintFrameErrorTraceFlag) {
WelsLog (pLogCtx, WELS_LOG_WARNING,
"ParseNalHeader(), no exist Parameter Sets ahead of sequence when try to decode slice(type:%d).\n",
pNalUnitHeader->eNalUnitType);
"ParseNalHeader(), no exist Parameter Sets ahead of sequence when try to decode slice(type:%d).\n",
pNalUnitHeader->eNalUnitType);
}
pCtx->iErrorCode |= dsNoParamSets;
return NULL;
@ -622,7 +622,8 @@ int32_t DecodeSpsSvcExt (PWelsDecoderContext pCtx, PSubsetSps pSpsExt, PBitStrin
WELS_READ_VERIFY (BsGetBits (pBs, 2, &uiCode)); //extended_spatial_scalability_idc
pExt->uiExtendedSpatialScalability = uiCode;
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);
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;
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //seq_parameter_set_id
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);
}
iSpsId = uiCode;
@ -819,7 +820,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
memset (pSubsetSps, 0, sizeof (SSubsetSps));
const SLevelLimits* pSLevelLimits = GetLevelLimits (uiLevelIdc, bConstraintSetFlags[3]);
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);
} else pSps->pSLevelLimits = pSLevelLimits;
// 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
pSps->uiChromaFormatIdc = uiCode;
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);
}
pSps->uiChromaArrayType = pSps->uiChromaFormatIdc;
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //bit_depth_luma_minus8
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);
}
pSps->uiBitDepthLuma = 8;
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //bit_depth_chroma_minus8
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);
}
pSps->uiBitDepthChroma = 8;
@ -861,7 +863,8 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
pSps->bSeqScalingMatrixPresentFlag = !!uiCode;
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);
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) {
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);
}
@ -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
pSps->iMbWidth = PIC_WIDTH_IN_MBS_OFFSET + uiCode;
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);
}
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
pSps->iMbHeight = PIC_HEIGHT_IN_MAP_UNITS_OFFSET + uiCode;
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);
}
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;
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;
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)
uiMaxDpbFrames = SPS_MAX_NUM_REF_FRAMES_MAX;
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
pSps->bFrameMbsOnlyFlag = !!uiCode;
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);
}
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
pSps->sFrameCrop.iRightOffset = uiCode;
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
pSps->sFrameCrop.iTopOffset = uiCode;
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_bottom_offset
pSps->sFrameCrop.iBottomOffset = uiCode;
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 {
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
pPps->uiSliceGroupMapType = uiCode;
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);
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
pPps->uiWeightedBipredIdc = uiCode;
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);
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_WP);
}

View File

@ -90,7 +90,8 @@ int32_t WelsTargetSliceConstruction (PWelsDecoderContext 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);
return -1;
@ -103,7 +104,8 @@ int32_t WelsTargetSliceConstruction (PWelsDecoderContext pCtx) {
}
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);
return -1;
@ -285,7 +287,7 @@ int32_t WelsTargetMbConstruction (PWelsDecoderContext pCtx) {
WelsMbInterConstruction (pCtx, pCurLayer);
}
} 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]);
return -1;
}
@ -416,7 +418,7 @@ int32_t WelsDecodeSlice (PWelsDecoderContext pCtx, bool bFirstSliceInLayer, PNal
break;
}
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",
(int64_t) iUsedBits, pBs->iBits);
return -1;
@ -584,7 +586,8 @@ int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx) {
return ERR_INFO_INVALID_QP;
}
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)];
@ -687,7 +690,8 @@ int32_t WelsDecodeMbCavlcISlice (PWelsDecoderContext pCtx, PNalUnit pNalCur) {
if (!iBaseModeFlag) {
iRet = WelsActualDecodeMbCavlcISlice (pCtx);
} 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);
}
if (iRet) { //occur error when parsing, MUST STOP decoding
@ -743,7 +747,7 @@ int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx) {
if (pCurLayer->pResidualPredFlag[iMbXy] == 0) {
pCurLayer->pInterPredictionDoneFlag[iMbXy] = 0;
} 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;
}
} else { //intra MB type
@ -887,7 +891,8 @@ int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx) {
return ERR_INFO_INVALID_QP;
}
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)];
BsStartCavlc (pBs);
@ -1039,7 +1044,8 @@ int32_t WelsDecodeMbCavlcPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur) {
if (!iBaseModeFlag) {
iRet = WelsActualDecodeMbCavlcPSlice (pCtx);
} 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);
}
if (iRet) { //occur error when parsing, MUST STOP decoding

View File

@ -341,7 +341,7 @@ int32_t DecoderConfigParam (PWelsDecoderContext pCtx, const SDecodingParam* kpPa
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;
}
@ -605,14 +605,16 @@ int32_t SyncPictureResolutionExt (PWelsDecoderContext pCtx, const int32_t kiMbWi
iErr = WelsRequestMem (pCtx, kiMbWidth, kiMbHeight); // common memory used
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;
return iErr;
}
iErr = InitialDqLayersContext (pCtx, kiPicWidth, kiPicHeight);
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;
}

View File

@ -66,9 +66,9 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t
if (pCtx->iTotalNumMbRec == kiTotalNumMbInCurLayer) {
pCtx->bPrintFrameErrorTraceFlag = true;
WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO,
"DecodeFrameConstruction()::::output first frame of new sequence, %d x %d, crop_left:%d, crop_right:%d, crop_top:%d, crop_bottom:%d, ignored error packet:%d.\n",
kiWidth, kiHeight, pCtx->sFrameCrop.iLeftOffset, pCtx->sFrameCrop.iRightOffset, pCtx->sFrameCrop.iTopOffset,
pCtx->sFrameCrop.iBottomOffset, pCtx->iIgnoredErrorInfoPacketCount);
"DecodeFrameConstruction()::::output first frame of new sequence, %d x %d, crop_left:%d, crop_right:%d, crop_top:%d, crop_bottom:%d, ignored error packet:%d.\n",
kiWidth, kiHeight, pCtx->sFrameCrop.iLeftOffset, pCtx->sFrameCrop.iRightOffset, pCtx->sFrameCrop.iTopOffset,
pCtx->sFrameCrop.iBottomOffset, pCtx->iIgnoredErrorInfoPacketCount);
pCtx->iIgnoredErrorInfoPacketCount = 0;
}
}
@ -80,8 +80,9 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t
bFrameCompleteFlag = false; //return later after output buffer is done
if (pCtx->bInstantDecFlag) //no-delay decoding, wait for new slice
return -1;
} else if (pCurDq->sLayerInfo.sNalHeaderExt.bIdrFlag && (pCtx->iErrorCode == dsErrorFree)) { //complete non-ECed IDR frame done
pCtx->bDecErrorConedFlag = false;
} else if (pCurDq->sLayerInfo.sNalHeaderExt.bIdrFlag
&& (pCtx->iErrorCode == dsErrorFree)) { //complete non-ECed IDR frame done
pCtx->bDecErrorConedFlag = false;
}
pCtx->iTotalNumMbRec = 0;

View File

@ -123,7 +123,7 @@ int32_t WelsInitRefList (PWelsDecoderContext pCtx, int32_t iPoc) {
pRef->uiTemporalId = pRef->uiQualityId = 0;
AddShortTermToList (&pCtx->sRefPic, pRef);
} 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;
return ERR_INFO_REF_COUNT_OVERFLOW;
}
@ -187,7 +187,7 @@ int32_t WelsReorderRefList (PWelsDecoderContext pCtx) {
if (ppRefList[i]->iFrameNum == iPredFrameNum && !ppRefList[i]->bIsLongRef) {
if ((pNalHeaderExt->uiQualityId == ppRefList[i]->uiQualityId)
&& (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);
pCtx->iErrorCode = dsNoParamSets; //cross-IDR reference frame selection, SHOULD request IDR.--
return ERR_INFO_REFERENCE_PIC_LOST;
@ -204,7 +204,7 @@ int32_t WelsReorderRefList (PWelsDecoderContext pCtx) {
pRefPicListReorderSyn->sReorderingSyn[LIST_0][iReorderingIndex].uiLongTermPicNum) {
if ((pNalHeaderExt->uiQualityId == ppRefList[i]->uiQualityId)
&& (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);
pCtx->iErrorCode = dsNoParamSets; //cross-IDR reference frame selection, SHOULD request IDR.--
return ERR_INFO_REFERENCE_PIC_LOST;
@ -328,13 +328,13 @@ static int32_t MMCOProcess (PWelsDecoderContext pCtx, uint32_t uiMmcoType,
case MMCO_SHORT2UNUSED:
pPic = WelsDelShortFromListSetUnref (pRefPic, iShortFrameNum);
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;
case MMCO_LONG2UNUSED:
pPic = WelsDelLongFromListSetUnref (pRefPic, uiLongTermPicNum);
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;
case MMCO_SHORT2LONG:
@ -343,14 +343,14 @@ static int32_t MMCOProcess (PWelsDecoderContext pCtx, uint32_t uiMmcoType,
}
pPic = WelsDelShortFromList (pRefPic, iShortFrameNum);
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;
}
WelsDelLongFromListSetUnref (pRefPic, iLongTermFrameIdx);
#ifdef LONG_TERM_REF
pCtx->bCurAuContainLtrMarkSeFlag = true;
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);
#endif
@ -379,7 +379,8 @@ static int32_t MMCOProcess (PWelsDecoderContext pCtx, uint32_t uiMmcoType,
#ifdef LONG_TERM_REF
pCtx->bCurAuContainLtrMarkSeFlag = true;
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
iRet = AddLongTermToList (pRefPic, pCtx->pDec, iLongTermFrameIdx);
break;
@ -564,7 +565,7 @@ static int32_t RemainOneBufferInDpbForEC (PWelsDecoderContext pCtx) {
}
if (pRefPic->uiShortRefCount[0] + pRefPic->uiLongRefCount[0] >=
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;
}

View File

@ -1011,7 +1011,7 @@ int32_t ParseInterInfo (PWelsDecoderContext pCtx, int16_t iMvArray[LIST_A][30][M
}
}
} 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);
}
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++) {
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);
}
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 {
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);
}
@ -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 + 4] = pCurDqLayer->pRefIndex[0][iMbXy][uiScan4Idx + 5] = iRefIdx[i];
} 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);
}
}

View File

@ -411,7 +411,7 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc,
if (m_pDecContext->bPrintFrameErrorTraceFlag) {
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "decode failed, failure type:%d \n",
m_pDecContext->iErrorCode);
m_pDecContext->iErrorCode);
m_pDecContext->bPrintFrameErrorTraceFlag = false;
} else {
m_pDecContext->iIgnoredErrorInfoPacketCount ++;

View File

@ -213,28 +213,28 @@ static inline void McHorVer22WidthEq16_c (const uint8_t* pSrc, int32_t iSrcStrid
/////////////////////luma MC//////////////////////////
static inline void McHorVer01WidthEq16_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 256, 16)
McHorVer02WidthEq16_c (pSrc, iSrcStride, pTmp, 16, iHeight);
PixelAvgWidthEq16_c (pDst, iDstStride, pSrc, iSrcStride, pTmp, 16, iHeight);
}
static inline void McHorVer03WidthEq16_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 256, 16)
McHorVer02WidthEq16_c (pSrc, iSrcStride, pTmp, 16, iHeight);
PixelAvgWidthEq16_c (pDst, iDstStride, pSrc + iSrcStride, iSrcStride, pTmp, 16, iHeight);
}
static inline void McHorVer10WidthEq16_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 256, 16)
McHorVer20WidthEq16_c (pSrc, iSrcStride, pTmp, 16, iHeight);
PixelAvgWidthEq16_c (pDst, iDstStride, pSrc, iSrcStride, pTmp, 16, iHeight);
}
static inline void McHorVer11WidthEq16_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16)
McHorVer20WidthEq16_c (pSrc, iSrcStride, pTmp, 16, iHeight);
@ -242,7 +242,7 @@ static inline void McHorVer11WidthEq16_c (const uint8_t* pSrc, int32_t iSrcStrid
PixelAvgWidthEq16_c (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight);
}
static inline void McHorVer12WidthEq16_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16)
McHorVer02WidthEq16_c (pSrc, iSrcStride, pTmp, 16, iHeight);
@ -250,7 +250,7 @@ static inline void McHorVer12WidthEq16_c (const uint8_t* pSrc, int32_t iSrcStrid
PixelAvgWidthEq16_c (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight);
}
static inline void McHorVer13WidthEq16_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16)
McHorVer20WidthEq16_c (pSrc + iSrcStride, iSrcStride, pTmp, 16, iHeight);
@ -258,7 +258,7 @@ static inline void McHorVer13WidthEq16_c (const uint8_t* pSrc, int32_t iSrcStrid
PixelAvgWidthEq16_c (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight);
}
static inline void McHorVer21WidthEq16_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16)
McHorVer20WidthEq16_c (pSrc, iSrcStride, pTmp, 16, iHeight);
@ -266,7 +266,7 @@ static inline void McHorVer21WidthEq16_c (const uint8_t* pSrc, int32_t iSrcStrid
PixelAvgWidthEq16_c (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight);
}
static inline void McHorVer23WidthEq16_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16)
McHorVer20WidthEq16_c (pSrc + iSrcStride, iSrcStride, pTmp, 16, iHeight);
@ -274,14 +274,14 @@ static inline void McHorVer23WidthEq16_c (const uint8_t* pSrc, int32_t iSrcStrid
PixelAvgWidthEq16_c (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight);
}
static inline void McHorVer30WidthEq16_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 256, 16)
McHorVer20WidthEq16_c (pSrc, iSrcStride, pTmp, 16, iHeight);
PixelAvgWidthEq16_c (pDst, iDstStride, pSrc + 1, iSrcStride, pTmp, 16, iHeight);
}
static inline void McHorVer31WidthEq16_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16)
McHorVer20WidthEq16_c (pSrc, iSrcStride, pTmp, 16, iHeight);
@ -289,7 +289,7 @@ static inline void McHorVer31WidthEq16_c (const uint8_t* pSrc, int32_t iSrcStrid
PixelAvgWidthEq16_c (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight);
}
static inline void McHorVer32WidthEq16_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16)
McHorVer02WidthEq16_c (pSrc + 1, iSrcStride, pTmp, 16, iHeight);
@ -297,7 +297,7 @@ static inline void McHorVer32WidthEq16_c (const uint8_t* pSrc, int32_t iSrcStrid
PixelAvgWidthEq16_c (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight);
}
static inline void McHorVer33WidthEq16_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16)
McHorVer20WidthEq16_c (pSrc + iSrcStride, iSrcStride, pTmp, 16, iHeight);
@ -430,28 +430,28 @@ void McHorVer22Width9Or17Height9Or17_sse2 (const uint8_t* pSrc, int32_t iSrcStri
}
static inline void McHorVer01WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 256, 16)
McHorVer02WidthEq16_sse2 (pSrc, iSrcStride, pTmp, 16, iHeight);
PixelAvgWidthEq16_sse2 (pDst, iDstStride, pSrc, iSrcStride, pTmp, 16, iHeight);
}
static inline void McHorVer03WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 256, 16)
McHorVer02WidthEq16_sse2 (pSrc, iSrcStride, pTmp, 16, iHeight);
PixelAvgWidthEq16_sse2 (pDst, iDstStride, pSrc + iSrcStride, iSrcStride, pTmp, 16, iHeight);
}
static inline void McHorVer10WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 256, 16)
McHorVer20WidthEq16_sse2 (pSrc, iSrcStride, pTmp, 16, iHeight);
PixelAvgWidthEq16_sse2 (pDst, iDstStride, pSrc, iSrcStride, pTmp, 16, iHeight);
}
static inline void McHorVer11WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16)
McHorVer20WidthEq16_sse2 (pSrc, iSrcStride, pTmp, 16, iHeight);
@ -459,7 +459,7 @@ static inline void McHorVer11WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcSt
PixelAvgWidthEq16_sse2 (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight);
}
static inline void McHorVer12WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16)
McHorVer02WidthEq16_sse2 (pSrc, iSrcStride, pTmp, 16, iHeight);
@ -467,7 +467,7 @@ static inline void McHorVer12WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcSt
PixelAvgWidthEq16_sse2 (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight);
}
static inline void McHorVer13WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16)
McHorVer20WidthEq16_sse2 (pSrc + iSrcStride, iSrcStride, pTmp, 16, iHeight);
@ -475,7 +475,7 @@ static inline void McHorVer13WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcSt
PixelAvgWidthEq16_sse2 (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight);
}
static inline void McHorVer21WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16)
McHorVer20WidthEq16_sse2 (pSrc, iSrcStride, pTmp, 16, iHeight);
@ -483,7 +483,7 @@ static inline void McHorVer21WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcSt
PixelAvgWidthEq16_sse2 (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight);
}
static inline void McHorVer23WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16)
McHorVer20WidthEq16_sse2 (pSrc + iSrcStride, iSrcStride, pTmp, 16, iHeight);
@ -491,14 +491,14 @@ static inline void McHorVer23WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcSt
PixelAvgWidthEq16_sse2 (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight);
}
static inline void McHorVer30WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 256, 16)
McHorVer20WidthEq16_sse2 (pSrc, iSrcStride, pTmp, 16, iHeight);
PixelAvgWidthEq16_sse2 (pDst, iDstStride, pSrc + 1, iSrcStride, pTmp, 16, iHeight);
}
static inline void McHorVer31WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16)
McHorVer20WidthEq16_sse2 (pSrc, iSrcStride, pTmp, 16, iHeight);
@ -506,7 +506,7 @@ static inline void McHorVer31WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcSt
PixelAvgWidthEq16_sse2 (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight);
}
static inline void McHorVer32WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16)
McHorVer02WidthEq16_sse2 (pSrc + 1, iSrcStride, pTmp, 16, iHeight);
@ -514,7 +514,7 @@ static inline void McHorVer32WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcSt
PixelAvgWidthEq16_sse2 (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight);
}
static inline void McHorVer33WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight) {
int32_t iHeight) {
ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16)
McHorVer20WidthEq16_sse2 (pSrc + iSrcStride, iSrcStride, pTmp, 16, iHeight);

View File

@ -216,7 +216,7 @@ bool CheckChromaCost (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SMbCache* pMbCache
//01/17/2013. USE the NEW BGD Pskip with COLOR CHECK for screen content and camera because of color artifact seen in test
bool WelsMdInterJudgeBGDPskip (void* pCtx, void* pMd, SSlice* pSlice, SMB* pCurMb, SMbCache* pMbCache,
bool* bKeepSkip) {
bool* bKeepSkip) {
sWelsEncCtx* pEncCtx = (sWelsEncCtx*)pCtx;
SWelsMD* pWelsMd = (SWelsMD*)pMd;

View File

@ -243,13 +243,15 @@ void GeneralBilinearAccurateDownsamplerWrap_neon (uint8_t* pDst, const int32_t k
#endif
#ifdef HAVE_NEON_AARCH64
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) {
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) {
const int32_t kiScaleBit = 15;
const uint32_t kuiScale = (1 << kiScaleBit);
uint32_t uiScalex = WELS_ROUND ((float)kiSrcWidth / (float)kiDstWidth * 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
WELSVP_NAMESPACE_END

View File

@ -156,10 +156,10 @@ void WelsDequantHadamard2x2DcAnchor (int16_t* pDct, int16_t iMF) {
const int16_t iDelU = pDct[0] - pDct[2];
const int16_t iSumD = pDct[1] + pDct[3];
const int16_t iDelD = pDct[1] - pDct[3];
pDct[0] = ((iSumU + iSumD) * iMF)>>1;
pDct[1] = ((iSumU - iSumD) * iMF)>>1;
pDct[2] = ((iDelU + iDelD) * iMF)>>1;
pDct[3] = ((iDelU - iDelD) * iMF)>>1;
pDct[0] = ((iSumU + iSumD) * iMF) >> 1;
pDct[1] = ((iSumU - iSumD) * iMF) >> 1;
pDct[2] = ((iDelU + iDelD) * iMF) >> 1;
pDct[3] = ((iDelU - iDelD) * iMF) >> 1;
}
TEST (DecodeMbAuxTest, WelsDequantIHadamard2x2Dc) {
int16_t iDct[4], iRefDct[4];

View File

@ -13,7 +13,7 @@ using namespace WelsSVCEnc;
#define MEMORYZEROTEST_NUM 1000
TEST (SetMemZeroFunTest, WelsSetMemZero) {
int32_t iLen =64;
int32_t iLen = 64;
int32_t iCpuCores = 0;
SWelsFuncPtrList sFuncPtrList;
uint32_t uiCpuFlag = WelsCPUFeatureDetect (&iCpuCores);
@ -31,7 +31,7 @@ TEST (SetMemZeroFunTest, WelsSetMemZero) {
sFuncPtrList.pfSetMemZeroSize64Aligned16 = WelsSetMemZeroAligned64_sse2; // confirmed_safe_unsafe_usage
}
#endif//X86_ASM
#if defined(HAVE_NEON)
if (uiCpuFlag & WELS_CPU_NEON) {
sFuncPtrList.pfSetMemZeroSize8 = WelsSetMemZero_neon;
@ -39,7 +39,7 @@ TEST (SetMemZeroFunTest, WelsSetMemZero) {
sFuncPtrList.pfSetMemZeroSize64 = WelsSetMemZero_neon;
}
#endif
#if defined(HAVE_NEON_AARCH64)
if (uiCpuFlag & WELS_CPU_NEON) {
sFuncPtrList.pfSetMemZeroSize8 = WelsSetMemZero_AArch64_neon;
@ -47,46 +47,46 @@ TEST (SetMemZeroFunTest, WelsSetMemZero) {
sFuncPtrList.pfSetMemZeroSize64 = WelsSetMemZero_AArch64_neon;
}
#endif
ENFORCE_STACK_ALIGN_2D (uint8_t, pInputAlign, 2, 64*101, 16)
for (int32_t k = 0; k < MEMORYZEROTEST_NUM; k++) {
memset(pInputAlign[0], 255, 64*101);
memset(pInputAlign[1], 255, 64*101);
iLen = 64*(1+(rand()%100));
WelsSetMemZero_c(pInputAlign[0],iLen);
sFuncPtrList.pfSetMemZeroSize64Aligned16(pInputAlign[1],iLen);
for (int32_t i = 0 ; i < 64*101; i++) {
ASSERT_EQ (pInputAlign[0][i], pInputAlign[1][i]);
}
}
ENFORCE_STACK_ALIGN_2D (uint8_t, pInputAlign, 2, 64 * 101, 16)
for (int32_t k = 0; k < MEMORYZEROTEST_NUM; k++) {
memset(pInputAlign[0], 255, 64*101);
memset(pInputAlign[1], 255, 64*101);
iLen = 64*(1+(rand()%100));
WelsSetMemZero_c(pInputAlign[0]+1,iLen);
sFuncPtrList.pfSetMemZeroSize64(pInputAlign[1]+1,iLen);
for (int32_t i = 0 ; i < 64*101; i++) {
memset (pInputAlign[0], 255, 64 * 101);
memset (pInputAlign[1], 255, 64 * 101);
iLen = 64 * (1 + (rand() % 100));
WelsSetMemZero_c (pInputAlign[0], iLen);
sFuncPtrList.pfSetMemZeroSize64Aligned16 (pInputAlign[1], iLen);
for (int32_t i = 0 ; i < 64 * 101; i++) {
ASSERT_EQ (pInputAlign[0][i], pInputAlign[1][i]);
}
}
memset(pInputAlign[0], 255, 64*101);
memset(pInputAlign[1], 255, 64*101);
for (int32_t k = 0; k < MEMORYZEROTEST_NUM; k++) {
memset (pInputAlign[0], 255, 64 * 101);
memset (pInputAlign[1], 255, 64 * 101);
iLen = 64 * (1 + (rand() % 100));
WelsSetMemZero_c (pInputAlign[0] + 1, iLen);
sFuncPtrList.pfSetMemZeroSize64 (pInputAlign[1] + 1, iLen);
for (int32_t i = 0 ; i < 64 * 101; i++) {
ASSERT_EQ (pInputAlign[0][i], pInputAlign[1][i]);
}
}
memset (pInputAlign[0], 255, 64 * 101);
memset (pInputAlign[1], 255, 64 * 101);
iLen = 32;
WelsSetMemZero_c(pInputAlign[0]+1,iLen);
sFuncPtrList.pfSetMemZeroSize8(pInputAlign[1]+1,iLen);
for (int32_t i = 0 ; i < 64*101; i++) {
WelsSetMemZero_c (pInputAlign[0] + 1, iLen);
sFuncPtrList.pfSetMemZeroSize8 (pInputAlign[1] + 1, iLen);
for (int32_t i = 0 ; i < 64 * 101; i++) {
ASSERT_EQ (pInputAlign[0][i], pInputAlign[1][i]);
}
memset(pInputAlign[0], 255, 64*101);
memset(pInputAlign[1], 255, 64*101);
memset (pInputAlign[0], 255, 64 * 101);
memset (pInputAlign[1], 255, 64 * 101);
iLen = 24;
WelsSetMemZero_c(pInputAlign[0]+1,iLen);
sFuncPtrList.pfSetMemZeroSize8(pInputAlign[1]+1,iLen);
for (int32_t i = 0 ; i < 64*101; i++) {
WelsSetMemZero_c (pInputAlign[0] + 1, iLen);
sFuncPtrList.pfSetMemZeroSize8 (pInputAlign[1] + 1, iLen);
for (int32_t i = 0 ; i < 64 * 101; i++) {
ASSERT_EQ (pInputAlign[0][i], pInputAlign[1][i]);
}
}