static int decode_residual_block ( AVSContext * h , GetBitContext * gb , const struct dec_2dvlc * r , int esc_golomb_order , int qp , uint8_t * dst , int stride ) {
 int i , level_code , esc_code , level , run , mask ;
 int16_t level_buf [ 65 ] ;
 uint8_t run_buf [ 65 ] ;
 int16_t * block = h -> block ;
 for ( i = 0 ;
 i < 65 ;
 i ++ ) {
 level_code = get_ue_code ( gb , r -> golomb_order ) ;
 if ( level_code >= ESCAPE_CODE ) {
 run = ( ( level_code - ESCAPE_CODE ) >> 1 ) + 1 ;
 esc_code = get_ue_code ( gb , esc_golomb_order ) ;
 level = esc_code + ( run > r -> max_run ? 1 : r -> level_add [ run ] ) ;
 while ( level > r -> inc_limit ) r ++ ;
 mask = - ( level_code & 1 ) ;
 level = ( level ^ mask ) - mask ;
 }
 else if ( level_code >= 0 ) {
 level = r -> rltab [ level_code ] [ 0 ] ;
 if ( ! level ) break ;
 run = r -> rltab [ level_code ] [ 1 ] ;
 r += r -> rltab [ level_code ] [ 2 ] ;
 }
 else {
 break ;
 }
 level_buf [ i ] = level ;
 run_buf [ i ] = run ;
 }
 if ( dequant ( h , level_buf , run_buf , block , dequant_mul [ qp ] , dequant_shift [ qp ] , i ) ) return - 1 ;
 h -> cdsp . cavs_idct8_add ( dst , block , stride ) ;
 h -> dsp . clear_block ( block ) ;
 return 0 ;
 }
static int decode_residual_block ( AVSContext * h , GetBitContext * gb , const struct dec_2dvlc * r , int esc_golomb_order , int qp , uint8_t * dst , int stride ) {
 int i , level_code , esc_code , level , run , mask ;
 int16_t level_buf [ 65 ] ;
 uint8_t run_buf [ 65 ] ;
 int16_t * block = h -> block ;
 for ( i = 0 ;
 i < 65 ;
 i ++ ) {
 level_code = get_ue_code ( gb , r -> golomb_order ) ;
 if ( level_code >= ESCAPE_CODE ) {
 run = ( ( level_code - ESCAPE_CODE ) >> 1 ) + 1 ;
 esc_code = get_ue_code ( gb , esc_golomb_order ) ;
 level = esc_code + ( run > r -> max_run ? 1 : r -> level_add [ run ] ) ;
 while ( level > r -> inc_limit ) r ++ ;
 mask = - ( level_code & 1 ) ;
 level = ( level ^ mask ) - mask ;
 }
 else if ( level_code >= 0 ) {
 level = r -> rltab [ level_code ] [ 0 ] ;
 if ( ! level ) break ;
 run = r -> rltab [ level_code ] [ 1 ] ;
 r += r -> rltab [ level_code ] [ 2 ] ;
 }
 else {
 break ;
 }
 level_buf [ i ] = level ;
 run_buf [ i ] = run ;
 }
 if ( dequant ( h , level_buf , run_buf , block , dequant_mul [ qp ] , dequant_shift [ qp ] , i ) ) return - 1 ;
 h -> cdsp . cavs_idct8_add ( dst , block , stride ) ;
 h -> dsp . clear_block ( block ) ;
 return 0 ;
 }