H.264 Codec for ESP32-S3
Loading...
Searching...
No Matches
codec_app_def.h
Go to the documentation of this file.
1/*!
2 * \copy
3 * Copyright (c) 2013, Cisco Systems
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
16 * distribution.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 *
31 */
32
33
34
35#ifndef WELS_VIDEO_CODEC_APPLICATION_DEFINITION_H__
36#define WELS_VIDEO_CODEC_APPLICATION_DEFINITION_H__
37/**
38 * @file codec_app_def.h
39 * @brief Data and /or structures introduced in Cisco OpenH264 application
40*/
41
42#include "codec_def.h"
43/* Constants */
44#define MAX_TEMPORAL_LAYER_NUM 4
45#define MAX_SPATIAL_LAYER_NUM 4
46#define MAX_QUALITY_LAYER_NUM 4
47
48#define MAX_LAYER_NUM_OF_FRAME 128
49#define MAX_NAL_UNITS_IN_LAYER 128 ///< predetermined here, adjust it later if need
50
51#define MAX_RTP_PAYLOAD_LEN 1000
52#define AVERAGE_RTP_PAYLOAD_LEN 800
53
54
55#define SAVED_NALUNIT_NUM_TMP ( (MAX_SPATIAL_LAYER_NUM*MAX_QUALITY_LAYER_NUM) + 1 + MAX_SPATIAL_LAYER_NUM ) ///< SPS/PPS + SEI/SSEI + PADDING_NAL
56#define MAX_SLICES_NUM_TMP ( ( MAX_NAL_UNITS_IN_LAYER - SAVED_NALUNIT_NUM_TMP ) / 3 )
57
58
59#define AUTO_REF_PIC_COUNT -1 ///< encoder selects the number of reference frame automatically
60#define UNSPECIFIED_BIT_RATE 0 ///< to do: add detail comment
61
62/**
63 * @brief Struct of OpenH264 version
64 */
65///
66/// E.g. SDK version is 1.2.0.0, major version number is 1, minor version number is 2, and revision number is 0.
67typedef struct _tagVersion {
68 uint32_t uMajor; ///< The major version number
69 uint32_t uMinor; ///< The minor version number
70 uint32_t uRevision; ///< The revision number
71 uint32_t uReserved; ///< The reserved number, it should be 0.
72} OpenH264Version;
73
74/**
75* @brief Decoding status
76*/
77typedef enum {
78 /**
79 * Errors derived from bitstream parsing
80 */
81 dsErrorFree = 0x00, ///< bit stream error-free
82 dsFramePending = 0x01, ///< need more throughput to generate a frame output,
83 dsRefLost = 0x02, ///< layer lost at reference frame with temporal id 0
84 dsBitstreamError = 0x04, ///< error bitstreams(maybe broken internal frame) the decoder cared
85 dsDepLayerLost = 0x08, ///< dependented layer is ever lost
86 dsNoParamSets = 0x10, ///< no parameter set NALs involved
87 dsDataErrorConcealed = 0x20, ///< current data error concealed specified
88 dsRefListNullPtrs = 0x40, ///<ref picure list contains null ptrs within uiRefCount range
89
90 /**
91 * Errors derived from logic level
92 */
93 dsInvalidArgument = 0x1000, ///< invalid argument specified
94 dsInitialOptExpected = 0x2000, ///< initializing operation is expected
95 dsOutOfMemory = 0x4000, ///< out of memory due to new request
96 /**
97 * ANY OTHERS?
98 */
99 dsDstBufNeedExpan = 0x8000 ///< actual picture size exceeds size of dst pBuffer feed in decoder, so need expand its size
100
101} DECODING_STATE;
102
103/**
104* @brief Option types introduced in SVC encoder application
105*/
106typedef enum {
108 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)
109 ENCODER_OPTION_SVC_ENCODE_PARAM_BASE, ///< structure of Base Param
110 ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, ///< structure of Extension Param
111 ENCODER_OPTION_FRAME_RATE, ///< maximal input frame rate, current supported range: MAX_FRAME_RATE = 30,MIN_FRAME_RATE = 1
117 ENCODER_PADDING_PADDING, ///< 0:disable padding;1:padding
118
119 ENCODER_OPTION_PROFILE, ///< assgin the profile for each layer
120 ENCODER_OPTION_LEVEL, ///< assgin the level for each layer
121 ENCODER_OPTION_NUMBER_REF, ///< the number of refererence frame
122 ENCODER_OPTION_DELIVERY_STATUS, ///< the delivery info which is a feedback from app level
123
127 ENCODER_OPTION_LTR, ///< 0:disable LTR;larger than 0 enable LTR; LTR number is fixed to be 2 in current encoder
129
130 ENCODER_OPTION_ENABLE_SSEI, ///< enable SSEI: true--enable ssei; false--disable ssei
131 ENCODER_OPTION_ENABLE_PREFIX_NAL_ADDING, ///< enable prefix: true--enable prefix; false--disable prefix
132 ENCODER_OPTION_SPS_PPS_ID_STRATEGY, ///< different stategy in adjust ID in SPS/PPS: 0- constant ID, 1-additional ID, 6-mapping and additional
133
135 ENCODER_OPTION_DUMP_FILE, ///< dump layer reconstruct frame to a specified file
136 ENCODER_OPTION_TRACE_LEVEL, ///< trace info based on the trace level
137 ENCODER_OPTION_TRACE_CALLBACK, ///< a void (*)(void* context, int32_t level, const char* message) function which receives log messages
138 ENCODER_OPTION_TRACE_CALLBACK_CONTEXT, ///< context info of trace callback
139
141 ENCODER_OPTION_STATISTICS_LOG_INTERVAL, ///< log interval in millisecond
142
143 ENCODER_OPTION_IS_LOSSLESS_LINK, ///< advanced algorithmetic settings
144
145 ENCODER_OPTION_BITS_VARY_PERCENTAGE ///< bit vary percentage
146} ENCODER_OPTION;
147
148/**
149* @brief Option types introduced in decoder application
150*/
151typedef enum {
152 DECODER_OPTION_END_OF_STREAM = 1, ///< end of stream flag
153 DECODER_OPTION_VCL_NAL, ///< feedback whether or not have VCL NAL in current AU for application layer
154 DECODER_OPTION_TEMPORAL_ID, ///< feedback temporal id for application layer
155 DECODER_OPTION_FRAME_NUM, ///< feedback current decoded frame number
156 DECODER_OPTION_IDR_PIC_ID, ///< feedback current frame belong to which IDR period
157 DECODER_OPTION_LTR_MARKING_FLAG, ///< feedback wether current frame mark a LTR
158 DECODER_OPTION_LTR_MARKED_FRAME_NUM, ///< feedback frame num marked by current Frame
159 DECODER_OPTION_ERROR_CON_IDC, ///< indicate decoder error concealment method
161 DECODER_OPTION_TRACE_CALLBACK, ///< a void (*)(void* context, int32_t level, const char* message) function which receives log messages
162 DECODER_OPTION_TRACE_CALLBACK_CONTEXT,///< context info of trace callbac
163
164 DECODER_OPTION_GET_STATISTICS, ///< feedback decoder statistics
165 DECODER_OPTION_GET_SAR_INFO, ///< feedback decoder Sample Aspect Ratio info in Vui
166 DECODER_OPTION_PROFILE, ///< get current AU profile info, only is used in GetOption
167 DECODER_OPTION_LEVEL, ///< get current AU level info,only is used in GetOption
168 DECODER_OPTION_STATISTICS_LOG_INTERVAL,///< set log output interval
169 DECODER_OPTION_IS_REF_PIC, ///< feedback current frame is ref pic or not
170 DECODER_OPTION_NUM_OF_FRAMES_REMAINING_IN_BUFFER, ///< number of frames remaining in decoder buffer when pictures are required to re-ordered into display-order.
171 DECODER_OPTION_NUM_OF_THREADS, ///< number of decoding threads. The maximum thread count is equal or less than lesser of (cpu core counts and 16).
172} DECODER_OPTION;
173
174/**
175* @brief Enumerate the type of error concealment methods
176*/
177typedef enum {
186} ERROR_CON_IDC;
187/**
188* @brief Feedback that whether or not have VCL NAL in current AU
189*/
190typedef enum {
194} FEEDBACK_VCL_NAL_IN_AU;
195
196/**
197* @brief Type of layer being encoded
198*/
199typedef enum {
202} LAYER_TYPE;
203
204/**
205* @brief Spatial layer num
206*/
207typedef enum {
213} LAYER_NUM;
214
215/**
216* @brief Enumerate the type of video bitstream which is provided to decoder
217*/
218typedef enum {
222} VIDEO_BITSTREAM_TYPE;
223
224/**
225* @brief Enumerate the type of key frame request
226*/
227typedef enum {
234} KEY_FRAME_REQUEST_TYPE;
235
236/**
237* @brief Structure for LTR recover request
238*/
239typedef struct {
240 uint32_t uiFeedbackType; ///< IDR request or LTR recovery request
241 uint32_t uiIDRPicId; ///< distinguish request from different IDR
243 int32_t iCurrentFrameNum; ///< specify current decoder frame_num.
244 int32_t iLayerId; //specify the layer for recovery request
245} SLTRRecoverRequest;
246
247/**
248* @brief Structure for LTR marking feedback
249*/
250typedef struct {
251 uint32_t uiFeedbackType; ///< mark failed or successful
252 uint32_t uiIDRPicId; ///< distinguish request from different IDR
253 int32_t iLTRFrameNum; ///< specify current decoder frame_num
254 int32_t iLayerId; //specify the layer for LTR marking feedback
255} SLTRMarkingFeedback;
256
257/**
258* @brief Structure for LTR configuration
259*/
260typedef struct {
261 bool bEnableLongTermReference; ///< 1: on, 0: off
262 int32_t iLTRRefNum; ///< TODO: not supported to set it arbitrary yet
263} SLTRConfig;
264
265/**
266* @brief Enumerate the type of rate control mode
267*/
268typedef enum {
269 RC_QUALITY_MODE = 0, ///< quality mode
270 RC_BITRATE_MODE = 1, ///< bitrate mode
271 RC_BUFFERBASED_MODE = 2, ///< no bitrate control,only using buffer status,adjust the video quality
272 RC_TIMESTAMP_MODE = 3, //rate control based timestamp
273 RC_BITRATE_MODE_POST_SKIP = 4, ///< this is in-building RC MODE, WILL BE DELETED after algorithm tuning!
274 RC_OFF_MODE = -1, ///< rate control off mode
275} RC_MODES;
276
277/**
278* @brief Enumerate the type of profile id
279*/
280typedef enum {
285 PRO_HIGH = 100,
290
293} EProfileIdc;
294
295/**
296* @brief Enumerate the type of level id
297*/
298typedef enum {
316 LEVEL_5_2 = 52
317} ELevelIdc;
318
319/**
320* @brief Enumerate the type of wels log
321*/
322enum {
323 WELS_LOG_QUIET = 0x00, ///< quiet mode
324 WELS_LOG_ERROR = 1 << 0, ///< error log iLevel
325 WELS_LOG_WARNING = 1 << 1, ///< Warning log iLevel
326 WELS_LOG_INFO = 1 << 2, ///< information log iLevel
327 WELS_LOG_DEBUG = 1 << 3, ///< debug log, critical algo log
328 WELS_LOG_DETAIL = 1 << 4, ///< per packet/frame log
329 WELS_LOG_RESV = 1 << 5, ///< resversed log iLevel
331 WELS_LOG_DEFAULT = WELS_LOG_WARNING ///< default log iLevel in Wels codec
333
334/**
335 * @brief Enumerate the type of slice mode
336 */
337typedef enum {
338 SM_SINGLE_SLICE = 0, ///< | SliceNum==1
339 SM_FIXEDSLCNUM_SLICE = 1, ///< | according to SliceNum | enabled dynamic slicing for multi-thread
340 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.
341 SM_SIZELIMITED_SLICE = 3, ///< | according to SliceSize | slicing according to size, the slicing will be dynamic(have no idea about slice_nums until encoding current frame)
342 SM_RESERVED = 4
343} SliceModeEnum;
344
345/**
346 * @brief Structure for slice argument
347 */
348typedef struct {
349 SliceModeEnum uiSliceMode; ///< by default, uiSliceMode will be SM_SINGLE_SLICE
350 uint32_t
351 uiSliceNum; ///< only used when uiSliceMode=1, when uiSliceNum=0 means auto design it with cpu core number
352 uint32_t
353 uiSliceMbNum[MAX_SLICES_NUM_TMP]; ///< only used when uiSliceMode=2; when =0 means setting one MB row a slice
354 uint32_t uiSliceSizeConstraint; ///< now only used when uiSliceMode=4
355} SSliceArgument;
356
357/**
358* @brief Enumerate the type of video format
359*/
360typedef enum {
368} EVideoFormatSPS; // EVideoFormat is already defined/used elsewhere!
369
370/**
371* @brief Enumerate the type of color primaries
372*/
373typedef enum {
385} EColorPrimaries;
386
387/**
388* @brief Enumerate the type of transfer characteristics
389*/
390typedef enum {
408} ETransferCharacteristics;
409
410/**
411* @brief Enumerate the type of color matrix
412*/
413typedef enum {
426} EColorMatrix;
427
428
429/**
430* @brief Enumerate the type of sample aspect ratio
431*/
432typedef enum {
447
448 ASP_EXT_SAR = 255
449} ESampleAspectRatio;
450
451
452/**
453* @brief Structure for spatial layer configuration
454*/
455typedef struct {
456 int32_t iVideoWidth; ///< width of picture in luminance samples of a layer
457 int32_t iVideoHeight; ///< height of picture in luminance samples of a layer
458 float fFrameRate; ///< frame rate specified for a layer
459 int32_t iSpatialBitrate; ///< target bitrate for a spatial layer, in unit of bps
460 int32_t iMaxSpatialBitrate; ///< maximum bitrate for a spatial layer, in unit of bps
461 EProfileIdc uiProfileIdc; ///< value of profile IDC (PRO_UNKNOWN for auto-detection)
462 ELevelIdc uiLevelIdc; ///< value of profile IDC (0 for auto-detection)
463 int32_t iDLayerQp; ///< value of level IDC (0 for auto-detection)
464
465 SSliceArgument sSliceArgument;
466
467 // Note: members bVideoSignalTypePresent through uiColorMatrix below are also defined in SWelsSPS in parameter_sets.h.
468 bool bVideoSignalTypePresent; // false => do not write any of the following information to the header
469 unsigned char
470 uiVideoFormat; // EVideoFormatSPS; 3 bits in header; 0-5 => component, kpal, ntsc, secam, mac, undef
471 bool bFullRange; // false => analog video data range [16, 235]; true => full data range [0,255]
472 bool bColorDescriptionPresent; // false => do not write any of the following three items to the header
473 unsigned char
474 uiColorPrimaries; // EColorPrimaries; 8 bits in header; 0 - 9 => ???, bt709, undef, ???, bt470m, bt470bg,
475 // smpte170m, smpte240m, film, bt2020
476 unsigned char
477 uiTransferCharacteristics; // ETransferCharacteristics; 8 bits in header; 0 - 15 => ???, bt709, undef, ???, bt470m, bt470bg, smpte170m,
478 // smpte240m, linear, log100, log316, iec61966-2-4, bt1361e, iec61966-2-1, bt2020-10, bt2020-12
479 unsigned char
480 uiColorMatrix; // EColorMatrix; 8 bits in header (corresponds to FFmpeg "colorspace"); 0 - 10 => GBR, bt709,
481 // undef, ???, fcc, bt470bg, smpte170m, smpte240m, YCgCo, bt2020nc, bt2020c
482
483 bool bAspectRatioPresent; ///< aspect ratio present in VUI
484 ESampleAspectRatio eAspectRatio; ///< aspect ratio idc
485 unsigned short sAspectRatioExtWidth; ///< use if aspect ratio idc == 255
486 unsigned short sAspectRatioExtHeight; ///< use if aspect ratio idc == 255
487
488} SSpatialLayerConfig;
489
490/**
491* @brief Encoder usage type
492*/
493typedef enum {
494 CAMERA_VIDEO_REAL_TIME, ///< camera video for real-time communication
495 SCREEN_CONTENT_REAL_TIME, ///< screen content signal
499} EUsageType;
500
501/**
502* @brief Enumulate the complexity mode
503*/
504typedef enum {
505 LOW_COMPLEXITY = 0, ///< the lowest compleixty,the fastest speed,
506 MEDIUM_COMPLEXITY, ///< medium complexity, medium speed,medium quality
507 HIGH_COMPLEXITY ///< high complexity, lowest speed, high quality
508} ECOMPLEXITY_MODE;
509
510/**
511 * @brief Enumulate for the stategy of SPS/PPS strategy
512 */
513typedef enum {
514 CONSTANT_ID = 0, ///< constant id in SPS/PPS
515 INCREASING_ID = 0x01, ///< SPS/PPS id increases at each IDR
516 SPS_LISTING = 0x02, ///< using SPS in the existing list if possible
519} EParameterSetStrategy;
520
521// TODO: Refine the parameters definition.
522/**
523* @brief SVC Encoding Parameters
524*/
525typedef struct TagEncParamBase {
526 EUsageType
527 iUsageType; ///< application type; please refer to the definition of EUsageType
528
529 int32_t iPicWidth; ///< width of picture in luminance samples (the maximum of all layers if multiple spatial layers presents)
530 int32_t iPicHeight; ///< height of picture in luminance samples((the maximum of all layers if multiple spatial layers presents)
531 int32_t iTargetBitrate; ///< target bitrate desired, in unit of bps
532 RC_MODES iRCMode; ///< rate control mode
533 float fMaxFrameRate; ///< maximal input frame rate
534
535} SEncParamBase, *PEncParamBase;
536
537/**
538* @brief SVC Encoding Parameters extention
539*/
540typedef struct TagEncParamExt {
541 EUsageType
542 iUsageType; ///< same as in TagEncParamBase
543
544 int32_t iPicWidth; ///< same as in TagEncParamBase
545 int32_t iPicHeight; ///< same as in TagEncParamBase
546 int32_t iTargetBitrate; ///< same as in TagEncParamBase
547 RC_MODES iRCMode; ///< same as in TagEncParamBase
548 float fMaxFrameRate; ///< same as in TagEncParamBase
549
550 int32_t iTemporalLayerNum; ///< temporal layer number, max temporal layer = 4
551 int32_t iSpatialLayerNum; ///< spatial layer number,1<= iSpatialLayerNum <= MAX_SPATIAL_LAYER_NUM, MAX_SPATIAL_LAYER_NUM = 4
553
554 ECOMPLEXITY_MODE iComplexityMode;
555 uint32_t uiIntraPeriod; ///< period of Intra frame
556 int32_t iNumRefFrame; ///< number of reference frame used
557 EParameterSetStrategy
558 eSpsPpsIdStrategy; ///< different stategy in adjust ID in SPS/PPS: 0- constant ID, 1-additional ID, 6-mapping and additional
559 bool bPrefixNalAddingCtrl; ///< false:not use Prefix NAL; true: use Prefix NAL
560 bool bEnableSSEI; ///< false:not use SSEI; true: use SSEI -- TODO: planning to remove the interface of SSEI
561 bool bSimulcastAVC; ///< (when encoding more than 1 spatial layer) false: use SVC syntax for higher layers; true: use Simulcast AVC
562 int32_t iPaddingFlag; ///< 0:disable padding;1:padding
563 int32_t iEntropyCodingModeFlag; ///< 0:CAVLC 1:CABAC.
564
565 /* rc control */
566 bool bEnableFrameSkip; ///< False: don't skip frame even if VBV buffer overflow.True: allow skipping frames to keep the bitrate within limits
567 int32_t iMaxBitrate; ///< the maximum bitrate, in unit of bps, set it to UNSPECIFIED_BIT_RATE if not needed
568 int32_t iMaxQp; ///< the maximum QP encoder supports
569 int32_t iMinQp; ///< the minmum QP encoder supports
570 uint32_t uiMaxNalSize; ///< the maximum NAL size. This value should be not 0 for dynamic slice mode
571
572 /*LTR settings*/
573 bool bEnableLongTermReference; ///< 1: on, 0: off
574 int32_t iLTRRefNum; ///< the number of LTR(long term reference),TODO: not supported to set it arbitrary yet
575 uint32_t iLtrMarkPeriod; ///< the LTR marked period that is used in feedback.
576 /* multi-thread settings*/
577 unsigned short
578 iMultipleThreadIdc; ///< 1 # 0: auto(dynamic imp. internal encoder); 1: multiple threads imp. disabled; lager than 1: count number of threads;
579 bool bUseLoadBalancing; ///< only used when uiSliceMode=1 or 3, will change slicing of a picture during the run-time of multi-thread encoding, so the result of each run may be different
580
581 /* Deblocking loop filter */
582 int32_t iLoopFilterDisableIdc; ///< 0: on, 1: off, 2: on except for slice boundaries
583 int32_t iLoopFilterAlphaC0Offset; ///< AlphaOffset: valid range [-6, 6], default 0
584 int32_t iLoopFilterBetaOffset; ///< BetaOffset: valid range [-6, 6], default 0
585 /*pre-processing feature*/
586 bool bEnableDenoise; ///< denoise control
587 bool bEnableBackgroundDetection; ///< background detection control //VAA_BACKGROUND_DETECTION //BGD cmd
588 bool bEnableAdaptiveQuant; ///< adaptive quantization control
589 bool bEnableFrameCroppingFlag; ///< enable frame cropping flag: TRUE always in application
591
592 bool bIsLosslessLink; ///< LTR advanced setting
593} SEncParamExt;
594
595/**
596* @brief Define a new struct to show the property of video bitstream.
597*/
598typedef struct {
599 uint32_t size; ///< size of the struct
600 VIDEO_BITSTREAM_TYPE eVideoBsType; ///< video stream type (AVC/SVC)
601} SVideoProperty;
602
603/**
604* @brief SVC Decoding Parameters, reserved here and potential applicable in the future
605*/
606typedef struct TagSVCDecodingParam {
607 char *pFileNameRestructed; ///< file name of reconstructed frame used for PSNR calculation based debug
608
609 uint32_t uiCpuLoad; ///< CPU load
610 unsigned char uiTargetDqLayer; ///< setting target dq layer id
611
612 ERROR_CON_IDC eEcActiveIdc; ///< whether active error concealment feature in decoder
613 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
614
615 SVideoProperty sVideoProperty; ///< video stream property
616 int32_t min_au_size;
617} SDecodingParam, *PDecodingParam;
618
619/**
620* @brief Bitstream inforamtion of a layer being encoded
621*/
622typedef struct {
623 unsigned char uiTemporalId;
624 unsigned char uiSpatialId;
625 unsigned char uiQualityId;
626 EVideoFrameType eFrameType;
627 unsigned char uiLayerType;
628
629 /**
630 * The sub sequence layers are ordered hierarchically based on their dependency on each other so that any picture in a layer shall not be
631 * predicted from any picture on any higher layer.
632 */
633 int32_t iSubSeqId; ///< refer to D.2.11 Sub-sequence information SEI message semantics
634 int32_t iNalCount; ///< count number of NAL coded already
635 int32_t *pNalLengthInByte; ///< length of NAL size in byte from 0 to iNalCount-1
636 unsigned char *pBsBuf; ///< buffer of bitstream contained
637} SLayerBSInfo, *PLayerBSInfo;
638
639/**
640* @brief Frame bit stream info
641*/
642typedef struct {
643 int32_t iLayerNum;
645
646 EVideoFrameType eFrameType;
648 long long uiTimeStamp;
649} SFrameBSInfo, *PFrameBSInfo;
650
651/**
652* @brief Structure for source picture
653*/
654typedef struct Source_Picture_s {
655 int32_t iColorFormat; ///< color space type
656 int32_t iStride[4]; ///< stride for each plane pData
657 unsigned char *pData[4]; ///< plane pData
658 int32_t iPicWidth; ///< luma picture width in x coordinate
659 int32_t iPicHeight; ///< luma picture height in y coordinate
660 long long uiTimeStamp; ///< timestamp of the source picture, unit: millisecond
661} SSourcePicture;
662/**
663* @brief Structure for bit rate info
664*/
665typedef struct TagBitrateInfo {
666 LAYER_NUM iLayer;
667 int32_t iBitrate; ///< the maximum bitrate
668} SBitrateInfo;
669
670/**
671* @brief Structure for dump layer info
672*/
673typedef struct TagDumpLayer {
674 int32_t iLayer;
676} SDumpLayer;
677
678/**
679* @brief Structure for profile info in layer
680*
681*/
682typedef struct TagProfileInfo {
683 int32_t iLayer;
684 EProfileIdc uiProfileIdc; ///< the profile info
685} SProfileInfo;
686
687/**
688* @brief Structure for level info in layer
689*
690*/
691typedef struct TagLevelInfo {
692 int32_t iLayer;
693 ELevelIdc uiLevelIdc; ///< the level info
694} SLevelInfo;
695/**
696* @brief Structure for dilivery status
697*
698*/
699typedef struct TagDeliveryStatus {
700 bool bDeliveryFlag; ///< 0: the previous frame isn't delivered,1: the previous frame is delivered
701 int32_t iDropFrameType; ///< the frame type that is dropped; reserved
702 int32_t iDropFrameSize; ///< the frame size that is dropped; reserved
703} SDeliveryStatus;
704
705/**
706* @brief The capability of decoder, for SDP negotiation
707*/
708typedef struct TagDecoderCapability {
709 int32_t iProfileIdc; ///< profile_idc
710 int32_t iProfileIop; ///< profile-iop
711 int32_t iLevelIdc; ///< level_idc
712 int32_t iMaxMbps; ///< max-mbps
713 int32_t iMaxFs; ///< max-fs
714 int32_t iMaxCpb; ///< max-cpb
715 int32_t iMaxDpb; ///< max-dpb
716 int32_t iMaxBr; ///< max-br
717 bool bRedPicCap; ///< redundant-pic-cap
718} SDecoderCapability;
719
720/**
721* @brief Structure for parse only output
722*/
723typedef struct TagParserBsInfo {
724 int32_t iNalNum; ///< total NAL number in current AU
725 int32_t *pNalLenInByte; ///< each nal length
726 unsigned char *pDstBuff; ///< outputted dst buffer for parsed bitstream
727 int32_t iSpsWidthInPixel; ///< required SPS width info
728 int32_t iSpsHeightInPixel; ///< required SPS height info
729 unsigned long long uiInBsTimeStamp; ///< input BS timestamp
730 unsigned long long uiOutBsTimeStamp; ///< output BS timestamp
731} SParserBsInfo, *PParserBsInfo;
732
733/**
734* @brief Structure for encoder statistics
735*/
737 uint32_t uiWidth; ///< the width of encoded frame
738 uint32_t uiHeight; ///< the height of encoded frame
739 //following standard, will be 16x aligned, if there are multiple spatial, this is of the highest
740 float fAverageFrameSpeedInMs; ///< average_Encoding_Time
741
742 // rate control related
743 float fAverageFrameRate; ///< the average frame rate in, calculate since encoding starts, supposed that the input timestamp is in unit of ms
744 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?
745 uint32_t uiBitRate; ///< sendrate in Bits per second, calculated within the set time-window
746 uint32_t uiAverageFrameQP; ///< the average QP of last encoded frame
747
748 uint32_t uiInputFrameCount; ///< number of frames
749 uint32_t uiSkippedFrameCount; ///< number of frames
750
751 uint32_t uiResolutionChangeTimes; ///< uiResolutionChangeTimes
752 uint32_t uiIDRReqNum; ///< number of IDR requests
753 uint32_t uiIDRSentNum; ///< number of actual IDRs sent
754 uint32_t uiLTRSentNum; ///< number of LTR sent/marked
755
756 long long iStatisticsTs; ///< Timestamp of updating the statistics
757
758 unsigned long iTotalEncodedBytes;
759 unsigned long iLastStatisticsBytes;
761} SEncoderStatistics;
762
763/**
764* @brief Structure for decoder statistics
765*/
767 uint32_t uiWidth; ///< the width of encode/decode frame
768 uint32_t uiHeight; ///< the height of encode/decode frame
769 float fAverageFrameSpeedInMs; ///< average_Decoding_Time
770 float fActualAverageFrameSpeedInMs; ///< actual average_Decoding_Time, including freezing pictures
771 uint32_t uiDecodedFrameCount; ///< number of frames
772 uint32_t uiResolutionChangeTimes; ///< uiResolutionChangeTimes
773 uint32_t uiIDRCorrectNum; ///< number of correct IDR received
774 //EC on related
775 uint32_t
776 uiAvgEcRatio; ///< when EC is on, the average ratio of total EC areas, can be an indicator of reconstruction quality
777 uint32_t
778 uiAvgEcPropRatio; ///< when EC is on, the rough average ratio of propogate EC areas, can be an indicator of reconstruction quality
779 uint32_t uiEcIDRNum; ///< number of actual unintegrity IDR or not received but eced
780 uint32_t uiEcFrameNum; ///<
781 uint32_t uiIDRLostNum; ///< number of whole lost IDR
782 uint32_t
783 uiFreezingIDRNum; ///< number of freezing IDR with error (partly received), under resolution change
784 uint32_t uiFreezingNonIDRNum; ///< number of freezing non-IDR with error
785 int32_t iAvgLumaQp; ///< average luma QP. default: -1, no correct frame outputted
786 int32_t iSpsReportErrorNum; ///< number of Sps Invalid report
787 int32_t iSubSpsReportErrorNum; ///< number of SubSps Invalid report
788 int32_t iPpsReportErrorNum; ///< number of Pps Invalid report
789 int32_t iSpsNoExistNalNum; ///< number of Sps NoExist Nal
790 int32_t iSubSpsNoExistNalNum; ///< number of SubSps NoExist Nal
791 int32_t iPpsNoExistNalNum; ///< number of Pps NoExist Nal
792
793 uint32_t uiProfile; ///< Profile idc in syntax
794 uint32_t uiLevel; ///< level idc according to Annex A-1
795
796 int32_t iCurrentActiveSpsId; ///< current active SPS id
797 int32_t iCurrentActivePpsId; ///< current active PPS id
798
799 uint32_t iStatisticsLogInterval; ///< frame interval of statistics log
800} SDecoderStatistics; // in building, coming soon
801
802/**
803* @brief Structure for sample aspect ratio (SAR) info in VUI
804*/
805typedef struct TagVuiSarInfo {
806 uint32_t uiSarWidth; ///< SAR width
807 uint32_t uiSarHeight; ///< SAR height
808 bool bOverscanAppropriateFlag; ///< SAR overscan flag
809} SVuiSarInfo, *PVuiSarInfo;
810
811#endif//WELS_VIDEO_CODEC_APPLICATION_DEFINITION_H__
#define SAVED_NALUNIT_NUM_TMP
SPS/PPS + SEI/SSEI + PADDING_NAL.
Definition: codec_app_def.h:55
@ CM_RESERVED3
Definition: codec_app_def.h:417
@ CM_BT709
Definition: codec_app_def.h:415
@ CM_BT470BG
Definition: codec_app_def.h:419
@ CM_GBR
Definition: codec_app_def.h:414
@ CM_BT2020NC
Definition: codec_app_def.h:423
@ CM_FCC
Definition: codec_app_def.h:418
@ CM_UNDEF
Definition: codec_app_def.h:416
@ CM_SMPTE170M
Definition: codec_app_def.h:420
@ CM_YCGCO
Definition: codec_app_def.h:422
@ CM_BT2020C
Definition: codec_app_def.h:424
@ CM_SMPTE240M
Definition: codec_app_def.h:421
@ CM_NUM_ENUM
Definition: codec_app_def.h:425
@ SM_RASTER_SLICE
| according to SlicesAssign | need input of MB numbers each slice. In addition, if other constraint i...
Definition: codec_app_def.h:340
@ SM_SINGLE_SLICE
| SliceNum==1
Definition: codec_app_def.h:338
@ SM_SIZELIMITED_SLICE
| according to SliceSize | slicing according to size, the slicing will be dynamic(have no idea about ...
Definition: codec_app_def.h:341
@ SM_RESERVED
Definition: codec_app_def.h:342
@ SM_FIXEDSLCNUM_SLICE
| according to SliceNum | enabled dynamic slicing for multi-thread
Definition: codec_app_def.h:339
@ DECODER_OPTION_VCL_NAL
feedback whether or not have VCL NAL in current AU for application layer
Definition: codec_app_def.h:153
@ DECODER_OPTION_IS_REF_PIC
feedback current frame is ref pic or not
Definition: codec_app_def.h:169
@ DECODER_OPTION_NUM_OF_FRAMES_REMAINING_IN_BUFFER
number of frames remaining in decoder buffer when pictures are required to re-ordered into display-or...
Definition: codec_app_def.h:170
@ DECODER_OPTION_END_OF_STREAM
end of stream flag
Definition: codec_app_def.h:152
@ DECODER_OPTION_TRACE_CALLBACK_CONTEXT
context info of trace callbac
Definition: codec_app_def.h:162
@ DECODER_OPTION_NUM_OF_THREADS
number of decoding threads. The maximum thread count is equal or less than lesser of (cpu core counts...
Definition: codec_app_def.h:171
@ DECODER_OPTION_PROFILE
get current AU profile info, only is used in GetOption
Definition: codec_app_def.h:166
@ DECODER_OPTION_TEMPORAL_ID
feedback temporal id for application layer
Definition: codec_app_def.h:154
@ DECODER_OPTION_IDR_PIC_ID
feedback current frame belong to which IDR period
Definition: codec_app_def.h:156
@ DECODER_OPTION_TRACE_CALLBACK
a void (*)(void* context, int32_t level, const char* message) function which receives log messages
Definition: codec_app_def.h:161
@ DECODER_OPTION_STATISTICS_LOG_INTERVAL
set log output interval
Definition: codec_app_def.h:168
@ DECODER_OPTION_LTR_MARKED_FRAME_NUM
feedback frame num marked by current Frame
Definition: codec_app_def.h:158
@ DECODER_OPTION_ERROR_CON_IDC
indicate decoder error concealment method
Definition: codec_app_def.h:159
@ DECODER_OPTION_LEVEL
get current AU level info,only is used in GetOption
Definition: codec_app_def.h:167
@ DECODER_OPTION_GET_SAR_INFO
feedback decoder Sample Aspect Ratio info in Vui
Definition: codec_app_def.h:165
@ DECODER_OPTION_GET_STATISTICS
feedback decoder statistics
Definition: codec_app_def.h:164
@ DECODER_OPTION_FRAME_NUM
feedback current decoded frame number
Definition: codec_app_def.h:155
@ DECODER_OPTION_LTR_MARKING_FLAG
feedback wether current frame mark a LTR
Definition: codec_app_def.h:157
@ DECODER_OPTION_TRACE_LEVEL
Definition: codec_app_def.h:160
#define MAX_NAL_UNITS_IN_LAYER
predetermined here, adjust it later if need
Definition: codec_app_def.h:49
@ PRO_SCALABLE_HIGH
Definition: codec_app_def.h:292
@ PRO_CAVLC444
Definition: codec_app_def.h:289
@ PRO_UNKNOWN
Definition: codec_app_def.h:281
@ PRO_HIGH422
Definition: codec_app_def.h:287
@ PRO_EXTENDED
Definition: codec_app_def.h:284
@ PRO_HIGH
Definition: codec_app_def.h:285
@ PRO_HIGH444
Definition: codec_app_def.h:288
@ PRO_HIGH10
Definition: codec_app_def.h:286
@ PRO_BASELINE
Definition: codec_app_def.h:282
@ PRO_MAIN
Definition: codec_app_def.h:283
@ PRO_SCALABLE_BASELINE
Definition: codec_app_def.h:291
@ FEEDBACK_VCL_NAL
Definition: codec_app_def.h:192
@ FEEDBACK_UNKNOWN_NAL
Definition: codec_app_def.h:193
@ FEEDBACK_NON_VCL_NAL
Definition: codec_app_def.h:191
@ VF_MAC
Definition: codec_app_def.h:365
@ VF_UNDEF
Definition: codec_app_def.h:366
@ VF_PAL
Definition: codec_app_def.h:362
@ VF_NUM_ENUM
Definition: codec_app_def.h:367
@ VF_COMPONENT
Definition: codec_app_def.h:361
@ VF_SECAM
Definition: codec_app_def.h:364
@ VF_NTSC
Definition: codec_app_def.h:363
@ RC_BUFFERBASED_MODE
no bitrate control,only using buffer status,adjust the video quality
Definition: codec_app_def.h:271
@ RC_QUALITY_MODE
quality mode
Definition: codec_app_def.h:269
@ RC_TIMESTAMP_MODE
Definition: codec_app_def.h:272
@ RC_BITRATE_MODE
bitrate mode
Definition: codec_app_def.h:270
@ RC_BITRATE_MODE_POST_SKIP
this is in-building RC MODE, WILL BE DELETED after algorithm tuning!
Definition: codec_app_def.h:273
@ RC_OFF_MODE
rate control off mode
Definition: codec_app_def.h:274
@ NON_VIDEO_CODING_LAYER
Definition: codec_app_def.h:200
@ VIDEO_CODING_LAYER
Definition: codec_app_def.h:201
@ LEVEL_1_2
Definition: codec_app_def.h:303
@ LEVEL_5_1
Definition: codec_app_def.h:315
@ LEVEL_2_2
Definition: codec_app_def.h:307
@ LEVEL_2_0
Definition: codec_app_def.h:305
@ LEVEL_3_0
Definition: codec_app_def.h:308
@ LEVEL_1_B
Definition: codec_app_def.h:301
@ LEVEL_3_1
Definition: codec_app_def.h:309
@ LEVEL_3_2
Definition: codec_app_def.h:310
@ LEVEL_1_3
Definition: codec_app_def.h:304
@ LEVEL_5_2
Definition: codec_app_def.h:316
@ LEVEL_1_0
Definition: codec_app_def.h:300
@ LEVEL_1_1
Definition: codec_app_def.h:302
@ LEVEL_4_0
Definition: codec_app_def.h:311
@ LEVEL_UNKNOWN
Definition: codec_app_def.h:299
@ LEVEL_4_2
Definition: codec_app_def.h:313
@ LEVEL_5_0
Definition: codec_app_def.h:314
@ LEVEL_2_1
Definition: codec_app_def.h:306
@ LEVEL_4_1
Definition: codec_app_def.h:312
@ NO_RECOVERY_REQUSET
Definition: codec_app_def.h:228
@ LTR_MARKING_SUCCESS
Definition: codec_app_def.h:232
@ NO_LTR_MARKING_FEEDBACK
Definition: codec_app_def.h:231
@ LTR_MARKING_FAILED
Definition: codec_app_def.h:233
@ IDR_RECOVERY_REQUEST
Definition: codec_app_def.h:230
@ LTR_RECOVERY_REQUEST
Definition: codec_app_def.h:229
@ VIDEO_BITSTREAM_SVC
Definition: codec_app_def.h:220
@ VIDEO_BITSTREAM_AVC
Definition: codec_app_def.h:219
@ VIDEO_BITSTREAM_DEFAULT
Definition: codec_app_def.h:221
@ INPUT_CONTENT_TYPE_ALL
Definition: codec_app_def.h:498
@ SCREEN_CONTENT_REAL_TIME
screen content signal
Definition: codec_app_def.h:495
@ CAMERA_VIDEO_REAL_TIME
camera video for real-time communication
Definition: codec_app_def.h:494
@ CAMERA_VIDEO_NON_REAL_TIME
Definition: codec_app_def.h:496
@ SCREEN_CONTENT_NON_REAL_TIME
Definition: codec_app_def.h:497
#define MAX_SPATIAL_LAYER_NUM
Definition: codec_app_def.h:45
@ ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE
Definition: codec_app_def.h:185
@ ERROR_CON_FRAME_COPY_CROSS_IDR
Definition: codec_app_def.h:181
@ ERROR_CON_FRAME_COPY
Definition: codec_app_def.h:179
@ ERROR_CON_SLICE_COPY_CROSS_IDR
Definition: codec_app_def.h:182
@ ERROR_CON_SLICE_COPY
Definition: codec_app_def.h:180
@ ERROR_CON_DISABLE
Definition: codec_app_def.h:178
@ ERROR_CON_SLICE_MV_COPY_CROSS_IDR
Definition: codec_app_def.h:184
@ ERROR_CON_SLICE_COPY_CROSS_IDR_FREEZE_RES_CHANGE
Definition: codec_app_def.h:183
@ CONSTANT_ID
constant id in SPS/PPS
Definition: codec_app_def.h:514
@ INCREASING_ID
SPS/PPS id increases at each IDR.
Definition: codec_app_def.h:515
@ SPS_LISTING_AND_PPS_INCREASING
Definition: codec_app_def.h:517
@ SPS_PPS_LISTING
Definition: codec_app_def.h:518
@ SPS_LISTING
using SPS in the existing list if possible
Definition: codec_app_def.h:516
@ TRC_BT709
Definition: codec_app_def.h:392
@ TRC_BT2020_12
Definition: codec_app_def.h:406
@ TRC_SMPTE240M
Definition: codec_app_def.h:398
@ TRC_BT1361E
Definition: codec_app_def.h:403
@ TRC_BT470BG
Definition: codec_app_def.h:396
@ TRC_NUM_ENUM
Definition: codec_app_def.h:407
@ TRC_LINEAR
Definition: codec_app_def.h:399
@ TRC_LOG100
Definition: codec_app_def.h:400
@ TRC_RESERVED0
Definition: codec_app_def.h:391
@ TRC_SMPTE170M
Definition: codec_app_def.h:397
@ TRC_IEC61966_2_4
Definition: codec_app_def.h:402
@ TRC_LOG316
Definition: codec_app_def.h:401
@ TRC_BT2020_10
Definition: codec_app_def.h:405
@ TRC_BT470M
Definition: codec_app_def.h:395
@ TRC_UNDEF
Definition: codec_app_def.h:393
@ TRC_IEC61966_2_1
Definition: codec_app_def.h:404
@ TRC_RESERVED3
Definition: codec_app_def.h:394
#define MAX_LAYER_NUM_OF_FRAME
Definition: codec_app_def.h:48
#define MAX_SLICES_NUM_TMP
Definition: codec_app_def.h:56
@ MEDIUM_COMPLEXITY
medium complexity, medium speed,medium quality
Definition: codec_app_def.h:506
@ LOW_COMPLEXITY
the lowest compleixty,the fastest speed,
Definition: codec_app_def.h:505
@ HIGH_COMPLEXITY
high complexity, lowest speed, high quality
Definition: codec_app_def.h:507
@ ASP_20x11
Definition: codec_app_def.h:440
@ ASP_10x11
Definition: codec_app_def.h:436
@ ASP_80x33
Definition: codec_app_def.h:442
@ ASP_15x11
Definition: codec_app_def.h:444
@ ASP_24x11
Definition: codec_app_def.h:439
@ ASP_UNSPECIFIED
Definition: codec_app_def.h:433
@ ASP_160x99
Definition: codec_app_def.h:446
@ ASP_EXT_SAR
Definition: codec_app_def.h:448
@ ASP_1x1
Definition: codec_app_def.h:434
@ ASP_40x33
Definition: codec_app_def.h:438
@ ASP_18x11
Definition: codec_app_def.h:443
@ ASP_16x11
Definition: codec_app_def.h:437
@ ASP_12x11
Definition: codec_app_def.h:435
@ ASP_32x11
Definition: codec_app_def.h:441
@ ASP_64x33
Definition: codec_app_def.h:445
@ CP_SMPTE170M
Definition: codec_app_def.h:380
@ CP_NUM_ENUM
Definition: codec_app_def.h:384
@ CP_BT2020
Definition: codec_app_def.h:383
@ CP_UNDEF
Definition: codec_app_def.h:376
@ CP_BT470M
Definition: codec_app_def.h:378
@ CP_BT470BG
Definition: codec_app_def.h:379
@ CP_SMPTE240M
Definition: codec_app_def.h:381
@ CP_RESERVED0
Definition: codec_app_def.h:374
@ CP_FILM
Definition: codec_app_def.h:382
@ CP_RESERVED3
Definition: codec_app_def.h:377
@ CP_BT709
Definition: codec_app_def.h:375
@ WELS_LOG_RESV
resversed log iLevel
Definition: codec_app_def.h:329
@ WELS_LOG_QUIET
quiet mode
Definition: codec_app_def.h:323
@ WELS_LOG_INFO
information log iLevel
Definition: codec_app_def.h:326
@ WELS_LOG_WARNING
Warning log iLevel.
Definition: codec_app_def.h:325
@ WELS_LOG_LEVEL_COUNT
Definition: codec_app_def.h:330
@ WELS_LOG_ERROR
error log iLevel
Definition: codec_app_def.h:324
@ WELS_LOG_DEBUG
debug log, critical algo log
Definition: codec_app_def.h:327
@ WELS_LOG_DEFAULT
default log iLevel in Wels codec
Definition: codec_app_def.h:331
@ WELS_LOG_DETAIL
per packet/frame log
Definition: codec_app_def.h:328
@ SPATIAL_LAYER_2
Definition: codec_app_def.h:210
@ SPATIAL_LAYER_3
Definition: codec_app_def.h:211
@ SPATIAL_LAYER_0
Definition: codec_app_def.h:208
@ SPATIAL_LAYER_ALL
Definition: codec_app_def.h:212
@ SPATIAL_LAYER_1
Definition: codec_app_def.h:209
@ ENCODER_OPTION_ENABLE_SSEI
enable SSEI: true–enable ssei; false–disable ssei
Definition: codec_app_def.h:130
@ ENCODER_OPTION_INTER_SPATIAL_PRED
Definition: codec_app_def.h:114
@ ENCODER_LTR_MARKING_PERIOD
Definition: codec_app_def.h:126
@ ENCODER_OPTION_GET_STATISTICS
read only
Definition: codec_app_def.h:140
@ ENCODER_OPTION_DUMP_FILE
dump layer reconstruct frame to a specified file
Definition: codec_app_def.h:135
@ ENCODER_OPTION_TRACE_CALLBACK_CONTEXT
context info of trace callback
Definition: codec_app_def.h:138
@ ENCODER_LTR_RECOVERY_REQUEST
Definition: codec_app_def.h:124
@ ENCODER_OPTION_ENABLE_PREFIX_NAL_ADDING
enable prefix: true–enable prefix; false–disable prefix
Definition: codec_app_def.h:131
@ ENCODER_LTR_MARKING_FEEDBACK
Definition: codec_app_def.h:125
@ ENCODER_OPTION_RC_FRAME_SKIP
Definition: codec_app_def.h:116
@ ENCODER_OPTION_TRACE_CALLBACK
a void (*)(void* context, int32_t level, const char* message) function which receives log messages
Definition: codec_app_def.h:137
@ ENCODER_OPTION_FRAME_RATE
maximal input frame rate, current supported range: MAX_FRAME_RATE = 30,MIN_FRAME_RATE = 1
Definition: codec_app_def.h:111
@ ENCODER_OPTION_BITS_VARY_PERCENTAGE
bit vary percentage
Definition: codec_app_def.h:145
@ ENCODER_OPTION_LEVEL
assgin the level for each layer
Definition: codec_app_def.h:120
@ ENCODER_OPTION_IDR_INTERVAL
IDR period,0/-1 means no Intra period (only the first frame); lager than 0 means the desired IDR peri...
Definition: codec_app_def.h:108
@ ENCODER_OPTION_IS_LOSSLESS_LINK
advanced algorithmetic settings
Definition: codec_app_def.h:143
@ ENCODER_OPTION_COMPLEXITY
Definition: codec_app_def.h:128
@ ENCODER_OPTION_TRACE_LEVEL
trace info based on the trace level
Definition: codec_app_def.h:136
@ ENCODER_OPTION_BITRATE
Definition: codec_app_def.h:112
@ ENCODER_OPTION_RC_MODE
Definition: codec_app_def.h:115
@ ENCODER_OPTION_LTR
0:disable LTR;larger than 0 enable LTR; LTR number is fixed to be 2 in current encoder
Definition: codec_app_def.h:127
@ ENCODER_OPTION_SVC_ENCODE_PARAM_EXT
structure of Extension Param
Definition: codec_app_def.h:110
@ ENCODER_OPTION_CURRENT_PATH
Definition: codec_app_def.h:134
@ ENCODER_OPTION_DATAFORMAT
Definition: codec_app_def.h:107
@ ENCODER_OPTION_MAX_BITRATE
Definition: codec_app_def.h:113
@ ENCODER_OPTION_PROFILE
assgin the profile for each layer
Definition: codec_app_def.h:119
@ ENCODER_OPTION_STATISTICS_LOG_INTERVAL
log interval in millisecond
Definition: codec_app_def.h:141
@ ENCODER_OPTION_NUMBER_REF
the number of refererence frame
Definition: codec_app_def.h:121
@ ENCODER_OPTION_SVC_ENCODE_PARAM_BASE
structure of Base Param
Definition: codec_app_def.h:109
@ ENCODER_OPTION_SPS_PPS_ID_STRATEGY
different stategy in adjust ID in SPS/PPS: 0- constant ID, 1-additional ID, 6-mapping and additional
Definition: codec_app_def.h:132
@ ENCODER_PADDING_PADDING
0:disable padding;1:padding
Definition: codec_app_def.h:117
@ ENCODER_OPTION_DELIVERY_STATUS
the delivery info which is a feedback from app level
Definition: codec_app_def.h:122
#define MAX_QUALITY_LAYER_NUM
Definition: codec_app_def.h:46
@ dsBitstreamError
error bitstreams(maybe broken internal frame) the decoder cared
Definition: codec_app_def.h:84
@ dsDataErrorConcealed
current data error concealed specified
Definition: codec_app_def.h:87
@ dsInitialOptExpected
initializing operation is expected
Definition: codec_app_def.h:94
@ dsFramePending
need more throughput to generate a frame output,
Definition: codec_app_def.h:82
@ dsRefLost
layer lost at reference frame with temporal id 0
Definition: codec_app_def.h:83
@ dsDepLayerLost
dependented layer is ever lost
Definition: codec_app_def.h:85
@ dsOutOfMemory
out of memory due to new request
Definition: codec_app_def.h:95
@ dsErrorFree
bit stream error-free
Definition: codec_app_def.h:81
@ dsInvalidArgument
invalid argument specified
Definition: codec_app_def.h:93
@ dsNoParamSets
no parameter set NALs involved
Definition: codec_app_def.h:86
@ dsDstBufNeedExpan
actual picture size exceeds size of dst pBuffer feed in decoder, so need expand its size
Definition: codec_app_def.h:99
@ dsRefListNullPtrs
ref picure list contains null ptrs within uiRefCount range
Definition: codec_app_def.h:88
long long uiTimeStamp
Definition: codec_app_def.h:648
SLayerBSInfo sLayerInfo[128]
Definition: codec_app_def.h:644
int32_t iLayerNum
Definition: codec_app_def.h:643
int32_t iFrameSizeInBytes
Definition: codec_app_def.h:647
EVideoFrameType eFrameType
Definition: codec_app_def.h:646
bool bEnableLongTermReference
1: on, 0: off
Definition: codec_app_def.h:261
int32_t iLTRRefNum
TODO: not supported to set it arbitrary yet.
Definition: codec_app_def.h:262
int32_t iLayerId
Definition: codec_app_def.h:254
uint32_t uiFeedbackType
mark failed or successful
Definition: codec_app_def.h:251
int32_t iLTRFrameNum
specify current decoder frame_num
Definition: codec_app_def.h:253
uint32_t uiIDRPicId
distinguish request from different IDR
Definition: codec_app_def.h:252
int32_t iLayerId
Definition: codec_app_def.h:244
uint32_t uiFeedbackType
IDR request or LTR recovery request.
Definition: codec_app_def.h:240
int32_t iCurrentFrameNum
specify current decoder frame_num.
Definition: codec_app_def.h:243
uint32_t uiIDRPicId
distinguish request from different IDR
Definition: codec_app_def.h:241
int32_t iLastCorrectFrameNum
Definition: codec_app_def.h:242
unsigned char uiLayerType
Definition: codec_app_def.h:627
int32_t * pNalLengthInByte
length of NAL size in byte from 0 to iNalCount-1
Definition: codec_app_def.h:635
int32_t iSubSeqId
refer to D.2.11 Sub-sequence information SEI message semantics
Definition: codec_app_def.h:633
unsigned char uiTemporalId
Definition: codec_app_def.h:623
unsigned char * pBsBuf
buffer of bitstream contained
Definition: codec_app_def.h:636
int32_t iNalCount
count number of NAL coded already
Definition: codec_app_def.h:634
unsigned char uiSpatialId
Definition: codec_app_def.h:624
unsigned char uiQualityId
Definition: codec_app_def.h:625
EVideoFrameType eFrameType
Definition: codec_app_def.h:626
uint32_t uiSliceMbNum[((128 -((4 *4)+1+4))/3)]
only used when uiSliceMode=2; when =0 means setting one MB row a slice
Definition: codec_app_def.h:353
uint32_t uiSliceSizeConstraint
now only used when uiSliceMode=4
Definition: codec_app_def.h:354
SliceModeEnum uiSliceMode
by default, uiSliceMode will be SM_SINGLE_SLICE
Definition: codec_app_def.h:349
uint32_t uiSliceNum
only used when uiSliceMode=1, when uiSliceNum=0 means auto design it with cpu core number
Definition: codec_app_def.h:351
ESampleAspectRatio eAspectRatio
aspect ratio idc
Definition: codec_app_def.h:484
int32_t iSpatialBitrate
target bitrate for a spatial layer, in unit of bps
Definition: codec_app_def.h:459
int32_t iVideoHeight
height of picture in luminance samples of a layer
Definition: codec_app_def.h:457
bool bColorDescriptionPresent
Definition: codec_app_def.h:472
float fFrameRate
frame rate specified for a layer
Definition: codec_app_def.h:458
unsigned short sAspectRatioExtHeight
use if aspect ratio idc == 255
Definition: codec_app_def.h:486
EProfileIdc uiProfileIdc
value of profile IDC (PRO_UNKNOWN for auto-detection)
Definition: codec_app_def.h:461
unsigned short sAspectRatioExtWidth
use if aspect ratio idc == 255
Definition: codec_app_def.h:485
int32_t iVideoWidth
width of picture in luminance samples of a layer
Definition: codec_app_def.h:456
unsigned char uiTransferCharacteristics
Definition: codec_app_def.h:477
bool bVideoSignalTypePresent
Definition: codec_app_def.h:468
SSliceArgument sSliceArgument
Definition: codec_app_def.h:465
int32_t iDLayerQp
value of level IDC (0 for auto-detection)
Definition: codec_app_def.h:463
ELevelIdc uiLevelIdc
value of profile IDC (0 for auto-detection)
Definition: codec_app_def.h:462
int32_t iMaxSpatialBitrate
maximum bitrate for a spatial layer, in unit of bps
Definition: codec_app_def.h:460
unsigned char uiColorPrimaries
Definition: codec_app_def.h:474
bool bAspectRatioPresent
aspect ratio present in VUI
Definition: codec_app_def.h:483
unsigned char uiVideoFormat
Definition: codec_app_def.h:470
bool bFullRange
Definition: codec_app_def.h:471
unsigned char uiColorMatrix
Definition: codec_app_def.h:480
VIDEO_BITSTREAM_TYPE eVideoBsType
video stream type (AVC/SVC)
Definition: codec_app_def.h:600
uint32_t size
size of the struct
Definition: codec_app_def.h:599
Structure for source picture.
Definition: codec_app_def.h:654
long long uiTimeStamp
timestamp of the source picture, unit: millisecond
Definition: codec_app_def.h:660
int32_t iPicWidth
luma picture width in x coordinate
Definition: codec_app_def.h:658
unsigned char * pData[4]
plane pData
Definition: codec_app_def.h:657
int32_t iStride[4]
stride for each plane pData
Definition: codec_app_def.h:656
int32_t iColorFormat
color space type
Definition: codec_app_def.h:655
int32_t iPicHeight
luma picture height in y coordinate
Definition: codec_app_def.h:659
Structure for bit rate info.
Definition: codec_app_def.h:665
int32_t iBitrate
the maximum bitrate
Definition: codec_app_def.h:667
LAYER_NUM iLayer
Definition: codec_app_def.h:666
The capability of decoder, for SDP negotiation.
Definition: codec_app_def.h:708
bool bRedPicCap
redundant-pic-cap
Definition: codec_app_def.h:717
int32_t iMaxCpb
max-cpb
Definition: codec_app_def.h:714
int32_t iMaxMbps
max-mbps
Definition: codec_app_def.h:712
int32_t iMaxBr
max-br
Definition: codec_app_def.h:716
int32_t iLevelIdc
level_idc
Definition: codec_app_def.h:711
int32_t iProfileIop
profile-iop
Definition: codec_app_def.h:710
int32_t iProfileIdc
profile_idc
Definition: codec_app_def.h:709
int32_t iMaxDpb
max-dpb
Definition: codec_app_def.h:715
int32_t iMaxFs
max-fs
Definition: codec_app_def.h:713
Structure for dilivery status.
Definition: codec_app_def.h:699
int32_t iDropFrameSize
the frame size that is dropped; reserved
Definition: codec_app_def.h:702
int32_t iDropFrameType
the frame type that is dropped; reserved
Definition: codec_app_def.h:701
bool bDeliveryFlag
0: the previous frame isn't delivered,1: the previous frame is delivered
Definition: codec_app_def.h:700
Structure for dump layer info.
Definition: codec_app_def.h:673
char * pFileName
Definition: codec_app_def.h:675
int32_t iLayer
Definition: codec_app_def.h:674
SVC Encoding Parameters.
Definition: codec_app_def.h:525
int32_t iPicWidth
width of picture in luminance samples (the maximum of all layers if multiple spatial layers presents)
Definition: codec_app_def.h:529
int32_t iTargetBitrate
target bitrate desired, in unit of bps
Definition: codec_app_def.h:531
int32_t iPicHeight
height of picture in luminance samples((the maximum of all layers if multiple spatial layers presents...
Definition: codec_app_def.h:530
RC_MODES iRCMode
rate control mode
Definition: codec_app_def.h:532
EUsageType iUsageType
application type; please refer to the definition of EUsageType
Definition: codec_app_def.h:527
float fMaxFrameRate
maximal input frame rate
Definition: codec_app_def.h:533
SVC Encoding Parameters extention.
Definition: codec_app_def.h:540
bool bEnableAdaptiveQuant
adaptive quantization control
Definition: codec_app_def.h:588
int32_t iLoopFilterBetaOffset
BetaOffset: valid range [-6, 6], default 0.
Definition: codec_app_def.h:584
int32_t iNumRefFrame
number of reference frame used
Definition: codec_app_def.h:556
int32_t iPicWidth
same as in TagEncParamBase
Definition: codec_app_def.h:544
ECOMPLEXITY_MODE iComplexityMode
Definition: codec_app_def.h:554
int32_t iEntropyCodingModeFlag
0:CAVLC 1:CABAC.
Definition: codec_app_def.h:563
bool bPrefixNalAddingCtrl
false:not use Prefix NAL; true: use Prefix NAL
Definition: codec_app_def.h:559
bool bUseLoadBalancing
only used when uiSliceMode=1 or 3, will change slicing of a picture during the run-time of multi-thre...
Definition: codec_app_def.h:579
bool bEnableLongTermReference
1: on, 0: off
Definition: codec_app_def.h:573
bool bIsLosslessLink
LTR advanced setting.
Definition: codec_app_def.h:592
bool bEnableBackgroundDetection
background detection control //VAA_BACKGROUND_DETECTION //BGD cmd
Definition: codec_app_def.h:587
bool bEnableFrameCroppingFlag
enable frame cropping flag: TRUE always in application
Definition: codec_app_def.h:589
uint32_t uiMaxNalSize
the maximum NAL size. This value should be not 0 for dynamic slice mode
Definition: codec_app_def.h:570
bool bEnableSceneChangeDetect
Definition: codec_app_def.h:590
bool bSimulcastAVC
(when encoding more than 1 spatial layer) false: use SVC syntax for higher layers; true: use Simulcas...
Definition: codec_app_def.h:561
bool bEnableFrameSkip
False: don't skip frame even if VBV buffer overflow.True: allow skipping frames to keep the bitrate w...
Definition: codec_app_def.h:566
EParameterSetStrategy eSpsPpsIdStrategy
different stategy in adjust ID in SPS/PPS: 0- constant ID, 1-additional ID, 6-mapping and additional
Definition: codec_app_def.h:558
int32_t iPaddingFlag
0:disable padding;1:padding
Definition: codec_app_def.h:562
int32_t iTemporalLayerNum
temporal layer number, max temporal layer = 4
Definition: codec_app_def.h:550
int32_t iSpatialLayerNum
spatial layer number,1<= iSpatialLayerNum <= MAX_SPATIAL_LAYER_NUM, MAX_SPATIAL_LAYER_NUM = 4
Definition: codec_app_def.h:551
int32_t iLTRRefNum
the number of LTR(long term reference),TODO: not supported to set it arbitrary yet
Definition: codec_app_def.h:574
int32_t iMinQp
the minmum QP encoder supports
Definition: codec_app_def.h:569
bool bEnableDenoise
denoise control
Definition: codec_app_def.h:586
int32_t iLoopFilterDisableIdc
0: on, 1: off, 2: on except for slice boundaries
Definition: codec_app_def.h:582
int32_t iMaxQp
the maximum QP encoder supports
Definition: codec_app_def.h:568
int32_t iLoopFilterAlphaC0Offset
AlphaOffset: valid range [-6, 6], default 0.
Definition: codec_app_def.h:583
SSpatialLayerConfig sSpatialLayers[4]
Definition: codec_app_def.h:552
int32_t iMaxBitrate
the maximum bitrate, in unit of bps, set it to UNSPECIFIED_BIT_RATE if not needed
Definition: codec_app_def.h:567
unsigned short iMultipleThreadIdc
1 # 0: auto(dynamic imp. internal encoder); 1: multiple threads imp. disabled; lager than 1: count nu...
Definition: codec_app_def.h:578
uint32_t uiIntraPeriod
period of Intra frame
Definition: codec_app_def.h:555
int32_t iTargetBitrate
same as in TagEncParamBase
Definition: codec_app_def.h:546
uint32_t iLtrMarkPeriod
the LTR marked period that is used in feedback.
Definition: codec_app_def.h:575
int32_t iPicHeight
same as in TagEncParamBase
Definition: codec_app_def.h:545
RC_MODES iRCMode
same as in TagEncParamBase
Definition: codec_app_def.h:547
bool bEnableSSEI
false:not use SSEI; true: use SSEI – TODO: planning to remove the interface of SSEI
Definition: codec_app_def.h:560
EUsageType iUsageType
same as in TagEncParamBase
Definition: codec_app_def.h:542
float fMaxFrameRate
same as in TagEncParamBase
Definition: codec_app_def.h:548
Structure for level info in layer.
Definition: codec_app_def.h:691
int32_t iLayer
Definition: codec_app_def.h:692
ELevelIdc uiLevelIdc
the level info
Definition: codec_app_def.h:693
Structure for parse only output.
Definition: codec_app_def.h:723
int32_t * pNalLenInByte
each nal length
Definition: codec_app_def.h:725
unsigned long long uiInBsTimeStamp
input BS timestamp
Definition: codec_app_def.h:729
int32_t iNalNum
total NAL number in current AU
Definition: codec_app_def.h:724
int32_t iSpsWidthInPixel
required SPS width info
Definition: codec_app_def.h:727
int32_t iSpsHeightInPixel
required SPS height info
Definition: codec_app_def.h:728
unsigned long long uiOutBsTimeStamp
output BS timestamp
Definition: codec_app_def.h:730
unsigned char * pDstBuff
outputted dst buffer for parsed bitstream
Definition: codec_app_def.h:726
Structure for profile info in layer.
Definition: codec_app_def.h:682
EProfileIdc uiProfileIdc
the profile info
Definition: codec_app_def.h:684
int32_t iLayer
Definition: codec_app_def.h:683
SVC Decoding Parameters, reserved here and potential applicable in the future.
Definition: codec_app_def.h:606
uint32_t uiCpuLoad
CPU load.
Definition: codec_app_def.h:609
SVideoProperty sVideoProperty
video stream property
Definition: codec_app_def.h:615
bool bParseOnly
decoder for parse only, no reconstruction. When it is true, SPS/PPS size should not exceed SPS_PPS_BS...
Definition: codec_app_def.h:613
ERROR_CON_IDC eEcActiveIdc
whether active error concealment feature in decoder
Definition: codec_app_def.h:612
unsigned char uiTargetDqLayer
setting target dq layer id
Definition: codec_app_def.h:610
char * pFileNameRestructed
file name of reconstructed frame used for PSNR calculation based debug
Definition: codec_app_def.h:607
int32_t min_au_size
Definition: codec_app_def.h:616
Structure for decoder statistics.
Definition: codec_app_def.h:766
int32_t iSubSpsReportErrorNum
number of SubSps Invalid report
Definition: codec_app_def.h:787
uint32_t uiDecodedFrameCount
number of frames
Definition: codec_app_def.h:771
uint32_t uiProfile
Profile idc in syntax.
Definition: codec_app_def.h:793
uint32_t uiAvgEcRatio
when EC is on, the average ratio of total EC areas, can be an indicator of reconstruction quality
Definition: codec_app_def.h:776
uint32_t uiLevel
level idc according to Annex A-1
Definition: codec_app_def.h:794
int32_t iPpsReportErrorNum
number of Pps Invalid report
Definition: codec_app_def.h:788
uint32_t uiResolutionChangeTimes
uiResolutionChangeTimes
Definition: codec_app_def.h:772
uint32_t uiIDRLostNum
number of whole lost IDR
Definition: codec_app_def.h:781
uint32_t uiEcIDRNum
number of actual unintegrity IDR or not received but eced
Definition: codec_app_def.h:779
int32_t iSpsNoExistNalNum
number of Sps NoExist Nal
Definition: codec_app_def.h:789
int32_t iCurrentActiveSpsId
current active SPS id
Definition: codec_app_def.h:796
int32_t iSpsReportErrorNum
number of Sps Invalid report
Definition: codec_app_def.h:786
uint32_t uiFreezingIDRNum
number of freezing IDR with error (partly received), under resolution change
Definition: codec_app_def.h:783
int32_t iAvgLumaQp
average luma QP. default: -1, no correct frame outputted
Definition: codec_app_def.h:785
uint32_t uiWidth
the width of encode/decode frame
Definition: codec_app_def.h:767
float fActualAverageFrameSpeedInMs
actual average_Decoding_Time, including freezing pictures
Definition: codec_app_def.h:770
int32_t iPpsNoExistNalNum
number of Pps NoExist Nal
Definition: codec_app_def.h:791
uint32_t uiIDRCorrectNum
number of correct IDR received
Definition: codec_app_def.h:773
uint32_t uiEcFrameNum
Definition: codec_app_def.h:780
float fAverageFrameSpeedInMs
average_Decoding_Time
Definition: codec_app_def.h:769
uint32_t uiFreezingNonIDRNum
number of freezing non-IDR with error
Definition: codec_app_def.h:784
uint32_t uiHeight
the height of encode/decode frame
Definition: codec_app_def.h:768
uint32_t iStatisticsLogInterval
frame interval of statistics log
Definition: codec_app_def.h:799
uint32_t uiAvgEcPropRatio
when EC is on, the rough average ratio of propogate EC areas, can be an indicator of reconstruction q...
Definition: codec_app_def.h:778
int32_t iSubSpsNoExistNalNum
number of SubSps NoExist Nal
Definition: codec_app_def.h:790
int32_t iCurrentActivePpsId
current active PPS id
Definition: codec_app_def.h:797
Structure for encoder statistics.
Definition: codec_app_def.h:736
uint32_t uiInputFrameCount
number of frames
Definition: codec_app_def.h:748
uint32_t uiLTRSentNum
number of LTR sent/marked
Definition: codec_app_def.h:754
uint32_t uiResolutionChangeTimes
uiResolutionChangeTimes
Definition: codec_app_def.h:751
unsigned long iTotalEncodedBytes
Definition: codec_app_def.h:758
unsigned long iLastStatisticsFrameCount
Definition: codec_app_def.h:760
uint32_t uiBitRate
sendrate in Bits per second, calculated within the set time-window
Definition: codec_app_def.h:745
uint32_t uiIDRReqNum
number of IDR requests
Definition: codec_app_def.h:752
uint32_t uiIDRSentNum
number of actual IDRs sent
Definition: codec_app_def.h:753
uint32_t uiWidth
the width of encoded frame
Definition: codec_app_def.h:737
unsigned long iLastStatisticsBytes
Definition: codec_app_def.h:759
uint32_t uiAverageFrameQP
the average QP of last encoded frame
Definition: codec_app_def.h:746
float fAverageFrameRate
the average frame rate in, calculate since encoding starts, supposed that the input timestamp is in u...
Definition: codec_app_def.h:743
float fAverageFrameSpeedInMs
average_Encoding_Time
Definition: codec_app_def.h:740
uint32_t uiSkippedFrameCount
number of frames
Definition: codec_app_def.h:749
uint32_t uiHeight
the height of encoded frame
Definition: codec_app_def.h:738
long long iStatisticsTs
Timestamp of updating the statistics.
Definition: codec_app_def.h:756
float fLatestFrameRate
the frame rate in, in the last second, supposed that the input timestamp is in unit of ms (?...
Definition: codec_app_def.h:744
Structure for sample aspect ratio (SAR) info in VUI.
Definition: codec_app_def.h:805
uint32_t uiSarWidth
SAR width.
Definition: codec_app_def.h:806
bool bOverscanAppropriateFlag
SAR overscan flag.
Definition: codec_app_def.h:808
uint32_t uiSarHeight
SAR height.
Definition: codec_app_def.h:807
Struct of OpenH264 version.
Definition: codec_app_def.h:67
uint32_t uRevision
The revision number.
Definition: codec_app_def.h:70
uint32_t uMajor
The major version number.
Definition: codec_app_def.h:68
uint32_t uMinor
The minor version number.
Definition: codec_app_def.h:69
uint32_t uReserved
The reserved number, it should be 0.
Definition: codec_app_def.h:71