X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=rans.shader;h=925543ef7dfa284d0fddbce411a61444438dbc9f;hb=dc3e3a2a88b2b1f0e177f613a8b355116e6020ff;hp=05ac1206d1961ac3732882fa152935f4bc884fde;hpb=b8401c220bbb581e2c1334eba12f58b25eb9103b;p=narabu diff --git a/rans.shader b/rans.shader index 05ac120..925543e 100644 --- a/rans.shader +++ b/rans.shader @@ -97,7 +97,9 @@ void encode_coeff(int signed_k, uint sign_bias, inout RansEncoder enc) uint k = abs(signed_k); if (k >= ESCAPE_LIMIT) { - // ... boring stuff here + // Put the coefficient as a 1/(2^12) symbol _before_ + // the 255 coefficient, since the decoder will read the + // 255 coefficient first. RansEncPut(enc.rans, enc.rans_offset, k, 1, prob_bits); k = ESCAPE_LIMIT; }