NVIDIA Performance Primitives (NPP)  Version 10.0
Typedefs | Functions
Quantization Functions

Typedefs

typedef struct NppiDCTState NppiDCTState
 

Functions

NppStatus nppiQuantFwdRawTableInit_JPEG_8u (Npp8u *hpQuantRawTable, int nQualityFactor)
 Apply quality factor to raw 8-bit quantization table. More...
 
NppStatus nppiQuantFwdTableInit_JPEG_8u16u (const Npp8u *hpQuantRawTable, Npp16u *hpQuantFwdRawTable)
 Initializes a quantization table for nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R(). More...
 
NppStatus nppiQuantInvTableInit_JPEG_8u16u (const Npp8u *hpQuantRawTable, Npp16u *hpQuantFwdRawTable)
 Initializes a quantization table for nppiDCTQuantInv8x8LS_JPEG_16s8u_C1R(). More...
 
NppStatus nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R (const Npp8u *pSrc, int nSrcStep, Npp16s *pDst, int nDstStep, const Npp16u *pQuantFwdTable, NppiSize oSizeROI)
 Forward DCT, quantization and level shift part of the JPEG encoding. More...
 
NppStatus nppiDCTQuantInv8x8LS_JPEG_16s8u_C1R (const Npp16s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, const Npp16u *pQuantInvTable, NppiSize oSizeROI)
 Inverse DCT, de-quantization and level shift part of the JPEG decoding. More...
 
NppStatus nppiDCTInitAlloc (NppiDCTState **ppState)
 Initializes DCT state structure and allocates additional resources. More...
 
NppStatus nppiDCTFree (NppiDCTState *pState)
 Frees the additional resources of the DCT state structure. More...
 
NppStatus nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R_NEW (const Npp8u *pSrc, int nSrcStep, Npp16s *pDst, int nDstStep, const Npp8u *pQuantizationTable, NppiSize oSizeROI, NppiDCTState *pState)
 Forward DCT, quantization and level shift part of the JPEG encoding. More...
 
NppStatus nppiDCTQuantInv8x8LS_JPEG_16s8u_C1R_NEW (const Npp16s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, const Npp8u *pQuantizationTable, NppiSize oSizeROI, NppiDCTState *pState)
 Inverse DCT, de-quantization and level shift part of the JPEG decoding. More...
 
NppStatus nppiDCTQuant16Fwd8x8LS_JPEG_8u16s_C1R_NEW (const Npp8u *pSrc, int nSrcStep, Npp16s *pDst, int nDstStep, const Npp16u *pQuantizationTable, NppiSize oSizeROI, NppiDCTState *pState)
 Forward DCT, quantization and level shift part of the JPEG encoding, 16-bit short integer. More...
 
NppStatus nppiDCTQuant16Inv8x8LS_JPEG_16s8u_C1R_NEW (const Npp16s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, const Npp16u *pQuantizationTable, NppiSize oSizeROI, NppiDCTState *pState)
 Inverse DCT, de-quantization and level shift part of the JPEG decoding, 16-bit short integer. More...
 

Detailed Description

Typedef Documentation

typedef struct NppiDCTState NppiDCTState

Function Documentation

NppStatus nppiDCTFree ( NppiDCTState pState)

Frees the additional resources of the DCT state structure.

See Also
nppiDCTInitAlloc
Parameters
pStatePointer to DCT state structure.
Returns
NPP_SUCCESS Indicates no error. Any other value indicates an error or a warning
NPP_SIZE_ERROR Indicates an error condition if any image dimension has zero or negative value
NPP_NULL_POINTER_ERROR Indicates an error condition if pState pointer is NULL
NppStatus nppiDCTInitAlloc ( NppiDCTState **  ppState)

Initializes DCT state structure and allocates additional resources.

See Also
nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R_NEW(), nppiDCTQuantInv8x8LS_JPEG_16s8u_C1R_NEW.
Parameters
ppStatePointer to pointer to DCT state structure.
Returns
NPP_SUCCESS Indicates no error. Any other value indicates an error or a warning
NPP_SIZE_ERROR Indicates an error condition if any image dimension has zero or negative value
NPP_NULL_POINTER_ERROR Indicates an error condition if pBufSize pointer is NULL
NppStatus nppiDCTQuant16Fwd8x8LS_JPEG_8u16s_C1R_NEW ( const Npp8u pSrc,
int  nSrcStep,
Npp16s pDst,
int  nDstStep,
const Npp16u pQuantizationTable,
NppiSize  oSizeROI,
NppiDCTState pState 
)

Forward DCT, quantization and level shift part of the JPEG encoding, 16-bit short integer.

Input is expected in 8x8 macro blocks and output is expected to be in 64x1 macro blocks. The new version of the primitive takes the ROI in image pixel size and works with DCT coefficients that are in zig-zag order.

Parameters
pSrcSource-Image Pointer.
nSrcStepSource-Image Line Step.
pDstDestination-Image Pointer.
nDstStepImage width in pixels x 8 x sizeof(Npp16s).
pQuantizationTableQuantization Table in zig-zag order.
oSizeROIRegion-of-Interest (ROI).
pStatePointer to DCT state structure. This structure must be initialized allocated and initialized using nppiDCTInitAlloc().
Returns
Error codes:
NppStatus nppiDCTQuant16Inv8x8LS_JPEG_16s8u_C1R_NEW ( const Npp16s pSrc,
int  nSrcStep,
Npp8u pDst,
int  nDstStep,
const Npp16u pQuantizationTable,
NppiSize  oSizeROI,
NppiDCTState pState 
)

Inverse DCT, de-quantization and level shift part of the JPEG decoding, 16-bit short integer.

Input is expected in 64x1 macro blocks and output is expected to be in 8x8 macro blocks. The new version of the primitive takes the ROI in image pixel size and works with DCT coefficients that are in zig-zag order.

Parameters
pSrcSource-Image Pointer.
nSrcStepImage width in pixels x 8 x sizeof(Npp16s).
pDstDestination-Image Pointer.
nDstStepDestination-Image Line Step.
pQuantizationTableQuantization Table in zig-zag order.
oSizeROIRegion-of-Interest (ROI).
pStatePointer to DCT state structure. This structure must be initialized allocated and initialized using nppiDCTInitAlloc().
Returns
Error codes:
NppStatus nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R ( const Npp8u pSrc,
int  nSrcStep,
Npp16s pDst,
int  nDstStep,
const Npp16u pQuantFwdTable,
NppiSize  oSizeROI 
)

Forward DCT, quantization and level shift part of the JPEG encoding.

Input is expected in 8x8 macro blocks and output is expected to be in 64x1 macro blocks.

Parameters
pSrcSource-Image Pointer.
nSrcStepSource-Image Line Step.
pDstDestination-Image Pointer.
nDstStepDestination-Image Line Step.
pQuantFwdTableForward quantization tables for JPEG encoding created using nppiQuantInvTableInit_JPEG_8u16u().
oSizeROIRegion-of-Interest (ROI).
Returns
Error codes:
NppStatus nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R_NEW ( const Npp8u pSrc,
int  nSrcStep,
Npp16s pDst,
int  nDstStep,
const Npp8u pQuantizationTable,
NppiSize  oSizeROI,
NppiDCTState pState 
)

Forward DCT, quantization and level shift part of the JPEG encoding.

Input is expected in 8x8 macro blocks and output is expected to be in 64x1 macro blocks. The new version of the primitive takes the ROI in image pixel size and works with DCT coefficients that are in zig-zag order.

Parameters
pSrcSource-Image Pointer.
nSrcStepSource-Image Line Step.
pDstDestination-Image Pointer.
nDstStepImage width in pixels x 8 x sizeof(Npp16s).
pQuantizationTableQuantization Table in zig-zag order.
oSizeROIRegion-of-Interest (ROI).
pStatePointer to DCT state structure. This structure must be initialized allocated and initialized using nppiDCTInitAlloc().
Returns
Error codes:
NppStatus nppiDCTQuantInv8x8LS_JPEG_16s8u_C1R ( const Npp16s pSrc,
int  nSrcStep,
Npp8u pDst,
int  nDstStep,
const Npp16u pQuantInvTable,
NppiSize  oSizeROI 
)

Inverse DCT, de-quantization and level shift part of the JPEG decoding.

Input is expected in 64x1 macro blocks and output is expected to be in 8x8 macro blocks.

Parameters
pSrcSource-Image Pointer.
nSrcStepImage width in pixels x 8 x sizeof(Npp16s).
pDstDestination-Image Pointer.
nDstStepImage width in pixels x 8 x sizeof(Npp16s).
pQuantInvTableInverse quantization tables for JPEG decoding created using nppiQuantInvTableInit_JPEG_8u16u().
oSizeROIRegion-of-Interest (ROI).
Returns
Error codes:
NppStatus nppiDCTQuantInv8x8LS_JPEG_16s8u_C1R_NEW ( const Npp16s pSrc,
int  nSrcStep,
Npp8u pDst,
int  nDstStep,
const Npp8u pQuantizationTable,
NppiSize  oSizeROI,
NppiDCTState pState 
)

Inverse DCT, de-quantization and level shift part of the JPEG decoding.

Input is expected in 64x1 macro blocks and output is expected to be in 8x8 macro blocks. The new version of the primitive takes the ROI in image pixel size and works with DCT coefficients that are in zig-zag order.

Parameters
pSrcSource-Image Pointer.
nSrcStepImage width in pixels x 8 x sizeof(Npp16s).
pDstDestination-Image Pointer.
nDstStepDestination-Image Line Step.
pQuantizationTableQuantization Table in zig-zag order.
oSizeROIRegion-of-Interest (ROI).
pStatePointer to DCT state structure. This structure must be initialized allocated and initialized using nppiDCTInitAlloc().
Returns
Error codes:
NppStatus nppiQuantFwdRawTableInit_JPEG_8u ( Npp8u hpQuantRawTable,
int  nQualityFactor 
)

Apply quality factor to raw 8-bit quantization table.

This is effectively and in-place method that modifies a given raw quantization table based on a quality factor. Note that this method is a host method and that the pointer to the raw quantization table is a host pointer.

Parameters
hpQuantRawTableRaw quantization table.
nQualityFactorQuality factor for the table. Range is [1:100].
Returns
Error code: NPP_NULL_POINTER_ERROR is returned if hpQuantRawTable is 0.
NppStatus nppiQuantFwdTableInit_JPEG_8u16u ( const Npp8u hpQuantRawTable,
Npp16u hpQuantFwdRawTable 
)

Initializes a quantization table for nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R().

The method creates a 16-bit version of the raw table and converts the data order from zigzag layout to original row-order layout since raw quantization tables are typically stored in zigzag format.

This method is a host method. It consumes and produces host data. I.e. the pointers passed to this function must be host pointers. The resulting table needs to be transferred to device memory in order to be used with nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R() function.

Parameters
hpQuantRawTableHost pointer to raw quantization table as returned by nppiQuantFwdRawTableInit_JPEG_8u(). The raw quantization table is assumed to be in zigzag order.
hpQuantFwdRawTableForward quantization table for use with nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R().
Returns
Error code: NPP_NULL_POINTER_ERROR pQuantRawTable is 0.
NppStatus nppiQuantInvTableInit_JPEG_8u16u ( const Npp8u hpQuantRawTable,
Npp16u hpQuantFwdRawTable 
)

Initializes a quantization table for nppiDCTQuantInv8x8LS_JPEG_16s8u_C1R().

 The nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R() method uses a quantization table

in a 16-bit format allowing for faster processing. In addition it converts the data order from zigzag layout to original row-order layout. Typically raw quantization tables are stored in zigzag format.

This method is a host method and consumes and produces host data. I.e. the pointers passed to this function must be host pointers. The resulting table needs to be transferred to device memory in order to be used with nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R() function.

Parameters
hpQuantRawTableRaw quantization table.
hpQuantFwdRawTableInverse quantization table.
Returns
NPP_NULL_POINTER_ERROR pQuantRawTable or pQuantFwdRawTable is0.

Copyright © 2009-2017 NVIDIA Corporation