fix: repair CI on the Sonar maintainability refactor

- h264: the coefficient scratch is i32, so the method path is <[i32]>::first_chunk_mut
- hevc: Px::w32 takes self, so keep the closure over the &P from slice::get
- tts: upsamples is a method, not an importable item
- vp8: drop the unused B_DC_PRED/DC_PRED imports; cargo fmt the import lists
- ui-egui: editing no longer needs to be mutable
- packaging: keep literal printf formats (shellcheck SC2059)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Dylan M. Taylor
2026-10-24 02:34:38 +00:00
co-authored by Claude Opus 5.5
parent d32c20ea97
commit d3cff00902
7 changed files with 16 additions and 20 deletions
+3 -3
View File
@@ -888,7 +888,7 @@ impl<'a> SliceDecoder<'a> {
let stride = self.pic.planes.width;
let px = self.mb_x * 16 + (raster & 3) * 4;
let py = self.mb_y * 16 + (raster >> 2) * 4;
let Some(blk) = self.s.coef.get_mut(raster * 16..).and_then(<[i16]>::first_chunk_mut::<16>) else {
let Some(blk) = self.s.coef.get_mut(raster * 16..).and_then(<[i32]>::first_chunk_mut::<16>) else {
return;
};
transform::idct4_add(blk, &mut self.pic.planes.y[py * stride + px..], stride);
@@ -902,7 +902,7 @@ impl<'a> SliceDecoder<'a> {
let stride = self.pic.planes.width;
let px = self.mb_x * 16 + (b8 & 1) * 8;
let py = self.mb_y * 16 + (b8 >> 1) * 8;
let Some(blk) = self.s.coef.get_mut(b8 * 64..).and_then(<[i16]>::first_chunk_mut::<64>) else {
let Some(blk) = self.s.coef.get_mut(b8 * 64..).and_then(<[i32]>::first_chunk_mut::<64>) else {
return;
};
transform::idct8_add(blk, &mut self.pic.planes.y[py * stride + px..], stride);
@@ -921,7 +921,7 @@ impl<'a> SliceDecoder<'a> {
}
let px = self.mb_x * 8 + (b & 1) * 4;
let py = self.mb_y * 8 + (b >> 1) * 4;
let Some(blk) = self.s.coef_c[c].get_mut(b * 16..).and_then(<[i16]>::first_chunk_mut::<16>) else {
let Some(blk) = self.s.coef_c[c].get_mut(b * 16..).and_then(<[i32]>::first_chunk_mut::<16>) else {
continue;
};
let plane = if c == 0 { &mut self.pic.planes.cb } else { &mut self.pic.planes.cr };
+1 -1
View File
@@ -122,7 +122,7 @@ fn filt<'a, P: Px + 'a, const T: usize>(tap: impl Fn(usize) -> Option<&'a [P]> +
64 => filt_w::<P, T, 64>(tap, f, shift, out),
_ => {
for (j, o) in out.iter_mut().take(w).enumerate() {
let s: i32 = (0..T).map(|k| f[k] as i32 * tap(k).and_then(|s| s.get(j)).map_or(0, P::w32)).sum();
let s: i32 = (0..T).map(|k| f[k] as i32 * tap(k).and_then(|s| s.get(j)).map_or(0, |p| p.w32())).sum();
*o = (s >> shift) as i16;
}
}
+1 -1
View File
@@ -17,7 +17,7 @@
use candle_core::{D, Device, Tensor};
use super::layers::{AdaLayerNorm, AdaResBlock, BiLstm, Conv, ConvT, LayerNorm, Linear, R, SnakeResBlock, leaky, upsamples};
use super::layers::{AdaLayerNorm, AdaResBlock, BiLstm, Conv, ConvT, LayerNorm, Linear, R, SnakeResBlock, leaky};
use super::weights::{Weights, err};
const HEADS: usize = 12;
+1 -1
View File
@@ -52,7 +52,7 @@ pub fn hot_number(ui: &mut Ui, id: egui::Id, value: f64, speed: f64, range: (f64
let editing_id = id.with("editing");
let edit_id = id.with("edit");
let select_all_id = id.with("select-all");
let mut editing: Option<String> = ui.data(|d| d.get_temp(editing_id));
let editing: Option<String> = ui.data(|d| d.get_temp(editing_id));
if let Some(mut buf) = editing {
return hot_number_edit(ui, editing_id, edit_id, select_all_id, &mut buf, value, range, suffix);
}
+5 -6
View File
@@ -10,14 +10,13 @@ use crate::header::{EntropyContext, FrameHeader, FrameTag, LfDeltas, Segmentatio
use crate::loopfilter::{self, Kind, Params};
use crate::predict::{self, RefPlane};
use crate::spec_tables::{
AC_QLOOKUP, BILINEAR_FILTERS, BMODE_PROBS, COEFF_BANDS, DC_QLOOKUP, KF_BMODE_PROBS, KF_UV_MODE_PROBS, KF_YMODE_PROBS, MODE_CONTEXTS,
MVPARTITION_PROBS, SIXTAP_FILTERS, SUB_MV_REF_PROBS,
AC_QLOOKUP, BILINEAR_FILTERS, BMODE_PROBS, COEFF_BANDS, DC_QLOOKUP, KF_BMODE_PROBS, KF_UV_MODE_PROBS, KF_YMODE_PROBS, MODE_CONTEXTS, MVPARTITION_PROBS,
SIXTAP_FILTERS, SUB_MV_REF_PROBS,
};
use crate::tables::{
ABOVE_4X4, B_DC_PRED, B_HE_PRED, BMODE_TREE, B_PRED, B_TM_PRED, B_VE_PRED, CAT_BASE, COEFF_TREE, DC_PRED, DCT_0, DCT_4, DCT_CAT1,
DCT_EOB, H_PRED, KF_YMODE_TREE, LEFT_4X4, MV_NEAR, MV_NEAREST, MV_NEW, MVP_BITS, MVP_IS_SHORT, MVPARTITION_TREE, MVP_SHORT, MVP_SIGN,
MV_REF_TREE, MV_SPLIT, MV_ZERO, PCAT, SEGMENT_TREE, SMALL_MV_TREE, SPLIT_COUNTS, SPLIT_MAPS, SUB_MV_REF_TREE, TM_PRED, UV_MODE_TREE,
V_PRED, YMODE_TREE, ZERO_4X4, ZIGZAG,
ABOVE_4X4, B_DC_PRED, B_HE_PRED, B_PRED, B_TM_PRED, B_VE_PRED, BMODE_TREE, CAT_BASE, COEFF_TREE, DC_PRED, DCT_0, DCT_4, DCT_CAT1, DCT_EOB, H_PRED,
KF_YMODE_TREE, LEFT_4X4, MV_NEAR, MV_NEAREST, MV_NEW, MV_REF_TREE, MV_SPLIT, MV_ZERO, MVP_BITS, MVP_IS_SHORT, MVP_SHORT, MVP_SIGN, MVPARTITION_TREE, PCAT,
SEGMENT_TREE, SMALL_MV_TREE, SPLIT_COUNTS, SPLIT_MAPS, SUB_MV_REF_TREE, TM_PRED, UV_MODE_TREE, V_PRED, YMODE_TREE, ZERO_4X4, ZIGZAG,
};
use crate::transform;
+1 -3
View File
@@ -6,9 +6,7 @@
//! row and 129 below it). Inter prediction reads a reference plane extended infinitely by
//! repeating its edge pixels.
use crate::tables::{
B_DC_PRED, B_HD_PRED, B_HE_PRED, B_HU_PRED, B_LD_PRED, B_RD_PRED, B_TM_PRED, B_VE_PRED, B_VL_PRED, B_VR_PRED, DC_PRED, H_PRED, TM_PRED, V_PRED,
};
use crate::tables::{B_HD_PRED, B_HE_PRED, B_HU_PRED, B_LD_PRED, B_RD_PRED, B_TM_PRED, B_VE_PRED, B_VL_PRED, B_VR_PRED, H_PRED, TM_PRED, V_PRED};
/// A pixel of the current frame for intra prediction, with the out-of-frame values of section 12.
#[inline]
+4 -5
View File
@@ -126,7 +126,6 @@ if has appimage; then
cp "$ROOT/assets/app-icon/hicolor/256x256/apps/$APP_ID.png" "$APPDIR/$APP_ID.png"
ln -s "$APP_ID.png" "$APPDIR/.DirIcon"
SHA_CHECK_FORMAT='%s %s\n'
if [[ -z "$RUNTIME_SHA256" ]]; then
echo "no pinned AppImage runtime for $ARCH" >&2
exit 2
@@ -136,10 +135,10 @@ if has appimage; then
download="$RUNTIME.download"
curl --proto '=https' -fsSL -o "$download" \
"https://github.com/AppImage/type2-runtime/releases/download/$RUNTIME_VERSION/runtime-$ARCH"
printf "$SHA_CHECK_FORMAT" "$RUNTIME_SHA256" "$download" | sha256sum -c -
printf '%s %s\n' "$RUNTIME_SHA256" "$download" | sha256sum -c -
mv "$download" "$RUNTIME"
fi
printf "$SHA_CHECK_FORMAT" "$RUNTIME_SHA256" "$RUNTIME" | sha256sum -c -
printf '%s %s\n' "$RUNTIME_SHA256" "$RUNTIME" | sha256sum -c -
TOOL="${APPIMAGETOOL:-$(command -v appimagetool || true)}"
if [[ -z "$TOOL" ]]; then
@@ -152,11 +151,11 @@ if has appimage; then
download="$TOOL.download"
curl --proto '=https' -fsSL -o "$download" \
"https://github.com/AppImage/appimagetool/releases/download/$APPIMAGETOOL_VERSION/appimagetool-$ARCH.AppImage"
printf "$SHA_CHECK_FORMAT" "$APPIMAGETOOL_SHA256" "$download" | sha256sum -c -
printf '%s %s\n' "$APPIMAGETOOL_SHA256" "$download" | sha256sum -c -
chmod 755 "$download"
mv "$download" "$TOOL"
fi
printf "$SHA_CHECK_FORMAT" "$APPIMAGETOOL_SHA256" "$TOOL" | sha256sum -c -
printf '%s %s\n' "$APPIMAGETOOL_SHA256" "$TOOL" | sha256sum -c -
fi
# Absolute, because appimagetool runs in $DIST below (CARGO_TARGET_DIR or APPIMAGETOOL may be
# relative, e.g. target/agent-<name>).