Skip to content

Commit

Permalink
Update value scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
emotion3459 committed Oct 14, 2024
1 parent 5c126c3 commit bd48930
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion vsdeband/funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def guided_deband(
if clip.format.sample_type is vs.FLOAT:
bin_thr = 1.5 / 255 if range_in.is_full else [1.5 / 219, 1.5 / 224]
else:
bin_thr = scale_value(0.005859375, 32, clip, range_out=range_in)
bin_thr = scale_value(0.005859375, 32, clip, range_in, range_out=range_in)

bin_thr = normalize_seq(bin_thr, clip.format.num_planes)

Expand Down
2 changes: 0 additions & 2 deletions vsdeband/noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ def _try_grain(src: vs.VideoNode, stre: tuple[float, float] = strength, **args:
low = [
scale_value(
threshold, 8, clip.format.bits_per_sample,
scale_offsets=(clip.format.sample_type is vs.FLOAT),
chroma=not not plane_index
)
for plane_index, threshold in enumerate(normalize_seq(fallback(low, 16)))
Expand All @@ -271,7 +270,6 @@ def _try_grain(src: vs.VideoNode, stre: tuple[float, float] = strength, **args:
high = [
scale_value(
threshold, 8, clip.format.bits_per_sample,
scale_offsets=(clip.format.sample_type is vs.FLOAT),
chroma=not not plane_index
)
for plane_index, threshold in enumerate(normalize_seq(fallback(high, [235, 240])))
Expand Down

0 comments on commit bd48930

Please sign in to comment.