Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix artifacts on bicubic interpolation #18

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
*/
public final class InterpolationBicubic extends InterpolationTable {

private static final int PRECISION_BITS = 8;
private static final int PRECISION_BITS = 12;

private static float[] dataHelper(int subsampleBits) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
*/
public final class InterpolationBicubic2 extends InterpolationTable {

private static final int PRECISION_BITS = 8;
private static final int PRECISION_BITS = 12;

private static float[] dataHelper(int subsampleBits) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ private void byteLoop(RasterAccessor src,
float_fracx = fracx;
float_fracy = fracy;
frac_xx = float_fracx * (1.0F - float_fracx);
frac_yy = float_fracx * (1.0F - float_fracy);
frac_yy = float_fracy * (1.0F - float_fracy);

s0 = s00 + ((s10 - s00) * float_fracx);
s1 = s01 + ((s11 - s01) * float_fracx);
Expand Down Expand Up @@ -584,7 +584,7 @@ private void intLoop(RasterAccessor src,
float_fracx = fracx;
float_fracy = fracy;
frac_xx = float_fracx * (1.0F - float_fracx);
frac_yy = float_fracx * (1.0F - float_fracy);
frac_yy = float_fracy * (1.0F - float_fracy);

s0 = s00 + ((s10 - s00) * float_fracx);
s1 = s01 + ((s11 - s01) * float_fracx);
Expand Down Expand Up @@ -850,7 +850,7 @@ private void shortLoop(RasterAccessor src,
float_fracx = fracx;
float_fracy = fracy;
frac_xx = float_fracx * (1.0F - float_fracx);
frac_yy = float_fracx * (1.0F - float_fracy);
frac_yy = float_fracy * (1.0F - float_fracy);

s0 = s00 + ((s10 - s00) * float_fracx);
s1 = s01 + ((s11 - s01) * float_fracx);
Expand Down Expand Up @@ -1115,7 +1115,7 @@ private void ushortLoop(RasterAccessor src,
float_fracx = fracx;
float_fracy = fracy;
frac_xx = float_fracx * (1.0F - float_fracx);
frac_yy = float_fracx * (1.0F - float_fracy);
frac_yy = float_fracy * (1.0F - float_fracy);

s0 = s00 + ((s10 - s00) * float_fracx);
s1 = s01 + ((s11 - s01) * float_fracx);
Expand Down Expand Up @@ -1379,7 +1379,7 @@ private void floatLoop(RasterAccessor src,
float_fracx = fracx;
float_fracy = fracy;
frac_xx = float_fracx * (1.0F - float_fracx);
frac_yy = float_fracx * (1.0F - float_fracy);
frac_yy = float_fracy * (1.0F - float_fracy);

s0 = s00 + ((s10 - s00) * float_fracx);
s1 = s01 + ((s11 - s01) * float_fracx);
Expand Down Expand Up @@ -1630,7 +1630,7 @@ private void doubleLoop(RasterAccessor src,
float_fracx = fracx;
float_fracy = fracy;
frac_xx = float_fracx * (1.0F - float_fracx);
frac_yy = float_fracx * (1.0F - float_fracy);
frac_yy = float_fracy * (1.0F - float_fracy);

s0 = s00 + ((s10 - s00) * float_fracx);
s1 = s01 + ((s11 - s01) * float_fracx);
Expand Down