Revision d1d10e91 libavcodec/h264.c

View differences:

libavcodec/h264.c
217 217
            h->top_samples_available= 0x33FF;
218 218
            h->topright_samples_available= 0x26EA;
219 219
        }
220
        for(i=0; i<2; i++){
221
            if(!IS_INTRA(left_type[i]) && (left_type[i]==0 || h->pps.constrained_intra_pred)){
220
        if(IS_INTERLACED(mb_type) != IS_INTERLACED(left_type[0])){
221
            if(IS_INTERLACED(mb_type)){
222
                if(!IS_INTRA(left_type[0]) && (left_type[0]==0 || h->pps.constrained_intra_pred)){
223
                    h->topleft_samples_available&= 0xDFFF;
224
                    h->left_samples_available&= 0x5FFF;
225
                }
226
                if(!IS_INTRA(left_type[1]) && (left_type[1]==0 || h->pps.constrained_intra_pred)){
227
                    h->topleft_samples_available&= 0xFF5F;
228
                    h->left_samples_available&= 0xFF5F;
229
                }
230
            }else{
231
                int left_typei = h->slice_table[left_xy[0] + s->mb_stride ] == h->slice_num
232
                                ? s->current_picture.mb_type[left_xy[0] + s->mb_stride] : 0;
233
                assert(left_xy[0] == left_xy[1]);
234
                if(!(IS_INTRA(left_typei) && IS_INTRA(left_type[0])) && (left_typei==0 || h->pps.constrained_intra_pred)){
235
                    h->topleft_samples_available&= 0xDF5F;
236
                    h->left_samples_available&= 0x5F5F;
237
                }
238
            }
239
        }else{
240
            if(!IS_INTRA(left_type[0]) && (left_type[0]==0 || h->pps.constrained_intra_pred)){
222 241
                h->topleft_samples_available&= 0xDF5F;
223 242
                h->left_samples_available&= 0x5F5F;
224 243
            }
......
565 584
        }
566 585
    }
567 586

  
568
    if(!(h->left_samples_available&0x8000)){
587
    if((h->left_samples_available&0x8888)!=0x8888){
588
        static const int mask[4]={0x8000,0x2000,0x80,0x20};
569 589
        for(i=0; i<4; i++){
590
            if(!(h->left_samples_available&mask[i])){
570 591
            int status= left[ h->intra4x4_pred_mode_cache[scan8[0] + 8*i] ];
571 592
            if(status<0){
572 593
                av_log(h->s.avctx, AV_LOG_ERROR, "left block unavailable for requested intra4x4 mode %d at %d %d\n", status, s->mb_x, s->mb_y);
......
574 595
            } else if(status){
575 596
                h->intra4x4_pred_mode_cache[scan8[0] + 8*i]= status;
576 597
            }
598
            }
577 599
        }
578 600
    }
579 601

  
......
601 623
        }
602 624
    }
603 625

  
604
    if(!(h->left_samples_available&0x8000)){
626
    if((h->left_samples_available&0x8080) != 0x8080){
605 627
        mode= left[ mode ];
628
        if(h->left_samples_available&0x8080){ //mad cow disease mode, aka MBAFF + constrained_intra_pred
629
            mode= ALZHEIMER_DC_L0T_PRED8x8 + (!(h->left_samples_available&0x8000)) + 2*(mode == DC_128_PRED8x8);
630
        }
606 631
        if(mode<0){
607 632
            av_log(h->s.avctx, AV_LOG_ERROR, "left block unavailable for requested intra mode at %d %d\n", s->mb_x, s->mb_y);
608 633
            return -1;

Also available in: Unified diff