Revision 42dd22c4 libavcodec/huffyuv.c

View differences:

libavcodec/huffyuv.c
360 360
    width= s->width= avctx->width;
361 361
    height= s->height= avctx->height;
362 362
    avctx->coded_frame= &s->picture;
363
    s->interlaced= height > 288;
363 364

  
364 365
s->bgr32=1;
365 366
    assert(width && height);
......
374 375
        s->version=0;
375 376
    
376 377
    if(s->version==2){
377
        int method;
378
        int method, interlace;
378 379

  
379 380
        method= ((uint8_t*)avctx->extradata)[0];
380 381
        s->decorrelate= method&64 ? 1 : 0;
......
382 383
        s->bitstream_bpp= ((uint8_t*)avctx->extradata)[1];
383 384
        if(s->bitstream_bpp==0) 
384 385
            s->bitstream_bpp= avctx->bits_per_sample&~7;
386
        interlace= (((uint8_t*)avctx->extradata)[2] & 0x30) >> 4;
387
        s->interlaced= (interlace==1) ? 1 : (interlace==2) ? 0 : s->interlaced;
385 388
        s->context= ((uint8_t*)avctx->extradata)[2] & 0x40 ? 1 : 0;
386 389
            
387 390
        if(read_huffman_tables(s, ((uint8_t*)avctx->extradata)+4, avctx->extradata_size) < 0)
......
416 419
            return -1;
417 420
    }
418 421
    
419
    if(((uint8_t*)avctx->extradata)[2] & 0x20)
420
	s->interlaced= ((uint8_t*)avctx->extradata)[2] & 0x10 ? 1 : 0;
421
    else
422
	s->interlaced= height > 288;
423
    
424 422
    switch(s->bitstream_bpp){
425 423
    case 12:
426 424
        avctx->pix_fmt = PIX_FMT_YUV420P;
......
534 532
    
535 533
    ((uint8_t*)avctx->extradata)[0]= s->predictor;
536 534
    ((uint8_t*)avctx->extradata)[1]= s->bitstream_bpp;
537
    ((uint8_t*)avctx->extradata)[2]= 0x20 | (s->interlaced ? 0x10 : 0);
535
    ((uint8_t*)avctx->extradata)[2]= s->interlaced ? 0x10 : 0x20;
538 536
    if(s->context)
539 537
        ((uint8_t*)avctx->extradata)[2]|= 0x40;
540 538
    ((uint8_t*)avctx->extradata)[3]= 0;

Also available in: Unified diff