Quantization Functions
Compression

## 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_Ctx (const Npp8u *pSrc, int nSrcStep, Npp16s *pDst, int nDstStep, const Npp16u *pQuantFwdTable, NppiSize oSizeROI, NppStreamContext nppStreamCtx)
| Forward DCT, quantization and level shift part of the JPEG encoding. More...
NppStatus | nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R (const Npp8u *pSrc, int nSrcStep, Npp16s *pDst, int nDstStep, const Npp16u *pQuantFwdTable, NppiSize oSizeROI)
NppStatus | nppiDCTQuantInv8x8LS_JPEG_16s8u_C1R_Ctx (const Npp16s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, const Npp16u *pQuantInvTable, NppiSize oSizeROI, NppStreamContext nppStreamCtx)
| Inverse DCT, de-quantization and level shift part of the JPEG decoding. More...
NppStatus | nppiDCTQuantInv8x8LS_JPEG_16s8u_C1R (const Npp16s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, const Npp16u *pQuantInvTable, NppiSize oSizeROI)
NppStatus | nppiDCTInitAlloc_Ctx (NppiDCTState **ppState, NppStreamContext nppStreamCtx)
| Initializes DCT state structure and allocates additional resources. More...
NppStatus | nppiDCTInitAlloc (NppiDCTState **ppState)
NppStatus | nppiDCTFree (NppiDCTState *pState)
| Frees the additional resources of the DCT state structure. More...
NppStatus | nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R_NEW_Ctx (const Npp8u *pSrc, int nSrcStep, Npp16s *pDst, int nDstStep, const Npp8u *pQuantizationTable, NppiSize oSizeROI, NppiDCTState *pState, NppStreamContext nppStreamCtx)
| Forward DCT, quantization and level shift part of the JPEG encoding. More...
NppStatus | nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R_NEW (const Npp8u *pSrc, int nSrcStep, Npp16s *pDst, int nDstStep, const Npp8u *pQuantizationTable, NppiSize oSizeROI, NppiDCTState *pState)
NppStatus | nppiDCTQuantInv8x8LS_JPEG_16s8u_C1R_NEW_Ctx (const Npp16s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, const Npp8u *pQuantizationTable, NppiSize oSizeROI, NppiDCTState *pState, NppStreamContext nppStreamCtx)
| Inverse DCT, de-quantization and level shift part of the JPEG decoding. More...
NppStatus | nppiDCTQuantInv8x8LS_JPEG_16s8u_C1R_NEW (const Npp16s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, const Npp8u *pQuantizationTable, NppiSize oSizeROI, NppiDCTState *pState)
NppStatus | nppiDCTQuant16Fwd8x8LS_JPEG_8u16s_C1R_NEW_Ctx (const Npp8u *pSrc, int nSrcStep, Npp16s *pDst, int nDstStep, const Npp16u *pQuantizationTable, NppiSize oSizeROI, NppiDCTState *pState, NppStreamContext nppStreamCtx)
| Forward DCT, quantization and level shift part of the JPEG encoding, 16-bit short integer. More...
NppStatus | nppiDCTQuant16Fwd8x8LS_JPEG_8u16s_C1R_NEW (const Npp8u *pSrc, int nSrcStep, Npp16s *pDst, int nDstStep, const Npp16u *pQuantizationTable, NppiSize oSizeROI, NppiDCTState *pState)
NppStatus | nppiDCTQuant16Inv8x8LS_JPEG_16s8u_C1R_NEW_Ctx (const Npp16s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, const Npp16u *pQuantizationTable, NppiSize oSizeROI, NppiDCTState *pState, NppStreamContext nppStreamCtx)
| Inverse DCT, de-quantization and level shift part of the JPEG decoding, 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)

## 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

  pState | 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 pState pointer is NULL

NppStatus nppiDCTInitAlloc | ( | NppiDCTState ** | ppState | ) |

NppStatus nppiDCTInitAlloc_Ctx | ( | NppiDCTState ** | ppState,
|  | NppStreamContext | nppStreamCtx
| ) |  |

Initializes DCT state structure and allocates additional resources.

See Also
  nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R_NEW(), nppiDCTQuantInv8x8LS_JPEG_16s8u_C1R_NEW.

Parameters

  ppState | Pointer to pointer to DCT state structure.
  nppStreamCtx | Application Managed Stream Context.

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
| ) |  |

NppStatus nppiDCTQuant16Fwd8x8LS_JPEG_8u16s_C1R_NEW_Ctx | ( | const Npp8u * | pSrc,
|  | int | nSrcStep,
|  | Npp16s * | pDst,
|  | int | nDstStep,
|  | const Npp16u * | pQuantizationTable,
|  | NppiSize | oSizeROI,
|  | NppiDCTState * | pState,
|  | NppStreamContext | nppStreamCtx
| ) |  |

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

  pSrc | Source-Image Pointer.
  nSrcStep | Source-Image Line Step.
  pDst | Destination-Image Pointer.
  nDstStep | Image width in pixels x 8 x sizeof(Npp16s).
  pQuantizationTable | Quantization Table in zig-zag order.
  oSizeROI | Region-of-Interest (ROI).
  pState | Pointer to DCT state structure. This structure must be initialized allocated and initialized using nppiDCTInitAlloc().
  nppStreamCtx | Application Managed Stream Context.

Returns
  Error codes:
  - NPP_SIZE_ERROR For negative input height/width or not a multiple of 8 width/height.
  - NPP_STEP_ERROR If input image width is not multiple of 8 or does not match ROI.
  - NPP_NULL_POINTER_ERROR If the destination pointer is 0.

NppStatus nppiDCTQuant16Inv8x8LS_JPEG_16s8u_C1R_NEW | ( | const Npp16s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | const Npp16u * | pQuantizationTable,
|  | NppiSize | oSizeROI,
|  | NppiDCTState * | pState
| ) |  |

NppStatus nppiDCTQuant16Inv8x8LS_JPEG_16s8u_C1R_NEW_Ctx | ( | const Npp16s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | const Npp16u * | pQuantizationTable,
|  | NppiSize | oSizeROI,
|  | NppiDCTState * | pState,
|  | NppStreamContext | nppStreamCtx
| ) |  |

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

  pSrc | Source-Image Pointer.
  nSrcStep | Image width in pixels x 8 x sizeof(Npp16s).
  pDst | Destination-Image Pointer.
  nDstStep | Destination-Image Line Step.
  pQuantizationTable | Quantization Table in zig-zag order.
  oSizeROI | Region-of-Interest (ROI).
  pState | Pointer to DCT state structure. This structure must be initialized allocated and initialized using nppiDCTInitAlloc().
  nppStreamCtx | Application Managed Stream Context.

Returns
  Error codes:
  - NPP_SIZE_ERROR For negative input height/width or not a multiple of 8 width/height.
  - NPP_STEP_ERROR If input image width is not multiple of 8 or does not match ROI.
  - NPP_NULL_POINTER_ERROR If the destination pointer is 0.

NppStatus nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R | ( | const Npp8u * | pSrc,
|  | int | nSrcStep,
|  | Npp16s * | pDst,
|  | int | nDstStep,
|  | const Npp16u * | pQuantFwdTable,
|  | NppiSize | oSizeROI
| ) |  |

NppStatus nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R_Ctx | ( | const Npp8u * | pSrc,
|  | int | nSrcStep,
|  | Npp16s * | pDst,
|  | int | nDstStep,
|  | const Npp16u * | pQuantFwdTable,
|  | NppiSize | oSizeROI,
|  | NppStreamContext | nppStreamCtx
| ) |  |

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

  pSrc | Source-Image Pointer.
  nSrcStep | Source-Image Line Step.
  pDst | Destination-Image Pointer.
  nDstStep | Destination-Image Line Step.
  pQuantFwdTable | Forward quantization tables for JPEG encoding created using nppiQuantInvTableInit_JPEG_8u16u().
  oSizeROI | Region-of-Interest (ROI).
  nppStreamCtx | Application Managed Stream Context.

Returns
  Error codes:
  - NPP_SIZE_ERROR For negative input height/width or not a multiple of 8 width/height.
  - NPP_STEP_ERROR If input image width is not multiple of 8 or does not match ROI.
  - NPP_NULL_POINTER_ERROR If the destination pointer is 0.

NppStatus nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R_NEW | ( | const Npp8u * | pSrc,
|  | int | nSrcStep,
|  | Npp16s * | pDst,
|  | int | nDstStep,
|  | const Npp8u * | pQuantizationTable,
|  | NppiSize | oSizeROI,
|  | NppiDCTState * | pState
| ) |  |

NppStatus nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R_NEW_Ctx | ( | const Npp8u * | pSrc,
|  | int | nSrcStep,
|  | Npp16s * | pDst,
|  | int | nDstStep,
|  | const Npp8u * | pQuantizationTable,
|  | NppiSize | oSizeROI,
|  | NppiDCTState * | pState,
|  | NppStreamContext | nppStreamCtx
| ) |  |

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

  pSrc | Source-Image Pointer.
  nSrcStep | Source-Image Line Step.
  pDst | Destination-Image Pointer.
  nDstStep | Image width in pixels x 8 x sizeof(Npp16s).
  pQuantizationTable | Quantization Table in zig-zag order.
  oSizeROI | Region-of-Interest (ROI).
  pState | Pointer to DCT state structure. This structure must be initialized allocated and initialized using nppiDCTInitAlloc().
  nppStreamCtx | Application Managed Stream Context.

Returns
  Error codes:
  - NPP_SIZE_ERROR For negative input height/width or not a multiple of 8 width/height.
  - NPP_STEP_ERROR If input image width is not multiple of 8 or does not match ROI.
  - NPP_NULL_POINTER_ERROR If the destination pointer is 0.

NppStatus nppiDCTQuantInv8x8LS_JPEG_16s8u_C1R | ( | const Npp16s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | const Npp16u * | pQuantInvTable,
|  | NppiSize | oSizeROI
| ) |  |

NppStatus nppiDCTQuantInv8x8LS_JPEG_16s8u_C1R_Ctx | ( | const Npp16s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | const Npp16u * | pQuantInvTable,
|  | NppiSize | oSizeROI,
|  | NppStreamContext | nppStreamCtx
| ) |  |

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

  pSrc | Source-Image Pointer.
  nSrcStep | Image width in pixels x 8 x sizeof(Npp16s).
  pDst | Destination-Image Pointer.
  nDstStep | Image width in pixels x 8 x sizeof(Npp16s).
  pQuantInvTable | Inverse quantization tables for JPEG decoding created using nppiQuantInvTableInit_JPEG_8u16u().
  oSizeROI | Region-of-Interest (ROI).
  nppStreamCtx | Application Managed Stream Context.

Returns
  Error codes:
  - NPP_SIZE_ERROR For negative input height/width or not a multiple of 8 width/height.
  - NPP_STEP_ERROR If input image width is not multiple of 8 or does not match ROI.
  - NPP_NULL_POINTER_ERROR If the destination pointer is 0.

NppStatus nppiDCTQuantInv8x8LS_JPEG_16s8u_C1R_NEW | ( | const Npp16s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | const Npp8u * | pQuantizationTable,
|  | NppiSize | oSizeROI,
|  | NppiDCTState * | pState
| ) |  |

NppStatus nppiDCTQuantInv8x8LS_JPEG_16s8u_C1R_NEW_Ctx | ( | const Npp16s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | const Npp8u * | pQuantizationTable,
|  | NppiSize | oSizeROI,
|  | NppiDCTState * | pState,
|  | NppStreamContext | nppStreamCtx
| ) |  |

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

  pSrc | Source-Image Pointer.
  nSrcStep | Image width in pixels x 8 x sizeof(Npp16s).
  pDst | Destination-Image Pointer.
  nDstStep | Destination-Image Line Step.
  pQuantizationTable | Quantization Table in zig-zag order.
  oSizeROI | Region-of-Interest (ROI).
  pState | Pointer to DCT state structure. This structure must be initialized allocated and initialized using nppiDCTInitAlloc().
  nppStreamCtx | Application Managed Stream Context.

Returns
  Error codes:
  - NPP_SIZE_ERROR For negative input height/width or not a multiple of 8 width/height.
  - NPP_STEP_ERROR If input image width is not multiple of 8 or does not match ROI.
  - NPP_NULL_POINTER_ERROR If the destination pointer is 0.

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

  hpQuantRawTable | Raw quantization table.
  nQualityFactor | Quality 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

  hpQuantRawTable | Host pointer to raw quantization table as returned by nppiQuantFwdRawTableInit_JPEG_8u(). The raw quantization table is assumed to be in zigzag order.
  hpQuantFwdRawTable | Forward 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

  hpQuantRawTable | Raw quantization table.
  hpQuantFwdRawTable | Inverse quantization table.

Returns
  NPP_NULL_POINTER_ERROR pQuantRawTable or pQuantFwdRawTable is0.

Copyright © 2009-2018 NVIDIA Corporation