The JPEG Algorithm and Implementation

 

 

A Sample JPEG Image File Data structure


ff d8 ff e0 00 10 4a 46 49 46 00 01 01 00 00 01 00 01 00 00 ff fe 00 46

76 77 78 79 7a 83 84 85 86 b5 b6 b7 b8 b9 ba c2 03 00 04 ff db 00 43

00 08 06 06 07 06 05 08 07 07 07 09 09 08 0a 0c 14 0d 0c 0b 0b 0c 19 12

13 0f 14 1d 1a 1f 1e 1d 1a 1c 1c 20 24 2e 27 20 22 2c 23 1c 1c 28 37 29

2c 30 31 34 34 34 1f 27 39 3d 38 32 3c 2e 33 34 32 ff c0 00 0b 08 01 00

01 00 01 01 11 00 ff c4 00 1f 00 00 01 05 01 01 01 01 01 01 00 00 00 00

00 00 00 00 01 02 03 04 05 06 07 08 09 0a 0b ff c4 00 b5 10 00 02 01 03

03 02 04 03 05 05 04 04 00 00 01 7d 01 02 03 00 04 11 05 12 21 31 41 06

13 51 61 07 22 71 14 32 81 91 a1 08 23 42 b1 c1 15 52 d1 f0 24 33 62 72

82 09 0a 16 17 18 19 1a 25 26 27 28 29 2a 34 35 36 37 38 39 3a 43 44 45

46 47 48 49 4a 53 54 55 56 57 58 59 5a 63 64 65 66 67 68 69 6a 73 74 75

76 77 78 79 7a 83 84 85 86 87 88 89 8a 92 93 94 95 96 97 98 99 9a a2 a3

a4 a5 a6 a7 a8 a9 aa b2 b3 b4 b5 b6 b7 b8 b9 ba c2 c3 c4 c5 c6 c7 c8 c9

ca d2 d3 d4 d5 d6 d7 d8 d9 da e1 e2 e3 e4 e5 e6 e7 e8 e9 ea f1 f2 f3 f4

f5 f6 f7 f8 f9 fa ff da 00 08 01 01 00 00 3f 00 xx xx xx xx xx xx xx xx

xx xx xx xx xx xx xx xx xx xx xx xx ff d9




Markers

Brief Explanation

FF D8

Start of Image

FF FE

Comments (This marker may be absent)

FF E0

Application data marker (not of much use in general)

FF DB

Define Quantization Table

FF C0

Start of Frame for Baseline DCT

FF C4

Define Huffman table

FF DA

Start of Data

XX XX

Encoded Data

FF D9

End of Image.



Notes: The first ff c4 marker defines the DC huffman table, which is defined by the third entry

after the marker which is 00 for the first ffc4 and 10 for the second ffc4.


All the picture informations in encoded in the header, for example:

The size of the image is encoded in the ff c0 block. The x-pixel width is defined by the 4th

entry after the ffc0 marker and the y-pixel width is defined by the 5th entry ( all in hexadecimals).

Here x-pixel width = 01 00 = 256 in decimal.

y-pixel width = 01 00 = 256 in decimal.

 

Any jpeg image can be dumped in hexadecimal format and the above markers and format can be observed.



         Note: The above information is copyrighted content. Need to use it for reference? No problems, just contact me at .