shithub: openh264

Download patch

ref: 51d8682139dda35fb5bd390b12a2a8e23671ddc1
parent: 6e8fceb0c7c380210e5c9a56e03a6ec4fe79b65f
parent: f40b964526150d17040484c71b7d4cbf6062e65f
author: sijchen <sijchen@cisco.com>
date: Tue Jun 24 14:00:13 EDT 2014

Merge pull request #1003 from ruil2/subseq

Subseq

--- a/codec/api/svc/codec_app_def.h
+++ b/codec/api/svc/codec_app_def.h
@@ -247,19 +247,6 @@
   WELS_LOG_DEFAULT	= WELS_LOG_DEBUG	// Default log iLevel in Wels codec
 };
 
-typedef enum{
-  FRAMEIDC_IDR              = 0x00,
-  FRAMEIDC_I                = 0x04,
-  FRAMEIDC_LTR              = 0x08,
-  FRAMEIDC_T0               = 0x10,
-  FRAMEIDC_T1               = 0x11,
-  FRAMEIDC_T2               = 0x12,
-  FRAMEIDC_T3               = 0x13,
-  FRAMEIDC_T4               = 0x14,
-  FRAMEIDC_UNKNOWN          = 0x20,
-  FRAMEIDC_INVALID          = 0xFF,
-}EFrameIDC;
-
 typedef struct {
   SliceModeEnum uiSliceMode; //by default, uiSliceMode will be SM_SINGLE_SLICE
   SSliceArgument sSliceArgument;
@@ -376,8 +363,6 @@
   unsigned char uiSpatialId;
   unsigned char uiQualityId;
 
-  unsigned char uiPriorityId; //ignore it currently
-
   unsigned char uiLayerType;
 
   int	iNalCount;					// Count number of NAL coded already
@@ -388,12 +373,14 @@
 
 typedef struct {
   int		iTemporalId;	// Temporal ID
-  EFrameIDC	eFrameIdc;
+  //The sub sequence layers are ordered hierarchically based on their dependency on each other so that any picture in a layer shall not be
+  //predicted from any picture on any higher layer.
+  int	  iSubSeqId;  //refer to D.2.11 Sub-sequence information SEI message semantics
 
   int		iLayerNum;
   SLayerBSInfo	sLayerInfo[MAX_LAYER_NUM_OF_FRAME];
 
-  EVideoFrameType eOutputFrameType;
+  EVideoFrameType eFrameType;
   long long uiTimeStamp;
 } SFrameBSInfo, *PFrameBSInfo;
 
--- a/codec/console/enc/src/welsenc.cpp
+++ b/codec/console/enc/src/welsenc.cpp
@@ -805,7 +805,7 @@
     iTotal += WelsTime() - iStart;
 
     // fixed issue in case dismatch source picture introduced by frame skipped, 1/12/2010
-    if (videoFrameTypeSkip == sFbi.eOutputFrameType) {
+    if (videoFrameTypeSkip == sFbi.eFrameType) {
       continue;
     }
 
--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -2885,7 +2885,6 @@
   int32_t iReturn = WelsWriteParameterSets (pCtx, &pLayerBsInfo->pNalLengthInByte[0], &iCountNal);
   WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)
 
-  pLayerBsInfo->uiPriorityId  = 0;
   pLayerBsInfo->uiSpatialId   = 0;
   pLayerBsInfo->uiTemporalId  = 0;
   pLayerBsInfo->uiQualityId   = 0;
@@ -2948,13 +2947,13 @@
   iSpatialNum = pCtx->pVpp->BuildSpatialPicList (pCtx, pSrcPic);
   if (iSpatialNum < 1) {	// skip due to temporal layer settings (different frame rate)
     ++ pCtx->iCodingIndex;
-    pFbi->eOutputFrameType = videoFrameTypeSkip;
+    pFbi->eFrameType = videoFrameTypeSkip;
     return ENC_RETURN_SUCCESS;
   }
 
   eFrameType = DecideFrameType (pCtx, iSpatialNum);
   if (eFrameType == videoFrameTypeSkip) {
-    pFbi->eOutputFrameType = eFrameType;
+    pFbi->eFrameType = eFrameType;
     return ENC_RETURN_SUCCESS;
   }
 
@@ -2969,7 +2968,7 @@
       }
     }
     if (true == bSkipMustFlag) {
-      pFbi->eOutputFrameType = videoFrameTypeSkip;
+      pFbi->eFrameType = videoFrameTypeSkip;
       return ENC_RETURN_SUCCESS;
     }
   }
@@ -2992,7 +2991,6 @@
     pCtx->iEncoderError = WelsWriteParameterSets (pCtx, &pLayerBsInfo->pNalLengthInByte[0], &iCountNal);
     WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)
 
-    pLayerBsInfo->uiPriorityId	= 0;
     pLayerBsInfo->uiSpatialId		= 0;
     pLayerBsInfo->uiTemporalId	= 0;
     pLayerBsInfo->uiQualityId		= 0;
@@ -3095,7 +3093,7 @@
       WelsLog (pCtx, WELS_LOG_WARNING,
                "WelsEncoderEncodeExt(), WelsBuildRefList failed for P frames, pCtx->iNumRef0= %d. ForceCodingIDR!\n",
                pCtx->iNumRef0);
-      pFbi->eOutputFrameType = videoFrameTypeIDR;
+      pFbi->eFrameType = videoFrameTypeIDR;
       pCtx->iEncoderError = ENC_RETURN_CORRECTED;
       return ENC_RETURN_CORRECTED;
     }
@@ -3150,7 +3148,6 @@
       pLayerBsInfo->uiSpatialId		= iCurDid;
       pLayerBsInfo->uiTemporalId	= iCurTid;
       pLayerBsInfo->uiQualityId		= 0;
-      pLayerBsInfo->uiPriorityId	= 0;
       pLayerBsInfo->iNalCount		= ++ iNalIdxInLayer;
     }
     // for dynamic slicing single threading..
@@ -3336,7 +3333,6 @@
         pLayerBsInfo->uiSpatialId		= iCurDid;
         pLayerBsInfo->uiTemporalId	= iCurTid;
         pLayerBsInfo->uiQualityId		= 0;
-        pLayerBsInfo->uiPriorityId	= 0;
         pLayerBsInfo->iNalCount		= iNalIdxInLayer;
       }
     }
@@ -3360,7 +3356,7 @@
         ForceCodingIDR (pCtx);
         WelsLog (pCtx, WELS_LOG_WARNING, "WelsEncoderEncodeExt(), WelsUpdateRefList failed. ForceCodingIDR!\n");
         //the above is to set the next frame to be IDR
-        pFbi->eOutputFrameType = eFrameType;
+        pFbi->eFrameType = eFrameType;
         return ENC_RETURN_CORRECTED;
       }
     }
@@ -3474,7 +3470,6 @@
 
       pCtx->pWelsSvcRc[pCtx->uiDependencyId].iPaddingSize = 0;
 
-      pLayerBsInfo->uiPriorityId	= 0;
       pLayerBsInfo->uiSpatialId		= 0;
       pLayerBsInfo->uiTemporalId	= 0;
       pLayerBsInfo->uiQualityId		= 0;
@@ -3512,7 +3507,7 @@
       ForceCodingIDR (pCtx);
       WelsLog (pCtx, WELS_LOG_WARNING, "WelsEncoderEncodeExt(), Logic Error Found in temporal level. ForceCodingIDR!\n");
       //the above is to set the next frame IDR
-      pFbi->eOutputFrameType = eFrameType;
+      pFbi->eFrameType = eFrameType;
       return ENC_RETURN_CORRECTED;
     }
 
@@ -3548,7 +3543,7 @@
 
   WelsEmms();
 
-  pFbi->eOutputFrameType = eFrameType;
+  pFbi->eFrameType = eFrameType;
   return ENC_RETURN_SUCCESS;
 }
 
@@ -3939,7 +3934,6 @@
   pLayerBsInfo->uiSpatialId		= pCtx->uiDependencyId;
   pLayerBsInfo->uiTemporalId	= pCtx->uiTemporalId;
   pLayerBsInfo->uiQualityId		= 0;
-  pLayerBsInfo->uiPriorityId	= 0;
   pLayerBsInfo->iNalCount		= iNalIdxInLayer;
 
   return ENC_RETURN_SUCCESS;
--- a/codec/encoder/core/src/slice_multi_threading.cpp
+++ b/codec/encoder/core/src/slice_multi_threading.cpp
@@ -634,7 +634,6 @@
     pLbi->uiSpatialId		= pNalHdrExt->uiDependencyId;
     pLbi->uiTemporalId	= pNalHdrExt->uiTemporalId;
     pLbi->uiQualityId		= 0;
-    pLbi->uiPriorityId	= 0;
     pLbi->iNalCount		= kiNalCnt;
   } else {
     pLbi->iNalCount		+= kiNalCnt;
--- a/module/gmp-openh264.cpp
+++ b/module/gmp-openh264.cpp
@@ -360,7 +360,7 @@
     GMPVideoFrameType encoded_type;
     bool has_frame = false;
 
-    switch (encoded.eOutputFrameType) {
+    switch (encoded.eFrameType) {
     case videoFrameTypeIDR:
       encoded_type = kGMPKeyFrame;
       has_frame = true;
@@ -379,7 +379,7 @@
     case videoFrameTypeIPMixed://this type is currently not suppported
     case videoFrameTypeInvalid:
       GMPLOG (GL_ERROR, "Couldn't encode frame. Type = "
-              << encoded.eOutputFrameType);
+              << encoded.eFrameType);
       break;
     default:
       // The API is defined as returning a type.
--- a/test/api/BaseEncoderTest.cpp
+++ b/test/api/BaseEncoderTest.cpp
@@ -96,7 +96,7 @@
   while (in->read(buf.data(), frameSize) == frameSize) {
     rv = encoder_->EncodeFrame(&pic, &info);
     ASSERT_TRUE(rv == cmResultSuccess);
-    if (info.eOutputFrameType != videoFrameTypeSkip && cbk != NULL) {
+    if (info.eFrameType != videoFrameTypeSkip && cbk != NULL) {
       cbk->onEncodeFrame(info);
     }
   }