NVIDIA DRIVE OS Linux SDK API Reference

5.1.12.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nvmedia_ijpd.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2019, NVIDIA CORPORATION. All rights reserved. All
3  * information contained herein is proprietary and confidential to NVIDIA
4  * Corporation. Any use, reproduction, or disclosure without the written
5  * permission of NVIDIA Corporation is prohibited.
6  */
7 
15 #ifndef NVMEDIA_IJPD_H
16 #define NVMEDIA_IJPD_H
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
23 #include "nvmedia_core.h"
24 #include "nvmedia_image.h"
25 
36 #define NVMEDIA_IJPD_VERSION_MAJOR 1
37 
38 #define NVMEDIA_IJPD_VERSION_MINOR 7
39 
44 #define NVMEDIA_JPEG_DEC_ATTRIBUTE_ALPHA_VALUE (1 << 0)
45 
49 #define NVMEDIA_JPEG_DEC_ATTRIBUTE_COLOR_STANDARD (1 << 1)
50 
54 #define NVMEDIA_IJPD_RENDER_FLAG_ROTATE_0 0
55 
59 #define NVMEDIA_IJPD_RENDER_FLAG_ROTATE_90 1
60 
64 #define NVMEDIA_IJPD_RENDER_FLAG_ROTATE_180 2
65 
69 #define NVMEDIA_IJPD_RENDER_FLAG_ROTATE_270 3
70 
74 #define NVMEDIA_IJPD_RENDER_FLAG_FLIP_HORIZONTAL (1 << 2)
75 
79 #define NVMEDIA_IJPD_RENDER_FLAG_FLIP_VERTICAL (1 << 3)
80 
84 #define NVMEDIA_MAX_JPEG_APP_MARKERS 16
85 
89 typedef struct {
97  uint32_t alphaValue;
99 
103 typedef struct {
106  uint16_t marker;
109  uint16_t len;
112  void *pMarker;
114 
118 typedef struct {
121  uint16_t width;
124  uint16_t height;
127  uint8_t partialAccel;
135 
141 typedef struct {
143  uint16_t maxWidth;
145  uint16_t maxHeight;
151  struct NvMediaIJPDPriv_ *jpegDecPriv;
152 } NvMediaIJPD;
153 
165  NvMediaVersion *version
166 );
167 
184 NvMediaIJPD *
186  const NvMediaDevice *device,
187  uint16_t maxWidth,
188  uint16_t maxHeight,
189  uint32_t maxBitstreamBytes,
190  uint8_t supportPartialAccel
191 );
192 
197 void NvMediaIJPDDestroy(NvMediaIJPD *decoder);
198 
213  NvMediaIJPD *decoder,
214  uint16_t maxWidth,
215  uint16_t maxHeight,
216  uint32_t maxBitstreamBytes
217 );
218 
237  const NvMediaIJPD *decoder,
238  uint32_t attributeMask,
239  const void *attributes
240 );
241 
268  NVMEDIAJPEGDecInfo *info,
269  uint32_t numBitstreamBuffers,
270  const NvMediaBitstreamBuffer *bitstreams
271 );
272 
366  const NvMediaIJPD *decoder,
367  NvMediaImage *output,
368  const NvMediaRect *srcRect,
369  const NvMediaRect *dstRect,
370  uint8_t downscaleLog2,
371  uint32_t numBitstreamBuffers,
372  const NvMediaBitstreamBuffer *bitstreams,
373  uint32_t flags
374 );
375 
423  const NvMediaIJPD *decoder,
424  NvMediaImage *output,
425  uint8_t downscaleLog2,
426  uint32_t numBitstreamBuffers,
427  const NvMediaBitstreamBuffer *bitstreams,
428  uint32_t flags
429 );
430 
431 /*
432  * \defgroup history_nvmedia_ijpd History
433  * Provides change history for the NvMedia Image Jpeg Decode API.
434  *
435  * \section history_nvmedia_ijpd Version History
436  *
437  * <b> Version 1.0 </b> November 9, 2015
438  * - Initial release
439  *
440  * <b> Version 1.1 </b> May 11, 2016
441  * - Added \ref NvMediaIJPDCheckVersion API
442  *
443  * <b> Version 1.2 </b> May 15, 2017
444  * - Added \ref NvMediaIJPDGetVersion API to get the version of NvMedia IJPD library
445  * - NvMediaIJPDCheckVersion is deprecated. Use NvMediaIJPDGetVersion() instead
446  * - All NvMedia data types are moved to standard data types
447  *
448  * <b> Version 1.3 </b> October 5, 2017
449  * - Added \ref NvMediaJPEGAppMarkerInfo to store the App info.
450  *
451  * <b> Version 1.4 </b> January 15, 2019
452  * - Fix MISRA violations 8.13, 21.1 and 21.2
453  *
454  * <b> Version 1.5 </b> Feb 20, 2019
455  * - Added opaque pointer for jpeg decoder
456  * internal usage into jpeg decoder object
457  * - Fix MISRA violations 11.3
458  *
459  * <b> Version 1.6 </b> February 28, 2019
460  * - Add dependent header include nvmedia_core and nvmedia_image.h
461  *
462  * <b> Version 1.7 </b> July 10, 2019
463  * - Header include nvmedia_common.h is replaced with nvmedia_common_encode_decode.h
464  */
465 
468 #ifdef __cplusplus
469 }; /* extern "C" */
470 #endif
471 
472 #endif /* NVMEDIA_IJPD_H */
Holds image JPEG decoder marker Info.
Definition: nvmedia_ijpd.h:103
Holds a handle representing image objects.
Definition: nvmedia_image.h:69
Holds an application data buffer containing compressed video data.
uint8_t partialAccel
Specifies whether partial acceleration is needed for the stream.
Definition: nvmedia_ijpd.h:127
uint16_t height
Specifies the stream-encoded height, in pixels.
Definition: nvmedia_ijpd.h:124
struct NvMediaIJPDPriv_ * jpegDecPriv
An Opaque pointer for internal use.
Definition: nvmedia_ijpd.h:151
NvMediaStatus NvMediaIJPDGetVersion(NvMediaVersion *version)
Gets the version compatibility for the NvMedia IJPGD library.
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.
NVIDIA Media Interface: Image Processing
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.
NVIDIA Media Interface: Common Types for Video/Image Encode/Decode
uint16_t maxHeight
Max height of decoded JPEG image supported.
Definition: nvmedia_ijpd.h:145
uint8_t supportPartialAccel
Flag indicates support partial acceleration or not.
Definition: nvmedia_ijpd.h:149
Holds NvMedia version information.
Definition: nvmedia_core.h:226
struct NvMediaDevice NvMediaDevice
An opaque handle representing an NvMediaDevice object.
Definition: nvmedia_core.h:337
void NvMediaIJPDDestroy(NvMediaIJPD *decoder)
Destroys an NvMedia image JPEG decoder.
NvMediaColorStandard
Defines color standards.
Definition: nvmedia_core.h:108
uint32_t maxBitstreamBytes
Max size in bytes of JPEG bitstream supported.
Definition: nvmedia_ijpd.h:147
NVIDIA Media Interface: Core
NvMediaStatus
Defines all possible error codes.
Definition: nvmedia_core.h:169
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...
Holds image JPEG decoder stream information.
Definition: nvmedia_ijpd.h:118
uint8_t num_app_markers
Specifies the number of App merkers in the stream.
Definition: nvmedia_ijpd.h:130
void * pMarker
Specifies the App info marker data.
Definition: nvmedia_ijpd.h:112
int uint32_t uint32_t uint32_t const uint32_t const uint32_t const uint32_t const uint64_t uint32_t uint32_t flags
Holds a rectangular region of a surface.
Definition: nvmedia_core.h:133
#define NVMEDIA_MAX_JPEG_APP_MARKERS
JPEG decode max number of app markers supported.
Definition: nvmedia_ijpd.h:84
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.
uint16_t marker
Specifies the App info marker.
Definition: nvmedia_ijpd.h:106
Holds image JPEG decoder attributes.
Definition: nvmedia_ijpd.h:89
NvMediaStatus NvMediaIJPDSetAttributes(const NvMediaIJPD *decoder, uint32_t attributeMask, const void *attributes)
Sets attributes of an existing image JPEG decoder.
uint16_t len
Specifies the App info marker length.
Definition: nvmedia_ijpd.h:109
NvMediaColorStandard colorStandard
Specifies the color standard, defined in NvMediaColorStandard.
Definition: nvmedia_ijpd.h:93
NvMediaStatus NvMediaIJPDResize(NvMediaIJPD *decoder, uint16_t maxWidth, uint16_t maxHeight, uint32_t maxBitstreamBytes)
Resizes an existing image JPEG decoder.
uint16_t width
Specifies the stream-encoded width, in pixels.
Definition: nvmedia_ijpd.h:121
uint16_t maxWidth
Max width of decoded JPEG image supported.
Definition: nvmedia_ijpd.h:143
Holds information for decoding a JPEG stream into an image surface.
Definition: nvmedia_ijpd.h:141
uint32_t alphaValue
Specifies the alpha value.
Definition: nvmedia_ijpd.h:97