Skip to content

Commit

Permalink
Fix minor type conversion and clippy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
barrbrain authored and kornelski committed Oct 23, 2023
1 parent 61c4860 commit eae0cb3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/asm/x86/quantize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ mod test {
let mut out = [0u16; 16];
let area: usize = av1_get_coded_tx_size(tx_size).area();
out[0] = 0;
out[1] = area;
out[1] = area as u16;
for eob in out.iter_mut().skip(2) {
*eob = rng.gen_range(0..area);
*eob = rng.gen_range(0..area as u16);
}
out
};
Expand All @@ -198,7 +198,9 @@ mod test {

// Generate quantized coefficients up to the eob
let between = Uniform::from(-i16::MAX..=i16::MAX);
for (i, qcoeff) in qcoeffs.data.iter_mut().enumerate().take(eob) {
for (i, qcoeff) in
qcoeffs.data.iter_mut().enumerate().take(eob as usize)
{
*qcoeff = between.sample(&mut rng)
/ if i == 0 { dc_quant } else { ac_quant };
}
Expand Down
2 changes: 1 addition & 1 deletion src/quantize/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ impl QuantizationContext {
.unwrap_or(0);
// We skip the DC coefficient since it has its own quantizer index.
if eob_minus_one > 0 {
eob_minus_one as u16 + 1
eob_minus_one + 1
} else {
u16::from(qcoeffs[0] != T::cast_from(0))
}
Expand Down
2 changes: 1 addition & 1 deletion src/rdo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1641,7 +1641,7 @@ pub fn rdo_cfl_alpha<T: Pixel>(
&mut rec_region,
uv_tx_size,
fi.sequence.bit_depth,
&ac,
ac,
IntraParam::Alpha(alpha),
None,
&edge_buf,
Expand Down

0 comments on commit eae0cb3

Please sign in to comment.