//StaticParams - IVIDENC2_Params pStaticEnc->videnc2Params.size = sizeof(IH265VENC_Params); pStaticEnc->videnc2Params.encodingPreset = 4; // 0: DEFAULT, 1: HIGH_QUALITY, 2: HIGH_SPEED, 3: USER_DEFINED. If not USER_DEFINED most of configuration parameters are chosen by encoder, thus ignored. pStaticEnc->videnc2Params.rateControlPreset = 2; // 1: LOW_DELAY, 2: STORAGE, 4: NONE, 5: USER_DEFINED pStaticEnc->videnc2Params.maxWidth = 1920; pStaticEnc->videnc2Params.maxHeight = 1080; pStaticEnc->videnc2Params.dataEndianness = XDM_BYTE; // Not configurable pStaticEnc->videnc2Params.maxInterFrameInterval = 1; // Max I to P frame distance. 1: no B frames, 2: one B frame, 3: two B frames, etc [1, 255] pStaticEnc->videnc2Params.maxBitRate = 1024*1200; // In bits per second. Should be valid as per LEVEL limit pStaticEnc->videnc2Params.minBitRate = 1024*1024; // In bits per second pStaticEnc->videnc2Params.inputChromaFormat = XDM_YUV_420P; // Not configurable pStaticEnc->videnc2Params.inputContentType = IVIDEO_PROGRESSIVE; // 0: PROGRESSIVE, 1: INTERLACED pStaticEnc->videnc2Params.operatingMode = IVIDEO_ENCODE_ONLY; // Not configurable pStaticEnc->videnc2Params.profile = IH265_MAIN_PROFILE; // TODO: change description pStaticEnc->videnc2Params.level = IH265_LEVEL_41; // TODO: change description pStaticEnc->videnc2Params.inputDataMode = IVIDEO_ENTIREFRAME; // Not configurable pStaticEnc->videnc2Params.outputDataMode = IVIDEO_ENTIREFRAME; // Not configurable pStaticEnc->videnc2Params.numInputDataUnits = 1; pStaticEnc->videnc2Params.numOutputDataUnits = 1; int i; for (i = 0 ; i < IVIDEO_MAX_NUM_METADATA_PLANES; i++) { pStaticEnc->videnc2Params.metadataType[i] = IVIDEO_METADATAPLANE_NONE; } //StaticParams - Misc pStaticEnc->scalingMatrixPreset = IH265_SCALINGMATRIXPRESET_DEFAULT; pStaticEnc->decRefreshType = 0; // Decoder referesh type: IDR or CDR [0 or 1]. pStaticEnc->decRefreshInterval = 0; pStaticEnc->enableTransQuantBypass = 0; pStaticEnc->maxPoc = 256; pStaticEnc->enableTransformSkip = 0; pStaticEnc->maxIntraFrameInterval = 10000; pStaticEnc->enableWPP = 1; pStaticEnc->maxNumRefFrames = 1; pStaticEnc->enableVirtualTile = 31; pStaticEnc->disableVirtualTileDependency = 0; pStaticEnc->debugTraceLevel = 0; pStaticEnc->lastNFramesToLog = 0; //StaticParams - IH265VENC_RateControlParams pStaticEnc->rateControlParams.rateControlParamsPreset = IH265_RATECONTROLPARAMS_USERDEFINED; pStaticEnc->rateControlParams.rcAlgo = IH265_RATECONTROL_CBR; pStaticEnc->rateControlParams.qpI = 28; pStaticEnc->rateControlParams.qpMaxI = 40; pStaticEnc->rateControlParams.qpMinI = 20; pStaticEnc->rateControlParams.qpP = 28; pStaticEnc->rateControlParams.qpMaxP = 40; pStaticEnc->rateControlParams.qpMinP = 20; pStaticEnc->rateControlParams.qpOffsetB = 4; pStaticEnc->rateControlParams.qpMaxB = 40; pStaticEnc->rateControlParams.qpMinB = 20; pStaticEnc->rateControlParams.enableFrameSkip = 0; pStaticEnc->rateControlParams.enablePartialFrameSkip = 0; pStaticEnc->rateControlParams.qualityFactorIP = 0; pStaticEnc->rateControlParams.cbQPIndexOffset = 2; pStaticEnc->rateControlParams.crQPIndexOffset = 2; pStaticEnc->rateControlParams.initialBufferLevel = 2000000; pStaticEnc->rateControlParams.hrdBufferSize = 2000000; pStaticEnc->rateControlParams.enableHRDComplianceMode = 0; pStaticEnc->rateControlParams.maxFrameSkipCnt = 0; pStaticEnc->rateControlParams.SubFrameRC = 0; pStaticEnc->rateControlParams.maxDeltaQP = 0; pStaticEnc->rateControlParams.enablePRC = 0; //StaticParams - IH265VENC_LoopFilterParams pStaticEnc->loopFilterParams.loopFilterParamsPreset = IH265_SLICECODINGPRESET_USERDEFINED; pStaticEnc->loopFilterParams.enableDeblockFilter = 1; pStaticEnc->loopFilterParams.enableSaoFilter = 1;// sao quality better pStaticEnc->loopFilterParams.enableLoopFilterSliceBoundary = 0; pStaticEnc->loopFilterParams.enableLoopFilterTileBoundary = 0; pStaticEnc->loopFilterParams.separateCbCrSAO = 0; pStaticEnc->loopFilterParams.offsetLoopFilterInPPSFlag = 0; pStaticEnc->loopFilterParams.offsetDeblockBetaDiv2 = 0; pStaticEnc->loopFilterParams.offsetDeblockTcDiv2 = 0; //StaticParams - IH265VENC_GopCntrlParams pStaticEnc->gopCntrlParams.gopCntrlParamsPreset = IH265_GOPCTRLPRESET_DEFAULT; //StaticParams - IH265VENC_SliceCodingParams pStaticEnc->sliceCodingParams.sliceCodingPreset = IH265_SLICECODINGPRESET_USERDEFINED; pStaticEnc->sliceCodingParams.sliceCodingMode = 0; pStaticEnc->sliceCodingParams.sliceCodingArg = 0; pStaticEnc->sliceCodingParams.enableTiles = 0; pStaticEnc->sliceCodingParams.numTileColumns = 2; pStaticEnc->sliceCodingParams.numTileRows = 2; pStaticEnc->sliceCodingParams.enableDependentSlice = 0; //StaticParams - IH265VENC_IntraCodingParams pStaticEnc->intraCodingParams.intraCodingPreset = IH265_INTRACODINGPRESET_USERDEFINED; pStaticEnc->intraCodingParams.intraRefreshMethod = 0; pStaticEnc->intraCodingParams.intraRefreshRate = 0; pStaticEnc->intraCodingParams.constrainedIntraPredEnable = 0; pStaticEnc->intraCodingParams.enableStrongIntraSmoothing = 1; pStaticEnc->intraCodingParams.matchYCbCrIntraMode = 0; pStaticEnc->intraCodingParams.enableLumaIntra4x4Mode = 0; pStaticEnc->intraCodingParams.enableLumaIntra8x8Mode = 0; pStaticEnc->intraCodingParams.enableLumaIntra16x16Mode = 0; pStaticEnc->intraCodingParams.enableLumaIntra32x32Mode = 0; pStaticEnc->intraCodingParams.enableChromaIntra4x4Mode = 0; pStaticEnc->intraCodingParams.enableChromaIntra8x8Mode = 0; pStaticEnc->intraCodingParams.enableChromaIntra16x16Mode = 0; //StaticParams - IH265VENC_InterCodingParams pStaticEnc->interCodingParams.interCodingPreset = IH265_INTERCODINGPRESET_USERDEFINED; pStaticEnc->interCodingParams.enableTmvp = 0; pStaticEnc->interCodingParams.searchRangeHorP = 144; pStaticEnc->interCodingParams.searchRangeVerP = 32; pStaticEnc->interCodingParams.searchRangeHorB = 144; pStaticEnc->interCodingParams.searchRangeVerB = 32; pStaticEnc->interCodingParams.interCodingBias = 0; pStaticEnc->interCodingParams.skipMVCodingBias = 0; pStaticEnc->interCodingParams.numMergeCandidates = 3; pStaticEnc->interCodingParams.enableBiPredMode = 1; pStaticEnc->interCodingParams.enableFastIntraAlgo = 1; //StaticParams - IH265VENC_VUICodingParams pStaticEnc->vuiCodingParams.vuiCodingPreset = IH265_VUICODINGPRESET_DEFAULT; pStaticEnc->vuiCodingParams.aspectRatioInfoPresentFlag = 0; pStaticEnc->vuiCodingParams.aspectRatioIdc = 0; pStaticEnc->vuiCodingParams.videoSignalTypePresentFlag = 0; pStaticEnc->vuiCodingParams.videoFormat = 0; pStaticEnc->vuiCodingParams.videoFullRangeFlag = 0; pStaticEnc->vuiCodingParams.colourDescriptionPresentFlag = 0; pStaticEnc->vuiCodingParams.colourPrimaries = 0; pStaticEnc->vuiCodingParams.transferCharacteristics = 0; pStaticEnc->vuiCodingParams.matrixCoefficients = 0; pStaticEnc->vuiCodingParams.timingInfoPresentFlag = 0; //StaticParams - IH265VENC_SEIParams pStaticEnc->seiParams.enableSeiFlag = 0; //StaticParams - IH265VENC_CTBCodingParams pStaticEnc->ctbCodingParams.maxCTBSize = 64; pStaticEnc->ctbCodingParams.maxCUDepth = 3; //DynamicParams - IVIDENC2_DynamicParams IH265VENC_DynamicParams* pDynEnc = (IH265VENC_DynamicParams*)pDynParam; pDynEnc->videnc2DynamicParams.size = sizeof(IH265VENC_DynamicParams); pDynEnc->videnc2DynamicParams.inputWidth = 1920; pDynEnc->videnc2DynamicParams.inputHeight = 1080; pDynEnc->videnc2DynamicParams.refFrameRate = 30 * 1000; pDynEnc->videnc2DynamicParams.targetFrameRate = 30 * 1000; pDynEnc->videnc2DynamicParams.targetBitRate = 1024*1024; pDynEnc->videnc2DynamicParams.intraFrameInterval = 3000; // The number of frames between two I frames. 0: IPPPP..., 1: IIII..., 2: IPIPIPIPI, 3: IPPIPPIPPI or IPBIPBIPBI, etc. pDynEnc->videnc2DynamicParams.generateHeader = XDM_ENCODE_AU; // 0: Encode entire access unit including headers, 1: Encode only header pDynEnc->videnc2DynamicParams.captureWidth = 0; pDynEnc->videnc2DynamicParams.forceFrame = IVIDEO_NA_FRAME; // -1: IVIDEO_NA_FRAME, 3: IVIDEO_IDR_FRAME pDynEnc->videnc2DynamicParams.interFrameInterval = 1; // I to P frame distance. 1: no B frames, 2: one B frame, 3: two B frames, etc [1, 255] pDynEnc->videnc2DynamicParams.mvAccuracy = IVIDENC2_MOTIONVECTOR_QUARTERPEL; // Motion vectors accuracy. 0: integer pel., 2: quarter pel. pDynEnc->videnc2DynamicParams.sampleAspectRatioHeight = 1; pDynEnc->videnc2DynamicParams.sampleAspectRatioWidth = 1; pDynEnc->videnc2DynamicParams.ignoreOutbufSizeFlag = XDAS_FALSE; // Non configurable pDynEnc->videnc2DynamicParams.putDataFxn = NULL; pDynEnc->videnc2DynamicParams.putDataHandle = 0; pDynEnc->videnc2DynamicParams.getDataFxn = NULL; pDynEnc->videnc2DynamicParams.getDataHandle = 0; pDynEnc->videnc2DynamicParams.getBufferFxn = NULL; pDynEnc->videnc2DynamicParams.getBufferHandle = 0; pDynEnc->videnc2DynamicParams.lateAcquireArg = 0; memcpy(&pDynEnc->rateControlParams, &pStaticEnc->rateControlParams, sizeof(pStaticEnc->rateControlParams)); memcpy(&pDynEnc->loopFilterParams, &pStaticEnc->loopFilterParams, sizeof(pStaticEnc->loopFilterParams)); memcpy(&pDynEnc->intraCodingParams, &pStaticEnc->intraCodingParams, sizeof(pStaticEnc->intraCodingParams)); memcpy(&pDynEnc->interCodingParams, &pStaticEnc->interCodingParams, sizeof(pStaticEnc->interCodingParams)); memcpy(&pDynEnc->ctbCodingParams, &pStaticEnc->ctbCodingParams, sizeof(pStaticEnc->ctbCodingParams)); memcpy(&pDynEnc->sliceCodingParams, &pStaticEnc->sliceCodingParams, sizeof(pStaticEnc->sliceCodingParams)); pDynEnc->enableTransQuantBypass = pStaticEnc->enableTransQuantBypass; pDynEnc->enableTransformSkip = pStaticEnc->enableTransformSkip; pDynEnc->enableROI = 0;