Commit f38332a3 authored by David Flynn's avatar David Flynn
Browse files

hls/m50745: avoid signalling variables in meaningless cases

For the lifting scheme, some APS parameters are always signalled.
However, some syntax elements are not needed depending upon the values
of attr_coding_type and lifting_scalability_enabled_flag.  This adoption
avoids signalling unnecessary syntax elements in these cases.
parent 047cc958
......@@ -273,20 +273,26 @@ write(const AttributeParameterSet& aps)
|| aps.attr_encoding == AttributeEncoding::kPredictingTransform;
if (isLifting) {
bs.writeUe(aps.num_pred_nearest_neighbours);
bs.writeUe(aps.max_num_direct_predictors);
bs.writeUe(aps.search_range);
bs.write(aps.lod_decimation_enabled_flag);
bs.writeUe(aps.num_detail_levels);
for (int idx = 0; idx < aps.num_detail_levels; idx++) {
// todo(??): is this an appropriate encoding?
bs.writeUe64(aps.dist2[idx]);
if (aps.attr_encoding == AttributeEncoding::kLiftingTransform)
bs.write(aps.scalable_lifting_enabled_flag);
if (!aps.scalable_lifting_enabled_flag) {
bs.writeUe(aps.search_range);
bs.write(aps.lod_decimation_enabled_flag);
for (int idx = 0; idx < aps.num_detail_levels; idx++) {
// todo(??): is this an appropriate encoding?
bs.writeUe64(aps.dist2[idx]);
}
}
}
if (aps.attr_encoding == AttributeEncoding::kPredictingTransform) {
bs.writeUe(aps.adaptive_prediction_threshold);
bs.write(aps.intra_lod_prediction_enabled_flag);
bs.writeUe(aps.max_num_direct_predictors);
}
if (aps.attr_encoding == AttributeEncoding::kRAHTransform) {
......@@ -294,10 +300,6 @@ write(const AttributeParameterSet& aps)
bs.writeUe(aps.raht_depth);
}
if (aps.attr_encoding == AttributeEncoding::kLiftingTransform) {
bs.write(aps.scalable_lifting_enabled_flag);
}
bool aps_extension_flag = false;
bs.write(aps_extension_flag);
bs.byteAlign();
......@@ -326,14 +328,20 @@ parseAps(const PayloadBuffer& buf)
|| aps.attr_encoding == AttributeEncoding::kPredictingTransform;
if (isLifting) {
bs.readUe(&aps.num_pred_nearest_neighbours);
bs.readUe(&aps.max_num_direct_predictors);
bs.readUe(&aps.search_range);
bs.read(&aps.lod_decimation_enabled_flag);
bs.readUe(&aps.num_detail_levels);
aps.scalable_lifting_enabled_flag = false;
if (aps.attr_encoding == AttributeEncoding::kLiftingTransform)
bs.read(&aps.scalable_lifting_enabled_flag);
if (!aps.scalable_lifting_enabled_flag) {
bs.readUe(&aps.search_range);
bs.read(&aps.lod_decimation_enabled_flag);
aps.num_detail_levels = int(bs.readUe());
aps.dist2.resize(aps.num_detail_levels);
for (int idx = 0; idx < aps.num_detail_levels; idx++) {
bs.readUe(&aps.dist2[idx]);
aps.dist2.resize(aps.num_detail_levels);
for (int idx = 0; idx < aps.num_detail_levels; idx++) {
bs.readUe(&aps.dist2[idx]);
}
}
}
......@@ -341,6 +349,7 @@ parseAps(const PayloadBuffer& buf)
if (aps.attr_encoding == AttributeEncoding::kPredictingTransform) {
bs.readUe(&aps.adaptive_prediction_threshold);
bs.read(&aps.intra_lod_prediction_enabled_flag);
bs.readUe(&aps.max_num_direct_predictors);
}
if (aps.attr_encoding == AttributeEncoding::kRAHTransform) {
......@@ -348,11 +357,6 @@ parseAps(const PayloadBuffer& buf)
bs.readUe(&aps.raht_depth);
}
aps.scalable_lifting_enabled_flag = false;
if (aps.attr_encoding == AttributeEncoding::kLiftingTransform) {
bs.readUn(1, &aps.scalable_lifting_enabled_flag);
}
bool aps_extension_flag = bs.read();
if (aps_extension_flag) {
// todo(df): aps_extension_data;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment