tag:blogger.com,1999:blog-5871195708658212343.post4462196963263013315..comments2023-10-21T06:21:26.431-07:00Comments on Hugo Smits devlog: Easy CompressionHugohttp://www.blogger.com/profile/13832882628247753379noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-5871195708658212343.post-63426599650209395352009-08-29T01:48:56.091-07:002009-08-29T01:48:56.091-07:00@Kostas:
I understand, but I'm not doing that...@Kostas:<br /><br />I understand, but I'm not doing that! <br /><br />I look at it indeed as a mask part. If I find a opaque pixel, I start a new line (or slab) I store the x-value (the start place) and I then increase the width of the line until I hit a transparent pixel.<br /><br />So in the end I have no data of transparent pixels. <br /><br />So my data isn't alternated between the two values, instead I know where to draw the opaque pixels because I have the x offset value!Hugohttps://www.blogger.com/profile/13832882628247753379noreply@blogger.comtag:blogger.com,1999:blog-5871195708658212343.post-88503508834091410552009-08-27T11:31:04.619-07:002009-08-27T11:31:04.619-07:00@Hugo:
If you think the data you want to encode as...@Hugo:<br />If you think the data you want to encode as only the mask part, what you encode is 1bit data (0=transparent, 1=opaque). In this case you don't have to specify what follows: just alternate between the two values.Bad Sectorhttps://www.blogger.com/profile/03732306899696142994noreply@blogger.comtag:blogger.com,1999:blog-5871195708658212343.post-71896858628103031732009-08-27T08:39:54.189-07:002009-08-27T08:39:54.189-07:00When scanning the compressed image, how do you kno...When scanning the compressed image, how do you know when a new 'slab' starts? And how do you determine where the new slab should be rendered horizontally?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5871195708658212343.post-47063571075460933542009-08-26T02:49:58.020-07:002009-08-26T02:49:58.020-07:00I didn’t know this is also RLE. To my knowledge yo...I didn’t know this is also RLE. To my knowledge you still ‘store’ all the data in RLE but in a shorter way like this ‘WWWBBBBWWBWWWBB’ becomes ‘3W4B2W1B3W2B’. While in my method I delete all the transparent pixels (they don’t exists anymore, after the image went through my tool).Hugohttps://www.blogger.com/profile/13832882628247753379noreply@blogger.comtag:blogger.com,1999:blog-5871195708658212343.post-24614794556464431352009-08-24T10:13:30.363-07:002009-08-24T10:13:30.363-07:00That is a common use for RLE (which is what you id...That is a common use for RLE (which is what you id) actually. A slightly improved version is to encode the image for a state machine VM that has 'commands' like DRAW_PIXELS, SKIP_PIXELS, NEXT_LINE. Beyond requiring less branches (zero i the CPU has 'movd'-like commands and you use a function table for this -- although depending on the architecture this might be worse due to cache misses, but i'm not sure if the ARM in DS has any cache), it also has the beauty if adding an extra 'command' to handle translucency or other effects (darken, lighten, or even blur - a sprite that has parts that blur the background!) not affecting the rest.<br /><br />A more advanced version (which *will* impact your cache if your architecture has one) is to encode the RLEd image directly in machine code skipping the VM entirely.Bad Sectorhttps://www.blogger.com/profile/03732306899696142994noreply@blogger.comtag:blogger.com,1999:blog-5871195708658212343.post-87106267484446610122009-08-23T08:16:32.255-07:002009-08-23T08:16:32.255-07:00Erg slim gedaan. Geeft mij ook weer een nieuwe kij...Erg slim gedaan. Geeft mij ook weer een nieuwe kijk op ruimtebesparing.Eric Diepeveenhttps://www.blogger.com/profile/08104078222886669253noreply@blogger.com