Ticket #113: ffmpeg-cabacres-types.diff

File ffmpeg-cabacres-types.diff, 1.4 kB (added by astrange, 2 years ago)

Make some variable types in decode_cabac_residual smaller. Breaks x86.

  • h264.c

    old new  
    60406040    5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8 
    60416041}; 
    60426042 
    6043 static int decode_cabac_residual( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff) { 
     6043static int decode_cabac_residual( H264Context *h, DCTELEM *block, unsigned char cat, int n, const uint8_t *scantable, const uint32_t *qmul, unsigned char max_coeff) { 
    60446044    const int mb_xy  = h->s.mb_x + h->s.mb_y*h->s.mb_stride; 
    60456045    static const uint16_t significant_coeff_flag_offset[2][6] = { 
    60466046      { 105+0, 105+15, 105+29, 105+44, 105+47, 402 }, 
     
    60646064        9,10,10, 8,13,13, 9, 9,10,10,14,14,14,14,14 } 
    60656065    }; 
    60666066 
    6067     int index[64]; 
     6067    uint8_t index[64]; 
    60686068 
    6069     int last; 
     6069    uint8_t last; 
    60706070    int coeff_count = 0; 
    60716071 
    6072     int abslevel1 = 1; 
    6073     int abslevelgt1 = 0; 
     6072    unsigned abslevel1 = 1; 
     6073    unsigned abslevelgt1 = 0; 
    60746074 
    60756075    uint8_t *significant_coeff_ctx_base; 
    60766076    uint8_t *last_coeff_ctx_base; 
     
    61696169    } 
    61706170 
    61716171    while ( coeff_count-- ) { 
     6172                uint8_t j= scantable[index[coeff_count]]; 
    61726173        uint8_t *ctx = (abslevelgt1 != 0 ? 0 : FFMIN( 4, abslevel1 )) + abs_level_m1_ctx_base; 
    6173         int j= scantable[index[coeff_count]]; 
    61746174 
    61756175        if( get_cabac( CC, ctx ) == 0 ) { 
    61766176            int sign = get_cabac_bypass_sign( CC, qmul ? -qmul[j] : -1 );