Example #1
0
 public static extern nvjpegStatus nvjpegDecodeBatchedPreAllocate(
     nvjpegHandle handle,
     nvjpegJpegState jpeg_handle,
     int batch_size,
     int width,
     int height,
     nvjpegChromaSubsampling chroma_subsampling,
     nvjpegOutputFormat output_format);
Example #2
0
 public void EncodeYUV(EncoderParams encoderParams, nvjpegImage source, nvjpegChromaSubsampling chromaSubsampling, int image_width, int image_height, CudaStream stream)
 {
     res = NvJpegNativeMethods.nvjpegEncodeYUV(_nvJpeg.Handle, _state, encoderParams.Params, ref source, chromaSubsampling, image_width, image_height, stream.Stream);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nvjpegEncodeYUV", res));
     if (res != nvjpegStatus.Success)
     {
         throw new NvJpegException(res);
     }
 }
Example #3
0
 public static extern nvjpegStatus nvjpegEncodeYUV(
     nvjpegHandle handle,
     nvjpegEncoderState encoder_state,
     nvjpegEncoderParams encoder_params,
     ref nvjpegImage source,
     nvjpegChromaSubsampling chroma_subsampling,
     int image_width,
     int image_height,
     CUstream stream);
Example #4
0
 public void DecodeBatchedPreAllocate(int batch_size, int width, int height, nvjpegChromaSubsampling chroma_subsampling, nvjpegOutputFormat output_format)
 {
     res = NvJpegNativeMethods.nvjpegDecodeBatchedPreAllocate(_nvJpeg.Handle, _state, batch_size, width, height, chroma_subsampling, output_format);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nvjpegDecodeBatchedPreAllocate", res));
     if (res != nvjpegStatus.Success)
     {
         throw new NvJpegException(res);
     }
 }
Example #5
0
 public void GetImageInfo(byte[] data, ref int nComponents, ref nvjpegChromaSubsampling subsampling, int[] widths, int[] heights)
 {
     res = NvJpegNativeMethods.nvjpegGetImageInfo(_handle, data, data.Length, ref nComponents, ref subsampling, widths, heights);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nvjpegGetImageInfo", res));
     if (res != nvjpegStatus.Success)
     {
         throw new NvJpegException(res);
     }
 }
Example #6
0
 public void SetSamplingFactors(nvjpegChromaSubsampling chroma_subsampling, CudaStream stream)
 {
     res = NvJpegNativeMethods.nvjpegEncoderParamsSetSamplingFactors(_params, chroma_subsampling, stream.Stream);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nvjpegEncoderParamsSetSamplingFactors", res));
     if (res != nvjpegStatus.Success)
     {
         throw new NvJpegException(res);
     }
 }
Example #7
0
 public static extern nvjpegStatus nvjpegJpegStreamGetChromaSubsampling(
     nvjpegJpegStream jpeg_stream,
     ref nvjpegChromaSubsampling chroma_subsampling);
Example #8
0
 public static extern nvjpegStatus nvjpegEncoderParamsSetSamplingFactors(
     nvjpegEncoderParams encoder_params,
     nvjpegChromaSubsampling chroma_subsampling,
     CUstream stream);
Example #9
0
 public static extern nvjpegStatus nvjpegGetImageInfo(nvjpegHandle handle, byte[] data, SizeT length,
                                                      ref int nComponents, ref nvjpegChromaSubsampling subsampling, int[] widths, int[] heights);