tag:blogger.com,1999:blog-22960277615973052782024-03-14T18:57:12.780+01:00Various grumblingsUnknownnoreply@blogger.comBlogger21125tag:blogger.com,1999:blog-2296027761597305278.post-27689461625901405492018-07-11T20:56:00.000+02:002018-07-11T20:56:28.286+02:00etcpak 0.6A new version of etcpak has been released. There are a couple of small changes in 0.6, but the main one is newly added support for compressing ETC2 RGBA textures.<br />
<br />
Example compression result (only showing alpha channel):<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0yNUM8-SiegqdEXlC87NNRldtVAVie9dFU6cru_lRUWHtKMboLpXNU1XBSOqQX8VqR1yM8_-JqDMe8NR4K55nuy1wCtHkREEXrSzOaLLmC-79BhImXe6eDz1QTQWK8wBayx4fKtXoEaw/s1600/alpha.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="512" data-original-width="512" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0yNUM8-SiegqdEXlC87NNRldtVAVie9dFU6cru_lRUWHtKMboLpXNU1XBSOqQX8VqR1yM8_-JqDMe8NR4K55nuy1wCtHkREEXrSzOaLLmC-79BhImXe6eDz1QTQWK8wBayx4fKtXoEaw/s1600/alpha.png" /></a></div>
<br />
16K x 16K image benchmark:<br />
<div>
ETC1: 113 ms (only RGB part)</div>
<div>
ETC2 RGB: 213 ms (only RGB part)</div>
<div>
ETC2 RGBA: 404 ms</div>
<div>
<br /></div>
<div>
Download: <a href="https://bitbucket.org/wolfpld/etcpak/downloads">https://bitbucket.org/wolfpld/etcpak/downloads</a></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2296027761597305278.post-47709030372454794912017-01-29T15:55:00.004+01:002017-01-29T16:03:28.947+01:00Archiwum usenetu stało się jeszcze lepsze<h2>
Narzędzia</h2>
<h3>
</h3>
<h3>
Tekstowy czytnik</h3>
<h3>
</h3>
<div class="separator" style="clear: both; text-align: left;">
Od niedawna dostępny jest czytnik archiwum działający w trybie tekstowym. Użytkownicy slrn-a powinni poczuć się jak w domu.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjWpNqwJd0kRvi3wHKN9cgrNGOILfp7R1BnBG2Byvixq1FbjOnM1h_LxX5vmb7z3I6jTv7pGsu2qRGNX-f0zFyU3E_Gu2ZA5FX4UZg6OAE6f1wqt20_hmTxxog-2g1VqDKGsZl7Z5edPE/s1600/tbrowser1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjWpNqwJd0kRvi3wHKN9cgrNGOILfp7R1BnBG2Byvixq1FbjOnM1h_LxX5vmb7z3I6jTv7pGsu2qRGNX-f0zFyU3E_Gu2ZA5FX4UZg6OAE6f1wqt20_hmTxxog-2g1VqDKGsZl7Z5edPE/s200/tbrowser1.png" width="200" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLZyVVtgOYKfh4_ZAD81I3iOUYbaWMkKhj08TRUUmwBCF8e4ZYXMlaN3ZFP7kdNa4NR_CehXUko3T1JTfHcRpZBxoaZ2enLK7opLuyu09ErTUi9om1GOJ-klT9-Ylqeyo37bWOYzZG_dE/s1600/tbrowser2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLZyVVtgOYKfh4_ZAD81I3iOUYbaWMkKhj08TRUUmwBCF8e4ZYXMlaN3ZFP7kdNa4NR_CehXUko3T1JTfHcRpZBxoaZ2enLK7opLuyu09ErTUi9om1GOJ-klT9-Ylqeyo37bWOYzZG_dE/s200/tbrowser2.png" width="200" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: left;">
tbrowser posiada wszystkie możliwości starego czytnika graficznego, przy czym działa szybciej i potrzebuje mniej pamięci. Jest to teraz podstawowy program do przeglądania archiwum. Wersja oparta na Qt staje się przestarzałą i nie będzie dalej rozwijana.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Program do ściągnięcia z <a href="https://bitbucket.org/wolfpld/usenetarchive/downloads">https://bitbucket.org/wolfpld/usenetarchive/downloads</a>.</div>
<h3 class="separator" style="clear: both; text-align: left;">
</h3>
<h3 class="separator" style="clear: both; text-align: left;">
Galaktyka</h3>
<h3 class="separator" style="clear: both; text-align: left;">
</h3>
<div class="separator" style="clear: both; text-align: left;">
Do tej pory poszczególne grupy dyskusyjne były niezależnymi bytami. Nowo wprowadzony tryb "galaxy" umożliwia przełączanie się między grupami, przejście do wiadomości z innej grupy na podstawie Message-ID, a także pozwala na śledzenie followup-ów i crosspostów.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiG7U7MS_op_KCHNqLC7vxfYFCfS2CDueca5vW8doo1_TSia5yrL88Tlt-emuAwTapmbIJxmu7SGSwyKlnTdZYyZLExFTkvo8XmWKyoCycnHNv1EHTPqF08Eird0wVAN8GRNjYz1pFQTA/s1600/galaxy1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="148" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiG7U7MS_op_KCHNqLC7vxfYFCfS2CDueca5vW8doo1_TSia5yrL88Tlt-emuAwTapmbIJxmu7SGSwyKlnTdZYyZLExFTkvo8XmWKyoCycnHNv1EHTPqF08Eird0wVAN8GRNjYz1pFQTA/s200/galaxy1.png" width="200" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJsVxKI_rJ1d8a74NA-9JLycoDPUawIc94NHayyPMesS3MG-gS7vYbkXidTLQ4BHWGwkWGAEKH4yDuMJJ_QBDJC2bOH9_Ior6ZSzNLZUmXZymUkGiDgx1jhgMWffGO1MBxxeJoz_KVurk/s1600/galaxy2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="148" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJsVxKI_rJ1d8a74NA-9JLycoDPUawIc94NHayyPMesS3MG-gS7vYbkXidTLQ4BHWGwkWGAEKH4yDuMJJ_QBDJC2bOH9_Ior6ZSzNLZUmXZymUkGiDgx1jhgMWffGO1MBxxeJoz_KVurk/s200/galaxy2.png" width="200" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Aby skorzystać z przygotowanej bazy danych, należy pobrać plik galaxy.7z z archiwum i rozpakować do katalogu, w którym umieszczone są pliki grup dyskusyjnych. Następnie wystarczy podać ścieżkę do katalogu galaxy jako parametr programu tbrowser.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Tryb galaxy nie wymaga obecności wszystkich grup dyskusyjnych. Gdy któregoś archiwum będzie brakowało, zostanie ono wyświetlone, ale nie będzie można go otworzyć.</div>
<h3 class="separator" style="clear: both; text-align: left;">
</h3>
<h3 class="separator" style="clear: both; text-align: left;">
Wyszukiwanie</h3>
<h3 class="separator" style="clear: both; text-align: left;">
</h3>
<div class="separator" style="clear: both; text-align: left;">
Zmieniony został algorytm punktacji wyników wyszukiwania. Wyniki, w których wyszukiwane słowa znajdują się blisko siebie są dodatkowo premiowane. Ponadto, w wyszukiwaniu biorą udział słowa podobne do podanych w zapytaniu, co pozwala znaleźć również wiadomości z literówkami.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Wyszukiwarka pozostawia jeszcze sporo do życzenia, szczególnie jeżeli chodzi o kwestię prezentacji wyników. </div>
<h3 class="separator" style="clear: both; text-align: left;">
</h3>
<h3 class="separator" style="clear: both; text-align: left;">
Narzędzia i biblioteki</h3>
<h3 class="separator" style="clear: both; text-align: left;">
</h3>
<div class="separator" style="clear: both; text-align: left;">
Wspólna część kodu doczekała się wielu drobnych optymalizacji, dzięki czemu oba czytniki działają jeszcze szybciej. Podobne usprawnienia trafiły do narzędzi służących do tworzenia archiwum. Pojawiło się również kilka nowych programów przetwarzających dane. Więcej szczegółów jest dostępnych pod adresem <a href="https://bitbucket.org/wolfpld/usenetarchive">https://bitbucket.org/wolfpld/usenetarchive</a>.</div>
<h2 class="separator" style="clear: both; text-align: left;">
</h2>
<h2 class="separator" style="clear: both; text-align: left;">
Archiwum polskiego usenetu</h2>
<h2 class="separator" style="clear: both; text-align: left;">
</h2>
<div class="separator" style="clear: both; text-align: left;">
Archiwum dostępne pod adresem <a href="https://archive.org/details/usenet-uat-pl">https://archive.org/details/usenet-uat-pl</a> zawiera teraz grupy zarówno z hierarchii pl.*, jak i alt.pl.*. Poza tym znalazło się tam również kilka innych polskich grup dyskusyjnych.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Zawartość archiwum została zaktualizowana o <a href="https://bitbucket.org/wolfpld/usenetarchive/raw/a858212c7c9f74b198f45430087a7257bb61443d/doc/2016.08-to-2016.12.pdf">wiadomości wysłane do grudnia 2016 roku</a>. Niektóre grupy zyskały też dodatkowy rok archiwalnych wiadomości. Najstarsze wpisy sięgają teraz 1995 roku. Archiwum zawiera teraz ponad 56 milionów unikalnych wiadomości.</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<h3 class="separator" style="clear: both; text-align: left;">
</h3>
<h3 class="separator" style="clear: both; text-align: left;">
Kompatybilność</h3>
<h3 class="separator" style="clear: both; text-align: left;">
</h3>
<div class="separator" style="clear: both; text-align: left;">
Poprzednie wersje archiwum w dalszym ciągu można otworzyć graficzną przeglądarką, ale wersja tekstowa nie jest z nimi kompatybilna. Aktualna wersja nie będzie działać ze starszymi wersjami programów. Niemniej, z uwagi na liczne poprawki i uzupełnienia zawartości, najlepiej usunąć wcześniej pobrane archiwa i pobrać je na nowo.</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2296027761597305278.post-31443559226796960722016-01-27T19:22:00.000+01:002016-01-27T19:22:59.576+01:00etcpak 0.5etcpak strikes again, this time with version 0.5, which has the ability to calculate planar blocks from the <a href="http://www.jacobstrom.com/publications/StromPetterssonGH07.pdf">ETC2 standard</a>. Color gradients, which were a sore spot in the image quality previously, will now have a much smoother look. This new option is activated by passing -etc2 parameter and comes at a small time cost (152% of pure ETC1 mode, 77 ms vs 117 ms). Example compressed image:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/v7Dw2Yz.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://i.imgur.com/v7Dw2Yz.png" height="425" width="640" /></a></div>
<br />
Planar block count in this image is quite high, as can be seen on the following debug image, where blue color indicates planar mode:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/a8ZjpsE.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://i.imgur.com/a8ZjpsE.png" height="426" width="640" /></a></div>
<br />
It should be noted that AVX2 version of planar block compression <b>does not</b> produce the same results as scalar one. Keep that in mind on pre-Haswell machines.<br />
<br />
Download: <a href="https://bitbucket.org/wolfpld/etcpak/downloads">https://bitbucket.org/wolfpld/etcpak/downloads</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2296027761597305278.post-63761567572254495412016-01-02T18:31:00.000+01:002016-01-02T18:31:51.901+01:00etcpak 0.4New year, new etcpak. Previously etcpak was an order of magnitude faster than the competing ETC compressors. This new version is yet another order of magnitude faster.<br />
<br />
Time to compress 8K image:<br />
etcpak 0.3: 655 ms<br />
etcpak 0.4: 77 ms<br />
<br />
This is thanks to Daniel Jungmann, who submitted patches implementing SSE 4.1 and AVX2 instructions. SSE 4.1 is now default and required (supported by Core 2 and AMD Bulldozer CPUs) and AVX2 is detected at runtime (support added in Haswell CPUs).<br />
<br />
Other new features:<br />
<ul>
<li>ETC1 dissection mode, allowing in-depth inspection of compressed images.</li>
<li>Mip-maps will be calculated only if needed (doh!).</li>
<li>Alpha channel compression is now deterministic.</li>
<li>Minor changes in compression precision. This will change checksums of most compressed images, compared with previous versions.</li>
<li>Multithreaded job dispatch algorithm was improved.</li>
<li>zlib/PNG checksum validation was removed, resulting in 12% improvement in image load times.</li>
</ul>
Download: <a href="https://bitbucket.org/wolfpld/etcpak/downloads">https://bitbucket.org/wolfpld/etcpak/downloads</a> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2296027761597305278.post-28675003143513230162014-05-30T22:14:00.002+02:002014-05-30T22:14:52.096+02:00etcpak 0.3New major version, new features:<br />
<ul>
<li>Ability to create mipmaps (only POT, not in benchmark mode).</li>
<li>Optional dithering of input image.</li>
<li>Small quality improvements at basically no cost.</li>
</ul>
Image minification algorithm used for generating mipmaps is stupid simple, but it already beats the implementation in PVRTexTool:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUL71eBp4yrb-t9j6JkxnNRnqen70iKD1IAlgNjKxLaqONxp3y5_snslJjrGbcCaYKyhH5CvXLiyW3w8aptvjvzmDEevnTBsPCnM20vOVc3HLDbPN7FDen8Vg7Ti2Rf2i3aTTP18DRZtg/s1600/mipmap.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUL71eBp4yrb-t9j6JkxnNRnqen70iKD1IAlgNjKxLaqONxp3y5_snslJjrGbcCaYKyhH5CvXLiyW3w8aptvjvzmDEevnTBsPCnM20vOVc3HLDbPN7FDen8Vg7Ti2Rf2i3aTTP18DRZtg/s1600/mipmap.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Left: PVRTexTool, Right: etcpak</td></tr>
</tbody></table>
Notice the <a href="http://en.wikipedia.org/wiki/Moir%C3%A9_pattern">high frequency artifacts</a> present in the PVRTexTool image, particularly near the eyes of parrots. etcpak generates smoother and more natural look. Further refinements will be able to improve the image quality even more.<br />
<br />
Dithering basically improves the appearance of gradients or smooth areas in photos:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigemVFIqivX8x0b_uRA7JeduG-cfqRv5HP1-OUXcB2jUi052WG6fT4rRrDUCCB2L4dzv4U6TL2PuJwXOUdq7tY-aL7OixU1Sfbwgf8Vpog4yfBS7Ab-z2-_XNazC2AdAzV-aExbJaqXUo/s1600/dither.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigemVFIqivX8x0b_uRA7JeduG-cfqRv5HP1-OUXcB2jUi052WG6fT4rRrDUCCB2L4dzv4U6TL2PuJwXOUdq7tY-aL7OixU1Sfbwgf8Vpog4yfBS7Ab-z2-_XNazC2AdAzV-aExbJaqXUo/s1600/dither.png" height="215" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Left: no dithering, Right: dithering enabled</td></tr>
</tbody></table>
It comes at a small cost however. Here are the timings for normal compression:<br />
<blockquote class="tr_bq">
<span style="font-family: "Courier New",Courier,monospace;">$ x64/Release/etcpak.exe 8192.png -b<br />Image load time: 1352.646 ms<br />Mean compression time for 50 runs: 630.855 ms</span></blockquote>
And this is the run with dithering enabled:<br />
<br />
<blockquote class="tr_bq">
<span style="font-family: "Courier New",Courier,monospace;">$ x64/Release/etcpak.exe 8192.png -b -d<br />Image load time: 1312.084 ms<br />Mean compression time for 50 runs: 744.394 ms</span></blockquote>
Download: <a href="https://bitbucket.org/wolfpld/etcpak/downloads">https://bitbucket.org/wolfpld/etcpak/downloads</a>Unknownnoreply@blogger.com8tag:blogger.com,1999:blog-2296027761597305278.post-87992471146898552912014-03-13T19:53:00.000+01:002014-03-13T20:02:27.520+01:00etcpak 0.2.2This version contains some minor performance improvements and a benchmark mode, which can be activated using the -b parameter. It will perform 50 compression passes and print out the average time for one pass. It should provide better environment for measurements, as the PNG decode is the slowest component during normal operation.<br />
<br />
I've also made an example <a href="https://bitbucket.org/wolfpld/etcpak/downloads/8192.png">8192x8192 image</a> available for test purposes. It is based on the <a href="http://hubblesite.org/gallery/album/entire/pr2007016a/">Carina Nebula</a> shot from Hubble.<br />
<br />
For comparison, here's the previous method of speed measurement, heavily influenced by the PNG decoder:<br />
<blockquote class="tr_bq">
<span style="font-family: "Courier New",Courier,monospace;">$ time etcpak.exe 8192.png<br /><br />real 0m1.471s<br />user 0m0.000s<br />sys 0m0.030s</span></blockquote>
And here's the new benchmark mode:<br />
<blockquote class="tr_bq">
<span style="font-family: "Courier New",Courier,monospace;">$ etcpak.exe 8192.png -b<br />Image load time: 1330.949 ms<br />Mean compression time for 50 runs: 631.308 ms</span></blockquote>
<br />
Download: <a href="https://bitbucket.org/wolfpld/etcpak/downloads">https://bitbucket.org/wolfpld/etcpak/downloads</a>Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-2296027761597305278.post-27920164331421843152013-08-10T20:38:00.000+02:002014-03-13T19:43:28.215+01:00etcpak 0.2.1A new version of <a href="http://zgredowo.blogspot.com/2013/06/fastest-etc-compressor-on-planet.html">etcpak</a> has been published today. What's new:<br />
<ul>
<li>Reduced number of spawned threads and context switches.</li>
<li>Memory mapped files are used for output. This allows writing compressed data to disk during compression. The downside is that writing PVR output files no longer can be disabled.</li>
<li>32 bit version has been discontinued. From now on only 64 bit version will be provided. It was always the recommended one to use, anyways, as it performed much better than the 32 bit one.</li>
<li>Various optimizations.</li>
</ul>
etcpak 0.2.1 is 10% faster than etcpak 0.2, with the compression time measured at 0.08 s (after deducting PNG load time).<br />
<br />
Download: <a href="https://bitbucket.org/wolfpld/etcpak/downloads">https://bitbucket.org/wolfpld/etcpak/downloads</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2296027761597305278.post-70848827479719508502013-07-07T18:34:00.000+02:002013-08-10T20:42:53.022+02:00etcpak 0.2It would appear that <a href="http://zgredowo.blogspot.com/2013/06/fastest-etc-compressor-on-planet.html">etcpak</a> was programmed in quite inefficient way up until now. That's a funny way to talk about a program which was an order of magnitude faster than competing ones. And it's one of these obvious things which you wonder about afterwards, how wouldn't you think about it in the first place.<br />
<br />
etcpak will no longer wait for compression to start until all image data is available. Data processing will now be performed simultaneously with PNG image decode process, which basically means that by the time the source image is fully loaded, we're almost done with the compression.<br />
<br />
Some numbers.<br />
<br />
<table>
<tbody>
<tr><th>Test</th><th>Time (full)</th><th>Time (minus PNG load)</th></tr>
<tr><td>etcpak 0.1 RGB</td><td>1.12 s</td><td>0.45 s</td></tr>
<tr><td>etcpak 0.1 RGB + alpha</td><td>1.36 s</td><td>0.69 s</td></tr>
<tr><td>etcpak 0.2 RGB</td><td>0.83 s</td><td>0.16 s</td></tr>
<tr><td>etcpak 0.2 RGB + alpha</td><td>1.00 s</td><td>0.33 s</td></tr>
</tbody>
</table>
<br />
This new version can be downloaded from <a href="https://bitbucket.org/wolfpld/etcpak/downloads">https://bitbucket.org/wolfpld/etcpak/downloads</a>.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2296027761597305278.post-50353119276013389792013-06-09T17:25:00.000+02:002018-07-11T20:57:32.490+02:00Fastest ETC compressor on the planet: etcpak<b>[edit: <a href="http://zgredowo.blogspot.com/2018/07/etcpak-06.html">new version</a> is available]</b> <br />
<br />
My new (mobile) game has quite a lot of assets. Four different resolution sets, more than 23000 source images in each of them. After packing everything into <a href="http://en.wikipedia.org/wiki/Texture_atlas">atlases</a>, the resulting data set is about 1106 Mpixels big. Since each pixel occupies 4 bytes (RGB + alpha channel), the raw data would roughly fit on a DVD disc.<br />
<br />
Of course, 3D hardware supports <a href="http://en.wikipedia.org/wiki/Texture_compression">texture compression</a> basically since the <a href="http://en.wikipedia.org/wiki/S3_Savage">beginning</a> of 3D revolution, which is <a href="http://www.wolframalpha.com/input/?i=time+since+1998">quite some time</a>. In the mobile space there are two major texture compression formats. The first one (and the only one supported on iOS) is <a href="http://en.wikipedia.org/wiki/PVRTC">PVRTC</a>. The second one is <a href="http://en.wikipedia.org/wiki/Ericsson_Texture_Compression">ETC</a> (Ericsson Texture Compression) and it's supported by virtually all OpenGL ES devices. It's also here to stay, as ETC compression <a href="https://www.khronos.org/assets/uploads/developers/library/2012-siggraph-opengl-es-bof/Ericsson-ETC2-SIGGRAPH_Aug12.pdf">support is mandatory</a> in OpenGL ES 3.0 and OpenGL 4.3.<br />
<br />
Now, the problem is that compression takes time. A looong time. On a dedicated i7 CPU it takes about 3 hours to compress all my atlases to PVRTC format, using <a href="http://www.imgtec.com/">ImgTec's</a> <a href="http://www.imgtec.com/powervr/insider/powervr-pvrtextool.asp">PVRTexTool</a> utility. ETC is better with about half an hour, but that's still unacceptable for a quick, iterative development. There are various quality settings, you can choose between perceptual and non-perceptual processing, but even in the fastest mode the compression is still unbearably slow.<br />
<br />
There are other compression utilities available, but they fare no better. I am aware of the following ones:<br />
<ul>
<li><a href="http://malideveloper.arm.com/develop-for-mali/mali-gpu-texture-compression-tool/">Mali Texture Compression Tool</a> (4.1.0, etcpack.exe version 4.0.1)</li>
<li><a href="http://devtools.ericsson.com/etc">Ericsson's etcpack</a> (1.06, 2.72 is behind registration wall)</li>
<li><a href="http://code.google.com/p/rg-etc1/">rg-etc1</a> (<a href="http://code.google.com/p/crunch/">crunch</a> <a href="http://richg42.blogspot.com/2012/11/released-crunch-v104.html">1.04</a>)</li>
</ul>
I have a test image, which is a real-life data 4096x4096 RGBA texture atlas filled up to about 87%. Since some tools load PNG files and other require PPM input, which is basically streaming raw image data from the disk, I have measured the load time of the PNG test image on my i3 540 to be 0.67 second. Every utility loading PNG image will have that time deducted from total time, even if the program reports it took longer (for example, crunch says it loads the texture in 1.029s).<br />
<br />
<table>
<tbody>
<tr><th>Tool</th><th>Command line</th><th>Time</th>
</tr>
<tr><td>PVRTexToolCL 3.40</td><td>PVRTexTool.exe -i atlas-base1.png -o pvr.pvr -f ETC1 -q etcfast</td><td>24.71 s</td></tr>
<tr><td>ericsson ETCPACK 1.06</td><td>etcpack.exe -s fast -e nonperceptual atlas-base1.ppm etc.ktx</td><td>23.86 s</td></tr>
<tr><td>mali etcpack 4.0.1</td><td>etcpack.exe atlas-base1.ppm . -s fast -e nonperceptual -c etc1</td><td>19.20 s</td></tr>
<tr><td>crunch (rg-etc1) 1.04</td><td>crunch_x64 -ETC1 -fileformat KTX -mipMode none -uniformMetrics -dxtQuality superfast -file atlas-base1.png</td><td>4.41 s</td></tr>
</tbody></table>
<br />
So, crunch is really fast, isn't it? Well, I didn't know that before I set out to write my own compression utility. And it runs circles around crunch. The compression time is <b>0.45 s</b>. That's not a typo, it's 10x as fast as the fastest utility previously available. It's 50x as fast as PVRTexTool. And it has a special mode for processing <a href="http://malideveloper.arm.com/develop-for-mali/sample-code/etcv1-texture-compression-and-alpha-channels/">alpha channel textures</a>. Creating <i>two</i> ETC textures, one with RGB data and a second one with alpha channel takes <b>0.69 s</b>. That's the time it takes to decompress the PNG image. And it's so fast you will be limited by HDD I/O wait.<br />
<br />
As for the resulting image quality, my tool was never intended for production usage. And for testing during development it doesn't look that bad. Take a look.<br />
<br />
<div align="center">
<table>
<tbody>
<tr><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM3CWUG38L1UNavQ84Ko1abmim1LFpNJRJ_zfCBRCrviAsIbT2CFrnLZ8A_ZbUbgSe3We7xynN-jb1LpgRSbQ-npfyuoZJHh5APoi1MgRInvdL-2f_ed-YsELVa0NFJvTDqtnUdCyCjyw/s1600/kodim23.png" imageanchor="1"><img border="0" height="133" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM3CWUG38L1UNavQ84Ko1abmim1LFpNJRJ_zfCBRCrviAsIbT2CFrnLZ8A_ZbUbgSe3We7xynN-jb1LpgRSbQ-npfyuoZJHh5APoi1MgRInvdL-2f_ed-YsELVa0NFJvTDqtnUdCyCjyw/s200/kodim23.png" width="200" /></a></td><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnT1x72PuVWlqyw6bnLOCOGDOUj2nqmWslG2dT7oKefttztO5srtSvtsORblW3Sbp0o1tjKckuqZQQYXpPMscWCnCAIDecVnIJrKh9hpNG_7mYMWYlf89kUgNvo_L2cQHyigdxZhVIJPM/s1600/out0.png" imageanchor="1"><img border="0" height="133" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnT1x72PuVWlqyw6bnLOCOGDOUj2nqmWslG2dT7oKefttztO5srtSvtsORblW3Sbp0o1tjKckuqZQQYXpPMscWCnCAIDecVnIJrKh9hpNG_7mYMWYlf89kUgNvo_L2cQHyigdxZhVIJPM/s200/out0.png" width="200" /></a></td></tr>
<tr><td align="center">Original</td><td align="center">Compressed</td></tr>
</tbody></table>
</div>
<br />
You can download the Windows executables (both 32 and 64 bit, but use 64 one, as it's a lot faster) from <a href="https://bitbucket.org/wolfpld/etcpak/downloads">https://bitbucket.org/wolfpld/etcpak/downloads</a>. As usual, <a href="http://www.microsoft.com/en-us/download/details.aspx?id=30679">MSVC redist</a> is required.<br />
<br />
Source code can be found at <a href="https://bitbucket.org/wolfpld/etcpak">bitbucket</a>.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-2296027761597305278.post-55091303051485705722012-10-24T23:10:00.001+02:002012-10-24T23:10:58.943+02:00N900 software renderingSome time ago I wrote a software renderer and presented the video on N73 running it. Then I ported it to N900, updated the model and lighting, but never actually published the video of it in action. Well, here it is:<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/mei-GO8jVlA?feature=player_embedded' frameborder='0'></iframe></div>
I think the low FPS values (around 12) were the reason it was not published. It is due to the amount of triangles the new model consists of. The old Caesar's one was much simpler and thus rendered faster. With proper low-poly model the above animation would run with at least 30 FPS without any problems.<br />
<br />
Fun side note. The software renderer on N900 was actually faster than running the hardware accelerated version. Well, hardware and/or drivers sucked greatly on that phone.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2296027761597305278.post-64425076501874087582012-10-02T22:10:00.000+02:002012-10-02T22:10:12.310+02:00CRT-like rendering on LCD monitors followupApparently some folks on some strange forum-like site have been wondering how the CRT effect works. Next time you should write a comment to the entry instead of relying on me watching site traffic analysis.<br />
<br />
Anyway. I have prepared a stripped down version of the code and it should be simple enough for anybody competent to replicate the effect in his own code. As the ReadMe file says, the shaders are not optimized in any way whatsoever. Some of them are written in a blatantly bad way. But it's a good starting point for anyone interested.<br />
<br />
Windows binary: <a href="http://team.pld-linux.org/~wolf/CRT%20demo.7z">http://team.pld-linux.org/~wolf/CRT%20demo.7z</a>. You will probably need <a href="http://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/vcredist_x86.exe">MSVC 2012 redistributable package</a>.<br />
Source code: <a href="http://team.pld-linux.org/~wolf/CRT%20demo%20src.7z">http://team.pld-linux.org/~wolf/CRT%20demo%20src.7z</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2296027761597305278.post-25350683703498512422012-05-06T01:02:00.000+02:002012-05-06T01:02:47.386+02:00CRT-like rendering on LCD monitorsThe advances of technologly in the past few years have given us quite a nice improvement in the quality of images displayed by our monitors. Thanks to RAMDACs that don't suck, LCD monitors, digital video interfaces, then LCD monitors that don't suck we're now able to display sharp visuals of unprecedented quality, at rather big resolutions too.<br />
<br />
But there is a problem. Some types of content looked great in the past, but there is something missing when it's viewed nowadays. There are people who may not even know how it's supposed to be, due to the old technology becoming obsolete. Text mode looks different. When you want to use 8x8 font it ends up looking either blurred or super blocky. Use modern TTF fonts and you get nice curved shapes, antialiasing, etc., but it looks just wrong. It's not how it should be anymore. Another good example are 8-bit emulators. What has happened? These games used to look good, but now they are ugly in their perfectness!<br />
<br />
Well, some things <b>need </b>to look bad to look good. Thanks to programmable GPUs we can now re-introduce all these bad things that were plaguing us in the CRT days, so that we can be happy once more. Let me show some pictures, each split in half. The left side is post-processed and the right side is the original content.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg21d7EzWbQyxu234MJBmfe5XjQ5woh31GFZtwHgDBVJ7KNgRCHVz94iGl4fczo90lQMXbx2grPoFNRI6YvzX0kbN9QQuUNz1gc5BENTx-vRV5_zVmNdCQoMXB-H-QlhFEllzREKljK_hU/s1600/img1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="112" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg21d7EzWbQyxu234MJBmfe5XjQ5woh31GFZtwHgDBVJ7KNgRCHVz94iGl4fczo90lQMXbx2grPoFNRI6YvzX0kbN9QQuUNz1gc5BENTx-vRV5_zVmNdCQoMXB-H-QlhFEllzREKljK_hU/s200/img1.png" width="200" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUnsyOlrpUSjPQZXs-W7cDgUPgEUgHsCCp4pGnQ6W5gfTujn3wXG9YIndz-9gToT6qPZ89JgPD1LYa_KhNMDwEF-VghEZcqFaBOPwT5vLBmmlzt5FhXvkepHF-MRUlm49qJZpHprElldY/s1600/img2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="112" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUnsyOlrpUSjPQZXs-W7cDgUPgEUgHsCCp4pGnQ6W5gfTujn3wXG9YIndz-9gToT6qPZ89JgPD1LYa_KhNMDwEF-VghEZcqFaBOPwT5vLBmmlzt5FhXvkepHF-MRUlm49qJZpHprElldY/s200/img2.png" width="200" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOBA4x7ySJVC-nQtGbgU2NDv984w1OpdP2xaBI74Ub9LR6JLhnEJiYKecb0htzNipvXLMiNaH9VDwLz6Uw-1xNo7gft1bA5jxsHkL05UItr5ISNhYTI67SdRtWIRhCzkzhCEWlz_lul8Q/s1600/img3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="112" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOBA4x7ySJVC-nQtGbgU2NDv984w1OpdP2xaBI74Ub9LR6JLhnEJiYKecb0htzNipvXLMiNaH9VDwLz6Uw-1xNo7gft1bA5jxsHkL05UItr5ISNhYTI67SdRtWIRhCzkzhCEWlz_lul8Q/s200/img3.png" width="200" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimNXL_DoEqDlD_c2DMMvEQNIhglQBNqO5D_iy2Xs6p71p_YWIoDNVknTI73xlJLClqpcusVvMDwhmudWrS-WJApM8jZbobVPMajl09vLB-EI9398zbNZaHGQYkEQS4EjGXarDERY3tlTY/s1600/img4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="112" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimNXL_DoEqDlD_c2DMMvEQNIhglQBNqO5D_iy2Xs6p71p_YWIoDNVknTI73xlJLClqpcusVvMDwhmudWrS-WJApM8jZbobVPMajl09vLB-EI9398zbNZaHGQYkEQS4EjGXarDERY3tlTY/s200/img4.png" width="200" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9Q29lYdAWxHgNxC_t2UwX0mXP87l7bqETFlnkrLgIV8QW2CpK6NE3y1eblF6pzJxcjKbbB_gS_EFRZescomksO2joKfdO8vmKzszeI1j_dGwBlMElBpG4lSdiTrBNMUKdj2mmwlummis/s1600/img5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="112" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9Q29lYdAWxHgNxC_t2UwX0mXP87l7bqETFlnkrLgIV8QW2CpK6NE3y1eblF6pzJxcjKbbB_gS_EFRZescomksO2joKfdO8vmKzszeI1j_dGwBlMElBpG4lSdiTrBNMUKdj2mmwlummis/s200/img5.png" width="200" /></a></div>
Some notes:<br />
<ol>
<li>The effect is dynamic and looks better when it's watched live.</li>
<li>This is not an emulator, these are just screenshots of 8-bit games. I am using the post-processing for other purposes.</li>
<li>This is based on what I thought would look good, not on any comparison to a real CRT, or analysis of errors happening in the VRAM -> analog -> CRT path.</li>
</ol>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2296027761597305278.post-67240314544619017042011-11-14T19:05:00.002+01:002011-11-14T19:10:26.291+01:00UTF-8 support added to dftpd<span class="gD">Thomas </span><span class="gD">Brushington has send me patches adding UTF-8 support to Symbian builds of dftpd. In case someone might want to use such functionality, he also provided a new build.<br /><br /><a href="http://team.pld-linux.org/%7Ewolf/dftpd-utf8.SIS">http://team.pld-linux.org/~wolf/dftpd-utf8.SIS</a><br /><br />(note that I have not checked if it actually works).<br /></span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2296027761597305278.post-46115489482677998062009-12-20T22:04:00.005+01:002009-12-26T18:25:31.308+01:00Dumb FTP Server now on N900<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7I8uPhlTXthXnQt7SAAzD8_9FaX2weZi6V5wR6mg0NFgs1GJXduuIxGbByFBKBejOOS-iRbjZQ0Gxa4Moexploq1WpiLfA0i-rwEPZio2EdNCiAwXH3CuYb5JswaEYg8JQ40yD8aMcMs/s1600-h/Screenshot-20091220-220841.png"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 220px; height: 132px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7I8uPhlTXthXnQt7SAAzD8_9FaX2weZi6V5wR6mg0NFgs1GJXduuIxGbByFBKBejOOS-iRbjZQ0Gxa4Moexploq1WpiLfA0i-rwEPZio2EdNCiAwXH3CuYb5JswaEYg8JQ40yD8aMcMs/s320/Screenshot-20091220-220841.png" alt="" id="BLOGGER_PHOTO_ID_5417429367489050514" border="0" /></a><a href="http://zgredowo.blogspot.com/2008/08/symbian-ftp-server.html">Dump FTP Server</a> is now available on the N900. It uses QT 4.6, which currently is only available in extras-devel, so beware.<br /><br />Download location: <a href="http://team.pld-linux.org/%7Ewolf/dftpd_0.1.3_armel.deb">http://team.pld-linux.org/~wolf/dftpd_0.1.3_armel.deb</a>. Hopefully will be in extras soon.<br />Source repository: <a href="http://gitorious.org/dftpd">http://gitorious.org/dftpd</a><br /><br />Changelog (0.1.2):<br />- Workaround for Firefox handling of PASV command.<br />- Maemo port.<br />- If binding to port 21 fails (for example as a result of lack of root priviliges), the server will try to listen on port 2121.<br /><br />Changelog (0.1.3):<br />- Passive mode should now be working. Because of the used workaround only WIFI connections are supported.<br />- Bigger icon in application manager.<br />- Upload speed should now be at par with download speed.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2296027761597305278.post-72544183306606623252009-11-10T00:16:00.003+01:002009-11-10T00:17:56.262+01:00Impossible?<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQgUm3tQGaTbF9J0QNdzU3q0sAow_ArUco2pQ022GTymiK12q6y4dFNIV4BW16mqMFCGc9adwcPa4ss65Oge5f4mLGCsjUXkGwwGM65nabFG8OAoc825d-G38Yqm1uUqfsAO00Cc73rJw/s1600-h/bunny.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 300px; height: 374px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQgUm3tQGaTbF9J0QNdzU3q0sAow_ArUco2pQ022GTymiK12q6y4dFNIV4BW16mqMFCGc9adwcPa4ss65Oge5f4mLGCsjUXkGwwGM65nabFG8OAoc825d-G38Yqm1uUqfsAO00Cc73rJw/s400/bunny.jpg" alt="" id="BLOGGER_PHOTO_ID_5402246989987471218" border="0" /></a>Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-2296027761597305278.post-56489112136526874362009-06-12T13:32:00.006+02:002009-06-12T13:52:49.225+02:00UAC considered harmfulI have switched from XP to Windows 7 on my work machine recently. Everything was working fine until this has happened:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT46wseoU4c2qwThSKLf8oCrHSzHqNqpgekVZ1F8PRFALXC8raqCKkNZyM4kml8Yi6BHZ0cHcASeQtgyZF65Fte-QNfx0X8rqGB9qWTc3fojaE14TJEw5diyXcPSFTXvQN-PHYFUEya-0/s1600-h/make.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 12px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT46wseoU4c2qwThSKLf8oCrHSzHqNqpgekVZ1F8PRFALXC8raqCKkNZyM4kml8Yi6BHZ0cHcASeQtgyZF65Fte-QNfx0X8rqGB9qWTc3fojaE14TJEw5diyXcPSFTXvQN-PHYFUEya-0/s400/make.png" alt="" id="BLOGGER_PHOTO_ID_5346404119035317186" border="0" /></a>A quick research revealed the following (<a href="http://technet.microsoft.com/en-us/library/dd835540%28WS.10%29.aspx">source</a>):<br /><p style="font-style: italic;">Before a 32-bit process is created, the following attributes are checked to determine whether it is an installer:</p> <ul style="font-style: italic;"><li>The file name includes keywords such as "install," "setup," or "update."</li></ul>This is confirmed by changing the file name of the offending exe:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfBNLI4E43SsXb5XQf6p61DJHA3UW__3AgGAMUgwUkhSh2HKuf1DX2HbJg-X0ur5RsSIn_8E63_cOkNmwTigLsmYv_AhmtbgfHtyfa2t7JGGZMY7ZtuQi-Mli-Srmsn9QTCrV6yAQUeJg/s1600-h/install.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 120px; height: 40px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfBNLI4E43SsXb5XQf6p61DJHA3UW__3AgGAMUgwUkhSh2HKuf1DX2HbJg-X0ur5RsSIn_8E63_cOkNmwTigLsmYv_AhmtbgfHtyfa2t7JGGZMY7ZtuQi-Mli-Srmsn9QTCrV6yAQUeJg/s400/install.png" alt="" id="BLOGGER_PHOTO_ID_5346405426668286754" border="0" /></a>The executable of course is not an installer of any kind and does not require any extra privileges. It just reads two files and creates a third one. Furthermore, it's a third-party application and I can't just change its file name without breaking things for everyone else. There seems to be some kind of white list of trusted applications, but nobody other than Microsoft can modify it.<br /><br />Without the ability to take that application out of UAC "protection" the only viable thing to do is to turn the UAC off. Great work! I feel more secure already.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-2296027761597305278.post-91802651805740288322009-01-22T18:52:00.003+01:002009-01-22T18:55:24.736+01:00dftpd 0.1.1 availableNew version of symbian FTP server has been published.<br /><br />Changes:<br />- Empty directories are now listed correctly.<br />- Directory creation and removal is now implemented.<br /><br /><a href="http://team.pld-linux.org/%7Ewolf/symbian/dftpd.sisx">Download</a>.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-2296027761597305278.post-39538500104373601612008-11-22T21:57:00.003+01:002008-11-22T23:05:10.727+01:00Major sound handling improvements in S60 SDLAudio handling in <a href="http://repo.or.cz/w/SDL.s60v3.git">S60v3 SDL port</a> was thoroughly broken. Well, it managed to play something, but the way it did that was just horrid.<br /><br />In case of <a href="http://www.tt-forums.net/viewtopic.php?t=35942">OpenTTD</a>, the difference between the 'sdl' and 'null' audio drivers was very much visible. The game had that smooth feeling to it when no audio was playing, but was jerky with the sounds enabled. To make things worse there were cracks and pops just about all the time, which added more of that unpleasant "the phone can't handle it" feeling. Fortunately, these problems are now a thing of the past.<br /><br />The taxation problem was fixed by <a href="http://repo.or.cz/w/SDL.s60v3.git?a=commit;h=53bd671ba3731123757af5c6e1bda75e86a06036">these</a> <a href="http://repo.or.cz/w/SDL.s60v3.git?a=commit;h=6b444968f6f3b53a86538f8df58983990072ca72">commits</a>. The <a href="http://koti.mbnet.fi/mertama/sdl.html">original author</a> has some really weird ideas there. Introduction of multiple audio buffers increases the audio lag without any benefits. And the handling of audio buffer is just crazy. I will quote the commit message here:<blockquote style="font-style: italic;">Audio buffer size is there to allow a balancing act between smooth sound playback (ie. big buffer) and low latency times (ie. small buffer). The original author clearly didn't understood this concept, as the buffer size here always was 256 bytes, which resulted in playback system that had all the minuses of the two approaches but no pluses.</blockquote>With one problem handled, the next one was just around the corner. The <a href="http://team.pld-linux.org/%7Ewolf/symbian/audio/old.ogg">cracks and pops</a> may not be easy to hear, but you'll for sure get a feeling that something's wrong. I even have a waveform plot with the gaps in audio data shown: <a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEios5N10qB0dEw_ssXx-Xf2rCha4MyQ5lr-88gA8wV_cpC_JUGHQUWj8Rp_Ah_DfpgtbKuGFr8cnFJf3YTpnbF-EHvEe9P75DLUFqPSEps9j_9vnU9vs69BWa5fSLrYsOmm6ydp0GMZ0L4/s1600-h/gaps.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 317px; height: 69px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEios5N10qB0dEw_ssXx-Xf2rCha4MyQ5lr-88gA8wV_cpC_JUGHQUWj8Rp_Ah_DfpgtbKuGFr8cnFJf3YTpnbF-EHvEe9P75DLUFqPSEps9j_9vnU9vs69BWa5fSLrYsOmm6ydp0GMZ0L4/s400/gaps.png" alt="" id="BLOGGER_PHOTO_ID_5271598611857868690" border="0" /></a>The <a href="http://repo.or.cz/w/SDL.s60v3.git?a=commit;h=554c60ea89a9e27438b81212b649327773a89fa8">solution</a> of that problem was to remove some never-correct delay time calculations and use a mutex-like mechanism to handle internal SDL audio wait. With that done the sound is now <a href="http://team.pld-linux.org/%7Ewolf/symbian/audio/new.ogg">flawless</a>.<br /><br />There's also some new functionality added:<br /><ul><li>With <a href="http://repo.or.cz/w/SDL.s60v3.git?a=commit;h=c38ee9e1b7c3fc32a4639a2ccb4fca2adb7813d3">silent</a> <a href="http://repo.or.cz/w/SDL.s60v3.git?a=commit;h=f3793bc31c227b0747ef2ab7861e4054877a6eec">profile</a> enabled SDL will mute the audio. Mixing will still be done, for the need of games expecting audio-timer synchronization.</li><li>When the game is out of focus the audio will be <a href="http://repo.or.cz/w/SDL.s60v3.git?a=commit;h=34896629391ecc6dfda91baf55d5a846a0754c71">disabled</a> as well as mixing, to reduce energy usage.</li><li>In out of focus situations the video blit incurs a <a href="http://repo.or.cz/w/SDL.s60v3.git?a=commit;h=7346f13c6ad2518e14b51cf4a09e11f78be05ff4">0.1s delay</a> to reduce power usage. The wait time is rather short for better responsivity when focus is regained and for some rare situations when the screen needs to be redrawn.</li></ul>Thanks to the above changes the phone with OpenTTD in background now consumes just 0.13W of energy. Comparing it to total idle consumption of 0.11W and previous OpenTTD consumption of 0.5W it's a substantial improvement.<br /><blockquote></blockquote><span style="display: block;" id="formatbar_Buttons"><span class="on down" style="display: block;" id="formatbar_CreateLink" title="Link" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);FormatbarButton('richeditorframe', this, 8);ButtonMouseDown(this);"></span></span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2296027761597305278.post-37054167602349768782008-10-18T17:04:00.004+02:002008-11-22T23:08:07.052+01:00OpenTTD battery usage<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaJBF9ir5Q2TsUS1YHFO3AHnuAovd2CXy8sx-7QZSCtPMG9YwtnTNfH3_fIn30T-SizvVYTzuFFt0mcJxq_FYE-CqTHvNcMjhL7fdENkB0vF1KmEDewp19cbrO_EkkBtW6PuWCG6TryvA/s1600-h/EnergyUsage.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaJBF9ir5Q2TsUS1YHFO3AHnuAovd2CXy8sx-7QZSCtPMG9YwtnTNfH3_fIn30T-SizvVYTzuFFt0mcJxq_FYE-CqTHvNcMjhL7fdENkB0vF1KmEDewp19cbrO_EkkBtW6PuWCG6TryvA/s400/EnergyUsage.png" alt="" id="BLOGGER_PHOTO_ID_5258510136823045202" border="0" /></a><br />Energy usage (ie. battery life) has been brought to my attention recently. As can be seen above, OpenTTD running in background doesn't handle things nice and battery drain is much greater than it should be.<br /><br />The average value for "OpenTTD running" is 1,07W, for "OpenTTD in background" it's 0,51W and for "Idle" it's 0,11W.<br /><br />Other Symbian SDL ports also will have this problem. So, quick advice: don't leave OpenTTD, C2Doom, ScummVM running on the phone in background, your battery will die very quickly if you do so.<br /><br /><span style="font-style: italic;">Edit: The background energy usage of my SDL's port has been reduced to 0,13W</span>.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-2296027761597305278.post-37989897924392161032008-10-09T21:08:00.012+02:002008-10-09T23:48:43.272+02:00The sorry state of symbian SDLProbably noone of you care about the fact that there are four different versions of the <a href="http://libsdl.org/">SDL library</a> for symbian based devices. When I was starting my <a href="http://www.tt-forums.net/viewtopic.php?t=35942">S60 OpenTTD port</a> there were only three. What has happened in between?<br /><br />The <a href="http://koti.mbnet.fi/%7Ehaviital/">first one</a> was created by Hannu Viitala and was targetted at antique devices, had no sound support, etc... we're not that much interested in it.<br /><br />The <a href="http://koti.mbnet.fi/mertama/sdl.html">second one</a>, maintained by Marcus Mertama, is an evolution of the previous, with support for S60 3rd edition devices (basically anything worth considering for purchase right now), sound and a lot of problems. More on that later.<br /><br />The <a href="http://anotherguest.k0.se/">third one</a> is, again, based on the previous one. It's used by anotherguest in his ScummVM port and focuses on wide device range support (including UIQ, touch screen, etc). Since it had the same problems as the second version, I didn't looked too deeply into it.<br /><br />The <a href="http://repo.or.cz/w/SDL.s60v3.git">fourth option</a> is constantly fixed (or rather stripped down from features) by yours truly. There were several issues in Markus' version which really bothered me.<br /><br />The first was support for S60v1 and S60v2.<br /><ul><li>If I'm going to modify the code, I have no way to test if the code works.</li><li>The platform is severely limited by screen resolution, processor speed, available RAM, lack of Open C and Open C++ or even by inability to use static variables.</li><li>The platform is dead.</li></ul>So, drop it. Leave only S60v3.<br /><br />The next big issue was resolution support. Or rather lack of it. The game resolution was always stretched to the phone's display resolution, which resulted in something that can be seen on the images below. The left one is original, the right one is scaled one. Horrible. And barely playable, thanks to ultra slow symbian blitting procedures.<br /><table><br /><tbody><tr><br /><td><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqdulmYnTNjjHgj4Jf_PXz4QcSPmhyphenhypheniDdctwLM8El1CKhHv7RgxZvf6RlztdJ87CWn_PlEHwQjaflnOyoyPMuVH_ZL-tAM0LfhlKWUYMihbiuTvRMWSP4Rrgl6q1LLOrKzkjUX4JQPt80/s1600-h/shot02.gif"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqdulmYnTNjjHgj4Jf_PXz4QcSPmhyphenhypheniDdctwLM8El1CKhHv7RgxZvf6RlztdJ87CWn_PlEHwQjaflnOyoyPMuVH_ZL-tAM0LfhlKWUYMihbiuTvRMWSP4Rrgl6q1LLOrKzkjUX4JQPt80/s320/shot02.gif" alt="" id="BLOGGER_PHOTO_ID_5255249301557398322" border="0" /></a></td><br /><td><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdKTLa8JPSMdgSc4nx5zLYQVawozaLMzkIJcRCxNan50NAt0BUHFUx3H_n89XKlQqiyrkGPTyuQlOquUtni_wnI7Y2Mb7DTD_nB476qpIueUxrloLjp40rh2qBrrAPukQ312arufQOQoo/s1600-h/shot01.gif"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdKTLa8JPSMdgSc4nx5zLYQVawozaLMzkIJcRCxNan50NAt0BUHFUx3H_n89XKlQqiyrkGPTyuQlOquUtni_wnI7Y2Mb7DTD_nB476qpIueUxrloLjp40rh2qBrrAPukQ312arufQOQoo/s320/shot01.gif" alt="" id="BLOGGER_PHOTO_ID_5255249425885790994" border="0" /></a></td><br /></tr><br /></tbody></table>My version does it right (or rather should be doing, I didn't actually checked it) by setting the right display orientation and by not stretching the display. This is one of things where my and other authors views differ. I don't accept the scaling, Marcus and anotherguest say that users prefer when game is displayed on full screen, without borders.<br /><br />Another big issue, display orientation support. All S60v3 devices can either be in portrait (normal use) or landscape (think "camera") mode. On most devices the landscape mode is hidden from user during normal usage, but there are devices, like N95 or N82, which rotate the display when user physically rotates the phone. On phones that lack this feature, orientation support can be faked in software by using small drawing hacks. So consider this: phone is in portrait orientation, user runs application and sees something like that:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9QeCqPJP06JNYSoJeeaFgOJx9m0HBCzZIIWWSzhABvcJn6pWzmlVdTDj6I9xFj9DQ56851Sf6G-y9ECuToAtNBQKHQ4JV7KPCA_Qz2DGSpxJT7CkyuiHSdS1XbQqSo2a9R0EBesL-HR8/s1600-h/or1.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9QeCqPJP06JNYSoJeeaFgOJx9m0HBCzZIIWWSzhABvcJn6pWzmlVdTDj6I9xFj9DQ56851Sf6G-y9ECuToAtNBQKHQ4JV7KPCA_Qz2DGSpxJT7CkyuiHSdS1XbQqSo2a9R0EBesL-HR8/s200/or1.jpg" alt="" id="BLOGGER_PHOTO_ID_5255254269770347938" border="0" /></a>"Oh, display is not distorted, I can rotate the phone and play, how nice" he thinks. And most of the time he's correct. But when he has that new and shiny N95 this happens:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBscx-ucT4wPDKQQK4r-coRZYeBx6PoxT9ISmpJ_t5FbKwe_HIiVxF5TDepm3wh4TAH94WtepX88OVhZau91qPIK03iCx3WRzviKAMtjiwCmg1JQKnxxe9KOuP2VLxSonCrVM2XJFAO2E/s1600-h/or2.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBscx-ucT4wPDKQQK4r-coRZYeBx6PoxT9ISmpJ_t5FbKwe_HIiVxF5TDepm3wh4TAH94WtepX88OVhZau91qPIK03iCx3WRzviKAMtjiwCmg1JQKnxxe9KOuP2VLxSonCrVM2XJFAO2E/s200/or2.jpg" alt="" id="BLOGGER_PHOTO_ID_5255255051459876610" border="0" /></a>The phone has switched orientation to landscape, the application didn't follow. MAJOR FAIL! My SDL version correctly handles such situations:<br /><br /><div align="center"><object height="344" width="425"><param name="movie" value="http://www.youtube.com/v/GjeSjvpy0Ro&hl=en&fs=1&rel=0"><param name="allowFullScreen" value="true"><embed src="http://www.youtube.com/v/GjeSjvpy0Ro&hl=en&fs=1&rel=0" type="application/x-shockwave-flash" allowfullscreen="true" height="344" width="425"></embed></object></div><br /><br />Marcus writes on his site that his SDL allows "S60 programming without pain of Symbian!" This is completly untrue, as Marcus promotes the use of symbian-ridden CSDL class, which more or less requires some arcane knowledge. And when we're at it, just look at the documentation. There's a plethora of bells and whistles to enable or disable, only you don't have the slightest idea which option does what and some of them are there just because they can be. Take virtual mouse cursor for example. I doubt it was used anywhere (not in C2Doom for sure) and my experiences with OpenTTD, which is a mouse-driven game, has proven that it's completly unusable.<br /><br />The amount of such undocumented or useless features only makes the code harder to read (oh, you don't want to look at it; 5 different coding styles in just 20 lines of code), without giving any profits, so the most sane option for me was brutal removal. So long, virtual mouse cursor, bye, various display modes, adiós console view, пока display overlays. You won't be missed. Such Reduction Of Useless Features not only makes the code easier to read, but also reduces the number of potential bugs and makes adding new (but this time usable) features less daunting task.<br /><br />Of course, the library is still not finished (will it be ever?). Despite the fixes mentioned above and all the smaller ones, like fixing palette animation, making sound play smoother, there's still a lot of work to be done before I will be able to just get some random game using SDL and compile it for my phone without much ado. But even with having that said, my SDL port is The Best* symbian SDL version currently available.<br /><br /><span style="font-size:78%;">* for me.</span>Unknownnoreply@blogger.com9tag:blogger.com,1999:blog-2296027761597305278.post-47569737060120488802008-08-27T21:53:00.005+02:002008-10-18T17:03:47.470+02:00Symbian FTP Server<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitKZBhlSfNIKKScbjNb0BVrg0-udE3yPAk6A-TZ_LyVxnlDOe4ttO6PIlDa3vN2EqxPfvniL0iALpgPwDTVD-TPPLN1lg7ZCzFpIe8yGvb40msTmzLdNPiDbpOQTOKXQJGViW2JZYEijk/s1600-h/Screenshot0002.png"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitKZBhlSfNIKKScbjNb0BVrg0-udE3yPAk6A-TZ_LyVxnlDOe4ttO6PIlDa3vN2EqxPfvniL0iALpgPwDTVD-TPPLN1lg7ZCzFpIe8yGvb40msTmzLdNPiDbpOQTOKXQJGViW2JZYEijk/s320/Screenshot0002.png" alt="" id="BLOGGER_PHOTO_ID_5239290097563884450" border="0" /></a>Sending and receiving files from Nokia devices is a major pain in the ass. Basically you're in a lose-lose situation.<br /><br />Option one: send files using USB cable and mass storage mode. It's fairly fast, but your PC only has access to the memory card and you're locked out from using anything that's not installed in the phone memory. And that's an optimistic scenario. In case of some devices, like N73 for example, you can't use the phone at all!<br /><br />Option two: send files using USB cable and Nokia PC Suite. It has the speed advantage of previous option and doesn't prevent you from using your phone, but the PC Suite is so crappy I won't even talk about it.<br /><br />Option three: send files using bluetooth obex file transfer (or whatever it's called). The major advantage here is the lack of that damn cable which restricts mobility when you want to use your mobile (nyah, nyah) device. And you won't be hiding under your table wanting to select some options, just because the USB cable is so short. OK, now the bad side. Firstly, your transfer rate is limited to, like, 120KB/s. In areas with lots of EM pollution you may not be able to go over 40KB/s. And that whole client problem. You have some proprietary clients under windows, some are crappy, some are rather good in some places, but still cumbersome in others. On linux it's tragic. You have some command line mumbo-jumbo requiring lenghty man-page reading, editing <span style="font-style: italic;">/etc/fstab</span>, using commands like <span style="font-style: italic;">dfutool</span>, <span style="font-style: italic;">rfcomm</span>, <span style="font-style: italic;">pand</span> (WTF?). There are some GUI clients, but, as usual, they suck badly. kdebluetooth for example. Oh, I won't work because you have wrong version of this, oh, I won't work because you want me to do that, oh, KDE4 is there for half a year, but obex file transfer is not yet supported. And even if it does work, it's a major pain in the ass to use, as it tries to establish new bluetooth connections every other second. Move file from disk folder to bluetooth folder, wait for the actions popup to appear, oh, it didn't, try again, now it did, but after selecting the copy operation the connection just timed out. So try again, go to to the sending the file part successfully only to fail yet again because for some obscure reason the file just wasn't sent. So try again, and yes, success! All this shit only because I wanted to transfer my fucking holiday photos to PC! Why can't it be simple and just work?<br />In case someone wonders, it's all based on my experience.<br /><br />To get back on the topic: there's also possiblity of html download, sending files using Skype client, but all this requires too much constant setup effort to be actually usable.<br /><br />So, enter the Dumb FTP Server, or dftpd. The first FTP server for S60v3 devices. It's in alpha state, it can crash a lot, it doesn't support that many FTP commands, some may be misimplemented and cause problems with one or two FTP clients, but here's the catch: it does work (and doesn't corrupt the files you transfer).<br />To be able to use it you'll need wifi capable device and (for now) a memory card. To be able to log-in after starting the server and selecting the access point you will need to either disable authentication (any user and password will do, very insecure) or generate an one-time token that is presumably only known to you and which will be invalidated after successfully using it as a password (any username is accepted).<br />Attainable transfer rates are:<br /><ul><li>700-800 KB/s for upload</li><li>~350 KB/s for download</li></ul>I don't think that upload will get any better, but there sure is some space for download optimizations.<br /><br />How to get it:<br /><ol><li>Download <a href="http://team.pld-linux.org/%7Ewolf/symbian/support/pips_nokia_1_3_SS.sis">Open C library</a> and install it, in case you don't have it already.</li><li>Do the same for <a href="http://team.pld-linux.org/%7Ewolf/symbian/support/stdcpp.sis">Open C++</a> component.</li><li>Download <a href="http://team.pld-linux.org/%7Ewolf/symbian/dftpd.sisx">the server</a> and install it.</li></ol>You might be also interested in <a href="http://repo.or.cz/w/dftpd.git">source code</a>. The license is GPLv2. Oh, and that icon is stolen from <a href="http://tango.freedesktop.org/">Tango Desktop Project</a>.Unknownnoreply@blogger.com13