- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Every oncein a while Iam getting a JPEG_INTERNAL_ERROR on the WriteImageBaseline method. Is this because my buffer is smaller than what it needs? I have it set to the origonal image size.
- Matt
- Matt
1 解決策
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
it seems you have integrated code from sample to your own application. Please make sure .NET garbage collector can't move memory accessed in native IPP functions (mean you correctly use 'fixed' and 'unsafe' keywords). I have no other ideas on this issue. We can't reproduce it with our sample
Vladimir
Vladimir
コピーされたリンク
7 返答(返信)
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
How do you call IPP JPEG encoder? What are the parameters you are using?
Vladimir
Vladimir
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Quoting - Vladimir Dudnik
How do you call IPP JPEG encoder? What are the parameters you are using?
Vladimir
Vladimir
[c-sharp]public static byte[] JPEGEncode(Bitmap image, int quality)
{
ExampleIP.JPEGEncoder encoder = new ExampleIP.JPEGEncoder();
BitmapData imageData = image.LockBits(new Rectangle(0,0,image.Width,image.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
byte[] trimmedArray = null;
try
{
byte[] compressedJPEG = new byte[imageData.Stride * imageData.Height];
int realSize = 0;
ExampleIP.JERRCODE error = ExampleIP.JERRCODE.JPEG_OK;
error = encoder.SetSource((byte*)imageData.Scan0, imageData.Stride, new IppiSize(image.Width, image.Height), 3, ExampleIP.JCOLOR.JC_BGR);
ThrowExceptionForJPEGError(error);
error = encoder.SetDestination(ref compressedJPEG, imageData.Stride * image.Height,
quality, ExampleIP.JSS.JS_411, ExampleIP.JCOLOR.JC_YCBCR, ExampleIP.JMODE.JPEG_BASELINE, 0);
ThrowExceptionForJPEGError(error);
error = encoder.WriteImageBaseline(ref realSize);
ThrowExceptionForJPEGError(error);
trimmedArray = new byte[realSize];
Array.Copy(compressedJPEG, trimmedArray, realSize);
}
catch (Exception ex)
{
Debug.WriteLine(ex.ToString());
}
finally
{
image.UnlockBits(imageData);
}
return trimmedArray;
}[/c-sharp]
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
What version of IPP do you use and are you using JPEG C# sample we provide in IPP sample package or you develop this code by your own? Could you please try the same image with original IPP sample?
Regards,
Vladimir
Regards,
Vladimir
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Quoting - Vladimir Dudnik
What version of IPP do you use and are you using JPEG C# sample we provide in IPP sample package or you develop this code by your own? Could you please try the same image with original IPP sample?
Regards,
Vladimir
Regards,
Vladimir
I'm actually using the encoder.cs you guys provided in the JPEG C# sample. I don't get JPEG_INTERNAL_ERROR on every frame of video I compress just every once in a while I get that error.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Quoting - Vladimir Dudnik
What version of IPP do you use and are you using JPEG C# sample we provide in IPP sample package or you develop this code by your own? Could you please try the same image with original IPP sample?
Regards,
Vladimir
Regards,
Vladimir
I'm also using Version 6 Update 1 of the library.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
it seems you have integrated code from sample to your own application. Please make sure .NET garbage collector can't move memory accessed in native IPP functions (mean you correctly use 'fixed' and 'unsafe' keywords). I have no other ideas on this issue. We can't reproduce it with our sample
Vladimir
Vladimir
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Quoting - Vladimir Dudnik
it seems you have integrated code from sample to your own application. Please make sure .NET garbage collector can't move memory accessed in native IPP functions (mean you correctly use 'fixed' and 'unsafe' keywords). I have no other ideas on this issue. We can't reproduce it with our sample
Vladimir
Vladimir
Your right. I found some errors in the encoder.cs file in the example. I've fixed them and attached the file. I'm also working on fixing the decoder.cs memory issues too.