s8 loop_filter_beta;
enum v4l2_mpeg_video_h264_entropy_mode entropy_mode;
u8 _8x8_transform;
- u32 rc_framerate;
u8 rc_frame_qp;
u8 rc_min_qp;
u8 rc_max_qp;
u16 vop_frm_delta;
u8 rc_b_frame_qp;
/* Common for MPEG4, H263 */
- u32 rc_framerate;
u8 rc_frame_qp;
u8 rc_min_qp;
u8 rc_max_qp;
*/
struct s5p_mfc_vp9_enc_params {
/* VP9 Only */
- u32 rc_framerate;
u8 vp9_version;
u8 rc_min_qp;
u8 rc_max_qp;
*/
struct s5p_mfc_vp8_enc_params {
/* VP8 Only */
- u32 rc_framerate;
u8 vp8_version;
u8 rc_min_qp;
u8 rc_max_qp;
u8 level;
u8 tier_flag;
/* HEVC Only */
- u32 rc_framerate;
u8 rc_min_qp;
u8 rc_max_qp;
u8 rc_min_qp_p;
u8 pad_cr;
u8 rc_frame;
u32 rc_bitrate;
+ u32 rc_framerate;
u16 rc_reaction_coeff;
u32 config_qp;
u32 dynamic_qp;
p->rc_mb = ctrl->value;
break;
case V4L2_CID_MPEG_MFC51_VIDEO_H264_RC_FRAME_RATE:
- p->codec.h264.rc_framerate = ctrl->value;
+ p->rc_framerate = ctrl->value;
break;
case V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP:
p->codec.h264.rc_frame_qp = ctrl->value;
p->codec.mpeg4.vop_frm_delta = ctrl->value;
break;
case V4L2_CID_MPEG_MFC51_VIDEO_H263_RC_FRAME_RATE:
- p->codec.mpeg4.rc_framerate = ctrl->value;
+ p->rc_framerate = ctrl->value;
break;
case V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP:
p->codec.mpeg4.rc_frame_qp = ctrl->value;
p->codec.vp8.vp8_version = ctrl->value;
break;
case V4L2_CID_MPEG_MFC70_VIDEO_VP8_RC_FRAME_RATE:
- p->codec.vp8.rc_framerate = ctrl->value;
+ p->rc_framerate = ctrl->value;
break;
case V4L2_CID_MPEG_VIDEO_VP8_MIN_QP:
p->codec.vp8.rc_min_qp = ctrl->value;
p->codec.vp9.vp9_version = ctrl->value;
break;
case V4L2_CID_MPEG_VIDEO_VP9_RC_FRAME_RATE:
- p->codec.vp9.rc_framerate = ctrl->value;
+ p->rc_framerate = ctrl->value;
break;
case V4L2_CID_MPEG_VIDEO_VP9_MIN_QP:
p->codec.vp9.rc_min_qp = ctrl->value;
p->codec.hevc.rc_b_frame_qp = ctrl->value;
break;
case V4L2_CID_MPEG_MFC90_VIDEO_HEVC_RC_FRAME_RATE:
- p->codec.hevc.rc_framerate = ctrl->value;
+ p->rc_framerate = ctrl->value;
break;
case V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP:
p->codec.hevc.rc_min_qp = ctrl->value;
p->rc_frame_delta = FRAME_DELTA_DEFAULT;
reg = MFC_READL(S5P_FIMV_E_RC_FRAME_RATE);
reg &= ~(0xFFFF << 16);
- reg |= p_264->rc_framerate << 16;
+ reg |= (p->rc_framerate << 16);
reg &= ~(0xFFFF);
reg |= p->rc_frame_delta & 0xFFFF;
MFC_WRITEL(reg, S5P_FIMV_E_RC_FRAME_RATE);
p->rc_frame_delta = FRAME_DELTA_DEFAULT;
reg = MFC_READL(S5P_FIMV_E_RC_FRAME_RATE);
reg &= ~(0xFFFF << 16);
- reg |= (p_mpeg4->rc_framerate << 16);
+ reg |= (p->rc_framerate << 16);
reg &= ~(0xFFFF);
reg |= (p->rc_frame_delta & 0xFFFF);
MFC_WRITEL(reg, S5P_FIMV_E_RC_FRAME_RATE);
p->rc_frame_delta = FRAME_DELTA_DEFAULT;
reg = MFC_READL(S5P_FIMV_E_RC_FRAME_RATE);
reg &= ~(0xFFFF << 16);
- reg |= (p_vp8->rc_framerate << 16);
+ reg |= (p->rc_framerate << 16);
reg &= ~(0xFFFF);
reg |= (p->rc_frame_delta & 0xFFFF);
MFC_WRITEL(reg, S5P_FIMV_E_RC_FRAME_RATE);
p->rc_frame_delta = FRAME_DELTA_DEFAULT;
reg = MFC_READL(S5P_FIMV_E_RC_FRAME_RATE);
reg &= ~(0xFFFF << 16);
- reg |= (p_vp9->rc_framerate << 16);
+ reg |= (p->rc_framerate << 16);
reg &= ~(0xFFFF);
reg |= (p->rc_frame_delta & 0xFFFF);
MFC_WRITEL(reg, S5P_FIMV_E_RC_FRAME_RATE);
p->rc_frame_delta = FRAME_DELTA_DEFAULT;
reg = MFC_READL(S5P_FIMV_E_RC_FRAME_RATE);
reg &= ~(0xFFFF << 16);
- reg |= (p_hevc->rc_framerate << 16);
+ reg |= (p->rc_framerate << 16);
reg &= ~(0xFFFF);
reg |= (p->rc_frame_delta & 0xFFFF);
MFC_WRITEL(reg, S5P_FIMV_E_RC_FRAME_RATE);
static void mfc_handle_stream_copy_timestamp(struct s5p_mfc_ctx *ctx, struct s5p_mfc_buf *src_mb)
{
struct s5p_mfc_dev *dev;
+ struct s5p_mfc_enc *enc = ctx->enc_priv;
+ struct s5p_mfc_enc_params *p = &enc->params;
struct s5p_mfc_buf *dst_mb;
- u64 interval;
+ u32 interval;
u64 start_timestamp;
u64 new_timestamp;
}
start_timestamp = src_mb->vb.vb2_buf.timestamp;
- interval = NSEC_PER_SEC / (ENC_DEFAULT_CAM_VIDEO_FPS / 1000);
+ interval = NSEC_PER_SEC / p->rc_framerate;
if (debug_ts == 1)
- mfc_info_ctx("[TS] %dfps, start timestamp: %lld, base interval: %lld\n",
- (ENC_DEFAULT_CAM_VIDEO_FPS / 1000), start_timestamp, interval);
+ mfc_info_ctx("[TS] %dfps, start timestamp: %lld, base interval: %d\n",
+ p->rc_framerate, start_timestamp, interval);
new_timestamp = start_timestamp + (interval * src_mb->done_index);
if (debug_ts == 1)
- mfc_info_ctx("[TS] new timestamp: %lld, interval: %lld\n",
+ mfc_info_ctx("[TS] new timestamp: %lld, interval: %d\n",
new_timestamp, interval * src_mb->done_index);
/* Get the destination buffer */
static void mfc_nal_q_handle_stream_copy_timestamp(struct s5p_mfc_ctx *ctx, struct s5p_mfc_buf *src_mb)
{
struct s5p_mfc_dev *dev;
+ struct s5p_mfc_enc *enc = ctx->enc_priv;
+ struct s5p_mfc_enc_params *p = &enc->params;
struct s5p_mfc_buf *dst_mb;
- u64 interval;
+ u32 interval;
u64 start_timestamp;
u64 new_timestamp;
}
start_timestamp = src_mb->vb.vb2_buf.timestamp;
- interval = NSEC_PER_SEC / (ENC_DEFAULT_CAM_VIDEO_FPS / 1000);
+ interval = NSEC_PER_SEC / p->rc_framerate;
if (debug_ts == 1)
- mfc_info_ctx("[NALQ][TS] %dfps, start timestamp: %lld, base interval: %lld\n",
- (ENC_DEFAULT_CAM_VIDEO_FPS / 1000), start_timestamp, interval);
+ mfc_info_ctx("[NALQ][TS] %dfps, start timestamp: %lld, base interval: %d\n",
+ p->rc_framerate, start_timestamp, interval);
new_timestamp = start_timestamp + (interval * src_mb->done_index);
if (debug_ts == 1)
- mfc_info_ctx("[NALQ][TS] new timestamp: %lld, interval: %lld\n",
+ mfc_info_ctx("[NALQ][TS] new timestamp: %lld, interval: %d\n",
new_timestamp, interval * src_mb->done_index);
/* Get the destination buffer */
#define DEC_DEFAULT_FPS (240000)
#define ENC_DEFAULT_FPS (240000)
#define ENC_DEFAULT_CAM_CAPTURE_FPS (60000)
-#define ENC_DEFAULT_CAM_VIDEO_FPS (30000)
#define MB_COUNT_PER_UHD_FRAME 32400
#define MAX_FPS_PER_UHD_FRAME 120