Remove tabs where a simple space is just enough
This commit is contained in:
@@ -124,7 +124,7 @@ int32_t WelsEncodeNal (SWelsNalRaw* pRawNal, void* pNalHeaderExt, const int32_t
|
||||
int32_t* pDstLen) {
|
||||
const bool kbNALExt = pRawNal->sNalExt.sNalUnitHeader.eNalUnitType == NAL_UNIT_PREFIX
|
||||
|| pRawNal->sNalExt.sNalUnitHeader.eNalUnitType == NAL_UNIT_CODED_SLICE_EXT;
|
||||
int32_t iAssumedNeededLength = NAL_HEADER_SIZE + (kbNALExt ? 3 : 0) + pRawNal->iPayloadSize + 1;
|
||||
int32_t iAssumedNeededLength = NAL_HEADER_SIZE + (kbNALExt ? 3 : 0) + pRawNal->iPayloadSize + 1;
|
||||
WELS_VERIFY_RETURN_IF (ENC_RETURN_UNEXPECTED, (iAssumedNeededLength <= 0))
|
||||
|
||||
//since for each 0x000 need a 0x03, so the needed length will not exceed (iAssumeNeedLenth + iAssumeNeedLength/3), here adjust to >>1 to omit division
|
||||
@@ -145,20 +145,20 @@ int32_t WelsEncodeNal (SWelsNalRaw* pRawNal, void* pNalHeaderExt, const int32_t
|
||||
pDstPointer += 4;
|
||||
|
||||
/* NAL Unit Header */
|
||||
*pDstPointer++ = (pRawNal->sNalExt.sNalUnitHeader.uiNalRefIdc << 5) | (pRawNal->sNalExt.sNalUnitHeader.eNalUnitType &
|
||||
*pDstPointer++ = (pRawNal->sNalExt.sNalUnitHeader.uiNalRefIdc << 5) | (pRawNal->sNalExt.sNalUnitHeader.eNalUnitType &
|
||||
0x1f);
|
||||
|
||||
if (kbNALExt) {
|
||||
SNalUnitHeaderExt* sNalExt = (SNalUnitHeaderExt*)pNalHeaderExt;
|
||||
SNalUnitHeaderExt* sNalExt = (SNalUnitHeaderExt*)pNalHeaderExt;
|
||||
|
||||
/* NAL UNIT Extension Header */
|
||||
*pDstPointer++ = (0x80) |
|
||||
*pDstPointer++ = (0x80) |
|
||||
(sNalExt->bIdrFlag << 6);
|
||||
|
||||
*pDstPointer++ = (0x80) |
|
||||
*pDstPointer++ = (0x80) |
|
||||
(sNalExt->uiDependencyId << 4);
|
||||
|
||||
*pDstPointer++ = (sNalExt->uiTemporalId << 5) |
|
||||
*pDstPointer++ = (sNalExt->uiTemporalId << 5) |
|
||||
(sNalExt->bDiscardableFlag << 3) |
|
||||
(0x07);
|
||||
}
|
||||
@@ -166,21 +166,21 @@ int32_t WelsEncodeNal (SWelsNalRaw* pRawNal, void* pNalHeaderExt, const int32_t
|
||||
while (pSrcPointer < pSrcEnd) {
|
||||
if (iZeroCount == 2 && *pSrcPointer <= 3) {
|
||||
//add the code 03
|
||||
*pDstPointer++ = 3;
|
||||
iZeroCount = 0;
|
||||
*pDstPointer++ = 3;
|
||||
iZeroCount = 0;
|
||||
}
|
||||
if (*pSrcPointer == 0) {
|
||||
++ iZeroCount;
|
||||
} else {
|
||||
iZeroCount = 0;
|
||||
iZeroCount = 0;
|
||||
}
|
||||
*pDstPointer++ = *pSrcPointer++;
|
||||
}
|
||||
|
||||
/* count length of NAL Unit */
|
||||
iNalLength = (int32_t) (pDstPointer - pDstStart);
|
||||
iNalLength = (int32_t) (pDstPointer - pDstStart);
|
||||
if (NULL != pDstLen)
|
||||
*pDstLen = iNalLength;
|
||||
*pDstLen = iNalLength;
|
||||
|
||||
return ENC_RETURN_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user