Revision 3b606e71 libavcodec/svq3.c

View differences:

libavcodec/svq3.c
478 478
        */
479 479

  
480 480
        for (m = 0; m < 2; m++) {
481
            if (s->mb_x > 0 && h->intra4x4_pred_mode[8*h->mb2br_xy[mb_xy - 1]+6] != -1) {
481
            if (s->mb_x > 0 && h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - 1]+6] != -1) {
482 482
                for (i = 0; i < 4; i++) {
483 483
                    *(uint32_t *) h->mv_cache[m][scan8[0] - 1 + i*8] = *(uint32_t *) s->current_picture.motion_val[m][b_xy - 1 + i*h->b_stride];
484 484
                }
......
489 489
            }
490 490
            if (s->mb_y > 0) {
491 491
                memcpy(h->mv_cache[m][scan8[0] - 1*8], s->current_picture.motion_val[m][b_xy - h->b_stride], 4*2*sizeof(int16_t));
492
                memset(&h->ref_cache[m][scan8[0] - 1*8], (h->intra4x4_pred_mode[8*h->mb2br_xy[mb_xy - s->mb_stride]] == -1) ? PART_NOT_AVAILABLE : 1, 4);
492
                memset(&h->ref_cache[m][scan8[0] - 1*8], (h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - s->mb_stride]] == -1) ? PART_NOT_AVAILABLE : 1, 4);
493 493

  
494 494
                if (s->mb_x < (s->mb_width - 1)) {
495 495
                    *(uint32_t *) h->mv_cache[m][scan8[0] + 4 - 1*8] = *(uint32_t *) s->current_picture.motion_val[m][b_xy - h->b_stride + 4];
496 496
                    h->ref_cache[m][scan8[0] + 4 - 1*8] =
497
                        (h->intra4x4_pred_mode[8*h->mb2br_xy[mb_xy - s->mb_stride + 1]+6] == -1 ||
498
                         h->intra4x4_pred_mode[8*h->mb2br_xy[mb_xy - s->mb_stride    ]  ] == -1) ? PART_NOT_AVAILABLE : 1;
497
                        (h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - s->mb_stride + 1]+6] == -1 ||
498
                         h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - s->mb_stride    ]  ] == -1) ? PART_NOT_AVAILABLE : 1;
499 499
                }else
500 500
                    h->ref_cache[m][scan8[0] + 4 - 1*8] = PART_NOT_AVAILABLE;
501 501
                if (s->mb_x > 0) {
502 502
                    *(uint32_t *) h->mv_cache[m][scan8[0] - 1 - 1*8] = *(uint32_t *) s->current_picture.motion_val[m][b_xy - h->b_stride - 1];
503
                    h->ref_cache[m][scan8[0] - 1 - 1*8] = (h->intra4x4_pred_mode[8*h->mb2br_xy[mb_xy - s->mb_stride - 1]+3] == -1) ? PART_NOT_AVAILABLE : 1;
503
                    h->ref_cache[m][scan8[0] - 1 - 1*8] = (h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - s->mb_stride - 1]+3] == -1) ? PART_NOT_AVAILABLE : 1;
504 504
                }else
505 505
                    h->ref_cache[m][scan8[0] - 1 - 1*8] = PART_NOT_AVAILABLE;
506 506
            }else
......
540 540
        if (mb_type == 8) {
541 541
            if (s->mb_x > 0) {
542 542
                for (i = 0; i < 4; i++) {
543
                    h->intra4x4_pred_mode_cache[scan8[0] - 1 + i*8] = h->intra4x4_pred_mode[8*h->mb2br_xy[mb_xy - 1]+6-i];
543
                    h->intra4x4_pred_mode_cache[scan8[0] - 1 + i*8] = h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - 1]+6-i];
544 544
                }
545 545
                if (h->intra4x4_pred_mode_cache[scan8[0] - 1] == -1) {
546 546
                    h->left_samples_available = 0x5F5F;
547 547
                }
548 548
            }
549 549
            if (s->mb_y > 0) {
550
                h->intra4x4_pred_mode_cache[4+8*0] = h->intra4x4_pred_mode[8*h->mb2br_xy[mb_xy - s->mb_stride]+0];
551
                h->intra4x4_pred_mode_cache[5+8*0] = h->intra4x4_pred_mode[8*h->mb2br_xy[mb_xy - s->mb_stride]+1];
552
                h->intra4x4_pred_mode_cache[6+8*0] = h->intra4x4_pred_mode[8*h->mb2br_xy[mb_xy - s->mb_stride]+2];
553
                h->intra4x4_pred_mode_cache[7+8*0] = h->intra4x4_pred_mode[8*h->mb2br_xy[mb_xy - s->mb_stride]+3];
550
                h->intra4x4_pred_mode_cache[4+8*0] = h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - s->mb_stride]+0];
551
                h->intra4x4_pred_mode_cache[5+8*0] = h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - s->mb_stride]+1];
552
                h->intra4x4_pred_mode_cache[6+8*0] = h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - s->mb_stride]+2];
553
                h->intra4x4_pred_mode_cache[7+8*0] = h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - s->mb_stride]+3];
554 554

  
555 555
                if (h->intra4x4_pred_mode_cache[4+8*0] == -1) {
556 556
                    h->top_samples_available = 0x33FF;
......
624 624
        }
625 625
    }
626 626
    if (!IS_INTRA4x4(mb_type)) {
627
        memset(h->intra4x4_pred_mode+8*h->mb2br_xy[mb_xy], DC_PRED, 8);
627
        memset(h->intra4x4_pred_mode+h->mb2br_xy[mb_xy], DC_PRED, 8);
628 628
    }
629 629
    if (!IS_SKIP(mb_type) || s->pict_type == FF_B_TYPE) {
630 630
        memset(h->non_zero_count_cache + 8, 0, 4*9*sizeof(uint8_t));
......
774 774

  
775 775
    /* reset intra predictors and invalidate motion vector references */
776 776
    if (s->mb_x > 0) {
777
        memset(h->intra4x4_pred_mode+8*h->mb2br_xy[mb_xy - 1      ]+3, -1, 4*sizeof(int8_t));
778
        memset(h->intra4x4_pred_mode+8*h->mb2br_xy[mb_xy - s->mb_x]  , -1, 8*sizeof(int8_t)*s->mb_x);
777
        memset(h->intra4x4_pred_mode+h->mb2br_xy[mb_xy - 1      ]+3, -1, 4*sizeof(int8_t));
778
        memset(h->intra4x4_pred_mode+h->mb2br_xy[mb_xy - s->mb_x]  , -1, 8*sizeof(int8_t)*s->mb_x);
779 779
    }
780 780
    if (s->mb_y > 0) {
781
        memset(h->intra4x4_pred_mode+8*h->mb2br_xy[mb_xy - s->mb_stride], -1, 8*sizeof(int8_t)*(s->mb_width - s->mb_x));
781
        memset(h->intra4x4_pred_mode+h->mb2br_xy[mb_xy - s->mb_stride], -1, 8*sizeof(int8_t)*(s->mb_width - s->mb_x));
782 782

  
783 783
        if (s->mb_x > 0) {
784
            h->intra4x4_pred_mode[8*h->mb2br_xy[mb_xy - s->mb_stride - 1]+3] = -1;
784
            h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - s->mb_stride - 1]+3] = -1;
785 785
        }
786 786
    }
787 787

  

Also available in: Unified diff