Library/ManagedCuda/NPP/JPEGCompression.cs
/// <summary>
/// Huffman Decoding of the JPEG decoding on the host.<para/>
/// Input is expected in byte stuffed huffman encoded JPEG scan and output is expected to be 64x1 macro blocks.
/// </summary>
/// <param name="pSrc">Byte-stuffed huffman encoded JPEG scan.</param>
/// <param name="restartInterval">Restart Interval, see JPEG standard.</param>
/// <param name="Ss">Start Coefficient, see JPEG standard.</param>
/// <param name="Se">End Coefficient, see JPEG standard.</param>
/// <param name="Ah">Bit Approximation High, see JPEG standard.</param>
/// <param name="Al">Bit Approximation Low, see JPEG standard.</param>
/// <param name="pDstY">Destination first image channel</param>
/// <param name="pDstCb">Destination second image channel</param>
/// <param name="pDstCr">Destination third image channel</param>
/// <param name="nDstStep">destination image line step.</param>
/// <param name="pHuffmanTableDC">DC Huffman table.</param>
/// <param name="pHuffmanTableAC">AC Huffman table.</param>
/// <param name="oSizeROI">ROI</param>
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.
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 .
public static void DecodeHuffmanScanHost(byte[] pSrc, int restartInterval, int Ss, int Se, int Ah, int Al,
					short[] pDstY, short[] pDstCb, short[] pDstCr, int[] nDstStep, NppiDecodeHuffmanSpec[] pHuffmanTableDC, NppiDecodeHuffmanSpec[] pHuffmanTableAC, NppiSize[] oSizeROI)
		{
			NppStatus status;
			GCHandle[] handles = new GCHandle[3];
			try
			{
				handles[0] = GCHandle.Alloc(pDstY, GCHandleType.Pinned);
				handles[1] = GCHandle.Alloc(pDstCb, GCHandleType.Pinned);
				handles[2] = GCHandle.Alloc(pDstCr, GCHandleType.Pinned);
				IntPtr[] temp = new IntPtr[] { handles[0].AddrOfPinnedObject(), handles[1].AddrOfPinnedObject(), handles[2].AddrOfPinnedObject() };
				status = NPPNativeMethods.NPPi.CompressionDCT.nppiDecodeHuffmanScanHost_JPEG_8u16s_P3R(pSrc, pSrc.Length, restartInterval, Ss, Se, Ah, Al, temp, nDstStep, pHuffmanTableDC, pHuffmanTableAC, oSizeROI);
				Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiDecodeHuffmanScanHost_JPEG_8u16s_P3R", status));
			}
			finally
			{
				handles[0].Free();
				handles[1].Free();
				handles[2].Free();
			}
			NPPException.CheckNppStatus(status, null);
		}
public static void DecodeHuffmanScanHost ( byte [ ] pSrc , int restartInterval , int Ss , int Se , int Ah , int Al , short [ ] pDstY , short [ ] pDstCb , short [ ] pDstCr , int [ ] nDstStep , NppiDecodeHuffmanSpec [ ] pHuffmanTableDC , NppiDecodeHuffmanSpec [ ] pHuffmanTableAC , NppiSize [ ] oSizeROI ) { NppStatus status ; GCHandle [ ] handles = new GCHandle [ 3 ] ; try { handles [ 0 ] = GCHandle . Alloc ( pDstY , GCHandleType . Pinned ) ; handles [ 1 ] = GCHandle . Alloc ( pDstCb , GCHandleType . Pinned ) ; handles [ 2 ] = GCHandle . Alloc ( pDstCr , GCHandleType . Pinned ) ; IntPtr [ ] temp = new IntPtr [ ] { handles [ 0 ] . AddrOfPinnedObject ( ) , handles [ 1 ] . AddrOfPinnedObject ( ) , handles [ 2 ] . AddrOfPinnedObject ( ) } ; status = NPPNativeMethods . NPPi . CompressionDCT . nppiDecodeHuffmanScanHost_JPEG_8u16s_P3R ( pSrc , pSrc . Length , restartInterval , Ss , Se , Ah , Al , temp , nDstStep , pHuffmanTableDC , pHuffmanTableAC , oSizeROI ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , status ) ) ; } finally { handles [ 0 ] . Free ( ) ; handles [ 1 ] . Free ( ) ; handles [ 2 ] . Free ( ) ; } NPPException . CheckNppStatus ( status , null ) ; }
Huffman Decoding of the JPEG decoding on the host.
Huffman Decoding of the JPEG decoding on the host .
pSrc
byte[]
Byte-stuffed huffman encoded JPEG scan.
Byte - stuffed huffman encoded JPEG scan .
restartInterval
int
Restart Interval, see JPEG standard.
Restart Interval see JPEG standard .
Ss
int
Start Coefficient, see JPEG standard.
Start Coefficient see JPEG standard .
Se
int
End Coefficient, see JPEG standard.
End Coefficient see JPEG standard .
Ah
int
Bit Approximation High, see JPEG standard.
Bit Approximation High see JPEG standard .
Al
int
Bit Approximation Low, see JPEG standard.
Bit Approximation Low see JPEG standard .
pDstY
short[]
Destination first image channel
Destination first image channel
pDstCb
short[]
Destination second image channel
Destination second image channel
pDstCr
short[]
Destination third image channel
Destination third image channel
nDstStep
int[]
destination image line step.
destination image line step .
pHuffmanTableDC
NppiDecodeHuffmanSpec[]
DC Huffman table.
DC Huffman table .
pHuffmanTableAC
NppiDecodeHuffmanSpec[]
AC Huffman table.
AC Huffman table .
oSizeROI
NppiSize[]
None