Merge branch 'master' of https://github.com/cisco/openh264 into develop_b
This commit is contained in:
commit
592665a21d
@ -694,8 +694,8 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co
|
||||
return ERR_INFO_INVALID_DBLOCKING_IDC;
|
||||
}
|
||||
if (pSliceHead->uiDisableDeblockingFilterIdc != 1) {
|
||||
pSliceHead->iSliceAlphaC0Offset = BsGetSe (pBs) << 1; // slice_alpha_c0_offset_div2
|
||||
pSliceHead->iSliceBetaOffset = BsGetSe (pBs) << 1; // iSliceBetaOffset
|
||||
pSliceHead->iSliceAlphaC0Offset = BsGetSe (pBs) * 2; // slice_alpha_c0_offset_div2
|
||||
pSliceHead->iSliceBetaOffset = BsGetSe (pBs) * 2; // iSliceBetaOffset
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ static inline int32_t HorFilterInput16bit_c (int16_t* pSrc) {
|
||||
int32_t iPix14 = pSrc[-1] + pSrc[2];
|
||||
int32_t iPix23 = pSrc[ 0] + pSrc[1];
|
||||
|
||||
return (iPix05 - ((iPix14 << 2) + iPix14) + (iPix23 << 4) + (iPix23 << 2));
|
||||
return (iPix05 - (iPix14 * 5)+ (iPix23 * 20));
|
||||
}
|
||||
// h: iOffset=1 / v: iOffset=iSrcStride
|
||||
static inline int32_t FilterInput8bitWithStride_c (uint8_t* pSrc, const int32_t kiOffset) {
|
||||
|
@ -44,7 +44,7 @@
|
||||
#include "mv_pred.h"
|
||||
|
||||
namespace WelsDec {
|
||||
|
||||
#define MAX_LEVEL_PREFIX 15
|
||||
void GetNeighborAvailMbType (PNeighAvail pNeighAvail, PDqLayer pCurLayer) {
|
||||
int32_t iCurSliceIdc, iTopSliceIdc, iLeftTopSliceIdc, iRightTopSliceIdc, iLeftSliceIdc;
|
||||
int32_t iCurXy, iTopXy, iLeftXy, iLeftTopXy, iRightTopXy;
|
||||
@ -93,7 +93,7 @@ void GetNeighborAvailMbType (PNeighAvail pNeighAvail, PDqLayer pCurLayer) {
|
||||
pNeighAvail->iRightTopType = (pNeighAvail->iRightTopAvail ? pCurLayer->pMbType[iRightTopXy] : 0);
|
||||
}
|
||||
void WelsFillCacheNonZeroCount (PNeighAvail pNeighAvail, uint8_t* pNonZeroCount,
|
||||
PDqLayer pCurLayer) { //no matter slice type, intra_pred_constrained_flag
|
||||
PDqLayer pCurLayer) { //no matter slice type, intra_pred_constrained_flag
|
||||
int32_t iCurXy = pCurLayer->iMbXyIndex;
|
||||
int32_t iTopXy = 0;
|
||||
int32_t iLeftXy = 0;
|
||||
@ -144,7 +144,7 @@ void WelsFillCacheNonZeroCount (PNeighAvail pNeighAvail, uint8_t* pNonZeroCount,
|
||||
}
|
||||
}
|
||||
void WelsFillCacheConstrain1Intra4x4 (PNeighAvail pNeighAvail, uint8_t* pNonZeroCount, int8_t* pIntraPredMode,
|
||||
PDqLayer pCurLayer) { //no matter slice type
|
||||
PDqLayer pCurLayer) { //no matter slice type
|
||||
int32_t iCurXy = pCurLayer->iMbXyIndex;
|
||||
int32_t iTopXy = 0;
|
||||
int32_t iLeftXy = 0;
|
||||
@ -190,7 +190,7 @@ void WelsFillCacheConstrain1Intra4x4 (PNeighAvail pNeighAvail, uint8_t* pNonZero
|
||||
}
|
||||
|
||||
void WelsFillCacheConstrain0Intra4x4 (PNeighAvail pNeighAvail, uint8_t* pNonZeroCount, int8_t* pIntraPredMode,
|
||||
PDqLayer pCurLayer) { //no matter slice type
|
||||
PDqLayer pCurLayer) { //no matter slice type
|
||||
int32_t iCurXy = pCurLayer->iMbXyIndex;
|
||||
int32_t iTopXy = 0;
|
||||
int32_t iLeftXy = 0;
|
||||
@ -236,7 +236,7 @@ void WelsFillCacheConstrain0Intra4x4 (PNeighAvail pNeighAvail, uint8_t* pNonZero
|
||||
}
|
||||
|
||||
void WelsFillCacheInter (PNeighAvail pNeighAvail, uint8_t* pNonZeroCount,
|
||||
int16_t iMvArray[LIST_A][30][MV_A], int8_t iRefIdxArray[LIST_A][30], PDqLayer pCurLayer) {
|
||||
int16_t iMvArray[LIST_A][30][MV_A], int8_t iRefIdxArray[LIST_A][30], PDqLayer pCurLayer) {
|
||||
int32_t iCurXy = pCurLayer->iMbXyIndex;
|
||||
int32_t iTopXy = 0;
|
||||
int32_t iLeftXy = 0;
|
||||
@ -477,8 +477,8 @@ void BsStartCavlc (PBitStringAux pBs) {
|
||||
}
|
||||
void BsEndCavlc (PBitStringAux pBs) {
|
||||
pBs->pCurBuf = pBs->pStartBuf + (pBs->iIndex >> 3);
|
||||
pBs->uiCurBits = ((((pBs->pCurBuf[0] << 8) | pBs->pCurBuf[1]) << 16) | (pBs->pCurBuf[2] << 8) | pBs->pCurBuf[3]) <<
|
||||
(pBs->iIndex & 0x07);
|
||||
uint32_t uiCache32Bit = (uint32_t)((((pBs->pCurBuf[0] << 8) | pBs->pCurBuf[1]) << 16) | (pBs->pCurBuf[2] << 8) | pBs->pCurBuf[3]);
|
||||
pBs->uiCurBits = uiCache32Bit << (pBs->iIndex & 0x07);
|
||||
pBs->pCurBuf += 4;
|
||||
pBs->iLeftBits = -16 + (pBs->iIndex & 0x07);
|
||||
}
|
||||
@ -548,23 +548,23 @@ static int32_t CavlcGetLevelVal (int32_t iLevel[16], SReadBitsCache* pBitsCache,
|
||||
for (; i < uiTotalCoeff; i++) {
|
||||
if (pBitsCache->uiRemainBits <= 16) SHIFT_BUFFER (pBitsCache);
|
||||
WELS_GET_PREFIX_BITS (pBitsCache->uiCache32Bit, iPrefixBits);
|
||||
if (iPrefixBits > MAX_LEVEL_PREFIX + 1) //iPrefixBits includes leading "0"s and first "1", should +1
|
||||
return -1;
|
||||
POP_BUFFER (pBitsCache, iPrefixBits);
|
||||
iUsedBits += iPrefixBits;
|
||||
iLevelPrefix = iPrefixBits - 1;
|
||||
|
||||
iLevelCode = (WELS_MIN (15, iLevelPrefix)) << iSuffixLength; //differ
|
||||
iLevelCode = iLevelPrefix << iSuffixLength; //differ
|
||||
iSuffixLengthSize = iSuffixLength;
|
||||
|
||||
if (iLevelPrefix >= 14) {
|
||||
if (14 == iLevelPrefix && 0 == iSuffixLength)
|
||||
iSuffixLengthSize = 4;
|
||||
else if (15 == iLevelPrefix)
|
||||
else if (15 == iLevelPrefix) {
|
||||
iSuffixLengthSize = 12;
|
||||
else if (iLevelPrefix > 15)
|
||||
iLevelCode += (1 << (iLevelPrefix - 3)) - 4096;
|
||||
|
||||
if (iLevelPrefix >= 15 && iSuffixLength == 0)
|
||||
iLevelCode += 15;
|
||||
if (iSuffixLength == 0)
|
||||
iLevelCode += 15;
|
||||
}
|
||||
}
|
||||
|
||||
if (iSuffixLengthSize > 0) {
|
||||
@ -677,7 +677,8 @@ int32_t WelsResidualBlockCavlc (SVlcTable* pVlcTable, uint8_t* pNonZeroCountCach
|
||||
uint8_t bChroma = (bChromaDc || CHROMA_AC == iResidualProperty);
|
||||
SReadBitsCache sReadBitsCache;
|
||||
|
||||
sReadBitsCache.uiCache32Bit = ((((pBuf[0] << 8) | pBuf[1]) << 16) | (pBuf[2] << 8) | pBuf[3]) << (iCurIdx & 0x07);
|
||||
uint32_t uiCache32Bit = (uint32_t)((((pBuf[0] << 8) | pBuf[1]) << 16) | (pBuf[2] << 8) | pBuf[3]);
|
||||
sReadBitsCache.uiCache32Bit = uiCache32Bit << (iCurIdx & 0x07);
|
||||
sReadBitsCache.uiRemainBits = 32 - (iCurIdx & 0x07);
|
||||
sReadBitsCache.pBuf = pBuf;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
@ -250,8 +250,8 @@ int32_t ParamBaseTranscode (SEncParamBase& pCodingParam, const bool kbEnableRc =
|
||||
while (iIdxSpatial < iSpatialLayerNum) {
|
||||
|
||||
pDlp->uiProfileIdc = uiProfileIdc;
|
||||
sSpatialLayers[iIdxSpatial].fFrameRate = WELS_CLIP3 (sSpatialLayers[iIdxSpatial].fFrameRate,
|
||||
MIN_FRAME_RATE, pCodingParam.fMaxFrameRate);
|
||||
sSpatialLayers[iIdxSpatial].fFrameRate = WELS_CLIP3 (pCodingParam.fMaxFrameRate,
|
||||
MIN_FRAME_RATE, MAX_FRAME_RATE);
|
||||
pDlp->fInputFrameRate =
|
||||
pDlp->fOutputFrameRate = WELS_CLIP3 (sSpatialLayers[iIdxSpatial].fFrameRate, MIN_FRAME_RATE,
|
||||
MAX_FRAME_RATE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user