Hello all,
I've tried to do H.264 encoding using HTC Sensation XE.
But it takes 240ms (average) to encode 1 frame (544x960 YUV format).
I also found the size after H.264 encoding all around 30K (per frame), which is way too big.
I guess there's something wrong with my parameter, please help to check my parameter:
======================================================
FrameWidth=544
FrameHeight=960
FrameRate=10
RateControl=1
RateControl=3
BitRate=544*960*3
Comparing to the sample code of qcom_video_codec_sample_1_3_1:
FrameWidth=320
FrameHeight=240
FrameRate=10
RateControl=3 (OMX_Video_ControlRateVariableSkipFrames)
BitRate=320*240*3
The code is as below:
======================================================
if (OMX_VIDEO_AVCProfileBaseline == omxProfileLevel.eProfile &&
OMX_VIDEO_AVCLevel41 <= omxProfileLevel.eLevel) {
DBGL();
break;
}
omxAVC.bEnableUEP = OMX_FALSE;
omxAVC.bEnableFMO = OMX_FALSE;
omxAVC.bEnableASO = OMX_FALSE;
omxAVC.bEnableRS = OMX_FALSE;
omxAVC.eProfile = OMX_VIDEO_AVCProfileBaseline;
if (omxAVC.eProfile == OMX_VIDEO_AVCProfileBaseline) {
omxAVC.nSliceHeaderSpacing = 0;
omxAVC.nPFrames = 1/*IFrame Interval*/ * ctx->omxProp.frameRate;
omxAVC.nBFrames = 0;
omxAVC.bUseHadamard = OMX_TRUE;
omxAVC.nRefFrames = 1;
omxAVC.nRefIdx10ActiveMinus1 = 0;
omxAVC.nRefIdx11ActiveMinus1 = 0;
omxAVC.bEntropyCodingCABAC = OMX_FALSE;
omxAVC.bWeightedPPrediction = OMX_FALSE;
omxAVC.bconstIpred = OMX_FALSE;
omxAVC.bDirect8x8Inference = OMX_FALSE;
omxAVC.bDirectSpatialTemporal = OMX_FALSE;
omxAVC.nCabacInitIdc = 0;
}
omxAVC.nAllowedPictureTypes = OMX_VIDEO_PictureTypeI;
if (omxAVC.nPFrames > 0) {
omxAVC.nAllowedPictureTypes |= OMX_VIDEO_PictureTypeP;
}
if (omxAVC.nBFrames > 0) {
omxAVC.nAllowedPictureTypes |= OMX_VIDEO_PictureTypeB;
}
omxAVC.bFrameMBsOnly = OMX_TRUE;
omxAVC.bMBAFF = OMX_FALSE;
omxAVC.eLoopFilterMode = OMX_VIDEO_AVCLoopFilterEnable;
======================================================