├── .github └── workflows │ └── build.yml ├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md ├── Recommended_usb_content ├── Documents │ └── Hello World.txt ├── Images │ ├── Death Star.jpg │ ├── May The 4th.jpg │ ├── Millenium Falcon.jpg │ ├── esp_logo.jpg │ └── esp_text.jpg ├── Music │ ├── 16bit_mono_22_05khz.wav │ └── imperial_march.wav └── Readme.txt ├── components └── decoder_ijg │ ├── CMakeLists.txt │ ├── include │ └── jpegd2.h │ ├── jpeg-9a │ ├── Makefile.am │ ├── Makefile.in │ ├── README │ ├── aclocal.m4 │ ├── ar-lib │ ├── cderror.h │ ├── cdjpeg.c │ ├── cdjpeg.h │ ├── change.log │ ├── cjpeg.1 │ ├── cjpeg.c │ ├── ckconfig.c │ ├── coderules.txt │ ├── compile │ ├── config.guess │ ├── config.sub │ ├── configure │ ├── configure.ac │ ├── depcomp │ ├── djpeg.1 │ ├── djpeg.c │ ├── example.c │ ├── filelist.txt │ ├── install-sh │ ├── install.txt │ ├── jaricom.c │ ├── jcapimin.c │ ├── jcapistd.c │ ├── jcarith.c │ ├── jccoefct.c │ ├── jccolor.c │ ├── jcdctmgr.c │ ├── jchuff.c │ ├── jcinit.c │ ├── jcmainct.c │ ├── jcmarker.c │ ├── jcmaster.c │ ├── jcomapi.c │ ├── jconfig.bcc │ ├── jconfig.cfg │ ├── jconfig.dj │ ├── jconfig.h │ ├── jconfig.mac │ ├── jconfig.manx │ ├── jconfig.mc6 │ ├── jconfig.sas │ ├── jconfig.st │ ├── jconfig.txt │ ├── jconfig.vc │ ├── jconfig.vms │ ├── jconfig.wat │ ├── jcparam.c │ ├── jcprepct.c │ ├── jcsample.c │ ├── jctrans.c │ ├── jdapimin.c │ ├── jdapistd.c │ ├── jdarith.c │ ├── jdatadst.c │ ├── jdatasrc.c │ ├── jdcoefct.c │ ├── jdcolor.c │ ├── jdct.h │ ├── jddctmgr.c │ ├── jdhuff.c │ ├── jdinput.c │ ├── jdmainct.c │ ├── jdmarker.c │ ├── jdmaster.c │ ├── jdmerge.c │ ├── jdosabcc.obj │ ├── jdosamsc.obj │ ├── jdosaobj.txt │ ├── jdpostct.c │ ├── jdsample.c │ ├── jdtrans.c │ ├── jerror.c │ ├── jerror.h │ ├── jfdctflt.c │ ├── jfdctfst.c │ ├── jfdctint.c │ ├── jidctflt.c │ ├── jidctfst.c │ ├── jidctint.c │ ├── jinclude.h │ ├── jmemansi.c │ ├── jmemdos.c │ ├── jmemdosa.asm │ ├── jmemmac.c │ ├── jmemmgr.c │ ├── jmemname.c │ ├── jmemnobs.c │ ├── jmemsys.h │ ├── jmorecfg.h │ ├── jpegint.h │ ├── jpeglib.h │ ├── jpegtran.1 │ ├── jpegtran.c │ ├── jquant1.c │ ├── jquant2.c │ ├── jutils.c │ ├── jversion.h │ ├── libjpeg.map │ ├── libjpeg.txt │ ├── ltmain.sh │ ├── makcjpeg.st │ ├── makdjpeg.st │ ├── makeadsw.vc6 │ ├── makeasln.v10 │ ├── makecdep.vc6 │ ├── makecdsp.vc6 │ ├── makecfil.v10 │ ├── makecmak.vc6 │ ├── makecvcx.v10 │ ├── makeddep.vc6 │ ├── makeddsp.vc6 │ ├── makedfil.v10 │ ├── makedmak.vc6 │ ├── makedvcx.v10 │ ├── makefile.ansi │ ├── makefile.bcc │ ├── makefile.dj │ ├── makefile.manx │ ├── makefile.mc6 │ ├── makefile.mms │ ├── makefile.sas │ ├── makefile.unix │ ├── makefile.vc │ ├── makefile.vms │ ├── makefile.wat │ ├── makejdep.vc6 │ ├── makejdsp.vc6 │ ├── makejdsw.vc6 │ ├── makejfil.v10 │ ├── makejmak.vc6 │ ├── makejsln.v10 │ ├── makejvcx.v10 │ ├── makeproj.mac │ ├── makerdep.vc6 │ ├── makerdsp.vc6 │ ├── makerfil.v10 │ ├── makermak.vc6 │ ├── makervcx.v10 │ ├── maketdep.vc6 │ ├── maketdsp.vc6 │ ├── maketfil.v10 │ ├── maketmak.vc6 │ ├── maketvcx.v10 │ ├── makewdep.vc6 │ ├── makewdsp.vc6 │ ├── makewfil.v10 │ ├── makewmak.vc6 │ ├── makewvcx.v10 │ ├── makljpeg.st │ ├── maktjpeg.st │ ├── makvms.opt │ ├── missing │ ├── rdbmp.c │ ├── rdcolmap.c │ ├── rdgif.c │ ├── rdjpgcom.1 │ ├── rdjpgcom.c │ ├── rdppm.c │ ├── rdrle.c │ ├── rdswitch.c │ ├── rdtarga.c │ ├── readme.dos │ ├── structure.txt │ ├── testimg.bmp │ ├── testimg.jpg │ ├── testimg.ppm │ ├── testimgp.jpg │ ├── testorig.jpg │ ├── testprog.jpg │ ├── transupp.c │ ├── transupp.h │ ├── usage.txt │ ├── wizard.txt │ ├── wrbmp.c │ ├── wrgif.c │ ├── wrjpgcom.1 │ ├── wrjpgcom.c │ ├── wrppm.c │ ├── wrrle.c │ └── wrtarga.c │ ├── jpegd2.c │ └── readme.md ├── doc ├── hardware │ ├── PCB-EasyEDA │ │ ├── 1-PCB_PCB_ESP-BOX-USB.json │ │ └── 1-Schematic_ESP-BOX-USB.json │ └── schematic.png └── images │ ├── camera_tab.jpg │ ├── custom_pcb.jpg │ ├── custom_pcb_1.jpg │ ├── files_tab.jpg │ ├── image_window.jpg │ ├── media_player.jpg │ ├── settings_tab.jpg │ └── text_file.jpg ├── main ├── CMakeLists.txt ├── bsp_espbox_disp_camera_example.c └── idf_component.yml ├── partitions.csv ├── sdkconfig.defaults └── tools └── launchpad.toml /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build demo 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 9 | permissions: 10 | contents: read 11 | pages: write 12 | id-token: write 13 | 14 | # Allow one concurrent deployment 15 | concurrency: 16 | group: "pages" 17 | cancel-in-progress: true 18 | 19 | jobs: 20 | build: 21 | strategy: 22 | matrix: 23 | idf_ver: ["release-v5.0", "latest"] 24 | idf_target: ["esp32s3"] 25 | runs-on: ubuntu-20.04 26 | container: espressif/idf:${{ matrix.idf_ver }} 27 | steps: 28 | - uses: actions/checkout@v3 29 | with: 30 | submodules: 'recursive' 31 | - run: mkdir -p images 32 | - name: Build demo 33 | env: 34 | IDF_TARGET: ${{ matrix.idf_target }} 35 | shell: bash 36 | run: | 37 | cp tools/launchpad.toml images/launchpad.toml 38 | . ${IDF_PATH}/export.sh 39 | idf.py set-target ${{matrix.idf_target}} build 40 | cd build 41 | IDF_VERSION=`echo ${{ matrix.idf_ver }} | tr '-' '_' | tr '.' '_'` 42 | esptool.py --chip ${{matrix.idf_target}} merge_bin -o "$GITHUB_WORKSPACE/images/camera_example_${{matrix.idf_target}}_$IDF_VERSION.bin" @flash_args 43 | - name: Upload artifact 44 | uses: actions/upload-artifact@v3 45 | with: 46 | name: build-images 47 | path: images/ 48 | 49 | deploy: 50 | needs: build 51 | environment: 52 | name: github-pages 53 | url: ${{ steps.deployment.outputs.page_url }} 54 | runs-on: ubuntu-latest 55 | 56 | steps: 57 | - name: Download builds 58 | uses: actions/download-artifact@v3 59 | with: 60 | name: build-images 61 | path: images/ 62 | 63 | - name: Upload artifact 64 | uses: actions/upload-pages-artifact@v1 65 | with: 66 | path: images/ 67 | 68 | - name: Deploy to GitHub Pages 69 | id: deployment 70 | uses: actions/deploy-pages@v1 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | build/** 3 | managed_components/** 4 | dependencies.lock 5 | sdkconfig -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # For more information about build system see 2 | # https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html 3 | # The following five lines of boilerplate have to be in your project's 4 | # CMakeLists in this exact order for cmake to work correctly 5 | cmake_minimum_required(VERSION 3.5) 6 | 7 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 8 | project(bsp-espbox-display-camera-example) 9 | 10 | # Following parameters can't be set via Kconfig 11 | idf_component_get_property(lvgl_lib lvgl__lvgl COMPONENT_LIB) 12 | target_compile_options(${lvgl_lib} PRIVATE "-DLV_TICK_CUSTOM_SYS_TIME_EXPR=((int64_t)esp_timer_get_time() / 1000)") 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | | Supported Targets | ESP-BOX (ESP32-S3) | 2 | | ----------------- | ------------------ | 3 | 4 | # UVC Camera and MSC LVGL Example 5 | 6 | This example shows video from USB (UVC) camera into canvas in LVGL. There can be changed size of video and canvas in settings tab on the screen. The size can be changed only to lower size. 7 | 8 | On second tab, there is list of files and directories, when USB drive connected. When selected *.txt file, it shows content in a new window. When selected *.jpg image, it shows image in a new window. For files *.wav it shows media player. 9 | 10 | ## Screenshots 11 | 12 | | Camera tab | USB drive tab | Settings tab | 13 | | :----------: | :-----------: | :----------: | 14 | | ![Camera tab](/doc/images/camera_tab.jpg) | ![USB drive tab](/doc/images/files_tab.jpg) | ![USB drive tab](/doc/images/settings_tab.jpg) | 15 | 16 | | Image window | Media player window | Text file window | 17 | | :------------: | :-------------------: | :--------------: | 18 | | ![Camera tab](/doc/images/image_window.jpg) | ![USB drive tab](/doc/images/media_player.jpg) | ![USB drive tab](/doc/images/text_file.jpg) | 19 | 20 | ## How to use the example 21 | 22 | ### Hardware Required 23 | 24 | * ESP-BOX / ESP-BOX-3 25 | * USB (UVC) Camera 26 | * USB Drive 27 | * USB cable with bare wires on one side 28 | 29 | ### Camera connection 30 | 31 | | USB-A Female | ESP32-S3 | 32 | | :------------: | :--------: | 33 | | VCC 5V (red) | 5V | 34 | | D- (white) | GPIO 19 | 35 | | D+ (green) | GPIO 20 | 36 | | GND (black) | GND | 37 | 38 | ### USB/UART connection 39 | 40 | | USB/UART | ESP32-S3 | 41 | | :------------: | :--------: | 42 | | VCC 5V | 5V | 43 | | RXD | GPIO 44 | 44 | | TXD | GPIO 43 | 45 | | GND | GND | 46 | 47 | 48 | ### Compile and flash 49 | 50 | ``` 51 | idf.py -p COMX flash monitor 52 | ``` 53 | 54 | Note 1: Before flashing firmware, there should be manually switched into BOOT mode: Hold BOOT button on ESP-BOX and push restart button. 55 | 56 | Note 2: There cannot be used USB-C simultaneously with camera. The ESP-BOX must be powered from pins on the bottom side! 57 | 58 | ### Recommended USB connection with custom board 59 | 60 | ![Camera tab](doc/images/custom_pcb.jpg) ![USB drive tab](doc/images/custom_pcb_1.jpg) 61 | 62 | This is a custom board which was made for connecting USB devices to ESP-BOX. All source files are saved in [this folder](doc/hardware/). 63 | 64 | 65 | 66 | # Flash latest binary from browser 67 | 68 | 69 | Try it with ESP Launchpad 70 | -------------------------------------------------------------------------------- /Recommended_usb_content/Documents/Hello World.txt: -------------------------------------------------------------------------------- 1 | Hello world Espressif! -------------------------------------------------------------------------------- /Recommended_usb_content/Images/Death Star.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/Recommended_usb_content/Images/Death Star.jpg -------------------------------------------------------------------------------- /Recommended_usb_content/Images/May The 4th.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/Recommended_usb_content/Images/May The 4th.jpg -------------------------------------------------------------------------------- /Recommended_usb_content/Images/Millenium Falcon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/Recommended_usb_content/Images/Millenium Falcon.jpg -------------------------------------------------------------------------------- /Recommended_usb_content/Images/esp_logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/Recommended_usb_content/Images/esp_logo.jpg -------------------------------------------------------------------------------- /Recommended_usb_content/Images/esp_text.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/Recommended_usb_content/Images/esp_text.jpg -------------------------------------------------------------------------------- /Recommended_usb_content/Music/16bit_mono_22_05khz.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/Recommended_usb_content/Music/16bit_mono_22_05khz.wav -------------------------------------------------------------------------------- /Recommended_usb_content/Music/imperial_march.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/Recommended_usb_content/Music/imperial_march.wav -------------------------------------------------------------------------------- /Recommended_usb_content/Readme.txt: -------------------------------------------------------------------------------- 1 | This is an example of using USB devices (UVC camera and MSC Drive). This example shows video from camera on the first tab or list of files on the second tab. Each file can be opened in new window (supported only *.txt, *.jpg and *.wav files). -------------------------------------------------------------------------------- /components/decoder_ijg/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | list(APPEND srcs jpeg-9a/jaricom.c 2 | jpeg-9a/jcomapi.c 3 | jpeg-9a/jutils.c 4 | jpeg-9a/jerror.c 5 | jpeg-9a/jmemmgr.c 6 | jpeg-9a/jdapimin.c 7 | jpeg-9a/jdapistd.c 8 | jpeg-9a/jdarith.c 9 | jpeg-9a/jdmaster.c 10 | jpeg-9a/jdinput.c 11 | jpeg-9a/jdmarker.c 12 | jpeg-9a/jdhuff.c 13 | jpeg-9a/jdmainct.c 14 | jpeg-9a/jdcoefct.c 15 | jpeg-9a/jddctmgr.c 16 | jpeg-9a/jdpostct.c 17 | jpeg-9a/jdsample.c 18 | jpeg-9a/jdcolor.c 19 | jpeg-9a/jquant2.c 20 | jpeg-9a/jquant1.c 21 | jpeg-9a/jdmerge.c 22 | jpeg-9a/jmemnobs.c 23 | jpeg-9a/wrppm.c 24 | jpeg-9a/jidctint.c 25 | jpeg-9a/jidctflt.c 26 | jpeg-9a/jidctfst.c) 27 | 28 | list(APPEND iclds "jpeg-9a" "include") 29 | 30 | idf_component_register(SRCS "jpegd2.c" "${srcs}" 31 | INCLUDE_DIRS "${iclds}") 32 | -------------------------------------------------------------------------------- /components/decoder_ijg/include/jpegd2.h: -------------------------------------------------------------------------------- 1 | #ifndef __JPEGD2_H 2 | #define __JPEGD2_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "cdjpeg.h" 9 | // #include 10 | #include 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | typedef bool (*lcd_write_cb)(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint8_t *data); 17 | void mjpegdraw(uint8_t *mjpegbuffer, uint32_t size, uint8_t *outbuffer, lcd_write_cb lcd_cb); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | # 3 | # Automake Makefile for the JPEG library 4 | # 5 | # This file is written by Bob Friesenhahn, Guido Vollbeding 6 | # 7 | 8 | # Sources to build library 9 | LIBSOURCES = jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \ 10 | jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \ 11 | jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \ 12 | jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \ 13 | jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \ 14 | jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \ 15 | jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \ 16 | jquant2.c jutils.c jmemmgr.c @MEMORYMGR@.c 17 | 18 | # System dependent sources 19 | SYSDEPSOURCES = jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c 20 | 21 | # Headers which are installed to support the library 22 | INSTINCLUDES = jerror.h jmorecfg.h jpeglib.h 23 | 24 | # Headers which are not installed 25 | OTHERINCLUDES = cderror.h cdjpeg.h jdct.h jinclude.h jmemsys.h jpegint.h \ 26 | jversion.h transupp.h 27 | 28 | # Manual pages (Automake uses 'MANS' for itself) 29 | DISTMANS= cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1 30 | 31 | # Other documentation files 32 | DOCS= README install.txt usage.txt wizard.txt example.c libjpeg.txt \ 33 | structure.txt coderules.txt filelist.txt change.log 34 | 35 | # Makefiles for various systems 36 | MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ 37 | makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ 38 | makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ 39 | makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ 40 | maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ 41 | makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ 42 | makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ 43 | makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ 44 | makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ 45 | makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ 46 | makefile.mms makefile.vms makvms.opt 47 | 48 | # Configuration files 49 | CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ 50 | jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ 51 | jconfig.vms 52 | 53 | # Support scripts for configure 54 | CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ 55 | missing ar-lib 56 | 57 | # Miscellaneous support files 58 | OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map 59 | 60 | # Test support files 61 | TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ 62 | testimgp.jpg 63 | 64 | # libtool libraries to build 65 | lib_LTLIBRARIES = libjpeg.la 66 | 67 | # Library sources for libjpeg.la 68 | libjpeg_la_SOURCES = $(LIBSOURCES) 69 | 70 | # LDFLAGS for libjpeg.la 71 | libjpeg_la_LDFLAGS = -no-undefined \ 72 | -version-info $(JPEG_LIB_VERSION) 73 | 74 | if HAVE_LD_VERSION_SCRIPT 75 | libjpeg_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libjpeg.map 76 | endif 77 | 78 | # Executables to build 79 | bin_PROGRAMS = cjpeg djpeg jpegtran rdjpgcom wrjpgcom 80 | 81 | # Executable sources & libs 82 | cjpeg_SOURCES = cjpeg.c rdppm.c rdgif.c rdtarga.c rdrle.c rdbmp.c \ 83 | rdswitch.c cdjpeg.c 84 | cjpeg_LDADD = libjpeg.la 85 | djpeg_SOURCES = djpeg.c wrppm.c wrgif.c wrtarga.c wrrle.c wrbmp.c \ 86 | rdcolmap.c cdjpeg.c 87 | djpeg_LDADD = libjpeg.la 88 | jpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c 89 | jpegtran_LDADD = libjpeg.la 90 | rdjpgcom_SOURCES = rdjpgcom.c 91 | wrjpgcom_SOURCES = wrjpgcom.c 92 | 93 | # Manual pages to install 94 | man_MANS = $(DISTMANS) 95 | 96 | # Headers to install 97 | include_HEADERS = $(INSTINCLUDES) 98 | 99 | # Other distributed headers 100 | noinst_HEADERS = $(OTHERINCLUDES) 101 | 102 | # Other distributed files 103 | EXTRA_DIST = $(DOCS) $(DISTMANS) $(MKFILES) $(CONFIGFILES) $(SYSDEPSOURCES) \ 104 | $(OTHERFILES) $(TESTFILES) 105 | 106 | # Files to be cleaned 107 | CLEANFILES = testout.ppm testout.bmp testout.jpg testoutp.ppm testoutp.jpg \ 108 | testoutt.jpg 109 | 110 | # Install jconfig.h 111 | install-data-local: 112 | $(mkinstalldirs) $(DESTDIR)$(includedir) 113 | $(INSTALL_HEADER) jconfig.h $(DESTDIR)$(includedir)/jconfig.h 114 | 115 | # Uninstall jconfig.h 116 | uninstall-local: 117 | rm -f $(DESTDIR)$(includedir)/jconfig.h 118 | 119 | # Run tests 120 | test: check-local 121 | check-local: 122 | rm -f testout* 123 | ./djpeg -dct int -ppm -outfile testout.ppm $(srcdir)/testorig.jpg 124 | ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testorig.jpg 125 | ./cjpeg -dct int -outfile testout.jpg $(srcdir)/testimg.ppm 126 | ./djpeg -dct int -ppm -outfile testoutp.ppm $(srcdir)/testprog.jpg 127 | ./cjpeg -dct int -progressive -opt -outfile testoutp.jpg $(srcdir)/testimg.ppm 128 | ./jpegtran -outfile testoutt.jpg $(srcdir)/testprog.jpg 129 | cmp $(srcdir)/testimg.ppm testout.ppm 130 | cmp $(srcdir)/testimg.bmp testout.bmp 131 | cmp $(srcdir)/testimg.jpg testout.jpg 132 | cmp $(srcdir)/testimg.ppm testoutp.ppm 133 | cmp $(srcdir)/testimgp.jpg testoutp.jpg 134 | cmp $(srcdir)/testorig.jpg testoutt.jpg 135 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/ar-lib: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Wrapper for Microsoft lib.exe 3 | 4 | me=ar-lib 5 | scriptversion=2012-03-01.08; # UTC 6 | 7 | # Copyright (C) 2010-2013 Free Software Foundation, Inc. 8 | # Written by Peter Rosin . 9 | # 10 | # This program is free software; you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation; either version 2, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | # 20 | # You should have received a copy of the GNU General Public License 21 | # along with this program. If not, see . 22 | 23 | # As a special exception to the GNU General Public License, if you 24 | # distribute this file as part of a program that contains a 25 | # configuration script generated by Autoconf, you may include it under 26 | # the same distribution terms that you use for the rest of that program. 27 | 28 | # This file is maintained in Automake, please report 29 | # bugs to or send patches to 30 | # . 31 | 32 | 33 | # func_error message 34 | func_error () 35 | { 36 | echo "$me: $1" 1>&2 37 | exit 1 38 | } 39 | 40 | file_conv= 41 | 42 | # func_file_conv build_file 43 | # Convert a $build file to $host form and store it in $file 44 | # Currently only supports Windows hosts. 45 | func_file_conv () 46 | { 47 | file=$1 48 | case $file in 49 | / | /[!/]*) # absolute file, and not a UNC file 50 | if test -z "$file_conv"; then 51 | # lazily determine how to convert abs files 52 | case `uname -s` in 53 | MINGW*) 54 | file_conv=mingw 55 | ;; 56 | CYGWIN*) 57 | file_conv=cygwin 58 | ;; 59 | *) 60 | file_conv=wine 61 | ;; 62 | esac 63 | fi 64 | case $file_conv in 65 | mingw) 66 | file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` 67 | ;; 68 | cygwin) 69 | file=`cygpath -m "$file" || echo "$file"` 70 | ;; 71 | wine) 72 | file=`winepath -w "$file" || echo "$file"` 73 | ;; 74 | esac 75 | ;; 76 | esac 77 | } 78 | 79 | # func_at_file at_file operation archive 80 | # Iterate over all members in AT_FILE performing OPERATION on ARCHIVE 81 | # for each of them. 82 | # When interpreting the content of the @FILE, do NOT use func_file_conv, 83 | # since the user would need to supply preconverted file names to 84 | # binutils ar, at least for MinGW. 85 | func_at_file () 86 | { 87 | operation=$2 88 | archive=$3 89 | at_file_contents=`cat "$1"` 90 | eval set x "$at_file_contents" 91 | shift 92 | 93 | for member 94 | do 95 | $AR -NOLOGO $operation:"$member" "$archive" || exit $? 96 | done 97 | } 98 | 99 | case $1 in 100 | '') 101 | func_error "no command. Try '$0 --help' for more information." 102 | ;; 103 | -h | --h*) 104 | cat < /* to declare isupper(), tolower() */ 14 | #ifdef NEED_SIGNAL_CATCHER 15 | #include /* to declare signal() */ 16 | #endif 17 | #ifdef USE_SETMODE 18 | #include /* to declare setmode()'s parameter macros */ 19 | /* If you have setmode() but not , just delete this line: */ 20 | #include /* to declare setmode() */ 21 | #endif 22 | 23 | 24 | /* 25 | * Signal catcher to ensure that temporary files are removed before aborting. 26 | * NB: for Amiga Manx C this is actually a global routine named _abort(); 27 | * we put "#define signal_catcher _abort" in jconfig.h. Talk about bogus... 28 | */ 29 | 30 | #ifdef NEED_SIGNAL_CATCHER 31 | 32 | static j_common_ptr sig_cinfo; 33 | 34 | void /* must be global for Manx C */ 35 | signal_catcher (int signum) 36 | { 37 | if (sig_cinfo != NULL) { 38 | if (sig_cinfo->err != NULL) /* turn off trace output */ 39 | sig_cinfo->err->trace_level = 0; 40 | jpeg_destroy(sig_cinfo); /* clean up memory allocation & temp files */ 41 | } 42 | exit(EXIT_FAILURE); 43 | } 44 | 45 | 46 | GLOBAL(void) 47 | enable_signal_catcher (j_common_ptr cinfo) 48 | { 49 | sig_cinfo = cinfo; 50 | #ifdef SIGINT /* not all systems have SIGINT */ 51 | signal(SIGINT, signal_catcher); 52 | #endif 53 | #ifdef SIGTERM /* not all systems have SIGTERM */ 54 | signal(SIGTERM, signal_catcher); 55 | #endif 56 | } 57 | 58 | #endif 59 | 60 | 61 | /* 62 | * Optional progress monitor: display a percent-done figure on stderr. 63 | */ 64 | 65 | #ifdef PROGRESS_REPORT 66 | 67 | METHODDEF(void) 68 | progress_monitor (j_common_ptr cinfo) 69 | { 70 | cd_progress_ptr prog = (cd_progress_ptr) cinfo->progress; 71 | int total_passes = prog->pub.total_passes + prog->total_extra_passes; 72 | int percent_done = (int) (prog->pub.pass_counter*100L/prog->pub.pass_limit); 73 | 74 | if (percent_done != prog->percent_done) { 75 | prog->percent_done = percent_done; 76 | if (total_passes > 1) { 77 | fprintf(stderr, "\rPass %d/%d: %3d%% ", 78 | prog->pub.completed_passes + prog->completed_extra_passes + 1, 79 | total_passes, percent_done); 80 | } else { 81 | fprintf(stderr, "\r %3d%% ", percent_done); 82 | } 83 | fflush(stderr); 84 | } 85 | } 86 | 87 | 88 | GLOBAL(void) 89 | start_progress_monitor (j_common_ptr cinfo, cd_progress_ptr progress) 90 | { 91 | /* Enable progress display, unless trace output is on */ 92 | if (cinfo->err->trace_level == 0) { 93 | progress->pub.progress_monitor = progress_monitor; 94 | progress->completed_extra_passes = 0; 95 | progress->total_extra_passes = 0; 96 | progress->percent_done = -1; 97 | cinfo->progress = &progress->pub; 98 | } 99 | } 100 | 101 | 102 | GLOBAL(void) 103 | end_progress_monitor (j_common_ptr cinfo) 104 | { 105 | /* Clear away progress display */ 106 | if (cinfo->err->trace_level == 0) { 107 | fprintf(stderr, "\r \r"); 108 | fflush(stderr); 109 | } 110 | } 111 | 112 | #endif 113 | 114 | 115 | /* 116 | * Case-insensitive matching of possibly-abbreviated keyword switches. 117 | * keyword is the constant keyword (must be lower case already), 118 | * minchars is length of minimum legal abbreviation. 119 | */ 120 | 121 | GLOBAL(boolean) 122 | keymatch (char * arg, const char * keyword, int minchars) 123 | { 124 | register int ca, ck; 125 | register int nmatched = 0; 126 | 127 | while ((ca = *arg++) != '\0') { 128 | if ((ck = *keyword++) == '\0') 129 | return FALSE; /* arg longer than keyword, no good */ 130 | if (isupper(ca)) /* force arg to lcase (assume ck is already) */ 131 | ca = tolower(ca); 132 | if (ca != ck) 133 | return FALSE; /* no good */ 134 | nmatched++; /* count matched characters */ 135 | } 136 | /* reached end of argument; fail if it's too short for unique abbrev */ 137 | if (nmatched < minchars) 138 | return FALSE; 139 | return TRUE; /* A-OK */ 140 | } 141 | 142 | 143 | /* 144 | * Routines to establish binary I/O mode for stdin and stdout. 145 | * Non-Unix systems often require some hacking to get out of text mode. 146 | */ 147 | 148 | GLOBAL(FILE *) 149 | read_stdin (void) 150 | { 151 | FILE * input_file = stdin; 152 | 153 | #ifdef USE_SETMODE /* need to hack file mode? */ 154 | setmode(fileno(stdin), O_BINARY); 155 | #endif 156 | #ifdef USE_FDOPEN /* need to re-open in binary mode? */ 157 | if ((input_file = fdopen(fileno(stdin), READ_BINARY)) == NULL) { 158 | fprintf(stderr, "Cannot reopen stdin\n"); 159 | exit(EXIT_FAILURE); 160 | } 161 | #endif 162 | return input_file; 163 | } 164 | 165 | 166 | GLOBAL(FILE *) 167 | write_stdout (void) 168 | { 169 | FILE * output_file = stdout; 170 | 171 | #ifdef USE_SETMODE /* need to hack file mode? */ 172 | setmode(fileno(stdout), O_BINARY); 173 | #endif 174 | #ifdef USE_FDOPEN /* need to re-open in binary mode? */ 175 | if ((output_file = fdopen(fileno(stdout), WRITE_BINARY)) == NULL) { 176 | fprintf(stderr, "Cannot reopen stdout\n"); 177 | exit(EXIT_FAILURE); 178 | } 179 | #endif 180 | return output_file; 181 | } 182 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/cdjpeg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cdjpeg.h 3 | * 4 | * Copyright (C) 1994-1997, Thomas G. Lane. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file contains common declarations for the sample applications 9 | * cjpeg and djpeg. It is NOT used by the core JPEG library. 10 | */ 11 | 12 | #define JPEG_CJPEG_DJPEG /* define proper options in jconfig.h */ 13 | #define JPEG_INTERNAL_OPTIONS /* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */ 14 | #include "jinclude.h" 15 | #include "jpeglib.h" 16 | #include "jerror.h" /* get library error codes too */ 17 | #include "cderror.h" /* get application-specific error codes */ 18 | 19 | 20 | /* 21 | * Object interface for cjpeg's source file decoding modules 22 | */ 23 | 24 | typedef struct cjpeg_source_struct * cjpeg_source_ptr; 25 | 26 | struct cjpeg_source_struct { 27 | JMETHOD(void, start_input, (j_compress_ptr cinfo, 28 | cjpeg_source_ptr sinfo)); 29 | JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo, 30 | cjpeg_source_ptr sinfo)); 31 | JMETHOD(void, finish_input, (j_compress_ptr cinfo, 32 | cjpeg_source_ptr sinfo)); 33 | 34 | FILE *input_file; 35 | 36 | JSAMPARRAY buffer; 37 | JDIMENSION buffer_height; 38 | }; 39 | 40 | 41 | /* 42 | * Object interface for djpeg's output file encoding modules 43 | */ 44 | 45 | typedef struct djpeg_dest_struct * djpeg_dest_ptr; 46 | 47 | struct djpeg_dest_struct { 48 | /* start_output is called after jpeg_start_decompress finishes. 49 | * The color map will be ready at this time, if one is needed. 50 | */ 51 | JMETHOD(void, start_output, (j_decompress_ptr cinfo, 52 | djpeg_dest_ptr dinfo)); 53 | /* Emit the specified number of pixel rows from the buffer. */ 54 | JMETHOD(void, put_pixel_rows, (j_decompress_ptr cinfo, 55 | djpeg_dest_ptr dinfo, 56 | JDIMENSION rows_supplied)); 57 | /* Finish up at the end of the image. */ 58 | JMETHOD(void, finish_output, (j_decompress_ptr cinfo, 59 | djpeg_dest_ptr dinfo)); 60 | 61 | /* Target file spec; filled in by djpeg.c after object is created. */ 62 | FILE * output_file; 63 | 64 | /* Output pixel-row buffer. Created by module init or start_output. 65 | * Width is cinfo->output_width * cinfo->output_components; 66 | * height is buffer_height. 67 | */ 68 | JSAMPARRAY buffer; 69 | JDIMENSION buffer_height; 70 | }; 71 | 72 | 73 | /* 74 | * cjpeg/djpeg may need to perform extra passes to convert to or from 75 | * the source/destination file format. The JPEG library does not know 76 | * about these passes, but we'd like them to be counted by the progress 77 | * monitor. We use an expanded progress monitor object to hold the 78 | * additional pass count. 79 | */ 80 | 81 | struct cdjpeg_progress_mgr { 82 | struct jpeg_progress_mgr pub; /* fields known to JPEG library */ 83 | int completed_extra_passes; /* extra passes completed */ 84 | int total_extra_passes; /* total extra */ 85 | /* last printed percentage stored here to avoid multiple printouts */ 86 | int percent_done; 87 | }; 88 | 89 | typedef struct cdjpeg_progress_mgr * cd_progress_ptr; 90 | 91 | 92 | /* Short forms of external names for systems with brain-damaged linkers. */ 93 | 94 | #ifdef NEED_SHORT_EXTERNAL_NAMES 95 | #define jinit_read_bmp jIRdBMP 96 | #define jinit_write_bmp jIWrBMP 97 | #define jinit_read_gif jIRdGIF 98 | #define jinit_write_gif jIWrGIF 99 | #define jinit_read_ppm jIRdPPM 100 | #define jinit_write_ppm jIWrPPM 101 | #define jinit_read_rle jIRdRLE 102 | #define jinit_write_rle jIWrRLE 103 | #define jinit_read_targa jIRdTarga 104 | #define jinit_write_targa jIWrTarga 105 | #define read_quant_tables RdQTables 106 | #define read_scan_script RdScnScript 107 | #define set_quality_ratings SetQRates 108 | #define set_quant_slots SetQSlots 109 | #define set_sample_factors SetSFacts 110 | #define read_color_map RdCMap 111 | #define enable_signal_catcher EnSigCatcher 112 | #define start_progress_monitor StProgMon 113 | #define end_progress_monitor EnProgMon 114 | #define read_stdin RdStdin 115 | #define write_stdout WrStdout 116 | #endif /* NEED_SHORT_EXTERNAL_NAMES */ 117 | 118 | /* Module selection routines for I/O modules. */ 119 | 120 | EXTERN(cjpeg_source_ptr) jinit_read_bmp JPP((j_compress_ptr cinfo)); 121 | EXTERN(djpeg_dest_ptr) jinit_write_bmp JPP((j_decompress_ptr cinfo, 122 | boolean is_os2)); 123 | EXTERN(cjpeg_source_ptr) jinit_read_gif JPP((j_compress_ptr cinfo)); 124 | EXTERN(djpeg_dest_ptr) jinit_write_gif JPP((j_decompress_ptr cinfo)); 125 | EXTERN(cjpeg_source_ptr) jinit_read_ppm JPP((j_compress_ptr cinfo)); 126 | EXTERN(djpeg_dest_ptr) jinit_write_ppm JPP((j_decompress_ptr cinfo)); 127 | EXTERN(cjpeg_source_ptr) jinit_read_rle JPP((j_compress_ptr cinfo)); 128 | EXTERN(djpeg_dest_ptr) jinit_write_rle JPP((j_decompress_ptr cinfo)); 129 | EXTERN(cjpeg_source_ptr) jinit_read_targa JPP((j_compress_ptr cinfo)); 130 | EXTERN(djpeg_dest_ptr) jinit_write_targa JPP((j_decompress_ptr cinfo)); 131 | 132 | /* cjpeg support routines (in rdswitch.c) */ 133 | 134 | EXTERN(boolean) read_quant_tables JPP((j_compress_ptr cinfo, char * filename, 135 | boolean force_baseline)); 136 | EXTERN(boolean) read_scan_script JPP((j_compress_ptr cinfo, char * filename)); 137 | EXTERN(boolean) set_quality_ratings JPP((j_compress_ptr cinfo, char *arg, 138 | boolean force_baseline)); 139 | EXTERN(boolean) set_quant_slots JPP((j_compress_ptr cinfo, char *arg)); 140 | EXTERN(boolean) set_sample_factors JPP((j_compress_ptr cinfo, char *arg)); 141 | 142 | /* djpeg support routines (in rdcolmap.c) */ 143 | 144 | EXTERN(void) read_color_map JPP((j_decompress_ptr cinfo, FILE * infile)); 145 | 146 | /* common support routines (in cdjpeg.c) */ 147 | 148 | EXTERN(void) enable_signal_catcher JPP((j_common_ptr cinfo)); 149 | EXTERN(void) start_progress_monitor JPP((j_common_ptr cinfo, 150 | cd_progress_ptr progress)); 151 | EXTERN(void) end_progress_monitor JPP((j_common_ptr cinfo)); 152 | EXTERN(boolean) keymatch JPP((char * arg, const char * keyword, int minchars)); 153 | EXTERN(FILE *) read_stdin JPP((void)); 154 | EXTERN(FILE *) write_stdout JPP((void)); 155 | 156 | /* miscellaneous useful macros */ 157 | 158 | #ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */ 159 | #define READ_BINARY "r" 160 | #define WRITE_BINARY "w" 161 | #else 162 | #ifdef VMS /* VMS is very nonstandard */ 163 | #define READ_BINARY "rb", "ctx=stm" 164 | #define WRITE_BINARY "wb", "ctx=stm" 165 | #else /* standard ANSI-compliant case */ 166 | #define READ_BINARY "rb" 167 | #define WRITE_BINARY "wb" 168 | #endif 169 | #endif 170 | 171 | #ifndef EXIT_FAILURE /* define exit() codes if not provided */ 172 | #define EXIT_FAILURE 1 173 | #endif 174 | #ifndef EXIT_SUCCESS 175 | #ifdef VMS 176 | #define EXIT_SUCCESS 1 /* VMS is very nonstandard */ 177 | #else 178 | #define EXIT_SUCCESS 0 179 | #endif 180 | #endif 181 | #ifndef EXIT_WARNING 182 | #ifdef VMS 183 | #define EXIT_WARNING 1 /* VMS is very nonstandard */ 184 | #else 185 | #define EXIT_WARNING 2 186 | #endif 187 | #endif 188 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/coderules.txt: -------------------------------------------------------------------------------- 1 | IJG JPEG LIBRARY: CODING RULES 2 | 3 | Copyright (C) 1991-1996, Thomas G. Lane. 4 | This file is part of the Independent JPEG Group's software. 5 | For conditions of distribution and use, see the accompanying README file. 6 | 7 | 8 | Since numerous people will be contributing code and bug fixes, it's important 9 | to establish a common coding style. The goal of using similar coding styles 10 | is much more important than the details of just what that style is. 11 | 12 | In general we follow the recommendations of "Recommended C Style and Coding 13 | Standards" revision 6.1 (Cannon et al. as modified by Spencer, Keppel and 14 | Brader). This document is available in the IJG FTP archive (see 15 | jpeg/doc/cstyle.ms.tbl.Z, or cstyle.txt.Z for those without nroff/tbl). 16 | 17 | Block comments should be laid out thusly: 18 | 19 | /* 20 | * Block comments in this style. 21 | */ 22 | 23 | We indent statements in K&R style, e.g., 24 | if (test) { 25 | then-part; 26 | } else { 27 | else-part; 28 | } 29 | with two spaces per indentation level. (This indentation convention is 30 | handled automatically by GNU Emacs and many other text editors.) 31 | 32 | Multi-word names should be written in lower case with underscores, e.g., 33 | multi_word_name (not multiWordName). Preprocessor symbols and enum constants 34 | are similar but upper case (MULTI_WORD_NAME). Names should be unique within 35 | the first fifteen characters. (On some older systems, global names must be 36 | unique within six characters. We accommodate this without cluttering the 37 | source code by using macros to substitute shorter names.) 38 | 39 | We use function prototypes everywhere; we rely on automatic source code 40 | transformation to feed prototype-less C compilers. Transformation is done 41 | by the simple and portable tool 'ansi2knr.c' (courtesy of Ghostscript). 42 | ansi2knr is not very bright, so it imposes a format requirement on function 43 | declarations: the function name MUST BEGIN IN COLUMN 1. Thus all functions 44 | should be written in the following style: 45 | 46 | LOCAL(int *) 47 | function_name (int a, char *b) 48 | { 49 | code... 50 | } 51 | 52 | Note that each function definition must begin with GLOBAL(type), LOCAL(type), 53 | or METHODDEF(type). These macros expand to "static type" or just "type" as 54 | appropriate. They provide a readable indication of the routine's usage and 55 | can readily be changed for special needs. (For instance, special linkage 56 | keywords can be inserted for use in Windows DLLs.) 57 | 58 | ansi2knr does not transform method declarations (function pointers in 59 | structs). We handle these with a macro JMETHOD, defined as 60 | #ifdef HAVE_PROTOTYPES 61 | #define JMETHOD(type,methodname,arglist) type (*methodname) arglist 62 | #else 63 | #define JMETHOD(type,methodname,arglist) type (*methodname) () 64 | #endif 65 | which is used like this: 66 | struct function_pointers { 67 | JMETHOD(void, init_entropy_encoder, (int somearg, jparms *jp)); 68 | JMETHOD(void, term_entropy_encoder, (void)); 69 | }; 70 | Note the set of parentheses surrounding the parameter list. 71 | 72 | A similar solution is used for forward and external function declarations 73 | (see the EXTERN and JPP macros). 74 | 75 | If the code is to work on non-ANSI compilers, we cannot rely on a prototype 76 | declaration to coerce actual parameters into the right types. Therefore, use 77 | explicit casts on actual parameters whenever the actual parameter type is not 78 | identical to the formal parameter. Beware of implicit conversions to "int". 79 | 80 | It seems there are some non-ANSI compilers in which the sizeof() operator 81 | is defined to return int, yet size_t is defined as long. Needless to say, 82 | this is brain-damaged. Always use the SIZEOF() macro in place of sizeof(), 83 | so that the result is guaranteed to be of type size_t. 84 | 85 | 86 | The JPEG library is intended to be used within larger programs. Furthermore, 87 | we want it to be reentrant so that it can be used by applications that process 88 | multiple images concurrently. The following rules support these requirements: 89 | 90 | 1. Avoid direct use of file I/O, "malloc", error report printouts, etc; 91 | pass these through the common routines provided. 92 | 93 | 2. Minimize global namespace pollution. Functions should be declared static 94 | wherever possible. (Note that our method-based calling conventions help this 95 | a lot: in many modules only the initialization function will ever need to be 96 | called directly, so only that function need be externally visible.) All 97 | global function names should begin with "jpeg_", and should have an 98 | abbreviated name (unique in the first six characters) substituted by macro 99 | when NEED_SHORT_EXTERNAL_NAMES is set. 100 | 101 | 3. Don't use global variables; anything that must be used in another module 102 | should be in the common data structures. 103 | 104 | 4. Don't use static variables except for read-only constant tables. Variables 105 | that should be private to a module can be placed into private structures (see 106 | the system architecture document, structure.txt). 107 | 108 | 5. Source file names should begin with "j" for files that are part of the 109 | library proper; source files that are not part of the library, such as cjpeg.c 110 | and djpeg.c, do not begin with "j". Keep source file names to eight 111 | characters (plus ".c" or ".h", etc) to make life easy for MS-DOSers. Keep 112 | compression and decompression code in separate source files --- some 113 | applications may want only one half of the library. 114 | 115 | Note: these rules (particularly #4) are not followed religiously in the 116 | modules that are used in cjpeg/djpeg but are not part of the JPEG library 117 | proper. Those modules are not really intended to be used in other 118 | applications. 119 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jaricom.c: -------------------------------------------------------------------------------- 1 | /* 2 | * jaricom.c 3 | * 4 | * Developed 1997-2011 by Guido Vollbeding. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file contains probability estimation tables for common use in 9 | * arithmetic entropy encoding and decoding routines. 10 | * 11 | * This data represents Table D.3 in the JPEG spec (D.2 in the draft), 12 | * ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81, and Table 24 13 | * in the JBIG spec, ISO/IEC IS 11544 and CCITT Recommendation ITU-T T.82. 14 | */ 15 | 16 | #define JPEG_INTERNALS 17 | #include "jinclude.h" 18 | #include "jpeglib.h" 19 | 20 | /* The following #define specifies the packing of the four components 21 | * into the compact INT32 representation. 22 | * Note that this formula must match the actual arithmetic encoder 23 | * and decoder implementation. The implementation has to be changed 24 | * if this formula is changed. 25 | * The current organization is leaned on Markus Kuhn's JBIG 26 | * implementation (jbig_tab.c). 27 | */ 28 | 29 | #define V(i,a,b,c,d) (((INT32)a << 16) | ((INT32)c << 8) | ((INT32)d << 7) | b) 30 | 31 | const INT32 jpeg_aritab[113+1] = { 32 | /* 33 | * Index, Qe_Value, Next_Index_LPS, Next_Index_MPS, Switch_MPS 34 | */ 35 | V( 0, 0x5a1d, 1, 1, 1 ), 36 | V( 1, 0x2586, 14, 2, 0 ), 37 | V( 2, 0x1114, 16, 3, 0 ), 38 | V( 3, 0x080b, 18, 4, 0 ), 39 | V( 4, 0x03d8, 20, 5, 0 ), 40 | V( 5, 0x01da, 23, 6, 0 ), 41 | V( 6, 0x00e5, 25, 7, 0 ), 42 | V( 7, 0x006f, 28, 8, 0 ), 43 | V( 8, 0x0036, 30, 9, 0 ), 44 | V( 9, 0x001a, 33, 10, 0 ), 45 | V( 10, 0x000d, 35, 11, 0 ), 46 | V( 11, 0x0006, 9, 12, 0 ), 47 | V( 12, 0x0003, 10, 13, 0 ), 48 | V( 13, 0x0001, 12, 13, 0 ), 49 | V( 14, 0x5a7f, 15, 15, 1 ), 50 | V( 15, 0x3f25, 36, 16, 0 ), 51 | V( 16, 0x2cf2, 38, 17, 0 ), 52 | V( 17, 0x207c, 39, 18, 0 ), 53 | V( 18, 0x17b9, 40, 19, 0 ), 54 | V( 19, 0x1182, 42, 20, 0 ), 55 | V( 20, 0x0cef, 43, 21, 0 ), 56 | V( 21, 0x09a1, 45, 22, 0 ), 57 | V( 22, 0x072f, 46, 23, 0 ), 58 | V( 23, 0x055c, 48, 24, 0 ), 59 | V( 24, 0x0406, 49, 25, 0 ), 60 | V( 25, 0x0303, 51, 26, 0 ), 61 | V( 26, 0x0240, 52, 27, 0 ), 62 | V( 27, 0x01b1, 54, 28, 0 ), 63 | V( 28, 0x0144, 56, 29, 0 ), 64 | V( 29, 0x00f5, 57, 30, 0 ), 65 | V( 30, 0x00b7, 59, 31, 0 ), 66 | V( 31, 0x008a, 60, 32, 0 ), 67 | V( 32, 0x0068, 62, 33, 0 ), 68 | V( 33, 0x004e, 63, 34, 0 ), 69 | V( 34, 0x003b, 32, 35, 0 ), 70 | V( 35, 0x002c, 33, 9, 0 ), 71 | V( 36, 0x5ae1, 37, 37, 1 ), 72 | V( 37, 0x484c, 64, 38, 0 ), 73 | V( 38, 0x3a0d, 65, 39, 0 ), 74 | V( 39, 0x2ef1, 67, 40, 0 ), 75 | V( 40, 0x261f, 68, 41, 0 ), 76 | V( 41, 0x1f33, 69, 42, 0 ), 77 | V( 42, 0x19a8, 70, 43, 0 ), 78 | V( 43, 0x1518, 72, 44, 0 ), 79 | V( 44, 0x1177, 73, 45, 0 ), 80 | V( 45, 0x0e74, 74, 46, 0 ), 81 | V( 46, 0x0bfb, 75, 47, 0 ), 82 | V( 47, 0x09f8, 77, 48, 0 ), 83 | V( 48, 0x0861, 78, 49, 0 ), 84 | V( 49, 0x0706, 79, 50, 0 ), 85 | V( 50, 0x05cd, 48, 51, 0 ), 86 | V( 51, 0x04de, 50, 52, 0 ), 87 | V( 52, 0x040f, 50, 53, 0 ), 88 | V( 53, 0x0363, 51, 54, 0 ), 89 | V( 54, 0x02d4, 52, 55, 0 ), 90 | V( 55, 0x025c, 53, 56, 0 ), 91 | V( 56, 0x01f8, 54, 57, 0 ), 92 | V( 57, 0x01a4, 55, 58, 0 ), 93 | V( 58, 0x0160, 56, 59, 0 ), 94 | V( 59, 0x0125, 57, 60, 0 ), 95 | V( 60, 0x00f6, 58, 61, 0 ), 96 | V( 61, 0x00cb, 59, 62, 0 ), 97 | V( 62, 0x00ab, 61, 63, 0 ), 98 | V( 63, 0x008f, 61, 32, 0 ), 99 | V( 64, 0x5b12, 65, 65, 1 ), 100 | V( 65, 0x4d04, 80, 66, 0 ), 101 | V( 66, 0x412c, 81, 67, 0 ), 102 | V( 67, 0x37d8, 82, 68, 0 ), 103 | V( 68, 0x2fe8, 83, 69, 0 ), 104 | V( 69, 0x293c, 84, 70, 0 ), 105 | V( 70, 0x2379, 86, 71, 0 ), 106 | V( 71, 0x1edf, 87, 72, 0 ), 107 | V( 72, 0x1aa9, 87, 73, 0 ), 108 | V( 73, 0x174e, 72, 74, 0 ), 109 | V( 74, 0x1424, 72, 75, 0 ), 110 | V( 75, 0x119c, 74, 76, 0 ), 111 | V( 76, 0x0f6b, 74, 77, 0 ), 112 | V( 77, 0x0d51, 75, 78, 0 ), 113 | V( 78, 0x0bb6, 77, 79, 0 ), 114 | V( 79, 0x0a40, 77, 48, 0 ), 115 | V( 80, 0x5832, 80, 81, 1 ), 116 | V( 81, 0x4d1c, 88, 82, 0 ), 117 | V( 82, 0x438e, 89, 83, 0 ), 118 | V( 83, 0x3bdd, 90, 84, 0 ), 119 | V( 84, 0x34ee, 91, 85, 0 ), 120 | V( 85, 0x2eae, 92, 86, 0 ), 121 | V( 86, 0x299a, 93, 87, 0 ), 122 | V( 87, 0x2516, 86, 71, 0 ), 123 | V( 88, 0x5570, 88, 89, 1 ), 124 | V( 89, 0x4ca9, 95, 90, 0 ), 125 | V( 90, 0x44d9, 96, 91, 0 ), 126 | V( 91, 0x3e22, 97, 92, 0 ), 127 | V( 92, 0x3824, 99, 93, 0 ), 128 | V( 93, 0x32b4, 99, 94, 0 ), 129 | V( 94, 0x2e17, 93, 86, 0 ), 130 | V( 95, 0x56a8, 95, 96, 1 ), 131 | V( 96, 0x4f46, 101, 97, 0 ), 132 | V( 97, 0x47e5, 102, 98, 0 ), 133 | V( 98, 0x41cf, 103, 99, 0 ), 134 | V( 99, 0x3c3d, 104, 100, 0 ), 135 | V( 100, 0x375e, 99, 93, 0 ), 136 | V( 101, 0x5231, 105, 102, 0 ), 137 | V( 102, 0x4c0f, 106, 103, 0 ), 138 | V( 103, 0x4639, 107, 104, 0 ), 139 | V( 104, 0x415e, 103, 99, 0 ), 140 | V( 105, 0x5627, 105, 106, 1 ), 141 | V( 106, 0x50e7, 108, 107, 0 ), 142 | V( 107, 0x4b85, 109, 103, 0 ), 143 | V( 108, 0x5597, 110, 109, 0 ), 144 | V( 109, 0x504f, 111, 107, 0 ), 145 | V( 110, 0x5a10, 110, 111, 1 ), 146 | V( 111, 0x5522, 112, 109, 0 ), 147 | V( 112, 0x59eb, 112, 111, 1 ), 148 | /* 149 | * This last entry is used for fixed probability estimate of 0.5 150 | * as suggested in Section 10.3 Table 5 of ITU-T Rec. T.851. 151 | */ 152 | V( 113, 0x5a1d, 113, 113, 0 ) 153 | }; 154 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jcapistd.c: -------------------------------------------------------------------------------- 1 | /* 2 | * jcapistd.c 3 | * 4 | * Copyright (C) 1994-1996, Thomas G. Lane. 5 | * Modified 2013 by Guido Vollbeding. 6 | * This file is part of the Independent JPEG Group's software. 7 | * For conditions of distribution and use, see the accompanying README file. 8 | * 9 | * This file contains application interface code for the compression half 10 | * of the JPEG library. These are the "standard" API routines that are 11 | * used in the normal full-compression case. They are not used by a 12 | * transcoding-only application. Note that if an application links in 13 | * jpeg_start_compress, it will end up linking in the entire compressor. 14 | * We thus must separate this file from jcapimin.c to avoid linking the 15 | * whole compression library into a transcoder. 16 | */ 17 | 18 | #define JPEG_INTERNALS 19 | #include "jinclude.h" 20 | #include "jpeglib.h" 21 | 22 | 23 | /* 24 | * Compression initialization. 25 | * Before calling this, all parameters and a data destination must be set up. 26 | * 27 | * We require a write_all_tables parameter as a failsafe check when writing 28 | * multiple datastreams from the same compression object. Since prior runs 29 | * will have left all the tables marked sent_table=TRUE, a subsequent run 30 | * would emit an abbreviated stream (no tables) by default. This may be what 31 | * is wanted, but for safety's sake it should not be the default behavior: 32 | * programmers should have to make a deliberate choice to emit abbreviated 33 | * images. Therefore the documentation and examples should encourage people 34 | * to pass write_all_tables=TRUE; then it will take active thought to do the 35 | * wrong thing. 36 | */ 37 | 38 | GLOBAL(void) 39 | jpeg_start_compress (j_compress_ptr cinfo, boolean write_all_tables) 40 | { 41 | if (cinfo->global_state != CSTATE_START) 42 | ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); 43 | 44 | if (write_all_tables) 45 | jpeg_suppress_tables(cinfo, FALSE); /* mark all tables to be written */ 46 | 47 | /* (Re)initialize error mgr and destination modules */ 48 | (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); 49 | (*cinfo->dest->init_destination) (cinfo); 50 | /* Perform master selection of active modules */ 51 | jinit_compress_master(cinfo); 52 | /* Set up for the first pass */ 53 | (*cinfo->master->prepare_for_pass) (cinfo); 54 | /* Ready for application to drive first pass through jpeg_write_scanlines 55 | * or jpeg_write_raw_data. 56 | */ 57 | cinfo->next_scanline = 0; 58 | cinfo->global_state = (cinfo->raw_data_in ? CSTATE_RAW_OK : CSTATE_SCANNING); 59 | } 60 | 61 | 62 | /* 63 | * Write some scanlines of data to the JPEG compressor. 64 | * 65 | * The return value will be the number of lines actually written. 66 | * This should be less than the supplied num_lines only in case that 67 | * the data destination module has requested suspension of the compressor, 68 | * or if more than image_height scanlines are passed in. 69 | * 70 | * Note: we warn about excess calls to jpeg_write_scanlines() since 71 | * this likely signals an application programmer error. However, 72 | * excess scanlines passed in the last valid call are *silently* ignored, 73 | * so that the application need not adjust num_lines for end-of-image 74 | * when using a multiple-scanline buffer. 75 | */ 76 | 77 | GLOBAL(JDIMENSION) 78 | jpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines, 79 | JDIMENSION num_lines) 80 | { 81 | JDIMENSION row_ctr, rows_left; 82 | 83 | if (cinfo->global_state != CSTATE_SCANNING) 84 | ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); 85 | if (cinfo->next_scanline >= cinfo->image_height) 86 | WARNMS(cinfo, JWRN_TOO_MUCH_DATA); 87 | 88 | /* Call progress monitor hook if present */ 89 | if (cinfo->progress != NULL) { 90 | cinfo->progress->pass_counter = (long) cinfo->next_scanline; 91 | cinfo->progress->pass_limit = (long) cinfo->image_height; 92 | (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); 93 | } 94 | 95 | /* Give master control module another chance if this is first call to 96 | * jpeg_write_scanlines. This lets output of the frame/scan headers be 97 | * delayed so that application can write COM, etc, markers between 98 | * jpeg_start_compress and jpeg_write_scanlines. 99 | */ 100 | if (cinfo->master->call_pass_startup) 101 | (*cinfo->master->pass_startup) (cinfo); 102 | 103 | /* Ignore any extra scanlines at bottom of image. */ 104 | rows_left = cinfo->image_height - cinfo->next_scanline; 105 | if (num_lines > rows_left) 106 | num_lines = rows_left; 107 | 108 | row_ctr = 0; 109 | (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines); 110 | cinfo->next_scanline += row_ctr; 111 | return row_ctr; 112 | } 113 | 114 | 115 | /* 116 | * Alternate entry point to write raw data. 117 | * Processes exactly one iMCU row per call, unless suspended. 118 | */ 119 | 120 | GLOBAL(JDIMENSION) 121 | jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data, 122 | JDIMENSION num_lines) 123 | { 124 | JDIMENSION lines_per_iMCU_row; 125 | 126 | if (cinfo->global_state != CSTATE_RAW_OK) 127 | ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); 128 | if (cinfo->next_scanline >= cinfo->image_height) { 129 | WARNMS(cinfo, JWRN_TOO_MUCH_DATA); 130 | return 0; 131 | } 132 | 133 | /* Call progress monitor hook if present */ 134 | if (cinfo->progress != NULL) { 135 | cinfo->progress->pass_counter = (long) cinfo->next_scanline; 136 | cinfo->progress->pass_limit = (long) cinfo->image_height; 137 | (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); 138 | } 139 | 140 | /* Give master control module another chance if this is first call to 141 | * jpeg_write_raw_data. This lets output of the frame/scan headers be 142 | * delayed so that application can write COM, etc, markers between 143 | * jpeg_start_compress and jpeg_write_raw_data. 144 | */ 145 | if (cinfo->master->call_pass_startup) 146 | (*cinfo->master->pass_startup) (cinfo); 147 | 148 | /* Verify that at least one iMCU row has been passed. */ 149 | lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->min_DCT_v_scaled_size; 150 | if (num_lines < lines_per_iMCU_row) 151 | ERREXIT(cinfo, JERR_BUFFER_SIZE); 152 | 153 | /* Directly compress the row. */ 154 | if (! (*cinfo->coef->compress_data) (cinfo, data)) { 155 | /* If compressor did not consume the whole row, suspend processing. */ 156 | return 0; 157 | } 158 | 159 | /* OK, we processed one iMCU row. */ 160 | cinfo->next_scanline += lines_per_iMCU_row; 161 | return lines_per_iMCU_row; 162 | } 163 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jcinit.c: -------------------------------------------------------------------------------- 1 | /* 2 | * jcinit.c 3 | * 4 | * Copyright (C) 1991-1997, Thomas G. Lane. 5 | * Modified 2003-2013 by Guido Vollbeding. 6 | * This file is part of the Independent JPEG Group's software. 7 | * For conditions of distribution and use, see the accompanying README file. 8 | * 9 | * This file contains initialization logic for the JPEG compressor. 10 | * This routine is in charge of selecting the modules to be executed and 11 | * making an initialization call to each one. 12 | * 13 | * Logically, this code belongs in jcmaster.c. It's split out because 14 | * linking this routine implies linking the entire compression library. 15 | * For a transcoding-only application, we want to be able to use jcmaster.c 16 | * without linking in the whole library. 17 | */ 18 | 19 | #define JPEG_INTERNALS 20 | #include "jinclude.h" 21 | #include "jpeglib.h" 22 | 23 | 24 | /* 25 | * Master selection of compression modules. 26 | * This is done once at the start of processing an image. We determine 27 | * which modules will be used and give them appropriate initialization calls. 28 | */ 29 | 30 | GLOBAL(void) 31 | jinit_compress_master (j_compress_ptr cinfo) 32 | { 33 | long samplesperrow; 34 | JDIMENSION jd_samplesperrow; 35 | 36 | /* For now, precision must match compiled-in value... */ 37 | if (cinfo->data_precision != BITS_IN_JSAMPLE) 38 | ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision); 39 | 40 | /* Sanity check on image dimensions */ 41 | if (cinfo->image_height <= 0 || cinfo->image_width <= 0 || 42 | cinfo->input_components <= 0) 43 | ERREXIT(cinfo, JERR_EMPTY_IMAGE); 44 | 45 | /* Width of an input scanline must be representable as JDIMENSION. */ 46 | samplesperrow = (long) cinfo->image_width * (long) cinfo->input_components; 47 | jd_samplesperrow = (JDIMENSION) samplesperrow; 48 | if ((long) jd_samplesperrow != samplesperrow) 49 | ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); 50 | 51 | /* Initialize master control (includes parameter checking/processing) */ 52 | jinit_c_master_control(cinfo, FALSE /* full compression */); 53 | 54 | /* Preprocessing */ 55 | if (! cinfo->raw_data_in) { 56 | jinit_color_converter(cinfo); 57 | jinit_downsampler(cinfo); 58 | jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */); 59 | } 60 | /* Forward DCT */ 61 | jinit_forward_dct(cinfo); 62 | /* Entropy encoding: either Huffman or arithmetic coding. */ 63 | if (cinfo->arith_code) 64 | jinit_arith_encoder(cinfo); 65 | else { 66 | jinit_huff_encoder(cinfo); 67 | } 68 | 69 | /* Need a full-image coefficient buffer in any multi-pass mode. */ 70 | jinit_c_coef_controller(cinfo, 71 | (boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding)); 72 | jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */); 73 | 74 | jinit_marker_writer(cinfo); 75 | 76 | /* We can now tell the memory manager to allocate virtual arrays. */ 77 | (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); 78 | 79 | /* Write the datastream header (SOI) immediately. 80 | * Frame and scan headers are postponed till later. 81 | * This lets application insert special markers after the SOI. 82 | */ 83 | (*cinfo->marker->write_file_header) (cinfo); 84 | } 85 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jcomapi.c: -------------------------------------------------------------------------------- 1 | /* 2 | * jcomapi.c 3 | * 4 | * Copyright (C) 1994-1997, Thomas G. Lane. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file contains application interface routines that are used for both 9 | * compression and decompression. 10 | */ 11 | 12 | #define JPEG_INTERNALS 13 | #include "jinclude.h" 14 | #include "jpeglib.h" 15 | 16 | 17 | /* 18 | * Abort processing of a JPEG compression or decompression operation, 19 | * but don't destroy the object itself. 20 | * 21 | * For this, we merely clean up all the nonpermanent memory pools. 22 | * Note that temp files (virtual arrays) are not allowed to belong to 23 | * the permanent pool, so we will be able to close all temp files here. 24 | * Closing a data source or destination, if necessary, is the application's 25 | * responsibility. 26 | */ 27 | 28 | GLOBAL(void) 29 | jpeg_abort (j_common_ptr cinfo) 30 | { 31 | int pool; 32 | 33 | /* Do nothing if called on a not-initialized or destroyed JPEG object. */ 34 | if (cinfo->mem == NULL) 35 | return; 36 | 37 | /* Releasing pools in reverse order might help avoid fragmentation 38 | * with some (brain-damaged) malloc libraries. 39 | */ 40 | for (pool = JPOOL_NUMPOOLS-1; pool > JPOOL_PERMANENT; pool--) { 41 | (*cinfo->mem->free_pool) (cinfo, pool); 42 | } 43 | 44 | /* Reset overall state for possible reuse of object */ 45 | if (cinfo->is_decompressor) { 46 | cinfo->global_state = DSTATE_START; 47 | /* Try to keep application from accessing now-deleted marker list. 48 | * A bit kludgy to do it here, but this is the most central place. 49 | */ 50 | ((j_decompress_ptr) cinfo)->marker_list = NULL; 51 | } else { 52 | cinfo->global_state = CSTATE_START; 53 | } 54 | } 55 | 56 | 57 | /* 58 | * Destruction of a JPEG object. 59 | * 60 | * Everything gets deallocated except the master jpeg_compress_struct itself 61 | * and the error manager struct. Both of these are supplied by the application 62 | * and must be freed, if necessary, by the application. (Often they are on 63 | * the stack and so don't need to be freed anyway.) 64 | * Closing a data source or destination, if necessary, is the application's 65 | * responsibility. 66 | */ 67 | 68 | GLOBAL(void) 69 | jpeg_destroy (j_common_ptr cinfo) 70 | { 71 | /* We need only tell the memory manager to release everything. */ 72 | /* NB: mem pointer is NULL if memory mgr failed to initialize. */ 73 | if (cinfo->mem != NULL) 74 | (*cinfo->mem->self_destruct) (cinfo); 75 | cinfo->mem = NULL; /* be safe if jpeg_destroy is called twice */ 76 | cinfo->global_state = 0; /* mark it destroyed */ 77 | } 78 | 79 | 80 | /* 81 | * Convenience routines for allocating quantization and Huffman tables. 82 | * (Would jutils.c be a more reasonable place to put these?) 83 | */ 84 | 85 | GLOBAL(JQUANT_TBL *) 86 | jpeg_alloc_quant_table (j_common_ptr cinfo) 87 | { 88 | JQUANT_TBL *tbl; 89 | 90 | tbl = (JQUANT_TBL *) 91 | (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JQUANT_TBL)); 92 | tbl->sent_table = FALSE; /* make sure this is false in any new table */ 93 | return tbl; 94 | } 95 | 96 | 97 | GLOBAL(JHUFF_TBL *) 98 | jpeg_alloc_huff_table (j_common_ptr cinfo) 99 | { 100 | JHUFF_TBL *tbl; 101 | 102 | tbl = (JHUFF_TBL *) 103 | (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JHUFF_TBL)); 104 | tbl->sent_table = FALSE; /* make sure this is false in any new table */ 105 | return tbl; 106 | } 107 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jconfig.bcc: -------------------------------------------------------------------------------- 1 | /* jconfig.bcc --- jconfig.h for Borland C (Turbo C) on MS-DOS or OS/2. */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #ifdef __MSDOS__ 15 | #define NEED_FAR_POINTERS /* for small or medium memory model */ 16 | #endif 17 | #undef NEED_SHORT_EXTERNAL_NAMES 18 | #undef INCOMPLETE_TYPES_BROKEN /* this assumes you have -w-stu in CFLAGS */ 19 | 20 | #ifdef JPEG_INTERNALS 21 | 22 | #undef RIGHT_SHIFT_IS_UNSIGNED 23 | 24 | #ifdef __MSDOS__ 25 | #define USE_MSDOS_MEMMGR /* Define this if you use jmemdos.c */ 26 | #define MAX_ALLOC_CHUNK 65520L /* Maximum request to malloc() */ 27 | #define USE_FMEM /* Borland has _fmemcpy() and _fmemset() */ 28 | #endif 29 | 30 | #endif /* JPEG_INTERNALS */ 31 | 32 | #ifdef JPEG_CJPEG_DJPEG 33 | 34 | #define BMP_SUPPORTED /* BMP image file format */ 35 | #define GIF_SUPPORTED /* GIF image file format */ 36 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 37 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 38 | #define TARGA_SUPPORTED /* Targa image file format */ 39 | 40 | #define TWO_FILE_COMMANDLINE 41 | #define USE_SETMODE /* Borland has setmode() */ 42 | #ifdef __MSDOS__ 43 | #define NEED_SIGNAL_CATCHER /* Define this if you use jmemdos.c */ 44 | #endif 45 | #undef DONT_USE_B_MODE 46 | #undef PROGRESS_REPORT /* optional */ 47 | 48 | #endif /* JPEG_CJPEG_DJPEG */ 49 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jconfig.cfg: -------------------------------------------------------------------------------- 1 | /* jconfig.cfg --- source file edited by configure script */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #undef HAVE_PROTOTYPES 5 | #undef HAVE_UNSIGNED_CHAR 6 | #undef HAVE_UNSIGNED_SHORT 7 | #undef void 8 | #undef const 9 | #undef CHAR_IS_UNSIGNED 10 | #undef HAVE_STDDEF_H 11 | #undef HAVE_STDLIB_H 12 | #undef HAVE_LOCALE_H 13 | #undef NEED_BSD_STRINGS 14 | #undef NEED_SYS_TYPES_H 15 | #undef NEED_FAR_POINTERS 16 | #undef NEED_SHORT_EXTERNAL_NAMES 17 | /* Define this if you get warnings about undefined structures. */ 18 | #undef INCOMPLETE_TYPES_BROKEN 19 | 20 | /* Define "boolean" as unsigned char, not enum, on Windows systems. */ 21 | #ifdef _WIN32 22 | #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ 23 | typedef unsigned char boolean; 24 | #endif 25 | #ifndef FALSE /* in case these macros already exist */ 26 | #define FALSE 0 /* values of boolean */ 27 | #endif 28 | #ifndef TRUE 29 | #define TRUE 1 30 | #endif 31 | #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ 32 | #endif 33 | 34 | #ifdef JPEG_INTERNALS 35 | 36 | #undef RIGHT_SHIFT_IS_UNSIGNED 37 | #undef INLINE 38 | /* These are for configuring the JPEG memory manager. */ 39 | #undef DEFAULT_MAX_MEM 40 | #undef NO_MKTEMP 41 | 42 | #endif /* JPEG_INTERNALS */ 43 | 44 | #ifdef JPEG_CJPEG_DJPEG 45 | 46 | #define BMP_SUPPORTED /* BMP image file format */ 47 | #define GIF_SUPPORTED /* GIF image file format */ 48 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 49 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 50 | #define TARGA_SUPPORTED /* Targa image file format */ 51 | 52 | #undef TWO_FILE_COMMANDLINE 53 | #undef NEED_SIGNAL_CATCHER 54 | #undef DONT_USE_B_MODE 55 | 56 | /* Define this if you want percent-done progress reports from cjpeg/djpeg. */ 57 | #undef PROGRESS_REPORT 58 | 59 | #endif /* JPEG_CJPEG_DJPEG */ 60 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jconfig.dj: -------------------------------------------------------------------------------- 1 | /* jconfig.dj --- jconfig.h for DJGPP (Delorie's GNU C port) on MS-DOS. */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS /* DJGPP uses flat 32-bit addressing */ 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #endif /* JPEG_INTERNALS */ 23 | 24 | #ifdef JPEG_CJPEG_DJPEG 25 | 26 | #define BMP_SUPPORTED /* BMP image file format */ 27 | #define GIF_SUPPORTED /* GIF image file format */ 28 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 29 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 30 | #define TARGA_SUPPORTED /* Targa image file format */ 31 | 32 | #undef TWO_FILE_COMMANDLINE /* optional */ 33 | #define USE_SETMODE /* Needed to make one-file style work in DJGPP */ 34 | #undef NEED_SIGNAL_CATCHER /* Define this if you use jmemname.c */ 35 | #undef DONT_USE_B_MODE 36 | #undef PROGRESS_REPORT /* optional */ 37 | 38 | #endif /* JPEG_CJPEG_DJPEG */ 39 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jconfig.h: -------------------------------------------------------------------------------- 1 | /* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */ 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | /* Define "boolean" as unsigned char, not enum, per Windows custom */ 19 | #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ 20 | typedef unsigned char boolean; 21 | #endif 22 | #ifndef FALSE /* in case these macros already exist */ 23 | #define FALSE 0 /* values of boolean */ 24 | #endif 25 | #ifndef TRUE 26 | #define TRUE 1 27 | #endif 28 | #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ 29 | 30 | 31 | #ifdef JPEG_INTERNALS 32 | 33 | #undef RIGHT_SHIFT_IS_UNSIGNED 34 | 35 | #endif /* JPEG_INTERNALS */ 36 | 37 | #ifdef JPEG_CJPEG_DJPEG 38 | 39 | #define BMP_SUPPORTED /* BMP image file format */ 40 | #define GIF_SUPPORTED /* GIF image file format */ 41 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 42 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 43 | #define TARGA_SUPPORTED /* Targa image file format */ 44 | 45 | #define TWO_FILE_COMMANDLINE /* optional */ 46 | #define USE_SETMODE /* Microsoft has setmode() */ 47 | #undef NEED_SIGNAL_CATCHER 48 | #undef DONT_USE_B_MODE 49 | #undef PROGRESS_REPORT /* optional */ 50 | 51 | #endif /* JPEG_CJPEG_DJPEG */ 52 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jconfig.mac: -------------------------------------------------------------------------------- 1 | /* jconfig.mac --- jconfig.h for CodeWarrior on Apple Macintosh */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #define USE_MAC_MEMMGR /* Define this if you use jmemmac.c */ 23 | 24 | #define ALIGN_TYPE long /* Needed for 680x0 Macs */ 25 | 26 | #endif /* JPEG_INTERNALS */ 27 | 28 | #ifdef JPEG_CJPEG_DJPEG 29 | 30 | #define BMP_SUPPORTED /* BMP image file format */ 31 | #define GIF_SUPPORTED /* GIF image file format */ 32 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 33 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 34 | #define TARGA_SUPPORTED /* Targa image file format */ 35 | 36 | #define USE_CCOMMAND /* Command line reader for Macintosh */ 37 | #define TWO_FILE_COMMANDLINE /* Binary I/O thru stdin/stdout doesn't work */ 38 | 39 | #undef NEED_SIGNAL_CATCHER 40 | #undef DONT_USE_B_MODE 41 | #undef PROGRESS_REPORT /* optional */ 42 | 43 | #endif /* JPEG_CJPEG_DJPEG */ 44 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jconfig.manx: -------------------------------------------------------------------------------- 1 | /* jconfig.manx --- jconfig.h for Amiga systems using Manx Aztec C ver 5.x. */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #define TEMP_DIRECTORY "JPEGTMP:" /* recommended setting for Amiga */ 23 | 24 | #define SHORTxSHORT_32 /* produces better DCT code with Aztec C */ 25 | 26 | #endif /* JPEG_INTERNALS */ 27 | 28 | #ifdef JPEG_CJPEG_DJPEG 29 | 30 | #define BMP_SUPPORTED /* BMP image file format */ 31 | #define GIF_SUPPORTED /* GIF image file format */ 32 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 33 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 34 | #define TARGA_SUPPORTED /* Targa image file format */ 35 | 36 | #define TWO_FILE_COMMANDLINE 37 | #define NEED_SIGNAL_CATCHER 38 | #undef DONT_USE_B_MODE 39 | #undef PROGRESS_REPORT /* optional */ 40 | 41 | #define signal_catcher _abort /* hack for Aztec C naming requirements */ 42 | 43 | #endif /* JPEG_CJPEG_DJPEG */ 44 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jconfig.mc6: -------------------------------------------------------------------------------- 1 | /* jconfig.mc6 --- jconfig.h for Microsoft C on MS-DOS, version 6.00A & up. */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #define NEED_FAR_POINTERS /* for small or medium memory model */ 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #define USE_MSDOS_MEMMGR /* Define this if you use jmemdos.c */ 23 | 24 | #define MAX_ALLOC_CHUNK 65520L /* Maximum request to malloc() */ 25 | 26 | #define USE_FMEM /* Microsoft has _fmemcpy() and _fmemset() */ 27 | 28 | #define NEED_FHEAPMIN /* far heap management routines are broken */ 29 | 30 | #define SHORTxLCONST_32 /* enable compiler-specific DCT optimization */ 31 | /* Note: the above define is known to improve the code with Microsoft C 6.00A. 32 | * I do not know whether it is good for later compiler versions. 33 | * Please report any info on this point to jpeg-info@jpegclub.org. 34 | */ 35 | 36 | #endif /* JPEG_INTERNALS */ 37 | 38 | #ifdef JPEG_CJPEG_DJPEG 39 | 40 | #define BMP_SUPPORTED /* BMP image file format */ 41 | #define GIF_SUPPORTED /* GIF image file format */ 42 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 43 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 44 | #define TARGA_SUPPORTED /* Targa image file format */ 45 | 46 | #define TWO_FILE_COMMANDLINE 47 | #define USE_SETMODE /* Microsoft has setmode() */ 48 | #define NEED_SIGNAL_CATCHER /* Define this if you use jmemdos.c */ 49 | #undef DONT_USE_B_MODE 50 | #undef PROGRESS_REPORT /* optional */ 51 | 52 | #endif /* JPEG_CJPEG_DJPEG */ 53 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jconfig.sas: -------------------------------------------------------------------------------- 1 | /* jconfig.sas --- jconfig.h for Amiga systems using SAS C 6.0 and up. */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #define TEMP_DIRECTORY "JPEGTMP:" /* recommended setting for Amiga */ 23 | 24 | #define NO_MKTEMP /* SAS C doesn't have mktemp() */ 25 | 26 | #define SHORTxSHORT_32 /* produces better DCT code with SAS C */ 27 | 28 | #endif /* JPEG_INTERNALS */ 29 | 30 | #ifdef JPEG_CJPEG_DJPEG 31 | 32 | #define BMP_SUPPORTED /* BMP image file format */ 33 | #define GIF_SUPPORTED /* GIF image file format */ 34 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 35 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 36 | #define TARGA_SUPPORTED /* Targa image file format */ 37 | 38 | #define TWO_FILE_COMMANDLINE 39 | #define NEED_SIGNAL_CATCHER 40 | #undef DONT_USE_B_MODE 41 | #undef PROGRESS_REPORT /* optional */ 42 | 43 | #endif /* JPEG_CJPEG_DJPEG */ 44 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jconfig.st: -------------------------------------------------------------------------------- 1 | /* jconfig.st --- jconfig.h for Atari ST/STE/TT using Pure C or Turbo C. */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #define INCOMPLETE_TYPES_BROKEN /* suppress undefined-structure warnings */ 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #define ALIGN_TYPE long /* apparently double is a weird size? */ 23 | 24 | #endif /* JPEG_INTERNALS */ 25 | 26 | #ifdef JPEG_CJPEG_DJPEG 27 | 28 | #define BMP_SUPPORTED /* BMP image file format */ 29 | #define GIF_SUPPORTED /* GIF image file format */ 30 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 31 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 32 | #define TARGA_SUPPORTED /* Targa image file format */ 33 | 34 | #define TWO_FILE_COMMANDLINE /* optional -- undef if you like Unix style */ 35 | /* Note: if you undef TWO_FILE_COMMANDLINE, you may need to define 36 | * USE_SETMODE. Some Atari compilers require it, some do not. 37 | */ 38 | #define NEED_SIGNAL_CATCHER /* needed if you use jmemname.c */ 39 | #undef DONT_USE_B_MODE 40 | #undef PROGRESS_REPORT /* optional */ 41 | 42 | #endif /* JPEG_CJPEG_DJPEG */ 43 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jconfig.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * jconfig.txt 3 | * 4 | * Copyright (C) 1991-1994, Thomas G. Lane. 5 | * Modified 2009-2013 by Guido Vollbeding. 6 | * This file is part of the Independent JPEG Group's software. 7 | * For conditions of distribution and use, see the accompanying README file. 8 | * 9 | * This file documents the configuration options that are required to 10 | * customize the JPEG software for a particular system. 11 | * 12 | * The actual configuration options for a particular installation are stored 13 | * in jconfig.h. On many machines, jconfig.h can be generated automatically 14 | * or copied from one of the "canned" jconfig files that we supply. But if 15 | * you need to generate a jconfig.h file by hand, this file tells you how. 16 | * 17 | * DO NOT EDIT THIS FILE --- IT WON'T ACCOMPLISH ANYTHING. 18 | * EDIT A COPY NAMED JCONFIG.H. 19 | */ 20 | 21 | 22 | /* 23 | * These symbols indicate the properties of your machine or compiler. 24 | * #define the symbol if yes, #undef it if no. 25 | */ 26 | 27 | /* Does your compiler support function prototypes? 28 | * (If not, you also need to use ansi2knr, see install.txt) 29 | */ 30 | #define HAVE_PROTOTYPES 31 | 32 | /* Does your compiler support the declaration "unsigned char" ? 33 | * How about "unsigned short" ? 34 | */ 35 | #define HAVE_UNSIGNED_CHAR 36 | #define HAVE_UNSIGNED_SHORT 37 | 38 | /* Define "void" as "char" if your compiler doesn't know about type void. 39 | * NOTE: be sure to define void such that "void *" represents the most general 40 | * pointer type, e.g., that returned by malloc(). 41 | */ 42 | /* #define void char */ 43 | 44 | /* Define "const" as empty if your compiler doesn't know the "const" keyword. 45 | */ 46 | /* #define const */ 47 | 48 | /* Define this if an ordinary "char" type is unsigned. 49 | * If you're not sure, leaving it undefined will work at some cost in speed. 50 | * If you defined HAVE_UNSIGNED_CHAR then the speed difference is minimal. 51 | */ 52 | #undef CHAR_IS_UNSIGNED 53 | 54 | /* Define this if your system has an ANSI-conforming file. 55 | */ 56 | #define HAVE_STDDEF_H 57 | 58 | /* Define this if your system has an ANSI-conforming file. 59 | */ 60 | #define HAVE_STDLIB_H 61 | 62 | /* Define this if your system does not have an ANSI/SysV , 63 | * but does have a BSD-style . 64 | */ 65 | #undef NEED_BSD_STRINGS 66 | 67 | /* Define this if your system does not provide typedef size_t in any of the 68 | * ANSI-standard places (stddef.h, stdlib.h, or stdio.h), but places it in 69 | * instead. 70 | */ 71 | #undef NEED_SYS_TYPES_H 72 | 73 | /* For 80x86 machines, you need to define NEED_FAR_POINTERS, 74 | * unless you are using a large-data memory model or 80386 flat-memory mode. 75 | * On less brain-damaged CPUs this symbol must not be defined. 76 | * (Defining this symbol causes large data structures to be referenced through 77 | * "far" pointers and to be allocated with a special version of malloc.) 78 | */ 79 | #undef NEED_FAR_POINTERS 80 | 81 | /* Define this if your linker needs global names to be unique in less 82 | * than the first 15 characters. 83 | */ 84 | #undef NEED_SHORT_EXTERNAL_NAMES 85 | 86 | /* Although a real ANSI C compiler can deal perfectly well with pointers to 87 | * unspecified structures (see "incomplete types" in the spec), a few pre-ANSI 88 | * and pseudo-ANSI compilers get confused. To keep one of these bozos happy, 89 | * define INCOMPLETE_TYPES_BROKEN. This is not recommended unless you 90 | * actually get "missing structure definition" warnings or errors while 91 | * compiling the JPEG code. 92 | */ 93 | #undef INCOMPLETE_TYPES_BROKEN 94 | 95 | /* Define "boolean" as unsigned char, not enum, on Windows systems. 96 | */ 97 | #ifdef _WIN32 98 | #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ 99 | typedef unsigned char boolean; 100 | #endif 101 | #ifndef FALSE /* in case these macros already exist */ 102 | #define FALSE 0 /* values of boolean */ 103 | #endif 104 | #ifndef TRUE 105 | #define TRUE 1 106 | #endif 107 | #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ 108 | #endif 109 | 110 | 111 | /* 112 | * The following options affect code selection within the JPEG library, 113 | * but they don't need to be visible to applications using the library. 114 | * To minimize application namespace pollution, the symbols won't be 115 | * defined unless JPEG_INTERNALS has been defined. 116 | */ 117 | 118 | #ifdef JPEG_INTERNALS 119 | 120 | /* Define this if your compiler implements ">>" on signed values as a logical 121 | * (unsigned) shift; leave it undefined if ">>" is a signed (arithmetic) shift, 122 | * which is the normal and rational definition. 123 | */ 124 | #undef RIGHT_SHIFT_IS_UNSIGNED 125 | 126 | 127 | #endif /* JPEG_INTERNALS */ 128 | 129 | 130 | /* 131 | * The remaining options do not affect the JPEG library proper, 132 | * but only the sample applications cjpeg/djpeg (see cjpeg.c, djpeg.c). 133 | * Other applications can ignore these. 134 | */ 135 | 136 | #ifdef JPEG_CJPEG_DJPEG 137 | 138 | /* These defines indicate which image (non-JPEG) file formats are allowed. */ 139 | 140 | #define BMP_SUPPORTED /* BMP image file format */ 141 | #define GIF_SUPPORTED /* GIF image file format */ 142 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 143 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 144 | #define TARGA_SUPPORTED /* Targa image file format */ 145 | 146 | /* Define this if you want to name both input and output files on the command 147 | * line, rather than using stdout and optionally stdin. You MUST do this if 148 | * your system can't cope with binary I/O to stdin/stdout. See comments at 149 | * head of cjpeg.c or djpeg.c. 150 | */ 151 | #undef TWO_FILE_COMMANDLINE 152 | 153 | /* Define this if your system needs explicit cleanup of temporary files. 154 | * This is crucial under MS-DOS, where the temporary "files" may be areas 155 | * of extended memory; on most other systems it's not as important. 156 | */ 157 | #undef NEED_SIGNAL_CATCHER 158 | 159 | /* By default, we open image files with fopen(...,"rb") or fopen(...,"wb"). 160 | * This is necessary on systems that distinguish text files from binary files, 161 | * and is harmless on most systems that don't. If you have one of the rare 162 | * systems that complains about the "b" spec, define this symbol. 163 | */ 164 | #undef DONT_USE_B_MODE 165 | 166 | /* Define this if you want percent-done progress reports from cjpeg/djpeg. 167 | */ 168 | #undef PROGRESS_REPORT 169 | 170 | 171 | #endif /* JPEG_CJPEG_DJPEG */ 172 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jconfig.vc: -------------------------------------------------------------------------------- 1 | /* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */ 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | /* Define "boolean" as unsigned char, not enum, per Windows custom */ 19 | #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ 20 | typedef unsigned char boolean; 21 | #endif 22 | #ifndef FALSE /* in case these macros already exist */ 23 | #define FALSE 0 /* values of boolean */ 24 | #endif 25 | #ifndef TRUE 26 | #define TRUE 1 27 | #endif 28 | #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ 29 | 30 | 31 | #ifdef JPEG_INTERNALS 32 | 33 | #undef RIGHT_SHIFT_IS_UNSIGNED 34 | 35 | #endif /* JPEG_INTERNALS */ 36 | 37 | #ifdef JPEG_CJPEG_DJPEG 38 | 39 | #define BMP_SUPPORTED /* BMP image file format */ 40 | #define GIF_SUPPORTED /* GIF image file format */ 41 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 42 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 43 | #define TARGA_SUPPORTED /* Targa image file format */ 44 | 45 | #define TWO_FILE_COMMANDLINE /* optional */ 46 | #define USE_SETMODE /* Microsoft has setmode() */ 47 | #undef NEED_SIGNAL_CATCHER 48 | #undef DONT_USE_B_MODE 49 | #undef PROGRESS_REPORT /* optional */ 50 | 51 | #endif /* JPEG_CJPEG_DJPEG */ 52 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jconfig.vms: -------------------------------------------------------------------------------- 1 | /* jconfig.vms --- jconfig.h for use on Digital VMS. */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #endif /* JPEG_INTERNALS */ 23 | 24 | #ifdef JPEG_CJPEG_DJPEG 25 | 26 | #define BMP_SUPPORTED /* BMP image file format */ 27 | #define GIF_SUPPORTED /* GIF image file format */ 28 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 29 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 30 | #define TARGA_SUPPORTED /* Targa image file format */ 31 | 32 | #define TWO_FILE_COMMANDLINE /* Needed on VMS */ 33 | #undef NEED_SIGNAL_CATCHER 34 | #undef DONT_USE_B_MODE 35 | #undef PROGRESS_REPORT /* optional */ 36 | 37 | #endif /* JPEG_CJPEG_DJPEG */ 38 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jconfig.wat: -------------------------------------------------------------------------------- 1 | /* jconfig.wat --- jconfig.h for Watcom C/C++ on MS-DOS or OS/2. */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #define CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS /* Watcom uses flat 32-bit addressing */ 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #endif /* JPEG_INTERNALS */ 23 | 24 | #ifdef JPEG_CJPEG_DJPEG 25 | 26 | #define BMP_SUPPORTED /* BMP image file format */ 27 | #define GIF_SUPPORTED /* GIF image file format */ 28 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 29 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 30 | #define TARGA_SUPPORTED /* Targa image file format */ 31 | 32 | #undef TWO_FILE_COMMANDLINE /* optional */ 33 | #define USE_SETMODE /* Needed to make one-file style work in Watcom */ 34 | #undef NEED_SIGNAL_CATCHER /* Define this if you use jmemname.c */ 35 | #undef DONT_USE_B_MODE 36 | #undef PROGRESS_REPORT /* optional */ 37 | 38 | #endif /* JPEG_CJPEG_DJPEG */ 39 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jdosabcc.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/jdosabcc.obj -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jdosamsc.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/jdosamsc.obj -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jdosaobj.txt: -------------------------------------------------------------------------------- 1 | This archive contains already-assembled object files for JMEMDOSA.ASM 2 | of the Independent JPEG Group's JPEG package. These files will be helpful 3 | if you want to compile the IJG code for DOS, but don't have an assembler. 4 | 5 | These files were prepared from the 3/13/1992 version of JMEMDOSA.ASM, 6 | which is still unchanged as of mid-1998. You can use these files with 7 | releases 3 through 6 of the IJG code, and probably future releases too. 8 | 9 | To use these files, copy the proper version to JMEMDOSA.OBJ. Make sure 10 | this file has a newer date than JMEMDOSA.ASM. Then compile the code as 11 | usual. 12 | 13 | Object files included: 14 | 15 | JDOSAMSC.OBJ For Microsoft C version 5 or later. 16 | JDOSABCC.OBJ For Borland C version 3.0 or later. 17 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jdtrans.c: -------------------------------------------------------------------------------- 1 | /* 2 | * jdtrans.c 3 | * 4 | * Copyright (C) 1995-1997, Thomas G. Lane. 5 | * Modified 2000-2009 by Guido Vollbeding. 6 | * This file is part of the Independent JPEG Group's software. 7 | * For conditions of distribution and use, see the accompanying README file. 8 | * 9 | * This file contains library routines for transcoding decompression, 10 | * that is, reading raw DCT coefficient arrays from an input JPEG file. 11 | * The routines in jdapimin.c will also be needed by a transcoder. 12 | */ 13 | 14 | #define JPEG_INTERNALS 15 | #include "jinclude.h" 16 | #include "jpeglib.h" 17 | 18 | 19 | /* Forward declarations */ 20 | LOCAL(void) transdecode_master_selection JPP((j_decompress_ptr cinfo)); 21 | 22 | 23 | /* 24 | * Read the coefficient arrays from a JPEG file. 25 | * jpeg_read_header must be completed before calling this. 26 | * 27 | * The entire image is read into a set of virtual coefficient-block arrays, 28 | * one per component. The return value is a pointer to the array of 29 | * virtual-array descriptors. These can be manipulated directly via the 30 | * JPEG memory manager, or handed off to jpeg_write_coefficients(). 31 | * To release the memory occupied by the virtual arrays, call 32 | * jpeg_finish_decompress() when done with the data. 33 | * 34 | * An alternative usage is to simply obtain access to the coefficient arrays 35 | * during a buffered-image-mode decompression operation. This is allowed 36 | * after any jpeg_finish_output() call. The arrays can be accessed until 37 | * jpeg_finish_decompress() is called. (Note that any call to the library 38 | * may reposition the arrays, so don't rely on access_virt_barray() results 39 | * to stay valid across library calls.) 40 | * 41 | * Returns NULL if suspended. This case need be checked only if 42 | * a suspending data source is used. 43 | */ 44 | 45 | GLOBAL(jvirt_barray_ptr *) 46 | jpeg_read_coefficients (j_decompress_ptr cinfo) 47 | { 48 | if (cinfo->global_state == DSTATE_READY) { 49 | /* First call: initialize active modules */ 50 | transdecode_master_selection(cinfo); 51 | cinfo->global_state = DSTATE_RDCOEFS; 52 | } 53 | if (cinfo->global_state == DSTATE_RDCOEFS) { 54 | /* Absorb whole file into the coef buffer */ 55 | for (;;) { 56 | int retcode; 57 | /* Call progress monitor hook if present */ 58 | if (cinfo->progress != NULL) 59 | (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); 60 | /* Absorb some more input */ 61 | retcode = (*cinfo->inputctl->consume_input) (cinfo); 62 | if (retcode == JPEG_SUSPENDED) 63 | return NULL; 64 | if (retcode == JPEG_REACHED_EOI) 65 | break; 66 | /* Advance progress counter if appropriate */ 67 | if (cinfo->progress != NULL && 68 | (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) { 69 | if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) { 70 | /* startup underestimated number of scans; ratchet up one scan */ 71 | cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows; 72 | } 73 | } 74 | } 75 | /* Set state so that jpeg_finish_decompress does the right thing */ 76 | cinfo->global_state = DSTATE_STOPPING; 77 | } 78 | /* At this point we should be in state DSTATE_STOPPING if being used 79 | * standalone, or in state DSTATE_BUFIMAGE if being invoked to get access 80 | * to the coefficients during a full buffered-image-mode decompression. 81 | */ 82 | if ((cinfo->global_state == DSTATE_STOPPING || 83 | cinfo->global_state == DSTATE_BUFIMAGE) && cinfo->buffered_image) { 84 | return cinfo->coef->coef_arrays; 85 | } 86 | /* Oops, improper usage */ 87 | ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); 88 | return NULL; /* keep compiler happy */ 89 | } 90 | 91 | 92 | /* 93 | * Master selection of decompression modules for transcoding. 94 | * This substitutes for jdmaster.c's initialization of the full decompressor. 95 | */ 96 | 97 | LOCAL(void) 98 | transdecode_master_selection (j_decompress_ptr cinfo) 99 | { 100 | /* This is effectively a buffered-image operation. */ 101 | cinfo->buffered_image = TRUE; 102 | 103 | /* Compute output image dimensions and related values. */ 104 | jpeg_core_output_dimensions(cinfo); 105 | 106 | /* Entropy decoding: either Huffman or arithmetic coding. */ 107 | if (cinfo->arith_code) 108 | jinit_arith_decoder(cinfo); 109 | else { 110 | jinit_huff_decoder(cinfo); 111 | } 112 | 113 | /* Always get a full-image coefficient buffer. */ 114 | jinit_d_coef_controller(cinfo, TRUE); 115 | 116 | /* We can now tell the memory manager to allocate virtual arrays. */ 117 | (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); 118 | 119 | /* Initialize input side of decompressor to consume first scan. */ 120 | (*cinfo->inputctl->start_input_pass) (cinfo); 121 | 122 | /* Initialize progress monitoring. */ 123 | if (cinfo->progress != NULL) { 124 | int nscans; 125 | /* Estimate number of scans to set pass_limit. */ 126 | if (cinfo->progressive_mode) { 127 | /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */ 128 | nscans = 2 + 3 * cinfo->num_components; 129 | } else if (cinfo->inputctl->has_multiple_scans) { 130 | /* For a nonprogressive multiscan file, estimate 1 scan per component. */ 131 | nscans = cinfo->num_components; 132 | } else { 133 | nscans = 1; 134 | } 135 | cinfo->progress->pass_counter = 0L; 136 | cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans; 137 | cinfo->progress->completed_passes = 0; 138 | cinfo->progress->total_passes = 1; 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jfdctflt.c: -------------------------------------------------------------------------------- 1 | /* 2 | * jfdctflt.c 3 | * 4 | * Copyright (C) 1994-1996, Thomas G. Lane. 5 | * Modified 2003-2009 by Guido Vollbeding. 6 | * This file is part of the Independent JPEG Group's software. 7 | * For conditions of distribution and use, see the accompanying README file. 8 | * 9 | * This file contains a floating-point implementation of the 10 | * forward DCT (Discrete Cosine Transform). 11 | * 12 | * This implementation should be more accurate than either of the integer 13 | * DCT implementations. However, it may not give the same results on all 14 | * machines because of differences in roundoff behavior. Speed will depend 15 | * on the hardware's floating point capacity. 16 | * 17 | * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT 18 | * on each column. Direct algorithms are also available, but they are 19 | * much more complex and seem not to be any faster when reduced to code. 20 | * 21 | * This implementation is based on Arai, Agui, and Nakajima's algorithm for 22 | * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in 23 | * Japanese, but the algorithm is described in the Pennebaker & Mitchell 24 | * JPEG textbook (see REFERENCES section in file README). The following code 25 | * is based directly on figure 4-8 in P&M. 26 | * While an 8-point DCT cannot be done in less than 11 multiplies, it is 27 | * possible to arrange the computation so that many of the multiplies are 28 | * simple scalings of the final outputs. These multiplies can then be 29 | * folded into the multiplications or divisions by the JPEG quantization 30 | * table entries. The AA&N method leaves only 5 multiplies and 29 adds 31 | * to be done in the DCT itself. 32 | * The primary disadvantage of this method is that with a fixed-point 33 | * implementation, accuracy is lost due to imprecise representation of the 34 | * scaled quantization values. However, that problem does not arise if 35 | * we use floating point arithmetic. 36 | */ 37 | 38 | #define JPEG_INTERNALS 39 | #include "jinclude.h" 40 | #include "jpeglib.h" 41 | #include "jdct.h" /* Private declarations for DCT subsystem */ 42 | 43 | #ifdef DCT_FLOAT_SUPPORTED 44 | 45 | 46 | /* 47 | * This module is specialized to the case DCTSIZE = 8. 48 | */ 49 | 50 | #if DCTSIZE != 8 51 | Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ 52 | #endif 53 | 54 | 55 | /* 56 | * Perform the forward DCT on one block of samples. 57 | */ 58 | 59 | GLOBAL(void) 60 | jpeg_fdct_float (FAST_FLOAT * data, JSAMPARRAY sample_data, JDIMENSION start_col) 61 | { 62 | FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; 63 | FAST_FLOAT tmp10, tmp11, tmp12, tmp13; 64 | FAST_FLOAT z1, z2, z3, z4, z5, z11, z13; 65 | FAST_FLOAT *dataptr; 66 | JSAMPROW elemptr; 67 | int ctr; 68 | 69 | /* Pass 1: process rows. */ 70 | 71 | dataptr = data; 72 | for (ctr = 0; ctr < DCTSIZE; ctr++) { 73 | elemptr = sample_data[ctr] + start_col; 74 | 75 | /* Load data into workspace */ 76 | tmp0 = (FAST_FLOAT) (GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[7])); 77 | tmp7 = (FAST_FLOAT) (GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[7])); 78 | tmp1 = (FAST_FLOAT) (GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[6])); 79 | tmp6 = (FAST_FLOAT) (GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[6])); 80 | tmp2 = (FAST_FLOAT) (GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[5])); 81 | tmp5 = (FAST_FLOAT) (GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5])); 82 | tmp3 = (FAST_FLOAT) (GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[4])); 83 | tmp4 = (FAST_FLOAT) (GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4])); 84 | 85 | /* Even part */ 86 | 87 | tmp10 = tmp0 + tmp3; /* phase 2 */ 88 | tmp13 = tmp0 - tmp3; 89 | tmp11 = tmp1 + tmp2; 90 | tmp12 = tmp1 - tmp2; 91 | 92 | /* Apply unsigned->signed conversion */ 93 | dataptr[0] = tmp10 + tmp11 - 8 * CENTERJSAMPLE; /* phase 3 */ 94 | dataptr[4] = tmp10 - tmp11; 95 | 96 | z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */ 97 | dataptr[2] = tmp13 + z1; /* phase 5 */ 98 | dataptr[6] = tmp13 - z1; 99 | 100 | /* Odd part */ 101 | 102 | tmp10 = tmp4 + tmp5; /* phase 2 */ 103 | tmp11 = tmp5 + tmp6; 104 | tmp12 = tmp6 + tmp7; 105 | 106 | /* The rotator is modified from fig 4-8 to avoid extra negations. */ 107 | z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */ 108 | z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */ 109 | z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */ 110 | z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */ 111 | 112 | z11 = tmp7 + z3; /* phase 5 */ 113 | z13 = tmp7 - z3; 114 | 115 | dataptr[5] = z13 + z2; /* phase 6 */ 116 | dataptr[3] = z13 - z2; 117 | dataptr[1] = z11 + z4; 118 | dataptr[7] = z11 - z4; 119 | 120 | dataptr += DCTSIZE; /* advance pointer to next row */ 121 | } 122 | 123 | /* Pass 2: process columns. */ 124 | 125 | dataptr = data; 126 | for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { 127 | tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; 128 | tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; 129 | tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; 130 | tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; 131 | tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; 132 | tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; 133 | tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; 134 | tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; 135 | 136 | /* Even part */ 137 | 138 | tmp10 = tmp0 + tmp3; /* phase 2 */ 139 | tmp13 = tmp0 - tmp3; 140 | tmp11 = tmp1 + tmp2; 141 | tmp12 = tmp1 - tmp2; 142 | 143 | dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */ 144 | dataptr[DCTSIZE*4] = tmp10 - tmp11; 145 | 146 | z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */ 147 | dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */ 148 | dataptr[DCTSIZE*6] = tmp13 - z1; 149 | 150 | /* Odd part */ 151 | 152 | tmp10 = tmp4 + tmp5; /* phase 2 */ 153 | tmp11 = tmp5 + tmp6; 154 | tmp12 = tmp6 + tmp7; 155 | 156 | /* The rotator is modified from fig 4-8 to avoid extra negations. */ 157 | z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */ 158 | z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */ 159 | z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */ 160 | z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */ 161 | 162 | z11 = tmp7 + z3; /* phase 5 */ 163 | z13 = tmp7 - z3; 164 | 165 | dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */ 166 | dataptr[DCTSIZE*3] = z13 - z2; 167 | dataptr[DCTSIZE*1] = z11 + z4; 168 | dataptr[DCTSIZE*7] = z11 - z4; 169 | 170 | dataptr++; /* advance pointer to next column */ 171 | } 172 | } 173 | 174 | #endif /* DCT_FLOAT_SUPPORTED */ 175 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jinclude.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jinclude.h 3 | * 4 | * Copyright (C) 1991-1994, Thomas G. Lane. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file exists to provide a single place to fix any problems with 9 | * including the wrong system include files. (Common problems are taken 10 | * care of by the standard jconfig symbols, but on really weird systems 11 | * you may have to edit this file.) 12 | * 13 | * NOTE: this file is NOT intended to be included by applications using the 14 | * JPEG library. Most applications need only include jpeglib.h. 15 | */ 16 | 17 | 18 | /* Include auto-config file to find out which system include files we need. */ 19 | 20 | #include "jconfig.h" /* auto configuration options */ 21 | #define JCONFIG_INCLUDED /* so that jpeglib.h doesn't do it again */ 22 | 23 | /* 24 | * We need the NULL macro and size_t typedef. 25 | * On an ANSI-conforming system it is sufficient to include . 26 | * Otherwise, we get them from or ; we may have to 27 | * pull in as well. 28 | * Note that the core JPEG library does not require ; 29 | * only the default error handler and data source/destination modules do. 30 | * But we must pull it in because of the references to FILE in jpeglib.h. 31 | * You can remove those references if you want to compile without . 32 | */ 33 | 34 | #ifdef HAVE_STDDEF_H 35 | #include 36 | #endif 37 | 38 | #ifdef HAVE_STDLIB_H 39 | #include 40 | #endif 41 | 42 | #ifdef NEED_SYS_TYPES_H 43 | #include 44 | #endif 45 | 46 | #include 47 | 48 | /* 49 | * We need memory copying and zeroing functions, plus strncpy(). 50 | * ANSI and System V implementations declare these in . 51 | * BSD doesn't have the mem() functions, but it does have bcopy()/bzero(). 52 | * Some systems may declare memset and memcpy in . 53 | * 54 | * NOTE: we assume the size parameters to these functions are of type size_t. 55 | * Change the casts in these macros if not! 56 | */ 57 | 58 | #ifdef NEED_BSD_STRINGS 59 | 60 | #include 61 | #define MEMZERO(target,size) bzero((void *)(target), (size_t)(size)) 62 | #define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size)) 63 | 64 | #else /* not BSD, assume ANSI/SysV string lib */ 65 | 66 | #include 67 | #define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size)) 68 | #define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size)) 69 | 70 | #endif 71 | 72 | /* 73 | * In ANSI C, and indeed any rational implementation, size_t is also the 74 | * type returned by sizeof(). However, it seems there are some irrational 75 | * implementations out there, in which sizeof() returns an int even though 76 | * size_t is defined as long or unsigned long. To ensure consistent results 77 | * we always use this SIZEOF() macro in place of using sizeof() directly. 78 | */ 79 | 80 | #define SIZEOF(object) ((size_t) sizeof(object)) 81 | 82 | /* 83 | * The modules that use fread() and fwrite() always invoke them through 84 | * these macros. On some systems you may need to twiddle the argument casts. 85 | * CAUTION: argument order is different from underlying functions! 86 | */ 87 | 88 | #define JFREAD(file,buf,sizeofbuf) \ 89 | ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) 90 | #define JFWRITE(file,buf,sizeofbuf) \ 91 | ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) 92 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jmemansi.c: -------------------------------------------------------------------------------- 1 | /* 2 | * jmemansi.c 3 | * 4 | * Copyright (C) 1992-1996, Thomas G. Lane. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file provides a simple generic implementation of the system- 9 | * dependent portion of the JPEG memory manager. This implementation 10 | * assumes that you have the ANSI-standard library routine tmpfile(). 11 | * Also, the problem of determining the amount of memory available 12 | * is shoved onto the user. 13 | */ 14 | 15 | #define JPEG_INTERNALS 16 | #include "jinclude.h" 17 | #include "jpeglib.h" 18 | #include "jmemsys.h" /* import the system-dependent declarations */ 19 | 20 | #ifndef HAVE_STDLIB_H /* should declare malloc(),free() */ 21 | extern void * malloc JPP((size_t size)); 22 | extern void free JPP((void *ptr)); 23 | #endif 24 | 25 | #ifndef SEEK_SET /* pre-ANSI systems may not define this; */ 26 | #define SEEK_SET 0 /* if not, assume 0 is correct */ 27 | #endif 28 | 29 | 30 | /* 31 | * Memory allocation and freeing are controlled by the regular library 32 | * routines malloc() and free(). 33 | */ 34 | 35 | GLOBAL(void *) 36 | jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) 37 | { 38 | return (void *) malloc(sizeofobject); 39 | } 40 | 41 | GLOBAL(void) 42 | jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) 43 | { 44 | free(object); 45 | } 46 | 47 | 48 | /* 49 | * "Large" objects are treated the same as "small" ones. 50 | * NB: although we include FAR keywords in the routine declarations, 51 | * this file won't actually work in 80x86 small/medium model; at least, 52 | * you probably won't be able to process useful-size images in only 64KB. 53 | */ 54 | 55 | GLOBAL(void FAR *) 56 | jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject) 57 | { 58 | return (void FAR *) malloc(sizeofobject); 59 | } 60 | 61 | GLOBAL(void) 62 | jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) 63 | { 64 | free(object); 65 | } 66 | 67 | 68 | /* 69 | * This routine computes the total memory space available for allocation. 70 | * It's impossible to do this in a portable way; our current solution is 71 | * to make the user tell us (with a default value set at compile time). 72 | * If you can actually get the available space, it's a good idea to subtract 73 | * a slop factor of 5% or so. 74 | */ 75 | 76 | #ifndef DEFAULT_MAX_MEM /* so can override from makefile */ 77 | #define DEFAULT_MAX_MEM 1000000L /* default: one megabyte */ 78 | #endif 79 | 80 | GLOBAL(long) 81 | jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, 82 | long max_bytes_needed, long already_allocated) 83 | { 84 | return cinfo->mem->max_memory_to_use - already_allocated; 85 | } 86 | 87 | 88 | /* 89 | * Backing store (temporary file) management. 90 | * Backing store objects are only used when the value returned by 91 | * jpeg_mem_available is less than the total space needed. You can dispense 92 | * with these routines if you have plenty of virtual memory; see jmemnobs.c. 93 | */ 94 | 95 | 96 | METHODDEF(void) 97 | read_backing_store (j_common_ptr cinfo, backing_store_ptr info, 98 | void FAR * buffer_address, 99 | long file_offset, long byte_count) 100 | { 101 | if (fseek(info->temp_file, file_offset, SEEK_SET)) 102 | ERREXIT(cinfo, JERR_TFILE_SEEK); 103 | if (JFREAD(info->temp_file, buffer_address, byte_count) 104 | != (size_t) byte_count) 105 | ERREXIT(cinfo, JERR_TFILE_READ); 106 | } 107 | 108 | 109 | METHODDEF(void) 110 | write_backing_store (j_common_ptr cinfo, backing_store_ptr info, 111 | void FAR * buffer_address, 112 | long file_offset, long byte_count) 113 | { 114 | if (fseek(info->temp_file, file_offset, SEEK_SET)) 115 | ERREXIT(cinfo, JERR_TFILE_SEEK); 116 | if (JFWRITE(info->temp_file, buffer_address, byte_count) 117 | != (size_t) byte_count) 118 | ERREXIT(cinfo, JERR_TFILE_WRITE); 119 | } 120 | 121 | 122 | METHODDEF(void) 123 | close_backing_store (j_common_ptr cinfo, backing_store_ptr info) 124 | { 125 | fclose(info->temp_file); 126 | /* Since this implementation uses tmpfile() to create the file, 127 | * no explicit file deletion is needed. 128 | */ 129 | } 130 | 131 | 132 | /* 133 | * Initial opening of a backing-store object. 134 | * 135 | * This version uses tmpfile(), which constructs a suitable file name 136 | * behind the scenes. We don't have to use info->temp_name[] at all; 137 | * indeed, we can't even find out the actual name of the temp file. 138 | */ 139 | 140 | GLOBAL(void) 141 | jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info, 142 | long total_bytes_needed) 143 | { 144 | if ((info->temp_file = tmpfile()) == NULL) 145 | ERREXITS(cinfo, JERR_TFILE_CREATE, ""); 146 | info->read_backing_store = read_backing_store; 147 | info->write_backing_store = write_backing_store; 148 | info->close_backing_store = close_backing_store; 149 | } 150 | 151 | 152 | /* 153 | * These routines take care of any system-dependent initialization and 154 | * cleanup required. 155 | */ 156 | 157 | GLOBAL(long) 158 | jpeg_mem_init (j_common_ptr cinfo) 159 | { 160 | return DEFAULT_MAX_MEM; /* default for max_memory_to_use */ 161 | } 162 | 163 | GLOBAL(void) 164 | jpeg_mem_term (j_common_ptr cinfo) 165 | { 166 | /* no work */ 167 | } 168 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jmemnobs.c: -------------------------------------------------------------------------------- 1 | /* 2 | * jmemnobs.c 3 | * 4 | * Copyright (C) 1992-1996, Thomas G. Lane. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file provides a really simple implementation of the system- 9 | * dependent portion of the JPEG memory manager. This implementation 10 | * assumes that no backing-store files are needed: all required space 11 | * can be obtained from malloc(). 12 | * This is very portable in the sense that it'll compile on almost anything, 13 | * but you'd better have lots of main memory (or virtual memory) if you want 14 | * to process big images. 15 | * Note that the max_memory_to_use option is ignored by this implementation. 16 | */ 17 | 18 | #define JPEG_INTERNALS 19 | #include "jinclude.h" 20 | #include "jpeglib.h" 21 | #include "jmemsys.h" /* import the system-dependent declarations */ 22 | 23 | #ifndef HAVE_STDLIB_H /* should declare malloc(),free() */ 24 | extern void * malloc JPP((size_t size)); 25 | extern void free JPP((void *ptr)); 26 | #endif 27 | 28 | 29 | /* 30 | * Memory allocation and freeing are controlled by the regular library 31 | * routines malloc() and free(). 32 | */ 33 | 34 | GLOBAL(void *) 35 | jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) 36 | { 37 | return (void *) malloc(sizeofobject); 38 | } 39 | 40 | GLOBAL(void) 41 | jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) 42 | { 43 | free(object); 44 | } 45 | 46 | 47 | /* 48 | * "Large" objects are treated the same as "small" ones. 49 | * NB: although we include FAR keywords in the routine declarations, 50 | * this file won't actually work in 80x86 small/medium model; at least, 51 | * you probably won't be able to process useful-size images in only 64KB. 52 | */ 53 | 54 | GLOBAL(void FAR *) 55 | jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject) 56 | { 57 | return (void FAR *) malloc(sizeofobject); 58 | } 59 | 60 | GLOBAL(void) 61 | jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) 62 | { 63 | free(object); 64 | } 65 | 66 | 67 | /* 68 | * This routine computes the total memory space available for allocation. 69 | * Here we always say, "we got all you want bud!" 70 | */ 71 | 72 | GLOBAL(long) 73 | jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, 74 | long max_bytes_needed, long already_allocated) 75 | { 76 | return max_bytes_needed; 77 | } 78 | 79 | 80 | /* 81 | * Backing store (temporary file) management. 82 | * Since jpeg_mem_available always promised the moon, 83 | * this should never be called and we can just error out. 84 | */ 85 | 86 | GLOBAL(void) 87 | jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info, 88 | long total_bytes_needed) 89 | { 90 | ERREXIT(cinfo, JERR_NO_BACKING_STORE); 91 | } 92 | 93 | 94 | /* 95 | * These routines take care of any system-dependent initialization and 96 | * cleanup required. Here, there isn't any. 97 | */ 98 | 99 | GLOBAL(long) 100 | jpeg_mem_init (j_common_ptr cinfo) 101 | { 102 | return 0; /* just set max_memory_to_use to 0 */ 103 | } 104 | 105 | GLOBAL(void) 106 | jpeg_mem_term (j_common_ptr cinfo) 107 | { 108 | /* no work */ 109 | } 110 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jutils.c: -------------------------------------------------------------------------------- 1 | /* 2 | * jutils.c 3 | * 4 | * Copyright (C) 1991-1996, Thomas G. Lane. 5 | * Modified 2009-2011 by Guido Vollbeding. 6 | * This file is part of the Independent JPEG Group's software. 7 | * For conditions of distribution and use, see the accompanying README file. 8 | * 9 | * This file contains tables and miscellaneous utility routines needed 10 | * for both compression and decompression. 11 | * Note we prefix all global names with "j" to minimize conflicts with 12 | * a surrounding application. 13 | */ 14 | 15 | #define JPEG_INTERNALS 16 | #include "jinclude.h" 17 | #include "jpeglib.h" 18 | 19 | 20 | /* 21 | * jpeg_zigzag_order[i] is the zigzag-order position of the i'th element 22 | * of a DCT block read in natural order (left to right, top to bottom). 23 | */ 24 | 25 | #if 0 /* This table is not actually needed in v6a */ 26 | 27 | const int jpeg_zigzag_order[DCTSIZE2] = { 28 | 0, 1, 5, 6, 14, 15, 27, 28, 29 | 2, 4, 7, 13, 16, 26, 29, 42, 30 | 3, 8, 12, 17, 25, 30, 41, 43, 31 | 9, 11, 18, 24, 31, 40, 44, 53, 32 | 10, 19, 23, 32, 39, 45, 52, 54, 33 | 20, 22, 33, 38, 46, 51, 55, 60, 34 | 21, 34, 37, 47, 50, 56, 59, 61, 35 | 35, 36, 48, 49, 57, 58, 62, 63 36 | }; 37 | 38 | #endif 39 | 40 | /* 41 | * jpeg_natural_order[i] is the natural-order position of the i'th element 42 | * of zigzag order. 43 | * 44 | * When reading corrupted data, the Huffman decoders could attempt 45 | * to reference an entry beyond the end of this array (if the decoded 46 | * zero run length reaches past the end of the block). To prevent 47 | * wild stores without adding an inner-loop test, we put some extra 48 | * "63"s after the real entries. This will cause the extra coefficient 49 | * to be stored in location 63 of the block, not somewhere random. 50 | * The worst case would be a run-length of 15, which means we need 16 51 | * fake entries. 52 | */ 53 | 54 | const int jpeg_natural_order[DCTSIZE2+16] = { 55 | 0, 1, 8, 16, 9, 2, 3, 10, 56 | 17, 24, 32, 25, 18, 11, 4, 5, 57 | 12, 19, 26, 33, 40, 48, 41, 34, 58 | 27, 20, 13, 6, 7, 14, 21, 28, 59 | 35, 42, 49, 56, 57, 50, 43, 36, 60 | 29, 22, 15, 23, 30, 37, 44, 51, 61 | 58, 59, 52, 45, 38, 31, 39, 46, 62 | 53, 60, 61, 54, 47, 55, 62, 63, 63 | 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */ 64 | 63, 63, 63, 63, 63, 63, 63, 63 65 | }; 66 | 67 | const int jpeg_natural_order7[7*7+16] = { 68 | 0, 1, 8, 16, 9, 2, 3, 10, 69 | 17, 24, 32, 25, 18, 11, 4, 5, 70 | 12, 19, 26, 33, 40, 48, 41, 34, 71 | 27, 20, 13, 6, 14, 21, 28, 35, 72 | 42, 49, 50, 43, 36, 29, 22, 30, 73 | 37, 44, 51, 52, 45, 38, 46, 53, 74 | 54, 75 | 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */ 76 | 63, 63, 63, 63, 63, 63, 63, 63 77 | }; 78 | 79 | const int jpeg_natural_order6[6*6+16] = { 80 | 0, 1, 8, 16, 9, 2, 3, 10, 81 | 17, 24, 32, 25, 18, 11, 4, 5, 82 | 12, 19, 26, 33, 40, 41, 34, 27, 83 | 20, 13, 21, 28, 35, 42, 43, 36, 84 | 29, 37, 44, 45, 85 | 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */ 86 | 63, 63, 63, 63, 63, 63, 63, 63 87 | }; 88 | 89 | const int jpeg_natural_order5[5*5+16] = { 90 | 0, 1, 8, 16, 9, 2, 3, 10, 91 | 17, 24, 32, 25, 18, 11, 4, 12, 92 | 19, 26, 33, 34, 27, 20, 28, 35, 93 | 36, 94 | 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */ 95 | 63, 63, 63, 63, 63, 63, 63, 63 96 | }; 97 | 98 | const int jpeg_natural_order4[4*4+16] = { 99 | 0, 1, 8, 16, 9, 2, 3, 10, 100 | 17, 24, 25, 18, 11, 19, 26, 27, 101 | 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */ 102 | 63, 63, 63, 63, 63, 63, 63, 63 103 | }; 104 | 105 | const int jpeg_natural_order3[3*3+16] = { 106 | 0, 1, 8, 16, 9, 2, 10, 17, 107 | 18, 108 | 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */ 109 | 63, 63, 63, 63, 63, 63, 63, 63 110 | }; 111 | 112 | const int jpeg_natural_order2[2*2+16] = { 113 | 0, 1, 8, 9, 114 | 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */ 115 | 63, 63, 63, 63, 63, 63, 63, 63 116 | }; 117 | 118 | 119 | /* 120 | * Arithmetic utilities 121 | */ 122 | 123 | GLOBAL(long) 124 | jdiv_round_up (long a, long b) 125 | /* Compute a/b rounded up to next integer, ie, ceil(a/b) */ 126 | /* Assumes a >= 0, b > 0 */ 127 | { 128 | return (a + b - 1L) / b; 129 | } 130 | 131 | 132 | GLOBAL(long) 133 | jround_up (long a, long b) 134 | /* Compute a rounded up to next multiple of b, ie, ceil(a/b)*b */ 135 | /* Assumes a >= 0, b > 0 */ 136 | { 137 | a += b - 1L; 138 | return a - (a % b); 139 | } 140 | 141 | 142 | /* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays 143 | * and coefficient-block arrays. This won't work on 80x86 because the arrays 144 | * are FAR and we're assuming a small-pointer memory model. However, some 145 | * DOS compilers provide far-pointer versions of memcpy() and memset() even 146 | * in the small-model libraries. These will be used if USE_FMEM is defined. 147 | * Otherwise, the routines below do it the hard way. (The performance cost 148 | * is not all that great, because these routines aren't very heavily used.) 149 | */ 150 | 151 | #ifndef NEED_FAR_POINTERS /* normal case, same as regular macro */ 152 | #define FMEMCOPY(dest,src,size) MEMCOPY(dest,src,size) 153 | #else /* 80x86 case, define if we can */ 154 | #ifdef USE_FMEM 155 | #define FMEMCOPY(dest,src,size) _fmemcpy((void FAR *)(dest), (const void FAR *)(src), (size_t)(size)) 156 | #else 157 | /* This function is for use by the FMEMZERO macro defined in jpegint.h. 158 | * Do not call this function directly, use the FMEMZERO macro instead. 159 | */ 160 | GLOBAL(void) 161 | jzero_far (void FAR * target, size_t bytestozero) 162 | /* Zero out a chunk of FAR memory. */ 163 | /* This might be sample-array data, block-array data, or alloc_large data. */ 164 | { 165 | register char FAR * ptr = (char FAR *) target; 166 | register size_t count; 167 | 168 | for (count = bytestozero; count > 0; count--) { 169 | *ptr++ = 0; 170 | } 171 | } 172 | #endif 173 | #endif 174 | 175 | 176 | GLOBAL(void) 177 | jcopy_sample_rows (JSAMPARRAY input_array, int source_row, 178 | JSAMPARRAY output_array, int dest_row, 179 | int num_rows, JDIMENSION num_cols) 180 | /* Copy some rows of samples from one place to another. 181 | * num_rows rows are copied from input_array[source_row++] 182 | * to output_array[dest_row++]; these areas may overlap for duplication. 183 | * The source and destination arrays must be at least as wide as num_cols. 184 | */ 185 | { 186 | register JSAMPROW inptr, outptr; 187 | #ifdef FMEMCOPY 188 | register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE)); 189 | #else 190 | register JDIMENSION count; 191 | #endif 192 | register int row; 193 | 194 | input_array += source_row; 195 | output_array += dest_row; 196 | 197 | for (row = num_rows; row > 0; row--) { 198 | inptr = *input_array++; 199 | outptr = *output_array++; 200 | #ifdef FMEMCOPY 201 | FMEMCOPY(outptr, inptr, count); 202 | #else 203 | for (count = num_cols; count > 0; count--) 204 | *outptr++ = *inptr++; /* needn't bother with GETJSAMPLE() here */ 205 | #endif 206 | } 207 | } 208 | 209 | 210 | GLOBAL(void) 211 | jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row, 212 | JDIMENSION num_blocks) 213 | /* Copy a row of coefficient blocks from one place to another. */ 214 | { 215 | #ifdef FMEMCOPY 216 | FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF))); 217 | #else 218 | register JCOEFPTR inptr, outptr; 219 | register long count; 220 | 221 | inptr = (JCOEFPTR) input_row; 222 | outptr = (JCOEFPTR) output_row; 223 | for (count = (long) num_blocks * DCTSIZE2; count > 0; count--) { 224 | *outptr++ = *inptr++; 225 | } 226 | #endif 227 | } 228 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/jversion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jversion.h 3 | * 4 | * Copyright (C) 1991-2014, Thomas G. Lane, Guido Vollbeding. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file contains software version identification. 9 | */ 10 | 11 | 12 | #define JVERSION "9a 19-Jan-2014" 13 | 14 | #define JCOPYRIGHT "Copyright (C) 2014, Thomas G. Lane, Guido Vollbeding" 15 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/libjpeg.map: -------------------------------------------------------------------------------- 1 | LIBJPEG_9.0 { 2 | global: 3 | *; 4 | }; 5 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makcjpeg.st: -------------------------------------------------------------------------------- 1 | ; Project file for Independent JPEG Group's software 2 | ; 3 | ; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C. 4 | ; Thanks to Frank Moehle, B. Setzepfandt, and Guido Vollbeding. 5 | ; 6 | ; To use this file, rename it to cjpeg.prj. 7 | ; If you are using Turbo C, change filenames beginning with "pc..." to "tc..." 8 | ; Read installation instructions before trying to make the program! 9 | ; 10 | ; 11 | ; * * * Output file * * * 12 | cjpeg.ttp 13 | ; 14 | ; * * * COMPILER OPTIONS * * * 15 | .C[-P] ; absolute calls 16 | .C[-M] ; and no string merging, folks 17 | .C[-w-cln] ; no "constant is long" warnings 18 | .C[-w-par] ; no "parameter xxxx unused" 19 | .C[-w-rch] ; no "unreachable code" 20 | .C[-wsig] ; warn if significant digits may be lost 21 | = 22 | ; * * * * List of modules * * * * 23 | pcstart.o 24 | cjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h,jversion.h) 25 | cdjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 26 | rdswitch.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 27 | rdppm.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 28 | rdgif.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 29 | rdtarga.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 30 | rdbmp.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 31 | rdrle.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 32 | libjpeg.lib ; built by libjpeg.prj 33 | pcfltlib.lib ; floating point library 34 | ; the float library can be omitted if you've turned off DCT_FLOAT_SUPPORTED 35 | pcstdlib.lib ; standard library 36 | pcextlib.lib ; extended library 37 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makdjpeg.st: -------------------------------------------------------------------------------- 1 | ; Project file for Independent JPEG Group's software 2 | ; 3 | ; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C. 4 | ; Thanks to Frank Moehle, B. Setzepfandt, and Guido Vollbeding. 5 | ; 6 | ; To use this file, rename it to djpeg.prj. 7 | ; If you are using Turbo C, change filenames beginning with "pc..." to "tc..." 8 | ; Read installation instructions before trying to make the program! 9 | ; 10 | ; 11 | ; * * * Output file * * * 12 | djpeg.ttp 13 | ; 14 | ; * * * COMPILER OPTIONS * * * 15 | .C[-P] ; absolute calls 16 | .C[-M] ; and no string merging, folks 17 | .C[-w-cln] ; no "constant is long" warnings 18 | .C[-w-par] ; no "parameter xxxx unused" 19 | .C[-w-rch] ; no "unreachable code" 20 | .C[-wsig] ; warn if significant digits may be lost 21 | = 22 | ; * * * * List of modules * * * * 23 | pcstart.o 24 | djpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h,jversion.h) 25 | cdjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 26 | rdcolmap.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 27 | wrppm.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 28 | wrgif.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 29 | wrtarga.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 30 | wrbmp.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 31 | wrrle.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 32 | libjpeg.lib ; built by libjpeg.prj 33 | pcfltlib.lib ; floating point library 34 | ; the float library can be omitted if you've turned off DCT_FLOAT_SUPPORTED 35 | pcstdlib.lib ; standard library 36 | pcextlib.lib ; extended library 37 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makeadsw.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/makeadsw.vc6 -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makeasln.v10: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual C++ Express 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cjpeg", "cjpeg.vcxproj", "{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "djpeg", "djpeg.vcxproj", "{11043137-B453-4DFA-9010-4D2B9DC1545C}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jpegtran", "jpegtran.vcxproj", "{025BAC50-51B5-4FFE-BC47-3F920BB4047E}" 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rdjpgcom", "rdjpgcom.vcxproj", "{C81513DB-78DC-46BC-BC98-82E745203976}" 11 | EndProject 12 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wrjpgcom", "wrjpgcom.vcxproj", "{B57065D4-DDDA-4668-BAF5-2D49270C973C}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Release|Win32 = Release|Win32 17 | EndGlobalSection 18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 19 | {2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|Win32.ActiveCfg = Release|Win32 20 | {2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|Win32.Build.0 = Release|Win32 21 | {11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|Win32.ActiveCfg = Release|Win32 22 | {11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|Win32.Build.0 = Release|Win32 23 | {025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|Win32.ActiveCfg = Release|Win32 24 | {025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|Win32.Build.0 = Release|Win32 25 | {C81513DB-78DC-46BC-BC98-82E745203976}.Release|Win32.ActiveCfg = Release|Win32 26 | {C81513DB-78DC-46BC-BC98-82E745203976}.Release|Win32.Build.0 = Release|Win32 27 | {B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|Win32.ActiveCfg = Release|Win32 28 | {B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|Win32.Build.0 = Release|Win32 29 | EndGlobalSection 30 | GlobalSection(SolutionProperties) = preSolution 31 | HideSolutionNode = FALSE 32 | EndGlobalSection 33 | EndGlobal 34 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makecdep.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/makecdep.vc6 -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makecdsp.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/makecdsp.vc6 -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makecfil.v10: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | Header Files 35 | 36 | 37 | Header Files 38 | 39 | 40 | Header Files 41 | 42 | 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | Source Files 55 | 56 | 57 | Source Files 58 | 59 | 60 | Source Files 61 | 62 | 63 | Source Files 64 | 65 | 66 | Source Files 67 | 68 | 69 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makecmak.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/makecmak.vc6 -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makecvcx.v10: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Release 6 | Win32 7 | 8 | 9 | 10 | {2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57} 11 | Win32Proj 12 | cjpeg 13 | 14 | 15 | 16 | Application 17 | false 18 | true 19 | Unicode 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | false 30 | $(ProjectName)\$(Configuration)\ 31 | $(ProjectName)\$(Configuration)\ 32 | 33 | 34 | 35 | Level3 36 | NotUsing 37 | Full 38 | true 39 | false 40 | WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS 41 | true 42 | true 43 | 4996 44 | 45 | 46 | Console 47 | true 48 | true 49 | true 50 | Release\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makeddep.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/makeddep.vc6 -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makeddsp.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/makeddsp.vc6 -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makedfil.v10: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | Header Files 35 | 36 | 37 | Header Files 38 | 39 | 40 | Header Files 41 | 42 | 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | Source Files 55 | 56 | 57 | Source Files 58 | 59 | 60 | Source Files 61 | 62 | 63 | Source Files 64 | 65 | 66 | Source Files 67 | 68 | 69 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makedmak.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/makedmak.vc6 -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makedvcx.v10: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Release 6 | Win32 7 | 8 | 9 | 10 | {11043137-B453-4DFA-9010-4D2B9DC1545C} 11 | Win32Proj 12 | djpeg 13 | 14 | 15 | 16 | Application 17 | false 18 | true 19 | Unicode 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | false 30 | $(ProjectName)\$(Configuration)\ 31 | $(ProjectName)\$(Configuration)\ 32 | 33 | 34 | 35 | Level3 36 | NotUsing 37 | Full 38 | true 39 | false 40 | WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS 41 | true 42 | true 43 | 4996 44 | 45 | 46 | Console 47 | true 48 | true 49 | true 50 | Release\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makefile.vms: -------------------------------------------------------------------------------- 1 | $! Makefile for Independent JPEG Group's software 2 | $! 3 | $! This is a command procedure for Digital VMS systems that do not have MMS. 4 | $! It builds the JPEG software by brute force, recompiling everything whether 5 | $! or not it is necessary. It then runs the basic self-test. 6 | $! Thanks to Rick Dyson (dyson@iowasp.physics.uiowa.edu) 7 | $! and Tim Bell (tbell@netcom.com) for their help. 8 | $! 9 | $! Read installation instructions before running this!! 10 | $! 11 | $ If F$Mode () .eqs. "INTERACTIVE" 12 | $ Then 13 | $ VERIFY = F$Verify (0) 14 | $ Else 15 | $ VERIFY = F$Verify (1) 16 | $ EndIf 17 | $ On Control_Y Then GoTo End 18 | $ On Error Then GoTo End 19 | $ 20 | $ If F$GetSyi ("HW_MODEL") .gt. 1023 21 | $ Then 22 | $ OPT = "" 23 | $ Else 24 | $ OPT = ",Sys$Disk:[]makvms.opt/Option" 25 | $ EndIf 26 | $ 27 | $ DoCompile := CC /NoDebug /Optimize /NoList 28 | $! 29 | $ DoCompile jaricom.c 30 | $ DoCompile jcapimin.c 31 | $ DoCompile jcapistd.c 32 | $ DoCompile jcarith.c 33 | $ DoCompile jctrans.c 34 | $ DoCompile jcparam.c 35 | $ DoCompile jdatadst.c 36 | $ DoCompile jcinit.c 37 | $ DoCompile jcmaster.c 38 | $ DoCompile jcmarker.c 39 | $ DoCompile jcmainct.c 40 | $ DoCompile jcprepct.c 41 | $ DoCompile jccoefct.c 42 | $ DoCompile jccolor.c 43 | $ DoCompile jcsample.c 44 | $ DoCompile jchuff.c 45 | $ DoCompile jcdctmgr.c 46 | $ DoCompile jfdctfst.c 47 | $ DoCompile jfdctflt.c 48 | $ DoCompile jfdctint.c 49 | $ DoCompile jdapimin.c 50 | $ DoCompile jdapistd.c 51 | $ DoCompile jdarith.c 52 | $ DoCompile jdtrans.c 53 | $ DoCompile jdatasrc.c 54 | $ DoCompile jdmaster.c 55 | $ DoCompile jdinput.c 56 | $ DoCompile jdmarker.c 57 | $ DoCompile jdhuff.c 58 | $ DoCompile jdmainct.c 59 | $ DoCompile jdcoefct.c 60 | $ DoCompile jdpostct.c 61 | $ DoCompile jddctmgr.c 62 | $ DoCompile jidctfst.c 63 | $ DoCompile jidctflt.c 64 | $ DoCompile jidctint.c 65 | $ DoCompile jdsample.c 66 | $ DoCompile jdcolor.c 67 | $ DoCompile jquant1.c 68 | $ DoCompile jquant2.c 69 | $ DoCompile jdmerge.c 70 | $ DoCompile jcomapi.c 71 | $ DoCompile jutils.c 72 | $ DoCompile jerror.c 73 | $ DoCompile jmemmgr.c 74 | $ DoCompile jmemnobs.c 75 | $! 76 | $ Library /Create libjpeg.olb jaricom.obj,jcapimin.obj,jcapistd.obj, - 77 | jcarith.obj,jctrans.obj,jcparam.obj,jdatadst.obj,jcinit.obj, - 78 | jcmaster.obj,jcmarker.obj,jcmainct.obj,jcprepct.obj,jccoefct.obj, - 79 | jccolor.obj,jcsample.obj,jchuff.obj,jcdctmgr.obj,jfdctfst.obj, - 80 | jfdctflt.obj,jfdctint.obj,jdapimin.obj,jdapistd.obj,jdarith.obj, - 81 | jdtrans.obj,jdatasrc.obj,jdmaster.obj,jdinput.obj,jdmarker.obj, - 82 | jdhuff.obj,jdmainct.obj,jdcoefct.obj,jdpostct.obj,jddctmgr.obj, - 83 | jidctfst.obj,jidctflt.obj,jidctint.obj,jdsample.obj,jdcolor.obj, - 84 | jquant1.obj,jquant2.obj,jdmerge.obj,jcomapi.obj,jutils.obj, - 85 | jerror.obj,jmemmgr.obj,jmemnobs.obj 86 | $! 87 | $ DoCompile cjpeg.c 88 | $ DoCompile rdppm.c 89 | $ DoCompile rdgif.c 90 | $ DoCompile rdtarga.c 91 | $ DoCompile rdrle.c 92 | $ DoCompile rdbmp.c 93 | $ DoCompile rdswitch.c 94 | $ DoCompile cdjpeg.c 95 | $! 96 | $ Link /NoMap /Executable = cjpeg.exe cjpeg.obj,rdppm.obj,rdgif.obj, - 97 | rdtarga.obj,rdrle.obj,rdbmp.obj,rdswitch.obj,cdjpeg.obj,libjpeg.olb/Library'OPT' 98 | $! 99 | $ DoCompile djpeg.c 100 | $ DoCompile wrppm.c 101 | $ DoCompile wrgif.c 102 | $ DoCompile wrtarga.c 103 | $ DoCompile wrrle.c 104 | $ DoCompile wrbmp.c 105 | $ DoCompile rdcolmap.c 106 | $ DoCompile cdjpeg.c 107 | $! 108 | $ Link /NoMap /Executable = djpeg.exe djpeg.obj,wrppm.obj,wrgif.obj, - 109 | wrtarga.obj,wrrle.obj,wrbmp.obj,rdcolmap.obj,cdjpeg.obj,libjpeg.olb/Library'OPT' 110 | $! 111 | $ DoCompile jpegtran.c 112 | $ DoCompile rdswitch.c 113 | $ DoCompile cdjpeg.c 114 | $ DoCompile transupp.c 115 | $! 116 | $ Link /NoMap /Executable = jpegtran.exe jpegtran.obj,rdswitch.obj, - 117 | cdjpeg.obj,transupp.obj,libjpeg.olb/Library'OPT' 118 | $! 119 | $ DoCompile rdjpgcom.c 120 | $ Link /NoMap /Executable = rdjpgcom.exe rdjpgcom.obj'OPT' 121 | $! 122 | $ DoCompile wrjpgcom.c 123 | $ Link /NoMap /Executable = wrjpgcom.exe wrjpgcom.obj'OPT' 124 | $! 125 | $! Run the self-test 126 | $! 127 | $ mcr sys$disk:[]djpeg -dct int -ppm -outfile testout.ppm testorig.jpg 128 | $ mcr sys$disk:[]djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg 129 | $ mcr sys$disk:[]cjpeg -dct int -outfile testout.jpg testimg.ppm 130 | $ mcr sys$disk:[]djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg 131 | $ mcr sys$disk:[]cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm 132 | $ mcr sys$disk:[]jpegtran -outfile testoutt.jpg testprog.jpg 133 | $ Backup /Compare/Log testimg.ppm testout.ppm 134 | $ Backup /Compare/Log testimg.bmp testout.bmp 135 | $ Backup /Compare/Log testimg.jpg testout.jpg 136 | $ Backup /Compare/Log testimg.ppm testoutp.ppm 137 | $ Backup /Compare/Log testimgp.jpg testoutp.jpg 138 | $ Backup /Compare/Log testorig.jpg testoutt.jpg 139 | $! 140 | $End: 141 | $ If Verify Then Set Verify 142 | $ Exit 143 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makejdep.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/makejdep.vc6 -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makejdsp.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/makejdsp.vc6 -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makejdsw.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/makejdsw.vc6 -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makejfil.v10: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | Header Files 35 | 36 | 37 | Header Files 38 | 39 | 40 | Header Files 41 | 42 | 43 | Header Files 44 | 45 | 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | Source Files 55 | 56 | 57 | Source Files 58 | 59 | 60 | Source Files 61 | 62 | 63 | Source Files 64 | 65 | 66 | Source Files 67 | 68 | 69 | Source Files 70 | 71 | 72 | Source Files 73 | 74 | 75 | Source Files 76 | 77 | 78 | Source Files 79 | 80 | 81 | Source Files 82 | 83 | 84 | Source Files 85 | 86 | 87 | Source Files 88 | 89 | 90 | Source Files 91 | 92 | 93 | Source Files 94 | 95 | 96 | Source Files 97 | 98 | 99 | Source Files 100 | 101 | 102 | Source Files 103 | 104 | 105 | Source Files 106 | 107 | 108 | Source Files 109 | 110 | 111 | Source Files 112 | 113 | 114 | Source Files 115 | 116 | 117 | Source Files 118 | 119 | 120 | Source Files 121 | 122 | 123 | Source Files 124 | 125 | 126 | Source Files 127 | 128 | 129 | Source Files 130 | 131 | 132 | Source Files 133 | 134 | 135 | Source Files 136 | 137 | 138 | Source Files 139 | 140 | 141 | Source Files 142 | 143 | 144 | Source Files 145 | 146 | 147 | Source Files 148 | 149 | 150 | Source Files 151 | 152 | 153 | Source Files 154 | 155 | 156 | Source Files 157 | 158 | 159 | Source Files 160 | 161 | 162 | Source Files 163 | 164 | 165 | Source Files 166 | 167 | 168 | Source Files 169 | 170 | 171 | Source Files 172 | 173 | 174 | Source Files 175 | 176 | 177 | Source Files 178 | 179 | 180 | Source Files 181 | 182 | 183 | Source Files 184 | 185 | 186 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makejmak.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/makejmak.vc6 -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makejsln.v10: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual C++ Express 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jpeg", "jpeg.vcxproj", "{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Release|Win32 = Release|Win32 9 | EndGlobalSection 10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 11 | {019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|Win32.ActiveCfg = Release|Win32 12 | {019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|Win32.Build.0 = Release|Win32 13 | EndGlobalSection 14 | GlobalSection(SolutionProperties) = preSolution 15 | HideSolutionNode = FALSE 16 | EndGlobalSection 17 | EndGlobal 18 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makejvcx.v10: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Release 6 | Win32 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | Disabled 67 | false 68 | 69 | 70 | 71 | 72 | {019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1} 73 | Win32Proj 74 | jpeg 75 | 76 | 77 | 78 | StaticLibrary 79 | false 80 | true 81 | Unicode 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | Level3 94 | NotUsing 95 | Full 96 | true 97 | false 98 | WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS 99 | true 100 | true 101 | 102 | 103 | Windows 104 | true 105 | true 106 | true 107 | 108 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makerdep.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/makerdep.vc6 -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makerdsp.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/makerdsp.vc6 -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makerfil.v10: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | 26 | 27 | Source Files 28 | 29 | 30 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makermak.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/makermak.vc6 -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makervcx.v10: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Release 6 | Win32 7 | 8 | 9 | 10 | {C81513DB-78DC-46BC-BC98-82E745203976} 11 | Win32Proj 12 | rdjpgcom 13 | 14 | 15 | 16 | Application 17 | false 18 | true 19 | Unicode 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | false 30 | $(ProjectName)\$(Configuration)\ 31 | $(ProjectName)\$(Configuration)\ 32 | 33 | 34 | 35 | Level3 36 | NotUsing 37 | Full 38 | true 39 | false 40 | WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS 41 | true 42 | true 43 | 4996 44 | 45 | 46 | Console 47 | true 48 | true 49 | true 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/maketdep.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/maketdep.vc6 -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/maketdsp.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/maketdsp.vc6 -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/maketfil.v10: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | Header Files 35 | 36 | 37 | Header Files 38 | 39 | 40 | Header Files 41 | 42 | 43 | Header Files 44 | 45 | 46 | Header Files 47 | 48 | 49 | 50 | 51 | Source Files 52 | 53 | 54 | Source Files 55 | 56 | 57 | Source Files 58 | 59 | 60 | Source Files 61 | 62 | 63 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/maketmak.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/maketmak.vc6 -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/maketvcx.v10: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Release 6 | Win32 7 | 8 | 9 | 10 | {025BAC50-51B5-4FFE-BC47-3F920BB4047E} 11 | Win32Proj 12 | jpegtran 13 | 14 | 15 | 16 | Application 17 | false 18 | true 19 | Unicode 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | false 30 | $(ProjectName)\$(Configuration)\ 31 | $(ProjectName)\$(Configuration)\ 32 | 33 | 34 | 35 | Level3 36 | NotUsing 37 | Full 38 | true 39 | false 40 | WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS 41 | true 42 | true 43 | 4996 44 | 45 | 46 | Console 47 | true 48 | true 49 | true 50 | Release\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makewdep.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/makewdep.vc6 -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makewdsp.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/makewdsp.vc6 -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makewfil.v10: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | 26 | 27 | Source Files 28 | 29 | 30 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makewmak.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/makewmak.vc6 -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makewvcx.v10: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Release 6 | Win32 7 | 8 | 9 | 10 | {B57065D4-DDDA-4668-BAF5-2D49270C973C} 11 | Win32Proj 12 | wrjpgcom 13 | 14 | 15 | 16 | Application 17 | false 18 | true 19 | Unicode 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | false 30 | $(ProjectName)\$(Configuration)\ 31 | $(ProjectName)\$(Configuration)\ 32 | 33 | 34 | 35 | Level3 36 | NotUsing 37 | Full 38 | true 39 | false 40 | WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS 41 | true 42 | true 43 | 4996 44 | 45 | 46 | Console 47 | true 48 | true 49 | true 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makljpeg.st: -------------------------------------------------------------------------------- 1 | ; Project file for Independent JPEG Group's software 2 | ; 3 | ; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C. 4 | ; Thanks to Frank Moehle, B. Setzepfandt, and Guido Vollbeding. 5 | ; 6 | ; To use this file, rename it to libjpeg.prj. 7 | ; Read installation instructions before trying to make the program! 8 | ; 9 | ; 10 | ; * * * Output file * * * 11 | libjpeg.lib 12 | ; 13 | ; * * * COMPILER OPTIONS * * * 14 | .C[-P] ; absolute calls 15 | .C[-M] ; and no string merging, folks 16 | .C[-w-cln] ; no "constant is long" warnings 17 | .C[-w-par] ; no "parameter xxxx unused" 18 | .C[-w-rch] ; no "unreachable code" 19 | .C[-wsig] ; warn if significant digits may be lost 20 | .L[-J] ; link new Obj-format (so we get a library) 21 | = 22 | ; * * * * List of modules * * * * 23 | jaricom.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 24 | jcapimin.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 25 | jcapistd.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 26 | jcarith.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 27 | jccoefct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 28 | jccolor.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 29 | jcdctmgr.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h) 30 | jchuff.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 31 | jcinit.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 32 | jcmainct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 33 | jcmarker.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 34 | jcmaster.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 35 | jcomapi.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 36 | jcparam.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 37 | jcprepct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 38 | jcsample.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 39 | jctrans.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 40 | jdapimin.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 41 | jdapistd.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 42 | jdarith.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 43 | jdatadst.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h) 44 | jdatasrc.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h) 45 | jdcoefct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 46 | jdcolor.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 47 | jddctmgr.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h) 48 | jdhuff.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 49 | jdinput.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 50 | jdmainct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 51 | jdmarker.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 52 | jdmaster.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 53 | jdmerge.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 54 | jdpostct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 55 | jdsample.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 56 | jdtrans.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 57 | jerror.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jversion.h,jerror.h) 58 | jfdctflt.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h) 59 | jfdctfst.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h) 60 | jfdctint.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h) 61 | jidctflt.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h) 62 | jidctfst.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h) 63 | jidctint.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h) 64 | jquant1.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 65 | jquant2.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 66 | jutils.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) 67 | jmemmgr.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jmemsys.h) 68 | jmemansi.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jmemsys.h) 69 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/maktjpeg.st: -------------------------------------------------------------------------------- 1 | ; Project file for Independent JPEG Group's software 2 | ; 3 | ; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C. 4 | ; Thanks to Frank Moehle, B. Setzepfandt, and Guido Vollbeding. 5 | ; 6 | ; To use this file, rename it to jpegtran.prj. 7 | ; If you are using Turbo C, change filenames beginning with "pc..." to "tc..." 8 | ; Read installation instructions before trying to make the program! 9 | ; 10 | ; 11 | ; * * * Output file * * * 12 | jpegtran.ttp 13 | ; 14 | ; * * * COMPILER OPTIONS * * * 15 | .C[-P] ; absolute calls 16 | .C[-M] ; and no string merging, folks 17 | .C[-w-cln] ; no "constant is long" warnings 18 | .C[-w-par] ; no "parameter xxxx unused" 19 | .C[-w-rch] ; no "unreachable code" 20 | .C[-wsig] ; warn if significant digits may be lost 21 | = 22 | ; * * * * List of modules * * * * 23 | pcstart.o 24 | jpegtran.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h,transupp.h,jversion.h) 25 | cdjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 26 | rdswitch.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 27 | transupp.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,transupp.h) 28 | libjpeg.lib ; built by libjpeg.prj 29 | pcstdlib.lib ; standard library 30 | pcextlib.lib ; extended library 31 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/makvms.opt: -------------------------------------------------------------------------------- 1 | ! A pointer to the VAX/VMS C Run-Time Shareable Library. 2 | ! This file is needed by makefile.mms and makefile.vms, 3 | ! but only for the older VAX C compiler. DEC C does not need it. 4 | Sys$Library:VAXCRTL.EXE /Share 5 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/missing: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Common wrapper for a few potentially missing GNU programs. 3 | 4 | scriptversion=2013-10-28.13; # UTC 5 | 6 | # Copyright (C) 1996-2013 Free Software Foundation, Inc. 7 | # Originally written by Fran,cois Pinard , 1996. 8 | 9 | # This program is free software; you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation; either version 2, or (at your option) 12 | # any later version. 13 | 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program. If not, see . 21 | 22 | # As a special exception to the GNU General Public License, if you 23 | # distribute this file as part of a program that contains a 24 | # configuration script generated by Autoconf, you may include it under 25 | # the same distribution terms that you use for the rest of that program. 26 | 27 | if test $# -eq 0; then 28 | echo 1>&2 "Try '$0 --help' for more information" 29 | exit 1 30 | fi 31 | 32 | case $1 in 33 | 34 | --is-lightweight) 35 | # Used by our autoconf macros to check whether the available missing 36 | # script is modern enough. 37 | exit 0 38 | ;; 39 | 40 | --run) 41 | # Back-compat with the calling convention used by older automake. 42 | shift 43 | ;; 44 | 45 | -h|--h|--he|--hel|--help) 46 | echo "\ 47 | $0 [OPTION]... PROGRAM [ARGUMENT]... 48 | 49 | Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due 50 | to PROGRAM being missing or too old. 51 | 52 | Options: 53 | -h, --help display this help and exit 54 | -v, --version output version information and exit 55 | 56 | Supported PROGRAM values: 57 | aclocal autoconf autoheader autom4te automake makeinfo 58 | bison yacc flex lex help2man 59 | 60 | Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 61 | 'g' are ignored when checking the name. 62 | 63 | Send bug reports to ." 64 | exit $? 65 | ;; 66 | 67 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 68 | echo "missing $scriptversion (GNU Automake)" 69 | exit $? 70 | ;; 71 | 72 | -*) 73 | echo 1>&2 "$0: unknown '$1' option" 74 | echo 1>&2 "Try '$0 --help' for more information" 75 | exit 1 76 | ;; 77 | 78 | esac 79 | 80 | # Run the given program, remember its exit status. 81 | "$@"; st=$? 82 | 83 | # If it succeeded, we are done. 84 | test $st -eq 0 && exit 0 85 | 86 | # Also exit now if we it failed (or wasn't found), and '--version' was 87 | # passed; such an option is passed most likely to detect whether the 88 | # program is present and works. 89 | case $2 in --version|--help) exit $st;; esac 90 | 91 | # Exit code 63 means version mismatch. This often happens when the user 92 | # tries to use an ancient version of a tool on a file that requires a 93 | # minimum version. 94 | if test $st -eq 63; then 95 | msg="probably too old" 96 | elif test $st -eq 127; then 97 | # Program was missing. 98 | msg="missing on your system" 99 | else 100 | # Program was found and executed, but failed. Give up. 101 | exit $st 102 | fi 103 | 104 | perl_URL=http://www.perl.org/ 105 | flex_URL=http://flex.sourceforge.net/ 106 | gnu_software_URL=http://www.gnu.org/software 107 | 108 | program_details () 109 | { 110 | case $1 in 111 | aclocal|automake) 112 | echo "The '$1' program is part of the GNU Automake package:" 113 | echo "<$gnu_software_URL/automake>" 114 | echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" 115 | echo "<$gnu_software_URL/autoconf>" 116 | echo "<$gnu_software_URL/m4/>" 117 | echo "<$perl_URL>" 118 | ;; 119 | autoconf|autom4te|autoheader) 120 | echo "The '$1' program is part of the GNU Autoconf package:" 121 | echo "<$gnu_software_URL/autoconf/>" 122 | echo "It also requires GNU m4 and Perl in order to run:" 123 | echo "<$gnu_software_URL/m4/>" 124 | echo "<$perl_URL>" 125 | ;; 126 | esac 127 | } 128 | 129 | give_advice () 130 | { 131 | # Normalize program name to check for. 132 | normalized_program=`echo "$1" | sed ' 133 | s/^gnu-//; t 134 | s/^gnu//; t 135 | s/^g//; t'` 136 | 137 | printf '%s\n' "'$1' is $msg." 138 | 139 | configure_deps="'configure.ac' or m4 files included by 'configure.ac'" 140 | case $normalized_program in 141 | autoconf*) 142 | echo "You should only need it if you modified 'configure.ac'," 143 | echo "or m4 files included by it." 144 | program_details 'autoconf' 145 | ;; 146 | autoheader*) 147 | echo "You should only need it if you modified 'acconfig.h' or" 148 | echo "$configure_deps." 149 | program_details 'autoheader' 150 | ;; 151 | automake*) 152 | echo "You should only need it if you modified 'Makefile.am' or" 153 | echo "$configure_deps." 154 | program_details 'automake' 155 | ;; 156 | aclocal*) 157 | echo "You should only need it if you modified 'acinclude.m4' or" 158 | echo "$configure_deps." 159 | program_details 'aclocal' 160 | ;; 161 | autom4te*) 162 | echo "You might have modified some maintainer files that require" 163 | echo "the 'autom4te' program to be rebuilt." 164 | program_details 'autom4te' 165 | ;; 166 | bison*|yacc*) 167 | echo "You should only need it if you modified a '.y' file." 168 | echo "You may want to install the GNU Bison package:" 169 | echo "<$gnu_software_URL/bison/>" 170 | ;; 171 | lex*|flex*) 172 | echo "You should only need it if you modified a '.l' file." 173 | echo "You may want to install the Fast Lexical Analyzer package:" 174 | echo "<$flex_URL>" 175 | ;; 176 | help2man*) 177 | echo "You should only need it if you modified a dependency" \ 178 | "of a man page." 179 | echo "You may want to install the GNU Help2man package:" 180 | echo "<$gnu_software_URL/help2man/>" 181 | ;; 182 | makeinfo*) 183 | echo "You should only need it if you modified a '.texi' file, or" 184 | echo "any other file indirectly affecting the aspect of the manual." 185 | echo "You might want to install the Texinfo package:" 186 | echo "<$gnu_software_URL/texinfo/>" 187 | echo "The spurious makeinfo call might also be the consequence of" 188 | echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" 189 | echo "want to install GNU make:" 190 | echo "<$gnu_software_URL/make/>" 191 | ;; 192 | *) 193 | echo "You might have modified some files without having the proper" 194 | echo "tools for further handling them. Check the 'README' file, it" 195 | echo "often tells you about the needed prerequisites for installing" 196 | echo "this package. You may also peek at any GNU archive site, in" 197 | echo "case some other package contains this missing '$1' program." 198 | ;; 199 | esac 200 | } 201 | 202 | give_advice "$1" | sed -e '1s/^/WARNING: /' \ 203 | -e '2,$s/^/ /' >&2 204 | 205 | # Propagate the correct exit status (expected to be 127 for a program 206 | # not found, 63 for a program that failed due to version mismatch). 207 | exit $st 208 | 209 | # Local variables: 210 | # eval: (add-hook 'write-file-hooks 'time-stamp) 211 | # time-stamp-start: "scriptversion=" 212 | # time-stamp-format: "%:y-%02m-%02d.%02H" 213 | # time-stamp-time-zone: "UTC" 214 | # time-stamp-end: "; # UTC" 215 | # End: 216 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/rdcolmap.c: -------------------------------------------------------------------------------- 1 | /* 2 | * rdcolmap.c 3 | * 4 | * Copyright (C) 1994-1996, Thomas G. Lane. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file implements djpeg's "-map file" switch. It reads a source image 9 | * and constructs a colormap to be supplied to the JPEG decompressor. 10 | * 11 | * Currently, these file formats are supported for the map file: 12 | * GIF: the contents of the GIF's global colormap are used. 13 | * PPM (either text or raw flavor): the entire file is read and 14 | * each unique pixel value is entered in the map. 15 | * Note that reading a large PPM file will be horrendously slow. 16 | * Typically, a PPM-format map file should contain just one pixel 17 | * of each desired color. Such a file can be extracted from an 18 | * ordinary image PPM file with ppmtomap(1). 19 | * 20 | * Rescaling a PPM that has a maxval unequal to MAXJSAMPLE is not 21 | * currently implemented. 22 | */ 23 | 24 | #include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ 25 | 26 | #ifdef QUANT_2PASS_SUPPORTED /* otherwise can't quantize to supplied map */ 27 | 28 | /* Portions of this code are based on the PBMPLUS library, which is: 29 | ** 30 | ** Copyright (C) 1988 by Jef Poskanzer. 31 | ** 32 | ** Permission to use, copy, modify, and distribute this software and its 33 | ** documentation for any purpose and without fee is hereby granted, provided 34 | ** that the above copyright notice appear in all copies and that both that 35 | ** copyright notice and this permission notice appear in supporting 36 | ** documentation. This software is provided "as is" without express or 37 | ** implied warranty. 38 | */ 39 | 40 | 41 | /* 42 | * Add a (potentially) new color to the color map. 43 | */ 44 | 45 | LOCAL(void) 46 | add_map_entry (j_decompress_ptr cinfo, int R, int G, int B) 47 | { 48 | JSAMPROW colormap0 = cinfo->colormap[0]; 49 | JSAMPROW colormap1 = cinfo->colormap[1]; 50 | JSAMPROW colormap2 = cinfo->colormap[2]; 51 | int ncolors = cinfo->actual_number_of_colors; 52 | int index; 53 | 54 | /* Check for duplicate color. */ 55 | for (index = 0; index < ncolors; index++) { 56 | if (GETJSAMPLE(colormap0[index]) == R && 57 | GETJSAMPLE(colormap1[index]) == G && 58 | GETJSAMPLE(colormap2[index]) == B) 59 | return; /* color is already in map */ 60 | } 61 | 62 | /* Check for map overflow. */ 63 | if (ncolors >= (MAXJSAMPLE+1)) 64 | ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, (MAXJSAMPLE+1)); 65 | 66 | /* OK, add color to map. */ 67 | colormap0[ncolors] = (JSAMPLE) R; 68 | colormap1[ncolors] = (JSAMPLE) G; 69 | colormap2[ncolors] = (JSAMPLE) B; 70 | cinfo->actual_number_of_colors++; 71 | } 72 | 73 | 74 | /* 75 | * Extract color map from a GIF file. 76 | */ 77 | 78 | LOCAL(void) 79 | read_gif_map (j_decompress_ptr cinfo, FILE * infile) 80 | { 81 | int header[13]; 82 | int i, colormaplen; 83 | int R, G, B; 84 | 85 | /* Initial 'G' has already been read by read_color_map */ 86 | /* Read the rest of the GIF header and logical screen descriptor */ 87 | for (i = 1; i < 13; i++) { 88 | if ((header[i] = getc(infile)) == EOF) 89 | ERREXIT(cinfo, JERR_BAD_CMAP_FILE); 90 | } 91 | 92 | /* Verify GIF Header */ 93 | if (header[1] != 'I' || header[2] != 'F') 94 | ERREXIT(cinfo, JERR_BAD_CMAP_FILE); 95 | 96 | /* There must be a global color map. */ 97 | if ((header[10] & 0x80) == 0) 98 | ERREXIT(cinfo, JERR_BAD_CMAP_FILE); 99 | 100 | /* OK, fetch it. */ 101 | colormaplen = 2 << (header[10] & 0x07); 102 | 103 | for (i = 0; i < colormaplen; i++) { 104 | R = getc(infile); 105 | G = getc(infile); 106 | B = getc(infile); 107 | if (R == EOF || G == EOF || B == EOF) 108 | ERREXIT(cinfo, JERR_BAD_CMAP_FILE); 109 | add_map_entry(cinfo, 110 | R << (BITS_IN_JSAMPLE-8), 111 | G << (BITS_IN_JSAMPLE-8), 112 | B << (BITS_IN_JSAMPLE-8)); 113 | } 114 | } 115 | 116 | 117 | /* Support routines for reading PPM */ 118 | 119 | 120 | LOCAL(int) 121 | pbm_getc (FILE * infile) 122 | /* Read next char, skipping over any comments */ 123 | /* A comment/newline sequence is returned as a newline */ 124 | { 125 | register int ch; 126 | 127 | ch = getc(infile); 128 | if (ch == '#') { 129 | do { 130 | ch = getc(infile); 131 | } while (ch != '\n' && ch != EOF); 132 | } 133 | return ch; 134 | } 135 | 136 | 137 | LOCAL(unsigned int) 138 | read_pbm_integer (j_decompress_ptr cinfo, FILE * infile) 139 | /* Read an unsigned decimal integer from the PPM file */ 140 | /* Swallows one trailing character after the integer */ 141 | /* Note that on a 16-bit-int machine, only values up to 64k can be read. */ 142 | /* This should not be a problem in practice. */ 143 | { 144 | register int ch; 145 | register unsigned int val; 146 | 147 | /* Skip any leading whitespace */ 148 | do { 149 | ch = pbm_getc(infile); 150 | if (ch == EOF) 151 | ERREXIT(cinfo, JERR_BAD_CMAP_FILE); 152 | } while (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r'); 153 | 154 | if (ch < '0' || ch > '9') 155 | ERREXIT(cinfo, JERR_BAD_CMAP_FILE); 156 | 157 | val = ch - '0'; 158 | while ((ch = pbm_getc(infile)) >= '0' && ch <= '9') { 159 | val *= 10; 160 | val += ch - '0'; 161 | } 162 | return val; 163 | } 164 | 165 | 166 | /* 167 | * Extract color map from a PPM file. 168 | */ 169 | 170 | LOCAL(void) 171 | read_ppm_map (j_decompress_ptr cinfo, FILE * infile) 172 | { 173 | int c; 174 | unsigned int w, h, maxval, row, col; 175 | int R, G, B; 176 | 177 | /* Initial 'P' has already been read by read_color_map */ 178 | c = getc(infile); /* save format discriminator for a sec */ 179 | 180 | /* while we fetch the remaining header info */ 181 | w = read_pbm_integer(cinfo, infile); 182 | h = read_pbm_integer(cinfo, infile); 183 | maxval = read_pbm_integer(cinfo, infile); 184 | 185 | if (w <= 0 || h <= 0 || maxval <= 0) /* error check */ 186 | ERREXIT(cinfo, JERR_BAD_CMAP_FILE); 187 | 188 | /* For now, we don't support rescaling from an unusual maxval. */ 189 | if (maxval != (unsigned int) MAXJSAMPLE) 190 | ERREXIT(cinfo, JERR_BAD_CMAP_FILE); 191 | 192 | switch (c) { 193 | case '3': /* it's a text-format PPM file */ 194 | for (row = 0; row < h; row++) { 195 | for (col = 0; col < w; col++) { 196 | R = read_pbm_integer(cinfo, infile); 197 | G = read_pbm_integer(cinfo, infile); 198 | B = read_pbm_integer(cinfo, infile); 199 | add_map_entry(cinfo, R, G, B); 200 | } 201 | } 202 | break; 203 | 204 | case '6': /* it's a raw-format PPM file */ 205 | for (row = 0; row < h; row++) { 206 | for (col = 0; col < w; col++) { 207 | R = getc(infile); 208 | G = getc(infile); 209 | B = getc(infile); 210 | if (R == EOF || G == EOF || B == EOF) 211 | ERREXIT(cinfo, JERR_BAD_CMAP_FILE); 212 | add_map_entry(cinfo, R, G, B); 213 | } 214 | } 215 | break; 216 | 217 | default: 218 | ERREXIT(cinfo, JERR_BAD_CMAP_FILE); 219 | break; 220 | } 221 | } 222 | 223 | 224 | /* 225 | * Main entry point from djpeg.c. 226 | * Input: opened input file (from file name argument on command line). 227 | * Output: colormap and actual_number_of_colors fields are set in cinfo. 228 | */ 229 | 230 | GLOBAL(void) 231 | read_color_map (j_decompress_ptr cinfo, FILE * infile) 232 | { 233 | /* Allocate space for a color map of maximum supported size. */ 234 | cinfo->colormap = (*cinfo->mem->alloc_sarray) 235 | ((j_common_ptr) cinfo, JPOOL_IMAGE, 236 | (JDIMENSION) (MAXJSAMPLE+1), (JDIMENSION) 3); 237 | cinfo->actual_number_of_colors = 0; /* initialize map to empty */ 238 | 239 | /* Read first byte to determine file format */ 240 | switch (getc(infile)) { 241 | case 'G': 242 | read_gif_map(cinfo, infile); 243 | break; 244 | case 'P': 245 | read_ppm_map(cinfo, infile); 246 | break; 247 | default: 248 | ERREXIT(cinfo, JERR_BAD_CMAP_FILE); 249 | break; 250 | } 251 | } 252 | 253 | #endif /* QUANT_2PASS_SUPPORTED */ 254 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/rdgif.c: -------------------------------------------------------------------------------- 1 | /* 2 | * rdgif.c 3 | * 4 | * Copyright (C) 1991-1997, Thomas G. Lane. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file contains routines to read input images in GIF format. 9 | * 10 | ***************************************************************************** 11 | * NOTE: to avoid entanglements with Unisys' patent on LZW compression, * 12 | * the ability to read GIF files has been removed from the IJG distribution. * 13 | * Sorry about that. * 14 | ***************************************************************************** 15 | * 16 | * We are required to state that 17 | * "The Graphics Interchange Format(c) is the Copyright property of 18 | * CompuServe Incorporated. GIF(sm) is a Service Mark property of 19 | * CompuServe Incorporated." 20 | */ 21 | 22 | #include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ 23 | 24 | #ifdef GIF_SUPPORTED 25 | 26 | /* 27 | * The module selection routine for GIF format input. 28 | */ 29 | 30 | GLOBAL(cjpeg_source_ptr) 31 | jinit_read_gif (j_compress_ptr cinfo) 32 | { 33 | fprintf(stderr, "GIF input is unsupported for legal reasons. Sorry.\n"); 34 | exit(EXIT_FAILURE); 35 | return NULL; /* keep compiler happy */ 36 | } 37 | 38 | #endif /* GIF_SUPPORTED */ 39 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/rdjpgcom.1: -------------------------------------------------------------------------------- 1 | .TH RDJPGCOM 1 "13 September 2013" 2 | .SH NAME 3 | rdjpgcom \- display text comments from a JPEG file 4 | .SH SYNOPSIS 5 | .B rdjpgcom 6 | [ 7 | .B \-raw 8 | ] 9 | [ 10 | .B \-verbose 11 | ] 12 | [ 13 | .I filename 14 | ] 15 | .LP 16 | .SH DESCRIPTION 17 | .LP 18 | .B rdjpgcom 19 | reads the named JPEG/JFIF file, or the standard input if no file is named, 20 | and prints any text comments found in the file on the standard output. 21 | .PP 22 | The JPEG standard allows "comment" (COM) blocks to occur within a JPEG file. 23 | Although the standard doesn't actually define what COM blocks are for, they 24 | are widely used to hold user-supplied text strings. This lets you add 25 | annotations, titles, index terms, etc to your JPEG files, and later retrieve 26 | them as text. COM blocks do not interfere with the image stored in the JPEG 27 | file. The maximum size of a COM block is 64K, but you can have as many of 28 | them as you like in one JPEG file. 29 | .SH OPTIONS 30 | .TP 31 | .B \-raw 32 | Normally 33 | .B rdjpgcom 34 | escapes non-printable characters in comments, for security reasons. 35 | This option avoids that. 36 | .PP 37 | .B \-verbose 38 | Causes 39 | .B rdjpgcom 40 | to also display the JPEG image dimensions. 41 | .PP 42 | Switch names may be abbreviated, and are not case sensitive. 43 | .SH HINTS 44 | .B rdjpgcom 45 | does not depend on the IJG JPEG library. Its source code is intended as an 46 | illustration of the minimum amount of code required to parse a JPEG file 47 | header correctly. 48 | .PP 49 | In 50 | .B \-verbose 51 | mode, 52 | .B rdjpgcom 53 | will also attempt to print the contents of any "APP12" markers as text. 54 | Some digital cameras produce APP12 markers containing useful textual 55 | information. If you like, you can modify the source code to print 56 | other APPn marker types as well. 57 | .SH SEE ALSO 58 | .BR cjpeg (1), 59 | .BR djpeg (1), 60 | .BR jpegtran (1), 61 | .BR wrjpgcom (1) 62 | .SH AUTHOR 63 | Independent JPEG Group 64 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/readme.dos: -------------------------------------------------------------------------------- 1 | This archive contains a DOS-friendly version of the Independent JPEG Group's 2 | source code. It differs from the normal distribution in that: 3 | 4 | 1. The archive format is zip rather than tar+gzip. You should be able to 5 | unpack it with PKUNZIP (2.04g or later) or Info-Zip's unzip or 7-Zip. 6 | 7 | 2. Newlines have been converted from Unix (LF) to DOS (CR/LF) style in all 8 | text files, but not in the binary files (test*.*). 9 | 10 | 3. Object files have been included for jmemdosa.asm. See jdosaobj.txt. 11 | 12 | Please see the main README file for the primary documentation. 13 | 14 | If you'd rather have a non-DOSified archive, see the ARCHIVE LOCATIONS section 15 | of README. 16 | -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/testimg.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/testimg.bmp -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/testimg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/testimg.jpg -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/testimg.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/testimg.ppm -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/testimgp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/testimgp.jpg -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/testorig.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/testorig.jpg -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/testprog.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/components/decoder_ijg/jpeg-9a/testprog.jpg -------------------------------------------------------------------------------- /components/decoder_ijg/jpeg-9a/wrjpgcom.1: -------------------------------------------------------------------------------- 1 | .TH WRJPGCOM 1 "15 June 1995" 2 | .SH NAME 3 | wrjpgcom \- insert text comments into a JPEG file 4 | .SH SYNOPSIS 5 | .B wrjpgcom 6 | [ 7 | .B \-replace 8 | ] 9 | [ 10 | .BI \-comment " text" 11 | ] 12 | [ 13 | .BI \-cfile " name" 14 | ] 15 | [ 16 | .I filename 17 | ] 18 | .LP 19 | .SH DESCRIPTION 20 | .LP 21 | .B wrjpgcom 22 | reads the named JPEG/JFIF file, or the standard input if no file is named, 23 | and generates a new JPEG/JFIF file on standard output. A comment block is 24 | added to the file. 25 | .PP 26 | The JPEG standard allows "comment" (COM) blocks to occur within a JPEG file. 27 | Although the standard doesn't actually define what COM blocks are for, they 28 | are widely used to hold user-supplied text strings. This lets you add 29 | annotations, titles, index terms, etc to your JPEG files, and later retrieve 30 | them as text. COM blocks do not interfere with the image stored in the JPEG 31 | file. The maximum size of a COM block is 64K, but you can have as many of 32 | them as you like in one JPEG file. 33 | .PP 34 | .B wrjpgcom 35 | adds a COM block, containing text you provide, to a JPEG file. 36 | Ordinarily, the COM block is added after any existing COM blocks; but you 37 | can delete the old COM blocks if you wish. 38 | .SH OPTIONS 39 | Switch names may be abbreviated, and are not case sensitive. 40 | .TP 41 | .B \-replace 42 | Delete any existing COM blocks from the file. 43 | .TP 44 | .BI \-comment " text" 45 | Supply text for new COM block on command line. 46 | .TP 47 | .BI \-cfile " name" 48 | Read text for new COM block from named file. 49 | .PP 50 | If you have only one line of comment text to add, you can provide it on the 51 | command line with 52 | .BR \-comment . 53 | The comment text must be surrounded with quotes so that it is treated as a 54 | single argument. Longer comments can be read from a text file. 55 | .PP 56 | If you give neither 57 | .B \-comment 58 | nor 59 | .BR \-cfile , 60 | then 61 | .B wrjpgcom 62 | will read the comment text from standard input. (In this case an input image 63 | file name MUST be supplied, so that the source JPEG file comes from somewhere 64 | else.) You can enter multiple lines, up to 64KB worth. Type an end-of-file 65 | indicator (usually control-D) to terminate the comment text entry. 66 | .PP 67 | .B wrjpgcom 68 | will not add a COM block if the provided comment string is empty. Therefore 69 | \fB\-replace \-comment ""\fR can be used to delete all COM blocks from a file. 70 | .SH EXAMPLES 71 | .LP 72 | Add a short comment to in.jpg, producing out.jpg: 73 | .IP 74 | .B wrjpgcom \-c 75 | \fI"View of my back yard" in.jpg 76 | .B > 77 | .I out.jpg 78 | .PP 79 | Attach a long comment previously stored in comment.txt: 80 | .IP 81 | .B wrjpgcom 82 | .I in.jpg 83 | .B < 84 | .I comment.txt 85 | .B > 86 | .I out.jpg 87 | .PP 88 | or equivalently 89 | .IP 90 | .B wrjpgcom 91 | .B -cfile 92 | .I comment.txt 93 | .B < 94 | .I in.jpg 95 | .B > 96 | .I out.jpg 97 | .SH SEE ALSO 98 | .BR cjpeg (1), 99 | .BR djpeg (1), 100 | .BR jpegtran (1), 101 | .BR rdjpgcom (1) 102 | .SH AUTHOR 103 | Independent JPEG Group 104 | -------------------------------------------------------------------------------- /components/decoder_ijg/readme.md: -------------------------------------------------------------------------------- 1 | 2 | ## Component Notice 3 | 4 | This `decoder_ijg` component comes from `Independent JPEG Group`, version 9-a, for licence detials please check: https://www.ijg.org/ 5 | 6 | ## README for release 9a of 19-Jan-2014 7 | 8 | This distribution contains the ninth public release of the Independent JPEG 9 | Group's free JPEG software. You are welcome to redistribute this software and 10 | to use it for any purpose, subject to the conditions under LEGAL ISSUES, below. 11 | 12 | This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone, 13 | Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson, 14 | Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers, 15 | and other members of the Independent JPEG Group. 16 | 17 | IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee 18 | (previously known as JPEG, together with ITU-T SG16). 19 | -------------------------------------------------------------------------------- /doc/hardware/schematic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/doc/hardware/schematic.png -------------------------------------------------------------------------------- /doc/images/camera_tab.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/doc/images/camera_tab.jpg -------------------------------------------------------------------------------- /doc/images/custom_pcb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/doc/images/custom_pcb.jpg -------------------------------------------------------------------------------- /doc/images/custom_pcb_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/doc/images/custom_pcb_1.jpg -------------------------------------------------------------------------------- /doc/images/files_tab.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/doc/images/files_tab.jpg -------------------------------------------------------------------------------- /doc/images/image_window.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/doc/images/image_window.jpg -------------------------------------------------------------------------------- /doc/images/media_player.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/doc/images/media_player.jpg -------------------------------------------------------------------------------- /doc/images/settings_tab.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/doc/images/settings_tab.jpg -------------------------------------------------------------------------------- /doc/images/text_file.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espzav/UVC-Camera-and-MSC-LVGL-Example/5d941d4688d0c2a29c53966b8be8ee95ddab4334/doc/images/text_file.jpg -------------------------------------------------------------------------------- /main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS "bsp_espbox_disp_camera_example.c" 2 | INCLUDE_DIRS "." 3 | REQUIRES "usb" "esp_timer" "decoder_ijg") 4 | -------------------------------------------------------------------------------- /main/idf_component.yml: -------------------------------------------------------------------------------- 1 | description: Display and Camera example on ESP-BOX 2 | dependencies: 3 | idf: ">=4.4" 4 | esp-box: "^3.0.0" 5 | usb_host_uvc: "^1.0.0" 6 | usb_host_msc: "^1.0.0" 7 | -------------------------------------------------------------------------------- /partitions.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | nvs, data, nvs, 0x9000, 0x6000, 4 | phy_init, data, phy, 0xf000, 0x1000, 5 | factory, app, factory, 0x10000, 1M, 6 | storage, data, spiffs, 0x110000,0x2f0000, 7 | -------------------------------------------------------------------------------- /sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32s3" 5 | CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y 6 | CONFIG_PARTITION_TABLE_CUSTOM=y 7 | CONFIG_LV_COLOR_16_SWAP=y 8 | CONFIG_LV_MEM_CUSTOM=y 9 | CONFIG_LV_MEMCPY_MEMSET_STD=y 10 | #CONFIG_LV_TICK_CUSTOM=y 11 | #CONFIG_LV_TICK_CUSTOM_INCLUDE="esp_timer.h" 12 | CONFIG_LV_USE_PERF_MONITOR=y 13 | CONFIG_LV_SPRINTF_CUSTOM=y 14 | # CONFIG_LV_BUILD_EXAMPLES is not set 15 | 16 | # 17 | # USB 18 | # 19 | CONFIG_USB_HOST_CONTROL_TRANSFER_MAX_SIZE=1024 20 | CONFIG_USB_HOST_HW_BUFFER_BIAS_IN=y 21 | 22 | #Support long filenames 23 | CONFIG_FATFS_LFN_HEAP=y 24 | 25 | # 26 | # SPIRAM for ESP-BOX 27 | # 28 | CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y 29 | CONFIG_ESP32S3_SPIRAM_SUPPORT=y 30 | CONFIG_SPIRAM_MODE_OCT=y 31 | CONFIG_SPIRAM_SPEED_80M=y 32 | CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=4096 33 | CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=8192 -------------------------------------------------------------------------------- /tools/launchpad.toml: -------------------------------------------------------------------------------- 1 | esp_toml_version = 1.0 2 | firmware_images_url = "https://espzav.github.io/UVC-Camera-and-MSC-LVGL-Example/" 3 | 4 | supported_apps = ["UVC_CAMERA_EXAMPLE_IDF_latest", "UVC_CAMERA_EXAMPLE_IDF_v5"] 5 | 6 | [UVC_CAMERA_EXAMPLE_IDF_v5] 7 | chipsets = ["ESP32-S3"] 8 | image.esp32-s3 = "camera_example_esp32s3_release_v5_0.bin" 9 | android_app_url = "" 10 | ios_app_url = "" 11 | 12 | [UVC_CAMERA_EXAMPLE_IDF_latest] 13 | chipsets = ["ESP32-S3"] 14 | image.esp32-s3 = "camera_example_esp32s3_latest.bin" 15 | android_app_url = "" 16 | ios_app_url = "" --------------------------------------------------------------------------------