Common Lisp Package: JPEG

README:

FUNCTION

Public

DECODE-STREAM (STREAM)

Return image array, height, width, and number of components. Does not support progressive DCT-based JPEGs.

DECODE-STREAM-HEIGHT-WIDTH (STREAM)

Return the height and width of the JPEG data read from STREAM. Does less work than DECODE-STREAM and also supports progressive DCT-based JPEGs.

Undocumented

DECODE-IMAGE (FILENAME)

ENCODE-IMAGE (FILENAME IMAGE NCOMP H W &REST ARGS)

JPEG-TO-BMP (&KEY INFILE OUTFILE)

Private

BUILD-DECODER-TABLES (BITS HUFFCODE)

Builds up decoder-specific tables

DECODE (MAXCODE MINCODE VALPTR HUFFVAL NEXTBIT S)

The DECODE procedure, as described in CCITT rec.

DECODE-AC

Decodes AC coefficients

DECODE-BLOCK (ZZ TABS NEXTBIT S)

Reads one 8x8 block. Doesn't deals with predictors.

DECODE-CHUNK (IMAGE SCAN S)

Reads and decodes either a whole scan (if no restarts) or restart interval

DECODE-DC (MAXCODE MINCODE VALPTR HUFFVAL NEXTBIT S)

Decodes DC value

DEQUANTIZE

Dequantizes a single sample

DESCRIPTOR-BUFFER (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DESCRIPTOR-CID (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DESCRIPTOR-H (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DESCRIPTOR-HEIGHT (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DESCRIPTOR-HUFF-AC (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DESCRIPTOR-HUFF-DC (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DESCRIPTOR-IH (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DESCRIPTOR-IV (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DESCRIPTOR-NCOMP (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DESCRIPTOR-QDEST (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DESCRIPTOR-QTABLES (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DESCRIPTOR-RESTART-INTERVAL (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DESCRIPTOR-SCANS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DESCRIPTOR-V (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DESCRIPTOR-WIDTH (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DESCRIPTOR-ZZ (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

EXTEND (V TT)

EXTEND procedure, as described in spec.

HUFFSTRUCT-BITS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

HUFFSTRUCT-HUFFCODE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

HUFFSTRUCT-HUFFVAL (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

HUFFSTRUCT-MAXCODE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

HUFFSTRUCT-MINCODE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

HUFFSTRUCT-VALPTR (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

INTERPRET-MARKERS (IMAGE TERM S)

Reads tables etc., returns the first unrecognized marker it met

INVERSE-LLM-DCT (BLOCK Q-TABLE)

Performs Inverse LMM DCT and dequantizetion

IZIGZAG

Performs inverse zigzag block arrangement

MAKE-NEXTBIT (B CNT)

Returns the closure which reads specified numbers of bits from the stream

READ-APP (S)

APPn marker reading: just skipping the whole marker

READ-COM (S)

APPn marker reading: just skipping the whole marker

READ-DHT (IMAGE S)

Loads huffman tables on specified destinations

READ-DQT (IMAGE S)

Reads in quantization tables

READ-DRI (IMAGE S)

Reads restart interval

READ-WORD (S)

Reads 16-bit word from the stream

RECIEVE (SSSS NEXTBIT S)

Recieves ssss bits from the stream

SCAN-CDESC (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

SCAN-NCOMP (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

SCAN-X (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

SCAN-Y (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

UPSAMPLE (IMAGE SCAN BLOCK X Y H V OFFSET NWIDTH NW NX DEND)

Places decoded block into the image buffer, with necessary upsampling

Undocumented

BUILD-TABLES (BITS HUFFVAL)

BUILD-UNIVERSAL-TABLES (BITS)

COLORSPACE-CONVERT (RGB YUV DX DY H W HEIGHT WIDTH)

CONVERT-SAMPLING (S HMAX VMAX)

COPY-DESCRIPTOR (INSTANCE)

COPY-HUFFSTRUCT (INSTANCE)

COPY-SCAN (INSTANCE)

COUNT-RELATION (SMP)

CROP-IMAGE (INBUF OUTBUF DX DY H W HEIGHT WIDTH NCOMP)

CRUNCH

CSIZE

DECODE-FRAME (IMAGE S)

DECODE-FRAME-BEGINNING (IMAGE S)

DECODE-SCAN (IMAGE I S)

DESCALE

SETFDESCRIPTOR-BUFFER (NEW-VALUE INSTANCE)

SETFDESCRIPTOR-CID (NEW-VALUE INSTANCE)

SETFDESCRIPTOR-H (NEW-VALUE INSTANCE)

SETFDESCRIPTOR-HEIGHT (NEW-VALUE INSTANCE)

SETFDESCRIPTOR-HUFF-AC (NEW-VALUE INSTANCE)

SETFDESCRIPTOR-HUFF-DC (NEW-VALUE INSTANCE)

SETFDESCRIPTOR-IH (NEW-VALUE INSTANCE)

SETFDESCRIPTOR-IV (NEW-VALUE INSTANCE)

SETFDESCRIPTOR-NCOMP (NEW-VALUE INSTANCE)

DESCRIPTOR-P (OBJECT)

SETFDESCRIPTOR-QDEST (NEW-VALUE INSTANCE)

SETFDESCRIPTOR-QTABLES (NEW-VALUE INSTANCE)

SETFDESCRIPTOR-RESTART-INTERVAL (NEW-VALUE INSTANCE)

SETFDESCRIPTOR-SCANS (NEW-VALUE INSTANCE)

SETFDESCRIPTOR-V (NEW-VALUE INSTANCE)

SETFDESCRIPTOR-WIDTH (NEW-VALUE INSTANCE)

SETFDESCRIPTOR-ZZ (NEW-VALUE INSTANCE)

ENCODE-BLOCK

ENCODE-IMAGE-STREAM

ENCODING-WRAPPER (FILENAME IMAGE NCOMP H W &KEY (QUALITY 4))

SETFHUFFSTRUCT-BITS (NEW-VALUE INSTANCE)

SETFHUFFSTRUCT-HUFFCODE (NEW-VALUE INSTANCE)

SETFHUFFSTRUCT-HUFFVAL (NEW-VALUE INSTANCE)

SETFHUFFSTRUCT-MAXCODE (NEW-VALUE INSTANCE)

SETFHUFFSTRUCT-MINCODE (NEW-VALUE INSTANCE)

HUFFSTRUCT-P (OBJECT)

SETFHUFFSTRUCT-VALPTR (NEW-VALUE INSTANCE)

INVERSE-COLORSPACE-CONVERT (IMAGE)

LLM-DCT

MAKE-DESCRIPTOR (&KEY ((RESTART-INTERVAL DUM1450) 0) ((WIDTH DUM1451) 0) ((HEIGHT DUM1452) 0) ((BUFFER DUM1453) NIL) ((QTABLES DUM1454) (MAKE-ARRAY 4 INITIAL-CONTENTS (LOOP FOR J FIXNUM FROM 0 TO 3 COLLECTING (MAKE-ARRAY 8 INITIAL-CONTENTS (LOOP FOR I FIXNUM FROM 0 TO 7 COLLECTING (MAKE-ARRAY 8)))))) ((HUFF-AC DUM1455) (MAKE-ARRAY 2 INITIAL-CONTENTS (LIST (MAKE-HUFFSTRUCT) (MAKE-HUFFSTRUCT)))) ((HUFF-DC DUM1456) (MAKE-ARRAY 2 INITIAL-CONTENTS (LIST (MAKE-HUFFSTRUCT) (MAKE-HUFFSTRUCT)))) ((CID DUM1457) (MAKE-ARRAY 4)) ((SCANS DUM1458) (MAKE-ARRAY 4 INITIAL-CONTENTS (LOOP FOR I FIXNUM FROM 0 TO 3 COLLECTING (MAKE-SCAN)))) ((H DUM1459) (MAKE-ARRAY 4)) ((V DUM1460) (MAKE-ARRAY 4)) ((IH DUM1461) (MAKE-ARRAY 4)) ((IV DUM1462) (MAKE-ARRAY 4)) ((QDEST DUM1463) (MAKE-ARRAY 4)) ((ZZ DUM1464) (MAKE-ARRAY 64)) ((NCOMP DUM1465) 0))

MAKE-HUFFSTRUCT (&KEY ((MINCODE DUM1402) NIL) ((MAXCODE DUM1403) NIL) ((BITS DUM1404) (MAKE-ARRAY 16)) ((HUFFVAL DUM1405) NIL) ((HUFFCODE DUM1406) NIL) ((VALPTR DUM1407) NIL))

MAKE-SCAN (&KEY ((NCOMP DUM1344) 1) ((X DUM1345) 0) ((Y DUM1346) 0) ((CDESC DUM1347) (MAKE-ARRAY 4 INITIAL-CONTENTS (LOOP REPEAT 4 COLLECT (LIST 0 0)))))

PREPARE-JFIF-STREAM (OUT-STREAM)

Q-SCALE

QUANTIZE

READ-MARKER (S)

SETFSCAN-CDESC (NEW-VALUE INSTANCE)

SETFSCAN-NCOMP (NEW-VALUE INSTANCE)

SCAN-P (OBJECT)

SETFSCAN-X (NEW-VALUE INSTANCE)

SETFSCAN-Y (NEW-VALUE INSTANCE)

SUBSAMPLE

WRITE-BITS

WRITE-FRAME-HEADER

WRITE-HUFFMAN-TABLES (S)

WRITE-HUFFTABLE (BITS VALS TCTI S)

WRITE-MARKER (CODE TO)

WRITE-QUANTIZATION-TABLES (TABLES S)

WRITE-STUFFED

ZIGZAG

MACRO

Private

Undocumented

DBREF (DATA X Y)

DCT-LIMIT (N)

DEFINE-CONSTANT (NAME VALUE &OPTIONAL DOC)

LIMIT (N)

MINUS (A B)

MUL (A B)

PLUS (A B)

PLUS3 (X Y Z)

QUANTIZE-BLOCK

VARIABLE

Private

Undocumented

*CB-B-TAB*

*CB-G-TAB*

*CR-G-TAB*

*CR-R-TAB*

*CTAB*

*IDCT-LIMIT-ARRAY*

*OPTIMIZE*

*PREV-BYTE*

*PREV-LENGTH*

*Q-CHROMINANCE*

*Q-CHROMINANCE-HI*

*Q-LUMINANCE*

*Q-LUMINANCE-HI*

*QUANTIZE-OPTIMIZATION*

*WS*

*ZZ-RESULT*

CLASS

Private

Undocumented

DESCRIPTOR

HUFFSTRUCT

SCAN

CONSTANT

Private

Undocumented

+-.0813+

+-.1687+

+-.3313+

+-.4187+

+-0.34414+

+-0.71414+

+.114+

+.299+

+.5+

+.587+

+1.40200+

+1.77200+

+B-U-OFF+

+B-V-OFF+

+B-Y-OFF+

+CHROMINANCE-AC-BITS+

+CHROMINANCE-AC-VALUES+

+CHROMINANCE-DC-BITS+

+CHROMINANCE-DC-VALUES+

+CSIZE+

+FIX-0-298631336+

+FIX-0-390180644+

+FIX-0-541196100+

+FIX-0-765366865+

+FIX-0-899976223+

+FIX-1-175875602+

+FIX-1-501321110+

+FIX-1-847759065+

+FIX-1-961570560+

+FIX-2-053119869+

+FIX-2-562915447+

+FIX-3-072711026+

+G-U-OFF+

+G-V-OFF+

+G-Y-OFF+

+LUMINANCE-AC-BITS+

+LUMINANCE-AC-VALUES+

+LUMINANCE-DC-BITS+

+LUMINANCE-DC-VALUES+

+M_APP0+

+M_COM+

+M_DAC+

+M_DHT+

+M_DNL+

+M_DQT+

+M_DRI+

+M_EOI+

+M_RST0+

+M_RST7+

+M_SOF0+

+M_SOF2+

+M_SOI+

+M_SOS+

+ONE-HALF+

+Q-TABLES+

+R-U-OFF+

+R-V-OFF+

+R-Y-OFF+

+SHIFT+1+

+SHIFT+4+

+SHIFT-1+

+UVOFFSET+

+ZIGZAG-INDEX+

+ZZBUF+

DCT-SHIFT

SHIFT