Home | History | Annotate | Download | only in videoencoder
      1 /*
      2 * Copyright (c) 2009-2011 Intel Corporation.  All rights reserved.
      3 *
      4 * Licensed under the Apache License, Version 2.0 (the "License");
      5 * you may not use this file except in compliance with the License.
      6 * You may obtain a copy of the License at
      7 *
      8 * http://www.apache.org/licenses/LICENSE-2.0
      9 *
     10 * Unless required by applicable law or agreed to in writing, software
     11 * distributed under the License is distributed on an "AS IS" BASIS,
     12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 * See the License for the specific language governing permissions and
     14 * limitations under the License.
     15 */
     16 
     17 #ifndef __VIDEO_ENCODER_DEF_H__
     18 #define __VIDEO_ENCODER_DEF_H__
     19 
     20 #include <stdint.h>
     21 
     22 #define STRING_TO_FOURCC(format) ((uint32_t)(((format)[0])|((format)[1]<<8)|((format)[2]<<16)|((format)[3]<<24)))
     23 
     24 typedef int32_t Encode_Status;
     25 
     26 // Video encode error code
     27 enum {
     28     ENCODE_INVALID_SURFACE = -11,
     29     ENCODE_NO_REQUEST_DATA = -10,
     30     ENCODE_WRONG_STATE = -9,
     31     ENCODE_NOTIMPL = -8,
     32     ENCODE_NO_MEMORY = -7,
     33     ENCODE_NOT_INIT = -6,
     34     ENCODE_DRIVER_FAIL = -5,
     35     ENCODE_INVALID_PARAMS = -4,
     36     ENCODE_NOT_SUPPORTED = -3,
     37     ENCODE_NULL_PTR = -2,
     38     ENCODE_FAIL = -1,
     39     ENCODE_SUCCESS = 0,
     40     ENCODE_ALREADY_INIT = 1,
     41     ENCODE_SLICESIZE_OVERFLOW = 2,
     42     ENCODE_BUFFER_TOO_SMALL = 3, // The buffer passed to encode is too small to contain encoded data
     43     ENCODE_DEVICE_BUSY = 4,
     44     ENCODE_DATA_NOT_READY = 5,
     45 };
     46 
     47 typedef enum {
     48     OUTPUT_EVERYTHING = 0,  //Output whatever driver generates
     49     OUTPUT_CODEC_DATA = 1,
     50     OUTPUT_FRAME_DATA = 2, //Equal to OUTPUT_EVERYTHING when no header along with the frame data
     51     OUTPUT_ONE_NAL = 4,
     52     OUTPUT_ONE_NAL_WITHOUT_STARTCODE = 8,
     53     OUTPUT_LENGTH_PREFIXED = 16,
     54     OUTPUT_CODEDBUFFER = 32,
     55     OUTPUT_NALULENGTHS_PREFIXED = 64,
     56     OUTPUT_BUFFER_LAST
     57 } VideoOutputFormat;
     58 
     59 typedef enum {
     60     RAW_FORMAT_NONE = 0,
     61     RAW_FORMAT_YUV420 = 1,
     62     RAW_FORMAT_YUV422 = 2,
     63     RAW_FORMAT_YUV444 = 4,
     64     RAW_FORMAT_NV12 = 8,
     65     RAW_FORMAT_RGBA = 16,
     66     RAW_FORMAT_OPAQUE = 32,
     67     RAW_FORMAT_PROTECTED = 0x80000000,
     68     RAW_FORMAT_LAST
     69 } VideoRawFormat;
     70 
     71 typedef enum {
     72     RATE_CONTROL_NONE = 1,
     73     RATE_CONTROL_CBR = 2,
     74     RATE_CONTROL_VBR = 4,
     75     RATE_CONTROL_VCM = 8,
     76     RATE_CONTROL_LAST
     77 } VideoRateControl;
     78 
     79 typedef enum {
     80     PROFILE_MPEG2SIMPLE = 0,
     81     PROFILE_MPEG2MAIN,
     82     PROFILE_MPEG4SIMPLE,
     83     PROFILE_MPEG4ADVANCEDSIMPLE,
     84     PROFILE_MPEG4MAIN,
     85     PROFILE_H264BASELINE,
     86     PROFILE_H264MAIN,
     87     PROFILE_H264HIGH,
     88     PROFILE_VC1SIMPLE,
     89     PROFILE_VC1MAIN,
     90     PROFILE_VC1ADVANCED,
     91     PROFILE_H263BASELINE
     92 } VideoProfile;
     93 
     94 typedef enum {
     95     AVC_DELIMITER_LENGTHPREFIX = 0,
     96     AVC_DELIMITER_ANNEXB
     97 } AVCDelimiterType;
     98 
     99 typedef enum {
    100     VIDEO_ENC_NONIR,       // Non intra refresh
    101     VIDEO_ENC_CIR, 		// Cyclic intra refresh
    102     VIDEO_ENC_AIR, 		// Adaptive intra refresh
    103     VIDEO_ENC_BOTH,
    104     VIDEO_ENC_LAST
    105 } VideoIntraRefreshType;
    106 
    107 enum VideoBufferSharingMode {
    108     BUFFER_SHARING_NONE = 1, //Means non shared buffer mode
    109     BUFFER_SHARING_CI = 2,
    110     BUFFER_SHARING_V4L2 = 4,
    111     BUFFER_SHARING_SURFACE = 8,
    112     BUFFER_SHARING_USRPTR = 16,
    113     BUFFER_SHARING_GFXHANDLE = 32,
    114     BUFFER_SHARING_KBUFHANDLE = 64,
    115     BUFFER_LAST
    116 };
    117 
    118 typedef enum {
    119     FTYPE_UNKNOWN = 0, // Unknown
    120     FTYPE_I = 1, // General I-frame type
    121     FTYPE_P = 2, // General P-frame type
    122     FTYPE_B = 3, // General B-frame type
    123     FTYPE_SI = 4, // H.263 SI-frame type
    124     FTYPE_SP = 5, // H.263 SP-frame type
    125     FTYPE_EI = 6, // H.264 EI-frame type
    126     FTYPE_EP = 7, // H.264 EP-frame type
    127     FTYPE_S = 8, // MPEG-4 S-frame type
    128     FTYPE_IDR = 9, // IDR-frame type
    129 }FrameType;
    130 
    131 //function call mode
    132 #define FUNC_BLOCK        0xFFFFFFFF
    133 #define FUNC_NONBLOCK        0
    134 
    135 // Output buffer flag
    136 #define ENCODE_BUFFERFLAG_ENDOFFRAME       0x00000001
    137 #define ENCODE_BUFFERFLAG_PARTIALFRAME     0x00000002
    138 #define ENCODE_BUFFERFLAG_SYNCFRAME        0x00000004
    139 #define ENCODE_BUFFERFLAG_CODECCONFIG      0x00000008
    140 #define ENCODE_BUFFERFLAG_DATACORRUPT      0x00000010
    141 #define ENCODE_BUFFERFLAG_DATAINVALID      0x00000020
    142 #define ENCODE_BUFFERFLAG_SLICEOVERFOLOW   0x00000040
    143 #define ENCODE_BUFFERFLAG_ENDOFSTREAM     0x00000080
    144 #define ENCODE_BUFFERFLAG_NSTOPFRAME        0x00000100
    145 
    146 typedef struct {
    147     uint8_t *data;
    148     uint32_t bufferSize; //buffer size
    149     uint32_t dataSize; //actual size
    150     uint32_t offset; //buffer offset
    151     uint32_t remainingSize;
    152     int flag; //Key frame, Codec Data etc
    153     VideoOutputFormat format; //output format
    154     int64_t timeStamp; //reserved
    155     FrameType type;
    156     void *priv; //indicate corresponding input data
    157 } VideoEncOutputBuffer;
    158 
    159 typedef struct {
    160     uint8_t *data;
    161     uint32_t size;
    162     bool bufAvailable; //To indicate whether this buffer can be reused
    163     int64_t timeStamp; //reserved
    164     FrameType type; //frame type expected to be encoded
    165     int flag; // flag to indicate buffer property
    166     void *priv; //indicate corresponding input data
    167 } VideoEncRawBuffer;
    168 
    169 struct VideoEncSurfaceBuffer {
    170     VASurfaceID surface;
    171     uint8_t *usrptr;
    172     uint32_t index;
    173     bool bufAvailable;
    174     VideoEncSurfaceBuffer *next;
    175 };
    176 
    177 struct CirParams {
    178     uint32_t cir_num_mbs;
    179 
    180     CirParams &operator=(const CirParams &other) {
    181         if (this == &other) return *this;
    182 
    183         this->cir_num_mbs = other.cir_num_mbs;
    184         return *this;
    185     }
    186 };
    187 
    188 struct AirParams {
    189     uint32_t airMBs;
    190     uint32_t airThreshold;
    191     uint32_t airAuto;
    192 
    193     AirParams &operator=(const AirParams &other) {
    194         if (this == &other) return *this;
    195 
    196         this->airMBs= other.airMBs;
    197         this->airThreshold= other.airThreshold;
    198         this->airAuto = other.airAuto;
    199         return *this;
    200     }
    201 };
    202 
    203 struct VideoFrameRate {
    204     uint32_t frameRateNum;
    205     uint32_t frameRateDenom;
    206 
    207     VideoFrameRate &operator=(const VideoFrameRate &other) {
    208         if (this == &other) return *this;
    209 
    210         this->frameRateNum = other.frameRateNum;
    211         this->frameRateDenom = other.frameRateDenom;
    212         return *this;
    213     }
    214 };
    215 
    216 struct VideoResolution {
    217     uint32_t width;
    218     uint32_t height;
    219 
    220     VideoResolution &operator=(const VideoResolution &other) {
    221         if (this == &other) return *this;
    222 
    223         this->width = other.width;
    224         this->height = other.height;
    225         return *this;
    226     }
    227 };
    228 
    229 struct VideoRateControlParams {
    230     uint32_t bitRate;
    231     uint32_t initQP;
    232     uint32_t minQP;
    233     uint32_t maxQP;
    234     uint32_t I_minQP;
    235     uint32_t I_maxQP;
    236     uint32_t windowSize;
    237     uint32_t targetPercentage;
    238     uint32_t disableFrameSkip;
    239     uint32_t disableBitsStuffing;
    240     uint32_t enableIntraFrameQPControl;
    241     uint32_t temporalFrameRate;
    242     uint32_t temporalID;
    243 
    244     VideoRateControlParams &operator=(const VideoRateControlParams &other) {
    245         if (this == &other) return *this;
    246 
    247         this->bitRate = other.bitRate;
    248         this->initQP = other.initQP;
    249         this->minQP = other.minQP;
    250         this->maxQP = other.maxQP;
    251         this->I_minQP = other.I_minQP;
    252         this->I_maxQP = other.I_maxQP;
    253         this->windowSize = other.windowSize;
    254         this->targetPercentage = other.targetPercentage;
    255         this->disableFrameSkip = other.disableFrameSkip;
    256         this->disableBitsStuffing = other.disableBitsStuffing;
    257         this->enableIntraFrameQPControl = other.enableIntraFrameQPControl;
    258         this->temporalFrameRate = other.temporalFrameRate;
    259         this->temporalID = other.temporalID;
    260 
    261         return *this;
    262     }
    263 };
    264 
    265 struct SliceNum {
    266     uint32_t iSliceNum;
    267     uint32_t pSliceNum;
    268 
    269     SliceNum &operator=(const SliceNum &other) {
    270         if (this == &other) return *this;
    271 
    272         this->iSliceNum = other.iSliceNum;
    273         this->pSliceNum= other.pSliceNum;
    274         return *this;
    275     }
    276 };
    277 
    278 typedef struct {
    279     uint32_t realWidth;
    280     uint32_t realHeight;
    281     uint32_t lumaStride;
    282     uint32_t chromStride;
    283     uint32_t format;
    284 } ExternalBufferAttrib;
    285 
    286 struct Cropping {
    287     uint32_t LeftOffset;
    288     uint32_t RightOffset;
    289     uint32_t TopOffset;
    290     uint32_t BottomOffset;
    291 
    292     Cropping &operator=(const Cropping &other) {
    293         if (this == &other) return *this;
    294 
    295         this->LeftOffset = other.LeftOffset;
    296         this->RightOffset = other.RightOffset;
    297         this->TopOffset = other.TopOffset;
    298         this->BottomOffset = other.BottomOffset;
    299         return *this;
    300     }
    301 };
    302 
    303 struct SamplingAspectRatio {
    304     uint16_t SarWidth;
    305     uint16_t SarHeight;
    306 
    307     SamplingAspectRatio &operator=(const SamplingAspectRatio &other) {
    308         if (this == &other) return *this;
    309 
    310         this->SarWidth = other.SarWidth;
    311         this->SarHeight = other.SarHeight;
    312         return *this;
    313     }
    314 };
    315 
    316 enum VideoParamConfigType {
    317     VideoParamsTypeStartUnused = 0x01000000,
    318     VideoParamsTypeCommon,
    319     VideoParamsTypeAVC,
    320     VideoParamsTypeH263,
    321     VideoParamsTypeMP4,
    322     VideoParamsTypeVC1,
    323     VideoParamsTypeUpSteamBuffer,
    324     VideoParamsTypeUsrptrBuffer,
    325     VideoParamsTypeHRD,
    326     VideoParamsTypeStoreMetaDataInBuffers,
    327     VideoParamsTypeProfileLevel,
    328     VideoParamsTypeVP8,
    329     VideoParamsTypeTemporalLayer,
    330 
    331     VideoConfigTypeFrameRate,
    332     VideoConfigTypeBitRate,
    333     VideoConfigTypeResolution,
    334     VideoConfigTypeIntraRefreshType,
    335     VideoConfigTypeAIR,
    336     VideoConfigTypeCyclicFrameInterval,
    337     VideoConfigTypeAVCIntraPeriod,
    338     VideoConfigTypeNALSize,
    339     VideoConfigTypeIDRRequest,
    340     VideoConfigTypeSliceNum,
    341     VideoConfigTypeVP8,
    342     VideoConfigTypeVP8ReferenceFrame,
    343     VideoConfigTypeCIR,
    344     VideoConfigTypeVP8MaxFrameSizeRatio,
    345     VideoConfigTypeTemperalLayerBitrateFramerate,
    346 
    347     VideoParamsConfigExtension
    348 };
    349 
    350 struct VideoParamConfigSet {
    351     VideoParamConfigType type;
    352     uint32_t size;
    353 
    354     VideoParamConfigSet &operator=(const VideoParamConfigSet &other) {
    355         if (this == &other) return *this;
    356         this->type = other.type;
    357         this->size = other.size;
    358         return *this;
    359     }
    360 };
    361 
    362 struct VideoParamsCommon : VideoParamConfigSet {
    363 
    364     VAProfile profile;
    365     uint8_t level;
    366     VideoRawFormat rawFormat;
    367     VideoResolution resolution;
    368     VideoFrameRate frameRate;
    369     int32_t intraPeriod;
    370     VideoRateControl rcMode;
    371     VideoRateControlParams rcParams;
    372     VideoIntraRefreshType refreshType;
    373     int32_t cyclicFrameInterval;
    374     AirParams airParams;
    375     CirParams cirParams;
    376     uint32_t disableDeblocking;
    377     bool syncEncMode;
    378     //CodedBuffer properties
    379     uint32_t codedBufNum;
    380     uint32_t numberOfLayer;
    381     uint32_t nPeriodicity;
    382     uint32_t nLayerID[32];
    383 
    384     VideoParamsCommon() {
    385         type = VideoParamsTypeCommon;
    386         size = sizeof(VideoParamsCommon);
    387     }
    388 
    389     VideoParamsCommon &operator=(const VideoParamsCommon &other) {
    390         if (this == &other) return *this;
    391 
    392         VideoParamConfigSet::operator=(other);
    393         this->profile = other.profile;
    394         this->level = other.level;
    395         this->rawFormat = other.rawFormat;
    396         this->resolution = other.resolution;
    397         this->frameRate = other.frameRate;
    398         this->intraPeriod = other.intraPeriod;
    399         this->rcMode = other.rcMode;
    400         this->rcParams = other.rcParams;
    401         this->refreshType = other.refreshType;
    402         this->cyclicFrameInterval = other.cyclicFrameInterval;
    403         this->airParams = other.airParams;
    404         this->disableDeblocking = other.disableDeblocking;
    405         this->syncEncMode = other.syncEncMode;
    406         this->codedBufNum = other.codedBufNum;
    407         this->numberOfLayer = other.numberOfLayer;
    408         return *this;
    409     }
    410 };
    411 
    412 struct VideoParamsAVC : VideoParamConfigSet {
    413     uint32_t basicUnitSize;  //for rate control
    414     uint8_t VUIFlag;
    415     int32_t maxSliceSize;
    416     uint32_t idrInterval;
    417     uint32_t ipPeriod;
    418     uint32_t refFrames;
    419     SliceNum sliceNum;
    420     AVCDelimiterType delimiterType;
    421     Cropping crop;
    422     SamplingAspectRatio SAR;
    423     uint32_t refIdx10ActiveMinus1;
    424     uint32_t refIdx11ActiveMinus1;
    425     bool bFrameMBsOnly;
    426     bool bMBAFF;
    427     bool bEntropyCodingCABAC;
    428     bool bWeightedPPrediction;
    429     uint32_t weightedBipredicitonMode;
    430     bool bConstIpred ;
    431     bool bDirect8x8Inference;
    432     bool bDirectSpatialTemporal;
    433     uint32_t cabacInitIdc;
    434 
    435     VideoParamsAVC() {
    436         type = VideoParamsTypeAVC;
    437         size = sizeof(VideoParamsAVC);
    438     }
    439 
    440     VideoParamsAVC &operator=(const VideoParamsAVC &other) {
    441         if (this == &other) return *this;
    442 
    443         VideoParamConfigSet::operator=(other);
    444         this->basicUnitSize = other.basicUnitSize;
    445         this->VUIFlag = other.VUIFlag;
    446         this->maxSliceSize = other.maxSliceSize;
    447         this->idrInterval = other.idrInterval;
    448         this->ipPeriod = other.ipPeriod;
    449         this->refFrames = other.refFrames;
    450         this->sliceNum = other.sliceNum;
    451         this->delimiterType = other.delimiterType;
    452         this->crop.LeftOffset = other.crop.LeftOffset;
    453         this->crop.RightOffset = other.crop.RightOffset;
    454         this->crop.TopOffset = other.crop.TopOffset;
    455         this->crop.BottomOffset = other.crop.BottomOffset;
    456         this->SAR.SarWidth = other.SAR.SarWidth;
    457         this->SAR.SarHeight = other.SAR.SarHeight;
    458 
    459         this->refIdx10ActiveMinus1 = other.refIdx10ActiveMinus1;
    460         this->refIdx11ActiveMinus1 = other.refIdx11ActiveMinus1;
    461         this->bFrameMBsOnly = other.bFrameMBsOnly;
    462         this->bMBAFF = other.bMBAFF;
    463         this->bEntropyCodingCABAC = other.bEntropyCodingCABAC;
    464         this->bWeightedPPrediction = other.bWeightedPPrediction;
    465         this->weightedBipredicitonMode = other.weightedBipredicitonMode;
    466         this->bConstIpred = other.bConstIpred;
    467         this->bDirect8x8Inference = other.bDirect8x8Inference;
    468         this->bDirectSpatialTemporal = other.bDirectSpatialTemporal;
    469         this->cabacInitIdc = other.cabacInitIdc;
    470         return *this;
    471     }
    472 };
    473 
    474 struct VideoParamsUpstreamBuffer : VideoParamConfigSet {
    475 
    476     VideoParamsUpstreamBuffer() {
    477         type = VideoParamsTypeUpSteamBuffer;
    478         size = sizeof(VideoParamsUpstreamBuffer);
    479     }
    480 
    481     VideoBufferSharingMode bufferMode;
    482     intptr_t *bufList;
    483     uint32_t bufCnt;
    484     ExternalBufferAttrib *bufAttrib;
    485     void *display;
    486 };
    487 
    488 struct VideoParamsUsrptrBuffer : VideoParamConfigSet {
    489 
    490     VideoParamsUsrptrBuffer() {
    491         type = VideoParamsTypeUsrptrBuffer;
    492         size = sizeof(VideoParamsUsrptrBuffer);
    493     }
    494 
    495     //input
    496     uint32_t width;
    497     uint32_t height;
    498     uint32_t format;
    499     uint32_t expectedSize;
    500 
    501     //output
    502     uint32_t actualSize;
    503     uint32_t stride;
    504     uint8_t *usrPtr;
    505 };
    506 
    507 struct VideoParamsHRD : VideoParamConfigSet {
    508 
    509     VideoParamsHRD() {
    510         type = VideoParamsTypeHRD;
    511         size = sizeof(VideoParamsHRD);
    512     }
    513 
    514     uint32_t bufferSize;
    515     uint32_t initBufferFullness;
    516 };
    517 
    518 struct VideoParamsStoreMetaDataInBuffers : VideoParamConfigSet {
    519 
    520     VideoParamsStoreMetaDataInBuffers() {
    521         type = VideoParamsTypeStoreMetaDataInBuffers;
    522         size = sizeof(VideoParamsStoreMetaDataInBuffers);
    523     }
    524 
    525     bool isEnabled;
    526 };
    527 
    528 struct VideoParamsProfileLevel : VideoParamConfigSet {
    529 
    530     VideoParamsProfileLevel() {
    531         type = VideoParamsTypeProfileLevel;
    532         size = sizeof(VideoParamsProfileLevel);
    533     }
    534 
    535     VAProfile profile;
    536     uint32_t level;
    537     bool isSupported;
    538 };
    539 
    540 struct VideoParamsTemporalLayer : VideoParamConfigSet {
    541 
    542     VideoParamsTemporalLayer() {
    543         type = VideoParamsTypeTemporalLayer;
    544         size = sizeof(VideoParamsTemporalLayer);
    545     }
    546 
    547     uint32_t numberOfLayer;
    548     uint32_t nPeriodicity;
    549     uint32_t nLayerID[32];
    550 };
    551 
    552 
    553 struct VideoConfigFrameRate : VideoParamConfigSet {
    554 
    555     VideoConfigFrameRate() {
    556         type = VideoConfigTypeFrameRate;
    557         size = sizeof(VideoConfigFrameRate);
    558     }
    559 
    560     VideoFrameRate frameRate;
    561 };
    562 
    563 struct VideoConfigBitRate : VideoParamConfigSet {
    564 
    565     VideoConfigBitRate() {
    566         type = VideoConfigTypeBitRate;
    567         size = sizeof(VideoConfigBitRate);
    568     }
    569 
    570     VideoRateControlParams rcParams;
    571 };
    572 
    573 struct VideoConfigAVCIntraPeriod : VideoParamConfigSet {
    574 
    575     VideoConfigAVCIntraPeriod() {
    576         type = VideoConfigTypeAVCIntraPeriod;
    577         size = sizeof(VideoConfigAVCIntraPeriod);
    578     }
    579 
    580     uint32_t idrInterval;  //How many Intra frame will have a IDR frame
    581     uint32_t intraPeriod;
    582     uint32_t ipPeriod;
    583 };
    584 
    585 struct VideoConfigNALSize : VideoParamConfigSet {
    586 
    587     VideoConfigNALSize() {
    588         type = VideoConfigTypeNALSize;
    589         size = sizeof(VideoConfigNALSize);
    590     }
    591 
    592     uint32_t maxSliceSize;
    593 };
    594 
    595 struct VideoConfigResolution : VideoParamConfigSet {
    596 
    597     VideoConfigResolution() {
    598         type = VideoConfigTypeResolution;
    599         size = sizeof(VideoConfigResolution);
    600     }
    601 
    602     VideoResolution resolution;
    603 };
    604 
    605 struct VideoConfigIntraRefreshType : VideoParamConfigSet {
    606 
    607     VideoConfigIntraRefreshType() {
    608         type = VideoConfigTypeIntraRefreshType;
    609         size = sizeof(VideoConfigIntraRefreshType);
    610     }
    611 
    612     VideoIntraRefreshType refreshType;
    613 };
    614 
    615 struct VideoConfigCyclicFrameInterval : VideoParamConfigSet {
    616 
    617     VideoConfigCyclicFrameInterval() {
    618         type = VideoConfigTypeCyclicFrameInterval;
    619         size = sizeof(VideoConfigCyclicFrameInterval);
    620     }
    621 
    622     int32_t cyclicFrameInterval;
    623 };
    624 
    625 struct VideoConfigCIR : VideoParamConfigSet {
    626 
    627     VideoConfigCIR() {
    628         type = VideoConfigTypeCIR;
    629         size = sizeof(VideoConfigCIR);
    630     }
    631 
    632     CirParams cirParams;
    633 };
    634 
    635 struct VideoConfigAIR : VideoParamConfigSet {
    636 
    637     VideoConfigAIR() {
    638         type = VideoConfigTypeAIR;
    639         size = sizeof(VideoConfigAIR);
    640     }
    641 
    642     AirParams airParams;
    643 };
    644 
    645 struct VideoConfigSliceNum : VideoParamConfigSet {
    646 
    647     VideoConfigSliceNum() {
    648         type = VideoConfigTypeSliceNum;
    649         size = sizeof(VideoConfigSliceNum);
    650     }
    651 
    652     SliceNum sliceNum;
    653 };
    654 
    655 struct VideoParamsVP8 : VideoParamConfigSet {
    656 
    657         uint32_t profile;
    658         uint32_t error_resilient;
    659         uint32_t num_token_partitions;
    660         uint32_t kf_auto;
    661         uint32_t kf_min_dist;
    662         uint32_t kf_max_dist;
    663         uint32_t min_qp;
    664         uint32_t max_qp;
    665         uint32_t init_qp;
    666         uint32_t rc_undershoot;
    667         uint32_t rc_overshoot;
    668         uint32_t hrd_buf_size;
    669         uint32_t hrd_buf_initial_fullness;
    670         uint32_t hrd_buf_optimal_fullness;
    671         uint32_t max_frame_size_ratio;
    672 
    673         VideoParamsVP8() {
    674                 type = VideoParamsTypeVP8;
    675                 size = sizeof(VideoParamsVP8);
    676         }
    677 };
    678 
    679 struct VideoConfigVP8 : VideoParamConfigSet {
    680 
    681         uint32_t force_kf;
    682         uint32_t refresh_entropy_probs;
    683         uint32_t value;
    684         unsigned char sharpness_level;
    685 
    686         VideoConfigVP8 () {
    687                 type = VideoConfigTypeVP8;
    688                 size = sizeof(VideoConfigVP8);
    689         }
    690 };
    691 
    692 struct VideoConfigVP8ReferenceFrame : VideoParamConfigSet {
    693 
    694         uint32_t no_ref_last;
    695         uint32_t no_ref_gf;
    696         uint32_t no_ref_arf;
    697         uint32_t refresh_last;
    698         uint32_t refresh_golden_frame;
    699         uint32_t refresh_alternate_frame;
    700 
    701         VideoConfigVP8ReferenceFrame () {
    702                 type = VideoConfigTypeVP8ReferenceFrame;
    703                 size = sizeof(VideoConfigVP8ReferenceFrame);
    704         }
    705 };
    706 
    707 struct VideoConfigVP8MaxFrameSizeRatio : VideoParamConfigSet {
    708 
    709     VideoConfigVP8MaxFrameSizeRatio() {
    710         type = VideoConfigTypeVP8MaxFrameSizeRatio;
    711         size = sizeof(VideoConfigVP8MaxFrameSizeRatio);
    712     }
    713 
    714     uint32_t max_frame_size_ratio;
    715 };
    716 
    717 struct VideoConfigTemperalLayerBitrateFramerate : VideoParamConfigSet {
    718 
    719        VideoConfigTemperalLayerBitrateFramerate() {
    720                 type = VideoConfigTypeTemperalLayerBitrateFramerate;
    721                 size = sizeof(VideoConfigTemperalLayerBitrateFramerate);
    722         }
    723 
    724         uint32_t nLayerID;
    725         uint32_t bitRate;
    726         uint32_t frameRate;
    727 };
    728 
    729 #endif /*  __VIDEO_ENCODER_DEF_H__ */
    730