priv->force_pic_type.IntraRefreshVOP = OMX_FALSE;
priv->frame_num = 0;
priv->pic_order_cnt = 0;
+ priv->restricted_b_frames = debug_get_bool_option("OMX_USE_RESTRICTED_B_FRAMES", FALSE);
priv->scale.xWidth = OMX_VID_ENC_SCALING_WIDTH_DEFAULT;
priv->scale.xHeight = OMX_VID_ENC_SCALING_WIDTH_DEFAULT;
picture.picture_type = picture_type;
picture.pic_order_cnt = task->pic_order_cnt;
+ if (priv->restricted_b_frames && picture_type == PIPE_H264_ENC_PICTURE_TYPE_B)
+ picture.not_referenced = true;
enc_ControlPicture(port, &picture);
/* -------------- encode frame --------- */
/* handle B frames */
LIST_FOR_EACH_ENTRY(task, &priv->b_frames, list) {
enc_HandleTask(port, task, PIPE_H264_ENC_PICTURE_TYPE_B);
- priv->ref_idx_l0 = priv->frame_num++;
+ if (!priv->restricted_b_frames)
+ priv->ref_idx_l0 = priv->frame_num;
+ priv->frame_num++;
}
enc_MoveTasks(&priv->b_frames, &inp->tasks);
/* handle B frames */
LIST_FOR_EACH_ENTRY(task, &priv->b_frames, list) {
enc_HandleTask(port, task, PIPE_H264_ENC_PICTURE_TYPE_B);
- priv->ref_idx_l0 = priv->frame_num++;
+ if (!priv->restricted_b_frames)
+ priv->ref_idx_l0 = priv->frame_num;
+ priv->frame_num++;
}
enc_MoveTasks(&priv->b_frames, &inp->tasks);
OMX_U32 frame_num; \
OMX_U32 pic_order_cnt; \
OMX_U32 ref_idx_l0, ref_idx_l1; \
+ OMX_BOOL restricted_b_frames; \
OMX_VIDEO_PARAM_BITRATETYPE bitrate; \
OMX_VIDEO_PARAM_QUANTIZATIONTYPE quant; \
OMX_CONFIG_INTRAREFRESHVOPTYPE force_pic_type; \