Revision e1c88a21

View differences:

libavcodec/h264.c
757 757
    FF_ALLOCZ_OR_GOTO(h->s.avctx, h->cbp_table, big_mb_num * sizeof(uint16_t), fail)
758 758

  
759 759
    FF_ALLOCZ_OR_GOTO(h->s.avctx, h->chroma_pred_mode_table, big_mb_num * sizeof(uint8_t), fail)
760
    FF_ALLOCZ_OR_GOTO(h->s.avctx, h->mvd_table[0], 32*big_mb_num * sizeof(uint8_t), fail);
761
    FF_ALLOCZ_OR_GOTO(h->s.avctx, h->mvd_table[1], 32*big_mb_num * sizeof(uint8_t), fail);
760
    FF_ALLOCZ_OR_GOTO(h->s.avctx, h->mvd_table[0], 16*big_mb_num * sizeof(uint8_t), fail);
761
    FF_ALLOCZ_OR_GOTO(h->s.avctx, h->mvd_table[1], 16*big_mb_num * sizeof(uint8_t), fail);
762 762
    FF_ALLOCZ_OR_GOTO(h->s.avctx, h->direct_table, 32*big_mb_num * sizeof(uint8_t) , fail);
763 763
    FF_ALLOCZ_OR_GOTO(h->s.avctx, h->list_counts, big_mb_num * sizeof(uint8_t), fail)
764 764

  
......
775 775
            const int b8_xy= 2*x + 2*y*h->b8_stride;
776 776

  
777 777
            h->mb2b_xy [mb_xy]= b_xy;
778
            h->mb2br_xy[mb_xy]= FMO ? b_xy : (b_xy % (8*h->b_stride));
778
            h->mb2br_xy[mb_xy]= 8*(FMO ? mb_xy : (mb_xy % (2*s->mb_stride)));
779 779
            h->mb2b8_xy[mb_xy]= b8_xy;
780 780
        }
781 781
    }
libavcodec/h264.h
1070 1070
            if( CABAC ) {
1071 1071
                /* XXX beurk, Load mvd */
1072 1072
                if(USES_LIST(top_type, list)){
1073
                    const int b_xy= h->mb2br_xy[top_xy] + 3*h->b_stride;
1073
                    const int b_xy= h->mb2br_xy[top_xy];
1074 1074
                    AV_COPY64(h->mvd_cache[list][scan8[0] + 0 - 1*8], h->mvd_table[list][b_xy + 0]);
1075 1075
                }else{
1076 1076
                    AV_ZERO64(h->mvd_cache[list][scan8[0] + 0 - 1*8]);
1077 1077
                }
1078 1078
                if(USES_LIST(left_type[0], list)){
1079
                    const int b_xy= h->mb2br_xy[left_xy[0]] + 3;
1080
                    AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 0*8], h->mvd_table[list][b_xy + h->b_stride*left_block[0]]);
1081
                    AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 1*8], h->mvd_table[list][b_xy + h->b_stride*left_block[1]]);
1079
                    const int b_xy= h->mb2br_xy[left_xy[0]] + 6;
1080
                    AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 0*8], h->mvd_table[list][b_xy - left_block[0]]);
1081
                    AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 1*8], h->mvd_table[list][b_xy - left_block[1]]);
1082 1082
                }else{
1083 1083
                    AV_ZERO16(h->mvd_cache [list][scan8[0] - 1 + 0*8]);
1084 1084
                    AV_ZERO16(h->mvd_cache [list][scan8[0] - 1 + 1*8]);
1085 1085
                }
1086 1086
                if(USES_LIST(left_type[1], list)){
1087
                    const int b_xy= h->mb2br_xy[left_xy[1]] + 3;
1088
                    AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 2*8], h->mvd_table[list][b_xy + h->b_stride*left_block[2]]);
1089
                    AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 3*8], h->mvd_table[list][b_xy + h->b_stride*left_block[3]]);
1087
                    const int b_xy= h->mb2br_xy[left_xy[1]] + 6;
1088
                    AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 2*8], h->mvd_table[list][b_xy - left_block[2]]);
1089
                    AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 3*8], h->mvd_table[list][b_xy - left_block[3]]);
1090 1090
                }else{
1091 1091
                    AV_ZERO16(h->mvd_cache [list][scan8[0] - 1 + 2*8]);
1092 1092
                    AV_ZERO16(h->mvd_cache [list][scan8[0] - 1 + 3*8]);
......
1424 1424
            AV_COPY128(mv_dst + y*b_stride, mv_src + 8*y);
1425 1425
        }
1426 1426
        if( CABAC ) {
1427
            uint8_t (*mvd_dst)[2] = &h->mvd_table[list][FMO ? b_xy : h->mb2br_xy[h->mb_xy]];
1427
            uint8_t (*mvd_dst)[2] = &h->mvd_table[list][FMO ? 8*h->mb_xy : h->mb2br_xy[h->mb_xy]];
1428 1428
            uint8_t (*mvd_src)[2] = &h->mvd_cache[list][scan8[0]];
1429 1429
            if(IS_SKIP(mb_type))
1430
                fill_rectangle(mvd_dst, 4, 4, h->b_stride, 0, 2);
1431
            else
1432
            for(y=0; y<4; y++){
1433
                AV_COPY64(mvd_dst + y*b_stride, mvd_src + 8*y);
1430
                AV_ZERO128(mvd_dst);
1431
            else{
1432
            AV_COPY64(mvd_dst, mvd_src + 8*3);
1433
            for(y=0; y<3; y++){
1434
                AV_COPY16(mvd_dst + 3 + 3 - y, mvd_src + 3 + 8*y);
1435
            }
1434 1436
            }
1435 1437
        }
1436 1438

  

Also available in: Unified diff