Skip to content

Commit

Permalink
More conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
quietvoid committed Dec 7, 2021
1 parent 01c71df commit 3dccdf5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
14 changes: 10 additions & 4 deletions dolby_vision/src/rpu/rpu_data_mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ impl RpuDataMapping {
data.mapping_idc[cmp].resize_with(pivot_idx_count, Default::default);
data.num_mapping_param_predictors[cmp].resize_with(pivot_idx_count, Default::default);
data.mapping_param_pred_flag[cmp].resize_with(pivot_idx_count, Default::default);
data.diff_pred_part_idx_mapping_minus1[cmp]
.resize_with(pivot_idx_count, Default::default);

for pivot_idx in 0..pivot_idx_count {
data.mapping_idc[cmp][pivot_idx] = reader.get_ue()?;
Expand All @@ -81,13 +79,16 @@ impl RpuDataMapping {
if data.poly_order_minus1[cmp].is_empty() {
data.poly_order_minus1[cmp]
.resize_with(pivot_idx_count, Default::default);
data.linear_interp_flag[cmp]
.resize_with(pivot_idx_count, Default::default);
}

data.poly_order_minus1[cmp][pivot_idx] = reader.get_ue()?;

if data.poly_order_minus1[cmp][pivot_idx] == 0 {
if data.linear_interp_flag[cmp].is_empty() {
data.linear_interp_flag[cmp]
.resize_with(pivot_idx_count, Default::default);
}

data.linear_interp_flag[cmp][pivot_idx] = reader.get()?;
}

Expand Down Expand Up @@ -181,6 +182,11 @@ impl RpuDataMapping {
}
}
} else if data.num_mapping_param_predictors[cmp][pivot_idx] > 1 {
if data.diff_pred_part_idx_mapping_minus1[cmp].is_empty() {
data.diff_pred_part_idx_mapping_minus1[cmp]
.resize_with(pivot_idx_count, Default::default);
}

data.diff_pred_part_idx_mapping_minus1[cmp][pivot_idx] = reader.get_ue()?;
}
}
Expand Down
7 changes: 5 additions & 2 deletions dolby_vision/src/rpu/rpu_data_nlq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ impl RpuDataNlq {
.resize_with(pivot_idx_count, Default::default);
data.nlq_param_pred_flag
.resize_with(pivot_idx_count, Default::default);
data.diff_pred_part_idx_nlq_minus1
.resize_with(pivot_idx_count, Default::default);

for pivot_idx in 0..pivot_idx_count {
for cmp in 0..NUM_COMPONENTS {
Expand Down Expand Up @@ -120,6 +118,11 @@ impl RpuDataNlq {
}
}
} else if data.num_nlq_param_predictors[pivot_idx][cmp] > 1 {
if data.diff_pred_part_idx_nlq_minus1.is_empty() {
data.diff_pred_part_idx_nlq_minus1
.resize_with(pivot_idx_count, Default::default);
}

data.diff_pred_part_idx_nlq_minus1[pivot_idx][cmp] = reader.get_ue()?;
}
}
Expand Down

0 comments on commit 3dccdf5

Please sign in to comment.