npp jpeg Quantization Functions

11 篇文章 0 订阅

https://docs.nvidia.com/cuda/npp/group__image__quantization.html

NVIDIA 2D Image And Signal Performance Primitives (NPP)  Version 10.0.1

Typedefs | Functions

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

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) 

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

ppStatePointer to pointer to DCT state structure.
nppStreamCtxApplication 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

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().
nppStreamCtxApplication Managed Stream Context.

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 
 )  

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

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().
nppStreamCtxApplication Managed Stream Context.

Returns

Error codes:

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

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).
nppStreamCtxApplication Managed Stream Context.

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 
 )  

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

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().
nppStreamCtxApplication Managed Stream Context.

Returns

Error codes:

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

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).
nppStreamCtxApplication Managed Stream Context.

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 
 )  

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

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().
nppStreamCtxApplication Managed Stream Context.

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-2019 NVIDIA Corporation

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值