Class NPPNativeMethods.NPPi.CompressionDCT
Image compression primitives.
Inheritance
Inherited Members
Namespace: ManagedCuda.NPP
Assembly: NPP.dll
Syntax
public static class CompressionDCT
Methods
nppiDCTFree(NppiDCTState)
Frees the additional resources of the DCT state structure. \see nppiDCTInitAlloc
Declaration
public static NppStatus nppiDCTFree(NppiDCTState pState)
Parameters
Type | Name | Description |
---|---|---|
NppiDCTState | pState | Pointer to DCT state structure. |
Returns
Type | Description |
---|---|
NppStatus | NPP_SUCCESS Indicates no error. Any other value indicates an error or a warning \return NPP_SIZE_ERROR Indicates an error condition if any image dimension has zero or negative value \return NPP_NULL_POINTER_ERROR Indicates an error condition if pState pointer is NULL |
nppiDCTInitAlloc(ref NppiDCTState)
Initializes DCT state structure and allocates additional resources. \see nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R_NEW(), nppiDCTQuantInv8x8LS_JPEG_16s8u_C1R_NEW.
Declaration
public static NppStatus nppiDCTInitAlloc(ref NppiDCTState ppState)
Parameters
Type | Name | Description |
---|---|---|
NppiDCTState | ppState | Pointer to pointer to DCT state structure. |
Returns
Type | Description |
---|---|
NppStatus | NPP_SUCCESS Indicates no error. Any other value indicates an error or a warning \return NPP_SIZE_ERROR Indicates an error condition if any image dimension has zero or negative value \return NPP_NULL_POINTER_ERROR Indicates an error condition if pBufSize pointer is NULL |
nppiDCTInv4x4_WebP_16s_C1R(CUdeviceptr, Int32, CUdeviceptr, Int32, NppiSize)
Inverse DCT in WebP decoding. Input is the bitstream that contains the coefficients of 16x16 blocks. These coefficients are based on a 4x4 sub-block unit, e.g., Coeffs in 0th 4x4 block, 1st 4x4 block 2nd 4x4 block, etc. Output is the coefficients after inverse DCT transform. The output is put in an image format (i.e. raster scan order), different from the input order.
Declaration
public static NppStatus nppiDCTInv4x4_WebP_16s_C1R(CUdeviceptr pSrc, int nSrcStep, CUdeviceptr pDst, int nDstStep, NppiSize oSizeROI)
Parameters
Type | Name | Description |
---|---|---|
CUdeviceptr | pSrc | Source-Image Pointer. |
System.Int32 | nSrcStep | Source-Image Line Step. |
CUdeviceptr | pDst | Destination-Image Pointer. |
System.Int32 | nDstStep | Destination-Image Line Step. |
NppiSize | oSizeROI | Region-of-Interest (ROI). |
Returns
Type | Description |
---|---|
NppStatus |
nppiDCTQuant16Fwd8x8LS_JPEG_8u16s_C1R_NEW(CUdeviceptr, Int32, CUdeviceptr, Int32, CUdeviceptr, NppiSize, NppiDCTState)
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.
Declaration
public static NppStatus nppiDCTQuant16Fwd8x8LS_JPEG_8u16s_C1R_NEW(CUdeviceptr pSrc, int nSrcStep, CUdeviceptr pDst, int nDstStep, CUdeviceptr pQuantizationTable, NppiSize oSizeROI, NppiDCTState pState)
Parameters
Type | Name | Description |
---|---|---|
CUdeviceptr | pSrc | Source-Image Pointer. |
System.Int32 | nSrcStep | Source-Image Line Step. |
CUdeviceptr | pDst | Destination-Image Pointer. |
System.Int32 | nDstStep | Image width in pixels x 8 x sizeof(Npp16s). |
CUdeviceptr | pQuantizationTable | Quantization Table in zig-zag order. |
NppiSize | oSizeROI | Region-of-Interest (ROI). |
NppiDCTState | pState | Pointer to DCT state structure. This structure must be |
Returns
Type | Description |
---|---|
NppStatus |
nppiDCTQuant16Inv8x8LS_JPEG_16s8u_C1R_NEW(CUdeviceptr, Int32, CUdeviceptr, Int32, CUdeviceptr, NppiSize, NppiDCTState)
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.
Declaration
public static NppStatus nppiDCTQuant16Inv8x8LS_JPEG_16s8u_C1R_NEW(CUdeviceptr pSrc, int nSrcStep, CUdeviceptr pDst, int nDstStep, CUdeviceptr pQuantizationTable, NppiSize oSizeROI, NppiDCTState pState)
Parameters
Type | Name | Description |
---|---|---|
CUdeviceptr | pSrc | Source-Image Pointer. |
System.Int32 | nSrcStep | Image width in pixels x 8 x sizeof(Npp16s). |
CUdeviceptr | pDst | Destination-Image Pointer. |
System.Int32 | nDstStep | Destination-Image Line Step. |
CUdeviceptr | pQuantizationTable | Quantization Table in zig-zag order. |
NppiSize | oSizeROI | Region-of-Interest (ROI). |
NppiDCTState | pState | Pointer to DCT state structure. This structure must be |
Returns
Type | Description |
---|---|
NppStatus |
nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R_NEW(CUdeviceptr, Int32, CUdeviceptr, Int32, CUdeviceptr, NppiSize, NppiDCTState)
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.
Declaration
public static NppStatus nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R_NEW(CUdeviceptr pSrc, int nSrcStep, CUdeviceptr pDst, int nDstStep, CUdeviceptr pQuantizationTable, NppiSize oSizeROI, NppiDCTState pState)
Parameters
Type | Name | Description |
---|---|---|
CUdeviceptr | pSrc | Source-Image Pointer. |
System.Int32 | nSrcStep | Source-Image Line Step. |
CUdeviceptr | pDst | Destination-Image Pointer. |
System.Int32 | nDstStep | Image width in pixels x 8 x sizeof(Npp16s). |
CUdeviceptr | pQuantizationTable | Quantization Table in zig-zag order. |
NppiSize | oSizeROI | Region-of-Interest (ROI). |
NppiDCTState | pState | Pointer to DCT state structure. This structure must be |
Returns
Type | Description |
---|---|
NppStatus | 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. |
nppiDCTQuantInv8x8LS_JPEG_16s8u_C1R_NEW(CUdeviceptr, Int32, CUdeviceptr, Int32, CUdeviceptr, NppiSize, NppiDCTState)
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.
Declaration
public static NppStatus nppiDCTQuantInv8x8LS_JPEG_16s8u_C1R_NEW(CUdeviceptr pSrc, int nSrcStep, CUdeviceptr pDst, int nDstStep, CUdeviceptr pQuantizationTable, NppiSize oSizeROI, NppiDCTState pState)
Parameters
Type | Name | Description |
---|---|---|
CUdeviceptr | pSrc | Source-Image Pointer. |
System.Int32 | nSrcStep | Image width in pixels x 8 x sizeof(Npp16s). |
CUdeviceptr | pDst | Destination-Image Pointer. |
System.Int32 | nDstStep | Destination-Image Line Step. |
CUdeviceptr | pQuantizationTable | Quantization Table in zig-zag order. |
NppiSize | oSizeROI | Region-of-Interest (ROI). |
NppiDCTState | pState | Pointer to DCT state structure. This structure must be |
Returns
Type | Description |
---|---|
NppStatus | 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. |
nppiDecodeHuffmanScanHost_JPEG_8u16s_P1R(Byte[], Int32, Int32, Int32, Int32, Int32, Int32, Int16[], Int32, NppiDecodeHuffmanSpec, NppiDecodeHuffmanSpec, NppiSize)
Huffman Decoding of the JPEG decoding on the host. Input is expected in byte stuffed huffman encoded JPEG scan and output is expected to be 64x1 macro blocks.
Declaration
public static NppStatus nppiDecodeHuffmanScanHost_JPEG_8u16s_P1R(byte[] pSrc, int nLength, int restartInterval, int Ss, int Se, int Ah, int Al, short[] pDst, int nDstStep, NppiDecodeHuffmanSpec pHuffmanTableDC, NppiDecodeHuffmanSpec pHuffmanTableAC, NppiSize oSizeROI)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | pSrc | Byte-stuffed huffman encoded JPEG scan. |
System.Int32 | nLength | Byte length of the input. |
System.Int32 | restartInterval | Restart Interval, see JPEG standard. |
System.Int32 | Ss | Start Coefficient, see JPEG standard. |
System.Int32 | Se | End Coefficient, see JPEG standard. |
System.Int32 | Ah | Bit Approximation High, see JPEG standard. |
System.Int32 | Al | Bit Approximation Low, see JPEG standard. |
System.Int16[] | pDst | Destination-Image Pointer. |
System.Int32 | nDstStep | Destination-Image Line Step. |
NppiDecodeHuffmanSpec | pHuffmanTableDC | DC Huffman table. |
NppiDecodeHuffmanSpec | pHuffmanTableAC | AC Huffman table. |
NppiSize | oSizeROI | Region-of-Interest (ROI). |
Returns
Type | Description |
---|---|
NppStatus | 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. |
nppiDecodeHuffmanScanHost_JPEG_8u16s_P3R(Byte[], Int32, Int32, Int32, Int32, Int32, Int32, IntPtr[], Int32[], NppiDecodeHuffmanSpec[], NppiDecodeHuffmanSpec[], NppiSize[])
Huffman Decoding of the JPEG decoding on the host. Input is expected in byte stuffed huffman encoded JPEG scan and output is expected to be 64x1 macro blocks.
Declaration
public static NppStatus nppiDecodeHuffmanScanHost_JPEG_8u16s_P3R(byte[] pSrc, int nLength, int nRestartInterval, int nSs, int nSe, int nAh, int nAl, IntPtr[] apDst, int[] aDstStep, NppiDecodeHuffmanSpec[] apHuffmanDCTable, NppiDecodeHuffmanSpec[] apHuffmanACTable, NppiSize[] aSizeROI)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | pSrc | Byte-stuffed huffman encoded JPEG scan. |
System.Int32 | nLength | Byte length of the input. |
System.Int32 | nRestartInterval | Restart Interval, see JPEG standard. |
System.Int32 | nSs | Start Coefficient, see JPEG standard. |
System.Int32 | nSe | End Coefficient, see JPEG standard. |
System.Int32 | nAh | Bit Approximation High, see JPEG standard. |
System.Int32 | nAl | Bit Approximation Low, see JPEG standard. |
System.IntPtr[] | apDst | Destination-Image Pointer. |
System.Int32[] | aDstStep | Destination-Image Line Step. |
NppiDecodeHuffmanSpec[] | apHuffmanDCTable | DC Huffman tables. |
NppiDecodeHuffmanSpec[] | apHuffmanACTable | AC Huffman tables. |
NppiSize[] | aSizeROI | Region-of-Interest (ROI). |
Returns
Type | Description |
---|---|
NppStatus | 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. |
nppiDecodeHuffmanSpecFreeHost_JPEG(NppiDecodeHuffmanSpec)
Frees the host memory allocated by nppiDecodeHuffmanSpecInitAllocHost_JPEG.
Declaration
public static NppStatus nppiDecodeHuffmanSpecFreeHost_JPEG(NppiDecodeHuffmanSpec pHuffmanSpec)
Parameters
Type | Name | Description |
---|---|---|
NppiDecodeHuffmanSpec | pHuffmanSpec | Pointer to the Huffman table for the decoder |
Returns
Type | Description |
---|---|
NppStatus |
nppiDecodeHuffmanSpecGetBufSize_JPEG(ref Int32)
Returns the length of the NppiDecodeHuffmanSpec structure.
Declaration
public static NppStatus nppiDecodeHuffmanSpecGetBufSize_JPEG(ref int pSize)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pSize | Pointer to a variable that will receive the length of the NppiDecodeHuffmanSpec structure. |
Returns
Type | Description |
---|---|
NppStatus |
nppiDecodeHuffmanSpecInitAllocHost_JPEG(Byte[], NppiHuffmanTableType, ref NppiDecodeHuffmanSpec)
Allocates memory and creates a Huffman table in a format that is suitable for the decoder on the host.
Declaration
public static NppStatus nppiDecodeHuffmanSpecInitAllocHost_JPEG(byte[] pRawHuffmanTable, NppiHuffmanTableType eTableType, ref NppiDecodeHuffmanSpec ppHuffmanSpec)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | pRawHuffmanTable | Huffman table formated as specified in the JPEG standard. |
NppiHuffmanTableType | eTableType | Enum specifying type of table (nppiDCTable or nppiACTable). |
NppiDecodeHuffmanSpec | ppHuffmanSpec | Pointer to returned pointer to the Huffman table for the decoder |
Returns
Type | Description |
---|---|
NppStatus | NPP_NULL_POINTER_ERROR If one of the pointers is 0. |
nppiDecodeHuffmanSpecInitHost_JPEG(Byte[], NppiHuffmanTableType, NppiDecodeHuffmanSpec)
Creates a Huffman table in a format that is suitable for the decoder on the host.
Declaration
public static NppStatus nppiDecodeHuffmanSpecInitHost_JPEG(byte[] pRawHuffmanTable, NppiHuffmanTableType eTableType, NppiDecodeHuffmanSpec pHuffmanSpec)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | pRawHuffmanTable | Huffman table formated as specified in the JPEG standard. |
NppiHuffmanTableType | eTableType | Enum specifying type of table (nppiDCTable or nppiACTable) |
NppiDecodeHuffmanSpec | pHuffmanSpec | Pointer to the Huffman table for the decoder |
Returns
Type | Description |
---|---|
NppStatus | NPP_NULL_POINTER_ERROR If one of the pointers is 0. |
nppiEncodeHuffmanGetSize(NppiSize, Int32, ref Int32)
Calculates the size of the temporary buffer for baseline Huffman encoding. \see nppiEncodeHuffmanScan_JPEG_8u16s_P1R(), nppiEncodeHuffmanScan_JPEG_8u16s_P3R().
Declaration
public static NppStatus nppiEncodeHuffmanGetSize(NppiSize oSize, int nChannels, ref int pBufSize)
Parameters
Type | Name | Description |
---|---|---|
NppiSize | oSize | Image Dimension. |
System.Int32 | nChannels | |
System.Int32 | pBufSize | Pointer to variable that returns the size of the |
Returns
Type | Description |
---|---|
NppStatus | NPP_SUCCESS Indicates no error. Any other value indicates an error or a warning \return NPP_SIZE_ERROR Indicates an error condition if any image dimension has zero or negative value \return NPP_NULL_POINTER_ERROR Indicates an error condition if pBufSize pointer is NULL |
nppiEncodeHuffmanScan_JPEG_8u16s_P1R(CUdeviceptr, Int32, Int32, Int32, Int32, Int32, Int32, CUdeviceptr, ref Int32, NppiEncodeHuffmanSpec, NppiEncodeHuffmanSpec, NppiSize, CUdeviceptr)
Huffman Encoding of the JPEG Encoding. Input is expected to be 64x1 macro blocks and output is expected as byte stuffed huffman encoded JPEG scan.
Declaration
public static NppStatus nppiEncodeHuffmanScan_JPEG_8u16s_P1R(CUdeviceptr pSrc, int nSrcStep, int nRestartInterval, int nSs, int nSe, int nAh, int nAl, CUdeviceptr pDst, ref int nLength, NppiEncodeHuffmanSpec pHuffmanTableDC, NppiEncodeHuffmanSpec pHuffmanTableAC, NppiSize oSizeROI, CUdeviceptr pTempStorage)
Parameters
Type | Name | Description |
---|---|---|
CUdeviceptr | pSrc | Destination-Image Pointer. |
System.Int32 | nSrcStep | Destination-Image Line Step. |
System.Int32 | nRestartInterval | Restart Interval, see JPEG standard. Currently only values <=0 are supported. |
System.Int32 | nSs | Start Coefficient, see JPEG standard. |
System.Int32 | nSe | End Coefficient, see JPEG standard. |
System.Int32 | nAh | Bit Approximation High, see JPEG standard. |
System.Int32 | nAl | Bit Approximation Low, see JPEG standard. |
CUdeviceptr | pDst | Byte-stuffed huffman encoded JPEG scan. |
System.Int32 | nLength | Byte length of the huffman encoded JPEG scan. |
NppiEncodeHuffmanSpec | pHuffmanTableDC | DC Huffman table. |
NppiEncodeHuffmanSpec | pHuffmanTableAC | AC Huffman table. |
NppiSize | oSizeROI | Region-of-Interest (ROI). |
CUdeviceptr | pTempStorage |
Returns
Type | Description |
---|---|
NppStatus | 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. |
nppiEncodeHuffmanScan_JPEG_8u16s_P3R(CUdeviceptr[], Int32[], Int32, Int32, Int32, Int32, Int32, CUdeviceptr, ref Int32, NppiEncodeHuffmanSpec[], NppiEncodeHuffmanSpec[], NppiSize[], CUdeviceptr)
Huffman Encoding of the JPEG Encoding. Input is expected to be 64x1 macro blocks and output is expected as byte stuffed huffman encoded JPEG scan.
Declaration
public static NppStatus nppiEncodeHuffmanScan_JPEG_8u16s_P3R(CUdeviceptr[] apSrc, int[] aSrcStep, int nRestartInterval, int nSs, int nSe, int nAh, int nAl, CUdeviceptr pDst, ref int nLength, NppiEncodeHuffmanSpec[] apHuffmanDCTable, NppiEncodeHuffmanSpec[] apHuffmanACTable, NppiSize[] aSizeROI, CUdeviceptr pTempStorage)
Parameters
Type | Name | Description |
---|---|---|
CUdeviceptr[] | apSrc | Destination-Image Pointer. |
System.Int32[] | aSrcStep | Destination-Image Line Step. |
System.Int32 | nRestartInterval | Restart Interval, see JPEG standard. Currently only values <=0 are supported. |
System.Int32 | nSs | Start Coefficient, see JPEG standard. |
System.Int32 | nSe | End Coefficient, see JPEG standard. |
System.Int32 | nAh | Bit Approximation High, see JPEG standard. |
System.Int32 | nAl | Bit Approximation Low, see JPEG standard. |
CUdeviceptr | pDst | Byte-stuffed huffman encoded JPEG scan. |
System.Int32 | nLength | Byte length of the huffman encoded JPEG scan. |
NppiEncodeHuffmanSpec[] | apHuffmanDCTable | DC Huffman tables. |
NppiEncodeHuffmanSpec[] | apHuffmanACTable | AC Huffman tables. |
NppiSize[] | aSizeROI | Region-of-Interest (ROI). |
CUdeviceptr | pTempStorage |
Returns
Type | Description |
---|---|
NppStatus | 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. |
nppiEncodeHuffmanSpecFree_JPEG(NppiEncodeHuffmanSpec)
Frees the memory allocated by nppiEncodeHuffmanSpecInitAlloc_JPEG.
Declaration
public static NppStatus nppiEncodeHuffmanSpecFree_JPEG(NppiEncodeHuffmanSpec pHuffmanSpec)
Parameters
Type | Name | Description |
---|---|---|
NppiEncodeHuffmanSpec | pHuffmanSpec | Pointer to the Huffman table for the encoder |
Returns
Type | Description |
---|---|
NppStatus |
nppiEncodeHuffmanSpecGetBufSize_JPEG(ref Int32)
Returns the length of the NppiEncodeHuffmanSpec structure.
Declaration
public static NppStatus nppiEncodeHuffmanSpecGetBufSize_JPEG(ref int pSize)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pSize | Pointer to a variable that will receive the length of the NppiEncodeHuffmanSpec structure. |
Returns
Type | Description |
---|---|
NppStatus | NPP_NULL_POINTER_ERROR If one of the pointers is 0. |
nppiEncodeHuffmanSpecInit_JPEG(Byte[], NppiHuffmanTableType, NppiEncodeHuffmanSpec)
Creates a Huffman table in a format that is suitable for the encoder.
Declaration
public static NppStatus nppiEncodeHuffmanSpecInit_JPEG(byte[] pRawHuffmanTable, NppiHuffmanTableType eTableType, NppiEncodeHuffmanSpec pHuffmanSpec)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | pRawHuffmanTable | Huffman table formated as specified in the JPEG standard. |
NppiHuffmanTableType | eTableType | Enum specifying type of table (nppiDCTable or nppiACTable). |
NppiEncodeHuffmanSpec | pHuffmanSpec | Pointer to the Huffman table for the decoder |
Returns
Type | Description |
---|---|
NppStatus | NPP_NULL_POINTER_ERROR If one of the pointers is 0. |
nppiEncodeHuffmanSpecInitAlloc_JPEG(Byte[], NppiHuffmanTableType, ref NppiEncodeHuffmanSpec)
Allocates memory and creates a Huffman table in a format that is suitable for the encoder.
Declaration
public static NppStatus nppiEncodeHuffmanSpecInitAlloc_JPEG(byte[] pRawHuffmanTable, NppiHuffmanTableType eTableType, ref NppiEncodeHuffmanSpec ppHuffmanSpec)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | pRawHuffmanTable | Huffman table formated as specified in the JPEG standard. |
NppiHuffmanTableType | eTableType | Enum specifying type of table (nppiDCTable or nppiACTable). |
NppiEncodeHuffmanSpec | ppHuffmanSpec | Pointer to returned pointer to the Huffman table for the encoder |
Returns
Type | Description |
---|---|
NppStatus | NPP_NULL_POINTER_ERROR If one of the pointers is 0. |
nppiEncodeOptimizeHuffmanGetSize(NppiSize, Int32, ref Int32)
Calculates the size of the temporary buffer for optimize Huffman coding. See \ref nppiGenerateOptimizeHuffmanTable_JPEG.
Declaration
public static NppStatus nppiEncodeOptimizeHuffmanGetSize(NppiSize oSize, int nChannels, ref int pBufSize)
Parameters
Type | Name | Description |
---|---|---|
NppiSize | oSize | Image Dimension. |
System.Int32 | nChannels | Number of channels in the image. |
System.Int32 | pBufSize | Pointer to variable that returns the size of the |
Returns
Type | Description |
---|---|
NppStatus | NPP_SUCCESS Indicates no error. Any other value indicates an error or a warning \return NPP_SIZE_ERROR Indicates an error condition if any image dimension has zero or negative value \return NPP_NULL_POINTER_ERROR Indicates an error condition if pBufSize pointer is NULL |
nppiEncodeOptimizeHuffmanScan_JPEG_8u16s_P1R(CUdeviceptr, Int32, Int32, Int32, Int32, Int32, Int32, CUdeviceptr, CUdeviceptr, CUdeviceptr, CUdeviceptr, CUdeviceptr, CUdeviceptr, ref NppiEncodeHuffmanSpec, ref NppiEncodeHuffmanSpec, NppiSize, CUdeviceptr)
Optimize Huffman Encoding of the JPEG Encoding. Input is expected to be 64x1 macro blocks and output is expected as byte stuffed huffman encoded JPEG scan.
Declaration
public static NppStatus nppiEncodeOptimizeHuffmanScan_JPEG_8u16s_P1R(CUdeviceptr pSrc, int nSrcStep, int nRestartInterval, int nSs, int nSe, int nAh, int nAl, CUdeviceptr pDst, CUdeviceptr pLength, CUdeviceptr hpCodesDC, CUdeviceptr hpTableDC, CUdeviceptr hpCodesAC, CUdeviceptr hpTableAC, ref NppiEncodeHuffmanSpec aHuffmanDCTable, ref NppiEncodeHuffmanSpec aHuffmanACTable, NppiSize oSizeROI, CUdeviceptr pTempStorage)
Parameters
Type | Name | Description |
---|---|---|
CUdeviceptr | pSrc | Destination-Image Pointer. |
System.Int32 | nSrcStep | Destination-Image Line Step. |
System.Int32 | nRestartInterval | Restart Interval, see JPEG standard. Currently only values <=0 are supported. |
System.Int32 | nSs | Start Coefficient, see JPEG standard. |
System.Int32 | nSe | End Coefficient, see JPEG standard. |
System.Int32 | nAh | Bit Approximation High, see JPEG standard. |
System.Int32 | nAl | Bit Approximation Low, see JPEG standard. |
CUdeviceptr | pDst | Byte-stuffed huffman encoded JPEG scan. |
CUdeviceptr | pLength | Pointer to the byte length of the huffman encoded JPEG scan. |
CUdeviceptr | hpCodesDC | Host pointer to the code of the huffman tree for DC component. |
CUdeviceptr | hpTableDC | Host pointer to the table of the huffman tree for DC component. |
CUdeviceptr | hpCodesAC | Host pointer to the code of the huffman tree for AC component. |
CUdeviceptr | hpTableAC | Host pointer to the table of the huffman tree for AC component. |
NppiEncodeHuffmanSpec | aHuffmanDCTable | DC Huffman table. |
NppiEncodeHuffmanSpec | aHuffmanACTable | AC Huffman table. |
NppiSize | oSizeROI | Region-of-Interest (ROI). |
CUdeviceptr | pTempStorage |
Returns
Type | Description |
---|---|
NppStatus | 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. - ::NPP_NOT_SUFFICIENT_COMPUTE_CAPABILITY If the device has compute capability < 2.0. |
nppiEncodeOptimizeHuffmanScan_JPEG_8u16s_P3R(CUdeviceptr[], Int32[], Int32, Int32, Int32, Int32, Int32, CUdeviceptr, CUdeviceptr, CUdeviceptr[], CUdeviceptr[], CUdeviceptr[], CUdeviceptr[], IntPtr[], IntPtr[], NppiSize[], CUdeviceptr)
Optimize Huffman Encoding of the JPEG Encoding. Input is expected to be 64x1 macro blocks and output is expected as byte stuffed huffman encoded JPEG scan.
Declaration
public static NppStatus nppiEncodeOptimizeHuffmanScan_JPEG_8u16s_P3R(CUdeviceptr[] pSrc, int[] aSrcStep, int nRestartInterval, int nSs, int nSe, int nAh, int nAl, CUdeviceptr pDst, CUdeviceptr pLength, CUdeviceptr[] hpCodesDC, CUdeviceptr[] hpTableDC, CUdeviceptr[] hpCodesAC, CUdeviceptr[] hpTableAC, IntPtr[] aHuffmanDCTable, IntPtr[] aHuffmanACTable, NppiSize[] oSizeROI, CUdeviceptr pTempStorage)
Parameters
Type | Name | Description |
---|---|---|
CUdeviceptr[] | pSrc | Destination-Image Pointer. |
System.Int32[] | aSrcStep | Destination-Image Line Step. |
System.Int32 | nRestartInterval | Restart Interval, see JPEG standard. Currently only values <=0 are supported. |
System.Int32 | nSs | Start Coefficient, see JPEG standard. |
System.Int32 | nSe | End Coefficient, see JPEG standard. |
System.Int32 | nAh | Bit Approximation High, see JPEG standard. |
System.Int32 | nAl | Bit Approximation Low, see JPEG standard. |
CUdeviceptr | pDst | Byte-stuffed huffman encoded JPEG scan. |
CUdeviceptr | pLength | Pointer to the byte length of the huffman encoded JPEG scan. |
CUdeviceptr[] | hpCodesDC | Host pointer to the code of the huffman tree for DC component. |
CUdeviceptr[] | hpTableDC | Host pointer to the table of the huffman tree for DC component. |
CUdeviceptr[] | hpCodesAC | Host pointer to the code of the huffman tree for AC component. |
CUdeviceptr[] | hpTableAC | Host pointer to the table of the huffman tree for AC component. |
System.IntPtr[] | aHuffmanDCTable | DC Huffman tables. |
System.IntPtr[] | aHuffmanACTable | AC Huffman tables. |
NppiSize[] | oSizeROI | Region-of-Interest (ROI). |
CUdeviceptr | pTempStorage |
Returns
Type | Description |
---|---|
NppStatus | 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. - ::NPP_NOT_SUFFICIENT_COMPUTE_CAPABILITY If the device has compute capability < 2.0. |
nppiJpegDecodeGetDCTBufferSize(NppiSize)
Returns how much memory has to be allocated for DCT coefficient buffers
declared in \ref NppiJpegDecodeJobMemory. The returned value may be bigger than
simply number of blocks /// 64 /// sizeof (short)
, because decoder
may use slightly bigger temporary representation of data.
Declaration
public static SizeT nppiJpegDecodeGetDCTBufferSize(NppiSize oBlocks)
Parameters
Type | Name | Description |
---|---|---|
NppiSize | oBlocks | Size of the interleaved component in blocks. |
Returns
Type | Description |
---|---|
SizeT |
nppiJpegDecodeGetScanDeadzoneSize()
This function returns how much additional memory has to be available
after the end of compressed scan data.
The following buffers: pCpuScan
and pGpuScan
in \ref NppiJpegDecodeJobMemory
should have size at least pScan->length + nppiJpegDecodeGetScanDeadzoneSize()
.
The additional memory is needed because the decoder may perform
some speculative reads after the end of compressed scan data.
Declaration
public static SizeT nppiJpegDecodeGetScanDeadzoneSize()
Returns
Type | Description |
---|---|
SizeT |
nppiJpegDecodeJob(ref NppiJpegDecodeJob, ref NppiJpegDecodeJobMemory)
Executes a job -- part of decoding.
Declaration
public static NppStatus nppiJpegDecodeJob(ref NppiJpegDecodeJob pJob, ref NppiJpegDecodeJobMemory pMemory)
Parameters
Type | Name | Description |
---|---|---|
NppiJpegDecodeJob | pJob | has to be initialized by \ref nppiJpegDecodeJobCreateMemzero |
NppiJpegDecodeJobMemory | pMemory | has to point to valid structure, except for MEMZERO and FINALIZE |
Returns
Type | Description |
---|---|
NppStatus |
nppiJpegDecodeJobCreateFinalize(ref NppiJpegDecodeJob)
Initializes a job that has to be called at the end of decoding, in order to convert temporary representation of DCT coefficients to the final one.
Declaration
public static NppStatus nppiJpegDecodeJobCreateFinalize(ref NppiJpegDecodeJob pJob)
Parameters
Type | Name | Description |
---|---|---|
NppiJpegDecodeJob | pJob | pJob.pFrame should point to valid frame description. pJob.pScan will be overwritten. |
Returns
Type | Description |
---|---|
NppStatus |
nppiJpegDecodeJobCreateMemzero(ref NppiJpegDecodeJob)
Initializes a job that has to be called at the beginning of decoding.
Declaration
public static NppStatus nppiJpegDecodeJobCreateMemzero(ref NppiJpegDecodeJob pJob)
Parameters
Type | Name | Description |
---|---|---|
NppiJpegDecodeJob | pJob | pJob.pFrame should point to valid frame description. pJob.pScan will be overwritten. If the caller had manually zeroed the memory for DCT buffers, (note: whole \ref nppiJpegDecodeDCTBufferSize has to be zeroed) this job doesn't have to be executed. |
Returns
Type | Description |
---|---|
NppStatus |
nppiJpegDecodeJobMemorySize(ref NppiJpegDecodeJob, ref SizeT)
Calculates sizes of additional buffers used by the job.
Declaration
public static NppStatus nppiJpegDecodeJobMemorySize(ref NppiJpegDecodeJob pJob, ref SizeT aSize)
Parameters
Type | Name | Description |
---|---|---|
NppiJpegDecodeJob | pJob | has to point to properly initialized job |
SizeT | aSize | will be filled with \ref NPPI_JPEG_DECODE_N_BUFFERS sizes, |
Returns
Type | Description |
---|---|
NppStatus |