<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>671</bug_id>
          
          <creation_ts>2013-01-22 10:13:16 +0100</creation_ts>
          <short_desc>Add jpeg decoding support in core utils (w/o AWT -&gt; headless, embedded devices)</short_desc>
          <delta_ts>2013-04-01 05:20:15 +0200</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>util</component>
          <version>2</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P4</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>gouessej</cc>
          
          <cf_type>---</cf_type>
          <cf_scm_refs>a54bd3e963a7be320dee0c9692d237607fcd0f96</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2111</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-01-22 10:13:16 +0100</bug_when>
    <thetext>Allow usage of JPEG image sources w/o AWT, i.e. headless/embedded.

libjpeg-turbo (BSD 2clause licensed) http://www.libjpeg-turbo.org/
implements fast jpeg encoding &amp; decoding using SIMD ops (i586, amd64, arm/neon, ..)
and also offers a JNI interface to the JVM.

We may like to evaluate libjpeg-turbo utilization (and/or migration) to JOGL.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2112</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-01-22 12:15:59 +0100</bug_when>
    <thetext>Then .. there is WebP:
  https://bugzilla.mozilla.org/show_bug.cgi?id=600919
  https://developers.google.com/speed/webp/

Then .. there is a way to extract lossy pictures from video streams (ffmpeg, ..)

Then we can think of it as simply being not our job
while still branching (TextureIO) to AWT&apos;s ImageIO and maybe adding a branch
for Android .. and libjpeg-turbo if available ..

Well, I am open to suggestions ..</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2113</commentid>
    <comment_count>2</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-01-22 12:31:56 +0100</bug_when>
    <thetext>WebP (VP8 intra frame), H264 - x264&apos;s Jason Garrett-Glaser:
    http://x264dev.multimedia.cx/archives/541

http://muizelaar.blogspot.de/2011/04/webp.html

.. etc etc - then there are new GL [ES3/4.3] IP free texture compression formats.

.. to be continued ..</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2114</commentid>
    <comment_count>3</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2013-01-22 13:02:42 +0100</bug_when>
    <thetext>Libjpeg-turbo seems to be good. JPEG support would drive TextureIO (awt free) a viable solution for engines that alreadt heavily rely on NEWT (Ardor3D, JMonkeyEngine 3).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2366</commentid>
    <comment_count>4</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2013-03-27 14:17:09 +0100</bug_when>
    <thetext>We should take care of the legal aspects too (is JPEG format still patented?).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2413</commentid>
    <comment_count>5</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-04-01 05:18:40 +0200</bug_when>
    <thetext>    Original JavaScript code from &lt;https://github.com/notmasteryet/jpgjs/blob/master/jpg.js&gt;,
    author &apos;notmasteryet&apos; &lt;async.processingjs at yahoo.com&gt;.
    
    Ported to Java.
    
    Enhancements:
     * InputStream instead of memory buffer
     * User provided memory handler
     * Fixed JPEG Component ID/Index mapping
     * Color space conversion (YCCK, CMYK -&gt; RGB)
     * More error tolerant
    
    +++
    
    Features:
                         JOGL   AWT
      RGB             ok     ok
      YCCK            ok     Exception
      CMYK           ok     Exception
      YUV Store    ok     n/a
      Need Y-Flip  no     yes
    
    +++
    
    Benchmark: TestJPEGJoglAWTBenchmarkNewtAWT
    
      JOGL.RGB Loops 100, dt 1199 ms, 11.99 ms/l
      JOGL.YUV Loops 100, dt  351 ms,  3.51 ms/l
      AWT..... Loops 100, dt 2144 ms, 21.44 ms/l
    
    File:    jogl/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/j1-baseline.jpg
    Machine: GNU/Linux PC (AMD 8 core), JavaSE 6 (1.6.0_38)

    .++++ UITestCase.setUp: com.jogamp.opengl.test.junit.jogl.util.texture.TestJPEGJoglAWTBenchmarkNewtAWT - benchmark
    libEGL warning: DRI2: failed to authenticate
    0: JPEGImage[261x202, bytesPerPixel 3, reversedChannels false, JPEGPixels[261x202, sourceComp 3, sourceCS YCbCr, storageCS RGB, storageComp 3], java.nio.DirectByteBuffer[pos=0 lim=158166 cap=158166]]
    0: TextureData[261x202, y-flip false, internFormat 0x1907, pixelFormat 0x1907, pixelType 0x1401, border 0, estSize 158166, alignment 1, rowlen 0, buffer java.nio.DirectByteBuffer[pos=0 lim=158166 cap=158166]
    JOGL.RGB Loops 100, dt 1199 ms, 11.99 ms/l
    0: JPEGImage[261x202, bytesPerPixel 3, reversedChannels false, JPEGPixels[261x202, sourceComp 3, sourceCS YCbCr, storageCS YCbCr, storageComp 3], java.nio.DirectByteBuffer[pos=0 lim=158166 cap=158166]]
    0: TextureData[261x202, y-flip false, internFormat 0x1907, pixelFormat 0x1907, pixelType 0x1401, border 0, estSize 158166, alignment 1, rowlen 0, buffer java.nio.DirectByteBuffer[pos=0 lim=158166 cap=158166]
    JOGL.YUV Loops 100, dt 351 ms, 3.51 ms/l
    0: TextureData[261x202, y-flip true, internFormat 0x1907, pixelFormat 0x80e0, pixelType 0x1401, border 0, estSize 158166, alignment 1, rowlen 261, buffer java.nio.HeapByteBuffer[pos=0 lim=158166 cap=158166]
    AWT..... Loops 100, dt 2144 ms, 21.44 ms/l
    ++++ UITestCase.tearDown: com.jogamp.opengl.test.junit.jogl.util.texture.TestJPEGJoglAWTBenchmarkNewtAWT - benchmark</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2414</commentid>
    <comment_count>6</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-04-01 05:20:15 +0200</bug_when>
    <thetext>(In reply to comment #4)
&gt; We should take care of the legal aspects too (is JPEG format still
&gt; patented?).

https://en.wikipedia.org/wiki/Jpg#Patent_issues

No!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>