Skip to content

Commit

Permalink
Update DenoiseFillGenerator.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
f0enix authored Nov 2, 2021
1 parent 33e2639 commit cc7f7c9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class DenoiseFillGenerator : public Halide::Generator<DenoiseFillGenerator> {
int EXPANDED_RANGE = 16384;
Expr p = (input(x, y, c) / numOfFrames) - blackLevel;
Expr s = EXPANDED_RANGE / cast<float> (whiteLevel-blackLevel);
output(x, y, c) = cast<uint16_t>(max(0.0f, min(p * s, cast<float> (EXPANDED_RANGE)) ) );
output(x, y, c) = cast<uint16_t>(max(0.0f, min(p * s + 0.5f, cast<float> (EXPANDED_RANGE)) ) );

input.set_estimates({{0, 2000}, {0, 1500}, {0, 4}});
output.set_estimates({{0, 2000}, {0, 1500}, {0, 4}});
Expand Down

0 comments on commit cc7f7c9

Please sign in to comment.