Currently these variables are used only for H.264 encoding
v2: rename frame_width_in_mbs and frame_height_in_mbs to
frame_width_in_pixel and frame_height_in_pixel. It moves
WIDTH_IN_MACROBLOCKS() and HEIGHT_IN_MACROBLOCKS() from gen9_vdenc.h
to i965_encoder.h so that the two macros can be used in
other codecs.
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Tested-by: Luo, Focus <focus.luo@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
(cherry picked from commit
a069eff77a715804318011a69304a6c7d1afab17)
#define VDENC_LUTMODE_REF_ID 0x0A
#define VDENC_LUTMODE_INTRA_CHROMA 0x0B
-#define WIDTH_IN_MACROBLOCKS(width) (ALIGN(width, 16) >> 4)
-#define HEIGHT_IN_MACROBLOCKS(height) (ALIGN(height, 16) >> 4)
-
struct gen9_mfx_avc_img_state
{
union {
*/
encoder_context->is_new_sequence = (pic_param->pic_fields.bits.idr_pic_flag && seq_param);
+ if (encoder_context->is_new_sequence) {
+ encoder_context->num_frames_in_sequence = 0;
+ encoder_context->frame_width_in_pixel = seq_param->picture_width_in_mbs * 16;
+ encoder_context->frame_height_in_pixel = seq_param->picture_height_in_mbs * 16;
+ }
+
return VA_STATUS_SUCCESS;
error:
}
encoder_context->mfc_pipeline(ctx, profile, encode_state, encoder_context);
+ encoder_context->num_frames_in_sequence++;
return VA_STATUS_SUCCESS;
}
#define I965_BRC_VBR 2
#define I965_BRC_CQP 3
+#define WIDTH_IN_MACROBLOCKS(width) (ALIGN(width, 16) >> 4)
+#define HEIGHT_IN_MACROBLOCKS(height) (ALIGN(height, 16) >> 4)
+
struct intel_roi
{
short left;
unsigned int rate_control_mode;
unsigned int quality_level;
unsigned int quality_range;
+ unsigned int num_frames_in_sequence;
+ unsigned int frame_width_in_pixel;
+ unsigned int frame_height_in_pixel;
+
void *vme_context;
void *mfc_context;
void *enc_priv_state;