summaryrefslogtreecommitdiffstats
path: root/encoder
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2015-06-23 11:51:06 +0300
committerMarco Nelissen <marcone@google.com>2015-06-25 08:25:56 -0700
commit88966cf07d2095aec959c5ac14b30237eeaa5727 (patch)
tree0cfe8784f3c9bb1c6cacdfc906fc521e4d9fc784 /encoder
parentc4355642ba8504d2fcfe3431ee9367d050e1c436 (diff)
downloadandroid_external_libavc-88966cf07d2095aec959c5ac14b30237eeaa5727.tar.gz
android_external_libavc-88966cf07d2095aec959c5ac14b30237eeaa5727.tar.bz2
android_external_libavc-88966cf07d2095aec959c5ac14b30237eeaa5727.zip
Initialize i4_non_ref_frames_in_stream before encoding SPS/PPS
When header mode is enabled, the SPS is populated before this field was initialized in ih264e_pic_init. Change-Id: I7e38828e12bee15bd3a53562b4e4d0d65354326a
Diffstat (limited to 'encoder')
-rw-r--r--encoder/ih264e_encode.c6
-rw-r--r--encoder/ih264e_utils.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/encoder/ih264e_encode.c b/encoder/ih264e_encode.c
index 0760231..93e7dbd 100644
--- a/encoder/ih264e_encode.c
+++ b/encoder/ih264e_encode.c
@@ -304,6 +304,12 @@ WORD32 ih264e_encode(iv_obj_t *ps_codec_obj, void *pv_api_ip, void *pv_api_op)
}
#endif /*LOGO_EN*/
+ /* In case of alt ref and B pics we will have non reference frame in stream */
+ if (ps_codec->s_cfg.u4_enable_alt_ref || ps_codec->s_cfg.u4_num_bframes)
+ {
+ ps_codec->i4_non_ref_frames_in_stream = 1;
+ }
+
if (ps_codec->i4_encode_api_call_cnt == 0)
{
/********************************************************************/
diff --git a/encoder/ih264e_utils.c b/encoder/ih264e_utils.c
index b8514a8..b339143 100644
--- a/encoder/ih264e_utils.c
+++ b/encoder/ih264e_utils.c
@@ -1360,12 +1360,6 @@ IH264E_ERROR_T ih264e_pic_init(codec_t *ps_codec, inp_buf_t *ps_inp_buf)
* a) Set up alt ref too
**************************************************************************/
- /* In case of alt ref and B pics we will have non reference frame in stream */
- if (ps_codec->s_cfg.u4_enable_alt_ref || ps_codec->s_cfg.u4_num_bframes)
- {
- ps_codec->i4_non_ref_frames_in_stream = 1;
- }
-
/* Check and set if the current frame is reference or not */
ps_codec->u4_is_curr_frm_ref = 0;