shithub: openh264

Download patch

ref: 13cb84e695e8cabb89122d72ab2fc1001c5b30ac
parent: 01016b1c83b019d731e73c0bf513cd79ea3223ff
author: sijchen <sijchen@cisco.com>
date: Tue Nov 24 09:19:15 EST 2015

use different task when load-balancing or not to save computation

--- a/codec/encoder/core/src/wels_task_management.cpp
+++ b/codec/encoder/core/src/wels_task_management.cpp
@@ -125,8 +125,11 @@
   }
 
   for (int idx = 0; idx < kiTaskCount; idx++) {
-    pTask = WELS_NEW_OP (CWelsLoadBalancingSlicingEncodingTask (pEncCtx, idx), CWelsLoadBalancingSlicingEncodingTask);
-    //TODO: set this after loadbalancing flagpTask = WELS_NEW_OP (CWelsSliceEncodingTask (pEncCtx, idx), CWelsSliceEncodingTask);
+    if (pEncCtx->pSvcParam->bUseLoadBalancing) {
+      pTask = WELS_NEW_OP (CWelsLoadBalancingSlicingEncodingTask (pEncCtx, idx), CWelsLoadBalancingSlicingEncodingTask);
+    } else {
+      pTask = WELS_NEW_OP (CWelsSliceEncodingTask (pEncCtx, idx), CWelsSliceEncodingTask);
+    }
     WELS_VERIFY_RETURN_IF (ENC_RETURN_MEMALLOCERR, NULL == pTask)
     m_cEncodingTaskList->push_back (pTask);
   }