add patch to openh264 decoder for more permissive decoding
This commit is contained in:
parent
9bc2234788
commit
7d6efd0328
4 changed files with 66 additions and 6 deletions
15
Makefile
15
Makefile
|
@ -33,7 +33,6 @@ ENABLE_GPL_THIRD_PARTIES=1
|
|||
#default options, can be overidden using make OPTION=value .
|
||||
|
||||
ifeq ($(ENABLE_GPL_THIRD_PARTIES),1)
|
||||
BUILD_X264=1
|
||||
BUILD_G729=1
|
||||
else
|
||||
#x264 and g729 requires additional licensing agreements.
|
||||
|
@ -43,7 +42,7 @@ endif
|
|||
|
||||
NDK_DEBUG=0
|
||||
BUILD_VIDEO=1
|
||||
BUILD_OPENH264=0
|
||||
BUILD_OPENH264=1
|
||||
BUILD_UPNP=1
|
||||
BUILD_AMRNB=full # 0, light or full
|
||||
BUILD_AMRWB=1
|
||||
|
@ -218,6 +217,12 @@ endif
|
|||
OPENH264_SRC_DIR=$(TOPDIR)/submodules/externals/openh264
|
||||
OPENH264_BUILD_DIR=$(TOPDIR)/submodules/externals/build/openh264
|
||||
|
||||
openh264-patch: $(OPENH264_SRC_DIR)/patch.stamp
|
||||
|
||||
|
||||
$(OPENH264_SRC_DIR)/patch.stamp: $(TOPDIR)/patches/openh264-permissive.patch
|
||||
cd $(OPENH264_SRC_DIR) && patch -p1 < $(TOPDIR)/patches/openh264-permissive.patch && touch $(OPENH264_SRC_DIR)/patch.stamp
|
||||
|
||||
$(OPENH264_BUILD_DIR)/include/codec_api.h:
|
||||
mkdir -p $(OPENH264_BUILD_DIR)/include/wels && \
|
||||
cp $(OPENH264_SRC_DIR)/codec/api/svc/codec_api.h $(OPENH264_BUILD_DIR)/include/wels/
|
||||
|
@ -230,7 +235,7 @@ $(OPENH264_BUILD_DIR)/include/codec_def.h:
|
|||
mkdir -p $(OPENH264_BUILD_DIR)/include/wels && \
|
||||
cp $(OPENH264_SRC_DIR)/codec/api/svc/codec_def.h $(OPENH264_BUILD_DIR)/include/wels/
|
||||
|
||||
$(OPENH264_BUILD_DIR)/arm/libwels.a:
|
||||
$(OPENH264_BUILD_DIR)/arm/libwels.a: openh264-patch
|
||||
mkdir -p $(OPENH264_BUILD_DIR)/arm && \
|
||||
cd $(OPENH264_SRC_DIR) && \
|
||||
make libraries -j $(NUMCPUS) OS=android ARCH=arm NDKROOT=$(NDK_PATH) TARGET=$(ANDROID_MOST_RECENT_TARGET) && \
|
||||
|
@ -238,7 +243,7 @@ $(OPENH264_BUILD_DIR)/arm/libwels.a:
|
|||
make clean OS=android ARCH=arm NDKROOT=$(NDK_PATH) TARGET=$(ANDROID_MOST_RECENT_TARGET) \
|
||||
|| ( echo "Build of openh264 for arm failed." ; exit 1 )
|
||||
|
||||
$(OPENH264_BUILD_DIR)/x86/libwels.a:
|
||||
$(OPENH264_BUILD_DIR)/x86/libwels.a: openh264-patch
|
||||
mkdir -p $(OPENH264_BUILD_DIR)/x86 && \
|
||||
cd $(OPENH264_SRC_DIR) && \
|
||||
make libraries -j $(NUMCPUS) OS=android ARCH=x86 NDKROOT=$(NDK_PATH) TARGET=$(ANDROID_MOST_RECENT_TARGET) && \
|
||||
|
@ -250,6 +255,8 @@ endif
|
|||
build-openh264: $(BUILD_OPENH264_DEPS)
|
||||
|
||||
clean-openh264:
|
||||
cd $(OPENH264_SRC_DIR) && make clean OS=android ARCH=x86 NDKROOT=$(NDK_PATH) TARGET=$(ANDROID_MOST_RECENT_TARGET)
|
||||
cd $(OPENH264_SRC_DIR) && make clean OS=android ARCH=arm NDKROOT=$(NDK_PATH) TARGET=$(ANDROID_MOST_RECENT_TARGET)
|
||||
rm -rf $(OPENH264_BUILD_DIR)/arm && \
|
||||
rm -rf $(OPENH264_BUILD_DIR)/x86
|
||||
|
||||
|
|
53
patches/openh264-permissive.patch
Normal file
53
patches/openh264-permissive.patch
Normal file
|
@ -0,0 +1,53 @@
|
|||
commit 6b3de978d928b6c0baec3305c9803c21a4367d0c
|
||||
Author: Simon Morlat <simon.morlat@linphone.org>
|
||||
Date: Tue Apr 15 15:19:37 2014 +0200
|
||||
|
||||
permissive mode: allow reference frames to be used even if there were lost slices.
|
||||
|
||||
diff --git a/codec/decoder/core/src/decoder_core.cpp b/codec/decoder/core/src/decoder_core.cpp
|
||||
index c19f501..a14e971 100644
|
||||
--- a/codec/decoder/core/src/decoder_core.cpp
|
||||
+++ b/codec/decoder/core/src/decoder_core.cpp
|
||||
@@ -58,7 +58,7 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t
|
||||
WelsLog (pCtx, WELS_LOG_WARNING,
|
||||
"DecodeFrameConstruction():::iTotalNumMbRec:%d, total_num_mb_sps:%d, cur_layer_mb_width:%d, cur_layer_mb_height:%d --\n",
|
||||
pCtx->iTotalNumMbRec, kiTotalNumMbInCurLayer, pCurDq->iMbWidth, pCurDq->iMbHeight);
|
||||
- return -1;
|
||||
+ //return -1;
|
||||
}
|
||||
#ifdef NO_WAITING_AU
|
||||
pCtx->iTotalNumMbRec = 0;
|
||||
diff --git a/codec/decoder/core/src/manage_dec_ref.cpp b/codec/decoder/core/src/manage_dec_ref.cpp
|
||||
index dcf61ca..5582ec9 100644
|
||||
--- a/codec/decoder/core/src/manage_dec_ref.cpp
|
||||
+++ b/codec/decoder/core/src/manage_dec_ref.cpp
|
||||
@@ -165,6 +165,7 @@ int32_t WelsReorderRefList (PWelsDecoderContext pCtx) {
|
||||
&& (pSliceHeader->iSpsId != ppRefList[i]->iSpsId)) { //check;
|
||||
WelsLog (pCtx, WELS_LOG_WARNING, "WelsReorderRefList()-1::::BASE LAYER::::iSpsId:%d, ref_sps_id:%d\n",
|
||||
pSliceHeader->iSpsId, ppRefList[i]->iSpsId);
|
||||
+ return ERR_NONE;
|
||||
pCtx->iErrorCode = dsNoParamSets; //cross-IDR reference frame selection, SHOULD request IDR.--
|
||||
return ERR_INFO_REFERENCE_PIC_LOST;
|
||||
} else {
|
||||
|
||||
commit a1f3b95ad18d0788c2c803fac80e78d6365673ce
|
||||
Author: Simon Morlat <simon.morlat@linphone.org>
|
||||
Date: Tue Apr 15 17:54:58 2014 +0200
|
||||
|
||||
permissive mode (2)
|
||||
|
||||
diff --git a/codec/decoder/core/src/decoder_core.cpp b/codec/decoder/core/src/decoder_core.cpp
|
||||
index a14e971..e742dbf 100644
|
||||
--- a/codec/decoder/core/src/decoder_core.cpp
|
||||
+++ b/codec/decoder/core/src/decoder_core.cpp
|
||||
@@ -1738,8 +1738,8 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, int3
|
||||
if ((iLastIdD < 0) || //case 1: first layer
|
||||
(iLastIdD == iCurrIdD)) { //case 2: same uiDId
|
||||
InitDqLayerInfo (dq_cur, &pLayerInfo, pNalCur, pCtx->pDec);
|
||||
-
|
||||
- if (!dq_cur->sLayerInfo.pSps->bGapsInFrameNumValueAllowedFlag) {
|
||||
+ if (0){
|
||||
+ //if (!dq_cur->sLayerInfo.pSps->bGapsInFrameNumValueAllowedFlag) {
|
||||
const bool kbIdrFlag = dq_cur->sLayerInfo.sNalHeaderExt.bIdrFlag
|
||||
|| (dq_cur->sLayerInfo.sNalHeaderExt.sNalUnitHeader.eNalUnitType == NAL_UNIT_CODED_SLICE_IDR);
|
||||
// Subclause 8.2.5.2 Decoding process for gaps in frame_num
|
2
submodules/externals/openh264
vendored
2
submodules/externals/openh264
vendored
|
@ -1 +1 @@
|
|||
Subproject commit fb5700bd5cc18dd33c120ce9dd5f79b8f1f35f3a
|
||||
Subproject commit b2f7191fa7e213f5b63b8e31936b962bae6adc2f
|
|
@ -1 +1 @@
|
|||
Subproject commit d7c97675f6dd727c79f75bd807f69a8ad8946146
|
||||
Subproject commit 4a0ac438f11eeabcf202957ff45a44dacc316c2e
|
Loading…
Reference in a new issue