Revision e9feea59

View differences:

libavcodec/avcodec.h
64 64
    PIX_FMT_YUV444P,
65 65
    PIX_FMT_RGBA32,
66 66
    PIX_FMT_BGRA32,
67
    PIX_FMT_YUV410P
67
    PIX_FMT_YUV410P,
68
    PIX_FMT_YUV411P
68 69
};
69 70

  
70 71
/* currently unused, may be used if 24/32 bits samples ever supported */
libavcodec/dv.c
521 521
        nb_dif_segs = 10;
522 522
    }
523 523

  
524
    /* XXX: is it correct to assume that 420 is always used in PAL
525
       mode ? */
526
    s->sampling_411 = !dsf;
527
    if (s->sampling_411)
528
        mb_pos_ptr = dv_place_411;
529
    else
530
        mb_pos_ptr = dv_place_420;
531

  
524 532
    /* (re)alloc picture if needed */
525 533
    if (s->width != width || s->height != height) {
526 534
        for(i=0;i<3;i++)
......
530 538
            s->linesize[i] = width;
531 539
            if (i >= 1) {
532 540
                size >>= 2;
533
                s->linesize[i] >>= 1;
541
                s->linesize[i] >>= s->sampling_411 ? 2 : 1;
534 542
            }
535 543
            s->current_picture[i] = av_malloc(size);
536 544
            if (!s->current_picture[i])
......
540 548
        s->height = height;
541 549
    }
542 550

  
543
    /* XXX: is it correct to assume that 420 is always used in PAL
544
       mode ? */
545
    s->sampling_411 = !dsf;
546
    if (s->sampling_411)
547
        mb_pos_ptr = dv_place_411;
548
    else
549
        mb_pos_ptr = dv_place_420;
550
    
551 551
    /* for each DIF segment */
552 552
    buf_ptr = buf;
553 553
    for (ds = 0; ds < nb_dif_segs; ds++) {
......
568 568
    avctx->width = width;
569 569
    avctx->height = height;
570 570
    if (s->sampling_411)
571
        avctx->pix_fmt = PIX_FMT_YUV420P; /* XXX: incorrect, add PIX_FMT_YUV411P */
571
        avctx->pix_fmt = PIX_FMT_YUV411P;
572 572
    else
573 573
        avctx->pix_fmt = PIX_FMT_YUV420P;
574 574
    if (dsf)

Also available in: Unified diff