Revision 70e0c871 libavcodec/vdpau.c

View differences:

libavcodec/vdpau.c
305 305
    render->bitstream_buffers_used        = 0;
306 306
}
307 307

  
308
void ff_vdpau_mpeg4_decode_picture(MpegEncContext *s, const uint8_t *buf,
309
                                   int buf_size)
310
{
311
    struct vdpau_render_state *render, *last, *next;
312
    int i;
313

  
314
    if (!s->current_picture_ptr) return;
315

  
316
    render = (struct vdpau_render_state *)s->current_picture_ptr->data[0];
317
    assert(render);
318

  
319
    /* fill VdpPictureInfoMPEG4Part2 struct */
320
    render->info.mpeg4.vop_time_increment_resolution     = s->avctx->time_base.den;
321
    render->info.mpeg4.vop_coding_type                   = 0;
322
    render->info.mpeg4.vop_fcode_forward                 = s->f_code;
323
    render->info.mpeg4.vop_fcode_backward                = s->b_code;
324
    render->info.mpeg4.resync_marker_disable             = !s->resync_marker;
325
    render->info.mpeg4.interlaced                        = !s->progressive_sequence;
326
    render->info.mpeg4.quant_type                        = s->mpeg_quant;
327
    render->info.mpeg4.quarter_sample                    = s->quarter_sample;
328
    render->info.mpeg4.short_video_header                = s->avctx->codec->id == CODEC_ID_H263;
329
    render->info.mpeg4.rounding_control                  = s->no_rounding;
330
    render->info.mpeg4.alternate_vertical_scan_flag      = s->alternate_scan;
331
    render->info.mpeg4.top_field_first                   = s->top_field_first;
332
    for (i = 0; i < 64; ++i) {
333
        render->info.mpeg4.intra_quantizer_matrix[i]     = s->intra_matrix[i];
334
        render->info.mpeg4.non_intra_quantizer_matrix[i] = s->inter_matrix[i];
335
    }
336
    render->info.mpeg4.forward_reference                 = VDP_INVALID_HANDLE;
337
    render->info.mpeg4.backward_reference                = VDP_INVALID_HANDLE;
338

  
339
    switch (s->pict_type) {
340
    case FF_B_TYPE:
341
        next = (struct vdpau_render_state *)s->next_picture.data[0];
342
        assert(next);
343
        render->info.mpeg4.backward_reference     = next->surface;
344
        render->info.mpeg4.vop_coding_type        = 2;
345
        // no break here, going to set forward prediction
346
    case FF_P_TYPE:
347
        last = (struct vdpau_render_state *)s->last_picture.data[0];
348
        assert(last);
349
        render->info.mpeg4.forward_reference      = last->surface;
350
    }
351

  
352
    ff_vdpau_add_data_chunk(s, buf, buf_size);
353

  
354
    ff_draw_horiz_band(s, 0, s->avctx->height);
355
    render->bitstream_buffers_used = 0;
356
}
357

  
308 358
/* @}*/

Also available in: Unified diff