/* enable RC_BIT_RATE_CHANGE */
value = MFC_READL(buf_ctrl->flag_addr);
- if (temporal_LC.temporal_layer_bitrate[0] > 0)
+ if (temporal_LC.temporal_layer_bitrate[0] > 0 || p->hier_bitrate_ctrl)
/* set RC_BIT_RATE_CHANGE */
value |= (1 << 2);
else
buf_ctrl->old_val2 = value;
value &= ~(0x7);
value |= (temporal_LC.temporal_layer_count & 0x7);
+ value &= ~(0x1 << 8);
+ value |= (p->hier_bitrate_ctrl & 0x1) << 8;
MFC_WRITEL(value, S5P_FIMV_E_NUM_T_LAYER);
mfc_debug(3, "Temporal SVC: E_NUM_T_LAYER %#x\n", value);
for (i = 0; i < (temporal_LC.temporal_layer_count & 0x7); i++) {
- mfc_debug(3, "Temporal SVC: layer bitrate[%d] %d\n",
- i, temporal_LC.temporal_layer_bitrate[i]);
+ mfc_debug(3, "Temporal SVC: layer bitrate[%d] %d (FW ctrl: %d)\n",
+ i, temporal_LC.temporal_layer_bitrate[i], p->hier_bitrate_ctrl);
MFC_WRITEL(temporal_LC.temporal_layer_bitrate[i],
buf_ctrl->addr + i * 4);
}
temporal_LC.temporal_layer_count & 0x7;
/* enable RC_BIT_RATE_CHANGE */
- if (temporal_LC.temporal_layer_bitrate[0] > 0)
+ if (temporal_LC.temporal_layer_bitrate[0] > 0 || p->hier_bitrate_ctrl)
pInStr->ParamChange |= (1 << 2);
else
pInStr->ParamChange &= ~(1 << 2);
pInStr->NumTLayer &= ~(0x7);
pInStr->NumTLayer |= (temporal_LC.temporal_layer_count & 0x7);
+ pInStr->NumTLayer &= ~(0x1 << 8);
+ pInStr->NumTLayer |= (p->hier_bitrate_ctrl & 0x1) << 8;
for (i = 0; i < (temporal_LC.temporal_layer_count & 0x7); i++) {
- mfc_debug(3, "Temporal SVC: layer bitrate[%d] %d\n",
- i, temporal_LC.temporal_layer_bitrate[i]);
+ mfc_debug(3, "Temporal SVC: layer bitrate[%d] %d (FW ctrl: %d)\n",
+ i, temporal_LC.temporal_layer_bitrate[i], p->hier_bitrate_ctrl);
pInStr->HierarchicalBitRateLayer[i] =
temporal_LC.temporal_layer_bitrate[i];
}
} else {
reg |= 0x7 << 4;
}
+ reg &= ~(0x1 << 8);
+ reg |= (p->hier_bitrate_ctrl & 0x1) << 8;
MFC_WRITEL(reg, S5P_FIMV_E_NUM_T_LAYER);
mfc_debug(3, "Temporal SVC: hier_qp_enable %d, enable_ltr %d, "
"num_hier_layer %d, max_layer %d, hier_ref_type %d, NUM_T_LAYER 0x%x\n",
for (i = 0; i < 7; i++) {
MFC_WRITEL(p_264->hier_qp_layer[i],
S5P_FIMV_E_HIERARCHICAL_QP_LAYER0 + i * 4);
+ /* If hier_bitrate_ctrl is set to 1, this is meaningless */
MFC_WRITEL(p_264->hier_bit_layer[i],
S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER0 + i * 4);
- mfc_debug(3, "Temporal SVC: layer[%d] QP: %#x, bitrate: %d\n",
+ mfc_debug(3, "Temporal SVC: layer[%d] QP: %#x, bitrate: %d(FW ctrl: %d)\n",
i, p_264->hier_qp_layer[i],
- p_264->hier_bit_layer[i]);
+ p_264->hier_bit_layer[i], p->hier_bitrate_ctrl);
}
if (p_264->set_priority) {
reg = 0;
reg |= p_vp8->num_hier_layer & 0x3;
reg &= ~(0x7 << 4);
reg |= 0x3 << 4;
+ reg &= ~(0x1 << 8);
+ reg |= (p->hier_bitrate_ctrl & 0x1) << 8;
MFC_WRITEL(reg, S5P_FIMV_E_NUM_T_LAYER);
mfc_debug(3, "Temporal SVC: hier_qp_enable %d, num_hier_layer %d, NUM_T_LAYER 0x%x\n",
p_vp8->hier_qp_enable, p_vp8->num_hier_layer, reg);
for (i = 0; i < 3; i++) {
MFC_WRITEL(p_vp8->hier_qp_layer[i],
S5P_FIMV_E_HIERARCHICAL_QP_LAYER0 + i * 4);
+ /* If hier_bitrate_ctrl is set to 1, this is meaningless */
MFC_WRITEL(p_vp8->hier_bit_layer[i],
S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER0 + i * 4);
- mfc_debug(3, "Temporal SVC: layer[%d] QP: %#x, bitrate: %#x\n",
+ mfc_debug(3, "Temporal SVC: layer[%d] QP: %#x, bitrate: %#x(FW ctrl: %d)\n",
i, p_vp8->hier_qp_layer[i],
- p_vp8->hier_bit_layer[i]);
+ p_vp8->hier_bit_layer[i], p->hier_bitrate_ctrl);
}
reg = 0;
reg |= p_vp9->num_hier_layer & 0x3;
reg &= ~(0x7 << 4);
reg |= 0x3 << 4;
+ reg &= ~(0x1 << 8);
+ reg |= (p->hier_bitrate_ctrl & 0x1) << 8;
MFC_WRITEL(reg, S5P_FIMV_E_NUM_T_LAYER);
mfc_debug(3, "Temporal SVC: hier_qp_enable %d, num_hier_layer %d, NUM_T_LAYER 0x%x\n",
p_vp9->hier_qp_enable, p_vp9->num_hier_layer, reg);
for (i = 0; i < 3; i++) {
MFC_WRITEL(p_vp9->hier_qp_layer[i],
S5P_FIMV_E_HIERARCHICAL_QP_LAYER0 + i * 4);
+ /* If hier_bitrate_ctrl is set to 1, this is meaningless */
MFC_WRITEL(p_vp9->hier_bit_layer[i],
S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER0 + i * 4);
- mfc_debug(3, "Temporal SVC: layer[%d] QP: %#x, bitrate: %#x\n",
+ mfc_debug(3, "Temporal SVC: layer[%d] QP: %#x, bitrate: %#x (FW ctrl: %d)\n",
i, p_vp9->hier_qp_layer[i],
- p_vp9->hier_bit_layer[i]);
+ p_vp9->hier_bit_layer[i], p->hier_bitrate_ctrl);
}
/* qp */
} else {
reg |= 0x7 << 4;
}
+ reg &= ~(0x1 << 8);
+ reg |= (p->hier_bitrate_ctrl & 0x1) << 8;
MFC_WRITEL(reg, S5P_FIMV_E_NUM_T_LAYER);
mfc_debug(2, "Temporal SVC: hier_qp_enable %d, enable_ltr %d, "
"num_hier_layer %d, max_layer %d, hier_ref_type %d, NUM_T_LAYER 0x%x\n",
S5P_FIMV_E_HIERARCHICAL_QP_LAYER0 + i * 4);
MFC_WRITEL(p_hevc->hier_bit_layer[i],
S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER0 + i * 4);
- mfc_debug(3, "Temporal SVC: layer[%d] QP: %#x, bitrate: %#x\n",
+ mfc_debug(3, "Temporal SVC: layer[%d] QP: %#x, bitrate: %d(FW ctrl: %d)\n",
i, p_hevc->hier_qp_layer[i],
- p_hevc->hier_bit_layer[i]);
+ p_hevc->hier_bit_layer[i], p->hier_bitrate_ctrl);
}
/* rate control config. */