]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7517: update to openh264 commit 3f19534dd6118b96ce73073ae1e047490c71b6e6
authorSeven Du <dujinfang@gmail.com>
Fri, 6 Feb 2015 05:16:51 +0000 (13:16 +0800)
committerMichael Jerris <mike@jerris.com>
Thu, 28 May 2015 17:46:58 +0000 (12:46 -0500)
src/mod/codecs/mod_openh264/mod_openh264.cpp

index 0074e6146edb855d9fd8c38bcc71395f96be3fd6..1de95aaae49d00acea790c35163c1d81e8c40bc9 100644 (file)
@@ -38,6 +38,9 @@
 
 #include "codec_api.h"
 //#include "inc/logging.h"     // for debug
+#ifndef NAL_HEADER_ADD_0X30BYTES
+#define NAL_HEADER_ADD_0X30BYTES 50
+#endif
 
 #define FPS 15.0f // frame rate
 #define H264_NALU_BUFFER_SIZE 65536
@@ -107,7 +110,7 @@ int FillSpecificParameters(h264_codec_context_t *context) {
        param->bEnableDenoise        = 0;         // denoise control
        param->bEnableBackgroundDetection = 1;    // background detection control
        param->bEnableSceneChangeDetect= 1;
-       //param->bEnableFrameSkip = 1;
+       param->bEnableFrameSkip = 1;
        param->iMultipleThreadIdc= 1;
        param->bEnableAdaptiveQuant       = 1;    // adaptive quantization control
        param->bEnableLongTermReference   = 0;    // long term reference control
@@ -116,10 +119,11 @@ int FillSpecificParameters(h264_codec_context_t *context) {
        param->iLoopFilterBetaOffset= 0;
        param->iComplexityMode = MEDIUM_COMPLEXITY;
        param->uiIntraPeriod                = FPS * 3;       // period of Intra frame
+       param->iNumRefFrame = AUTO_REF_PIC_COUNT; // encoder selects the number of reference frame automatically
 #ifdef MT_ENABLED
-       param->bEnableSpsPpsIdAddition = 1;
+       param->eSpsPpsIdStrategy = INCREASING_ID;
 #else
-       param->bEnableSpsPpsIdAddition = 0;
+       param->eSpsPpsIdStrategy = CONSTANT_ID;
 #endif
        param->bPrefixNalAddingCtrl    = 0;
 
@@ -142,7 +146,7 @@ int FillSpecificParameters(h264_codec_context_t *context) {
 #ifdef MT_ENABLED
        param->sSpatialLayers[iIndexLayer].sSliceCfg.uiSliceMode = SM_DYN_SLICE;
        param->sSpatialLayers[iIndexLayer].sSliceCfg.sSliceArgument.uiSliceSizeConstraint = SLICE_SIZE;
-       param->uiMaxNalSize = SLICE_SIZE;
+       param->uiMaxNalSize = SLICE_SIZE + NAL_HEADER_ADD_0X30BYTES;
 #else
        param->sSpatialLayers[iIndexLayer].sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
 #endif