Author Topic: Further optimization: Re-order samples  (Read 14230 times)


  • Posts: 2662
Further optimization: Re-order samples
« on: 27 Jul '10 - 16:42 »
I've got an idea for further optimization in the mo3 encoder after having a look at an encoded file: I took an IT file in instrument mode, which had quite a few empty sample slots. To save even more bytes, those empty sample slots could simply be removed, so that the useless sample headers don't have to be stored.

Ian @ un4seen

  • Administrator
  • Posts: 25460
Re: Further optimization: Re-order samples
« Reply #1 on: 27 Jul '10 - 17:38 »
I'm not sure that would knock much off the file size as the sample structures are compressed, which should reduce empty/duplicate structures to practically nothing. Just to be sure though, you could try removing the empty sample slots from the IT file and make comparisons :)


  • Posts: 2662
Re: Further optimization: Re-order samples
« Reply #2 on: 25 Jul '11 - 21:32 »
I found that 6 sample slots made a different of a bit more than 1KiB (same with an uncompressed IT file). That is not a whole lot of course, but I suppose it could make a difference when size really matters. Of course it would also be possible for people to do it in their tracker (if it supports reordering samples), but it would be even nicer to automate this.

Talking about optimizations... MO3 keeps unused envelopes (which cannot be enabled in the XM format) and envelopes parts that can never be reached (specifically, the parts beyond the loop point in the IT format, where there is no command to jump around in the envelope), which is a pointless waste of space. I guess that removing those parts would be a trivial task, so why not add it to the encoder? :)
(as you might notice, I am currently fighting for every byte I can drop in a specific MO3 file...)
« Last Edit: 26 Jul '11 - 15:04 by saga »