shithub: openh264

Download patch

ref: a43841d0e94f3b18c440f55d91d8a1942cf86cfe
parent: d97f4c5b680bb90bf476c648b3e0a0bb480be0f2
parent: 687f9eff1b7c2f9b4cfbea7de44f52f8c8155312
author: huili2 <huili2@cisco.com>
date: Wed Jul 13 09:31:17 EDT 2016

Merge pull request #2526 from HaiboZhu/Bugfix_CHP_support

Fixes for CHP support

--- a/codec/decoder/core/src/au_parser.cpp
+++ b/codec/decoder/core/src/au_parser.cpp
@@ -1377,12 +1377,7 @@
   pPps->bWeightedPredFlag  = !!uiCode;
   WELS_READ_VERIFY (BsGetBits (pBsAux, 2, &uiCode)); //weighted_bipred_idc
   pPps->uiWeightedBipredIdc = uiCode;
-  if (pPps->uiWeightedBipredIdc != 0) {
-    WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
-             "ParsePps(): weighted_bipred_idc (%d) not supported.\n",
-             pPps->uiWeightedBipredIdc);
-    return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_WP);
-  }
+  // weighted_bipred_idc > 0 NOT supported now, but no impact when we ignore it
 
   WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode)); //pic_init_qp_minus26
   pPps->iPicInitQp = PIC_INIT_QP_OFFSET + iCode;
--- a/codec/decoder/core/src/decode_slice.cpp
+++ b/codec/decoder/core/src/decode_slice.cpp
@@ -535,6 +535,10 @@
   pCurDqLayer->pIntraPredMode[iMbXy][4] = pIntraPredMode[4 + 8 * 1];
   pCurDqLayer->pIntraPredMode[iMbXy][5] = pIntraPredMode[4 + 8 * 2];
   pCurDqLayer->pIntraPredMode[iMbXy][6] = pIntraPredMode[4 + 8 * 3];
+
+  if (pCtx->pSps->uiChromaFormatIdc == 0)
+    return ERR_NONE;
+
   if (pCurDqLayer->sLayerInfo.pPps->bEntropyCodingModeFlag) {
     WELS_READ_VERIFY (ParseIntraPredModeChromaCabac (pCtx, uiNeighAvail, iCode));
     if (iCode > MAX_PRED_MODE_ID_CHROMA) {