         r_bit = (r_bit << 8) + byte_value;
         r_bit_count += 8;
     }
-    
-    // Possibly load more bytes into shared buffer from global memory
-    if(s_byte_idx >= 16) {
-        // Move remaining bytes to begin and update index of next byte
-        s_byte[0] = s_byte[1];
-        s_byte_idx -= 16;
-        
-        // Load another byte chunk from global memory only if there is one
-        if(d_byte_chunk_count) {
-            s_byte[1] = *(d_byte++);
-            d_byte_chunk_count--;
-        }
-    }
 }
 
 

__device__ inline int
gpujpeg_huffman_gpu_decoder_get_coefficient(
                unsigned int & r_bit, unsigned int & r_bit_count, uint4* const s_byte,
                unsigned int & s_byte_idx, const uint4* & d_byte, unsigned int & d_byte_chunk_count,
                const unsigned int table_offset, unsigned int & coefficient_idx)
{
    // Peek next 16 bits and use them as an index into decoder table to find all the info.
    const unsigned int table_idx = table_offset + gpujpeg_huffman_gpu_decoder_peek_bits(16, r_bit, r_bit_count, s_byte, s_byte_idx, d_byte, d_byte_chunk_count);
    
    // Try the quick table first (use the full table only if not succeded with the quick table)
    unsigned int packed_info = gpujpeg_huffman_gpu_decoder_tables_quick_const[table_idx >> (16 - QUICK_CHECK_BITS)];

 */
__device__ inline void
gpujpeg_huffman_gpu_decoder_load_bits(
                const unsigned int required_bit_count, unsigned int & r_bit,
                unsigned int & r_bit_count, uint4 * const s_byte, unsigned int & s_byte_idx
) {
    // Add bytes until have enough
    while(r_bit_count < required_bit_count) {
