Skip to content

Commit

Permalink
preparation for packaging on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyakurdyukov authored Apr 8, 2021
1 parent 8016af9 commit 048312e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ APPNAME ?= jpegqs
endif
$(APPNAME): Makefile $(SRCDEPS)
endif
SIMD ?= native
SIMD := native
# machine flags
MFLAGS ?=
MFLAGS :=
SIMDFLG :=
SIMDOBJ :=
ifeq ($(SIMD),select)
Expand All @@ -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
Expand Down Expand Up @@ -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 ?=
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 3 additions & 3 deletions libjpegqs.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Ilya Kurdyukov
* Copyright (C) 2020-2021 Ilya Kurdyukov
*
* JPEG Quant Smooth API definitions
*/
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion quantsmooth.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016-2020 Ilya Kurdyukov
* Copyright (C) 2016-2021 Ilya Kurdyukov
*
* This file is part of jpeg quantsmooth
*
Expand Down

0 comments on commit 048312e

Please sign in to comment.