shithub: openh264

Download patch

ref: 08c07db3c6f8ce5eff701cbc1fe7d66ffe552c43
parent: 8b7fb36f399e45517df783e05b3f4285c727dedc
author: Martin Storsjö <martin@martin.st>
date: Sat Feb 22 18:31:13 EST 2014

Respect the loop filter disabling encoder parameter

Previously the loop filter was unconditionally enabled
regardless of what encoder parameter was set. If using
SEncParamBase instead, the loop filter was always disabled.

--- a/codec/encoder/core/inc/param_svc.h
+++ b/codec/encoder/core/inc/param_svc.h
@@ -302,10 +302,10 @@
   SUsedPicRect.iHeight = ((iPicHeight >> 1) << 1);
 
   /* Deblocking loop filter */
+  iLoopFilterDisableIdc	= pCodingParam.iLoopFilterDisableIdc;	// 0: on, 1: off, 2: on except for slice boundaries,
 #ifdef MT_ENABLED
-  iLoopFilterDisableIdc	= 2;//pCodingParam.iLoopFilterDisableIdc;	// 0: on, 1: off, 2: on except for slice boundaries,
-#else
-  iLoopFilterDisableIdc	= 0;	// 0: on, 1: off, 2: on except for slice boundaries
+  if (iLoopFilterDisableIdc == 0) // Loop filter requested to be enabled
+    iLoopFilterDisableIdc = 2; // Disable loop filter on slice boundaries since that's not possible with multithreading
 #endif
   iLoopFilterAlphaC0Offset = 0;	// AlphaOffset: valid range [-6, 6], default 0
   iLoopFilterBetaOffset	= 0;	// BetaOffset:	valid range [-6, 6], default 0