Skip to content

Commit 520a0c5

Browse files
Fix 4 converter fallback defaults and add comprehensive test coverage
Fixes: - toDeband: y/cb/cr fallback 64→32 to match model defaults - toColorCorrection: coring fallback true→false to match model default - toNoiseReduction: qtgmcEzDenoise fallback 2.0→0.0, qtgmcEzKeepGrain fallback 0.2→0.0 to match model defaults New tests (98 total, up from 86): - QTGMC round-trip: all 70+ params verified (typed→dynamic→typed) - IVTC round-trip: all 9 params verified - QTGMC built-in noise reduction round-trip - Deblock default consistency vs schema - Converter fallback validation: 8 tests feed empty DynamicParameters into every toX() method and verify the fallback values match the Dart model constructor defaults — catches any future ?? value drift Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8dc34e3 commit 520a0c5

2 files changed

Lines changed: 397 additions & 6 deletions

File tree

app/lib/models/parameter_converter.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,8 @@ class ParameterConverter {
502502
mcTemporalSigma: (v['mcTemporalSigma'] as num?)?.toDouble() ?? 4.0,
503503
mcTemporalRadius: v['mcTemporalRadius'] as int? ?? 2,
504504
mcTemporalProfile: v['mcTemporalProfile'] as String? ?? 'medium',
505-
qtgmcEzDenoise: (v['qtgmcEzDenoise'] as num?)?.toDouble() ?? 2.0,
506-
qtgmcEzKeepGrain: (v['qtgmcEzKeepGrain'] as num?)?.toDouble() ?? 0.2,
505+
qtgmcEzDenoise: (v['qtgmcEzDenoise'] as num?)?.toDouble() ?? 0.0,
506+
qtgmcEzKeepGrain: (v['qtgmcEzKeepGrain'] as num?)?.toDouble() ?? 0.0,
507507
);
508508
}
509509

@@ -566,9 +566,9 @@ class ParameterConverter {
566566
return DebandParameters(
567567
enabled: params.enabled,
568568
range: v['range'] as int? ?? 15,
569-
y: v['y'] as int? ?? 64,
570-
cb: v['cb'] as int? ?? 64,
571-
cr: v['cr'] as int? ?? 64,
569+
y: v['y'] as int? ?? 32,
570+
cb: v['cb'] as int? ?? 32,
571+
cr: v['cr'] as int? ?? 32,
572572
grainY: v['grainY'] as int? ?? 24,
573573
grainC: v['grainC'] as int? ?? 24,
574574
dynamicGrain: v['dynamicGrain'] as bool? ?? true,
@@ -609,7 +609,7 @@ class ParameterConverter {
609609
contrast: (v['contrast'] as num?)?.toDouble() ?? 1.0,
610610
hue: (v['hue'] as num?)?.toDouble() ?? 0.0,
611611
saturation: (v['saturation'] as num?)?.toDouble() ?? 1.0,
612-
coring: v['coring'] as bool? ?? true,
612+
coring: v['coring'] as bool? ?? false,
613613
applyLevels: v['applyLevels'] as bool? ?? false,
614614
inputLow: v['inputLow'] as int? ?? 0,
615615
inputHigh: v['inputHigh'] as int? ?? 255,

0 commit comments

Comments
 (0)