Revision 880003bb libavcodec/h264.c

View differences:

libavcodec/h264.c
5689 5689
    5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8
5690 5690
};
5691 5691

  
5692
static int decode_cabac_residual( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff) {
5692
static void decode_cabac_residual( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff) {
5693 5693
    const int mb_xy  = h->s.mb_x + h->s.mb_y*h->s.mb_stride;
5694 5694
    static const int significant_coeff_flag_offset[2][6] = {
5695 5695
      { 105+0, 105+15, 105+29, 105+44, 105+47, 402 },
......
5759 5759
            h->cabac.low       = cc.low       ;
5760 5760
            h->cabac.bytestream= cc.bytestream;
5761 5761
#endif
5762
            return 0;
5762
            return;
5763 5763
        }
5764 5764
    }
5765 5765

  
......
5860 5860
            h->cabac.low       = cc.low       ;
5861 5861
            h->cabac.bytestream= cc.bytestream;
5862 5862
#endif
5863
    return 0;
5863

  
5864 5864
}
5865 5865

  
5866 5866
static inline void compute_mb_neighbors(H264Context *h)
......
6306 6306
        if( IS_INTRA16x16( mb_type ) ) {
6307 6307
            int i;
6308 6308
            //av_log( s->avctx, AV_LOG_ERROR, "INTRA16x16 DC\n" );
6309
            if( decode_cabac_residual( h, h->mb, 0, 0, dc_scan, NULL, 16) < 0)
6310
                return -1;
6309
            decode_cabac_residual( h, h->mb, 0, 0, dc_scan, NULL, 16);
6310

  
6311 6311
            if( cbp&15 ) {
6312 6312
                for( i = 0; i < 16; i++ ) {
6313 6313
                    //av_log( s->avctx, AV_LOG_ERROR, "INTRA16x16 AC:%d\n", i );
6314
                    if( decode_cabac_residual(h, h->mb + 16*i, 1, i, scan + 1, h->dequant4_coeff[0][s->qscale], 15) < 0 )
6315
                        return -1;
6314
                    decode_cabac_residual(h, h->mb + 16*i, 1, i, scan + 1, h->dequant4_coeff[0][s->qscale], 15);
6316 6315
                }
6317 6316
            } else {
6318 6317
                fill_rectangle(&h->non_zero_count_cache[scan8[0]], 4, 4, 8, 0, 1);
......
6322 6321
            for( i8x8 = 0; i8x8 < 4; i8x8++ ) {
6323 6322
                if( cbp & (1<<i8x8) ) {
6324 6323
                    if( IS_8x8DCT(mb_type) ) {
6325
                        if( decode_cabac_residual(h, h->mb + 64*i8x8, 5, 4*i8x8,
6326
                            scan8x8, h->dequant8_coeff[IS_INTRA( mb_type ) ? 0:1][s->qscale], 64) < 0 )
6327
                            return -1;
6324
                        decode_cabac_residual(h, h->mb + 64*i8x8, 5, 4*i8x8,
6325
                            scan8x8, h->dequant8_coeff[IS_INTRA( mb_type ) ? 0:1][s->qscale], 64);
6328 6326
                    } else
6329 6327
                    for( i4x4 = 0; i4x4 < 4; i4x4++ ) {
6330 6328
                        const int index = 4*i8x8 + i4x4;
6331 6329
                        //av_log( s->avctx, AV_LOG_ERROR, "Luma4x4: %d\n", index );
6332 6330
//START_TIMER
6333
                        if( decode_cabac_residual(h, h->mb + 16*index, 2, index, scan, h->dequant4_coeff[IS_INTRA( mb_type ) ? 0:3][s->qscale], 16) < 0 )
6334
                            return -1;
6331
                        decode_cabac_residual(h, h->mb + 16*index, 2, index, scan, h->dequant4_coeff[IS_INTRA( mb_type ) ? 0:3][s->qscale], 16);
6335 6332
//STOP_TIMER("decode_residual")
6336 6333
                    }
6337 6334
                } else {
......
6345 6342
            int c;
6346 6343
            for( c = 0; c < 2; c++ ) {
6347 6344
                //av_log( s->avctx, AV_LOG_ERROR, "INTRA C%d-DC\n",c );
6348
                if( decode_cabac_residual(h, h->mb + 256 + 16*4*c, 3, c, chroma_dc_scan, NULL, 4) < 0)
6349
                    return -1;
6345
                decode_cabac_residual(h, h->mb + 256 + 16*4*c, 3, c, chroma_dc_scan, NULL, 4);
6350 6346
            }
6351 6347
        }
6352 6348

  
......
6357 6353
                for( i = 0; i < 4; i++ ) {
6358 6354
                    const int index = 16 + 4 * c + i;
6359 6355
                    //av_log( s->avctx, AV_LOG_ERROR, "INTRA C%d-AC %d\n",c, index - 16 );
6360
                    if( decode_cabac_residual(h, h->mb + 16*index, 4, index - 16, scan + 1, qmul, 15) < 0)
6361
                        return -1;
6356
                    decode_cabac_residual(h, h->mb + 16*index, 4, index - 16, scan + 1, qmul, 15);
6362 6357
                }
6363 6358
            }
6364 6359
        } else {

Also available in: Unified diff