Compare commits

...

6 Commits

Author SHA1 Message Date
sijchen
f6ee34c08b Merge pull request #1960 from sijchen/up14
update version info to get accord with release
2015-05-27 14:22:42 +08:00
Sijia Chen
6d1a9968e2 update version info to get accord with release 2015-05-27 13:30:30 +08:00
huili2
b46a9206d0 Merge pull request #1936 from sijchen/fix_rc_141
fix an improper mb-size assignment
2015-05-08 16:24:28 +08:00
Sijia Chen
07b046f7fa fix an improper mb-size assignment 2015-05-08 11:12:43 +08:00
sijchen
4b096b1ab6 Merge pull request #1923 from HaiboZhu/Remove_HP_from_decoder
Disable HP tools in decoder
2015-04-30 17:51:03 +08:00
dong zhang
be76769262 Disable HP tools in decoder
Remove the error spaces in code
2015-04-30 01:54:35 -07:00
6 changed files with 46 additions and 28 deletions

View File

@@ -4,12 +4,12 @@
#include "codec_app_def.h" #include "codec_app_def.h"
static const OpenH264Version g_stCodecVersion = {1, 4, 0, 0}; static const OpenH264Version g_stCodecVersion = {1,4,1,0};
static const char* const g_strCodecVer = "OpenH264 version:1.4.0.0"; static const char* const g_strCodecVer = "OpenH264 version:1.4.1.0";
#define OPENH264_MAJOR (1) #define OPENH264_MAJOR (1)
#define OPENH264_MINOR (4) #define OPENH264_MINOR (4)
#define OPENH264_REVISION (0) #define OPENH264_REVISION (1)
#define OPENH264_RESERVED (0) #define OPENH264_RESERVED (0)
#endif // CODEC_VER_H #endif // CODEC_VER_H

View File

@@ -46,6 +46,7 @@
#include "parameter_sets.h" #include "parameter_sets.h"
#include "decoder_context.h" #include "decoder_context.h"
#define DISABLE_HP_BRANCH_1_4
namespace WelsDec { namespace WelsDec {
/*! /*!

View File

@@ -961,11 +961,13 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //chroma_format_idc WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //chroma_format_idc
pSps->uiChromaFormatIdc = uiCode; pSps->uiChromaFormatIdc = uiCode;
// if (pSps->uiChromaFormatIdc != 1) { #ifdef DISABLE_HP_BRANCH_1_4
// WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): chroma_format_idc (%d) = 1 supported.", if (pSps->uiChromaFormatIdc != 1) {
// pSps->uiChromaFormatIdc); WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): chroma_format_idc (%d) = 1 supported.",
// return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE); pSps->uiChromaFormatIdc);
// } return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
}
#endif
if (pSps->uiChromaFormatIdc > 1) { if (pSps->uiChromaFormatIdc > 1) {
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): chroma_format_idc (%d) <=1 supported.", WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): chroma_format_idc (%d) <=1 supported.",
pSps->uiChromaFormatIdc); pSps->uiChromaFormatIdc);
@@ -993,8 +995,15 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
pSps->bSeqScalingMatrixPresentFlag = !!uiCode; pSps->bSeqScalingMatrixPresentFlag = !!uiCode;
if (pSps->bSeqScalingMatrixPresentFlag) { if (pSps->bSeqScalingMatrixPresentFlag) {
#ifndef DISABLE_HP_BRANCH_1_4
WELS_READ_VERIFY (ParseScalingList (pSps, pBs, 0, pSps->bSeqScalingListPresentFlag, pSps->iScalingList4x4, WELS_READ_VERIFY (ParseScalingList (pSps, pBs, 0, pSps->bSeqScalingListPresentFlag, pSps->iScalingList4x4,
pSps->iScalingList8x8)); pSps->iScalingList8x8));
#else
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
"ParseSps(): seq_scaling_matrix_present_flag (%d). Feature not supported.",
pSps->bSeqScalingMatrixPresentFlag);
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
#endif
} }
} }
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //log2_max_frame_num_minus4 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //log2_max_frame_num_minus4
@@ -1348,13 +1357,21 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux,
pPps->bWeightedPredFlag = !!uiCode; pPps->bWeightedPredFlag = !!uiCode;
WELS_READ_VERIFY (BsGetBits (pBsAux, 2, &uiCode)); //weighted_bipred_idc WELS_READ_VERIFY (BsGetBits (pBsAux, 2, &uiCode)); //weighted_bipred_idc
pPps->uiWeightedBipredIdc = uiCode; pPps->uiWeightedBipredIdc = uiCode;
#ifdef DISABLE_HP_BRANCH_1_4
if (pPps->bWeightedPredFlag || pPps->uiWeightedBipredIdc != 0) {
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);
}
#else
if (pPps->uiWeightedBipredIdc != 0) { if (pPps->uiWeightedBipredIdc != 0) {
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
"ParsePps(): weighted_bipred_idc (%d) not supported.\n", "ParsePps(): weighted_bipred_idc (%d) not supported.\n",
pPps->uiWeightedBipredIdc); pPps->uiWeightedBipredIdc);
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_WP); return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_WP);
} }
#endif
WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode)); //pic_init_qp_minus26 WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode)); //pic_init_qp_minus26
pPps->iPicInitQp = PIC_INIT_QP_OFFSET + iCode; pPps->iPicInitQp = PIC_INIT_QP_OFFSET + iCode;
WELS_CHECK_SE_BOTH_ERROR (pPps->iPicInitQp, PPS_PIC_INIT_QP_QS_MIN, PPS_PIC_INIT_QP_QS_MAX, "pic_init_qp_minus26 + 26", WELS_CHECK_SE_BOTH_ERROR (pPps->iPicInitQp, PPS_PIC_INIT_QP_QS_MIN, PPS_PIC_INIT_QP_QS_MAX, "pic_init_qp_minus26 + 26",
@@ -1374,7 +1391,7 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux,
pPps->bConstainedIntraPredFlag = !!uiCode; pPps->bConstainedIntraPredFlag = !!uiCode;
WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //redundant_pic_cnt_present_flag WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //redundant_pic_cnt_present_flag
pPps->bRedundantPicCntPresentFlag = !!uiCode; pPps->bRedundantPicCntPresentFlag = !!uiCode;
#ifndef DISABLE_HP_BRANCH_1_4
if (CheckMoreRBSPData (pBsAux)) { if (CheckMoreRBSPData (pBsAux)) {
WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //transform_8x8_mode_flag WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //transform_8x8_mode_flag
pPps->bTransform8x8ModeFlag = !!uiCode; pPps->bTransform8x8ModeFlag = !!uiCode;
@@ -1396,7 +1413,7 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux,
PPS_CHROMA_QP_INDEX_OFFSET_MAX, "chroma_qp_index_offset", GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, PPS_CHROMA_QP_INDEX_OFFSET_MAX, "chroma_qp_index_offset", GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS,
ERR_INFO_INVALID_CHROMA_QP_INDEX_OFFSET)); ERR_INFO_INVALID_CHROMA_QP_INDEX_OFFSET));
} }
#endif
if (pCtx->pAccessUnitList->uiAvailUnitsNum > 0) { if (pCtx->pAccessUnitList->uiAvailUnitsNum > 0) {
PNalUnit pLastNalUnit = pCtx->pAccessUnitList->pNalUnitsList[pCtx->pAccessUnitList->uiAvailUnitsNum - 1]; PNalUnit pLastNalUnit = pCtx->pAccessUnitList->pNalUnitsList[pCtx->pAccessUnitList->uiAvailUnitsNum - 1];
PPps pLastPps = pLastNalUnit->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pPps; PPps pLastPps = pLastNalUnit->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pPps;
@@ -1442,7 +1459,7 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux,
************************************************************************************* *************************************************************************************
* \brief to parse SEI message payload * \brief to parse SEI message payload
* *
* \param pSei sei message to be parsed output * \param pSei sei message to be parsed output
* \param pBsAux bitstream reader auxiliary * \param pBsAux bitstream reader auxiliary
* *
* \return 0 - successed * \return 0 - successed

View File

@@ -280,33 +280,33 @@ bool GomValidCheckSliceMbNum (const int32_t kiMbWidth, const int32_t kiMbHeight,
iGomSize = kiMbWidth * GOM_ROW_MODE0_360P; iGomSize = kiMbWidth * GOM_ROW_MODE0_360P;
else else
iGomSize = kiMbWidth * GOM_ROW_MODE0_720P; iGomSize = kiMbWidth * GOM_ROW_MODE0_720P;
// GOM boundary aligned
int32_t iNumMbAssigning = WELS_DIV_ROUND (INT_MULTIPLY * kiMbNumPerSlice, iGomSize * INT_MULTIPLY) * iGomSize;
int32_t iCurNumMbAssigning = 0;
iMinimalMbNum = iGomSize; iMinimalMbNum = iGomSize;
iMaximalMbNum = kiMbNumInFrame - (kuiSliceNum - 1) * iMinimalMbNum;
while (uiSliceIdx + 1 < kuiSliceNum) { while (uiSliceIdx + 1 < kuiSliceNum) {
// GOM boundary aligned iMaximalMbNum = iNumMbLeft - (kuiSliceNum - uiSliceIdx - 1) * iMinimalMbNum; // get maximal num_mb in left parts
int32_t iNumMbAssigning = WELS_DIV_ROUND (INT_MULTIPLY * kiMbNumPerSlice, iGomSize * INT_MULTIPLY) * iGomSize;
// make sure one GOM at least in each slice for safe // make sure one GOM at least in each slice for safe
if (iNumMbAssigning < iMinimalMbNum) if (iNumMbAssigning < iMinimalMbNum)
iNumMbAssigning = iMinimalMbNum; iCurNumMbAssigning = iMinimalMbNum;
else if (iNumMbAssigning > iMaximalMbNum) else if (iNumMbAssigning > iMaximalMbNum)
iNumMbAssigning = iMaximalMbNum; iCurNumMbAssigning = ( iMaximalMbNum / iGomSize ) * iGomSize;
else
iCurNumMbAssigning = iNumMbAssigning;
if (iNumMbAssigning <= 0) { if (iCurNumMbAssigning <= 0) {
return false; return false;
} }
iNumMbLeft -= iNumMbAssigning; iNumMbLeft -= iCurNumMbAssigning;
if (iNumMbLeft <= 0) { if (iNumMbLeft <= 0) {
return false; return false;
} }
pSlicesAssignList[uiSliceIdx] = iNumMbAssigning; pSlicesAssignList[uiSliceIdx] = iCurNumMbAssigning;
++ uiSliceIdx; ++ uiSliceIdx;
iMaximalMbNum = iNumMbLeft - (kuiSliceNum - uiSliceIdx - 1) * iMinimalMbNum; // get maximal num_mb in left parts
} }
pSlicesAssignList[uiSliceIdx] = iNumMbLeft; pSlicesAssignList[uiSliceIdx] = iNumMbLeft;

View File

@@ -24,8 +24,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,4,0,0 FILEVERSION 1,4,1,0
PRODUCTVERSION 1,4,0,0 PRODUCTVERSION 1,4,1,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@@ -43,12 +43,12 @@ BEGIN
VALUE "Comments", "Cisco OpenH264 codec" VALUE "Comments", "Cisco OpenH264 codec"
VALUE "CompanyName", "Cisco Systems Inc." VALUE "CompanyName", "Cisco Systems Inc."
VALUE "FileDescription", "Cisco OpenH264 codec" VALUE "FileDescription", "Cisco OpenH264 codec"
VALUE "FileVersion", "1.4.0.0" VALUE "FileVersion", "1.4.1.0"
VALUE "InternalName", "openh264.dll" VALUE "InternalName", "openh264.dll"
VALUE "LegalCopyright", "<22> 2011-2015 Cisco and/or its affiliates. All rights reserved." VALUE "LegalCopyright", "<22> 2011-2015 Cisco and/or its affiliates. All rights reserved."
VALUE "OriginalFilename", "openh264.dll" VALUE "OriginalFilename", "openh264.dll"
VALUE "ProductName", "Cisco OpenH264 codec" VALUE "ProductName", "Cisco OpenH264 codec"
VALUE "ProductVersion", "1.4.0.0" VALUE "ProductVersion", "1.4.1.0"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View File

@@ -272,7 +272,7 @@ void DecoderParseSyntaxTest::TestScalingList() {
//TEST here for whole tests //TEST here for whole tests
TEST_F (DecoderParseSyntaxTest, DecoderParseSyntaxTestAll) { TEST_F (DecoderParseSyntaxTest, DecoderParseSyntaxTestAll) {
TestScalingList(); //TestScalingList(); Disable ScalingUTTest in Branch1.4
} }