summaryrefslogtreecommitdiffstats
path: root/encoder/ih264e_api.c
diff options
context:
space:
mode:
authorHarinarayanan K K <harinarayanan.kk@ittiam.com>2015-06-19 11:39:42 +0530
committerMarco Nelissen <marcone@google.com>2015-06-24 21:04:58 +0000
commit8588303afa4064cdbd91a653d45e5716b377b767 (patch)
tree4bcba1df1186efe076adb3a955bc169212ad577a /encoder/ih264e_api.c
parent6cb6772805d86c66848b15a54926e396daed06b1 (diff)
downloadandroid_external_libavc-8588303afa4064cdbd91a653d45e5716b377b767.tar.gz
android_external_libavc-8588303afa4064cdbd91a653d45e5716b377b767.tar.bz2
android_external_libavc-8588303afa4064cdbd91a653d45e5716b377b767.zip
Added code to handle cases with qp less than 10
When qp goes less than 10, all I16x16 mode evaluations are disabled and I4x4 evaluations are enabled irrespective of preset. This will ensure that the residual will not exceed the supported range of entropy Minimum Qp cannot be set less than 4 now. When QP goes lesser, the residual may exceed the supported range even with I4x4 enabled. Change-Id: I25b404fcd9c9e9dbdd77679280968635ee047eb3
Diffstat (limited to 'encoder/ih264e_api.c')
-rw-r--r--encoder/ih264e_api.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/encoder/ih264e_api.c b/encoder/ih264e_api.c
index 7f92f7f..7ff3305 100644
--- a/encoder/ih264e_api.c
+++ b/encoder/ih264e_api.c
@@ -1561,7 +1561,11 @@ static IV_STATUS_T api_check_struct_sanity(iv_obj_t *ps_handle,
return IV_FAIL;
}
- if ((ps_ip->s_ive_ip.u4_i_qp_min > ps_ip->s_ive_ip.u4_i_qp_max)
+ /* We donot support QP < 4 */
+ if ((ps_ip->s_ive_ip.u4_i_qp_min < 4)
+ || (ps_ip->s_ive_ip.u4_p_qp_min < 4)
+ || (ps_ip->s_ive_ip.u4_b_qp_min < 4)
+ || (ps_ip->s_ive_ip.u4_i_qp_min > ps_ip->s_ive_ip.u4_i_qp_max)
|| (ps_ip->s_ive_ip.u4_p_qp_min > ps_ip->s_ive_ip.u4_p_qp_max)
|| (ps_ip->s_ive_ip.u4_b_qp_min > ps_ip->s_ive_ip.u4_b_qp_max))
{