Skip to content

Commit 908e201

Browse files
bai-isaacXinfengZhang
authored andcommitted
[HEVCe] update header logic
update hevce fill header logic when VAConfigAttribEncHEVCFeatures supported.
1 parent bbf09fa commit 908e201

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

encode/hevcencode.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -841,9 +841,9 @@ void fill_sps_header(struct SeqParamSet *sps, int id)
841841
sps->log2_min_luma_transform_block_size_minus2) : 3;
842842
sps->max_transform_hierarchy_depth_inter = use_block_sizes ? block_sizes.max_max_transform_hierarchy_depth_inter : 2;
843843
sps->max_transform_hierarchy_depth_intra = use_block_sizes ? block_sizes.max_max_transform_hierarchy_depth_intra : 2;
844-
sps->scaling_list_enabled_flag = use_features ? features.scaling_lists : 0;
845-
sps->sps_scaling_list_data_present_flag = 0;
846-
sps->amp_enabled_flag = use_features ? features.amp : 1;
844+
sps->scaling_list_enabled_flag = 0;
845+
//sps->sps_scaling_list_data_present_flag; // ignore since scaling_list_enabled_flag equal to 0
846+
sps->amp_enabled_flag = use_features ? features.amp >= 1 : 1;
847847
sps->sample_adaptive_offset_enabled_flag = use_features ? features.sao : 1;
848848
sps->pcm_enabled_flag = use_features ? features.pcm : 0;
849849
/* ignore below parameters seting since pcm_enabled_flag equal to 0
@@ -899,7 +899,7 @@ static void fill_pps_header(
899899
pps->init_qp_minus26 = initial_qp - 26;
900900
pps->constrained_intra_pred_flag = use_features ? features.constrained_intra_pred : 0;
901901
pps->transform_skip_enabled_flag = use_features ? features.transform_skip : 0;
902-
pps->cu_qp_delta_enabled_flag = use_features ? features.cu_qp_delta : 1;
902+
pps->cu_qp_delta_enabled_flag = use_features ? features.cu_qp_delta >= 1 : 1;
903903
if (pps->cu_qp_delta_enabled_flag)
904904
pps->diff_cu_qp_delta_depth = 2;
905905
pps->pps_cb_qp_offset = 0;
@@ -1986,6 +1986,7 @@ static int init_va(void)
19861986
VAEntrypoint *entrypoints;
19871987
int num_entrypoints, slice_entrypoint;
19881988
int support_encode = 0;
1989+
int support_lpEntryPoint = 0;
19891990
int major_ver, minor_ver;
19901991
VAStatus va_status;
19911992
unsigned int i;
@@ -2009,10 +2010,12 @@ static int init_va(void)
20092010
hevc_profile = profile_list[i];
20102011
vaQueryConfigEntrypoints(va_dpy, hevc_profile, entrypoints, &num_entrypoints);
20112012
for (slice_entrypoint = 0; slice_entrypoint < num_entrypoints; slice_entrypoint++) {
2012-
if (entrypoints[slice_entrypoint] == VAEntrypointEncSlice ||
2013-
entrypoints[slice_entrypoint] == VAEntrypointEncSliceLP ) {
2013+
if (entrypoints[slice_entrypoint] == VAEntrypointEncSlice) {
20142014
support_encode = 1;
2015-
break;
2015+
}
2016+
else if (entrypoints[slice_entrypoint] == VAEntrypointEncSliceLP) {
2017+
support_encode = 1;
2018+
support_lpEntryPoint = 1;
20162019
}
20172020
}
20182021
if (support_encode == 1)
@@ -2048,8 +2051,10 @@ static int init_va(void)
20482051

20492052
if (lowpower)
20502053
{
2051-
entryPoint = VAEntrypointEncSliceLP;
20522054
LCU_SIZE = 64;
2055+
if (support_lpEntryPoint == 1) {
2056+
entryPoint = VAEntrypointEncSliceLP;
2057+
}
20532058
}
20542059

20552060
va_status = vaGetConfigAttributes(va_dpy, hevc_profile, entryPoint,

0 commit comments

Comments
 (0)