Skip to content

Commit

Permalink
[HEVCe] update header logic
Browse files Browse the repository at this point in the history
update hevce fill header logic when VAConfigAttribEncHEVCFeatures
supported.
  • Loading branch information
bai-isaac committed Jul 16, 2024
1 parent bbf09fa commit fac4f9b
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions encode/hevcencode.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,9 +841,9 @@ void fill_sps_header(struct SeqParamSet *sps, int id)
sps->log2_min_luma_transform_block_size_minus2) : 3;
sps->max_transform_hierarchy_depth_inter = use_block_sizes ? block_sizes.max_max_transform_hierarchy_depth_inter : 2;
sps->max_transform_hierarchy_depth_intra = use_block_sizes ? block_sizes.max_max_transform_hierarchy_depth_intra : 2;
sps->scaling_list_enabled_flag = use_features ? features.scaling_lists : 0;
sps->sps_scaling_list_data_present_flag = 0;
sps->amp_enabled_flag = use_features ? features.amp : 1;
sps->scaling_list_enabled_flag = 0;
//sps->sps_scaling_list_data_present_flag; // ignore since scaling_list_enabled_flag equal to 0
sps->amp_enabled_flag = use_features ? features.amp >= 1 : 1;
sps->sample_adaptive_offset_enabled_flag = use_features ? features.sao : 1;
sps->pcm_enabled_flag = use_features ? features.pcm : 0;
/* ignore below parameters seting since pcm_enabled_flag equal to 0
Expand Down Expand Up @@ -899,7 +899,7 @@ static void fill_pps_header(
pps->init_qp_minus26 = initial_qp - 26;
pps->constrained_intra_pred_flag = use_features ? features.constrained_intra_pred : 0;
pps->transform_skip_enabled_flag = use_features ? features.transform_skip : 0;
pps->cu_qp_delta_enabled_flag = use_features ? features.cu_qp_delta : 1;
pps->cu_qp_delta_enabled_flag = use_features ? features.cu_qp_delta >= 1 : 1;
if (pps->cu_qp_delta_enabled_flag)
pps->diff_cu_qp_delta_depth = 2;
pps->pps_cb_qp_offset = 0;
Expand Down Expand Up @@ -1986,6 +1986,7 @@ static int init_va(void)
VAEntrypoint *entrypoints;
int num_entrypoints, slice_entrypoint;
int support_encode = 0;
int support_lpEncode = 0;
int major_ver, minor_ver;
VAStatus va_status;
unsigned int i;
Expand All @@ -2009,10 +2010,12 @@ static int init_va(void)
hevc_profile = profile_list[i];
vaQueryConfigEntrypoints(va_dpy, hevc_profile, entrypoints, &num_entrypoints);
for (slice_entrypoint = 0; slice_entrypoint < num_entrypoints; slice_entrypoint++) {
if (entrypoints[slice_entrypoint] == VAEntrypointEncSlice ||
entrypoints[slice_entrypoint] == VAEntrypointEncSliceLP ) {
if (entrypoints[slice_entrypoint] == VAEntrypointEncSlice) {
support_encode = 1;
break;
}
else if (entrypoints[slice_entrypoint] == VAEntrypointEncSliceLP) {
support_encode = 1;
support_lpEncode = 1;
}
}
if (support_encode == 1)
Expand Down Expand Up @@ -2048,8 +2051,10 @@ static int init_va(void)

if (lowpower)
{
entryPoint = VAEntrypointEncSliceLP;
LCU_SIZE = 64;
if (support_lpEncode == 1) {
entryPoint = VAEntrypointEncSliceLP;
}
}

va_status = vaGetConfigAttributes(va_dpy, hevc_profile, entryPoint,
Expand Down

0 comments on commit fac4f9b

Please sign in to comment.