     for ( int k = 1; k < 64; k++ ) {
         // s: (run, category)
 //         int s = gpujpeg_huffman_gpu_decoder_get_category(get_bits, get_buff, data, data_size, table_ac);
-        int s = gpujpeg_huffman_gpu_decoder_decode_special_decode(table_ac, 1, get_bits, get_buff, data, data_size);
+        int s = gpujpeg_huffman_gpu_decoder_decode_special_decode(table_ac, 1, r_bit, r_bit_count, s_byte, s_byte_idx, d_byte, d_byte_chunk_count);
         // r: run length for ac zero, 0 <= r < 16
         int r = s >> 4;
         // s: category for this non-zero ac

            }
            
            // Encode 8x8 block
            if ( gpujpeg_huffman_gpu_decoder_decode_block(get_buff, get_bits, component_dc, data_compressed, data_compressed_size, block, d_table_dc, d_table_ac) != 0 )
                break;
        } 
    }

            //    k: position for next non-zero ac
            k += r;
            //    r: offset in this ac category
            r = gpujpeg_huffman_gpu_decoder_get_bits(s, r_bit, r_bit_count, s_byte, s_byte_idx, d_byte, d_byte_chunk_count);
            //    s: ac value
            s = gpujpeg_huffman_gpu_decoder_value_from_category(s, r);

