
22
Integrated JPEG CODEC
6.5 Data Flow Overview
This section provides an overview of the data flow in the
ZR36060 during compression and decompression. For this
purpose it is useful to view the ZR36060 (see Figure 30 through
Figure 33) roughly as a JPEG engine with one dual port data
buffer on each side: the code FIFO buffer on one side and the
video buffer (strip buffer) on the other side.
6.5.1 Data Flow in Compression
The video input, after being processed in the video interface, is
written to the strip buffer in raster format. The JPEG engine
reads out the data in block format, and writes the JPEG code into
the code FIFO on the other side. From the FIFO the data is trans-
ferred out either by the ZR36060 itself, if it is the code bus
master, or by the host controller, if the ZR36060 is in code slave
mode.
When the ZR36060 is the code bus master (see Figure 30) it
writes out the code as long as its CBUSY input is not asserted.
When the code FIFO is empty the ZR36060 does not perform
code write cycles. If the host controller is too slow and it asserts
CBUSY for too long, the code FIFO might fill up. In order to
prevent overflow, the ZR36060 stops reading data from the Strip
buffer. If this situation continues long enough, the Strip buffer
overflows, because video keeps flowing in. A Strip buffer
overflow is a data corruption event. At the system level this event
may be prevented by two means: First, the host should be able
to accept the code at the same rate it is generated by the
ZR36060. Second, some system configurations may have the
capability to halt the video input stream when the Strip buffer is
close to overflow (16 pixels, or less, from overflow). The
ZR36060 indicates this “nearly full” condition with its RTBSY
output. One configuration for implementing this is if the ZR36060
is the master of the video syncs, and the system stops the video
using the PVALID input. This may be useful, for example, when
compressing still pictures.
When the code interface operates in slave mode (see Figure 31)
the scenario is almost identical. The main difference is that
CBUSY is now an output of the ZR36060, and it is used to
indicate that the code FIFO is “nearly empty”, thus the host must
stop reading out the code until CBUSY indicates that the FIFO
occupancy is above its threshold.
6.5.2 Data Flow in Decompression
The JPEG code is transferred on the code bus into the code
FIFO, either by the ZR36060, in Code Master mode, or by the
host, in Code Slave mode. The JPEG codec engine writes the
decoded video into the Strip buffer in block format. The video
interface reads the video out in raster format, executes the post-
processing operations and outputs the video on the digital video
bus.
When the ZR36060 is the code bus master (see Figure 32) it
reads in the code as long as its CBUSY input is not asserted.
Whenever the code FIFO is full the ZR36060 stops reading code
in. If the host controller is too slow and it asserts CBUSY for too
long, the code FIFO may become empty. In order to prevent
underflow the ZR36060 stops writing data into the Strip buffer. If
this situation continues long enough, the strip buffer underflows,
because the video unit keeps reading out video from the Strip
buffer, in order to keep up with the timing of the digital video bus.
A Strip buffer underflow is a data corruption event. At the system
level this event may be prevented by two means: First, the
system should be able to provide the code at the rate it is
required by the ZR36060. Second, some system configurations
may have the capability to stop the video output stream when the
Strip buffer is close to underflow (16 pixels, or less, away from
underflow). The ZR36060 indicates this “nearly empty” condition
with its RTBSY output. One configuration for implementing this
is if the ZR36060 is the master of the video syncs, and the
Figure 29. IDLE to WAIT-ACTIVE state transistion
START
(async)
FRAME
(async)
END
state
IDLE
WAIT ACTIVE
Tb
System decides to
compress the next field
(pulls START low).
System senses END deasserted,
so deasserts START to compress
next field only, then stop.
Tb = Delay while the ZR36060 completes execution of the Load command.
Figure 30. Data Flow in Compression, Code Master
Video Bus
Strip Memory
JPEG Codec
CODE FIFO
CODE Bus
RTBSY
CBUSY CCS
Figure 31. Data Flow in Compression, Code Master
Video Bus
Strip Memory
JPEG Codec
CODE FIFO
CODE Bus
RTBSY
CBUSY CCS