Skip to content Skip to navigation

Connexions

You are here: Home » Content » Sync and Headers

Navigation

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

In these lenses

  • eScience, eResearch and Computational Problem Solving

    This module is included inLens: eScience, eResearch and Computational Problem Solving
    By: Jan E. OdegardAs a part of collection: "Image Coding"

    Click the "eScience, eResearch and Computational Problem Solving" link to see all content selected in this lens.

Recently Viewed

This feature requires Javascript to be enabled.
 

Sync and Headers

Module by: Nick Kingsbury. E-mail the author

Summary: This module briefly look at the sync codes and header information that are needed in order to complete the coding process.

We have described how individual 8×8 8 8 blocks of DCT coefficients are coded. Now we shall briefly look at the sync codes and header information that are needed in order to complete the coding process.

JPEG is rather complex in this aspect, so we shall just give an overview of the basic principles (see the JPEG Book, chapter 7 for the full picture).

JPEG data is divided into segments, each of which starts with a 2-byte marker.

All markers are byte-aligned - they start on the byte boundaries of the transmission/storage medium. Any variable-length data which precedes a marker is padded with extra ones to achieve this.

The first byte of each marker is FFH FFH . The second byte defines the type of marker.

To allow for recovery in the presence of errors, it must be possible to detect markers without decoding all of the intervening data. Hence markers must be unique. To achieve this, if an FFH FFH byte occurs in the middle of a segment, an extra 00H 00H stuffed byte is inserted after it and 00H 00H is never used as the second byte of a marker.

Some important markers in the order they are often used are:

Table 1
Name Code (hex) Purpose
SOI FFD8 Start of image.
COM FFFE Comment (segment ignored by decoder). Lseg Lseg , <Text comments>
DQT FFDB Define quantisation table(s). Lseg Lseg , < Qlum Qlum , Qchr Qchr … >
SOF0 SOF0 FFC0 Start of Baseline DCT frame. Lseg Lseg , <Frame size, no. of components (colours), sub-sampling factors, Q-table selectors>
DHT FFC4 Define Huffman table(s). Lseg Lseg , <DC Size and AC (Run,Size) tables for each component>
SOS FFDA Start of scan. Lseg Lseg , <Huffman table selectors for each component> <Entropy coded DCT blocks>
EOI FFD9 End of image.

In Table 1 the data which follows each marker is shown between <> brackets. The first 2-byte word of most segments is the length (in bytes) of the segment, Lseg Lseg . The length of <Entropy coded DCT blocks>, which forms the main bulk of the compressed data, is not specified explicitly, since it may be determined by decoding the entropy codes. This also allows the data to be transmitted with minimal delay, since it is not necessary to determine the total length of the compressed data before any of the DCT block data can be sent.

Long blocks of entropy-coded data are rather prone to being corrupted by transmission errors. To mitigate the worst aspects of this, Restart Markers (FFD0 → FFD7) may be included at regular intervals (say at the start of each row of DCT blocks in the image) so that separate parts of the entropy coded stream may be decoded independently of errors in other parts. The restart interval, if required, is defined by a DRI (FFDD) marker segment. There are 8 restart markers, which are used in sequence, so that if one (or more) is corrupted by errors, its absence may be easily detected.

The use of multiple scans within each image frame and multiple frames within a given image allows many variations on the ordering and interleaving of the compressed data. For example:

  • Chrominance and luminance components may be sent in separate scans or interleaved into a single scan.
  • Lower frequency DCT coefs may be sent in one or more scans before higher frequency coefs.
  • Coarsely quantised coefs may be sent in one or more scans before finer (refinement) coefs.
  • A coarsely sampled frame of the image may be sent initially and then the detail may be progressively improved by adding differentially-coded correction frames of increasing resolution.

Content actions

Download module as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Add module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks