shithub: openh264

Download patch

ref: 7632510209e6cb242dcc0fa4a47a221ac72ad00c
parent: f62492716fff8cabd79fb62e95c1554ccd94ec2c
parent: 014f4d8250a607f6afa108d655aaa6b8e0cf9255
author: Ethan Hugg <[email protected]>
date: Fri Mar 7 04:17:03 EST 2014

Merge pull request #450 from mstorsjo/publish-slice-mode-enum

Move the slice mode enum to the public API

--- a/codec/api/svc/codec_app_def.h
+++ b/codec/api/svc/codec_app_def.h
@@ -153,13 +153,16 @@
     unsigned int		uiSliceSizeConstraint;
   } SSliceArgument;//not all the elements in this argument will be used, how it will be used depends on uiSliceMode; see below
 
-typedef struct {
+typedef enum {
+  SM_SINGLE_SLICE         = 0, //	| SliceNum==1
+  SM_FIXEDSLCNUM_SLICE    = 1, //	| according to SliceNum		| Enabled dynamic slicing for multi-thread
+  SM_RASTER_SLICE         = 2, //	| according to SlicesAssign	| Need input of MB numbers each slice. In addition, if other constraint in SSliceArgument is presented, need to follow the constraints. Typically if MB num and slice size are both constrained, re-encoding may be involved.
+  SM_ROWMB_SLICE          = 3, //	| according to PictureMBHeight	| Typical of single row of mbs each slice?+ slice size constraint which including re-encoding
+  SM_DYN_SLICE            = 4, //	| according to SliceSize	| Dynamic slicing (have no idea about slice_nums until encoding current frame)
+  SM_RESERVED             = 5
+} SliceModeEnum;
 
-  //# 0 SM_SINGLE_SLICE			| SliceNum==1
-  //# 1 SM_FIXEDSLCNUM_SLICE	| according to SliceNum			| Enabled dynamic slicing for multi-thread
-  //# 2 SM_RASTER_SLICE			| according to SlicesAssign		| Need input of MB numbers each slice. In addition, if other constraint in SSliceArgument is presented, need to follow the constraints. Typically if MB num and slice size are both constrained, re-encoding may be involved.
-  //# 3 SM_ROWMB_SLICE			| according to PictureMBHeight	|  Typical of single row of mbs each slice?+ slice size constraint which including re-encoding
-  //# 4 SM_DYN_SLICE			| according to SliceSize		| Dynamic slicing (have no idea about slice_nums until encoding current frame)
+typedef struct {
   unsigned int uiSliceMode; //by default, uiSliceMode will be 0
   SSliceArgument sSliceArgument;
 } SSliceConfig;
--- a/codec/encoder/core/inc/svc_enc_slice_segment.h
+++ b/codec/encoder/core/inc/svc_enc_slice_segment.h
@@ -51,14 +51,6 @@
  * \brief	SSlice mode
  */
 typedef uint16_t SliceMode;
-typedef enum {
-SM_SINGLE_SLICE         = 0,
-SM_FIXEDSLCNUM_SLICE	= 1,
-SM_RASTER_SLICE			= 2,
-SM_ROWMB_SLICE			= 3,
-SM_DYN_SLICE			= 4,
-SM_RESERVED				= 5
-} SliceModeEnum;
 
 
 // NOTE:
--- a/test/BaseEncoderTest.cpp
+++ b/test/BaseEncoderTest.cpp
@@ -33,7 +33,7 @@
     param.sSpatialLayers[0].fFrameRate = frameRate;
     param.sSpatialLayers[0].iSpatialBitrate = param.iTargetBitrate;
 
-    param.sSpatialLayers[0].sSliceCfg.uiSliceMode = 3; // One slice per MB row
+    param.sSpatialLayers[0].sSliceCfg.uiSliceMode = SM_ROWMB_SLICE;
 
     return encoder->InitializeExt(&param);
   }