• MTF better than AdaptHuff?

    From Harry Potter@21:1/5 to All on Sat Dec 24 09:16:15 2022
    Hi! I am working on several compression techniques right now. I was at one time working on a form of MTF but abandoned it thinking it did worse than AdaptHuff. However, a few weeks ago, I resurrected it and found it was *better* than AdaptHuff.
    Following is the code I'm using to write MTF values:
    ----------------------
    void mtfWriteVal (unsigned c)
    {
    unsigned m=mtfGetVal (c);
    if (m<32) {
    writeoutf_11 ();
    writeoutf (m, 5);
    } else if (m<64) {
    writeoutf_x2 (2);
    writeoutf (m-32, 5);
    } else if (m<128) {
    writeoutf (5, 3);
    writeoutf (m-64, 6);
    } else {
    writeoutf (6, 3);
    writeoutf (m-128, 7);
    }
    }
    ------------
    where mtfGetVal() gives the value translated to MTF, writeoutf_01() and writeoutf_11() write one bit, writeoutf_x2() writes two bits and writeoutf() writes the number of bits given in the second argument.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Phil Carmody@21:1/5 to Harry Potter on Tue Dec 27 01:40:38 2022
    Harry Potter <rose.joseph12@yahoo.com> writes:
    Hi! I am working on several compression techniques right now. I was at one time working on a form of MTF but abandoned it thinking it did worse than AdaptHuff. However, a few weeks ago, I resurrected it and found it was *better* than AdaptHuff.
    Following is the code I'm using to write MTF values:

    This is an apples to oranges comparison. MTF could be included before AdaptHuff, they aren't competing with each other.

    Phil
    --
    We are no longer hunters and nomads. No longer awed and frightened, as we have gained some understanding of the world in which we live. As such, we can cast aside childish remnants from the dawn of our civilization.
    -- NotSanguine on SoylentNews, after Eugen Weber in /The Western Tradition/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)