History

Merge remote-tracking branch 'upstream/master'

Sigrid Solveig Haflínudóttir committed 5 years ago

Commit 3eb2a132 parents a313955 c435fb914 files · +2356 −2337Browse files

Showing the changes to codec/decoder (7 of 14 files). Show all

Unified · Split

7 files
  1. codec/decoder/core/inc/decoder_context.h +1 −0
  2. codec/decoder/core/inc/mv_pred.h +4 −0
  3. codec/decoder/core/src/decoder.cpp +2 −0
  4. codec/decoder/core/src/decoder_core.cpp +1 −1
  5. codec/decoder/core/src/parse_mb_syn_cabac.cpp +4 −0
  6. codec/decoder/core/src/parse_mb_syn_cavlc.cpp +4 −0
  7. codec/decoder/plus/src/welsDecoderExt.cpp +4 −6
codec/decoder/core/inc/decoder_context.h+1−0
@@ -512,6 +512,7 @@ typedef struct TagWelsDecoderContext { · 511 unmodified lines
512 int16_t lastReadyHeightOffset[LIST_A][MAX_REF_PIC_COUNT]; //last ready reference MB offset512 int16_t lastReadyHeightOffset[LIST_A][MAX_REF_PIC_COUNT]; //last ready reference MB offset
513 PPictInfo pPictInfoList;513 PPictInfo pPictInfoList;
514 PPictReoderingStatus pPictReoderingStatus;514 PPictReoderingStatus pPictReoderingStatus;
515 SBufferInfo* pDstInfo;
515} SWelsDecoderContext, *PWelsDecoderContext;516} SWelsDecoderContext, *PWelsDecoderContext;
516 517
517typedef struct tagSWelsDecThread {518typedef struct tagSWelsDecThread {
codec/decoder/core/inc/mv_pred.h+4−0
@@ -44,6 +44,10 @@ · 43 unmodified lines
44#include "dec_frame.h"44#include "dec_frame.h"
45#include "decoder_context.h"45#include "decoder_context.h"
46 46
47#define RETURN_ERR_IF_NULL(pRefPic0) \
48if ( pRefPic0 == NULL) \
49 return GENERATE_ERROR_NO(ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_REF_INDEX)
50
47/*!51/*!
48* \brief update mv and ref_index cache for current MB, only for P_16x16 (SKIP inclusive)52* \brief update mv and ref_index cache for current MB, only for P_16x16 (SKIP inclusive)
49* \param53* \param
codec/decoder/core/src/decoder.cpp+2−0
@@ -255,6 +255,7 @@ void DestroyPicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, CMemoryAlign* · 254 unmodified lines
255 PPicBuff pPicBuf;255 PPicBuff pPicBuf;
256 256
257 ResetReorderingPictureBuffers (pCtx->pPictReoderingStatus, pCtx->pPictInfoList, false);257 ResetReorderingPictureBuffers (pCtx->pPictReoderingStatus, pCtx->pPictInfoList, false);
258 if (pCtx->pDstInfo) pCtx->pDstInfo->iBufferStatus = 0;
258 259
259 if (NULL == ppPicBuf || NULL == *ppPicBuf)260 if (NULL == ppPicBuf || NULL == *ppPicBuf)
260 return;261 return;
@@ -297,6 +298,7 @@ void ResetReorderingPictureBuffers (PPictReoderingStatus pPictReoderingStatus, P · 36 unmodified lines
297 pPictInfo[i].bLastGOP = false;298 pPictInfo[i].bLastGOP = false;
298 pPictInfo[i].iPOC = IMinInt32;299 pPictInfo[i].iPOC = IMinInt32;
299 }300 }
301 pPictInfo->sBufferInfo.iBufferStatus = 0;
300 }302 }
301}303}
302 304
codec/decoder/core/src/decoder_core.cpp+1−1
@@ -404,7 +404,7 @@ void CreateImplicitWeightTable (PWelsDecoderContext pCtx) { · 403 unmodified lines
404 //fix Bugzilla 1485229 check if pointers are NULL404 //fix Bugzilla 1485229 check if pointers are NULL
405 if (pCtx->sRefPic.pRefList[LIST_0][0] && pCtx->sRefPic.pRefList[LIST_1][0]) {405 if (pCtx->sRefPic.pRefList[LIST_0][0] && pCtx->sRefPic.pRefList[LIST_1][0]) {
406 if (pSliceHeader->uiRefCount[0] == 1 && pSliceHeader->uiRefCount[1] == 1406 if (pSliceHeader->uiRefCount[0] == 1 && pSliceHeader->uiRefCount[1] == 1
407 && pCtx->sRefPic.pRefList[LIST_0][0]->iFramePoc + pCtx->sRefPic.pRefList[LIST_1][0]->iFramePoc == 2 * iPoc) {407 && int64_t(pCtx->sRefPic.pRefList[LIST_0][0]->iFramePoc) + int64_t(pCtx->sRefPic.pRefList[LIST_1][0]->iFramePoc) == 2 * int64_t(iPoc)) {
408 pCurDqLayer->bUseWeightedBiPredIdc = false;408 pCurDqLayer->bUseWeightedBiPredIdc = false;
409 return;409 return;
410 }410 }
codec/decoder/core/src/parse_mb_syn_cabac.cpp+4−0
@@ -777,6 +777,7 @@ int32_t ParseInterBMotionInfoCabac (PWelsDecoderContext pCtx, PWelsNeighAvail pN · 776 unmodified lines
777 if (pCtx->pParam->eEcActiveIdc != ERROR_CON_DISABLE) {777 if (pCtx->pParam->eEcActiveIdc != ERROR_CON_DISABLE) {
778 iRef[listIdx] = 0;778 iRef[listIdx] = 0;
779 pCtx->iErrorCode |= dsBitstreamError;779 pCtx->iErrorCode |= dsBitstreamError;
780 RETURN_ERR_IF_NULL(pCtx->sRefPic.pRefList[listIdx][iRef[listIdx]]);
780 } else {781 } else {
781 return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_REF_INDEX);782 return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_REF_INDEX);
782 }783 }
@@ -814,6 +815,7 @@ int32_t ParseInterBMotionInfoCabac (PWelsDecoderContext pCtx, PWelsNeighAvail pN · 31 unmodified lines
814 if (pCtx->pParam->eEcActiveIdc != ERROR_CON_DISABLE) {815 if (pCtx->pParam->eEcActiveIdc != ERROR_CON_DISABLE) {
815 ref_idx = 0;816 ref_idx = 0;
816 pCtx->iErrorCode |= dsBitstreamError;817 pCtx->iErrorCode |= dsBitstreamError;
818 RETURN_ERR_IF_NULL(pCtx->sRefPic.pRefList[listIdx][ref_idx]);
817 } else {819 } else {
818 return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_REF_INDEX);820 return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_REF_INDEX);
819 }821 }
@@ -858,6 +860,7 @@ int32_t ParseInterBMotionInfoCabac (PWelsDecoderContext pCtx, PWelsNeighAvail pN · 38 unmodified lines
858 if (pCtx->pParam->eEcActiveIdc != ERROR_CON_DISABLE) {860 if (pCtx->pParam->eEcActiveIdc != ERROR_CON_DISABLE) {
859 ref_idx = 0;861 ref_idx = 0;
860 pCtx->iErrorCode |= dsBitstreamError;862 pCtx->iErrorCode |= dsBitstreamError;
863 RETURN_ERR_IF_NULL(pCtx->sRefPic.pRefList[listIdx][ref_idx]);
861 } else {864 } else {
862 return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_REF_INDEX);865 return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_REF_INDEX);
863 }866 }
@@ -992,6 +995,7 @@ int32_t ParseInterBMotionInfoCabac (PWelsDecoderContext pCtx, PWelsNeighAvail pN · 128 unmodified lines
992 if (pCtx->pParam->eEcActiveIdc != ERROR_CON_DISABLE) {995 if (pCtx->pParam->eEcActiveIdc != ERROR_CON_DISABLE) {
993 iref = 0;996 iref = 0;
994 pCtx->iErrorCode |= dsBitstreamError;997 pCtx->iErrorCode |= dsBitstreamError;
998 RETURN_ERR_IF_NULL(pCtx->sRefPic.pRefList[listIdx][iref]);
995 } else {999 } else {
996 return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_REF_INDEX);1000 return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_REF_INDEX);
997 }1001 }
codec/decoder/core/src/parse_mb_syn_cavlc.cpp+4−0
@@ -1389,6 +1389,7 @@ int32_t ParseInterBInfo (PWelsDecoderContext pCtx, int16_t iMvArray[LIST_A][30][ · 1388 unmodified lines
1389 if (pCtx->pParam->eEcActiveIdc != ERROR_CON_DISABLE) {1389 if (pCtx->pParam->eEcActiveIdc != ERROR_CON_DISABLE) {
1390 ref_idx_list[listIdx][0] = 0;1390 ref_idx_list[listIdx][0] = 0;
1391 pCtx->iErrorCode |= dsBitstreamError;1391 pCtx->iErrorCode |= dsBitstreamError;
1392 RETURN_ERR_IF_NULL(ppRefPic[listIdx][ref_idx_list[listIdx][0]]);
1392 } else {1393 } else {
1393 return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_REF_INDEX);1394 return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_REF_INDEX);
1394 }1395 }
@@ -1438,6 +1439,7 @@ int32_t ParseInterBInfo (PWelsDecoderContext pCtx, int16_t iMvArray[LIST_A][30][ · 43 unmodified lines
1438 if (pCtx->pParam->eEcActiveIdc != ERROR_CON_DISABLE) {1439 if (pCtx->pParam->eEcActiveIdc != ERROR_CON_DISABLE) {
1439 iRefIdx = 0;1440 iRefIdx = 0;
1440 pCtx->iErrorCode |= dsBitstreamError;1441 pCtx->iErrorCode |= dsBitstreamError;
1442 RETURN_ERR_IF_NULL(ppRefPic[listIdx][iRefIdx]);
1441 } else {1443 } else {
1442 return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_REF_INDEX);1444 return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_REF_INDEX);
1443 }1445 }
@@ -1497,6 +1499,7 @@ int32_t ParseInterBInfo (PWelsDecoderContext pCtx, int16_t iMvArray[LIST_A][30][ · 53 unmodified lines
1497 if (pCtx->pParam->eEcActiveIdc != ERROR_CON_DISABLE) {1499 if (pCtx->pParam->eEcActiveIdc != ERROR_CON_DISABLE) {
1498 iRefIdx = 0;1500 iRefIdx = 0;
1499 pCtx->iErrorCode |= dsBitstreamError;1501 pCtx->iErrorCode |= dsBitstreamError;
1502 RETURN_ERR_IF_NULL(ppRefPic[listIdx][iRefIdx]);
1500 } else {1503 } else {
1501 return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_REF_INDEX);1504 return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_REF_INDEX);
1502 }1505 }
@@ -1643,6 +1646,7 @@ int32_t ParseInterBInfo (PWelsDecoderContext pCtx, int16_t iMvArray[LIST_A][30][ · 140 unmodified lines
1643 if (pCtx->pParam->eEcActiveIdc != ERROR_CON_DISABLE) {1646 if (pCtx->pParam->eEcActiveIdc != ERROR_CON_DISABLE) {
1644 iref = 0;1647 iref = 0;
1645 pCtx->iErrorCode |= dsBitstreamError;1648 pCtx->iErrorCode |= dsBitstreamError;
1649 RETURN_ERR_IF_NULL(ppRefPic[listIdx][iref]);
1646 } else {1650 } else {
1647 return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_REF_INDEX);1651 return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_REF_INDEX);
1648 }1652 }
codec/decoder/plus/src/welsDecoderExt.cpp+4−6
@@ -450,6 +450,7 @@ int32_t CWelsDecoder::ResetDecoder (PWelsDecoderContext& pCtx) { · 449 unmodified lines
450 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "ResetDecoder() failed as decoder context null");450 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "ResetDecoder() failed as decoder context null");
451 }451 }
452 ResetReorderingPictureBuffers (&m_sReoderingStatus, m_sPictInfoList, false);452 ResetReorderingPictureBuffers (&m_sReoderingStatus, m_sPictInfoList, false);
453 if (pCtx->pDstInfo) pCtx->pDstInfo->iBufferStatus = 0;
453 }454 }
454 return ERR_INFO_UNINIT;455 return ERR_INFO_UNINIT;
455}456}
@@ -461,6 +462,7 @@ int32_t CWelsDecoder::ThreadResetDecoder (PWelsDecoderContext& pCtx) { · 5 unmodified lines
461 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "ResetDecoder(), context error code is %d", pCtx->iErrorCode);462 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "ResetDecoder(), context error code is %d", pCtx->iErrorCode);
462 memcpy (&sPrevParam, pCtx->pParam, sizeof (SDecodingParam));463 memcpy (&sPrevParam, pCtx->pParam, sizeof (SDecodingParam));
463 ResetReorderingPictureBuffers (&m_sReoderingStatus, m_sPictInfoList, true);464 ResetReorderingPictureBuffers (&m_sReoderingStatus, m_sPictInfoList, true);
465 if (pCtx->pDstInfo) pCtx->pDstInfo->iBufferStatus = 0;
464 CloseDecoderThreads();466 CloseDecoderThreads();
465 UninitDecoder();467 UninitDecoder();
466 InitDecoder (&sPrevParam);468 InitDecoder (&sPrevParam);
@@ -811,11 +813,6 @@ DECODING_STATE CWelsDecoder::DecodeFrame2WithCtx (PWelsDecoderContext pDecContex · 344 unmodified lines
811 }813 }
812 return dsErrorFree;814 return dsErrorFree;
813 }815 }
814 if ((pDecContext->iErrorCode & (dsBitstreamError | dsDataErrorConcealed)) && pDecContext->eSliceType == B_SLICE) {
815 ResetReorderingPictureBuffers (&m_sReoderingStatus, m_sPictInfoList, true);
816 WelsResetRefPic (pDecContext);
817 return dsErrorFree;
818 }
819 //for AVC bitstream (excluding AVC with temporal scalability, including TP), as long as error occur, SHOULD notify upper layer key frame loss.816 //for AVC bitstream (excluding AVC with temporal scalability, including TP), as long as error occur, SHOULD notify upper layer key frame loss.
820 if ((IS_PARAM_SETS_NALS (eNalType) || NAL_UNIT_CODED_SLICE_IDR == eNalType) ||817 if ((IS_PARAM_SETS_NALS (eNalType) || NAL_UNIT_CODED_SLICE_IDR == eNalType) ||
821 (VIDEO_BITSTREAM_AVC == pDecContext->eVideoType)) {818 (VIDEO_BITSTREAM_AVC == pDecContext->eVideoType)) {
@@ -910,6 +907,7 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 88 unmodified lines
910 unsigned char** ppDst,907 unsigned char** ppDst,
911 SBufferInfo* pDstInfo) {908 SBufferInfo* pDstInfo) {
912 PWelsDecoderContext pDecContext = m_pDecThrCtx[0].pCtx;909 PWelsDecoderContext pDecContext = m_pDecThrCtx[0].pCtx;
910 pDecContext->pDstInfo = pDstInfo;
913 return DecodeFrame2WithCtx (pDecContext, kpSrc, kiSrcLen, ppDst, pDstInfo);911 return DecodeFrame2WithCtx (pDecContext, kpSrc, kiSrcLen, ppDst, pDstInfo);
914}912}
915 913
@@ -1224,7 +1222,7 @@ void CWelsDecoder::ReleaseBufferedReadyPicture (PWelsDecoderContext pCtx, unsign · 308 unmodified lines
1224DECODING_STATE CWelsDecoder::ReorderPicturesInDisplay (PWelsDecoderContext pDecContext, unsigned char** ppDst,1222DECODING_STATE CWelsDecoder::ReorderPicturesInDisplay (PWelsDecoderContext pDecContext, unsigned char** ppDst,
1225 SBufferInfo* pDstInfo) {1223 SBufferInfo* pDstInfo) {
1226 DECODING_STATE iRet = dsErrorFree;1224 DECODING_STATE iRet = dsErrorFree;
1227 if (pDstInfo->iBufferStatus == 1) {1225 if ((pDstInfo->iBufferStatus == 1) && (pDecContext->pPps->bEntropyCodingModeFlag)) {
1228 m_bIsBaseline = pDecContext->pSps->uiProfileIdc == 66 || pDecContext->pSps->uiProfileIdc == 83;1226 m_bIsBaseline = pDecContext->pSps->uiProfileIdc == 66 || pDecContext->pSps->uiProfileIdc == 83;
1229 if (!m_bIsBaseline) {1227 if (!m_bIsBaseline) {
1230 BufferingReadyPicture (pDecContext, ppDst, pDstInfo);1228 BufferingReadyPicture (pDecContext, ppDst, pDstInfo);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t