aboutsummaryrefslogtreecommitdiff
path: root/decoder/ih264d_api.c
diff options
context:
space:
mode:
authorHarish Mahendrakar <harish.mahendrakar@ittiam.com>2017-02-14 17:00:16 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-02-14 17:00:16 +0000
commitba7f9e2aeddeda9b91addbe1d0abc68499f9dfc7 (patch)
tree38e875cebe587aa24cfaa9303e6604559c26fc75 /decoder/ih264d_api.c
parent8b75cdae9bab9ade09cfb717443cd60b0542815b (diff)
parent494561291a503840f385fbcd11d9bc5f4dc502b8 (diff)
downloadlibavc-ba7f9e2aeddeda9b91addbe1d0abc68499f9dfc7.tar.gz
Decoder: Moved end of pic processing to end of decode call
am: 494561291a Change-Id: Id3867f5dd0788f12f6827ed311a309d1fa58c535
Diffstat (limited to 'decoder/ih264d_api.c')
-rw-r--r--decoder/ih264d_api.c45
1 files changed, 32 insertions, 13 deletions
diff --git a/decoder/ih264d_api.c b/decoder/ih264d_api.c
index dbf7030..2379de1 100644
--- a/decoder/ih264d_api.c
+++ b/decoder/ih264d_api.c
@@ -1732,15 +1732,7 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
ps_dec->i4_frametype = -1;
ps_dec->i4_content_type = -1;
- /*
- * For field pictures, set the bottom and top picture decoded u4_flag correctly.
- */
- {
- if((TOP_FIELD_ONLY | BOT_FIELD_ONLY) == ps_dec->u1_top_bottom_decoded)
- {
- ps_dec->u1_top_bottom_decoded = 0;
- }
- }
+
ps_dec->u4_slice_start_code_found = 0;
/* In case the deocder is not in flush mode(in shared mode),
@@ -2294,10 +2286,6 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
{
/* Calling Function to deblock Picture and Display */
ret = ih264d_deblock_display(ps_dec);
- if(ret != 0)
- {
- return IV_FAIL;
- }
}
@@ -2394,6 +2382,37 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
}
}
+ if((TOP_FIELD_ONLY | BOT_FIELD_ONLY) == ps_dec->u1_top_bottom_decoded)
+ {
+ ps_dec->u1_top_bottom_decoded = 0;
+ }
+ /*--------------------------------------------------------------------*/
+ /* Do End of Pic processing. */
+ /* Should be called only if frame was decoded in previous process call*/
+ /*--------------------------------------------------------------------*/
+ if(ps_dec->u4_pic_buf_got == 1)
+ {
+ if(1 == ps_dec->u1_last_pic_not_decoded)
+ {
+ ret = ih264d_end_of_pic_dispbuf_mgr(ps_dec);
+
+ if(ret != OK)
+ return ret;
+
+ ret = ih264d_end_of_pic(ps_dec);
+ if(ret != OK)
+ return ret;
+ }
+ else
+ {
+ ret = ih264d_end_of_pic(ps_dec);
+ if(ret != OK)
+ return ret;
+ }
+
+ }
+
+
/*Data memory barrier instruction,so that yuv write by the library is complete*/
DATA_SYNC();