IMG_yc_demux_le16_16


Detailed Description


Functions

void IMG_yc_demux_le16_16 (int n, const unsigned short *yc, short *restrict y, short *restrict cr, short *restrict cb)


Function Documentation

void IMG_yc_demux_le16_16 ( int  n,
const unsigned short *  yc,
short *restrict  y,
short *restrict  cr,
short *restrict  cb 
)

Description:
This function reads the halfword-oriented pixel data, zero-extends it, and then writes it to the appropriate result array. Both the luma and chroma values are expected to be unsigned.
The data is expected to be in an order consistent with reading byte oriented data from a word-oriented peripheral that is operating in LITTLE ENDIAN mode, while the CPU is in LITTLE ENDIAN mode. This function unpacks the byte-oriented data so that further processing may proceed in LITTLE ENDIAN mode.
Parameters:
n Number of luma pixels
yc Interleaved luma/chroma
y Luma plane (16-bit)
cr Cr chroma plane (16-bit)
cb Cb chroma plane (16-bit)
Algorithm:
The input array 'yc' is expected to be an interleaved 4:2:2 video stream. The input is expected in LITTLE ENDIAN byte order within each 4-byte word. This is consistent with reading the video stream from a word-oriented LITTLE ENDIAN device while the C6000 device is in a LITTLE ENDIAN configuration.
In other words, the expected pixel order is:
                                                                              
                      Word 0           Word 1          Word 2                 
                +-----------------+-----------------+-----------------+--      
          Byte# | 0   1  |  2   3 | 4   5  |  6   7 | 8   9  | 10  11 |...     
                |   y0   |   cr0  |   y1   |   cb0  |   y2   |   cr2  |...     
                +-----------------+-----------------+-----------------+--      
   
The output arrays 'y', 'cr', and 'cb' are expected to not overlap. The de-interleaved pixels are written as half-words in LITTLE ENDIAN order.
Please see the IMGLIB function IMB_yc_demux_be16_16 for code which handles input coming from a BIG ENDIAN device.
Assumptions:
  • Input and output arrays should be 32-bit aligned.
  • The input must be a multiple of 16 luma pixels
Implementation Notes:
  • This code is fully interruptible and fully reentrant
  • This code is compatible with C66x processors (though not optimized)
  • The loop has been unrolled a total of 16 times to allow for processing 8 pixels in each datapath.
Benchmarks:
See IMGLIB_Test_Report.html for cycle and memory information.


Copyright 2012, Texas Instruments Incorporated