<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Depósito de ideias - Ideas Warehouse</title>
	<atom:link href="http://meudepositodeideias.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://meudepositodeideias.wordpress.com</link>
	<description>Books, Sci-fi, Stories, Computing, Whatever :)</description>
	<lastBuildDate>Tue, 21 May 2013 01:17:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='meudepositodeideias.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Depósito de ideias - Ideas Warehouse</title>
		<link>http://meudepositodeideias.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://meudepositodeideias.wordpress.com/osd.xml" title="Depósito de ideias - Ideas Warehouse" />
	<atom:link rel='hub' href='http://meudepositodeideias.wordpress.com/?pushpress=hub'/>
		<item>
		<title>How to build GIMP 2.7.5 using MinGW in Windows 32-bits</title>
		<link>http://meudepositodeideias.wordpress.com/2011/12/19/how-to-build-gimp-2-7-5-using-mingw-in-windows-32-bits/</link>
		<comments>http://meudepositodeideias.wordpress.com/2011/12/19/how-to-build-gimp-2-7-5-using-mingw-in-windows-32-bits/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 02:13:30 +0000</pubDate>
		<dc:creator>Victor Oliveira</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://meudepositodeideias.wordpress.com/?p=144</guid>
		<description><![CDATA[Hi! As part of my work to implement OpenCL in GEGL and GIMP, I have to compile it for Windows, and it&#8217;s no easy task. I&#8217;ll describe here the step-by-step how to build GEGL and GIMP from Git. Maybe this &#8230; <a href="http://meudepositodeideias.wordpress.com/2011/12/19/how-to-build-gimp-2-7-5-using-mingw-in-windows-32-bits/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meudepositodeideias.wordpress.com&#038;blog=13685725&#038;post=144&#038;subd=meudepositodeideias&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hi!</p>
<p>As part of my work to implement OpenCL in GEGL and GIMP, I have to compile it for Windows, and it&#8217;s no easy task. I&#8217;ll describe here the step-by-step how to build GEGL and GIMP from Git.</p>
<p>Maybe this post can help people trying to compile GIMP and help developers to improve GIMP building process in Windows.</p>
<h1>Install MinGW and MSYS</h1>
<p>First, use <a href="http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/mingw-get-inst-20111118/mingw-get-inst-20111118.exe/download">mingw-get-inst</a> to install the latest MinGW and MSYS, choose to install C/C++ compilers and the basic development environment. Install them in the default path.</p>
<p>After that, open the mingw shell and install wget, openssl and unzip, so we can download things from the command-line:</p>
<pre>$ mingw-get.exe install msys-wget
$ mingw-get.exe install msys-openssl
$ mingw-get.exe install msys-unzip</pre>
<h1>Installing Perl</h1>
<p>Perl is used by many building scripts. Download and install <a href="http://www.activestate.com/activeperl/downloads">ActivePerl</a>.</p>
<p>Now, let&#8217;s create our build directory:</p>
<pre>$ mkdir /opt</pre>
<p>Copy the whole content of Active Perl folder to this new folder [C:\MinGW\msys\1.0\opt].</p>
<h1>GTK+</h1>
<p>Let&#8217;s create the folder where our GIMP will be:</p>
<pre>$ mkdir /opt/gimp</pre>
<p>Here the fun begins, we have to go to many places to find gtk+ precompiled binaries.</p>
<p>First, download from the GNOME ftp the GTK+ all-in-one bundle, it has many of the libraries we need.</p>
<pre>$ cd /opt/gimp
$ wget http://ftp.gnome.org/pub/GNOME/binaries/win32/gtk+/2.24/gtk+-bundle_2.24.8-20111122_win32.zip
$ unzip  gtk+-bundle_2.24.8-20111122_win32.zip</pre>
<p>But, ATK, GLib and GTK+ versions bundled are too old for the latest GIMP. So we get them from <a href="http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory/noarch/">OpenSUSE repository</a>:</p>
<pre>$ cd /opt/gimp
$ wget  http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory/noarch/mingw32-atk-2.2.0-1.27.noarch.rpm
$ wget http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory/noarch/mingw32-atk-devel-2.2.0-1.27.noarch.rpm
$ wget http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory/noarch/mingw32-glib2-2.30.2-1.7.noarch.rpm
$ wget http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory/noarch/mingw32-glib2-devel-2.30.2-1.7.noarch.rpm
$ wget http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory/noarch/mingw32-gtk2-2.24.8-1.7.noarch.rpm
$ wget http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory/noarch/mingw32-gtk2-devel-2.24.8-1.7.noarch.rpm</pre>
<p>No easy way to extract them in MSYS, so go to the directory and extract it using 7zip. Replace files when asked. <strong>EDIT: Remember to move /bin, /usr, etc in packages (e.g: opt\gimp\usr\i686-w64-mingw32\sys-root\mingw) to your build dir!</strong></p>
<h1>JPEG, TIFF and PNG</h1>
<p>Download these packages from GNOME ftp and unzip them in /opt/gimp</p>
<pre>$ wget http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/jpeg_8-1_win32.zip
$ wget http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/jpeg-dev_8-1_win32.zip
$ wget http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/libpng_1.4.3-1_win32.zip
$ wget http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/libpng-dev_1.4.3-1_win32.zip</pre>
<h1>Environment variables</h1>
<p>Before compiling anything, set these variables:</p>
<pre>export PATH=".:/opt/perl/bin:/opt/bin:/bin:/mingw/bin:c:/opt/gimp/bin"
export PKG_CONFIG_PATH=/opt/gimp/lib/pkgconfig:/opt/lib/pkgconfig</pre>
<p>Also, try to run gtk-demo to see if everything is ok:</p>
<pre>$ gtk-demo.exe</pre>
<p>A window should appear. If it complains about some dll missing, go to the GNOME ftp or the OpenSUSE repository, get it and install it in /opt/gimp.</p>
<h1>Intltool</h1>
<p>Get Intltool source and let&#8217;s install in /opt</p>
<pre>$ cd /opt
$ wget http://ftp.gnome.org/pub/GNOME/sources/intltool/0.40/intltool-0.40.6.tar.gz
$ tar -xzvf  intltool-0.40.6.tar.gz
$ cd  intltool-0.40.6
$ ./configure prefix=/opt
$ make ; make install</pre>
<h1>Little CMS</h1>
<p><a href="http://sourceforge.net/projects/lcms/files/lcms/1.19/lcms-1.19.tar.gz/download">Download lcms 1.19 source</a> and move it to /opt/src.</p>
<pre>$ tar -xzvf lcms-1.19.tar.gz
$ cd  lcms-1.19
$ ./configure --prefix=/opt/gimp
$ make ; make install</pre>
<p>Now, go to /opt/gimp/lib/pkgconfig. Here are all pkg-config files that will be needed to compile BABL, GEGL and GIMP. It&#8217;s very boring, but change all paths in them [prefix=] to /opt/gimp. You can use some script like:</p>
<pre>find * -type f -name '*.pc' -exec sed -i "s#/devel/target/\(.*\)#/opt/gimp#g" {} \;</pre>
<p>But change it to catch all pkg-config prefix formats in the folder.</p>
<h1>BABL</h1>
<p>Now you can get the latest packages directly from <a href="http://git.gnome.org/browse/babl">Git </a>or from the <a href="https://gimptest.flamingtext.com:9090/">nightly builds site.</a></p>
<p>$ cd /opt/src/babl-0.1.7<br />
$ ./configure &#8211;prefix=/opt/gimp<br />
$ make ; make install</p>
<h1>GEGL</h1>
<pre>$ cd /opt/src/gegl-0.1.9
$ ./configure --prefix=/opt/gimp CPPFLAGS="-march=pentium -mtune=pentium" --disable-docs
$ make ; make install</pre>
<h1>GIMP</h1>
<p>Finally, GIMP! In this tutorial I didn&#8217;t enabled Python for simplicity. In <a href="http://git.gnome.org/browse/gimp/commit/?id=c15c3f4828527d9836de0ba168b4bfe00669cc21">http://git.gnome.org/browse/gimp/commit/?id=c15c3f4828527d9836de0ba168b4bfe00669cc21</a> I fixed some errors about undefined prototypes, so give a look if your source includes it.</p>
<pre>$ cd /opt/src/gimp-2.7.5
 $ ./configure --prefix=/opt/gimp CPPFLAGS="-march=pentium -mtune=pentium" --disable-python
 $ make
 $ make install</pre>
<p>Now, there will be some errors probably:</p>
<ul>
<li>If you have an error about &#8220;Undefined GetUserDefaultUILanguage&#8221;, change line 50 in app/language.c:</li>
</ul>
<pre>//switch (GetUserDefaultUILanguage())
switch (GetUserDefaultLangID())</pre>
<ul>
<li>I don&#8217;t know why, but my libintl doesn&#8217;t export some symbols like libintl_printf, so I had to put &#8220;#define libintl_printf printf&#8221; in the beginning of the following files:
<ul>
<li>app/core/gimptagcache.c</li>
<li>plug-ins/common/animation-play.c</li>
<li>plug-ins/common/curve-bend.c:</li>
<li>plug-ins/common/file-xwd.c</li>
<li>plug-ins/common/jigsaw.c</li>
<li>plug-ins/common/newsprint.c</li>
<li>plug-ins/common/sample-colorize.c</li>
<li>plug-ins/file-sgi/sgi.c</li>
</ul>
</li>
<li>if you have many errors with Little CMS, change lines 22-26 of modules/display-filter-lcms.c. Don&#8217;t really know why:</li>
</ul>
<pre>//#ifdef G_OS_WIN32
//#define STRICT
#include &lt;windows.h&gt;
//#define LCMS_WIN_TYPES_ALREADY_DEFINED
//#endif</pre>
<p>Now, go to /opt/gimp/bin and the gimp executable should be there. As we installed everything in /opt/gimp, just compress this folder if you want to create an installer or use it in another PC.</p>
<h1>References</h1>
<ul>
<li><a href="http://partha.com/articles/groundwork.html">http://partha.com/articles/groundwork.html</a></li>
<li><a href="http://partha.com/articles/buildinggimp.html">http://partha.com/articles/buildinggimp.html</a></li>
<li><a href="http://gimpchat.com/viewtopic.php?f=7&amp;t=3308&amp;start=20">http://gimpchat.com/viewtopic.php?f=7&amp;t=3308&amp;start=20</a></li>
<li><a href="http://gimpchat.com/viewtopic.php?f=7&amp;t=3308&amp;sid=e75252e1a95ce43ed6a2b364b1c95a30&amp;start=30">http://gimpchat.com/viewtopic.php?f=7&amp;t=3308&amp;sid=e75252e1a95ce43ed6a2b364b1c95a30&amp;start=30</a></li>
<li><a href="http://gimpchat.com/viewtopic.php?f=7&amp;t=3308&amp;sid=e75252e1a95ce43ed6a2b364b1c95a30&amp;start=40">http://gimpchat.com/viewtopic.php?f=7&amp;t=3308&amp;sid=e75252e1a95ce43ed6a2b364b1c95a30&amp;start=40</a></li>
<li><a href="http://www.gimpchat.com/viewtopic.php?f=4&amp;t=3071&amp;start=10">http://www.gimpchat.com/viewtopic.php?f=4&amp;t=3071&amp;start=10</a></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/meudepositodeideias.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/meudepositodeideias.wordpress.com/144/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meudepositodeideias.wordpress.com&#038;blog=13685725&#038;post=144&#038;subd=meudepositodeideias&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://meudepositodeideias.wordpress.com/2011/12/19/how-to-build-gimp-2-7-5-using-mingw-in-windows-32-bits/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/064472065d53467d5334849283ce998a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">victormatheus</media:title>
		</media:content>
	</item>
		<item>
		<title>OpenCL on GEGL: Results up to now</title>
		<link>http://meudepositodeideias.wordpress.com/2011/08/08/opencl-on-gegl-results-up-to-now/</link>
		<comments>http://meudepositodeideias.wordpress.com/2011/08/08/opencl-on-gegl-results-up-to-now/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 18:16:36 +0000</pubDate>
		<dc:creator>Victor Oliveira</dc:creator>
				<category><![CDATA[gsoc]]></category>

		<guid isPermaLink="false">http://meudepositodeideias.wordpress.com/?p=102</guid>
		<description><![CDATA[Hello everyone! I&#8217;m glad to show you the results up to now of my GSoC project about adding OpenCL support to the General Graphics Library. What I&#8217;ve done GEGL has two basic data types: GeglTile GeglBuffer A GeglBuffer can be &#8230; <a href="http://meudepositodeideias.wordpress.com/2011/08/08/opencl-on-gegl-results-up-to-now/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meudepositodeideias.wordpress.com&#038;blog=13685725&#038;post=102&#038;subd=meudepositodeideias&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hello everyone! I&#8217;m glad to show you the results up to now of my GSoC project about adding OpenCL support to the General Graphics Library.</p>
<h2>What I&#8217;ve done</h2>
<p>GEGL has two basic data types:</p>
<ul>
<li>GeglTile</li>
<li>GeglBuffer</li>
</ul>
<p>A GeglBuffer can be seen as a layer in a image editing tool, they can be translated, cut, duplicated, etc. A final image is a composition of buffers. A buffer is composed by many GeglTiles, which are rectangular regions of pixels with same size, so pixel data like color is stored in tiles. This architecture is very flexible and allows for example that tiles may be stored in the disk, in a network or compacted.</p>
<p>What I want in my project is to be able to process tiles using an OpenCL device, like GPUs or even a <a href="http://software.intel.com/en-us/articles/opencl-sdk/">multi-core CPU</a>, the solution I implemented is that each tile has two states, the host memory data and a pointer to a OpenCL memory buffer and each one has its revision number which are used for synchronization.</p>
<p>This synchronization is achieved through locks. For example, suppose <a href="http://gegl.org/api.html#gegl_buffer_get">gegl_buffer_get</a> is called for a buffer which tiles are being processed in the GPU. This function asks for buffer data to be copied to a pointer, as such, each buffer&#8217;s tile is going to be locked for reading, this locking process will verify the revision numbers and move data from the GPU to the CPU accordingly. The picture below illustrate this architecture:</p>
<p style="text-align:center;"><a href="http://meudepositodeideias.files.wordpress.com/2011/08/gegl1.png"><img class="aligncenter size-full wp-image-106" title="gegl" src="http://meudepositodeideias.files.wordpress.com/2011/08/gegl1.png?w=640&#038;h=354" alt="" width="640" height="354" /></a></p>
<h2 style="text-align:left;">An Example of Use</h2>
<p>I&#8217;ll show an example of use of gegl buffer iterators to implement a Brightness-Contrast filter using OpenCL.</p>
<p>First, we define the OpenCL kernel that will be executed for each tile:</p>
<pre class="brush: cpp; title: ; notranslate">
    const char* kernel_source[] =
    {
    &quot;sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE |              \n&quot;,
    &quot;                    CLK_ADDRESS_NONE            |              \n&quot;,
    &quot;                    CLK_FILTER_NEAREST;                        \n&quot;,
    &quot;__kernel void kernel_bc(__read_only  image2d_t in,             \n&quot;,
    &quot;                        __write_only image2d_t out,            \n&quot;,
    &quot;                         float brightness,                     \n&quot;,
    &quot;                         float contrast)                       \n&quot;,
    &quot;{                                                              \n&quot;,
    &quot;  int2 gid = (int2)(get_global_id(0), get_global_id(1));       \n&quot;,
    &quot;  float4 in_v  = read_imagef(in, sampler, gid);                \n&quot;,
    &quot;  float4 out_v;                                                \n&quot;,
    &quot;  out_v.xyz = (in_v.xyz - 0.5f) * contrast + brightness + 0.5f;\n&quot;,
    &quot;  out_v.w   =  in_v.w;                                         \n&quot;,
    &quot;  write_imagef(out, gid, out_v);                               \n&quot;,
    &quot;}                                                              \n&quot;,
}
</pre>
<p>So, each tile is a OpenCL image2d_t type which can be read-only or write-only and be must be fetched through a sampler.</p>
<p>Now let&#8217;s see the iterator code:</p>
<pre class="brush: cpp; title: ; notranslate">
    i = gegl_buffer_iterator_new (buffer_write, NULL, NULL, GEGL_BUFFER_CL_WRITE);
    index = gegl_buffer_iterator_add (i, buffer_read, NULL, NULL, GEGL_BUFFER_CL_READ);
    while (gegl_buffer_iterator_next (i))
      {
        GeglClTexture *in_tex  = i-&gt;cl_data[index];
        GeglClTexture *out_tex = i-&gt;cl_data[0];
        size_t global_worksize[2] = {i-&gt;roi[0].width, i-&gt;roi[0].height};

        CL_SAFE_CALL( errcode = gegl_clSetKernelArg(kernel, 0, sizeof(cl_mem),   (void*)&amp;in_tex-&gt;data) );
        CL_SAFE_CALL( errcode = gegl_clSetKernelArg(kernel, 1, sizeof(cl_mem),   (void*)&amp;out_tex-&gt;data) );
        CL_SAFE_CALL( errcode = gegl_clSetKernelArg(kernel, 2, sizeof(cl_float), (void*)&amp;brightness) );
        CL_SAFE_CALL( errcode = gegl_clSetKernelArg(kernel, 3, sizeof(cl_float), (void*)&amp;contrast) );

        CL_SAFE_CALL( errcode = gegl_clEnqueueNDRangeKernel(gegl_cl_get_command_queue(), kernel, 2,
                                                      NULL, global_worksize, NULL,
                                                      0, NULL, NULL) );
        CL_SAFE_CALL( errcode = gegl_clFinish(gegl_cl_get_command_queue()) );
      }
</pre>
<p>The key point here is the GEGL_BUFFER_CL_WRITE and GEGL_BUFFER_CL_READ flags passed to the iterator. They mean that writing and reading will be done through whatever OpenCL device [GPU or CPU] we&#8217;re using. This code just executes the kernel defined above for each tile.</p>
<p>Before entering the iteration in buffer_read and buffer_write, all data from buffer_read is copied to the GPU [of course, only if it is the most recent]. At the end, the OpenCL revision numbers from buffer_write&#8217;s tiles are bumped.</p>
<p>If after all that we do this:</p>
<pre class="brush: cpp; title: ; notranslate">
gegl_buffer_get (buffer_write, 1.0, NULL, NULL, buf_write, GEGL_AUTO_ROWSTRIDE);
</pre>
<p>This means we want to copy buffer_write&#8217;s data to a pointer in the host memory, so we have to synchronize host and GPU data versions before that. So all buffer functions will always return the most recent data version and, at the same time, memory transferences will be made only if necessary.</p>
<p>Here is a fluxogram  of what is happening in this code:</p>
<p><a href="http://meudepositodeideias.files.wordpress.com/2011/08/iterator1.png"><img class="aligncenter size-full wp-image-128" title="iterator" src="http://meudepositodeideias.files.wordpress.com/2011/08/iterator1.png?w=640&#038;h=440" alt="" width="640" height="440" /></a></p>
<p><a href="http://git.gnome.org/browse/gegl/tree/tests/opencl/test-gegl-buffer-cl-brightness-contrast.c?h=gsoc2011-opencl">Full code</a></p>
<h2>Performance Results</h2>
<p>Running the Brightness-Contrast code with a 1 mega pixel image using a NVidia Tesla C2050 as OpenCL device and a Intel Xeon E5506 as comparison [just using one core, but the code uses SSE2].</p>
<p>Time of memory transferences to the GPU was considered in this benchmark [EDIT:<strong> this time considers transferring data back and forth between GPU and CPU</strong>].</p>
<ul>
<li>CPU Elapsed time: 526 milliseconds</li>
<li>OpenCL Elapsed time: 483 milliseconds</li>
</ul>
<p>Also, here is a chart from NVidia profiler showing how execution time was spent:</p>
<p><a href="http://meudepositodeideias.files.wordpress.com/2011/08/execution_times.png"><img class="aligncenter size-full wp-image-130" title="execution_times" src="http://meudepositodeideias.files.wordpress.com/2011/08/execution_times.png?w=640&#038;h=82" alt="" width="640" height="82" /></a></p>
<p>Almost 80% of total execution time has been spent in memory transferences to and from the GPU. This is a good result, because even with this overhead the results were reasonable. Consider that the typical use case of GEGL is doing many operations in sequence, so the ratio processing/memory transferences tends to be higher. In fact, the case present here is the worst-case.</p>
<h2>Possible Improvements</h2>
<p>There are a lot of things that can be done in order to increase current code speed:</p>
<h3>Intercalate execution of tiles with memory transferences of others tiles</h3>
<p>GPU hardware (at least modern NVidia GPUs) has separated  units for processing and memory transferences, we can use this to intercalate tiles processing and copying.</p>
<h3>Tiles sharing the same OpenCL memory buffer</h3>
<p>There is a lot of overhead in allocating a GPU texture for each tile. which is typically small [128x64]. I think the best way to tackle this problem is allocating a big chunk of memory and using offsets in this chunk when processing [it's impossible to have pointers to GPU memory], the problem is that GEGL is supposed to abstract the user  this kind of stuff from the user. Another idea is to serialize execution by having a pool of textures which can be reused by tiles, this would be good also because GPU memory is smaller than Host memory in general, the direct mapping CPU&lt;-&gt;GPU cannot stand in fact.</p>
<h3>Multiple OpenCL Command Queues</h3>
<p>Command Queues can be executed concurrently in the same device, the Fermi architecture from NVidia can run 16 kernels at the same time, for example. This can be used to solve the memory transference overhead also.</p>
<h2>Next Steps</h2>
<p>I have yet to finish the implementation of a operator interface for OpenCL and make some OpenCL operators in order to create a useful chain of processing only in the GPU.</p>
<p>As the time for a GSoC project is very limited, my mentor and I decided to let optimizations outside the project, but I intend to work on them as soon as I can <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Conclusion</h2>
<p>The use of locking in order to synchronize CPU and GPU data was the most challenging part of the implementation, but after extensive testing. I think it&#8217;s working now, though I took more time than I expected to make it run properly.</p>
<p>Moreover, results so far show that using OpenCL to speed up Gegl is feasible and very interesting, thought still there is some challenges to be tackled, the tiled structure of Gegl allows a lot of optimizations.</p>
<p>The Gegl OpenCL branch is <a href="http://git.gnome.org/browse/gegl/log/?h=gsoc2011-opencl">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/meudepositodeideias.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/meudepositodeideias.wordpress.com/102/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meudepositodeideias.wordpress.com&#038;blog=13685725&#038;post=102&#038;subd=meudepositodeideias&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://meudepositodeideias.wordpress.com/2011/08/08/opencl-on-gegl-results-up-to-now/feed/</wfw:commentRss>
		<slash:comments>52</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/064472065d53467d5334849283ce998a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">victormatheus</media:title>
		</media:content>

		<media:content url="http://meudepositodeideias.files.wordpress.com/2011/08/gegl1.png" medium="image">
			<media:title type="html">gegl</media:title>
		</media:content>

		<media:content url="http://meudepositodeideias.files.wordpress.com/2011/08/iterator1.png" medium="image">
			<media:title type="html">iterator</media:title>
		</media:content>

		<media:content url="http://meudepositodeideias.files.wordpress.com/2011/08/execution_times.png" medium="image">
			<media:title type="html">execution_times</media:title>
		</media:content>
	</item>
		<item>
		<title>The Limits of Understanding</title>
		<link>http://meudepositodeideias.wordpress.com/2011/07/13/the-limits-of-understanding/</link>
		<comments>http://meudepositodeideias.wordpress.com/2011/07/13/the-limits-of-understanding/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 19:27:43 +0000</pubDate>
		<dc:creator>Victor Oliveira</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://meudepositodeideias.wordpress.com/?p=96</guid>
		<description><![CDATA[&#160; &#160; About This Video This statement is false. Think about it, and it makes your head hurt. If it’s true, it’s false. If it’s false, it’s true. In 1931, Austrian logician Kurt Gödel shocked the worlds of mathematics and &#8230; <a href="http://meudepositodeideias.wordpress.com/2011/07/13/the-limits-of-understanding/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meudepositodeideias.wordpress.com&#038;blog=13685725&#038;post=96&#038;subd=meudepositodeideias&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span class="Apple-style-span" style="color:#000000;font-size:22px;line-height:32px;">About This Video</span></p>
<p>This statement is false. Think about it, and it makes your head hurt. If it’s true, it’s false. If it’s false, it’s true. In 1931, Austrian logician Kurt Gödel shocked the worlds of mathematics and philosophy by establishing that such statements are far more than a quirky turn of language: he showed that there are mathematical truths which simply can’t be proven. In the decades since, thinkers have taken the brilliant Gödel’s result in a variety of directions—linking it to limits of human comprehension and the quest to recreate human thinking on a computer. In this full program from the 2010 Festival, leading thinkers untangle Gödel’s discovery and examine the wider implications of his revolutionary finding.</p>
<p><a href="http://worldsciencefestival.com/videos/the_limits_of_understanding">http://worldsciencefestival.com/videos/the_limits_of_understanding</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/meudepositodeideias.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/meudepositodeideias.wordpress.com/96/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meudepositodeideias.wordpress.com&#038;blog=13685725&#038;post=96&#038;subd=meudepositodeideias&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://meudepositodeideias.wordpress.com/2011/07/13/the-limits-of-understanding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/064472065d53467d5334849283ce998a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">victormatheus</media:title>
		</media:content>
	</item>
		<item>
		<title>Coincidence</title>
		<link>http://meudepositodeideias.wordpress.com/2011/07/13/coincidence/</link>
		<comments>http://meudepositodeideias.wordpress.com/2011/07/13/coincidence/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 19:26:21 +0000</pubDate>
		<dc:creator>Victor Oliveira</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://meudepositodeideias.wordpress.com/?p=94</guid>
		<description><![CDATA[People are entirely too disbelieving of coincidence. They are far too ready to dismiss it and to build arcane structures of extremely rickety substance in order to avoid it. I, on the other hand, see coincidence everywhere as an inevitable &#8230; <a href="http://meudepositodeideias.wordpress.com/2011/07/13/coincidence/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meudepositodeideias.wordpress.com&#038;blog=13685725&#038;post=94&#038;subd=meudepositodeideias&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<blockquote>
<div id="M0">People are entirely too disbelieving of coincidence. They are far too ready to dismiss it and to build arcane structures of extremely rickety substance in order to avoid it. I, on the other hand, see coincidence everywhere as an inevitable consequence of the laws of probability, according to which having no unusual coincidence is far more unusual than any coincidence could possibly be.</div>
<div>Isaac Asimov &#8211; The Planet That Wasn`t</div>
<p>&nbsp;</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/meudepositodeideias.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/meudepositodeideias.wordpress.com/94/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meudepositodeideias.wordpress.com&#038;blog=13685725&#038;post=94&#038;subd=meudepositodeideias&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://meudepositodeideias.wordpress.com/2011/07/13/coincidence/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/064472065d53467d5334849283ce998a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">victormatheus</media:title>
		</media:content>
	</item>
		<item>
		<title>Can a machine have a soul?</title>
		<link>http://meudepositodeideias.wordpress.com/2011/07/12/can-a-machine-have-a-soul/</link>
		<comments>http://meudepositodeideias.wordpress.com/2011/07/12/can-a-machine-have-a-soul/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 02:10:51 +0000</pubDate>
		<dc:creator>Victor Oliveira</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://meudepositodeideias.wordpress.com/?p=91</guid>
		<description><![CDATA[Alan, You really have thought about everything, who knows how the world would be if you had lived. Thinking is a function of man’s immortal soul In attempting to construct such machines we should not be irreverently usurping His power &#8230; <a href="http://meudepositodeideias.wordpress.com/2011/07/12/can-a-machine-have-a-soul/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meudepositodeideias.wordpress.com&#038;blog=13685725&#038;post=91&#038;subd=meudepositodeideias&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Alan, You really have thought about everything, who knows how the world would be if you had lived.</p>
<blockquote><p>Thinking is a function of man’s immortal soul</p>
<p>In attempting to construct such machines we should not be irreverently usurping His power of creating souls, any more than we are in the procreation of children: rather we are, in either case, instruments of His will providing mansions for the souls that He creates.</p>
<p>Alan Turing</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/meudepositodeideias.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/meudepositodeideias.wordpress.com/91/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meudepositodeideias.wordpress.com&#038;blog=13685725&#038;post=91&#038;subd=meudepositodeideias&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://meudepositodeideias.wordpress.com/2011/07/12/can-a-machine-have-a-soul/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/064472065d53467d5334849283ce998a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">victormatheus</media:title>
		</media:content>
	</item>
		<item>
		<title>Aleatório semanal</title>
		<link>http://meudepositodeideias.wordpress.com/2011/06/28/aleatorio-semanal/</link>
		<comments>http://meudepositodeideias.wordpress.com/2011/06/28/aleatorio-semanal/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 01:29:38 +0000</pubDate>
		<dc:creator>Victor Oliveira</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://meudepositodeideias.wordpress.com/?p=88</guid>
		<description><![CDATA[&#160; &#160; &#160; Solimão I &#160; &#160;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meudepositodeideias.wordpress.com&#038;blog=13685725&#038;post=88&#038;subd=meudepositodeideias&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h1>Solimão I</h1>
<p><a href="http://meudepositodeideias.files.wordpress.com/2011/06/solimao1.jpg"><img class="aligncenter size-full wp-image-89" title="solimao1" src="http://meudepositodeideias.files.wordpress.com/2011/06/solimao1.jpg?w=640&#038;h=480" alt="" width="640" height="480" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/meudepositodeideias.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/meudepositodeideias.wordpress.com/88/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meudepositodeideias.wordpress.com&#038;blog=13685725&#038;post=88&#038;subd=meudepositodeideias&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://meudepositodeideias.wordpress.com/2011/06/28/aleatorio-semanal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/064472065d53467d5334849283ce998a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">victormatheus</media:title>
		</media:content>

		<media:content url="http://meudepositodeideias.files.wordpress.com/2011/06/solimao1.jpg" medium="image">
			<media:title type="html">solimao1</media:title>
		</media:content>
	</item>
		<item>
		<title>Brute Force Exact Euclidian Distance Transform in CUDA</title>
		<link>http://meudepositodeideias.wordpress.com/2011/06/08/brute-force-exact-euclidian-distance-transform-in-cuda/</link>
		<comments>http://meudepositodeideias.wordpress.com/2011/06/08/brute-force-exact-euclidian-distance-transform-in-cuda/#comments</comments>
		<pubDate>Wed, 08 Jun 2011 19:09:12 +0000</pubDate>
		<dc:creator>Victor Oliveira</dc:creator>
				<category><![CDATA[gpu]]></category>
		<category><![CDATA[image processing]]></category>

		<guid isPermaLink="false">http://meudepositodeideias.wordpress.com/?p=70</guid>
		<description><![CDATA[Hi! Following a discussion in Reddit about the Distance Transform in GPU, I decided to post a implementation I made some time ago. It&#8217;s the brute force euclidian distance transform. Basically, in a binary image, for each pixel in the &#8230; <a href="http://meudepositodeideias.wordpress.com/2011/06/08/brute-force-exact-euclidian-distance-transform-in-cuda/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meudepositodeideias.wordpress.com&#038;blog=13685725&#038;post=70&#038;subd=meudepositodeideias&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hi!</p>
<p>Following a discussion in Reddit about the Distance Transform in GPU, I decided to post a implementation I made some time ago.</p>
<p>It&#8217;s the brute force euclidian distance transform. Basically, in a binary image, for each pixel in the foreground we verify what is the 2D euclidian distance to the nearest pixel in the background.</p>
<p>Here is the source of the kernel:</p>
<pre class="brush: cpp; title: ; notranslate">
#define BLOCK_SIZE 256

__global__ void euclidian_distance_transform_kernel(
  const unsigned char* img, float* dist, int w, int h)
{
  const int i = blockIdx.x*blockDim.x + threadIdx.x;
  const int N = w*h;

  if (i &gt;= N)
  {
    return;
  }

  int cx = i % w;
  int cy = i / w;

  float minv = INFINITY;

  if (img[i] &gt; 0)
  {
    minv = 0.0f;
  }
  else
  {
    for (int j = 0; j &lt; N; j++)
    {
        if (img[j] &gt; 0)
        {
          int x = j % w;
          int y = j / w;
          float d = sqrtf( powf(float(x-cx), 2.0f) + powf(float(y-cy), 2.0f) );
          if (d &lt; minv) minv = d;
        }
    }
  }

  dist[i] = minv;
}
</pre>
<p><span style="font-size:x-small;"><strong>Performance</strong></span></p>
<p>35.8 seconds for a 1 megapixel image in a Tesla C2050 GPU. Terrible result.</p>
<p>I suppose a good hardware can&#8217;t save a bad algorithm after all <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>The code is at <a href="https://github.com/victormatheus/DT-GPU">https://github.com/victormatheus/DT-GPU</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/meudepositodeideias.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/meudepositodeideias.wordpress.com/70/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meudepositodeideias.wordpress.com&#038;blog=13685725&#038;post=70&#038;subd=meudepositodeideias&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://meudepositodeideias.wordpress.com/2011/06/08/brute-force-exact-euclidian-distance-transform-in-cuda/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/064472065d53467d5334849283ce998a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">victormatheus</media:title>
		</media:content>
	</item>
		<item>
		<title>Google Summer of Code : OpenCL in GEGL</title>
		<link>http://meudepositodeideias.wordpress.com/2011/06/06/google-summer-of-code-opencl-in-gegl/</link>
		<comments>http://meudepositodeideias.wordpress.com/2011/06/06/google-summer-of-code-opencl-in-gegl/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 01:32:58 +0000</pubDate>
		<dc:creator>Victor Oliveira</dc:creator>
				<category><![CDATA[gsoc]]></category>

		<guid isPermaLink="false">http://meudepositodeideias.wordpress.com/?p=61</guid>
		<description><![CDATA[Hello everyone, I`m going to use my personal blog to register my steps in the wonderful world of my GSoC project. I`m going to implement OpenCL support in the Generic Graphics Library. For those who doesn`t know, OpenCL is a &#8230; <a href="http://meudepositodeideias.wordpress.com/2011/06/06/google-summer-of-code-opencl-in-gegl/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meudepositodeideias.wordpress.com&#038;blog=13685725&#038;post=61&#038;subd=meudepositodeideias&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hello everyone, I`m going to use my personal blog to register my steps in the wonderful world of my GSoC project. I`m going to implement OpenCL support in the Generic Graphics Library.</p>
<p>For those who doesn`t know, OpenCL is a language which allows parallel and high-performance code to run in different platforms, like GPUs and Multi-Core CPUs. By the end of the project, I want GEGL`s (and GIMP) plugins/operations to be able to use OpenCL.</p>
<p>My proposal:</p>
<p style="padding-left:30px;">OpenCL in GEGL</p>
<p>&#8220;OpenCL (Open Computing Language) is a framework for writing programs that execute across heterogeneous platforms consisting of CPUs, GPUs, and other processors. OpenCL includes a language (based on C99) for writing kernels (functions that execute on OpenCL devices), plus APIs that are used to define and then control the platforms. OpenCL provides parallel computing using task-based and data-based parallelism.&#8221; [wikipedia]</p>
<p style="padding-left:30px;">My proposal is about making possible to write GEGL plug-ins in OpenCL. Of course you can always write your plug-in using any technology inside it (nothing forbides you from using OpenMP to parallelize a composition operation, for example). But the main point of the work is extending GeglBuffer to automatically make the memory transferences between the CPU and GPU.<strong></strong></p>
<p style="padding-left:30px;"><strong>An example: </strong></p>
<p>So let&#8217;s suppose you have defined a graph in GEGL with a path of operations A, B and C. A and C can run at GPU, but we don&#8217;t have a GPU version for B.</p>
<p style="padding-left:30px;">input -&gt; A (GPU) -&gt; B (CPU) -&gt; C (GPU) -&gt; output</p>
<p style="padding-left:30px;">So, before entering A, we have to copy the input data to the GPU and do the processing in the GPU plug-in. After that, we copy data back to the main memory in order to B have its data, then we copy B&#8217;s output to the GPU again and run C, we need to have the output in the CPU of course, so we copy back C&#8217;s output to the main memory and finish.</p>
<p style="padding-left:30px;">Our objective is doing these memory transfers in a transparent way to the end-user of GEGL and implementing some operations in OpenCL.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/meudepositodeideias.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/meudepositodeideias.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meudepositodeideias.wordpress.com&#038;blog=13685725&#038;post=61&#038;subd=meudepositodeideias&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://meudepositodeideias.wordpress.com/2011/06/06/google-summer-of-code-opencl-in-gegl/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/064472065d53467d5334849283ce998a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">victormatheus</media:title>
		</media:content>
	</item>
		<item>
		<title>Animes: Legend of the Galactic Heroes</title>
		<link>http://meudepositodeideias.wordpress.com/2010/05/19/animes-legend-of-the-galactic-heroes/</link>
		<comments>http://meudepositodeideias.wordpress.com/2010/05/19/animes-legend-of-the-galactic-heroes/#comments</comments>
		<pubDate>Wed, 19 May 2010 21:43:06 +0000</pubDate>
		<dc:creator>Victor Oliveira</dc:creator>
				<category><![CDATA[animes]]></category>

		<guid isPermaLink="false">http://meudepositodeideias.wordpress.com/?p=37</guid>
		<description><![CDATA[&#8220;Legend of the Galactic Heroes&#8221; foi um anime que eu vi nas últimas férias, antes de mais nada vou colocar alguns números sobre a série: 2 filmes OVA de 110 episódios outro OVA com 52 episódios infinitos mangás e livros &#8230; <a href="http://meudepositodeideias.wordpress.com/2010/05/19/animes-legend-of-the-galactic-heroes/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meudepositodeideias.wordpress.com&#038;blog=13685725&#038;post=37&#038;subd=meudepositodeideias&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<div id="attachment_38" class="wp-caption aligncenter" style="width: 288px"><a href="http://meudepositodeideias.files.wordpress.com/2010/05/logh.jpg"><img class="size-full wp-image-38" title="Legend of the Galactic Heroes" src="http://meudepositodeideias.files.wordpress.com/2010/05/logh.jpg?w=640" alt="Legend of the Galactic Heroes"   /></a><p class="wp-caption-text">Legend of the Galactic Heroes</p></div>
<p>&#8220;Legend of the Galactic Heroes&#8221; foi um anime que eu vi nas últimas férias, antes de mais nada vou colocar alguns números sobre a série:</p>
<ul>
<li>2 filmes</li>
<li>OVA de <strong>110 episódios</strong></li>
<li><strong>outro</strong> OVA com 52 episódios</li>
<li>infinitos mangás e livros</li>
</ul>
<p>Eu vi o primeiro OVA (110 eps), que basicamente tem toda a história.</p>
<p>Pois bem, LOGH conta a história sobre um futuro distante em que a humanidade já colonizou a galáxia, mas a raça humana se organizou em dois governos que estão em guerra há tempos. A Aliança dos Planetas Livres, que é uma democracia, e o Império Galático, que é uma monarquia. Diferente de várias histórias sci-fi que eu já li/vi, não existem aliens em LOGH, o que o torna bastante parecido com as histórias da Fundação, de Asimov, em que também existe uma disputa  de poder, só que entre o (também) Império Galático e a Fundação.</p>
<p>Uma das partes mais interessante de LOGH é que ele não se prende aos estereótipos de Liberdade x Poder Absoluto, mas mostra uma democracia corrupta e decadente contra um império renovado pela figura de um novo imperador. Os dois personagens principais são o comandante da frota da Aliança dos Planetas Livres, Yang Wenli, e o comandante da frota Imperial, Reinhard von Lohengramm. Fica um embate pela simpatia do espectador por qual lado tomar partido, eu tomei pela Aliança, porque Yang Wenli é historiador e sem dúvida é um dos personagens mais interessantes que já vi em animes.</p>
<p>Mas me arrisco a dizer que o personagem principal do anime é a História, que vai sendo desfiada serenamente para o espectador a cada episódio, através das intrigas políticas e batalhas espaciais. Quando termina cada episódio você pensa: &#8220;É. não teria realmente outro modo das coisas acontecerem&#8221;. Claro que poderiam, mas o enredo é tão bem amarrado que realmente faz parecer que não há essa opção.</p>
<p>Outro detalhe é a trilha sonora, muito boa, composta basicamente por música clássica. Embora seja ambientado no futuro, LOGH tem muitos elementos da nobreza aristocrática do séc. XIX, o que é bem interessante também.</p>
<p>Enfim, para todos os que quiserem ver esse fantástico anime, só através de torrents ou sites especializados, já que ele é um tanto quanto obscuro e que sequer foi traduzido oficialmente para o inglês, mas que realmente vale a pena.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/meudepositodeideias.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/meudepositodeideias.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meudepositodeideias.wordpress.com&#038;blog=13685725&#038;post=37&#038;subd=meudepositodeideias&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://meudepositodeideias.wordpress.com/2010/05/19/animes-legend-of-the-galactic-heroes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/064472065d53467d5334849283ce998a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">victormatheus</media:title>
		</media:content>

		<media:content url="http://meudepositodeideias.files.wordpress.com/2010/05/logh.jpg" medium="image">
			<media:title type="html">Legend of the Galactic Heroes</media:title>
		</media:content>
	</item>
		<item>
		<title>Uma visão do futuro</title>
		<link>http://meudepositodeideias.wordpress.com/2010/05/15/uma-visao-do-futuro/</link>
		<comments>http://meudepositodeideias.wordpress.com/2010/05/15/uma-visao-do-futuro/#comments</comments>
		<pubDate>Sat, 15 May 2010 02:17:33 +0000</pubDate>
		<dc:creator>Victor Oliveira</dc:creator>
				<category><![CDATA[histórias]]></category>

		<guid isPermaLink="false">http://victormatheus.wordpress.com/?p=24</guid>
		<description><![CDATA[Eis que um certo dia, tive um sonho estranho, daqueles que não se entende no exato momento em que se acorda, mas que conforme passam os dias, as lacunas são preenchidas e o significado vai ficando mais claro &#8211; ou &#8230; <a href="http://meudepositodeideias.wordpress.com/2010/05/15/uma-visao-do-futuro/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meudepositodeideias.wordpress.com&#038;blog=13685725&#038;post=24&#038;subd=meudepositodeideias&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Eis que um certo dia, tive um sonho estranho, daqueles que não se entende no exato momento em que se acorda, mas que conforme passam os dias, as lacunas são preenchidas e o significado vai ficando mais claro &#8211; ou seria simplesmente invenção de uma mente que não suporta a idéia de um espaço vazio nesse fluxo contínuo de pensamentos que costumamos chamar de consciência? Sinceramente, não sei.</p>
<p>Nesse sonho eu não era mais eu, no sentido tradicional do termo, mas simplesmente uma presença que se movia pelo universo, não que pudesse fazer muita coisa para transformar minha vontade em ação, mas pelo menos conseguia ver o que se passava, o que já era bastante interessante por si só. Nesse estado quase etéreo, em um lampejo de vontade, tomei controle do meu sonho e me afastei da Terra, tão rápido quanto a luz. E no que foi uma fraçaõ de segundo para mim, o universo envelheceu alguns bilhões de anos.</p>
<p>Quando dei por mim, &#8220;Que estrelas são essas?&#8221;, pensei. Desconhecido &#8211; Longe no tempo e no espaço do pequeno planeta que havia vivido minha vida. Ele ainda existiria? Teria a humanidade esvanecido nas infinitas eras que se passaram? Foi quando perguntei para um cometa, do tipo velho e que tinha visto muita coisa por aí nas suas muitas eras de viagem intergalática, &#8220;Sr. Cometa, você viu algum humano por aí?&#8221;, perguntei.</p>
<p>&#8220;Umm, humano? Dê uma olhada por ali&#8221;. Segui a direção dada pela velha rocha e, para meu espanto, vi que a humanidade ainda existia! Raça de seres orgulhosos e fortes, havia superado todos os obstáculos e criado uma poderosa civilização que se estendia de uma ponta a outra da galáxia!</p>
<p>Mas se existe vontade nos sonhos, é uma ilusão, porque mal tive essa visão de glória, fui transportado mais uma vez para um futuro ainda mais remoto, além de qualquer compreensão humana. Vi sóis morrerem e virarem estrondosas Novas que destruíram tudo ao seu redor, mas mesmo elas são apenas uma faísca no grande universo. Lentamente, vi as cores do universo mudarem de um tom vermelho para o azul, se no início havia infinitas possibilidades, no fim tudo convergia para um único destino: O inverno termodinâmico.</p>
<p>Foi quando vi que só eu existia no universo e que fora a voz da minha consciência só havia o silêncio e a paz que só poderia existir fim de todas as coisas. A vida de um universo chega ao fim e junto com ela, o meu sonho.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/meudepositodeideias.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/meudepositodeideias.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meudepositodeideias.wordpress.com&#038;blog=13685725&#038;post=24&#038;subd=meudepositodeideias&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://meudepositodeideias.wordpress.com/2010/05/15/uma-visao-do-futuro/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/064472065d53467d5334849283ce998a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">victormatheus</media:title>
		</media:content>
	</item>
	</channel>
</rss>
