Top Banner

of 55

第 8 ç«  DCT ¸ JPEG ç¼–ç 

Jan 30, 2016

ReportDownload

Documents

sloan

第 8 章 DCT 与 JPEG 编码. JPEG ( Joint Photographic Experts Group 联合图象专家组)是( ITU 的前身)国际电话与电报咨询委员会 CCITT 与 ISO 于 1986 年联合成立的一个小组,负责制定静态图像的编码标准 1992 年 9 月 JPEG 推出了 ISO/IEC 10918 标准 ( CCITT T.81 )—— 连续色调静态图像的数字压缩与编码,简称为 JPEG 标准,适用于灰度图与真彩图的静态图像的压缩 - PowerPoint PPT Presentation

  • 8 DCTJPEGJPEGJoint Photographic Experts GroupITUCCITTISO198619929JPEGISO/IEC 10918(CCITT T.81)JPEG200012JPEGJBIGJoint Bi-level Image experts GroupJPEGJPEG 2000ISO/IEC 15444 (ITU T.800[20028])JPEG 2000JPEGDCTJPEG 2000JPEGJPEG 2000MPEG

  • 8.1 DCTDCTJPEGDCT = Discrete Cosine Transform =

  • Fourierf (x)2 l[-l, l ]f (x)Fourier

  • f (x) an0bn0f (x)

    f (x)x[0, l ][-l, l ]2l2l

  • f (x)

    f (x)an

  • Nf (x)x = 0, 1, 2, ..., N -12N

    f (-1) = f (0)x = -1/2

  • f (x)-1/2 l = N

    2N

  • IDCTa0

    an F(n)nuxi

  • f (i, j)i, j = 0, 1, 2, ... , N-1DCT

    N = 8

  • 8.2 JPEG1986CCITTISO(JPEG = Joint Photographic Experts Group)1992918Digital compression and coding of continuous-tone still images(CCITT T.81ISO/IEC 10918)JPEGwww.jpeg.org

  • JPEGISO/IEC 10918-1:1994Requirements and guidelinesISO/IEC 10918-2:1995Compliance testingISO/IEC 10918-3:1997ExtensionsISO/IEC 10918-3:1997/Amd 1:1999Provisions to allow registration of new compression types and versions in the SPIFF headerSPIFFISO/IEC 10918-4:1999Registration of JPEG profiles, SPIFF profiles, SPIFF tags, SPIFF colour spaces, APPn markers, SPIFF compression types and Registration Authorities (REGAUT)JPEGSPIFFSPIFFSPIFFAPPnSPIFF

  • JPEGJPEGDCTJPEGDPCMDCTDCT(2n)

  • JPEGDCT(baseline)(sequential)HuffmanDCTHuffman

  • JPEGJPEGDCT10~30

    (bit/pixel)

    12 ~ 16

    2.0 ~ 1.5

    16 ~ 32

    1.5 ~ 0.75

    32 ~ 48

    0.75 ~ 0.5

    48 ~ 96

    0.5 ~ 0.25

  • JPEGJPEGJPEG(DCT)(RLE/Huffman) JPEGRGBYUVYUVRGBJPEGJPEGRGB, YCbCrCMYK

  • JPEG(1) DCT(FDCT = forward DCT)(2) DCT(3) Huffman/

  • JPEG-

  • JPEG(0) 8*8(1) (FDCT)(2) (quantization)(3) Z(zigzag scan)(4) DPCMDC(direct current)(5) RLEAC (alternating current)(6) (Huffman/)

  • 1. FDCT(FDCT)(1) 88DCT

  • (2) DCT

    f(i,j) = v(i,j) 128

    DCF(u , v)AC

  • IDCT

    (3) DCTDCTDCT

  • DCT

  • 2. FDCT00JPEG()

  • CCIR 601

  • 161110162440516117182447999999991212141926586055182126669999999914131624405769562426569999999999141722295187806247669999999999991822375668109103779999999999999999243555648110411392999999999999999949647887103121120101999999999999999972929598112100103999999999999999999

  • Sq(u,v)F(u,v)DCTQ(u,v)

  • 3. Z00Z

  • DCTZDCT881 64

    0156141527282471316262942381217253041439111824314044531019233239455254202233384651556021343747505659613536484957586263

  • 4. 88DCTDC88DCJPEG(DPCM)DC(Delta)Delta DC(0, 0)k - DC(0, 0)k-1

  • 5. AC16300(RLE)JPEG140400AC

  • 6. JPEGDPCMDCRLEACJPEGHuffmanHuffman(lookup table)HuffmanHuffman

  • DCDC(Value)4SSS3

    Value

    SSS

    0

    0

    -1, 1

    1

    -3, -2, 2, 3

    2

    -7...-4, 4...7

    3

  • JPEGDCHuffman

  • JPEGDCHuffman

  • JPEGACHuffman

  • JPEGACHuffman

  • 7.JPEGJPEG(JPEG bitstream)

  • JPEG FDCT

  • 8.3 JPEGJPEGJPEG(marker)JPEGC-Cube MicrosystemsEric Hamilton1992.9.1JFIF(JPEG File Interchange Format JPEG) 1.02JPEG(*.JPG)JPEG(Baseline DCT)JFIF

  • . 1. RGBYCrCb4:2:24:1:1JPEG1982CCIR 601ITU-R BT.6012568RGBYCbCr 2. 8*8

  • . JFIFJPEGJFIFBaselineHuffmanHuffman8*8MCU(Minimum Data Unit

  • . (Intel CPU)

    0xff, SOI(0xd8)0(APP0 marker segment)00xff, APP0(0xe0)2B()5B"JFIF\0"2B(1B,=1), (1B,2)1B=0XYXY=1/=2/X2BY2B

  • (Xthumbnail)1B(Ythumbnail)1B[(thumbnail)]3*Xthumbnail*Ythumbnail BXthumbnail=Ythumbnail=0 [n]n0xff, APPn(0xen) (n=0~15)2B(-2)B[]0xff, DQT(0xdb)2B1B Pm4=0(8b), 1(16b), Baseline=0Nm4=0,1,2,364*(Pm+1) BZ

  • Baseline0xff, SOF0(0xc0) (Baseline DCT)2B1B//Baseline=82BMCU=0(scan)DNL(0xff, 0xdc)2BMCUNC1Bkk=1~NC, NC1B1B (4=Hk; 4=Vk; =0,1,2,3)Qk1B (DCT=0,1,2,3; DPCM=0) (YCbCrNC=3, YID1=0, (H1,V1)=0x22, Q1=0; CbID2=1,(H2,V2)=0x11, Q2=1; CrID3=2, (H3,V3)=0x11, Q3=1)

  • [Huffman]Huffman0xff, DHT(0xc4)2BHuffman1B 4, =0(DC), 1(AC); 4, =0,1,2,3, Baseline0,116BL1~L16, Lk=kHuffmanLk BV[k,i]=ikBaseline0xff, SOS(0xda)2BNS1BNCkk=1~NS, NS1B{IDk}Huffman1BDC4, =0,1,2,3; AC4, =0,1,2,3; Baseline0,11B[Baseline]0

  • 1B[Baseline]0[DCT]63[0x3f]1B[Baseline]0MCU(Minimum Data Unit, MCUMCUMCU8*88*8MCU8*80xff0x000xff, EOI(0xd9)

  • . JITFJPEG(*.jpg)0xFF SOI(0xD8)0xFF APP0(0xE0) [0xFF APPn(0xEn) ]0xFF DQT(0xDB) 0xFF SOF0(0xC0) 0xFF DHT(0xC4) Huffman0xFF SOS(0xDA) 0xFF EOI(0xD9)

  • 1. JPEG8*8DCTDCT48*8lena.bmp16*16 ASCII

  • 98 9C 96 99 9C A1 A1 A6 B2 C9 EA E4 C9 B8 D3 E2

    94 95 95 96 98 A0 A1 A7 B3 CB E2 EA D3 CD E6 E2

    95 94 91 94 9D A3 A9 A6 A7 A9 B7 BC D4 D8 C0 B2

    8D 92 8F 94 8F 8F 8C 87 84 83 92 91 9D A2 98 90

    7F 7C 7B 74 72 73 72 6F 6F 6B 7A 7F 8B 85 5D 4E

    5A 61 6A 5D 58 54 4D 49 51 5F 6D 72 77 67 5C 54

    6A 72 74 73 74 74 6F 70 72 72 7F 89 8D 94 8B 7E

    77 7F 85 89 87 9A A2 A6 AE AF BE C9 CC C7 A2 89

    76 7A 7C 87 91 A3 B3 C3 C3 C0 C5 CF D5 C7 99 89

    7F 83 7F 7E 89 96 9A A2 A7 A3 9C 9E A6 A2 89 91

    7A 7F 81 7F 7F 8C 90 90 99 96 92 90 90 8C 8C 96

    7F 7B 77 77 7A 81 84 87 90 88 87 81 7F 8B 98 9A

    84 7E 7C 76 74 70 72 74 74 70 74 78 8C A2 9D 94

    85 81 87 88 83 7C 78 7C 80 85 8D 99 A0 A1 94 8D

    88 89 92 96 96 9A 9D 9D 9C 9E A1 A1 A1 9D 8D 94

    94 94 9C A1 A5 AB B2 AE A6 A5 A5 A6 A1 99 96 95

  • 2.4JPEGJPGBMPGIF

  • DCTJPEGJPEGDCACJPEGZRLEJPEGJPEG

  • JPEG*.JPGJPGJPG