Showing the changes to test/api/encode_decode_api_test.cpp (1 of 57 files). Show all
Unified · Split
| @@ -819,7 +819,7 @@ void ExtractDidNal (SFrameBSInfo* pBsInfo, int& iSrcLen, std::vector<SLostSim>* · 818 unmodified lines | |||
| 819 | } else { | 819 | } else { |
| 820 | iPrefix = 0; | 820 | iPrefix = 0; |
| 821 | } | 821 | } |
| 822 | tmpSLostSim.eNalType = (EWelsNalUnitType) ((* (pSrcPtr + iPrefix)) & 0x1f); // eNalUnitType | 822 | tmpSLostSim.eNalType = (EWelsNalUnitType) ((* (pSrcPtr + iPrefix)) & 0x1f); // eNalUnitType |
| 823 | bLost = (ToRemainDidNal ((pSrcPtr + iPrefix + 2), tmpSLostSim.eNalType, iTarDid)) ? false : true; | 823 | bLost = (ToRemainDidNal ((pSrcPtr + iPrefix + 2), tmpSLostSim.eNalType, iTarDid)) ? false : true; |
| 824 | tmpSLostSim.isLost = bLost; | 824 | tmpSLostSim.isLost = bLost; |
| 825 | p_SLostSim->push_back (tmpSLostSim); | 825 | p_SLostSim->push_back (tmpSLostSim); |
| @@ -852,7 +852,7 @@ int SimulateNALLoss (const unsigned char* pSrc, int& iSrcLen, std::vector<SLost · 26 unmodified lines | |||
| 852 | for (i = 0; i < iSrcLen;) { | 852 | for (i = 0; i < iSrcLen;) { |
| 853 | if (pSrc[i] == 0 && pSrc[i + 1] == 0 && pSrc[i + 2] == 0 && pSrc[i + 3] == 1) { | 853 | if (pSrc[i] == 0 && pSrc[i + 1] == 0 && pSrc[i + 2] == 0 && pSrc[i + 3] == 1) { |
| 854 | if (i - iBufPos) { | 854 | if (i - iBufPos) { |
| 855 | tmpSLostSim.eNalType = (EWelsNalUnitType) ((* (pSrc + iBufPos + ilastprefixlen)) & 0x1f); // eNalUnitType | 855 | tmpSLostSim.eNalType = (EWelsNalUnitType) ((* (pSrc + iBufPos + ilastprefixlen)) & 0x1f); // eNalUnitType |
| 856 | bLost = iLossIdx < iLossCharLen ? (pLossChars[iLossIdx] == '1') : (rand() % 2 == 1); | 856 | bLost = iLossIdx < iLossCharLen ? (pLossChars[iLossIdx] == '1') : (rand() % 2 == 1); |
| 857 | bLost = (!bLossPara) && (IS_PARAM_SETS_NALS (tmpSLostSim.eNalType)) ? false : bLost; | 857 | bLost = (!bLossPara) && (IS_PARAM_SETS_NALS (tmpSLostSim.eNalType)) ? false : bLost; |
| 858 | iLossIdx++; | 858 | iLossIdx++; |
| @@ -871,7 +871,7 @@ int SimulateNALLoss (const unsigned char* pSrc, int& iSrcLen, std::vector<SLost · 12 unmodified lines | |||
| 871 | i = i + 4; | 871 | i = i + 4; |
| 872 | } else if (pSrc[i] == 0 && pSrc[i + 1] == 0 && pSrc[i + 2] == 1) { | 872 | } else if (pSrc[i] == 0 && pSrc[i + 1] == 0 && pSrc[i + 2] == 1) { |
| 873 | if (i - iBufPos) { | 873 | if (i - iBufPos) { |
| 874 | tmpSLostSim.eNalType = (EWelsNalUnitType) ((* (pSrc + iBufPos + ilastprefixlen)) & 0x1f); // eNalUnitType | 874 | tmpSLostSim.eNalType = (EWelsNalUnitType) ((* (pSrc + iBufPos + ilastprefixlen)) & 0x1f); // eNalUnitType |
| 875 | bLost = iLossIdx < iLossCharLen ? (pLossChars[iLossIdx] == '1') : (rand() % 2 == 1); | 875 | bLost = iLossIdx < iLossCharLen ? (pLossChars[iLossIdx] == '1') : (rand() % 2 == 1); |
| 876 | bLost = (!bLossPara) && (IS_PARAM_SETS_NALS (tmpSLostSim.eNalType)) ? false : bLost; | 876 | bLost = (!bLossPara) && (IS_PARAM_SETS_NALS (tmpSLostSim.eNalType)) ? false : bLost; |
| 877 | iLossIdx++; | 877 | iLossIdx++; |
| @@ -893,7 +893,7 @@ int SimulateNALLoss (const unsigned char* pSrc, int& iSrcLen, std::vector<SLost · 15 unmodified lines | |||
| 893 | } | 893 | } |
| 894 | } | 894 | } |
| 895 | if (i - iBufPos) { | 895 | if (i - iBufPos) { |
| 896 | tmpSLostSim.eNalType = (EWelsNalUnitType) ((* (pSrc + iBufPos + ilastprefixlen)) & 0x1f); // eNalUnitType | 896 | tmpSLostSim.eNalType = (EWelsNalUnitType) ((* (pSrc + iBufPos + ilastprefixlen)) & 0x1f); // eNalUnitType |
| 897 | bLost = iLossIdx < iLossCharLen ? (pLossChars[iLossIdx] == '1') : (rand() % 2 == 1); | 897 | bLost = iLossIdx < iLossCharLen ? (pLossChars[iLossIdx] == '1') : (rand() % 2 == 1); |
| 898 | bLost = (!bLossPara) && (IS_PARAM_SETS_NALS (tmpSLostSim.eNalType)) ? false : bLost; | 898 | bLost = (!bLossPara) && (IS_PARAM_SETS_NALS (tmpSLostSim.eNalType)) ? false : bLost; |
| 899 | iLossIdx++; | 899 | iLossIdx++; |