Skip to content
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
22 changes: 4 additions & 18 deletions src/enc/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1813,34 +1813,20 @@ fn ChooseContextMap(
+ ShannonEntropy(&two_prefix_histo[3..], 3usize, &mut dummy);
entropy[3] = 0i32 as (super::util::floatX);
for i in 0usize..3usize {
let _rhs = ShannonEntropy(
entropy[3] += ShannonEntropy(
&bigram_histo[(3usize).wrapping_mul(i)..],
3usize,
&mut dummy,
);
let _lhs = &mut entropy[3];
*_lhs += _rhs;
}
let total: usize = monogram_histo[0]
.wrapping_add(monogram_histo[1])
.wrapping_add(monogram_histo[2]) as usize;
0i32;
entropy[0] = 1.0 as super::util::floatX / total as (super::util::floatX);
{
let _rhs = entropy[0];
let _lhs = &mut entropy[1];
*_lhs *= _rhs;
}
{
let _rhs = entropy[0];
let _lhs = &mut entropy[2];
*_lhs *= _rhs;
}
{
let _rhs = entropy[0];
let _lhs = &mut entropy[3];
*_lhs *= _rhs;
}
entropy[1] *= entropy[0];
entropy[2] *= entropy[0];
entropy[3] *= entropy[0];
if quality < 7i32 {
entropy[3] = entropy[1] * 10i32 as (super::util::floatX);
}
Expand Down
6 changes: 1 addition & 5 deletions src/enc/metablock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -722,11 +722,7 @@ fn ContextBlockSplitterFinishBlock<
);
combined_entropy[jx] =
BitsEntropy(combined_histo.slice()[jx].slice(), xself.alphabet_size_);
{
let _rhs = combined_entropy[jx] - entropy[i] - xself.last_entropy_[jx];
let _lhs = &mut diff[j];
*_lhs += _rhs;
}
diff[j] += combined_entropy[jx] - entropy[i] - xself.last_entropy_[jx];
}
j = j.wrapping_add(1);
}
Expand Down