The NvMediaIJPD object takes a JPEG bitstream and decompress it to image data.
Data Structures | |
struct | NVMEDIAJPEGDecAttributes |
Holds image JPEG decoder attributes. More... | |
struct | NvMediaJPEGAppMarkerInfo |
Holds image JPEG decoder marker Info. More... | |
struct | NVMEDIAJPEGDecInfo |
Holds image JPEG decoder stream information. More... | |
struct | NvMediaIJPD |
Holds information for decoding a JPEG stream into an image surface. More... | |
Macros | |
#define | NVMEDIA_IJPD_VERSION_MAJOR 1 |
Major version number. More... | |
#define | NVMEDIA_IJPD_VERSION_MINOR 7 |
Minor version number. More... | |
#define | NVMEDIA_JPEG_DEC_ATTRIBUTE_ALPHA_VALUE |
JPEG decode set alpha. More... | |
#define | NVMEDIA_JPEG_DEC_ATTRIBUTE_COLOR_STANDARD |
JPEG decode set color standard. More... | |
#define | NVMEDIA_IJPD_RENDER_FLAG_ROTATE_0 |
JPEG decode render flag rotate 0. More... | |
#define | NVMEDIA_IJPD_RENDER_FLAG_ROTATE_90 |
JPEG decode render flag rotate 90. More... | |
#define | NVMEDIA_IJPD_RENDER_FLAG_ROTATE_180 |
JPEG decode render flag rotate 180. More... | |
#define | NVMEDIA_IJPD_RENDER_FLAG_ROTATE_270 |
JPEG decode render flag rotate 270. More... | |
#define | NVMEDIA_IJPD_RENDER_FLAG_FLIP_HORIZONTAL |
JPEG decode render flag flip horizontal. More... | |
#define | NVMEDIA_IJPD_RENDER_FLAG_FLIP_VERTICAL |
JPEG decode render flag flip vertical. More... | |
#define | NVMEDIA_MAX_JPEG_APP_MARKERS |
JPEG decode max number of app markers supported. More... | |
Functions | |
NvMediaStatus | NvMediaIJPDGetVersion (NvMediaVersion *version) |
Gets the version compatibility for the NvMedia IJPGD library. More... | |
NvMediaIJPD * | NvMediaIJPDCreate (const NvMediaDevice *device, uint16_t maxWidth, uint16_t maxHeight, uint32_t maxBitstreamBytes, uint8_t supportPartialAccel) |
Creates a JPEG decoder object capable of decoding a JPEG stream into an image surface. More... | |
void | NvMediaIJPDDestroy (NvMediaIJPD *decoder) |
Destroys an NvMedia image JPEG decoder. More... | |
NvMediaStatus | NvMediaIJPDResize (NvMediaIJPD *decoder, uint16_t maxWidth, uint16_t maxHeight, uint32_t maxBitstreamBytes) |
Resizes an existing image JPEG decoder. More... | |
NvMediaStatus | NvMediaIJPDSetAttributes (const NvMediaIJPD *decoder, uint32_t attributeMask, const void *attributes) |
Sets attributes of an existing image JPEG decoder. More... | |
NvMediaStatus | NvMediaIJPDGetInfo (NVMEDIAJPEGDecInfo *info, uint32_t numBitstreamBuffers, const NvMediaBitstreamBuffer *bitstreams) |
A helper function that determines whether the JPEG decoder HW engine can decode the input JPEG stream. More... | |
NvMediaStatus | NvMediaIJPDRender (const NvMediaIJPD *decoder, NvMediaImage *output, const NvMediaRect *srcRect, const NvMediaRect *dstRect, uint8_t downscaleLog2, uint32_t numBitstreamBuffers, const NvMediaBitstreamBuffer *bitstreams, uint32_t flags) |
Decodes a JPEG image. More... | |
NvMediaStatus | NvMediaIJPDRenderYUV (const NvMediaIJPD *decoder, NvMediaImage *output, uint8_t downscaleLog2, uint32_t numBitstreamBuffers, const NvMediaBitstreamBuffer *bitstreams, uint32_t flags) |
Decodes a JPEG image into YUV format. More... | |
#define NVMEDIA_IJPD_RENDER_FLAG_FLIP_HORIZONTAL |
JPEG decode render flag flip horizontal.
Definition at line 74 of file nvmedia_ijpd.h.
#define NVMEDIA_IJPD_RENDER_FLAG_FLIP_VERTICAL |
JPEG decode render flag flip vertical.
Definition at line 79 of file nvmedia_ijpd.h.
#define NVMEDIA_IJPD_RENDER_FLAG_ROTATE_0 |
JPEG decode render flag rotate 0.
Definition at line 54 of file nvmedia_ijpd.h.
#define NVMEDIA_IJPD_RENDER_FLAG_ROTATE_180 |
JPEG decode render flag rotate 180.
Definition at line 64 of file nvmedia_ijpd.h.
#define NVMEDIA_IJPD_RENDER_FLAG_ROTATE_270 |
JPEG decode render flag rotate 270.
Definition at line 69 of file nvmedia_ijpd.h.
#define NVMEDIA_IJPD_RENDER_FLAG_ROTATE_90 |
JPEG decode render flag rotate 90.
Definition at line 59 of file nvmedia_ijpd.h.
#define NVMEDIA_IJPD_VERSION_MAJOR 1 |
Major version number.
Definition at line 36 of file nvmedia_ijpd.h.
#define NVMEDIA_IJPD_VERSION_MINOR 7 |
Minor version number.
Definition at line 38 of file nvmedia_ijpd.h.
#define NVMEDIA_JPEG_DEC_ATTRIBUTE_ALPHA_VALUE |
JPEG decode set alpha.
Definition at line 44 of file nvmedia_ijpd.h.
#define NVMEDIA_JPEG_DEC_ATTRIBUTE_COLOR_STANDARD |
JPEG decode set color standard.
Definition at line 49 of file nvmedia_ijpd.h.
#define NVMEDIA_MAX_JPEG_APP_MARKERS |
JPEG decode max number of app markers supported.
Definition at line 84 of file nvmedia_ijpd.h.
NvMediaIJPD* NvMediaIJPDCreate | ( | const NvMediaDevice * | device, |
uint16_t | maxWidth, | ||
uint16_t | maxHeight, | ||
uint32_t | maxBitstreamBytes, | ||
uint8_t | supportPartialAccel | ||
) |
Creates a JPEG decoder object capable of decoding a JPEG stream into an image surface.
[in] | device | The device this image JPEG decoder will use. |
[in] | maxWidth | The maximum width of output surface to support. you can use NvMediaIJPDResize() to enlarge this limit for an existing decoder. |
[in] | maxHeight | The maximum height of output surface to support. You can use NvMediaIJPDResize () to enlarge this limit for an existing decoder. |
[in] | maxBitstreamBytes | The maximum JPEG bitstream size in bytes to support. Use NvMediaIJPDResize () to enlarge this limit for an existing decoder. |
[in] | supportPartialAccel | Indicates that the JPEG decode object supports partial acceleration. If it does, set this argument to the character '1' (true). If it does not, set this argument to the character '0' (false). |
NvMediaIJPD | The new image JPEG decoder handle or NULL if unsuccessful. |
void NvMediaIJPDDestroy | ( | NvMediaIJPD * | decoder | ) |
Destroys an NvMedia image JPEG decoder.
[in] | decoder | A pointer to the JPEG decoder to destroy. |
NvMediaStatus NvMediaIJPDGetInfo | ( | NVMEDIAJPEGDecInfo * | info, |
uint32_t | numBitstreamBuffers, | ||
const NvMediaBitstreamBuffer * | bitstreams | ||
) |
A helper function that determines whether the JPEG decoder HW engine can decode the input JPEG stream.
Possible outcomes are:
NvMediaIJPDCreate
() supportPartialAccel parameter.[in,out] | info | A pointer to the information to be filled. |
[in] | numBitstreamBuffers | The number of bitstream buffers. |
[in] | bitstreams | The bitstream buffer. |
NvMediaStatus NvMediaIJPDGetVersion | ( | NvMediaVersion * | version | ) |
Gets the version compatibility for the NvMedia IJPGD library.
[in] | version | A pointer to a NvMediaVersion structure of the client. |
NvMediaStatus NvMediaIJPDRender | ( | const NvMediaIJPD * | decoder, |
NvMediaImage * | output, | ||
const NvMediaRect * | srcRect, | ||
const NvMediaRect * | dstRect, | ||
uint8_t | downscaleLog2, | ||
uint32_t | numBitstreamBuffers, | ||
const NvMediaBitstreamBuffer * | bitstreams, | ||
uint32_t | flags | ||
) |
Decodes a JPEG image.
The decode pipeline produces a result equivalent to the following sequence:
Downscales the 8x8 block padded image by the downscaleLog2 factor. That is, a "width" by "height" JPEG is downscaled to:
((width + 7) & ~7) >> downscaleLog2
by
((height + 7) & ~7) >> downscaleLog2
The JPEG decoder object must have maxWidth and maxHeight values that are greater than or equal to the post-downscale JPEG image. Additionally, it must have a maxBitstreamBytes value that is greater than or equal to the total number of bytes in the bitstream buffers. You set these values when you create the JPEG decoder object with NvMediaIJPDCreate(). Alternatively, you can user NvMediaIJPDResize() to change the dimensions of an existing JPEG decoder object.
If the JPEG decoder object has inadequate dimensions, NvMediaIJPDRender
() returns NVMEDIA_STATUS_INSUFFICIENT_BUFFERING.
If the JPEG stream requires partial acceleration, created the JPEG decoder object with supportPartialAccel set to '1'. Otherwise, the function returns NVMEDIA_STATUS_BAD_PARAMETER.
Use NvMediaIJPDGetInfo() to determine whether a stream requires paritialAccel.
If the JPEG stream is not supported, the function returns NVMEDIA_STATUS_NOT_SUPPORTED.
Use NvMediaIJPDGetInfo
() to determine whether a stream is unsupported.
NvMediaIJPDRender
() with the NVJPG 1.0 codec does not support rotation.[in] | decoder | A pointer to the JPEG decoder to use. |
[in] | output | The video surface to render to. This surface type must be obtained by NvMediaSurfaceFormatGetType with NVM_SURF_FMT_SET_ATTR_RGBA(attr, RGBA, UINT, 8, PL) |
[in] | srcRect | The source rectangle. The rectangle from the post-downscaled image to be transformed and scaled to the dstRect. You can achieve horizontal and/or vertical mirroring by swapping the left-right and/or top-bottom coordinates. If NULL, the full post-downscaled surface is implied. |
[in] | dstRect | The destination rectangle on the output surface. If NULL, a rectangle the full size of the output surface is implied. |
[in] | downscaleLog2 | A value clamped between 0 and 3 inclusive, gives downscale factors of 1 to 8. |
[in] | numBitstreamBuffers | The number of bitstream buffers. |
[in] | bitstreams | The bitstream buffer. NvMediaIJPDRender () copies the data out of these buffers so the caller is free to reuse them as soon as NvMediaIJPDRender () returns. |
[in] | flags | Flags that specify a clockwise rotation of the source in degrees and horizontal and vertical flipping. If both are specified, the image is flipped before it is rotated. You can set the flags argument to any one of the following:
|
NvMediaStatus NvMediaIJPDRenderYUV | ( | const NvMediaIJPD * | decoder, |
NvMediaImage * | output, | ||
uint8_t | downscaleLog2, | ||
uint32_t | numBitstreamBuffers, | ||
const NvMediaBitstreamBuffer * | bitstreams, | ||
uint32_t | flags | ||
) |
Decodes a JPEG image into YUV format.
This function is similar to NvMediaIJPDRender() except that the output surface is in YUV format, not RGBA format. Also, clipping and scaling (other than downscaleLog2 scaling) are not supported, so there are no source or destination rectangle parameters.
NvMediaIJPDRenderYUV
() with the NVJPG 1.0 codec has the following limitations: [in] | decoder | A pointer to the JPEG decoder to use. |
[in] | output | The video surface to render to. This surface type must be obtained by /ref NvMediaSurfaceFormatGetType with: NVM_SURF_FMT_SET_ATTR_YUV(attr, YUV, 420, SEMI_PLANAR/PLANAR, UINT, 8, PL) NVM_SURF_FMT_SET_ATTR_YUV(attr, YUV, 422, SEMI_PLANAR/PLANAR, UINT, 8, PL) NVM_SURF_FMT_SET_ATTR_YUV(attr, YUV, 444, SEMI_PLANAR/PLANAR, UINT, 8, PL) |
[in] | downscaleLog2 | A value between 0 and 3 inclusive that gives downscale factors of 1 to 8. |
[in] | numBitstreamBuffers | The number of bitstream buffers. |
[in] | bitstreams | The bitstream buffer. NvMediaIJPDRenderYUV () copies the data out of these buffers so the caller is free to reuse them as soon as NvMediaIJPDRenderYUV () returns. |
[in] | flags | Flags that specify a clockwise rotation of the source in degrees and horizontal and vertical flipping. If both are specified, flipping is performed before rotating. You can set the flags argument to any one of the following:
|
NvMediaStatus NvMediaIJPDResize | ( | NvMediaIJPD * | decoder, |
uint16_t | maxWidth, | ||
uint16_t | maxHeight, | ||
uint32_t | maxBitstreamBytes | ||
) |
Resizes an existing image JPEG decoder.
[in] | decoder | A pointer to the JPEG decoder to use. |
[in] | maxWidth | The new maximum width of output surface to support. |
[in] | maxHeight | The new maximum height of output surface to support. |
[in] | maxBitstreamBytes | The new maximum JPEG bitstream size in bytes to support. |
NvMediaStatus NvMediaIJPDSetAttributes | ( | const NvMediaIJPD * | decoder, |
uint32_t | attributeMask, | ||
const void * | attributes | ||
) |
Sets attributes of an existing image JPEG decoder.
[in] | decoder | A pointer to the JPEG decoder to use. |
[in] | attributeMask | An attribute mask. Supported mask are: |
[in] | attributes | Attributes data. Supported attribute structures: |