shithub: openh264

Download patch

ref: f71cf37818e1827a03d6498ffd759e602c56945f
parent: 0f4499121a35ff33a5c733919366134c0e0cbb0b
parent: 2626ed21817f61d0af2cd7477e7c6fceb75b7de2
author: huili2 <huili2@cisco.com>
date: Fri Jun 27 09:14:20 EDT 2014

Merge pull request #1023 from ruil2/remove_check

only supports fixed LTR_NUM for screen and camera

--- a/codec/encoder/core/inc/param_svc.h
+++ b/codec/encoder/core/inc/param_svc.h
@@ -353,7 +353,7 @@
 
   if (iUsageType == SCREEN_CONTENT_REAL_TIME) {
     if (bEnableLongTermReference) {
-      iLTRRefNum = WELS_CLIP3 (pCodingParam.iLTRRefNum, 1, LONG_TERM_REF_NUM_SCREEN);
+      iLTRRefNum = LONG_TERM_REF_NUM_SCREEN;
       if (iNumRefFrame == AUTO_REF_PIC_COUNT)
         iNumRefFrame = WELS_MAX (1, WELS_LOG2 (uiGopSize)) + iLTRRefNum;
     } else {
@@ -363,7 +363,7 @@
         iNumRefFrame = WELS_MAX (1, uiGopSize >> 1);
     }
   } else {
-    iLTRRefNum = bEnableLongTermReference ? WELS_CLIP3 (pCodingParam.iLTRRefNum, 1, LONG_TERM_REF_NUM) : 0;
+    iLTRRefNum = bEnableLongTermReference ? LONG_TERM_REF_NUM : 0;
     if (iNumRefFrame == AUTO_REF_PIC_COUNT) {
       iNumRefFrame		= ((uiGopSize >> 1) > 1) ? ((uiGopSize >> 1) + iLTRRefNum) : (MIN_REF_PIC_COUNT + iLTRRefNum);
       iNumRefFrame		= WELS_CLIP3 (iNumRefFrame, MIN_REF_PIC_COUNT, MAX_REFERENCE_PICTURE_COUNT_NUM);
--- a/codec/encoder/plus/src/welsEncoderExt.cpp
+++ b/codec/encoder/plus/src/welsEncoderExt.cpp
@@ -355,7 +355,7 @@
   }
   if (pCfg->iUsageType == SCREEN_CONTENT_REAL_TIME) {
     if (pCfg->bEnableLongTermReference) {
-      pCfg->iLTRRefNum = WELS_CLIP3 (pCfg->iLTRRefNum, 1, LONG_TERM_REF_NUM_SCREEN);
+      pCfg->iLTRRefNum = LONG_TERM_REF_NUM_SCREEN;
       if (pCfg->iNumRefFrame == AUTO_REF_PIC_COUNT)
         pCfg->iNumRefFrame = WELS_MAX (1, WELS_LOG2 (pCfg->uiGopSize)) + pCfg->iLTRRefNum;
     } else {
@@ -364,7 +364,7 @@
         pCfg->iNumRefFrame = WELS_MAX (1, pCfg->uiGopSize >> 1);
     }
   } else {
-    pCfg->iLTRRefNum = pCfg->bEnableLongTermReference ? WELS_CLIP3 (pCfg->iLTRRefNum, 1, LONG_TERM_REF_NUM) : 0;
+    pCfg->iLTRRefNum = pCfg->bEnableLongTermReference ? LONG_TERM_REF_NUM : 0;
     if (pCfg->iNumRefFrame == AUTO_REF_PIC_COUNT) {
       pCfg->iNumRefFrame		= ((pCfg->uiGopSize >> 1) > 1) ? ((pCfg->uiGopSize >> 1) + pCfg->iLTRRefNum) :
                               (MIN_REF_PIC_COUNT + pCfg->iLTRRefNum);