PIPE_VIDEO_ENTRYPOINT_ENCODE);
break;
case VAConfigAttribRateControl:
+ {
+ /* Legacy behavior reports these three modes for all drivers */
value = VA_RC_CQP | VA_RC_CBR | VA_RC_VBR;
- break;
+
+ /* Check for optional mode QVBR */
+ int supports_qvbr = pscreen->get_video_param(pscreen, ProfileToPipe(profile),
+ PIPE_VIDEO_ENTRYPOINT_ENCODE,
+ PIPE_VIDEO_CAP_ENC_RATE_CONTROL_QVBR);
+ if (supports_qvbr > 0)
+ value |= VA_RC_QVBR;
+ } break;
case VAConfigAttribEncRateControlExt:
value = pscreen->get_video_param(pscreen, ProfileToPipe(profile),
PIPE_VIDEO_ENTRYPOINT_ENCODE,
config->rc = PIPE_H2645_ENC_RATE_CONTROL_METHOD_VARIABLE;
else if (attrib_list[i].value == VA_RC_CQP)
config->rc = PIPE_H2645_ENC_RATE_CONTROL_METHOD_DISABLE;
+ else if (attrib_list[i].value == VA_RC_QVBR)
+ config->rc = PIPE_H2645_ENC_RATE_CONTROL_METHOD_QUALITY_VARIABLE;
else {
FREE(config);
return VA_STATUS_ERROR_INVALID_VALUE;
context->desc.h264enc.rate_ctrl[temporal_id].max_qp = rc->max_qp;
context->desc.h264enc.rate_ctrl[temporal_id].min_qp = rc->min_qp;
+ if (context->desc.h264enc.rate_ctrl[0].rate_ctrl_method ==
+ PIPE_H2645_ENC_RATE_CONTROL_METHOD_QUALITY_VARIABLE)
+ context->desc.h264enc.rate_ctrl[temporal_id].vbr_quality_factor =
+ rc->quality_factor;
+
return VA_STATUS_SUCCESS;
}
context->desc.h265enc.rc.max_qp = rc->max_qp;
context->desc.h265enc.rc.min_qp = rc->min_qp;
+ if (context->desc.h265enc.rc.rate_ctrl_method ==
+ PIPE_H2645_ENC_RATE_CONTROL_METHOD_QUALITY_VARIABLE)
+ context->desc.h265enc.rc.vbr_quality_factor =
+ rc->quality_factor;
+
return VA_STATUS_SUCCESS;
}
PIPE_VIDEO_CAP_ENC_SUPPORTS_ASYNC_OPERATION = 33,
PIPE_VIDEO_CAP_MIN_WIDTH = 34,
- PIPE_VIDEO_CAP_MIN_HEIGHT = 35
+ PIPE_VIDEO_CAP_MIN_HEIGHT = 35,
+ PIPE_VIDEO_CAP_ENC_RATE_CONTROL_QVBR = 36
};
/* To be used with PIPE_VIDEO_CAP_VPP_ORIENTATION_MODES and for VPP state*/
PIPE_H2645_ENC_RATE_CONTROL_METHOD_CONSTANT_SKIP = 0x01,
PIPE_H2645_ENC_RATE_CONTROL_METHOD_VARIABLE_SKIP = 0x02,
PIPE_H2645_ENC_RATE_CONTROL_METHOD_CONSTANT = 0x03,
- PIPE_H2645_ENC_RATE_CONTROL_METHOD_VARIABLE = 0x04
+ PIPE_H2645_ENC_RATE_CONTROL_METHOD_VARIABLE = 0x04,
+ PIPE_H2645_ENC_RATE_CONTROL_METHOD_QUALITY_VARIABLE = 0x05
};
enum pipe_slice_buffer_placement_type
unsigned max_au_size;
unsigned max_qp;
unsigned min_qp;
+
+ /* Used with PIPE_H2645_ENC_RATE_CONTROL_METHOD_QUALITY_VARIABLE */
+ unsigned vbr_quality_factor;
};
struct pipe_h264_enc_motion_estimation
unsigned max_au_size;
unsigned max_qp;
unsigned min_qp;
+
+ /* Used with PIPE_H2645_ENC_RATE_CONTROL_METHOD_QUALITY_VARIABLE */
+ unsigned vbr_quality_factor;
};
struct pipe_h265_enc_picture_desc