diff --git a/2018/bellard/.gitignore b/2018/bellard/.gitignore index ea1749132..e4d82a2da 100644 --- a/2018/bellard/.gitignore +++ b/2018/bellard/.gitignore @@ -1 +1,3 @@ +lena.ppm prog +small.jpg diff --git a/2018/bellard/Lenna.png b/2018/bellard/Lenna.png new file mode 100644 index 000000000..59ef68aab Binary files /dev/null and b/2018/bellard/Lenna.png differ diff --git a/2018/bellard/Makefile b/2018/bellard/Makefile index 1c5ad14f5..185ef4e9d 100644 --- a/2018/bellard/Makefile +++ b/2018/bellard/Makefile @@ -62,8 +62,10 @@ X11_INCDIR= /opt/X11/include # Common C compiler warnings to silence # -CSILENCE= -#CSILENCE= -Wno-implicit-int +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-implicit-int \ + -Wno-logical-op-parentheses -Wno-main -Wno-parentheses -Wno-pedantic \ + -Wno-return-type -Wno-shift-op-parentheses # Common C compiler warning flags # @@ -138,7 +140,9 @@ CC= cc # ifeq ($(CC),clang) # -#CSILENCE+= +CSILENCE+= -Wno-conditional-uninitialized -Wno-missing-prototypes \ + -Wno-missing-variable-declarations -Wno-poison-system-directories \ + -Wno-strict-prototypes # CWARN+= -Weverything # @@ -163,7 +167,7 @@ ENTRY= endoh1 PROG= prog # OBJ= ${PROG}.o -DATA= +DATA= fruits.bin lena512.bin vintage_cars.bin Lenna.png TARGET= ${PROG} # ALT_OBJ= ${PROG}.alt.o @@ -215,6 +219,7 @@ clean: clobber: clean ${RM} -f ${TARGET} ${ALT_TARGET} + ${RM} -f lena.ppm small.jpg @-if [ -e sandwich ]; then \ ${RM} -f sandwich; \ echo 'ate sandwich'; \ diff --git a/2018/bellard/README.md b/2018/bellard/README.md index e334b4cf7..d221da54e 100644 --- a/2018/bellard/README.md +++ b/2018/bellard/README.md @@ -1,25 +1,31 @@ # Most inflationary -Fabrice Bellard - + Fabrice Bellard + -## To build: +# To build: - make all +```sh +make +``` -### To run +### To run: - ./prog > lena.ppm +```sh +./prog > lena.ppm +``` ### Try: - eog lena.ppm # On Linux - preview lena.ppm # On MacOS +```sh +eog lena.ppm # On Linux +preview lena.ppm # On MacOS - wget http://upload.wikimedia.org/wikipedia/en/2/24/Lenna.png - pngtopnm < Lenna.png | pnmscale 0.25 | cjpeg -arithmetic -dct float -quality 14 > small.jpg +pngtopnm < Lenna.png | pnmscale 0.25 | cjpeg -arithmetic -dct float -quality 14 > small.jpg +``` +# NOTE: Lenna.png is from https://upload.wikimedia.org/wikipedia/en/7/7d/Lenna_%28test_image%29.png -### Selected Judges Remarks: +## Judges' comments: The file `small.jpg` will be approximately of the same size as the raw image data in the program. Compare the level of the detail and the artifacts of @@ -60,9 +66,11 @@ Although the program was optimized to decompress its built-in image, it accepts to decompress image files from its standard input. Examples: - ./prog d < lena512.bin > lena512.ppm - ./prog d < fruits.bin > fruits.ppm - ./prog d < vintage_cars.bin > vintage_cars.ppm +```sh +./prog d < lena512.bin > lena512.ppm +./prog d < fruits.bin > fruits.ppm +./prog d < vintage_cars.bin > vintage_cars.ppm +``` The original images for [fruits][1] and [vintage cars][2] come from Wikipedia and were resized to a width of 1024 pixels. Warning: the @@ -73,16 +81,13 @@ The program should be portable on any Unix system. On Windows the line the main() function to avoid unwanted carriage return characters in the output. --------------------------------------------------------------------------------- - [1]: https://commons.wikimedia.org/wiki/File%3AFruits_oranges%2C_jardin_japonais_2.JPG [2]: https://commons.wikimedia.org/wiki/File%3ARed_Bull_Jungfrau_Stafette%2C_10th_stage_-_vintage_cars_%282%29.jpg --------------------------------------------------------------------------------- -