Skip to content

Commit

Permalink
Fix AVS+ parameter processing (bm_range: 8 -> 9)
Browse files Browse the repository at this point in the history
  • Loading branch information
WolframRhodium committed Oct 17, 2021
1 parent 29b5018 commit 97efb4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions cpu_source/source_avs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,10 @@ BM3DFilter::BM3DFilter(AVSValue args, IScriptEnvironment* env)
}
}

bm_range = array_loader(args[4], 8);
bm_range = array_loader(args[4], 9);
for (const auto & x : bm_range) {
if (x <= 0 || x > 8) {
env->ThrowError("BM3D_CPU: \"bm_range\" must be in range [1, 8]");
if (x <= 0) {
env->ThrowError("BM3D_CPU: \"bm_range\" must be positive");
}
}

Expand All @@ -424,8 +424,8 @@ BM3DFilter::BM3DFilter(AVSValue args, IScriptEnvironment* env)

ps_num = array_loader(args[6], 2);
for (const auto & x : ps_num) {
if (x <= 0 || x > 8) {
env->ThrowError("BM3D_CPU: \"ps_num\" must be in range [1, 8]");
if (x <= 0) {
env->ThrowError("BM3D_CPU: \"ps_num\" must be positive");
}
}

Expand Down
10 changes: 5 additions & 5 deletions source/source_avs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,10 @@ BM3DFilter::BM3DFilter(AVSValue args, IScriptEnvironment* env)
}
}

std::array bm_range = array_loader(args[4], 8);
std::array bm_range = array_loader(args[4], 9);
for (const auto & x : bm_range) {
if (x <= 0 || x > 8) {
env->ThrowError("BM3D_CUDA: \"bm_range\" must be in range [1, 8]");
if (x <= 0) {
env->ThrowError("BM3D_CUDA: \"bm_range\" must be positive");
}
}

Expand All @@ -455,8 +455,8 @@ BM3DFilter::BM3DFilter(AVSValue args, IScriptEnvironment* env)

std::array ps_num = array_loader(args[6], 2);
for (const auto & x : ps_num) {
if (x <= 0 || x > 8) {
env->ThrowError("BM3D_CUDA: \"ps_num\" must be in range [1, 8]");
if (x <= 0) {
env->ThrowError("BM3D_CUDA: \"ps_num\" must be positive");
}
}

Expand Down

0 comments on commit 97efb4a

Please sign in to comment.