Decoder: Fixed flag u1_top_bottom_decoded.
Fixed initialization of flag u1_top_bottom_decoded
in decoder context. This flag indicates if top
field and botton field is decoded.
Bug: 36993291
Test: avcdec --input poc.h264 --output /dev/null
Change-Id: I9f8a2620683abd8b15e4780d76d4849394710716
(cherry picked from commit 7703822731a3e5425390ba1d177d061a699c367d)
diff --git a/decoder/ih264d_api.c b/decoder/ih264d_api.c
index 33fd11f..36b745f 100644
--- a/decoder/ih264d_api.c
+++ b/decoder/ih264d_api.c
@@ -2310,6 +2310,10 @@
ps_dec->u1_top_bottom_decoded |= TOP_FIELD_ONLY;
}
}
+ else
+ {
+ ps_dec->u1_top_bottom_decoded = TOP_FIELD_ONLY | BOT_FIELD_ONLY;
+ }
/* if new frame in not found (if we are still getting slices from previous frame)
* ih264d_deblock_display is not called. Such frames will not be added to reference /display
diff --git a/decoder/ih264d_parse_slice.c b/decoder/ih264d_parse_slice.c
index f755970..7e0815f 100644
--- a/decoder/ih264d_parse_slice.c
+++ b/decoder/ih264d_parse_slice.c
@@ -1191,10 +1191,6 @@
u1_nal_unit_type = SLICE_NAL;
if(u1_is_idr_slice)
{
- if(0 == u1_field_pic_flag)
- {
- ps_dec->u1_top_bottom_decoded = TOP_FIELD_ONLY | BOT_FIELD_ONLY;
- }
u1_nal_unit_type = IDR_SLICE_NAL;
u4_idr_pic_id = ih264d_uev(pu4_bitstrm_ofst,
pu4_bitstrm_buf);