Skip to content

Commit

Permalink
Spec specifies ceil(); implementation lacked it
Browse files Browse the repository at this point in the history
  • Loading branch information
dholroyd committed Feb 26, 2024
1 parent 21a5cbe commit 531df43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nal/pps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl SliceGroup {
) -> Result<Vec<u32>, PpsError> {
let pic_size_in_map_units_minus1 = r.read_ue("pic_size_in_map_units_minus1")?;
// TODO: avoid any panics due to failed conversions
let size = ((1f64 + f64::from(num_slice_groups_minus1)).log2()) as u32;
let size = (1f64 + f64::from(num_slice_groups_minus1)).log2().ceil() as u32;
let mut run_length_minus1 = Vec::with_capacity(num_slice_groups_minus1 as usize + 1);
for _ in 0..pic_size_in_map_units_minus1 + 1 {
run_length_minus1.push(r.read_u32(size, "slice_group_id")?);
Expand Down

0 comments on commit 531df43

Please sign in to comment.