mirror of
https://github.com/ittiam-systems/libhevc.git
synced 2026-08-15 07:12:36 +07:00
Merge "Fix in handling wrong cu_qp_delta" into lmp-dev am: 98f9e26d24 am: 10f2b105f5 am: b4ddce56d1
am: 59b232588b
Change-Id: I327b698965d66637fbc6e5a84230caa80df01f68
This commit is contained in:
commit
ca85c43d8d
2 changed files with 11 additions and 3 deletions
|
|
@ -669,14 +669,13 @@ UWORD32 ihevcd_cabac_decode_bypass_bins_egk(cab_ctxt_t *ps_cabac,
|
|||
numones = k;
|
||||
bin = 1;
|
||||
u4_sym = 0;
|
||||
while(bin)
|
||||
while(bin && (numones <= 16))
|
||||
{
|
||||
IHEVCD_CABAC_DECODE_BYPASS_BIN(bin, ps_cabac, ps_bitstrm);
|
||||
u4_sym += bin << numones++;
|
||||
}
|
||||
|
||||
numones -= 1;
|
||||
numones = CLIP3(numones, 0, 16);
|
||||
|
||||
if(numones)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -82,6 +82,9 @@
|
|||
/* Bit stream offset threshold */
|
||||
#define BITSTRM_OFF_THRS 8
|
||||
|
||||
#define MIN_CU_QP_DELTA_ABS(x) (-26 + ((x) * 6) / 2)
|
||||
#define MAX_CU_QP_DELTA_ABS(x) (25 + ((x) * 6) / 2)
|
||||
|
||||
/**
|
||||
* Table used to decode part_mode if AMP is enabled and current CU is not min CU
|
||||
*/
|
||||
|
|
@ -302,7 +305,6 @@ WORD32 ihevcd_parse_transform_tree(codec_t *ps_codec,
|
|||
}
|
||||
AEV_TRACE("cu_qp_delta_abs", cu_qp_delta_abs, ps_cabac->u4_range);
|
||||
|
||||
|
||||
ps_codec->s_parse.i4_is_cu_qp_delta_coded = 1;
|
||||
|
||||
|
||||
|
|
@ -315,6 +317,13 @@ WORD32 ihevcd_parse_transform_tree(codec_t *ps_codec,
|
|||
cu_qp_delta_abs = -cu_qp_delta_abs;
|
||||
|
||||
}
|
||||
|
||||
if (cu_qp_delta_abs < MIN_CU_QP_DELTA_ABS(ps_sps->i1_bit_depth_luma_minus8)
|
||||
|| cu_qp_delta_abs > MAX_CU_QP_DELTA_ABS(ps_sps->i1_bit_depth_luma_minus8))
|
||||
{
|
||||
return IHEVCD_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
ps_codec->s_parse.s_cu.i4_cu_qp_delta = cu_qp_delta_abs;
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue