NVIDIA DRIVE OS Linux API Reference

5.1.3.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nvmedia_ijpe.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2017, 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_IJPE_H
16 #define _NVMEDIA_IJPE_H
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 #include "nvmedia_common.h"
23 
35 #define NVMEDIA_IJPE_VERSION_MAJOR 1
36 
37 #define NVMEDIA_IJPE_VERSION_MINOR 3
38 
43 #define NVMEDIA_JPEG_ENC_FLAG_NONE (0 << 0)
44 
50 #define NVMEDIA_JPEG_ENC_FLAG_SKIP_SOI (1 << 0)
51 
56 #define NVMEDIA_IMAGE_JPEG_ATTRIBUTE_QUALITY (1 << 0)
57 
61 #define NVMEDIA_IMAGE_JPEG_ATTRIBUTE_RESTARTINTERVAL (1 << 1)
62 
66 #define NVMEDIA_IMAGE_JPEG_ATTRIBUTE_TARGETSIZE (1 << 2)
67 
71 #define NVMEDIA_IMAGE_JPEG_ATTRIBUTE_QUANTTABLE (1 << 3)
72 
76 #define NVMEDIA_IMAGE_JPEG_ATTRIBUTE_HUFFTABLE (1 << 4)
77 
81 typedef struct {
82  uint8_t length[16];
83  uint8_t *values;
85 
89 typedef struct {
95  uint8_t quality;
99  uint32_t restartInterval;
103  uint32_t targetImageSize;
107  uint8_t lumaQuant[64];
111  uint8_t chromaQuant[64];
137 
141 typedef struct {
144 } NvMediaIJPE;
145 
157  NvMediaVersion *version
158 );
159 
183 NvMediaIJPE *
185  NvMediaDevice *device,
186  NvMediaSurfaceType inputFormat,
187  uint8_t maxOutputBuffering,
188  uint32_t maxBitstreamBytes
189 );
190 
195 void NvMediaIJPEDestroy(NvMediaIJPE *encoder);
196 
218  NvMediaIJPE *encoder,
219  NvMediaImage *frame,
220  uint8_t quality
221 );
222 
244  NvMediaIJPE *encoder,
245  NvMediaImage *frame,
246  uint8_t *lumaQuant,
247  uint8_t *chromaQuant
248 );
249 
274  NvMediaIJPE *encoder,
275  NvMediaImage *frame,
276  uint8_t *lumaQuant,
277  uint8_t *chromaQuant,
278  uint32_t targetImageSize
279 );
280 
296  NvMediaIJPE *encoder,
297  uint32_t attributeMask,
298  void *attributes
299 );
300 
334  NvMediaIJPE *encoder,
335  uint32_t *numBytes,
336  void *buffer,
337  uint32_t flags
338 );
339 
366  NvMediaIJPE *encoder,
367  uint32_t *numBytes,
368  uint32_t numBitstreamBuffers,
369  const NvMediaBitstreamBuffer *bitstreams,
370  uint32_t flags
371 );
372 
419  NvMediaIJPE *encoder,
420  uint32_t *numBytesAvailable,
421  NvMediaBlockingType blockingType,
422  uint32_t millisecondTimeout
423 );
424 
425 /*
426  * \defgroup history_nvmedia_ijpe History
427  * Provides change history for the NvMedia Image Jpeg Encode API.
428  *
429  * \section history_nvmedia_ijpe Version History
430  *
431  * <b> Version 1.0 </b> November 9, 2015
432  * - Initial release
433  *
434  * <b> Version 1.1 </b> May 11, 2016
435  * - Added \ref NvMediaIJPECheckVersion API
436  *
437  * <b> Version 1.2 </b> Sep 19, 2016
438  * - Added \ref NvMediaIJPEGetBitsEx API
439  *
440  * <b> Version 1.3 </b> May 15, 2017
441  * - Added \ref NvMediaIJPEGetVersion API to get the version of NvMedia IJPE library
442  * - NvMediaIJPECheckVersion is deprecated. Use NvMediaIJPEGetVersion() instead
443  * - All NvMedia data types are moved to standard data types
444  */
445 
448 #ifdef __cplusplus
449 }; /* extern "C" */
450 #endif
451 
452 #endif /* _NVMEDIA_IJPE_H */
A handle representing image objects.
Definition: nvmedia_image.h:75
#define NvMediaSurfaceType
Defines the set of NvMedia surface types.
Holds an application data buffer containing compressed video data.
NvMediaIJPE * NvMediaIJPECreate(NvMediaDevice *device, NvMediaSurfaceType inputFormat, uint8_t maxOutputBuffering, uint32_t maxBitstreamBytes)
Creates a JPEG encoder object capable of turning a stream of surfaces of the inputFormat into a JPEG ...
NvMediaJPHuffmanTableSpecfication * lumaDC
A Huffmann table for Luma DC sample, initialized to NULL for using default table in JPEG specificatio...
Definition: nvmedia_ijpe.h:117
NvMediaStatus NvMediaIJPEGetVersion(NvMediaVersion *version)
Gets the version compatibility for the NvMedia IJPE library.
uint32_t restartInterval
A value to specify restart interval, initialized to 0 at NvMediaIJPE creation.
Definition: nvmedia_ijpe.h:99
NvMediaStatus NvMediaIJPESetAttributes(NvMediaIJPE *encoder, uint32_t attributeMask, void *attributes)
Sets the JPEG encoder attributes.
image JPEG encoder attributes.
Definition: nvmedia_ijpe.h:89
Holds NvMedia Version information.
Definition: nvmedia_core.h:252
image JPEG encoder object created by NvMediaIJPECreate.
Definition: nvmedia_ijpe.h:141
NVIDIA Media Interface: Common Types for Video/Image Encode/Decode
uint8_t quality
A value clamped to between 1 and 100, set to generate luma/chroma Quant tables.
Definition: nvmedia_ijpe.h:95
NvMediaStatus NvMediaIJPEFeedFrame(NvMediaIJPE *encoder, NvMediaImage *frame, uint8_t quality)
Encodes the specified frame with input quality.
NvMediaStatus
The set of all possible error codes.
Definition: nvmedia_core.h:199
NvMediaJPHuffmanTableSpecfication * chromaDC
A Huffmann table for Chroma DC sample, initialized to NULL for using default table in JPEG specificat...
Definition: nvmedia_ijpe.h:129
int uint32_t uint32_t uint32_t const uint32_t const uint32_t const uint32_t const uint64_t uint32_t uint32_t flags
NvMediaStatus NvMediaIJPEGetBits(NvMediaIJPE *encoder, uint32_t *numBytes, void *buffer, uint32_t flags)
Returns a frame's worth of bitstream into the provided buffer.
void NvMediaIJPEDestroy(NvMediaIJPE *encoder)
Destroys an NvMedia image JPEG encoder.
void NvMediaDevice
An opaque handle representing a NvMediaDevice object.
Definition: nvmedia_core.h:305
NvMediaStatus NvMediaIJPEFeedFrameQuant(NvMediaIJPE *encoder, NvMediaImage *frame, uint8_t *lumaQuant, uint8_t *chromaQuant)
Encodes the specified frame with input Luma and Chroma quant tables.
NvMediaStatus NvMediaIJPEGetBitsEx(NvMediaIJPE *encoder, uint32_t *numBytes, uint32_t numBitstreamBuffers, const NvMediaBitstreamBuffer *bitstreams, uint32_t flags)
Performs the same operation as NvMediaIJPEGetBits() except NvMediaIJPEGetBitsEx() consumes an array o...
NvMediaStatus NvMediaIJPEBitsAvailable(NvMediaIJPE *encoder, uint32_t *numBytesAvailable, NvMediaBlockingType blockingType, uint32_t millisecondTimeout)
Returns the encode status and number of bytes available for the next frame (if any).
NvMediaBlockingType
Blocking type.
image JPEG encoder HuffmanTable.
Definition: nvmedia_ijpe.h:81
NvMediaJPHuffmanTableSpecfication * chromaAC
A Huffmann table for Chroma AC sample, initialized to NULL for using default table in JPEG specificat...
Definition: nvmedia_ijpe.h:135
NvMediaJPHuffmanTableSpecfication * lumaAC
A Huffmann table for Luma AC sample, initialized to NULL for using default table in JPEG specificatio...
Definition: nvmedia_ijpe.h:123
uint32_t targetImageSize
A value to specify target encode size, initialized to 0xffffffff at NvMediaIJPE creation.
Definition: nvmedia_ijpe.h:103
NvMediaStatus NvMediaIJPEFeedFrameRateControl(NvMediaIJPE *encoder, NvMediaImage *frame, uint8_t *lumaQuant, uint8_t *chromaQuant, uint32_t targetImageSize)
Encodes the specified frame with input Luma and Chroma quant tables and targetImageSize.
NvMediaSurfaceType inputFormat
Input Image surface type.
Definition: nvmedia_ijpe.h:143