Hardware Reference
In-Depth Information
and a range and forces the operand into the range, using the lowest or highest val-
ues for operands that fall outside it. Clipping can be done on 8-, 16-, or 32-bit op-
erands. For example, when clipping is performed with a range of 0 to 255 on 40
and 340, the clipped results are 40 and 255, respectively. The clip group performs
clip operations.
Group Description
Clip Clip 4 bytes or 2 half words
DSP absolute value Clipped, signed, absolute value
DSP add Clipped signed addition
DSP subtract Clipped signed subtraction
DSP multiply Clipped signed multiplication
Min, max Get minimum or maximum of four byte pairs
Compare Bytewise compare of two registers
Shift Shift a pair of 16-bit operands
Sum of products Signed sum of 8- or 16-bit products
Merge, pack, swap Byte and half word manipulation
Byte quad averages Unsigned byte-wise quad averaging
Byte averages
Unsigned byte-wise average of four elements
Byte multiplies
Unsigned 8-bit multiply
Motion estimation
Unsigned sum of absolute values of signed 8-bit diffs
Miscellaneous
Other arithmetic operations
Figure 8-5. The major groups of TriMedia custom operations.
The next four groups in Fig. 8-5 perform the indicated operation on operands
of various sizes, clipping the results into a specific range. The min, max group ex-
amines two registers and for each byte finds the smallest or largest value. Simi-
larly, the compare group regards two registers as four pairs of bytes and compares
each pair.
Multimedia operations are rarely performed on 32-bit integers because most
images are composed of RGB pixels with 8-bit values for each of the red, green,
and blue colors. When an image is being processed (e.g., compressed), it is nor-
mally represented by three components, one for each color (RGB space) or a logi-
cally equivalent form (YUV space, discussed later in this chapter). Either way, a
lot of processing is done on rectangular arrays containing 8-bit unsigned integers.
The TriMedia has a large number of operations specifically designed for proc-
essing arrays of 8-bit unsigned integers efficiently. As a simple example, consider
the upper left-hand corner of an array of 8-bit values stored in (big-endian) memo-
ry as illustrated in Fig. 8-6(a). The 4
4 block shown in the corner contains 16
8-bit values labeled A through P . Suppose, for example, that the image needs to be
transposed, to produce Fig. 8-6(b). How can this task be achieved?
×
 
Search WWH ::




Custom Search