aboutsummaryrefslogtreecommitdiffstats
path: root/videocodec/OMXVideoEncoderAVC.cpp
diff options
context:
space:
mode:
authorChang Ying <ying.chang@intel.com>2012-06-20 14:58:03 +0800
committerPatrick Tjin <pattjin@google.com>2014-07-21 22:02:48 -0700
commit13bdc6512d6b7ee90de2ced4459b76e05ce797af (patch)
tree6d119d171e2a8502da54b6807b82f0c254a5da66 /videocodec/OMXVideoEncoderAVC.cpp
parentc1241ad0d5cde2667d058cad8b2bf725514301e2 (diff)
downloadandroid_hardware_intel_common_omx-components-13bdc6512d6b7ee90de2ced4459b76e05ce797af.tar.gz
android_hardware_intel_common_omx-components-13bdc6512d6b7ee90de2ced4459b76e05ce797af.tar.bz2
android_hardware_intel_common_omx-components-13bdc6512d6b7ee90de2ced4459b76e05ce797af.zip
[Port from R3]AVCE: Low bitrate/resolution VQ tuning
BZ: 40475 41836 Impacted parameters: 1.disable_deblocking_filter_idc always set to '0' 2.intra period set to '30' 3.slice number set to '2' for resolution <= VGA BZ41836 can also be fixed by intra period setup. Change-Id: Ic5612210a2afe41660f709411e400591cd48526f Signed-off-by: Chang Ying <ying.chang@intel.com> Reviewed-on: http://android.intel.com:8080/53395 Reviewed-by: Ding, Haitao <haitao.ding@intel.com> Tested-by: Ding, Haitao <haitao.ding@intel.com> Reviewed-by: Yuan, Shengquan <shengquan.yuan@intel.com> Reviewed-by: Zhao, Leo <leo.zhao@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com> Reviewed-on: http://android.intel.com:8080/57185
Diffstat (limited to 'videocodec/OMXVideoEncoderAVC.cpp')
-rw-r--r--videocodec/OMXVideoEncoderAVC.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/videocodec/OMXVideoEncoderAVC.cpp b/videocodec/OMXVideoEncoderAVC.cpp
index 647b369..25d6852 100644
--- a/videocodec/OMXVideoEncoderAVC.cpp
+++ b/videocodec/OMXVideoEncoderAVC.cpp
@@ -113,12 +113,22 @@ OMX_ERRORTYPE OMXVideoEncoderAVC::SetVideoEncoderParam(void) {
mVideoEncoder->getParameters(mEncoderParams);
mEncoderParams->profile = (VAProfile)VAProfileH264Baseline;
+ // 0 - all luma and chroma block edges of the slice are filtered
+ // 1 - deblocking is disabled for all block edges of the slice
+ // 2 - all luma and chroma block edges of the slice are filtered
+ // with exception of the block edges that coincide with slice boundaries
+ mEncoderParams->disableDeblocking = 0;
OMXVideoEncoderBase::SetVideoEncoderParam();
mVideoEncoder->getParameters(mAVCParams);
if(mParamIntelAvcVui.bVuiGeneration == OMX_TRUE) {
mAVCParams->VUIFlag = 1;
}
+ // For resolution below VGA, single core can hit the performance target and provide VQ gain
+ if (mEncoderParams->resolution.width <= 640 && mEncoderParams->resolution.height <= 480) {
+ mConfigIntelSliceNumbers.nISliceNumber = 1;
+ mConfigIntelSliceNumbers.nPSliceNumber = 1;
+ }
mAVCParams->sliceNum.iSliceNum = mConfigIntelSliceNumbers.nISliceNumber;
mAVCParams->sliceNum.pSliceNum = mConfigIntelSliceNumbers.nPSliceNumber;
mAVCParams->idrInterval = mConfigAvcIntraPeriod.nIDRPeriod;
@@ -126,6 +136,18 @@ OMX_ERRORTYPE OMXVideoEncoderAVC::SetVideoEncoderParam(void) {
ret = mVideoEncoder ->setParameters(mAVCParams);
CHECK_ENCODE_STATUS("setParameters");
+ VideoConfigAVCIntraPeriod avcIntraPreriod;
+ avcIntraPreriod.idrInterval = mConfigAvcIntraPeriod.nIDRPeriod;
+ // hardcode intra period for AVC encoder, get value from OMX_VIDEO_PARAM_AVCTYPE.nPFrames or
+ // OMX_VIDEO_CONFIG_AVCINTRAPERIOD.nPFrames is a more flexible method
+ if (mParamAvc.nPFrames == 0) {
+ avcIntraPreriod.intraPeriod = 0;
+ } else {
+ avcIntraPreriod.intraPeriod = 30;
+ }
+ ret = mVideoEncoder->setConfig(&avcIntraPreriod);
+ CHECK_ENCODE_STATUS("setConfig");
+
LOGV("VUIFlag = %d\n", mAVCParams->VUIFlag);
LOGV("sliceNum.iSliceNum = %d\n", mAVCParams->sliceNum.iSliceNum);
LOGV("sliceNum.pSliceNum = %d\n", mAVCParams->sliceNum.pSliceNum);