mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 11:38:05 +02:00
frontends/va: Support H264 encode pic_order_cnt_type 1
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38052>
This commit is contained in:
parent
cef8eff74d
commit
8c2de21090
2 changed files with 16 additions and 7 deletions
|
|
@ -450,6 +450,9 @@ static void parseEncSliceParamsH264(vlVaContext *context,
|
|||
if (seq->pic_order_cnt_type == 0)
|
||||
slice->pic_order_cnt_lsb = vl_rbsp_u(rbsp, seq->log2_max_pic_order_cnt_lsb_minus4 + 4);
|
||||
|
||||
if (seq->pic_order_cnt_type == 1 && !seq->delta_pic_order_always_zero_flag)
|
||||
slice->delta_pic_order_cnt0 = vl_rbsp_se(rbsp);
|
||||
|
||||
if (pic->redundant_pic_cnt_present_flag)
|
||||
slice->redundant_pic_cnt = vl_rbsp_ue(rbsp);
|
||||
|
||||
|
|
@ -581,7 +584,7 @@ static void parseEncHrdParamsH264(struct vl_rbsp *rbsp, pipe_h264_enc_hrd_params
|
|||
|
||||
static void parseEncSpsParamsH264(vlVaContext *context, struct vl_rbsp *rbsp)
|
||||
{
|
||||
unsigned i, profile_idc, num_ref_frames_in_pic_order_cnt_cycle;
|
||||
unsigned i, profile_idc;
|
||||
|
||||
context->desc.h264enc.seq.profile_idc = vl_rbsp_u(rbsp, 8);
|
||||
context->desc.h264enc.seq.enc_constraint_set_flags = vl_rbsp_u(rbsp, 6);
|
||||
|
|
@ -616,12 +619,12 @@ static void parseEncSpsParamsH264(vlVaContext *context, struct vl_rbsp *rbsp)
|
|||
if (context->desc.h264enc.seq.pic_order_cnt_type == 0)
|
||||
context->desc.h264enc.seq.log2_max_pic_order_cnt_lsb_minus4 = vl_rbsp_ue(rbsp);
|
||||
else if (context->desc.h264enc.seq.pic_order_cnt_type == 1) {
|
||||
vl_rbsp_u(rbsp, 1); /* delta_pic_order_always_zero_flag */
|
||||
vl_rbsp_se(rbsp); /* offset_for_non_ref_pic */
|
||||
vl_rbsp_se(rbsp); /* offset_for_top_to_bottom_field */
|
||||
num_ref_frames_in_pic_order_cnt_cycle = vl_rbsp_ue(rbsp);
|
||||
for (i = 0; i < num_ref_frames_in_pic_order_cnt_cycle; ++i)
|
||||
vl_rbsp_se(rbsp); /* offset_for_ref_frame[i] */
|
||||
context->desc.h264enc.seq.delta_pic_order_always_zero_flag = vl_rbsp_u(rbsp, 1);
|
||||
context->desc.h264enc.seq.offset_for_non_ref_pic = vl_rbsp_se(rbsp);
|
||||
context->desc.h264enc.seq.offset_for_top_to_bottom_field = vl_rbsp_se(rbsp);
|
||||
context->desc.h264enc.seq.num_ref_frames_in_pic_order_cnt_cycle = vl_rbsp_ue(rbsp);
|
||||
for (i = 0; i < context->desc.h264enc.seq.num_ref_frames_in_pic_order_cnt_cycle; ++i)
|
||||
context->desc.h264enc.seq.offset_for_ref_frame[i] = vl_rbsp_se(rbsp);
|
||||
}
|
||||
|
||||
context->desc.h264enc.seq.max_num_ref_frames = vl_rbsp_ue(rbsp);
|
||||
|
|
|
|||
|
|
@ -825,6 +825,7 @@ struct pipe_h264_enc_seq_param
|
|||
uint32_t video_full_range_flag : 1;
|
||||
uint32_t direct_8x8_inference_flag : 1;
|
||||
uint32_t gaps_in_frame_num_value_allowed_flag : 1;
|
||||
uint32_t delta_pic_order_always_zero_flag : 1;
|
||||
};
|
||||
unsigned profile_idc;
|
||||
unsigned enc_constraint_set_flags;
|
||||
|
|
@ -877,6 +878,10 @@ struct pipe_h264_enc_seq_param
|
|||
uint32_t max_num_ref_frames;
|
||||
uint32_t pic_width_in_mbs_minus1;
|
||||
uint32_t pic_height_in_map_units_minus1;
|
||||
int32_t offset_for_non_ref_pic;
|
||||
int32_t offset_for_top_to_bottom_field;
|
||||
uint32_t num_ref_frames_in_pic_order_cnt_cycle;
|
||||
int32_t offset_for_ref_frame[256];
|
||||
};
|
||||
|
||||
struct pipe_h264_ref_list_mod_entry
|
||||
|
|
@ -925,6 +930,7 @@ struct pipe_h264_enc_slice_param
|
|||
uint8_t disable_deblocking_filter_idc;
|
||||
int32_t slice_alpha_c0_offset_div2;
|
||||
int32_t slice_beta_offset_div2;
|
||||
int32_t delta_pic_order_cnt0;
|
||||
};
|
||||
|
||||
struct pipe_h264_enc_dpb_entry
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue