Revision a8de3901 libavcodec/vp3.c

View differences:

libavcodec/vp3.c
135 135
    int keyframe;
136 136
    DSPContext dsp;
137 137
    int flipped_image;
138
    int last_slice_end;
138 139

  
139 140
    int qps[3];
140 141
    int nqps;
......
1450 1451
    }
1451 1452
}
1452 1453

  
1454
/**
1455
 * called when all pixels up to row y are complete
1456
 */
1457
static void vp3_draw_horiz_band(Vp3DecodeContext *s, int y)
1458
{
1459
    int h, cy;
1460
    int offset[4];
1461

  
1462
    if(s->avctx->draw_horiz_band==NULL)
1463
        return;
1464

  
1465
    h= y - s->last_slice_end;
1466
    y -= h;
1467

  
1468
    if (!s->flipped_image) {
1469
        if (y == 0)
1470
            h -= s->height - s->avctx->height;  // account for non-mod16
1471
        y = s->height - y - h;
1472
    }
1473

  
1474
    cy = y >> 1;
1475
    offset[0] = s->current_frame.linesize[0]*y;
1476
    offset[1] = s->current_frame.linesize[1]*cy;
1477
    offset[2] = s->current_frame.linesize[2]*cy;
1478
    offset[3] = 0;
1479

  
1480
    emms_c();
1481
    s->avctx->draw_horiz_band(s->avctx, &s->current_frame, offset, y, 3, h);
1482
    s->last_slice_end= y + h;
1483
}
1484

  
1453 1485
/*
1454 1486
 * Perform the final rendering for a particular slice of data.
1455 1487
 * The slice number ranges from 0..(macroblock_height - 1).
......
1624 1656
      *     dispatch (slice - 1);
1625 1657
      */
1626 1658

  
1627
    emms_c();
1659
    // now that we've filtered the last rows, they're safe to display
1660
    if (slice)
1661
        vp3_draw_horiz_band(s, 16*slice);
1628 1662
}
1629 1663

  
1630 1664
/*
......
2008 2042
        return -1;
2009 2043
    }
2010 2044

  
2045
    s->last_slice_end = 0;
2011 2046
    for (i = 0; i < s->macroblock_height; i++)
2012 2047
        render_slice(s, i);
2013 2048

  
......
2016 2051
        int row = (s->height >> (3+!!i)) - 1;
2017 2052
        apply_loop_filter(s, i, row, row+1);
2018 2053
    }
2054
    vp3_draw_horiz_band(s, s->height);
2019 2055

  
2020 2056
    *data_size=sizeof(AVFrame);
2021 2057
    *(AVFrame*)data= s->current_frame;
......
2367 2403
    NULL,
2368 2404
    vp3_decode_end,
2369 2405
    vp3_decode_frame,
2370
    CODEC_CAP_DR1,
2406
    CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND,
2371 2407
    NULL,
2372 2408
    .long_name = NULL_IF_CONFIG_SMALL("Theora"),
2373 2409
};
......
2382 2418
    NULL,
2383 2419
    vp3_decode_end,
2384 2420
    vp3_decode_frame,
2385
    CODEC_CAP_DR1,
2421
    CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND,
2386 2422
    NULL,
2387 2423
    .long_name = NULL_IF_CONFIG_SMALL("On2 VP3"),
2388 2424
};

Also available in: Unified diff