summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMamadou DIOP <bossiel@yahoo.fr>2016-04-14 04:14:50 +0200
committerMamadou DIOP <bossiel@yahoo.fr>2016-04-14 04:14:50 +0200
commitaff961eb2374344cb9a62cd9c4f0fae1edf4dbc0 (patch)
tree90e219b9d9b7a168b39895b4a8d02501de5b48bc
parent83dd953a88401f53489f521cf5bcc45e17c135e8 (diff)
downloaddoubango-aff961eb2374344cb9a62cd9c4f0fae1edf4dbc0.zip
doubango-aff961eb2374344cb9a62cd9c4f0fae1edf4dbc0.tar.gz
Update openh264 to version v1.5.0
Fix openh264 crash when resolution change and SPS/PPS loss
-rwxr-xr-xthirdparties/android/armv5te/lib/dist/libcommon.abin63606 -> 118724 bytes
-rwxr-xr-xthirdparties/android/armv5te/lib/dist/libdecoder.abin252532 -> 341576 bytes
-rwxr-xr-xthirdparties/android/armv5te/lib/dist/libencoder.abin473272 -> 528258 bytes
-rwxr-xr-xthirdparties/android/armv5te/lib/dist/libopenh264.abin941112 -> 1124314 bytes
-rwxr-xr-xthirdparties/android/armv5te/lib/dist/libprocessing.abin152100 -> 136158 bytes
-rwxr-xr-xthirdparties/android/armv7-a-neon/lib/dist/libcommon.abin65174 -> 112548 bytes
-rwxr-xr-xthirdparties/android/armv7-a-neon/lib/dist/libdecoder.abin253132 -> 334668 bytes
-rwxr-xr-xthirdparties/android/armv7-a-neon/lib/dist/libencoder.abin464436 -> 508622 bytes
-rwxr-xr-xthirdparties/android/armv7-a-neon/lib/dist/libopenh264.abin934278 -> 1089418 bytes
-rwxr-xr-xthirdparties/android/armv7-a-neon/lib/dist/libprocessing.abin151934 -> 133982 bytes
-rwxr-xr-xthirdparties/android/armv7-a/lib/dist/libcommon.abin65174 -> 112548 bytes
-rwxr-xr-xthirdparties/android/armv7-a/lib/dist/libdecoder.abin253132 -> 334668 bytes
-rwxr-xr-xthirdparties/android/armv7-a/lib/dist/libencoder.abin464436 -> 508622 bytes
-rwxr-xr-xthirdparties/android/armv7-a/lib/dist/libopenh264.abin934278 -> 1089418 bytes
-rwxr-xr-xthirdparties/android/armv7-a/lib/dist/libprocessing.abin151934 -> 133982 bytes
-rwxr-xr-xthirdparties/android/x86/lib/dist/libcommon.abin101326 -> 232146 bytes
-rwxr-xr-xthirdparties/android/x86/lib/dist/libdecoder.abin322024 -> 387890 bytes
-rwxr-xr-xthirdparties/android/x86/lib/dist/libencoder.abin558386 -> 613196 bytes
-rwxr-xr-xthirdparties/android/x86/lib/dist/libopenh264.abin1155210 -> 1405382 bytes
-rwxr-xr-xthirdparties/android/x86/lib/dist/libprocessing.abin173870 -> 172548 bytes
-rwxr-xr-xthirdparties/common/include/wels/codec_api.h602
-rwxr-xr-xthirdparties/common/include/wels/codec_app_def.h808
-rwxr-xr-xthirdparties/common/include/wels/codec_def.h249
-rwxr-xr-xthirdparties/iphone/lib/universal/libcommon.abin318960 -> 703896 bytes
-rwxr-xr-xthirdparties/iphone/lib/universal/libdecoder.abin1349416 -> 1552712 bytes
-rwxr-xr-xthirdparties/iphone/lib/universal/libencoder.abin2472752 -> 2593976 bytes
-rwxr-xr-xthirdparties/iphone/lib/universal/libopenh264.abin4669136 -> 5398736 bytes
-rwxr-xr-xthirdparties/iphone/lib/universal/libprocessing.abin529832 -> 549984 bytes
-rwxr-xr-xthirdparties/win32/bin/openh264/openh264.dllbin481792 -> 0 bytes
-rwxr-xr-xthirdparties/win32/lib/openh264/common.libbin242654 -> 347740 bytes
-rwxr-xr-xthirdparties/win32/lib/openh264/console_common.libbin75974 -> 76502 bytes
-rwxr-xr-xthirdparties/win32/lib/openh264/decoder.libbin895142 -> 1052584 bytes
-rwxr-xr-xthirdparties/win32/lib/openh264/encoder.libbin1660690 -> 1859134 bytes
-rwxr-xr-xthirdparties/win32/lib/openh264/openh264.libbin3537732 -> 3923606 bytes
-rwxr-xr-xthirdparties/win32/lib/openh264/openh264_dll.libbin2446 -> 0 bytes
-rwxr-xr-xthirdparties/win32/lib/openh264/processing.libbin740088 -> 665242 bytes
-rwxr-xr-xtinyDAV/src/codecs/h264/tdav_codec_h264_cisco.cxx10
37 files changed, 1155 insertions, 514 deletions
diff --git a/thirdparties/android/armv5te/lib/dist/libcommon.a b/thirdparties/android/armv5te/lib/dist/libcommon.a
index 2f1ca21..54f2eb4 100755
--- a/thirdparties/android/armv5te/lib/dist/libcommon.a
+++ b/thirdparties/android/armv5te/lib/dist/libcommon.a
Binary files differ
diff --git a/thirdparties/android/armv5te/lib/dist/libdecoder.a b/thirdparties/android/armv5te/lib/dist/libdecoder.a
index aa0418d..0c005b5 100755
--- a/thirdparties/android/armv5te/lib/dist/libdecoder.a
+++ b/thirdparties/android/armv5te/lib/dist/libdecoder.a
Binary files differ
diff --git a/thirdparties/android/armv5te/lib/dist/libencoder.a b/thirdparties/android/armv5te/lib/dist/libencoder.a
index ac2a149..f985cf5 100755
--- a/thirdparties/android/armv5te/lib/dist/libencoder.a
+++ b/thirdparties/android/armv5te/lib/dist/libencoder.a
Binary files differ
diff --git a/thirdparties/android/armv5te/lib/dist/libopenh264.a b/thirdparties/android/armv5te/lib/dist/libopenh264.a
index a9cbd71..ce4ef24 100755
--- a/thirdparties/android/armv5te/lib/dist/libopenh264.a
+++ b/thirdparties/android/armv5te/lib/dist/libopenh264.a
Binary files differ
diff --git a/thirdparties/android/armv5te/lib/dist/libprocessing.a b/thirdparties/android/armv5te/lib/dist/libprocessing.a
index bc2f452..cd47d36 100755
--- a/thirdparties/android/armv5te/lib/dist/libprocessing.a
+++ b/thirdparties/android/armv5te/lib/dist/libprocessing.a
Binary files differ
diff --git a/thirdparties/android/armv7-a-neon/lib/dist/libcommon.a b/thirdparties/android/armv7-a-neon/lib/dist/libcommon.a
index 3f2cbb0..dfb9ec7 100755
--- a/thirdparties/android/armv7-a-neon/lib/dist/libcommon.a
+++ b/thirdparties/android/armv7-a-neon/lib/dist/libcommon.a
Binary files differ
diff --git a/thirdparties/android/armv7-a-neon/lib/dist/libdecoder.a b/thirdparties/android/armv7-a-neon/lib/dist/libdecoder.a
index 05f9602..f0655e3 100755
--- a/thirdparties/android/armv7-a-neon/lib/dist/libdecoder.a
+++ b/thirdparties/android/armv7-a-neon/lib/dist/libdecoder.a
Binary files differ
diff --git a/thirdparties/android/armv7-a-neon/lib/dist/libencoder.a b/thirdparties/android/armv7-a-neon/lib/dist/libencoder.a
index 4beacb2..fc77d04 100755
--- a/thirdparties/android/armv7-a-neon/lib/dist/libencoder.a
+++ b/thirdparties/android/armv7-a-neon/lib/dist/libencoder.a
Binary files differ
diff --git a/thirdparties/android/armv7-a-neon/lib/dist/libopenh264.a b/thirdparties/android/armv7-a-neon/lib/dist/libopenh264.a
index c147cbd..fb99049 100755
--- a/thirdparties/android/armv7-a-neon/lib/dist/libopenh264.a
+++ b/thirdparties/android/armv7-a-neon/lib/dist/libopenh264.a
Binary files differ
diff --git a/thirdparties/android/armv7-a-neon/lib/dist/libprocessing.a b/thirdparties/android/armv7-a-neon/lib/dist/libprocessing.a
index 4f355b0..620233f 100755
--- a/thirdparties/android/armv7-a-neon/lib/dist/libprocessing.a
+++ b/thirdparties/android/armv7-a-neon/lib/dist/libprocessing.a
Binary files differ
diff --git a/thirdparties/android/armv7-a/lib/dist/libcommon.a b/thirdparties/android/armv7-a/lib/dist/libcommon.a
index 3f2cbb0..dfb9ec7 100755
--- a/thirdparties/android/armv7-a/lib/dist/libcommon.a
+++ b/thirdparties/android/armv7-a/lib/dist/libcommon.a
Binary files differ
diff --git a/thirdparties/android/armv7-a/lib/dist/libdecoder.a b/thirdparties/android/armv7-a/lib/dist/libdecoder.a
index 05f9602..f0655e3 100755
--- a/thirdparties/android/armv7-a/lib/dist/libdecoder.a
+++ b/thirdparties/android/armv7-a/lib/dist/libdecoder.a
Binary files differ
diff --git a/thirdparties/android/armv7-a/lib/dist/libencoder.a b/thirdparties/android/armv7-a/lib/dist/libencoder.a
index 4beacb2..fc77d04 100755
--- a/thirdparties/android/armv7-a/lib/dist/libencoder.a
+++ b/thirdparties/android/armv7-a/lib/dist/libencoder.a
Binary files differ
diff --git a/thirdparties/android/armv7-a/lib/dist/libopenh264.a b/thirdparties/android/armv7-a/lib/dist/libopenh264.a
index c147cbd..fb99049 100755
--- a/thirdparties/android/armv7-a/lib/dist/libopenh264.a
+++ b/thirdparties/android/armv7-a/lib/dist/libopenh264.a
Binary files differ
diff --git a/thirdparties/android/armv7-a/lib/dist/libprocessing.a b/thirdparties/android/armv7-a/lib/dist/libprocessing.a
index 4f355b0..620233f 100755
--- a/thirdparties/android/armv7-a/lib/dist/libprocessing.a
+++ b/thirdparties/android/armv7-a/lib/dist/libprocessing.a
Binary files differ
diff --git a/thirdparties/android/x86/lib/dist/libcommon.a b/thirdparties/android/x86/lib/dist/libcommon.a
index 67992d5..aa9bcfb 100755
--- a/thirdparties/android/x86/lib/dist/libcommon.a
+++ b/thirdparties/android/x86/lib/dist/libcommon.a
Binary files differ
diff --git a/thirdparties/android/x86/lib/dist/libdecoder.a b/thirdparties/android/x86/lib/dist/libdecoder.a
index 55b2297..10cfbc5 100755
--- a/thirdparties/android/x86/lib/dist/libdecoder.a
+++ b/thirdparties/android/x86/lib/dist/libdecoder.a
Binary files differ
diff --git a/thirdparties/android/x86/lib/dist/libencoder.a b/thirdparties/android/x86/lib/dist/libencoder.a
index 5a0fa53..3fec408 100755
--- a/thirdparties/android/x86/lib/dist/libencoder.a
+++ b/thirdparties/android/x86/lib/dist/libencoder.a
Binary files differ
diff --git a/thirdparties/android/x86/lib/dist/libopenh264.a b/thirdparties/android/x86/lib/dist/libopenh264.a
index f531779..538b9a3 100755
--- a/thirdparties/android/x86/lib/dist/libopenh264.a
+++ b/thirdparties/android/x86/lib/dist/libopenh264.a
Binary files differ
diff --git a/thirdparties/android/x86/lib/dist/libprocessing.a b/thirdparties/android/x86/lib/dist/libprocessing.a
index 4ce69dc..db66fe7 100755
--- a/thirdparties/android/x86/lib/dist/libprocessing.a
+++ b/thirdparties/android/x86/lib/dist/libprocessing.a
Binary files differ
diff --git a/thirdparties/common/include/wels/codec_api.h b/thirdparties/common/include/wels/codec_api.h
index f7347f6..6ac6ae4 100755
--- a/thirdparties/common/include/wels/codec_api.h
+++ b/thirdparties/common/include/wels/codec_api.h
@@ -1,4 +1,6 @@
/*!
+ *@page License
+ *
* \copy
* Copyright (c) 2013, Cisco Systems
* All rights reserved.
@@ -34,7 +36,7 @@
#define WELS_VIDEO_CODEC_SVC_API_H__
#ifndef __cplusplus
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && (_MSC_VER < 1800)
typedef unsigned char bool;
#else
#include <stdbool.h>
@@ -50,88 +52,406 @@ typedef unsigned char bool;
#define EXTAPI
#endif
+/**
+ * @file codec_api.h
+*/
+
+/**
+ * @page Overview
+ * * This page is for openh264 codec API usage.
+ * * For how to use the encoder,please refer to page UsageExampleForEncoder
+ * * For how to use the decoder,please refer to page UsageExampleForDecoder
+ * * For more detail about ISVEncoder,please refer to page ISVCEnoder
+ * * For more detail about ISVDecoder,please refer to page ISVCDecoder
+*/
+
+/**
+ * @page DecoderUsageExample
+ *
+ * @brief
+ * * An example for using the decoder for Decoding only or Parsing only
+ *
+ * Step 1:decoder declaration
+ * @code
+ *
+ * //decoder declaration
+ * ISVCDecoder *pSvcDecoder;
+ * //input: encoded bitstream start position; should include start code prefix
+ * unsigned char *pBuf =...;
+ * //input: encoded bit stream length; should include the size of start code prefix
+ * int iSize =...;
+ * //output: [0~2] for Y,U,V buffer for Decoding only
+ * unsigned char *pData[3] =...;
+ * //in-out: for Decoding only: declare and initialize the output buffer info, this should never co-exist with Parsing only
+ * SBufferInfo sDstBufInfo;
+ * memset(&sDstBufInfo, 0, sizeof(SBufferInfo));
+ * //in-out: for Parsing only: declare and initialize the output bitstream buffer info for parse only, this should never co-exist with Decoding only
+ * SParserBsInfo sDstParseInfo;
+ * memset(&sDstParseInfo, 0, sizeof(SParserBsInfo));
+ * sDstParseInfo.pDstBuff = new unsigned char[PARSE_SIZE]; //In Parsing only, allocate enough buffer to save transcoded bitstream for a frame
+ *
+ * @endcode
+ *
+ * Step 2:decoder creation
+ * @code
+ * CreateDecoder(pSvcDecoder);
+ * @endcode
+ *
+ * Step 3:declare required parameter, used to differentiate Decoding only and Parsing only
+ * @code
+ * SDecodingParam sDecParam = {0};
+ * sDecParam.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_AVC;
+ * //for Parsing only, the assignment is mandatory
+ * sDecParam.bParseOnly = true;
+ * @endcode
+ *
+ * Step 4:initialize the parameter and decoder context, allocate memory
+ * @code
+ * Initialize(&sDecParam);
+ * @endcode
+ *
+ * Step 5:do actual decoding process in slice level;
+ * this can be done in a loop until data ends
+ * @code
+ * //for Decoding only
+ * iRet = DecodeFrameNoDelay(pBuf, iSize, pData, &sDstBufInfo);
+ * //or
+ * iRet = DecodeFrame2(pBuf, iSize, pData, &sDstBufInfo);
+ * //for Parsing only
+ * iRet = DecodeParser(pBuf, iSize, &sDstParseInfo);
+ * //decode failed
+ * If (iRet != 0){
+ * RequestIDR or something like that.
+ * }
+ * //for Decoding only, pData can be used for render.
+ * if (sDstBufInfo.iBufferStatus==1){
+ * output pData[0], pData[1], pData[2];
+ * }
+ * //for Parsing only, sDstParseInfo can be used for, e.g., HW decoding
+ * if (sDstBufInfo.iNalNum > 0){
+ * Hardware decoding sDstParseInfo;
+ * }
+ * //no-delay decoding can be realized by directly calling DecodeFrameNoDelay(), which is the recommended usage.
+ * //no-delay decoding can also be realized by directly calling DecodeFrame2() again with NULL input, as in the following. In this case, decoder would immediately reconstruct the input data. This can also be used similarly for Parsing only. Consequent decoding error and output indication should also be considered as above.
+ * iRet = DecodeFrame2(NULL, 0, pData, &sDstBufInfo);
+ * judge iRet, sDstBufInfo.iBufferStatus ...
+ * @endcode
+ *
+ * Step 6:uninitialize the decoder and memory free
+ * @code
+ * Uninitialize();
+ * @endcode
+ *
+ * Step 7:destroy the decoder
+ * @code
+ * DestroyDecoder();
+ * @endcode
+ *
+*/
+
+/**
+ * @page EncoderUsageExample1
+ *
+ * @brief
+ * * An example for using encoder with basic parameter
+ *
+ * Step1:setup encoder
+ * @code
+ * int rv = WelsCreateSVCEncoder (&encoder_);
+ * ASSERT_EQ (0, rv);
+ * ASSERT_TRUE (encoder_ != NULL);
+ * @endcode
+ *
+ * Step2:initilize with basic parameter
+ * @code
+ * SEncParamBase param;
+ * memset (&param, 0, sizeof (SEncParamBase));
+ * param.iUsageType = usageType;
+ * param.fMaxFrameRate = frameRate;
+ * param.iPicWidth = width;
+ * param.iPicHeight = height;
+ * param.iTargetBitrate = 5000000;
+ * encoder_->Initialize (&param);
+ * @endcode
+ *
+ * Step3:set option, set option during encoding process
+ * @code
+ * encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &g_LevelSetting);
+ * int videoFormat = videoFormatI420;
+ * encoder_->SetOption (ENCODER_OPTION_DATAFORMAT, &videoFormat);
+ * @endcode
+ *
+ * Step4: encode and store ouput bistream
+ * @code
+ * int frameSize = width * height * 3 / 2;
+ * BufferedData buf;
+ * buf.SetLength (frameSize);
+ * ASSERT_TRUE (buf.Length() == (size_t)frameSize);
+ * SFrameBSInfo info;
+ * memset (&info, 0, sizeof (SFrameBSInfo));
+ * SSourcePicture pic;
+ * memset (&pic, 0, sizeof (SsourcePicture));
+ * pic.iPicWidth = width;
+ * pic.iPicHeight = height;
+ * pic.iColorFormat = videoFormatI420;
+ * pic.iStride[0] = pic.iPicWidth;
+ * pic.iStride[1] = pic.iStride[2] = pic.iPicWidth >> 1;
+ * pic.pData[0] = buf.data();
+ * pic.pData[1] = pic.pData[0] + width * height;
+ * pic.pData[2] = pic.pData[1] + (width * height >> 2);
+ * for(int num = 0;num<total_num;num++) {
+ * //prepare input data
+ * rv = encoder_->EncodeFrame (&pic, &info);
+ * ASSERT_TRUE (rv == cmResultSuccess);
+ * if (info.eFrameType != videoFrameTypeSkip && cbk != NULL) {
+ * //output bitstream
+ * }
+ * }
+ * @endcode
+ *
+ * Step5:teardown encoder
+ * @code
+ * if (encoder_) {
+ * encoder_->Uninitialize();
+ * WelsDestroySVCEncoder (encoder_);
+ * }
+ * @endcode
+ *
+ */
+
+/**
+ * @page EncoderUsageExample2
+ *
+ * @brief
+ * * An example for using the encoder with extension parameter.
+ * * The same operation on Step 1,3,4,5 with Example-1
+ *
+ * Step 2:initialize with extension parameter
+ * @code
+ * SEncParamExt param;
+ * encoder->GetDefaultParams (&param);
+ * param.iUsageType = usageType;
+ * param.fMaxFrameRate = frameRate;
+ * param.iPicWidth = width;
+ * param.iPicHeight = height;
+ * param.iTargetBitrate = 5000000;
+ * param.bEnableDenoise = denoise;
+ * param.iSpatialLayerNum = layers;
+ * //SM_DYN_SLICE don't support multi-thread now
+ * if (sliceMode != SM_SINGLE_SLICE && sliceMode != SM_DYN_SLICE)
+ * param.iMultipleThreadIdc = 2;
+ *
+ * for (int i = 0; i < param.iSpatialLayerNum; i++) {
+ * param.sSpatialLayers[i].iVideoWidth = width >> (param.iSpatialLayerNum - 1 - i);
+ * param.sSpatialLayers[i].iVideoHeight = height >> (param.iSpatialLayerNum - 1 - i);
+ * param.sSpatialLayers[i].fFrameRate = frameRate;
+ * param.sSpatialLayers[i].iSpatialBitrate = param.iTargetBitrate;
+ *
+ * param.sSpatialLayers[i].sSliceCfg.uiSliceMode = sliceMode;
+ * if (sliceMode == SM_DYN_SLICE) {
+ * param.sSpatialLayers[i].sSliceCfg.sSliceArgument.uiSliceSizeConstraint = 600;
+ * param.uiMaxNalSize = 1500;
+ * }
+ * }
+ * param.iTargetBitrate *= param.iSpatialLayerNum;
+ * encoder_->InitializeExt (&param);
+ * int videoFormat = videoFormatI420;
+ * encoder_->SetOption (ENCODER_OPTION_DATAFORMAT, &videoFormat);
+ *
+ * @endcode
+ */
+
+
+
+
#ifdef __cplusplus
-class ISVCEncoder
-{
-public:
- /*
- * return: CM_RETURN: 0 - success; otherwise - failed;
- */
- virtual int EXTAPI Initialize (const SEncParamBase* pParam) = 0;
- virtual int EXTAPI InitializeExt (const SEncParamExt* pParam) = 0;
-
- virtual int EXTAPI GetDefaultParams (SEncParamExt* pParam) = 0;
-
- virtual int EXTAPI Uninitialize() = 0;
-
- /*
- * return: 0 - success; otherwise -failed;
- */
- virtual int EXTAPI EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo) = 0;
- /*
- * return: 0 - success; otherwise - failed;
- */
- virtual int EXTAPI EncodeParameterSets (SFrameBSInfo* pBsInfo) = 0;
-
- /*
- * return: 0 - success; otherwise - failed;
- */
- virtual int EXTAPI PauseFrame (const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo) = 0;
-
- /*
- * return: 0 - success; otherwise - failed;
- */
- virtual int EXTAPI ForceIntraFrame (bool bIDR) = 0;
-
- /************************************************************************
- * InDataFormat, IDRInterval, SVC Encode Param, Frame Rate, Bitrate,..
- ************************************************************************/
- /*
- * return: CM_RETURN: 0 - success; otherwise - failed;
- */
- virtual int EXTAPI SetOption (ENCODER_OPTION eOptionId, void* pOption) = 0;
- virtual int EXTAPI GetOption (ENCODER_OPTION eOptionId, void* pOption) = 0;
- virtual ~ISVCEncoder() {}
+/**
+* @brief Endocder definition
+*/
+class ISVCEncoder {
+ public:
+ /**
+ * @brief Initialize the encoder
+ * @param pParam basic encoder parameter
+ * @return CM_RETURN: 0 - success; otherwise - failed;
+ */
+ virtual int EXTAPI Initialize (const SEncParamBase* pParam) = 0;
+
+ /**
+ * @brief Initilaize encoder by using extension parameters.
+ * @param pParam extension parameter for encoder
+ * @return CM_RETURN: 0 - success; otherwise - failed;
+ */
+ virtual int EXTAPI InitializeExt (const SEncParamExt* pParam) = 0;
+
+ /**
+ * @brief Get the default extension parameters.
+ * If you want to change some parameters of encoder, firstly you need to get the default encoding parameters,
+ * after that you can change part of parameters you want to.
+ * @param pParam extension parameter for encoder
+ * @return CM_RETURN: 0 - success; otherwise - failed;
+ * */
+ virtual int EXTAPI GetDefaultParams (SEncParamExt* pParam) = 0;
+ /// uninitialize the encoder
+ virtual int EXTAPI Uninitialize() = 0;
+
+ /**
+ * @brief Encode one frame
+ * @param kpSrcPic the pointer to the source luminance plane
+ * chrominance data:
+ * CbData = kpSrc + m_iMaxPicWidth * m_iMaxPicHeight;
+ * CrData = CbData + (m_iMaxPicWidth * m_iMaxPicHeight)/4;
+ * the application calling this interface needs to ensure the data validation between the location
+ * @param pBsInfo output bit stream
+ * @return 0 - success; otherwise -failed;
+ */
+ virtual int EXTAPI EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo) = 0;
+
+ /**
+ * @brief Encode the parameters from output bit stream
+ * @param pBsInfo output bit stream
+ * @return 0 - success; otherwise - failed;
+ */
+ virtual int EXTAPI EncodeParameterSets (SFrameBSInfo* pBsInfo) = 0;
+
+ /**
+ * @brief Force encoder to encoder frame as IDR if bIDR set as true
+ * @param bIDR true: force encoder to encode frame as IDR frame;false, return 1 and nothing to do
+ * @return 0 - success; otherwise - failed;
+ */
+ virtual int EXTAPI ForceIntraFrame (bool bIDR) = 0;
+
+ /**
+ * @brief Set option for encoder, detail option type, please refer to enumurate ENCODER_OPTION.
+ * @param pOption option for encoder such as InDataFormat, IDRInterval, SVC Encode Param, Frame Rate, Bitrate,...
+ * @return CM_RETURN: 0 - success; otherwise - failed;
+ */
+ virtual int EXTAPI SetOption (ENCODER_OPTION eOptionId, void* pOption) = 0;
+
+ /**
+ * @brief Set option for encoder, detail option type, please refer to enumurate ENCODER_OPTION.
+ * @param pOption option for encoder such as InDataFormat, IDRInterval, SVC Encode Param, Frame Rate, Bitrate,...
+ * @return CM_RETURN: 0 - success; otherwise - failed;
+ */
+ virtual int EXTAPI GetOption (ENCODER_OPTION eOptionId, void* pOption) = 0;
+ virtual ~ISVCEncoder() {}
};
-class ISVCDecoder
-{
-public:
- virtual long EXTAPI Initialize (const SDecodingParam* pParam) = 0;
- virtual long EXTAPI Uninitialize() = 0;
-
- virtual DECODING_STATE EXTAPI DecodeFrame (const unsigned char* pSrc,
- const int iSrcLen,
- unsigned char** ppDst,
- int* pStride,
- int& iWidth,
- int& iHeight) = 0;
- /*
- * return: 0 - success; otherwise -failed;
- */
- virtual DECODING_STATE EXTAPI DecodeFrame2 (const unsigned char* pSrc,
- const int iSrcLen,
- unsigned char** ppDst,
- SBufferInfo* pDstInfo) = 0;
-
- /*
- * this API does not work for now!! This is for future use to support non-I420 color format output.
- */
- virtual DECODING_STATE EXTAPI DecodeFrameEx (const unsigned char* pSrc,
- const int iSrcLen,
- unsigned char* pDst,
- int iDstStride,
- int& iDstLen,
- int& iWidth,
- int& iHeight,
- int& iColorFormat) = 0;
-
- /*************************************************************************
- * OutDataFormat, Eos Flag, EC method, ...
- *************************************************************************/
- virtual long EXTAPI SetOption (DECODER_OPTION eOptionId, void* pOption) = 0;
- virtual long EXTAPI GetOption (DECODER_OPTION eOptionId, void* pOption) = 0;
- virtual ~ISVCDecoder() {}
+
+
+/**
+* @brief Decoder definition
+*/
+class ISVCDecoder {
+ public:
+
+ /**
+ * @brief Initilaize decoder
+ * @param pParam parameter for decoder
+ * @return 0 - success; otherwise - failed;
+ */
+ virtual long EXTAPI Initialize (const SDecodingParam* pParam) = 0;
+
+ /// Uninitialize the decoder
+ virtual long EXTAPI Uninitialize() = 0;
+
+ /**
+ * @brief Decode one frame
+ * @param pSrc the h264 stream to be decoded
+ * @param iSrcLen the length of h264 stream
+ * @param ppDst buffer pointer of decoded data (YUV)
+ * @param pStride output stride
+ * @param iWidth output width
+ * @param iHeight output height
+ * @return 0 - success; otherwise -failed;
+ */
+ virtual DECODING_STATE EXTAPI DecodeFrame (const unsigned char* pSrc,
+ const int iSrcLen,
+ unsigned char** ppDst,
+ int* pStride,
+ int& iWidth,
+ int& iHeight) = 0;
+
+/**
+ * @brief For slice level DecodeFrameNoDelay() (4 parameters input),
+ * whatever the function return value is, the output data
+ * of I420 format will only be available when pDstInfo->iBufferStatus == 1,.
+ * This function will parse and reconstruct the input frame immediately if it is complete
+ * It is recommended as the main decoding function for H.264/AVC format input
+ * @param pSrc the h264 stream to be decoded
+ * @param iSrcLen the length of h264 stream
+ * @param ppDst buffer pointer of decoded data (YUV)
+ * @param pDstInfo information provided to API(width, height, etc.)
+ * @return 0 - success; otherwise -failed;
+ */
+ virtual DECODING_STATE EXTAPI DecodeFrameNoDelay (const unsigned char* pSrc,
+ const int iSrcLen,
+ unsigned char** ppDst,
+ SBufferInfo* pDstInfo) = 0;
+
+ /**
+ * @brief For slice level DecodeFrame2() (4 parameters input),
+ * whatever the function return value is, the output data
+ * of I420 format will only be available when pDstInfo->iBufferStatus == 1,.
+ * (e.g., in multi-slice cases, only when the whole picture
+ * is completely reconstructed, this variable would be set equal to 1.)
+ * @param pSrc the h264 stream to be decoded
+ * @param iSrcLen the length of h264 stream
+ * @param ppDst buffer pointer of decoded data (YUV)
+ * @param pDstInfo information provided to API(width, height, etc.)
+ * @return 0 - success; otherwise -failed;
+ */
+ virtual DECODING_STATE EXTAPI DecodeFrame2 (const unsigned char* pSrc,
+ const int iSrcLen,
+ unsigned char** ppDst,
+ SBufferInfo* pDstInfo) = 0;
+
+ /**
+ * @brief This function parse input bitstream only, and rewrite possible SVC syntax to AVC syntax
+ * @param pSrc the h264 stream to be decoded
+ * @param iSrcLen the length of h264 stream
+ * @param pDstInfo bit stream info
+ * @return 0 - success; otherwise -failed;
+ */
+ virtual DECODING_STATE EXTAPI DecodeParser (const unsigned char* pSrc,
+ const int iSrcLen,
+ SParserBsInfo* pDstInfo) = 0;
+
+ /**
+ * @brief This API does not work for now!! This is for future use to support non-I420 color format output.
+ * @param pSrc the h264 stream to be decoded
+ * @param iSrcLen the length of h264 stream
+ * @param pDst buffer pointer of decoded data (YUV)
+ * @param iDstStride output stride
+ * @param iDstLen bit stream info
+ * @param iWidth output width
+ * @param iHeight output height
+ * @param iColorFormat output color format
+ * @return to do ...
+ */
+ virtual DECODING_STATE EXTAPI DecodeFrameEx (const unsigned char* pSrc,
+ const int iSrcLen,
+ unsigned char* pDst,
+ int iDstStride,
+ int& iDstLen,
+ int& iWidth,
+ int& iHeight,
+ int& iColorFormat) = 0;
+
+ /**
+ * @brief Set option for decoder, detail option type, please refer to enumurate DECODER_OPTION.
+ * @param pOption option for decoder such as OutDataFormat, Eos Flag, EC method, ...
+ * @return CM_RETURN: 0 - success; otherwise - failed;
+ */
+ virtual long EXTAPI SetOption (DECODER_OPTION eOptionId, void* pOption) = 0;
+
+ /**
+ * @brief Get option for decoder, detail option type, please refer to enumurate DECODER_OPTION.
+ * @param pOption option for decoder such as OutDataFormat, Eos Flag, EC method, ...
+ * @return CM_RETURN: 0 - success; otherwise - failed;
+ */
+ virtual long EXTAPI GetOption (DECODER_OPTION eOptionId, void* pOption) = 0;
+ virtual ~ISVCDecoder() {}
};
@@ -143,64 +463,112 @@ typedef struct ISVCEncoderVtbl ISVCEncoderVtbl;
typedef const ISVCEncoderVtbl* ISVCEncoder;
struct ISVCEncoderVtbl {
- int (*Initialize) (ISVCEncoder*, const SEncParamBase* pParam);
- int (*InitializeExt) (ISVCEncoder*, const SEncParamExt* pParam);
+int (*Initialize) (ISVCEncoder*, const SEncParamBase* pParam);
+int (*InitializeExt) (ISVCEncoder*, const SEncParamExt* pParam);
- int (*GetDefaultParams) (ISVCEncoder*, SEncParamExt* pParam);
+int (*GetDefaultParams) (ISVCEncoder*, SEncParamExt* pParam);
- int (*Uninitialize) (ISVCEncoder*);
+int (*Uninitialize) (ISVCEncoder*);
- int (*EncodeFrame) (ISVCEncoder*, const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo);
- int (*EncodeParameterSets) (ISVCEncoder*, SFrameBSInfo* pBsInfo);
+int (*EncodeFrame) (ISVCEncoder*, const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo);
+int (*EncodeParameterSets) (ISVCEncoder*, SFrameBSInfo* pBsInfo);
- int (*PauseFrame) (ISVCEncoder*, const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo);
+int (*ForceIntraFrame) (ISVCEncoder*, bool bIDR);
- int (*ForceIntraFrame) (ISVCEncoder*, bool bIDR);
-
- int (*SetOption) (ISVCEncoder*, ENCODER_OPTION eOptionId, void* pOption);
- int (*GetOption) (ISVCEncoder*, ENCODER_OPTION eOptionId, void* pOption);
+int (*SetOption) (ISVCEncoder*, ENCODER_OPTION eOptionId, void* pOption);
+int (*GetOption) (ISVCEncoder*, ENCODER_OPTION eOptionId, void* pOption);
};
typedef struct ISVCDecoderVtbl ISVCDecoderVtbl;
typedef const ISVCDecoderVtbl* ISVCDecoder;
struct ISVCDecoderVtbl {
- long (*Initialize) (ISVCDecoder*, const SDecodingParam* pParam);
- long (*Uninitialize) (ISVCDecoder*);
-
- DECODING_STATE (*DecodeFrame) (ISVCDecoder*, const unsigned char* pSrc,
- const int iSrcLen,
- unsigned char** ppDst,
- int* pStride,
- int* iWidth,
- int* iHeight);
-
- DECODING_STATE (*DecodeFrame2) (ISVCDecoder*, const unsigned char* pSrc,
- const int iSrcLen,
- unsigned char** ppDst,
- SBufferInfo* pDstInfo);
-
- DECODING_STATE (*DecodeFrameEx) (ISVCDecoder*, const unsigned char* pSrc,
- const int iSrcLen,
- unsigned char* pDst,
- int iDstStride,
- int* iDstLen,
- int* iWidth,
- int* iHeight,
- int* iColorFormat);
-
- long (*SetOption) (ISVCDecoder*, DECODER_OPTION eOptionId, void* pOption);
- long (*GetOption) (ISVCDecoder*, DECODER_OPTION eOptionId, void* pOption);
+long (*Initialize) (ISVCDecoder*, const SDecodingParam* pParam);
+long (*Uninitialize) (ISVCDecoder*);
+
+DECODING_STATE (*DecodeFrame) (ISVCDecoder*, const unsigned char* pSrc,
+ const int iSrcLen,
+ unsigned char** ppDst,
+ int* pStride,
+ int* iWidth,
+ int* iHeight);
+
+DECODING_STATE (*DecodeFrameNoDelay) (ISVCDecoder*, const unsigned char* pSrc,
+ const int iSrcLen,
+ unsigned char** ppDst,
+ SBufferInfo* pDstInfo);
+
+DECODING_STATE (*DecodeFrame2) (ISVCDecoder*, const unsigned char* pSrc,
+ const int iSrcLen,
+ unsigned char** ppDst,
+ SBufferInfo* pDstInfo);
+
+DECODING_STATE (*DecodeParser) (ISVCDecoder*, const unsigned char* pSrc,
+ const int iSrcLen,
+ SParserBsInfo* pDstInfo);
+
+DECODING_STATE (*DecodeFrameEx) (ISVCDecoder*, const unsigned char* pSrc,
+ const int iSrcLen,
+ unsigned char* pDst,
+ int iDstStride,
+ int* iDstLen,
+ int* iWidth,
+ int* iHeight,
+ int* iColorFormat);
+
+long (*SetOption) (ISVCDecoder*, DECODER_OPTION eOptionId, void* pOption);
+long (*GetOption) (ISVCDecoder*, DECODER_OPTION eOptionId, void* pOption);
};
#endif
typedef void (*WelsTraceCallback) (void* ctx, int level, const char* string);
+/** @brief Create encoder
+ * @param ppEncoder encoder
+ * @return 0 - success; otherwise - failed;
+*/
int WelsCreateSVCEncoder (ISVCEncoder** ppEncoder);
+
+
+/** @brief Destroy encoder
+* @param pEncoder encoder
+ * @return void
+*/
void WelsDestroySVCEncoder (ISVCEncoder* pEncoder);
+
+/** @brief Get the capability of decoder
+ * @param pDecCapability decoder capability
+ * @return 0 - success; otherwise - failed;
+*/
+int WelsGetDecoderCapability (SDecoderCapability* pDecCapability);
+
+
+/** @brief Create decoder
+ * @param ppDecoder decoder
+ * @return 0 - success; otherwise - failed;
+*/
long WelsCreateDecoder (ISVCDecoder** ppDecoder);
+
+
+/** @brief Destroy decoder
+ * @param pDecoder decoder
+ * @return void
+*/
void WelsDestroyDecoder (ISVCDecoder* pDecoder);
+/** @brief Get codec version
+ * Note, old versions of Mingw (GCC < 4.7) are buggy and use an
+ * incorrect/different ABI for calling this function, making it
+ * incompatible with MSVC builds.
+ * @return The linked codec version
+*/
+OpenH264Version WelsGetCodecVersion (void);
+
+/** @brief Get codec version
+ * @param pVersion struct to fill in with the version
+*/
+void WelsGetCodecVersionEx (OpenH264Version *pVersion);
+
#ifdef __cplusplus
}
#endif
diff --git a/thirdparties/common/include/wels/codec_app_def.h b/thirdparties/common/include/wels/codec_app_def.h
index 0e4c1cb..706f73a 100755
--- a/thirdparties/common/include/wels/codec_app_def.h
+++ b/thirdparties/common/include/wels/codec_app_def.h
@@ -30,394 +30,642 @@
*
*/
+
+
#ifndef WELS_VIDEO_CODEC_APPLICATION_DEFINITION_H__
#define WELS_VIDEO_CODEC_APPLICATION_DEFINITION_H__
-////////////////Data and /or structures introduced in Cisco OpenH264 application////////////////
+/**
+ * @file codec_app_def.h
+ * @brief Data and /or structures introduced in Cisco OpenH264 application
+*/
+
#include "codec_def.h"
/* Constants */
-#define MAX_TEMPORAL_LAYER_NUM 4
-#define MAX_SPATIAL_LAYER_NUM 4
-#define MAX_QUALITY_LAYER_NUM 4
+#define MAX_TEMPORAL_LAYER_NUM 4
+#define MAX_SPATIAL_LAYER_NUM 4
+#define MAX_QUALITY_LAYER_NUM 4
-#define MAX_LAYER_NUM_OF_FRAME 128
-#define MAX_NAL_UNITS_IN_LAYER 128 // predetermined here, adjust it later if need
+#define MAX_LAYER_NUM_OF_FRAME 128
+#define MAX_NAL_UNITS_IN_LAYER 128 ///< predetermined here, adjust it later if need
-#define MAX_RTP_PAYLOAD_LEN 1000
-#define AVERAGE_RTP_PAYLOAD_LEN 800
+#define MAX_RTP_PAYLOAD_LEN 1000
+#define AVERAGE_RTP_PAYLOAD_LEN 800
-#define SAVED_NALUNIT_NUM_TMP ( (MAX_SPATIAL_LAYER_NUM*MAX_QUALITY_LAYER_NUM) + 1 + MAX_SPATIAL_LAYER_NUM ) //SPS/PPS + SEI/SSEI + PADDING_NAL
-#define MAX_SLICES_NUM_TMP ( ( MAX_NAL_UNITS_IN_LAYER - SAVED_NALUNIT_NUM_TMP ) / 3 )
+#define SAVED_NALUNIT_NUM_TMP ( (MAX_SPATIAL_LAYER_NUM*MAX_QUALITY_LAYER_NUM) + 1 + MAX_SPATIAL_LAYER_NUM ) ///< SPS/PPS + SEI/SSEI + PADDING_NAL
+#define MAX_SLICES_NUM_TMP ( ( MAX_NAL_UNITS_IN_LAYER - SAVED_NALUNIT_NUM_TMP ) / 3 )
-#define AUTO_REF_PIC_COUNT -1 // encoder selects the number of reference frame automatically
+
+#define AUTO_REF_PIC_COUNT -1 ///< encoder selects the number of reference frame automatically
+#define UNSPECIFIED_BIT_RATE 0 ///< to do: add detail comment
+
+/**
+ * @brief Struct of OpenH264 version
+ */
+///
+/// E.g. SDK version is 1.2.0.0, major version number is 1, minor version number is 2, and revision number is 0.
+typedef struct _tagVersion {
+ unsigned int uMajor; ///< The major version number
+ unsigned int uMinor; ///< The minor version number
+ unsigned int uRevision; ///< The revision number
+ unsigned int uReserved; ///< The reserved number, it should be 0.
+} OpenH264Version;
+
+/**
+* @brief Decoding status
+*/
typedef enum {
- /* Errors derived from bitstream parsing */
- dsErrorFree = 0x00, /* Bitstream error-free */
- dsFramePending = 0x01, /* Need more throughput to generate a frame output, */
- dsRefLost = 0x02, /* layer lost at reference frame with temporal id 0 */
- dsBitstreamError = 0x04, /* Error bitstreams(maybe broken internal frame) the decoder cared */
- dsDepLayerLost = 0x08, /* Dependented layer is ever lost */
- dsNoParamSets = 0x10, /* No parameter set NALs involved */
- dsDataErrorConcealed = 0x20, /* current data Error concealed specified */
-
- /* Errors derived from logic level */
- dsInvalidArgument = 0x1000, /* Invalid argument specified */
- dsInitialOptExpected = 0x2000, /* Initializing operation is expected */
- dsOutOfMemory = 0x4000, /* Out of memory due to new request */
- /* ANY OTHERS? */
- dsDstBufNeedExpand = 0x8000 /* Actual picture size exceeds size of dst pBuffer feed in decoder, so need expand its size */
+ /**
+ * Errors derived from bitstream parsing
+ */
+ dsErrorFree = 0x00, ///< bit stream error-free
+ dsFramePending = 0x01, ///< need more throughput to generate a frame output,
+ dsRefLost = 0x02, ///< layer lost at reference frame with temporal id 0
+ dsBitstreamError = 0x04, ///< error bitstreams(maybe broken internal frame) the decoder cared
+ dsDepLayerLost = 0x08, ///< dependented layer is ever lost
+ dsNoParamSets = 0x10, ///< no parameter set NALs involved
+ dsDataErrorConcealed = 0x20, ///< current data error concealed specified
+
+ /**
+ * Errors derived from logic level
+ */
+ dsInvalidArgument = 0x1000, ///< invalid argument specified
+ dsInitialOptExpected = 0x2000, ///< initializing operation is expected
+ dsOutOfMemory = 0x4000, ///< out of memory due to new request
+ /**
+ * ANY OTHERS?
+ */
+ dsDstBufNeedExpan = 0x8000 ///< actual picture size exceeds size of dst pBuffer feed in decoder, so need expand its size
} DECODING_STATE;
-/* Option types introduced in SVC encoder application */
+/**
+* @brief Option types introduced in SVC encoder application
+*/
typedef enum {
- ENCODER_OPTION_DATAFORMAT = 0,
- ENCODER_OPTION_IDR_INTERVAL,
- ENCODER_OPTION_SVC_ENCODE_PARAM_BASE,
- ENCODER_OPTION_SVC_ENCODE_PARAM_EXT,
- ENCODER_OPTION_FRAME_RATE,
- ENCODER_OPTION_BITRATE,
- ENCODER_OPTION_MAX_BITRATE,
- ENCODER_OPTION_INTER_SPATIAL_PRED,
- ENCODER_OPTION_RC_MODE,
- ENCODER_PADDING_PADDING,
-
- ENCODER_OPTION_PROFILE,
- ENCODER_OPTION_LEVEL,
- ENCODER_OPTION_NUMBER_REF,
- ENCODER_OPTION_DELIVERY_STATUS,
-
- ENCODER_LTR_RECOVERY_REQUEST,
- ENCODER_LTR_MARKING_FEEDBACK,
- ENCOCER_LTR_MARKING_PERIOD,
- ENCODER_OPTION_LTR,
-
- ENCODER_OPTION_ENABLE_SSEI, //enable SSEI: true--enable ssei; false--disable ssei
- ENCODER_OPTION_ENABLE_PREFIX_NAL_ADDING, //enable prefix: true--enable prefix; false--disable prefix
- ENCODER_OPTION_ENABLE_SPS_PPS_ID_ADDITION, //enable pSps/pPps id addition: true--enable pSps/pPps id; false--disable pSps/pPps id addistion
-
- ENCODER_OPTION_CURRENT_PATH,
- ENCODER_OPTION_DUMP_FILE,
- ENCODER_OPTION_TRACE_LEVEL,
- ENCODER_OPTION_TRACE_CALLBACK, // a void (*)(void* context, int level, const char* message) function which receives log messages
- ENCODER_OPTION_TRACE_CALLBACK_CONTEXT,
+ ENCODER_OPTION_DATAFORMAT = 0,
+ ENCODER_OPTION_IDR_INTERVAL, ///< IDR period,0/-1 means no Intra period (only the first frame); lager than 0 means the desired IDR period, must be multiple of (2^temporal_layer)
+ ENCODER_OPTION_SVC_ENCODE_PARAM_BASE, ///< structure of Base Param
+ ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, ///< structure of Extension Param
+ ENCODER_OPTION_FRAME_RATE, ///< maximal input frame rate, current supported range: MAX_FRAME_RATE = 30,MIN_FRAME_RATE = 1
+ ENCODER_OPTION_BITRATE,
+ ENCODER_OPTION_MAX_BITRATE,
+ ENCODER_OPTION_INTER_SPATIAL_PRED,
+ ENCODER_OPTION_RC_MODE,
+ ENCODER_OPTION_RC_FRAME_SKIP,
+ ENCODER_PADDING_PADDING, ///< 0:disable padding;1:padding
+
+ ENCODER_OPTION_PROFILE, ///< assgin the profile for each layer
+ ENCODER_OPTION_LEVEL, ///< assgin the level for each layer
+ ENCODER_OPTION_NUMBER_REF, ///< the number of refererence frame
+ ENCODER_OPTION_DELIVERY_STATUS, ///< the delivery info which is a feedback from app level
+
+ ENCODER_LTR_RECOVERY_REQUEST,
+ ENCODER_LTR_MARKING_FEEDBACK,
+ ENCODER_LTR_MARKING_PERIOD,
+ ENCODER_OPTION_LTR, ///< 0:disable LTR;larger than 0 enable LTR; LTR number is fixed to be 2 in current encoder
+ ENCODER_OPTION_COMPLEXITY,
+
+ ENCODER_OPTION_ENABLE_SSEI, ///< enable SSEI: true--enable ssei; false--disable ssei
+ ENCODER_OPTION_ENABLE_PREFIX_NAL_ADDING, ///< enable prefix: true--enable prefix; false--disable prefix
+ ENCODER_OPTION_ENABLE_SPS_PPS_ID_ADDITION, ///< enable pSps/pPps id addition: true--enable pSps/pPps id; false--disable pSps/pPps id addistion
+
+ ENCODER_OPTION_CURRENT_PATH,
+ ENCODER_OPTION_DUMP_FILE, ///< dump layer reconstruct frame to a specified file
+ ENCODER_OPTION_TRACE_LEVEL, ///< trace info based on the trace level
+ ENCODER_OPTION_TRACE_CALLBACK, ///< a void (*)(void* context, int level, const char* message) function which receives log messages
+ ENCODER_OPTION_TRACE_CALLBACK_CONTEXT, ///< context info of trace callback
+
+ ENCODER_OPTION_GET_STATISTICS, ///< read only
+ ENCODER_OPTION_STATISTICS_LOG_INTERVAL, ///< log interval in millisecond
+
+ ENCODER_OPTION_IS_LOSSLESS_LINK, ///< advanced algorithmetic settings
+
+ ENCODER_OPTION_BITS_VARY_PERCENTAGE ///< bit vary percentage
} ENCODER_OPTION;
-/* Option types introduced in decoder application */
+/**
+* @brief Option types introduced in decoder application
+*/
typedef enum {
- DECODER_OPTION_DATAFORMAT = 0, /* Set color space of decoding output frame */
- DECODER_OPTION_END_OF_STREAM, /* Indicate bitstream of the final frame to be decoded */
- DECODER_OPTION_VCL_NAL, //feedback whether or not have VCL NAL in current AU for application layer
- DECODER_OPTION_TEMPORAL_ID, //feedback temporal id for application layer
- DECODER_OPTION_FRAME_NUM, //feedback current decoded frame number
- DECODER_OPTION_IDR_PIC_ID, // feedback current frame belong to which IDR period
- DECODER_OPTION_LTR_MARKING_FLAG, // feedback wether current frame mark a LTR
- DECODER_OPTION_LTR_MARKED_FRAME_NUM, // feedback frame num marked by current Frame
- DECODER_OPTION_ERROR_CON_IDC, //not finished yet, indicate decoder error concealment status, in progress
- DECODER_OPTION_TRACE_LEVEL,
- DECODER_OPTION_TRACE_CALLBACK, // a void (*)(void* context, int level, const char* message) function which receives log messages
- DECODER_OPTION_TRACE_CALLBACK_CONTEXT,
+ DECODER_OPTION_DATAFORMAT = 0, ///< color format, now supports 23 only (I420)
+ DECODER_OPTION_END_OF_STREAM, ///< end of stream flag
+ DECODER_OPTION_VCL_NAL, ///< feedback whether or not have VCL NAL in current AU for application layer
+ DECODER_OPTION_TEMPORAL_ID, ///< feedback temporal id for application layer
+ DECODER_OPTION_FRAME_NUM, ///< feedback current decoded frame number
+ DECODER_OPTION_IDR_PIC_ID, ///< feedback current frame belong to which IDR period
+ DECODER_OPTION_LTR_MARKING_FLAG, ///< feedback wether current frame mark a LTR
+ DECODER_OPTION_LTR_MARKED_FRAME_NUM, ///< feedback frame num marked by current Frame
+ DECODER_OPTION_ERROR_CON_IDC, ///< not finished yet, indicate decoder error concealment status, in progress
+ DECODER_OPTION_TRACE_LEVEL,
+ DECODER_OPTION_TRACE_CALLBACK, ///< a void (*)(void* context, int level, const char* message) function which receives log messages
+ DECODER_OPTION_TRACE_CALLBACK_CONTEXT,///< context info of trace callbac
+
+ DECODER_OPTION_GET_STATISTICS
} DECODER_OPTION;
-//enuerate the types of error concealment methods
+/**
+* @brief Enumerate the type of error concealment methods
+*/
typedef enum {
- ERROR_CON_DISABLE = 0,
- ERROR_CON_FRAME_COPY,
- ERROR_CON_SLICE_COPY,
+ ERROR_CON_DISABLE = 0,
+ ERROR_CON_FRAME_COPY,
+ ERROR_CON_SLICE_COPY,
+ ERROR_CON_FRAME_COPY_CROSS_IDR,
+ ERROR_CON_SLICE_COPY_CROSS_IDR,
+ ERROR_CON_SLICE_COPY_CROSS_IDR_FREEZE_RES_CHANGE,
+ ERROR_CON_SLICE_MV_COPY_CROSS_IDR,
+ ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE
} ERROR_CON_IDC;
-
-typedef enum { //feedback that whether or not have VCL NAL in current AU
- FEEDBACK_NON_VCL_NAL = 0,
- FEEDBACK_VCL_NAL,
- FEEDBACK_UNKNOWN_NAL
+/**
+* @brief Feedback that whether or not have VCL NAL in current AU
+*/
+typedef enum {
+ FEEDBACK_NON_VCL_NAL = 0,
+ FEEDBACK_VCL_NAL,
+ FEEDBACK_UNKNOWN_NAL
} FEEDBACK_VCL_NAL_IN_AU;
-/* Type of layer being encoded */
+/**
+* @brief Type of layer being encoded
+*/
typedef enum {
- NON_VIDEO_CODING_LAYER = 0,
- VIDEO_CODING_LAYER = 1
+ NON_VIDEO_CODING_LAYER = 0,
+ VIDEO_CODING_LAYER = 1
} LAYER_TYPE;
+/**
+* @brief Spatial layer num
+*/
typedef enum {
- SPATIAL_LAYER_0 = 0,
- SPATIAL_LAYER_1 = 1,
- SPATIAL_LAYER_2 = 2,
- SPATIAL_LAYER_3 = 3,
- SPATIAL_LAYER_ALL = 4,
+ SPATIAL_LAYER_0 = 0,
+ SPATIAL_LAYER_1 = 1,
+ SPATIAL_LAYER_2 = 2,
+ SPATIAL_LAYER_3 = 3,
+ SPATIAL_LAYER_ALL = 4
} LAYER_NUM;
-//enumerate the type of video bitstream which is provided to decoder
+/**
+* @brief Enumerate the type of video bitstream which is provided to decoder
+*/
typedef enum {
- VIDEO_BITSTREAM_AVC = 0,
- VIDEO_BITSTREAM_SVC = 1,
- VIDEO_BITSTREAM_DEFAULT = VIDEO_BITSTREAM_SVC,
+ VIDEO_BITSTREAM_AVC = 0,
+ VIDEO_BITSTREAM_SVC = 1,
+ VIDEO_BITSTREAM_DEFAULT = VIDEO_BITSTREAM_SVC
} VIDEO_BITSTREAM_TYPE;
+/**
+* @brief Enumerate the type of key frame request
+*/
typedef enum {
- NO_RECOVERY_REQUSET = 0,
- LTR_RECOVERY_REQUEST = 1,
- IDR_RECOVERY_REQUEST = 2,
- NO_LTR_MARKING_FEEDBACK = 3,
- LTR_MARKING_SUCCESS = 4,
- LTR_MARKING_FAILED = 5,
+ NO_RECOVERY_REQUSET = 0,
+ LTR_RECOVERY_REQUEST = 1,
+ IDR_RECOVERY_REQUEST = 2,
+ NO_LTR_MARKING_FEEDBACK = 3,
+ LTR_MARKING_SUCCESS = 4,
+ LTR_MARKING_FAILED = 5
} KEY_FRAME_REQUEST_TYPE;
+/**
+* @brief Structure for LTR recover request
+*/
typedef struct {
- unsigned int uiFeedbackType; //IDR request or LTR recovery request
- unsigned int uiIDRPicId; // distinguish request from different IDR
- int iLastCorrectFrameNum;
- int iCurrentFrameNum; //specify current decoder frame_num.
+ unsigned int uiFeedbackType; ///< IDR request or LTR recovery request
+ unsigned int uiIDRPicId; ///< distinguish request from different IDR
+ int iLastCorrectFrameNum;
+ int iCurrentFrameNum; ///< specify current decoder frame_num.
} SLTRRecoverRequest;
+/**
+* @brief Structure for LTR marking feedback
+*/
typedef struct {
- unsigned int uiFeedbackType; //mark failed or successful
- unsigned int uiIDRPicId; // distinguish request from different IDR
- int iLTRFrameNum; //specify current decoder frame_num
+ unsigned int uiFeedbackType; ///< mark failed or successful
+ unsigned int uiIDRPicId; ///< distinguish request from different IDR
+ int iLTRFrameNum; ///< specify current decoder frame_num
} SLTRMarkingFeedback;
+/**
+* @brief Structure for LTR configuration
+*/
typedef struct {
- unsigned int
- uiSliceMbNum[MAX_SLICES_NUM_TMP]; //here we use a tmp fixed value since MAX_SLICES_NUM is not defined here and its definition may be changed;
- unsigned int uiSliceNum;
- unsigned int uiSliceSizeConstraint;
-} SSliceArgument;//not all the elements in this argument will be used, how it will be used depends on uiSliceMode; see below
+ bool bEnableLongTermReference; ///< 1: on, 0: off
+ int iLTRRefNum; ///< TODO: not supported to set it arbitrary yet
+} SLTRConfig;
+/**
+* @brief Structure for slice argument
+*/
+typedef struct {
+ unsigned int
+ uiSliceMbNum[MAX_SLICES_NUM_TMP]; ///< only used when uiSliceMode=2;here we use a tmp fixed value since MAX_SLICES_NUM is not defined here and its definition may be changed;
+ unsigned int uiSliceNum; ///< only used when uiSliceMode=1
+ unsigned int uiSliceSizeConstraint; ///< only used when uiSliceMode=4
+} SSliceArgument; ///< not all the elements in this argument will be used, how it will be used depends on uiSliceMode; please refer to SliceModeEnum
+
+/**
+* @brief Enumerate the type of slice mode
+*/
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_AUTO_SLICE = 5, // | according to thread number
- SM_RESERVED = 6
+ 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_AUTO_SLICE = 5, ///< | according to thread number
+ SM_RESERVED = 6
} SliceModeEnum;
+/**
+* @brief Enumerate the type of rate control mode
+*/
typedef enum {
- RC_QUALITY_MODE = 0, //Quality mode
- RC_BITRATE_MODE = 1, //Bitrate mode
- RC_LOW_BW_MODE = 2, //bitrate limited mode
- RC_OFF_MODE = -1, // rate control off mode
+ RC_QUALITY_MODE = 0, ///< quality mode
+ RC_BITRATE_MODE = 1, ///< bitrate mode
+ RC_BUFFERBASED_MODE = 2, ///< no bitrate control,only using buffer status,adjust the video quality
+ RC_TIMESTAMP_MODE = 3, //rate control based timestamp
+ RC_BITRATE_MODE_POST_SKIP = 4, ///< this is in-building RC MODE, WILL BE DELETED after algorithm tuning!
+ RC_OFF_MODE = -1, ///< rate control off mode
} RC_MODES;
+/**
+* @brief Enumerate the type of profile id
+*/
typedef enum {
- PRO_UNKNOWN = 0,
- PRO_BASELINE = 66,
- PRO_MAIN = 77,
- PRO_EXTENDED = 88,
- PRO_HIGH = 100,
- PRO_HIGH10 = 110,
- PRO_HIGH422 = 122,
- PRO_HIGH444 = 144,
- PRO_CAVLC444 = 244,
-
- PRO_SCALABLE_BASELINE = 83,
- PRO_SCALABLE_HIGH = 86,
+ PRO_UNKNOWN = 0,
+ PRO_BASELINE = 66,
+ PRO_MAIN = 77,
+ PRO_EXTENDED = 88,
+ PRO_HIGH = 100,
+ PRO_HIGH10 = 110,
+ PRO_HIGH422 = 122,
+ PRO_HIGH444 = 144,
+ PRO_CAVLC444 = 244,
+
+ PRO_SCALABLE_BASELINE = 83,
+ PRO_SCALABLE_HIGH = 86
} EProfileIdc;
+/**
+* @brief Enumerate the type of level id
+*/
typedef enum {
- LEVEL_UNKNOWN,
- LEVEL_1_0,
- LEVEL_1_B,
- LEVEL_1_1,
- LEVEL_1_2,
- LEVEL_1_3,
- LEVEL_2_0,
- LEVEL_2_1,
- LEVEL_2_2,
- LEVEL_3_0,
- LEVEL_3_1,
- LEVEL_3_2,
- LEVEL_4_0,
- LEVEL_4_1,
- LEVEL_4_2,
- LEVEL_5_0,
- LEVEL_5_1,
- LEVEL_5_2
+ LEVEL_UNKNOWN,
+ LEVEL_1_0,
+ LEVEL_1_B,
+ LEVEL_1_1,
+ LEVEL_1_2,
+ LEVEL_1_3,
+ LEVEL_2_0,
+ LEVEL_2_1,
+ LEVEL_2_2,
+ LEVEL_3_0,
+ LEVEL_3_1,
+ LEVEL_3_2,
+ LEVEL_4_0,
+ LEVEL_4_1,
+ LEVEL_4_2,
+ LEVEL_5_0,
+ LEVEL_5_1,
+ LEVEL_5_2
} ELevelIdc;
-
+/**
+* @brief Enumerate the type of wels log
+*/
enum {
- WELS_LOG_QUIET = 0x00, // Quiet mode
- WELS_LOG_ERROR = 1 << 0, // Error log iLevel
- WELS_LOG_WARNING = 1 << 1, // Warning log iLevel
- WELS_LOG_INFO = 1 << 2, // Information log iLevel
- WELS_LOG_DEBUG = 1 << 3, // Debug log, critical algo log
- WELS_LOG_DETAIL = 1 << 4, // per packet/frame log
- WELS_LOG_RESV = 1 << 5, // Resversed log iLevel
- WELS_LOG_LEVEL_COUNT = 6,
- WELS_LOG_DEFAULT = WELS_LOG_DEBUG // Default log iLevel in Wels codec
+ WELS_LOG_QUIET = 0x00, ///< quiet mode
+ WELS_LOG_ERROR = 1 << 0, ///< error log iLevel
+ WELS_LOG_WARNING = 1 << 1, ///< Warning log iLevel
+ WELS_LOG_INFO = 1 << 2, ///< information log iLevel
+ WELS_LOG_DEBUG = 1 << 3, ///< debug log, critical algo log
+ WELS_LOG_DETAIL = 1 << 4, ///< per packet/frame log
+ WELS_LOG_RESV = 1 << 5, ///< resversed log iLevel
+ WELS_LOG_LEVEL_COUNT = 6,
+ WELS_LOG_DEFAULT = WELS_LOG_WARNING ///< default log iLevel in Wels codec
};
+/**
+* @brief Structure for slice configuration
+*/
typedef struct {
- SliceModeEnum uiSliceMode; //by default, uiSliceMode will be SM_SINGLE_SLICE
- SSliceArgument sSliceArgument;
+ SliceModeEnum uiSliceMode; ///< by default, uiSliceMode will be SM_SINGLE_SLICE
+ SSliceArgument sSliceArgument;
} SSliceConfig;
-
+/**
+* @brief Structure for spatial layer configuration
+*/
typedef struct {
- int iVideoWidth; // video size in cx specified for a layer
- int iVideoHeight; // video size in cy specified for a layer
- float fFrameRate; // frame rate specified for a layer
- int iSpatialBitrate; // target bitrate for a spatial layer
- int iMaxSpatialBitrate;
- EProfileIdc uiProfileIdc; // value of profile IDC (PRO_UNKNOWN for auto-detection)
- ELevelIdc uiLevelIdc;
- int iDLayerQp;
-
- SSliceConfig sSliceCfg;
+ int iVideoWidth; ///< width of picture in luminance samples of a layer
+ int iVideoHeight; ///< height of picture in luminance samples of a layer
+ float fFrameRate; ///< frame rate specified for a layer
+ int iSpatialBitrate; ///< target bitrate for a spatial layer, in unit of bps
+ int iMaxSpatialBitrate; ///< maximum bitrate for a spatial layer, in unit of bps
+ EProfileIdc uiProfileIdc; ///< value of profile IDC (PRO_UNKNOWN for auto-detection)
+ ELevelIdc uiLevelIdc; ///< value of profile IDC (0 for auto-detection)
+ int iDLayerQp; ///< value of level IDC (0 for auto-detection)
+
+ SSliceConfig sSliceCfg; ///< slice configuration for a layer
} SSpatialLayerConfig;
+/**
+* @brief Encoder usage type
+*/
typedef enum {
- CAMERA_VIDEO_REAL_TIME, //camera video signal
- SCREEN_CONTENT_REAL_TIME,//screen content signal
+ CAMERA_VIDEO_REAL_TIME, ///< camera video for real-time communication
+ SCREEN_CONTENT_REAL_TIME, ///< screen content signal
+ CAMERA_VIDEO_NON_REAL_TIME
} EUsageType;
+/**
+* @brief Enumulate the complexity mode
+*/
+typedef enum {
+ LOW_COMPLEXITY, ///< the lowest compleixty,the fastest speed,
+ MEDIUM_COMPLEXITY, ///< medium complexity, medium speed,medium quality
+ HIGH_COMPLEXITY ///< high complexity, lowest speed, high quality
+} ECOMPLEXITY_MODE;
+
+/**
+ * @brief Enumulate for the stategy of SPS/PPS strategy
+ */
+typedef enum {
+ CONSTANT_ID = 0, ///< constant id in SPS/PPS
+ INCREASING_ID = 0x01, ///< SPS/PPS id increases at each IDR
+ SPS_LISTING = 0x02, ///< using SPS in the existing list if possible
+ SPS_LISTING_AND_PPS_INCREASING = 0x03,
+ SPS_PPS_LISTING = 0x06,
+} EParameterSetStrategy;
+
// TODO: Refine the parameters definition.
-// SVC Encoding Parameters
+/**
+* @brief SVC Encoding Parameters
+*/
typedef struct TagEncParamBase {
- EUsageType
- iUsageType; //application type;// CAMERA_VIDEO_REAL_TIME: //camera video signal; SCREEN_CONTENT_REAL_TIME: screen content signal;
- int iInputCsp; // color space of input sequence
+ EUsageType
+ iUsageType; ///< application type;1.CAMERA_VIDEO_REAL_TIME:camera video signal; 2.SCREEN_CONTENT_REAL_TIME:screen content signal;
- int iPicWidth; // width of picture in samples
- int iPicHeight; // height of picture in samples
- int iTargetBitrate; // target bitrate desired
- RC_MODES iRCMode; // RC mode
- float fMaxFrameRate; // input maximal frame rate
+ int iPicWidth; ///< width of picture in luminance samples (the maximum of all layers if multiple spatial layers presents)
+ int iPicHeight; ///< height of picture in luminance samples((the maximum of all layers if multiple spatial layers presents)
+ int iTargetBitrate; ///< target bitrate desired, in unit of bps
+ RC_MODES iRCMode; ///< rate control mode
+ float fMaxFrameRate; ///< maximal input frame rate
} SEncParamBase, *PEncParamBase;
-
+/**
+* @brief SVC Encoding Parameters extention
+*/
typedef struct TagEncParamExt {
- EUsageType
- iUsageType; //application type;// CAMERA_VIDEO_REAL_TIME: //camera video signal; SCREEN_CONTENT_REAL_TIME: screen content signal;
- int iInputCsp; // color space of input sequence
-
- int iPicWidth; // width of picture in samples
- int iPicHeight; // height of picture in samples
- int iTargetBitrate; // target bitrate desired
- RC_MODES iRCMode; // RC mode
- float fMaxFrameRate; // input maximal frame rate
-
- int iTemporalLayerNum; // layer number at temporal level
- int iSpatialLayerNum; // layer number at spatial level
- SSpatialLayerConfig sSpatialLayers[MAX_SPATIAL_LAYER_NUM];
-
- unsigned int uiIntraPeriod; // period of Intra frame
- int iNumRefFrame; // number of reference frame used
- unsigned int uiFrameToBeCoded; // frame to be encoded (at input frame rate)
- bool bEnableSpsPpsIdAddition;
- bool bPrefixNalAddingCtrl;
- bool bEnableSSEI;
- int iPaddingFlag; // 0:disable padding;1:padding
- int iEntropyCodingModeFlag;
-
- /* rc control */
- bool bEnableFrameSkip; // allow skipping frames to keep the bitrate within limits
- int iMaxBitrate; // max bitrate desired
- int iMaxQp;
- int iMinQp;
- unsigned int uiMaxNalSize;
-
- /*LTR settings*/
- bool bEnableLongTermReference; // 0: on, 1: off
- int iLTRRefNum;
- unsigned int iLtrMarkPeriod;
-
- /* multi-thread settings*/
- unsigned short
- iMultipleThreadIdc; // 1 # 0: auto(dynamic imp. internal encoder); 1: multiple threads imp. disabled; > 1: count number of threads;
-
- /* Deblocking loop filter */
- int iLoopFilterDisableIdc; // 0: on, 1: off, 2: on except for slice boundaries
- int iLoopFilterAlphaC0Offset;// AlphaOffset: valid range [-6, 6], default 0
- int iLoopFilterBetaOffset; // BetaOffset: valid range [-6, 6], default 0
- /*pre-processing feature*/
- bool bEnableDenoise; // denoise control
- bool bEnableBackgroundDetection;// background detection control //VAA_BACKGROUND_DETECTION //BGD cmd
- bool bEnableAdaptiveQuant; // adaptive quantization control
- bool bEnableFrameCroppingFlag;// enable frame cropping flag: TRUE always in application
- bool bEnableSceneChangeDetect;
+ EUsageType
+ iUsageType; ///< application type;1.CAMERA_VIDEO_REAL_TIME:camera video signal;2.SCREEN_CONTENT_REAL_TIME:screen content signal;
+
+ int iPicWidth; ///< width of picture in luminance samples (the maximum of all layers if multiple spatial layers presents)
+ int iPicHeight; ///< height of picture in luminance samples((the maximum of all layers if multiple spatial layers presents)
+ int iTargetBitrate; ///< target bitrate desired, in unit of bps
+ RC_MODES iRCMode; ///< rate control mode
+ float fMaxFrameRate; ///< maximal input frame rate
+
+ int iTemporalLayerNum; ///< temporal layer number, max temporal layer = 4
+ int iSpatialLayerNum; ///< spatial layer number,1<= iSpatialLayerNum <= MAX_SPATIAL_LAYER_NUM, MAX_SPATIAL_LAYER_NUM = 4
+ SSpatialLayerConfig sSpatialLayers[MAX_SPATIAL_LAYER_NUM];
+
+ ECOMPLEXITY_MODE iComplexityMode;
+ unsigned int uiIntraPeriod; ///< period of Intra frame
+ int iNumRefFrame; ///< number of reference frame used
+ EParameterSetStrategy
+ eSpsPpsIdStrategy; ///< different stategy in adjust ID in SPS/PPS: 0- constant ID, 1-additional ID, 6-mapping and additional
+ bool bPrefixNalAddingCtrl; ///< false:not use Prefix NAL; true: use Prefix NAL
+ bool bEnableSSEI; ///< false:not use SSEI; true: use SSEI -- TODO: planning to remove the interface of SSEI
+ bool bSimulcastAVC; ///< (when encoding more than 1 spatial layer) false: use SVC syntax for higher layers; true: use Simulcast AVC -- coming soon
+ int iPaddingFlag; ///< 0:disable padding;1:padding
+ int iEntropyCodingModeFlag; ///< 0:CAVLC 1:CABAC.
+
+ /* rc control */
+ bool bEnableFrameSkip; ///< False: don't skip frame even if VBV buffer overflow.True: allow skipping frames to keep the bitrate within limits
+ int iMaxBitrate; ///< the maximum bitrate, in unit of bps, set it to UNSPECIFIED_BIT_RATE if not needed
+ int iMaxQp; ///< the maximum QP encoder supports
+ int iMinQp; ///< the minmum QP encoder supports
+ unsigned int uiMaxNalSize; ///< the maximum NAL size. This value should be not 0 for dynamic slice mode
+
+ /*LTR settings*/
+ bool bEnableLongTermReference; ///< 1: on, 0: off
+ int iLTRRefNum; ///< the number of LTR(long term reference),TODO: not supported to set it arbitrary yet
+ unsigned int iLtrMarkPeriod; ///< the LTR marked period that is used in feedback.
+ /* multi-thread settings*/
+ unsigned short
+ iMultipleThreadIdc; ///< 1 # 0: auto(dynamic imp. internal encoder); 1: multiple threads imp. disabled; lager than 1: count number of threads;
+
+ /* Deblocking loop filter */
+ int iLoopFilterDisableIdc; ///< 0: on, 1: off, 2: on except for slice boundaries
+ int iLoopFilterAlphaC0Offset; ///< AlphaOffset: valid range [-6, 6], default 0
+ int iLoopFilterBetaOffset; ///< BetaOffset: valid range [-6, 6], default 0
+ /*pre-processing feature*/
+ bool bEnableDenoise; ///< denoise control
+ bool bEnableBackgroundDetection; ///< background detection control //VAA_BACKGROUND_DETECTION //BGD cmd
+ bool bEnableAdaptiveQuant; ///< adaptive quantization control
+ bool bEnableFrameCroppingFlag; ///< enable frame cropping flag: TRUE always in application
+ bool bEnableSceneChangeDetect;
+
+ bool bIsLosslessLink; ///< LTR advanced setting
} SEncParamExt;
-//Define a new struct to show the property of video bitstream.
+/**
+* @brief Define a new struct to show the property of video bitstream.
+*/
typedef struct {
- unsigned int size; //size of the struct
- VIDEO_BITSTREAM_TYPE eVideoBsType;
+ unsigned int size; ///< size of the struct
+ VIDEO_BITSTREAM_TYPE eVideoBsType; ///< video stream type (AVC/SVC)
} SVideoProperty;
-/* SVC Decoding Parameters, reserved here and potential applicable in the future */
+/**
+* @brief SVC Decoding Parameters, reserved here and potential applicable in the future
+*/
typedef struct TagSVCDecodingParam {
- char* pFileNameRestructed; // File name of restructed frame used for PSNR calculation based debug
+ char* pFileNameRestructed; ///< file name of reconstructed frame used for PSNR calculation based debug
- int iOutputColorFormat; // color space format to be outputed, EVideoFormatType specified in codec_def.h
- unsigned int uiCpuLoad; // CPU load
- unsigned char uiTargetDqLayer; // Setting target dq layer id
+ EVideoFormatType eOutputColorFormat; ///< color space format to be outputed, EVideoFormatType specified in codec_def.h
+ unsigned int uiCpuLoad; ///< CPU load
+ unsigned char uiTargetDqLayer; ///< setting target dq layer id
- unsigned char uiEcActiveFlag; // Whether active error concealment feature in decoder
+ ERROR_CON_IDC eEcActiveIdc; ///< whether active error concealment feature in decoder
+ bool bParseOnly; ///< decoder for parse only, no reconstruction. When it is true, SPS/PPS size should not exceed SPS_PPS_BS_SIZE (128). Otherwise, it will return error info
- SVideoProperty sVideoProperty;
+ SVideoProperty sVideoProperty; ///< video stream property
} SDecodingParam, *PDecodingParam;
-/* Bitstream inforamtion of a layer being encoded */
+/**
+* @brief Bitstream inforamtion of a layer being encoded
+*/
typedef struct {
- unsigned char uiTemporalId;
- unsigned char uiSpatialId;
- unsigned char uiQualityId;
+ unsigned char uiTemporalId;
+ unsigned char uiSpatialId;
+ unsigned char uiQualityId;
- unsigned char uiLayerType;
+ unsigned char uiLayerType;
- int iNalCount; // Count number of NAL coded already
- int* pNalLengthInByte; // Length of NAL size in byte from 0 to iNalCount-1
- unsigned char* pBsBuf; // Buffer of bitstream contained
+ int iNalCount; ///< count number of NAL coded already
+ int* pNalLengthInByte; ///< length of NAL size in byte from 0 to iNalCount-1
+ unsigned char* pBsBuf; ///< buffer of bitstream contained
} SLayerBSInfo, *PLayerBSInfo;
-
+/**
+* @brief Frame bit stream info
+*/
typedef struct {
- int iTemporalId; // Temporal ID
- //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 iTemporalId; ///< temporal ID
- int iLayerNum;
- SLayerBSInfo sLayerInfo[MAX_LAYER_NUM_OF_FRAME];
+ /**
+ * 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
- EVideoFrameType eFrameType;
- long long uiTimeStamp;
+ int iLayerNum;
+ SLayerBSInfo sLayerInfo[MAX_LAYER_NUM_OF_FRAME];
+
+ EVideoFrameType eFrameType;
+ int iFrameSizeInBytes;
+ long long uiTimeStamp;
} SFrameBSInfo, *PFrameBSInfo;
+/**
+* @brief Structure for source picture
+*/
typedef struct Source_Picture_s {
- int iColorFormat; // color space type
- int iStride[4]; // stride for each plane pData
- unsigned char* pData[4]; // plane pData
- int iPicWidth; // luma picture width in x coordinate
- int iPicHeight; // luma picture height in y coordinate
- long long uiTimeStamp;
+ int iColorFormat; ///< color space type
+ int iStride[4]; ///< stride for each plane pData
+ unsigned char* pData[4]; ///< plane pData
+ int iPicWidth; ///< luma picture width in x coordinate
+ int iPicHeight; ///< luma picture height in y coordinate
+ long long uiTimeStamp; ///< timestamp of the source picture, unit: millisecond
} SSourcePicture;
-
+/**
+* @brief Structure for bit rate info
+*/
typedef struct TagBitrateInfo {
- LAYER_NUM iLayer;
- int iBitrate; //the maximum bitrate
+ LAYER_NUM iLayer;
+ int iBitrate; ///< the maximum bitrate
} SBitrateInfo;
+/**
+* @brief Structure for dump layer info
+*/
typedef struct TagDumpLayer {
- int iLayer;
- char* pFileName;
+ int iLayer;
+ char* pFileName;
} SDumpLayer;
+/**
+* @brief Structure for profile info in layer
+*
+*/
typedef struct TagProfileInfo {
- int iLayer;
- EProfileIdc uiProfileIdc; //the profile info
+ int iLayer;
+ EProfileIdc uiProfileIdc; ///< the profile info
} SProfileInfo;
+/**
+* @brief Structure for level info in layer
+*
+*/
typedef struct TagLevelInfo {
- int iLayer;
- ELevelIdc uiLevelIdc; //the level info
+ int iLayer;
+ ELevelIdc uiLevelIdc; ///< the level info
} SLevelInfo;
-
+/**
+* @brief Structure for dilivery status
+*
+*/
typedef struct TagDeliveryStatus {
- int iDropNum; //the number of video frames that are dropped continuously before delivery to encoder, which is used by screen content.
- int iDropFrameType; // the frame type that is dropped
- int iDropFrameSize; // the frame size that is dropped
+ bool bDeliveryFlag; ///< 0: the previous frame isn't delivered,1: the previous frame is delivered
+ int iDropFrameType; ///< the frame type that is dropped; reserved
+ int iDropFrameSize; ///< the frame size that is dropped; reserved
} SDeliveryStatus;
+
+/**
+* @brief The capability of decoder, for SDP negotiation
+*/
+typedef struct TagDecoderCapability {
+ int iProfileIdc; ///< profile_idc
+ int iProfileIop; ///< profile-iop
+ int iLevelIdc; ///< level_idc
+ int iMaxMbps; ///< max-mbps
+ int iMaxFs; ///< max-fs
+ int iMaxCpb; ///< max-cpb
+ int iMaxDpb; ///< max-dpb
+ int iMaxBr; ///< max-br
+ bool bRedPicCap; ///< redundant-pic-cap
+} SDecoderCapability;
+
+/**
+* @brief to do
+*/
+typedef struct TagParserBsInfo {
+ int iNalNum; ///< total NAL number in current AU
+ int iNalLenInByte [MAX_NAL_UNITS_IN_LAYER]; ///< each nal length
+ unsigned char* pDstBuff; ///< outputted dst buffer for parsed bitstream
+ int iSpsWidthInPixel; ///< required SPS width info
+ int iSpsHeightInPixel; ///< required SPS height info
+ unsigned long long uiInBsTimeStamp; ///< input BS timestamp
+ unsigned long long uiOutBsTimeStamp; ///< output BS timestamp
+} SParserBsInfo, *PParserBsInfo;
+
+/**
+* @brief Structure for encoder statistics
+*/
+typedef struct TagVideoEncoderStatistics {
+ unsigned int uiWidth; ///< the width of encoded frame
+ unsigned int uiHeight; ///< the height of encoded frame
+ //following standard, will be 16x aligned, if there are multiple spatial, this is of the highest
+ float fAverageFrameSpeedInMs; ///< average_Encoding_Time
+
+ // rate control related
+ float fAverageFrameRate; ///< the average frame rate in, calculate since encoding starts, supposed that the input timestamp is in unit of ms
+ float fLatestFrameRate; ///< the frame rate in, in the last second, supposed that the input timestamp is in unit of ms (? useful for checking BR, but is it easy to calculate?
+ unsigned int uiBitRate; ///< sendrate in Bits per second, calculated within the set time-window
+ unsigned int uiAverageFrameQP; ///< the average QP of last encoded frame
+
+ unsigned int uiInputFrameCount; ///< number of frames
+ unsigned int uiSkippedFrameCount; ///< number of frames
+
+ unsigned int uiResolutionChangeTimes; ///< uiResolutionChangeTimes
+ unsigned int uiIDRReqNum; ///< number of IDR requests
+ unsigned int uiIDRSentNum; ///< number of actual IDRs sent
+ unsigned int uiLTRSentNum; ///< number of LTR sent/marked
+
+ long long iStatisticsTs; ///< Timestamp of updating the statistics
+} SEncoderStatistics; // in building, coming soon
+
+/**
+* @brief Structure for decoder statistics
+*/
+typedef struct TagVideoDecoderStatistics {
+ unsigned int uiWidth; ///< the width of encode/decode frame
+ unsigned int uiHeight; ///< the height of encode/decode frame
+ float fAverageFrameSpeedInMs; ///< average_Decoding_Time
+ float fActualAverageFrameSpeedInMs; ///< actual average_Decoding_Time, including freezing pictures
+ unsigned int uiDecodedFrameCount; ///< number of frames
+ unsigned int uiResolutionChangeTimes; ///< uiResolutionChangeTimes
+ unsigned int uiIDRCorrectNum; ///< number of correct IDR received
+ //EC on related
+ unsigned int
+ uiAvgEcRatio; ///< when EC is on, the average ratio of total EC areas, can be an indicator of reconstruction quality
+ unsigned int
+ uiAvgEcPropRatio; ///< when EC is on, the rough average ratio of propogate EC areas, can be an indicator of reconstruction quality
+ unsigned int uiEcIDRNum; ///< number of actual unintegrity IDR or not received but eced
+ unsigned int uiEcFrameNum; ///<
+ unsigned int uiIDRLostNum; ///< number of whole lost IDR
+ unsigned int uiFreezingIDRNum; ///< number of freezing IDR with error (partly received), under resolution change
+ unsigned int uiFreezingNonIDRNum; ///< number of freezing non-IDR with error
+ int iAvgLumaQp; ///< average luma QP. default: -1, no correct frame outputted
+ int iSpsReportErrorNum; ///< number of Sps Invalid report
+ int iSubSpsReportErrorNum; ///< number of SubSps Invalid report
+ int iPpsReportErrorNum; ///< number of Pps Invalid report
+ int iSpsNoExistNalNum; ///< number of Sps NoExist Nal
+ int iSubSpsNoExistNalNum; ///< number of SubSps NoExist Nal
+ int iPpsNoExistNalNum; ///< number of Pps NoExist Nal
+} SDecoderStatistics; // in building, coming soon
+
#endif//WELS_VIDEO_CODEC_APPLICATION_DEFINITION_H__
diff --git a/thirdparties/common/include/wels/codec_def.h b/thirdparties/common/include/wels/codec_def.h
index dfc89cd..4f7eb9d 100755
--- a/thirdparties/common/include/wels/codec_def.h
+++ b/thirdparties/common/include/wels/codec_def.h
@@ -33,67 +33,83 @@
#ifndef WELS_VIDEO_CODEC_DEFINITION_H__
#define WELS_VIDEO_CODEC_DEFINITION_H__
+/**
+ * @file codec_def.h
+*/
+
+/**
+* @brief Enumerate the type of video format
+*/
typedef enum {
- /*rgb color formats*/
- videoFormatRGB = 1,
- videoFormatRGBA = 2,
- videoFormatRGB555 = 3,
- videoFormatRGB565 = 4,
- videoFormatBGR = 5,
- videoFormatBGRA = 6,
- videoFormatABGR = 7,
- videoFormatARGB = 8,
-
- /*yuv color formats*/
- videoFormatYUY2 = 20,
- videoFormatYVYU = 21,
- videoFormatUYVY = 22,
- videoFormatI420 = 23, //same as IYUV
- videoFormatYV12 = 24,
- videoFormatInternal = 25, // Only Used for SVC decoder testbed
-
- videoFormatNV12 = 26, // new format for output by DXVA decoding
-
- videoFormatVFlip = 0x80000000
+ videoFormatRGB = 1, ///< rgb color formats
+ videoFormatRGBA = 2,
+ videoFormatRGB555 = 3,
+ videoFormatRGB565 = 4,
+ videoFormatBGR = 5,
+ videoFormatBGRA = 6,
+ videoFormatABGR = 7,
+ videoFormatARGB = 8,
+
+ videoFormatYUY2 = 20, ///< yuv color formats
+ videoFormatYVYU = 21,
+ videoFormatUYVY = 22,
+ videoFormatI420 = 23, ///< the same as IYUV
+ videoFormatYV12 = 24,
+ videoFormatInternal = 25, ///< only used in SVC decoder testbed
+
+ videoFormatNV12 = 26, ///< new format for output by DXVA decoding
+
+ videoFormatVFlip = 0x80000000
} EVideoFormatType;
+/**
+* @brief Enumerate video frame type
+*/
typedef enum {
- videoFrameTypeInvalid, /* Encoder not ready or parameters are invalidate */
- videoFrameTypeIDR, /* This type is only available for H264 if this frame is key frame, then return this type */
- videoFrameTypeI, /* I frame type */
- videoFrameTypeP, /* P frame type */
- videoFrameTypeSkip, /* Skip the frame based encoder kernel */
- videoFrameTypeIPMixed, /* Frame type introduced I and P slices are mixing */
+ videoFrameTypeInvalid, ///< encoder not ready or parameters are invalidate
+ videoFrameTypeIDR, ///< IDR frame in H.264
+ videoFrameTypeI, ///< I frame type
+ videoFrameTypeP, ///< P frame type
+ videoFrameTypeSkip, ///< skip the frame based encoder kernel
+ videoFrameTypeIPMixed ///< a frame where I and P slices are mixing, not supported yet
} EVideoFrameType;
+/**
+* @brief Enumerate return type
+*/
typedef enum {
- cmResultSuccess,
- cmInitParaError, /*Parameters are invalid */
- cmUnkonwReason,
- cmMallocMemeError, /*Malloc a memory error*/
- cmInitExpected, /*Initial action is expected*/
- cmUnsupportedData,
+ cmResultSuccess, ///< successful
+ cmInitParaError, ///< parameters are invalid
+ cmUnknownReason,
+ cmMallocMemeError, ///< malloc a memory error
+ cmInitExpected, ///< initial action is expected
+ cmUnsupportedData
} CM_RETURN;
-/* nal unit type */
+/**
+* @brief Enumulate the nal unit type
+*/
enum ENalUnitType {
- NAL_UNKNOWN = 0,
- NAL_SLICE = 1,
- NAL_SLICE_DPA = 2,
- NAL_SLICE_DPB = 3,
- NAL_SLICE_DPC = 4,
- NAL_SLICE_IDR = 5, /* ref_idc != 0 */
- NAL_SEI = 6, /* ref_idc == 0 */
- NAL_SPS = 7,
- NAL_PPS = 8
- /* ref_idc == 0 for 6,9,10,11,12 */
+ NAL_UNKNOWN = 0,
+ NAL_SLICE = 1,
+ NAL_SLICE_DPA = 2,
+ NAL_SLICE_DPB = 3,
+ NAL_SLICE_DPC = 4,
+ NAL_SLICE_IDR = 5, ///< ref_idc != 0
+ NAL_SEI = 6, ///< ref_idc == 0
+ NAL_SPS = 7,
+ NAL_PPS = 8
+ ///< ref_idc == 0 for 6,9,10,11,12
};
-/* NRI: eNalRefIdc */
+
+/**
+* @brief NRI: eNalRefIdc
+*/
enum ENalPriority {
- NAL_PRIORITY_DISPOSABLE = 0,
- NAL_PRIORITY_LOW = 1,
- NAL_PRIORITY_HIGH = 2,
- NAL_PRIORITY_HIGHEST = 3,
+ NAL_PRIORITY_DISPOSABLE = 0,
+ NAL_PRIORITY_LOW = 1,
+ NAL_PRIORITY_HIGH = 2,
+ NAL_PRIORITY_HIGHEST = 3
};
#define IS_PARAMETER_SET_NAL(eNalRefIdc, eNalType) \
@@ -102,89 +118,98 @@ enum ENalPriority {
#define IS_IDR_NAL(eNalRefIdc, eNalType) \
( (eNalRefIdc == NAL_PRIORITY_HIGHEST) && (eNalType == NAL_SLICE_IDR) )
-#define FRAME_NUM_PARAM_SET (-1)
-#define FRAME_NUM_IDR 0
+#define FRAME_NUM_PARAM_SET (-1)
+#define FRAME_NUM_IDR 0
+
+/**
+ * @brief eDeblockingIdc
+ */
+enum {
+ DEBLOCKING_IDC_0 = 0,
+ DEBLOCKING_IDC_1 = 1,
+ DEBLOCKING_IDC_2 = 2
+};
+#define DEBLOCKING_OFFSET (6)
+#define DEBLOCKING_OFFSET_MINUS (-6)
/* Error Tools definition */
typedef unsigned short ERR_TOOL;
+
+/**
+ @brief to do
+*/
enum {
- ET_NONE = 0x00, // NONE Error Tools
- ET_IP_SCALE = 0x01, // IP Scalable
- ET_FMO = 0x02, // Flexible Macroblock Ordering
- ET_IR_R1 = 0x04, // Intra Refresh in predifined 2% MB
- ET_IR_R2 = 0x08, // Intra Refresh in predifined 5% MB
- ET_IR_R3 = 0x10, // Intra Refresh in predifined 10% MB
- ET_FEC_HALF = 0x20, // Forward Error Correction in 50% redundency mode
- ET_FEC_FULL = 0x40, // Forward Error Correction in 100% redundency mode
- ET_RFS = 0x80, // Reference Frame Selection
+ ET_NONE = 0x00, ///< NONE Error Tools
+ ET_IP_SCALE = 0x01, ///< IP Scalable
+ ET_FMO = 0x02, ///< Flexible Macroblock Ordering
+ ET_IR_R1 = 0x04, ///< Intra Refresh in predifined 2% MB
+ ET_IR_R2 = 0x08, ///< Intra Refresh in predifined 5% MB
+ ET_IR_R3 = 0x10, ///< Intra Refresh in predifined 10% MB
+ ET_FEC_HALF = 0x20, ///< Forward Error Correction in 50% redundency mode
+ ET_FEC_FULL = 0x40, ///< Forward Error Correction in 100% redundency mode
+ ET_RFS = 0x80 ///< Reference Frame Selection
};
-/* information of coded Slice(=NAL)(s) */
+/**
+* @brief Information of coded Slice(=NAL)(s)
+*/
typedef struct SliceInformation {
- unsigned char* pBufferOfSlices; // base buffer of coded slice(s)
- int iCodedSliceCount; // number of coded slices
- unsigned int* pLengthOfSlices; // array of slices length accordingly by number of slice
- int iFecType; // FEC type[0, 50%FEC, 100%FEC]
- unsigned char uiSliceIdx; // index of slice in frame [FMO: 0,..,uiSliceCount-1; No FMO: 0]
- unsigned char uiSliceCount; // count number of slice in frame [FMO: 2-8; No FMO: 1]
- char iFrameIndex; // index of frame[-1, .., idr_interval-1]
- unsigned char uiNalRefIdc; // NRI, priority level of slice(NAL)
- unsigned char uiNalType; // NAL type
- unsigned char
- uiContainingFinalNal; // whether final NAL is involved in buffer of coded slices, flag used in Pause feature in T27
+ unsigned char* pBufferOfSlices; ///< base buffer of coded slice(s)
+ int iCodedSliceCount; ///< number of coded slices
+ unsigned int* pLengthOfSlices; ///< array of slices length accordingly by number of slice
+ int iFecType; ///< FEC type[0, 50%FEC, 100%FEC]
+ unsigned char uiSliceIdx; ///< index of slice in frame [FMO: 0,..,uiSliceCount-1; No FMO: 0]
+ unsigned char uiSliceCount; ///< count number of slice in frame [FMO: 2-8; No FMO: 1]
+ char iFrameIndex; ///< index of frame[-1, .., idr_interval-1]
+ unsigned char uiNalRefIdc; ///< NRI, priority level of slice(NAL)
+ unsigned char uiNalType; ///< NAL type
+ unsigned char
+ uiContainingFinalNal; ///< whether final NAL is involved in buffer of coded slices, flag used in Pause feature in T27
} SliceInfo, *PSliceInfo;
-
-
-#define CIF_WIDTH 352
-#define CIF_HEIGHT 288
-#define QVGA_WIDTH 320
-#define QVGA_HEIGHT 240
-#define QCIF_WIDTH 176
-#define QCIF_HEIGHT 144
-#define SQCIF_WIDTH 128
-#define SQCIF_HEIGHT 96
-
-/* thresholds of the initial, maximal and minimal rate */
+/**
+* @brief thresholds of the initial, maximal and minimal rate
+*/
typedef struct {
- int iWidth; // frame width
- int iHeight; // frame height
- int iThresholdOfInitRate; // threshold of initial rate
- int iThresholdOfMaxRate; // threshold of maximal rate
- int iThresholdOfMinRate; // threshold of minimal rate
- int iMinThresholdFrameRate; //min frame rate min
- int iSkipFrameRate; //skip to frame rate min
- int iSkipFrameStep; //how many frames to skip
+ int iWidth; ///< frame width
+ int iHeight; ///< frame height
+ int iThresholdOfInitRate; ///< threshold of initial rate
+ int iThresholdOfMaxRate; ///< threshold of maximal rate
+ int iThresholdOfMinRate; ///< threshold of minimal rate
+ int iMinThresholdFrameRate; ///< min frame rate min
+ int iSkipFrameRate; ///< skip to frame rate min
+ int iSkipFrameStep; ///< how many frames to skip
} SRateThresholds, *PRateThresholds;
+/**
+* @brief Structure for decoder memery
+*/
typedef struct TagSysMemBuffer {
- int iWidth; //width of decoded pic for display
- int iHeight; //height of decoded pic for display
- int iFormat; // type is "EVideoFormatType"
- int iStride[2]; //stride of 2 component
+ int iWidth; ///< width of decoded pic for display
+ int iHeight; ///< height of decoded pic for display
+ int iFormat; ///< type is "EVideoFormatType"
+ int iStride[2]; ///< stride of 2 component
} SSysMEMBuffer;
+/**
+* @brief Buffer info
+*/
typedef struct TagBufferInfo {
- int iBufferStatus; // 0: one frame data is not ready; 1: one frame data is ready
- union {
- SSysMEMBuffer sSystemBuffer;
- } UsrData;
+ int iBufferStatus; ///< 0: one frame data is not ready; 1: one frame data is ready
+ unsigned long long uiInBsTimeStamp; ///< input BS timestamp
+ unsigned long long uiOutYuvTimeStamp; ///< output YUV timestamp, when bufferstatus is 1
+ union {
+ SSysMEMBuffer sSystemBuffer; ///< memory info for one picture
+ } UsrData; ///< output buffer info
} SBufferInfo;
-/* Constants related to transmission rate at various resolutions */
-static const SRateThresholds ksRateThrMap[4] = {
- // initial-maximal-minimal
- {CIF_WIDTH, CIF_HEIGHT, 225000, 384000, 96000, 3, 1, 1}, // CIF
- {QVGA_WIDTH, QVGA_HEIGHT, 192000, 320000, 80000, -1, -1, -1}, // QVGA
- {QCIF_WIDTH, QCIF_HEIGHT, 150000, 256000, 64000, 8, 4, 2}, // QCIF
- {SQCIF_WIDTH, SQCIF_HEIGHT, 120000, 192000, 48000, 5, 3, 1} // SQCIF
-};
-
-// In a GOP, multiple of the key frame number, derived from
-// the number of layers(index or array below)
+/**
+* @brief In a GOP, multiple of the key frame number, derived from
+* the number of layers(index or array below)
+*/
static const char kiKeyNumMultiple[] = {
- 1, 1, 2, 4, 8, 16,
+ 1, 1, 2, 4, 8, 16,
};
#endif//WELS_VIDEO_CODEC_DEFINITION_H__
diff --git a/thirdparties/iphone/lib/universal/libcommon.a b/thirdparties/iphone/lib/universal/libcommon.a
index 9b3e139..d2ad2bf 100755
--- a/thirdparties/iphone/lib/universal/libcommon.a
+++ b/thirdparties/iphone/lib/universal/libcommon.a
Binary files differ
diff --git a/thirdparties/iphone/lib/universal/libdecoder.a b/thirdparties/iphone/lib/universal/libdecoder.a
index dfdcc62..1ccf1ff 100755
--- a/thirdparties/iphone/lib/universal/libdecoder.a
+++ b/thirdparties/iphone/lib/universal/libdecoder.a
Binary files differ
diff --git a/thirdparties/iphone/lib/universal/libencoder.a b/thirdparties/iphone/lib/universal/libencoder.a
index 1f54df4..ccf6a99 100755
--- a/thirdparties/iphone/lib/universal/libencoder.a
+++ b/thirdparties/iphone/lib/universal/libencoder.a
Binary files differ
diff --git a/thirdparties/iphone/lib/universal/libopenh264.a b/thirdparties/iphone/lib/universal/libopenh264.a
index 5be0a83..5056a19 100755
--- a/thirdparties/iphone/lib/universal/libopenh264.a
+++ b/thirdparties/iphone/lib/universal/libopenh264.a
Binary files differ
diff --git a/thirdparties/iphone/lib/universal/libprocessing.a b/thirdparties/iphone/lib/universal/libprocessing.a
index e13579d..a2c361a 100755
--- a/thirdparties/iphone/lib/universal/libprocessing.a
+++ b/thirdparties/iphone/lib/universal/libprocessing.a
Binary files differ
diff --git a/thirdparties/win32/bin/openh264/openh264.dll b/thirdparties/win32/bin/openh264/openh264.dll
deleted file mode 100755
index 8a641e3..0000000
--- a/thirdparties/win32/bin/openh264/openh264.dll
+++ /dev/null
Binary files differ
diff --git a/thirdparties/win32/lib/openh264/common.lib b/thirdparties/win32/lib/openh264/common.lib
index f348c7e..ea70296 100755
--- a/thirdparties/win32/lib/openh264/common.lib
+++ b/thirdparties/win32/lib/openh264/common.lib
Binary files differ
diff --git a/thirdparties/win32/lib/openh264/console_common.lib b/thirdparties/win32/lib/openh264/console_common.lib
index f3e73f8..9852a22 100755
--- a/thirdparties/win32/lib/openh264/console_common.lib
+++ b/thirdparties/win32/lib/openh264/console_common.lib
Binary files differ
diff --git a/thirdparties/win32/lib/openh264/decoder.lib b/thirdparties/win32/lib/openh264/decoder.lib
index 6563f88..73018d0 100755
--- a/thirdparties/win32/lib/openh264/decoder.lib
+++ b/thirdparties/win32/lib/openh264/decoder.lib
Binary files differ
diff --git a/thirdparties/win32/lib/openh264/encoder.lib b/thirdparties/win32/lib/openh264/encoder.lib
index 1d337f5..9b509f6 100755
--- a/thirdparties/win32/lib/openh264/encoder.lib
+++ b/thirdparties/win32/lib/openh264/encoder.lib
Binary files differ
diff --git a/thirdparties/win32/lib/openh264/openh264.lib b/thirdparties/win32/lib/openh264/openh264.lib
index b20fa8b..9161782 100755
--- a/thirdparties/win32/lib/openh264/openh264.lib
+++ b/thirdparties/win32/lib/openh264/openh264.lib
Binary files differ
diff --git a/thirdparties/win32/lib/openh264/openh264_dll.lib b/thirdparties/win32/lib/openh264/openh264_dll.lib
deleted file mode 100755
index 6e110d9..0000000
--- a/thirdparties/win32/lib/openh264/openh264_dll.lib
+++ /dev/null
Binary files differ
diff --git a/thirdparties/win32/lib/openh264/processing.lib b/thirdparties/win32/lib/openh264/processing.lib
index 47324e3..f8ddf27 100755
--- a/thirdparties/win32/lib/openh264/processing.lib
+++ b/thirdparties/win32/lib/openh264/processing.lib
Binary files differ
diff --git a/tinyDAV/src/codecs/h264/tdav_codec_h264_cisco.cxx b/tinyDAV/src/codecs/h264/tdav_codec_h264_cisco.cxx
index 3cf2540..48ef0e4 100755
--- a/tinyDAV/src/codecs/h264/tdav_codec_h264_cisco.cxx
+++ b/tinyDAV/src/codecs/h264/tdav_codec_h264_cisco.cxx
@@ -1,5 +1,5 @@
/*
-* Copyright (C) 2014-2015 Mamadou DIOP.
+* Copyright (C) 2014-2016 Mamadou DIOP.
*
*
* This file is part of Open Source Doubango Framework.
@@ -20,7 +20,7 @@
*/
/**@file tdav_codec_h264_cisco.cxx
- * @brief H.264 codec plugin using OpenH264 (https://github.com/cisco/openh264) v1.1 for encoding/decoding.
+ * @brief H.264 codec plugin using OpenH264 (https://github.com/cisco/openh264) v1.5.0 for encoding/decoding.
*/
#include "tinydav/codecs/h264/tdav_codec_h264_cisco.h"
@@ -682,7 +682,6 @@ static int tdav_codec_h264_cisco_open_encoder(tdav_codec_h264_cisco_t* self)
max_bitrate_bps
);
- self->encoder.sEncParam.iInputCsp = videoFormatI420;
self->encoder.sEncParam.iSpatialLayerNum = 1;
self->encoder.sEncParam.iTemporalLayerNum = 1;
self->encoder.sEncParam.uiIntraPeriod = (self->encoder.neg_fps * CISCO_H264_GOP_SIZE_IN_SECONDS);
@@ -693,7 +692,7 @@ static int tdav_codec_h264_cisco_open_encoder(tdav_codec_h264_cisco_t* self)
self->encoder.sEncParam.iMaxBitrate = max_bitrate_bps;
self->encoder.sEncParam.fMaxFrameRate = (float)self->encoder.neg_fps;
self->encoder.sEncParam.uiMaxNalSize = H264_RTP_PAYLOAD_SIZE;
- self->encoder.sEncParam.bEnableSpsPpsIdAddition = true;
+ self->encoder.sEncParam.eSpsPpsIdStrategy = INCREASING_ID;
self->encoder.sEncParam.bEnableFrameCroppingFlag = true;
layer = &self->encoder.sEncParam.sSpatialLayers[0];
@@ -782,8 +781,9 @@ int tdav_codec_h264_cisco_open_decoder(tdav_codec_h264_cisco_t* self)
self->decoder.pInst->SetOption(DECODER_OPTION_TRACE_CALLBACK, &__tdav_codec_h264_cisco_debug_cb);
// initialize decoder
- sDecParam.iOutputColorFormat = videoFormatI420;
+ sDecParam.eOutputColorFormat = videoFormatI420;
sDecParam.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_AVC;
+
if ((err = self->decoder.pInst->Initialize(&sDecParam)) != cmResultSuccess) {
TSK_DEBUG_ERROR("Failed to initialize decoder: %ld", err);
goto bail;
OpenPOWER on IntegriCloud