shithub: openh264

Download patch

ref: d63172db9bc8c698c618cb35451a2b97f2b1faca
parent: 43dc6f01e1aac695bffec42cab67459d895da61d
parent: 61926f208ce44fe8fa657006af894e77664bc909
author: ruil2 <[email protected]>
date: Fri Sep 5 08:49:25 EDT 2014

Merge pull request #1331 from sijchen/add_setoption

[Encoder] add setoption of 'isLosslessLink' for further strategy tuning

--- a/codec/api/svc/codec_app_def.h
+++ b/codec/api/svc/codec_app_def.h
@@ -102,6 +102,9 @@
   ENCODER_OPTION_TRACE_LEVEL,
   ENCODER_OPTION_TRACE_CALLBACK, // a void (*)(void* context, int level, const char* message) function which receives log messages
   ENCODER_OPTION_TRACE_CALLBACK_CONTEXT,
+
+  // advanced algorithmetic settings
+  ENCODER_OPTION_IS_LOSSLESS_LINK,
 } ENCODER_OPTION;
 
 /* Option types introduced in decoder application */
--- a/codec/encoder/core/inc/param_svc.h
+++ b/codec/encoder/core/inc/param_svc.h
@@ -118,6 +118,9 @@
 int8_t		iDecompStages;		// GOP size dependency
 int32_t  iMaxNumRefFrame;
 
+//setting this according to link type in use MAY invoke some algorithms targeting higher coding efficiency
+bool bIsLossLessLink;
+
  public:
 TagWelsSvcCodingParam() {
   FillDefault();
@@ -217,7 +220,7 @@
     sSpatialLayers[0].sSliceCfg.sSliceArgument.uiSliceMbNum[idx] = 960;
   sSpatialLayers[0].iDLayerQp = SVC_QUALITY_BASE_QP;
 
-
+  bIsLossLessLink = false;
 }
 
 int32_t ParamBaseTranscode (const SEncParamBase& pCodingParam) {
--- a/codec/encoder/plus/src/welsEncoderExt.cpp
+++ b/codec/encoder/plus/src/welsEncoderExt.cpp
@@ -902,8 +902,13 @@
   }
   break;
   case ENCODER_OPTION_COMPLEXITY: {
-    int32_t iValue = * ((int32_t*)pOption);
+    int32_t iValue = * (static_cast<int32_t*>(pOption));
     m_pEncContext->pSvcParam->iComplexityMode = (ECOMPLEXITY_MODE)iValue;
+  }
+  break;
+  case ENCODER_OPTION_IS_LOSSLESS_LINK: {
+    bool bValue = * (static_cast<bool*>(pOption));
+    m_pEncContext->pSvcParam->bIsLossLessLink = bValue;
   }
   break;
   default: