Skip to content

Commit

Permalink
⚡ Remove unnecessary calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiyamou committed Feb 29, 2020
1 parent 350977e commit 83eb7fb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions JincResize/JincResize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,14 @@ static void process(const VSFrameRef* src, VSFrameRef* dst, const FilterData* co
for (int plane = 0; plane < d->vi->format->numPlanes; plane++) {
const T* srcp = reinterpret_cast<const T*>(vsapi->getReadPtr(src, plane));
T* VS_RESTRICT dstp = reinterpret_cast<T*>(vsapi->getWritePtr(dst, plane));
int in_height = vsapi->getFrameHeight(src, 0);
int in_width = vsapi->getFrameWidth(src, 0);

int src_stride = vsapi->getStride(src, plane) / sizeof(T);
int dst_stride = vsapi->getStride(dst, plane) / sizeof(T);

int ih = vsapi->getFrameHeight(src, plane);
int iw = vsapi->getFrameWidth(src, plane);
int oh = d->h * ih / in_height;
int ow = d->w * iw / in_width;
int oh = vsapi->getFrameHeight(dst, plane);
int ow = vsapi->getFrameWidth(dst, plane);

double radius2 = pow(d->radius, 2);
for (int y = 0; y < oh; y++) {
Expand Down

0 comments on commit 83eb7fb

Please sign in to comment.