shithub: openh264

Download patch

ref: 59e782a8a57151768884d965088b66079026f479
parent: 1526de3ae50b09f8096f4d538e93e791402a9aab
parent: 0bae0f869a1f2aa11dc75fedac5bb36a94a87d46
author: sijchen <sijchen@cisco.com>
date: Fri Nov 28 05:27:14 EST 2014

Merge pull request #1572 from mstorsjo/loopfilter-opts

Fixes relating to the loopfilter parameter

--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -261,6 +261,12 @@
              pCodingParam->uiIntraPeriod, pCodingParam->uiGopSize);
     return ENC_RETURN_UNSUPPORTED_PARA;
   }
+  if (pCodingParam->iLoopFilterDisableIdc < 0 || pCodingParam->iLoopFilterDisableIdc > 6) {
+    WelsLog (pLogCtx, WELS_LOG_ERROR,
+             "ParamValidationExt(), iLoopFilterDisableIdc(%d) must be between 0 and 6",
+             pCodingParam->iLoopFilterDisableIdc);
+    return ENC_RETURN_UNSUPPORTED_PARA;
+  }
 
 
   //about iMultipleThreadIdc, bDeblockingParallelFlag, iLoopFilterDisableIdc, & uiSliceMode
--- a/codec/encoder/core/src/svc_encode_slice.cpp
+++ b/codec/encoder/core/src/svc_encode_slice.cpp
@@ -290,8 +290,8 @@
     case 5:
       BsWriteUE (pBs, 2);
       break;
-    default :
-      WelsLog(&pCtx->sLogCtx, WELS_LOG_ERROR, "pData error for deblocking");
+    default:
+      WelsLog(&pCtx->sLogCtx, WELS_LOG_ERROR, "Invalid uiDisableDeblockingFilterIdc %d", pSliceHeader->uiDisableDeblockingFilterIdc);
       break;
     }
     if (1 != pSliceHeader->uiDisableDeblockingFilterIdc) {
--- a/test/api/encode_decode_api_test.cpp
+++ b/test/api/encode_decode_api_test.cpp
@@ -244,7 +244,7 @@
   param_.iLtrMarkPeriod            = rand();
 
   //loop filter
-  param_.iLoopFilterDisableIdc     = rand();
+  param_.iLoopFilterDisableIdc     = rand() % 7;
   param_.iLoopFilterAlphaC0Offset  = rand();
   param_.iLoopFilterBetaOffset     = rand();