[av1d_parse]: fix segment feature value get err issue

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I662b39575d19f50c1ff912c6b76f081db843855e
This commit is contained in:
Yandong Lin
2022-11-11 11:07:08 +08:00
committed by Herman Chen
parent 6593fd01e6
commit c90d683b53
2 changed files with 11 additions and 5 deletions

View File

@@ -1158,11 +1158,15 @@ static RK_S32 mpp_av1_segmentation_params(AV1Context *ctx, BitReadCtx_t *gb,
for (j = 0; j < AV1_SEG_LVL_MAX; j++) {
if (current->segmentation_update_data) {
flags(feature_enabled[i][j], 2, i, j);
if (current->feature_enabled[i][j] && bits[j] > 0) {
if (sign[j])
sus(1 + bits[j], feature_value[i][j], 2, i, j);
else
if (sign[j]) {
RK_S32 sign_, data;
READ_ONEBIT(gb, &sign_);
READ_BITS(gb, bits[j], &data);
if (sign_) data -= (1 << bits[j]);
current->feature_value[i][j] = data;
} else
fbs(bits[j], feature_value[i][j], 2, i, j);
} else {
infer(feature_value[i][j], 0);
@@ -1183,6 +1187,8 @@ static RK_S32 mpp_av1_segmentation_params(AV1Context *ctx, BitReadCtx_t *gb,
}
return 0;
__BITREAD_ERR:
return MPP_ERR_STREAM;
}
static RK_S32 mpp_av1_delta_q_params(AV1Context *ctx, BitReadCtx_t *gb,