private static void decodePaethFilter(byte[] curr, byte[] prev, int count, int bpp) { int priorPixel, priorRowPixel; for (int i = 0; i < bpp; i++) { int raw = curr[i] & 0xff; int priorRow = prev[i] & 0xff; curr[i] = (byte)(raw + priorRow); } for (int i = bpp; i < count; i++) { int raw = curr[i] & 0xff; priorPixel = curr[i - bpp] & 0xff; int priorRow = prev[i] & 0xff; priorRowPixel = prev[i - bpp] & 0xff; curr[i] = (byte)(raw + paethPredictor(priorPixel, priorRow, priorRowPixel)); } }
private static void decodePaethFilter(byte[] curr, byte[] prev, int count, int bpp) { int priorPixel, priorRowPixel; for (int i = 0; i < bpp; i++) { int raw = curr[i] & 0xff; int priorRow = prev[i] & 0xff; curr[i] = (byte)(raw + priorRow); } for (int i = bpp; i < count; i++) { int raw = curr[i] & 0xff; priorPixel = curr[i - bpp] & 0xff; int priorRow = prev[i] & 0xff; priorRowPixel = prev[i - bpp] & 0xff; curr[i] = (byte)(raw + paethPredictor(priorPixel, priorRow, priorRowPixel)); } }
private static void decodePaethFilter(byte[] curr, byte[] prev, int count, int bpp) { int priorPixel, priorRowPixel; for (int i = 0; i < bpp; i++) { int raw = curr[i] & 0xff; int priorRow = prev[i] & 0xff; curr[i] = (byte)(raw + priorRow); } for (int i = bpp; i < count; i++) { int raw = curr[i] & 0xff; priorPixel = curr[i - bpp] & 0xff; int priorRow = prev[i] & 0xff; priorRowPixel = prev[i - bpp] & 0xff; curr[i] = (byte)(raw + paethPredictor(priorPixel, priorRow, priorRowPixel)); } }
private static void decodePaethFilter(byte[] curr, byte[] prev, int count, int bpp) { int priorPixel, priorRowPixel; for (int i = 0; i < bpp; i++) { int raw = curr[i] & 0xff; int priorRow = prev[i] & 0xff; curr[i] = (byte)(raw + priorRow); } for (int i = bpp; i < count; i++) { int raw = curr[i] & 0xff; priorPixel = curr[i - bpp] & 0xff; int priorRow = prev[i] & 0xff; priorRowPixel = prev[i - bpp] & 0xff; curr[i] = (byte)(raw + paethPredictor(priorPixel, priorRow, priorRowPixel)); } }