diff --git a/Makefile b/Makefile index e96bde5..e816f65 100644 --- a/Makefile +++ b/Makefile @@ -12,9 +12,9 @@ APPNAME ?= jpegqs endif $(APPNAME): Makefile $(SRCDEPS) endif -SIMD ?= native +SIMD := native # machine flags -MFLAGS ?= +MFLAGS := SIMDFLG := SIMDOBJ := ifeq ($(SIMD),select) @@ -33,10 +33,11 @@ endif # multithreading options MTOPTS := -fopenmp # path to save "libgomp.a" -LIBMINIOMP ?= -LFLAGS ?= -Wl,--gc-sections +LIBMINIOMP := +CFLAGS := -Wall -O2 +LDFLAGS := -Wl,--gc-sections -s -CFLAGS_LIB := -Wall -O2 $(MFLAGS) $(SIMDFLG) +CFLAGS_LIB := $(CFLAGS) $(MFLAGS) $(SIMDFLG) CFLAGS_APP := $(CFLAGS_LIB) -Wextra -pedantic $(MTOPTS) ifeq ($(SIMD),select) CFLAGS_APP += -DSIMD_SELECT @@ -122,7 +123,7 @@ $(APPNAME): $(LIBMINIOMP) endif $(APPNAME): $(SRCNAME) $(SIMDOBJ) - $(CC) $(CFLAGS_APP) -DAPPNAME=$(APPNAME) -s -o $@ $< $(JPEGLIB2) $(SIMDOBJ) $(LFLAGS) -lm + $(CC) $(CFLAGS_APP) -DAPPNAME=$(APPNAME) -o $@ $< $(JPEGLIB2) $(SIMDOBJ) $(LDFLAGS) -lm ifeq ($(SRCNAME),example.c) SIMDSEL_FLAGS ?= diff --git a/README.md b/README.md index bd86477..83a5ecf 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,14 @@ # JPEG Quant Smooth -This program tries to recreate lost precision of DCT coefficients based on quantization table from jpeg image. -Output saved as jpeg image with quantization set to 1 (like jpeg saved with 100% quality). You can save smoothed image with original quantization tables resulting in same DCT coefficients as in original image. +This program tries to recover the lost precision of DCT coefficients based on a quantization table from a JPEG image. The result is saved as a JPEG image with quantization set to 1 (like a JPEG saved at 100% quality). You may not notice jpeg artifacts on the screen without zooming in, but you may notice them after printing. Also, when editing compressed images, artifacts can accumulate, but if you use this program before editing - the result will be better. -The original project page is [here](https://github.com/ilyakurdyukov/jpeg-quantsmooth). +* The original project page is [here](https://github.com/ilyakurdyukov/jpeg-quantsmooth). + +* You can save a smoothed image with the original quantization tables, which will result in the same DCT coefficients as in the original image. (Note: chroma will be slightly different if upsampling is used at quality level 6) + +* Since this program uses quantization tables to recreate DCT coefficients, applying it to JPEG images that have been re-saved multiple times may not produce good results, as it can recover only from the last JPEG recoding, and not from the previous ones. ## WebAssembly diff --git a/libjpegqs.h b/libjpegqs.h index b6a0908..dbd6955 100644 --- a/libjpegqs.h +++ b/libjpegqs.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Ilya Kurdyukov + * Copyright (C) 2020-2021 Ilya Kurdyukov * * JPEG Quant Smooth API definitions */ @@ -35,8 +35,8 @@ enum { #define JPEGQS_ATTR #endif -#define JPEGQS_VERSION "2020-05-17" -#define JPEGQS_COPYRIGHT "Copyright (C) 2020 Ilya Kurdyukov" +#define JPEGQS_VERSION "1.20210408" +#define JPEGQS_COPYRIGHT "Copyright (C) 2020-2021 Ilya Kurdyukov" typedef struct { int flags, niter, threads, progprec; diff --git a/quantsmooth.h b/quantsmooth.h index c8de51e..6c2c337 100644 --- a/quantsmooth.h +++ b/quantsmooth.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016-2020 Ilya Kurdyukov + * Copyright (C) 2016-2021 Ilya Kurdyukov * * This file is part of jpeg quantsmooth *