<div dir="ltr">Hello Marc,<div>images are preloaded into separated memory streams, the core part of the comparison is performed by a separated thread:</div><div><br></div><div><div>procedure TMyThread.Execute;</div><div>var</div><div> jpegDecompressor: tjhandle;</div><div> jpegWidth: cint;</div><div> jpegHeight: cint;</div><div> jpegSubsamp: cint;</div><div>begin</div><div> while (not Terminated) do</div><div> begin</div><div> case FTest of</div><div> 1 : begin // LCL</div><div> FPicture := TPicture.Create;</div><div> Images[FIndex].Position:=0;</div><div> FPicture.LoadFromStream(Images[FIndex]);</div><div><br></div><div> if (not Terminated) then</div><div> Synchronize(@ShowBitmap);</div><div><br></div><div> FPicture.Free;</div><div> end;</div><div> 2 : begin // libjpeg-turbo</div><div> FPicture := TPicture.Create;</div><div> FPicture.Bitmap.PixelFormat:=pf24bit;</div><div><br></div><div> jpegDecompressor := tjInitDecompress();</div><div> tjDecompressHeader2(jpegDecompressor, Images[FIndex].Memory, Images[FIndex].Size, @jpegWidth, @jpegHeight, @jpegSubsamp);</div><div> FPicture.Bitmap.SetSize(jpegWidth,jpegHeight);</div><div> tjDecompress2(jpegDecompressor, Images[FIndex].Memory, Images[FIndex].Size, FPicture.Bitmap.RawImage.Data, jpegWidth, 0, jpegHeight, cint(TJPF_BGR), TJFLAG_FASTDCT);</div><div> tjDestroy(jpegDecompressor);</div><div><br></div><div> if (not Terminated) then</div><div> Synchronize(@ShowBitmap);</div><div><br></div><div> FPicture.Free;</div><div> end;</div><div> end;</div><div> inc(FIndex);</div><div> if (FIndex > high(Images)) then FIndex := low(Images);</div><div> end;</div><div>end;</div></div><div><br></div><div><br></div><div><br></div><div><a href="http://pasteboard.co/hlatrJG.png">http://pasteboard.co/hlatrJG.png</a></div><div><br></div><div>Suggestions are welcome!</div><div><br></div><div>Sandro Cumerlato</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 18 April 2016 at 13:28, Marc Weustink <span dir="ltr"><<a href="mailto:marc@dommelstein.nl" target="_blank">marc@dommelstein.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sandro Cumerlato wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello Ara, my tests with libjpeg-/turbo/are even more promising.<br>
<br>
The following comparison between LCL and libjpeg-/turbo/ was made<span class=""><br>
decompressing for about one minute a sequence of several 4000x3000 JPEG<br>
pictures. The results are expressed in "pictures per second" and prove<br></span>
that libjpeg-/turbo/ is about 7-8 times faster than LCL:<br>
</blockquote>
<br>
How did you compare ?<br>
<br>
IE, whats the source ?<span class="HOEnZb"><font color="#888888"><br>
<br>
Marc</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
--<br>
_______________________________________________<br>
Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus.freepascal.org" target="_blank">Lazarus@lists.lazarus.freepascal.org</a><br>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" rel="noreferrer" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br>
</div></div></blockquote></div><br></div>