]> git.sesse.net Git - narabu/commitdiff
Tiny optimization.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 17 Oct 2017 20:36:42 +0000 (22:36 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 17 Oct 2017 20:36:42 +0000 (22:36 +0200)
rans.shader

index c0272312118a4a00a00a9c0ce6197fb8616691dc..965c6744d8e1151fc0f05eae9ec1dd5af660f60c 100644 (file)
@@ -87,11 +87,9 @@ void RansEncPutSymbol(inout uint rans, inout uint rans_offset, uvec4 sym)
        uint cmpl_freq = (sym.w >> 16);
 
        // renormalize
-       if (rans >= x_max) {
-               do {
-                       rans_output[--rans_offset] = uint8_t(rans & 0xffu);
-                       rans >>= 8;
-               } while (rans >= x_max);
+       while (rans >= x_max) {
+               rans_output[--rans_offset] = uint8_t(rans & 0xffu);
+               rans >>= 8;
        }
 
        uint q, unused;