Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local stream state #101

Merged
merged 6 commits into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/structs/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ impl ModelPerColor {
&mut self.sign_counts[calc_sign_index(best_prior as i16)][best_prior_bit_len];

let neg = !bool_reader
.get(sign, ModelComponent::Edge(ModelSubComponent::Sign))
.get_bit(sign, ModelComponent::Edge(ModelSubComponent::Sign))
.context(here!())?;

coef = 1;
Expand All @@ -388,7 +388,7 @@ impl ModelPerColor {

let mut decoded_so_far = 1;
while i >= min_threshold {
let cur_bit = bool_reader.get(
let cur_bit = bool_reader.get_bit(
&mut thresh_prob[decoded_so_far],
ModelComponent::Edge(ModelSubComponent::Residual),
)? as i16;
Expand Down Expand Up @@ -472,7 +472,7 @@ impl ModelPerColor {
let sign =
&mut self.sign_counts[calc_sign_index(best_prior as i16)][best_prior_bit_len];

bool_writer.put(
bool_writer.put_bit(
coef >= 0,
sign,
ModelComponent::Edge(ModelSubComponent::Sign),
Expand All @@ -492,7 +492,7 @@ impl ModelPerColor {
let mut encoded_so_far = 1;
while i >= min_threshold {
let cur_bit = (abs_coef & (1 << i)) != 0;
bool_writer.put(
bool_writer.put_bit(
cur_bit,
&mut thresh_prob[encoded_so_far],
ModelComponent::Edge(ModelSubComponent::Residual),
Expand Down Expand Up @@ -659,7 +659,7 @@ impl Model {

let mut coef: i16 = 0;
if length != 0 {
let neg = !bool_reader.get(sign_branch, sign_cmp)?;
let neg = !bool_reader.get_bit(sign_branch, sign_cmp)?;
if length > 1 {
coef = bool_reader.get_n_bits(length - 1, bits_branch, bits_cmp)? as i16;
}
Expand Down Expand Up @@ -704,7 +704,7 @@ impl Model {

bool_writer.put_unary_encoded(coef_bit_len as usize, magnitude_branches, mag_cmp)?;
if coef != 0 {
bool_writer.put(coef > 0, sign_branch, sign_cmp)?;
bool_writer.put_bit(coef > 0, sign_branch, sign_cmp)?;
}

if coef_bit_len > 1 {
Expand Down
Loading
Loading