RM0082
LS_JPEG codec
Doc ID 018672 Rev 1
557/844
25.3.2
Main functions description
As one can see from the block diagram (
), the main building blocks of the JPGC
are five:
●
The Codec Core;
●
The Codec Controller;
●
The DMA controller (DMAC);
●
The FIFO buffers (FIFO in and FIFO out);
●
The Internal Memories.
A general description follows each of these blocks, while a comprehensive discussion of
their internal registers from the programmer’s standpoint is the object of
.
25.3.3 Codec
core
The
Codec Core
implements all the steps necessary to encode and decode image data
according to the JPEG baseline algorithm as specified in
ISO/IEC 10918-1
. It is specifically
designed to accelerate entropy-coded segment (ECS) encoding and decoding, because this
forms the most computing-intensive part of the baseline JPEG algorithm.
The Codec Core can enable/disable header processing. If disabled, only the ECS data are
generated/decoded. Support for restart markers is also provided: the Codec Core
recognizes them in the encoded stream when decoding, and can optionally insert them
when encoding.
JPEG encoded data streams decoded by the Codec Core must be compliant with the
interchange format syntax specified in the ISO/IEC 10918-1. Also JFIF images, the de facto
standard used to encoded JPEG images, is supported.
Before any coding process can start, the codec core, together with the
DMAC
and the
Internal Memories, must be programmed, by writing to the corresponding registers.
The Codec Core receives from the
FIFO in
buffer its input data, which can be either a
sequence of
Minimum Coded Units
(MCU) (if the JPGC is used as an encoder from YUV
MCU’s to JPEG) or a stream of
Entropy Coded Segments
(ECS) (if the JPGC is used as a
decoder from JPEG to YUV MCU’s). Conversely, output data from the codec core are sent
to the
FIFO Out
buffer as an ECS stream (resp. MCU sequence), whenever the JPGC is
working as an encoder (resp. decoder).
25.3.4 Codec
controller
The
Codec Controller
manages the data flow between the Codec Core and the FIFO buffers
between the FIFO buffers and the external RAM. In order to accomplish the latter task, it
uses the
DMAC
to perform fast data transfers.
Due to area optimization of the JPGC block, encoding and decoding operations performed
by the Codec Core cannot be simultaneous. Thus the Codec Controller is in charge to
assure that only a given data path (JPEG data from RAM -> JPGC -> YUV MCU data to
RAM, or the opposite) is active at a certain time.
25.3.5 DMAC
The
DMA controller
is exploited by the codec controller to perform fast data transfers from/to
external RAM to/from the internal FIFO buffers. The DMAC has to be programmed with the