Revision e7077f5e libavcodec/h264_cavlc.c

View differences:

libavcodec/h264_cavlc.c
522 522
        } \
523 523
    }
524 524

  
525
    if (h->pixel_size == 2) {
525
    if (h->pixel_shift) {
526 526
        STORE_BLOCK(int32_t)
527 527
    } else {
528 528
        STORE_BLOCK(int16_t)
......
961 961
                for(i8x8=0; i8x8<4; i8x8++){
962 962
                    for(i4x4=0; i4x4<4; i4x4++){
963 963
                        const int index= i4x4 + 4*i8x8;
964
                        if( decode_residual(h, h->intra_gb_ptr, h->mb + 16*index*h->pixel_size, index, scan + 1, h->dequant4_coeff[0][s->qscale], 15) < 0 ){
964
                        if( decode_residual(h, h->intra_gb_ptr, h->mb + (16*index<<h->pixel_shift), index, scan + 1, h->dequant4_coeff[0][s->qscale], 15) < 0 ){
965 965
                            return -1;
966 966
                        }
967 967
                    }
......
973 973
            for(i8x8=0; i8x8<4; i8x8++){
974 974
                if(cbp & (1<<i8x8)){
975 975
                    if(IS_8x8DCT(mb_type)){
976
                        DCTELEM *buf = &h->mb[64*i8x8*h->pixel_size];
976
                        DCTELEM *buf = &h->mb[64*i8x8<<h->pixel_shift];
977 977
                        uint8_t *nnz;
978 978
                        for(i4x4=0; i4x4<4; i4x4++){
979 979
                            if( decode_residual(h, gb, buf, i4x4+4*i8x8, scan8x8+16*i4x4,
......
986 986
                        for(i4x4=0; i4x4<4; i4x4++){
987 987
                            const int index= i4x4 + 4*i8x8;
988 988

  
989
                            if( decode_residual(h, gb, h->mb + 16*index*h->pixel_size, index, scan, h->dequant4_coeff[IS_INTRA( mb_type ) ? 0:3][s->qscale], 16) <0 ){
989
                            if( decode_residual(h, gb, h->mb + (16*index<<h->pixel_shift), index, scan, h->dequant4_coeff[IS_INTRA( mb_type ) ? 0:3][s->qscale], 16) <0 ){
990 990
                                return -1;
991 991
                            }
992 992
                        }
......
1000 1000

  
1001 1001
        if(cbp&0x30){
1002 1002
            for(chroma_idx=0; chroma_idx<2; chroma_idx++)
1003
                if( decode_residual(h, gb, h->mb + (256 + 16*4*chroma_idx)*h->pixel_size, CHROMA_DC_BLOCK_INDEX+chroma_idx, chroma_dc_scan, NULL, 4) < 0){
1003
                if( decode_residual(h, gb, h->mb + ((256 + 16*4*chroma_idx)<<h->pixel_shift), CHROMA_DC_BLOCK_INDEX+chroma_idx, chroma_dc_scan, NULL, 4) < 0){
1004 1004
                    return -1;
1005 1005
                }
1006 1006
        }
......
1010 1010
                const uint32_t *qmul = h->dequant4_coeff[chroma_idx+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp[chroma_idx]];
1011 1011
                for(i4x4=0; i4x4<4; i4x4++){
1012 1012
                    const int index= 16 + 4*chroma_idx + i4x4;
1013
                    if( decode_residual(h, gb, h->mb + 16*index*h->pixel_size, index, scan + 1, qmul, 15) < 0){
1013
                    if( decode_residual(h, gb, h->mb + (16*index<<h->pixel_shift), index, scan + 1, qmul, 15) < 0){
1014 1014
                        return -1;
1015 1015
                    }
1016 1016
                }

Also available in: Unified diff