Skip to content

Commit

Permalink
fix wrong chroma processing.
Browse files Browse the repository at this point in the history
  • Loading branch information
chikuzen committed Jul 31, 2016
1 parent f8f14ed commit 4682283
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/DCTFilter.cpp
Expand Up @@ -25,7 +25,7 @@ PERFORMANCE OF THIS SOFTWARE.
#include <avs/win.h>
#include <avs/alignment.h>

#define DCT_FILTER_VERSION "0.0.0"
#define DCT_FILTER_VERSION "0.0.1"


typedef IScriptEnvironment ise_t;
Expand Down Expand Up @@ -75,6 +75,9 @@ DCTFilter::DCTFilter(PClip c, double* f, int ch, int opt)
if (numPlanes == 1 || chroma < 0 || chroma > 2) {
chroma = 2;
}
if (chroma != 1) {
numPlanes = 1;
}

if (chroma == 1) {
int w = vi.width >> vi.GetPlaneWidthSubsampling(PLANAR_U);
Expand Down Expand Up @@ -177,7 +180,7 @@ static AVSValue __cdecl create(AVSValue args, void*, ise_t* env)
}

try {
return new DCTFilter(args[0].AsClip(), f, args[9].AsInt(2), opt);
return new DCTFilter(args[0].AsClip(), f, args[9].AsInt(1), opt);
} catch (std::runtime_error& e) {
env->ThrowError("DCTFilter: %s", e.what());
}
Expand Down

0 comments on commit 4682283

Please sign in to comment.