*/
void ff_xvmc_init_block(MpegEncContext *s)
{
- struct xvmc_pix_fmt *render = (struct xvmc_pix_fmt*)s->current_picture.data[2];
+ struct xvmc_pix_fmt *render = (struct xvmc_pix_fmt*)s->current_picture.f.data[2];
assert(render && render->xvmc_id == AV_XVMC_ID);
s->block = (DCTELEM (*)[64])(render->data_blocks + render->next_free_data_block_num * 64);
*/
int ff_xvmc_field_start(MpegEncContext *s, AVCodecContext *avctx)
{
- struct xvmc_pix_fmt *last, *next, *render = (struct xvmc_pix_fmt*)s->current_picture.data[2];
+ struct xvmc_pix_fmt *last, *next, *render = (struct xvmc_pix_fmt*)s->current_picture.f.data[2];
const int mb_block_count = 4 + (1 << s->chroma_format);
assert(avctx);
case AV_PICTURE_TYPE_I:
return 0; // no prediction from other frames
case AV_PICTURE_TYPE_B:
- next = (struct xvmc_pix_fmt*)s->next_picture.data[2];
+ next = (struct xvmc_pix_fmt*)s->next_picture.f.data[2];
if (!next)
return -1;
if (next->xvmc_id != AV_XVMC_ID)
render->p_future_surface = next->p_surface;
// no return here, going to set forward prediction
case AV_PICTURE_TYPE_P:
- last = (struct xvmc_pix_fmt*)s->last_picture.data[2];
+ last = (struct xvmc_pix_fmt*)s->last_picture.f.data[2];
if (!last)
last = render; // predict second field from the first
if (last->xvmc_id != AV_XVMC_ID)
*/
void ff_xvmc_field_end(MpegEncContext *s)
{
- struct xvmc_pix_fmt *render = (struct xvmc_pix_fmt*)s->current_picture.data[2];
+ struct xvmc_pix_fmt *render = (struct xvmc_pix_fmt*)s->current_picture.f.data[2];
assert(render);
if (render->filled_mv_blocks_num > 0)
// Do I need to export quant when I could not perform postprocessing?
// Anyway, it doesn't hurt.
- s->current_picture.qscale_table[mb_xy] = s->qscale;
+ s->current_picture.f.qscale_table[mb_xy] = s->qscale;
// start of XVMC-specific code
- render = (struct xvmc_pix_fmt*)s->current_picture.data[2];
+ render = (struct xvmc_pix_fmt*)s->current_picture.f.data[2];
assert(render);
assert(render->xvmc_id == AV_XVMC_ID);
assert(render->mv_blocks);
int pic_structure)
{
if (pic_structure == 0)
- pic_structure = pic->reference;
+ pic_structure = pic->f.reference;
pic_structure &= PICT_FRAME; /* PICT_TOP_FIELD|PICT_BOTTOM_FIELD */
va_pic->picture_id = ff_vaapi_get_surface_id(pic);
va_pic->flags = 0;
if (pic_structure != PICT_FRAME)
va_pic->flags |= (pic_structure & PICT_TOP_FIELD) ? VA_PICTURE_H264_TOP_FIELD : VA_PICTURE_H264_BOTTOM_FIELD;
- if (pic->reference)
+ if (pic->f.reference)
va_pic->flags |= pic->long_ref ? VA_PICTURE_H264_LONG_TERM_REFERENCE : VA_PICTURE_H264_SHORT_TERM_REFERENCE;
va_pic->TopFieldOrderCnt = 0;
for (i = 0; i < h->short_ref_count; i++) {
Picture * const pic = h->short_ref[i];
- if (pic && pic->reference && dpb_add(&dpb, pic) < 0)
+ if (pic && pic->f.reference && dpb_add(&dpb, pic) < 0)
return -1;
}
for (i = 0; i < 16; i++) {
Picture * const pic = h->long_ref[i];
- if (pic && pic->reference && dpb_add(&dpb, pic) < 0)
+ if (pic && pic->f.reference && dpb_add(&dpb, pic) < 0)
return -1;
}
return 0;
{
unsigned int i, n = 0;
for (i = 0; i < ref_count; i++)
- if (ref_list[i].reference)
+ if (ref_list[i].f.reference)
fill_vaapi_pic(&RefPicList[n++], &ref_list[i], 0);
for (; n < 32; n++)
Picture *pic;
int i, list, pic_frame_idx;
- render = (struct vdpau_render_state *)s->current_picture_ptr->data[0];
+ render = (struct vdpau_render_state *)s->current_picture_ptr->f.data[0];
assert(render);
rf = &render->info.h264.referenceFrames[0];
for (i = 0; i < ls; ++i) {
pic = lp[i];
- if (!pic || !pic->reference)
+ if (!pic || !pic->f.reference)
continue;
pic_frame_idx = pic->long_ref ? pic->pic_id : pic->frame_num;
- render_ref = (struct vdpau_render_state *)pic->data[0];
+ render_ref = (struct vdpau_render_state *)pic->f.data[0];
assert(render_ref);
rf2 = &render->info.h264.referenceFrames[0];
++rf2;
}
if (rf2 != rf) {
- rf2->top_is_reference |= (pic->reference & PICT_TOP_FIELD) ? VDP_TRUE : VDP_FALSE;
- rf2->bottom_is_reference |= (pic->reference & PICT_BOTTOM_FIELD) ? VDP_TRUE : VDP_FALSE;
+ rf2->top_is_reference |= (pic->f.reference & PICT_TOP_FIELD) ? VDP_TRUE : VDP_FALSE;
+ rf2->bottom_is_reference |= (pic->f.reference & PICT_BOTTOM_FIELD) ? VDP_TRUE : VDP_FALSE;
continue;
}
rf->surface = render_ref->surface;
rf->is_long_term = pic->long_ref;
- rf->top_is_reference = (pic->reference & PICT_TOP_FIELD) ? VDP_TRUE : VDP_FALSE;
- rf->bottom_is_reference = (pic->reference & PICT_BOTTOM_FIELD) ? VDP_TRUE : VDP_FALSE;
+ rf->top_is_reference = (pic->f.reference & PICT_TOP_FIELD) ? VDP_TRUE : VDP_FALSE;
+ rf->bottom_is_reference = (pic->f.reference & PICT_BOTTOM_FIELD) ? VDP_TRUE : VDP_FALSE;
rf->field_order_cnt[0] = pic->field_poc[0];
rf->field_order_cnt[1] = pic->field_poc[1];
rf->frame_idx = pic_frame_idx;
{
struct vdpau_render_state *render;
- render = (struct vdpau_render_state *)s->current_picture_ptr->data[0];
+ render = (struct vdpau_render_state *)s->current_picture_ptr->f.data[0];
assert(render);
render->bitstream_buffers= av_fast_realloc(
struct vdpau_render_state *render;
int i;
- render = (struct vdpau_render_state *)s->current_picture_ptr->data[0];
+ render = (struct vdpau_render_state *)s->current_picture_ptr->f.data[0];
assert(render);
for (i = 0; i < 2; ++i) {
H264Context *h = s->avctx->priv_data;
struct vdpau_render_state *render;
- render = (struct vdpau_render_state *)s->current_picture_ptr->data[0];
+ render = (struct vdpau_render_state *)s->current_picture_ptr->f.data[0];
assert(render);
render->info.h264.slice_count = h->slice_num;
if (render->info.h264.slice_count < 1)
return;
- render->info.h264.is_reference = (s->current_picture_ptr->reference & 3) ? VDP_TRUE : VDP_FALSE;
+ render->info.h264.is_reference = (s->current_picture_ptr->f.reference & 3) ? VDP_TRUE : VDP_FALSE;
render->info.h264.field_pic_flag = s->picture_structure != PICT_FRAME;
render->info.h264.bottom_field_flag = s->picture_structure == PICT_BOTTOM_FIELD;
render->info.h264.num_ref_frames = h->sps.ref_frame_count;
if (!s->current_picture_ptr) return;
- render = (struct vdpau_render_state *)s->current_picture_ptr->data[0];
+ render = (struct vdpau_render_state *)s->current_picture_ptr->f.data[0];
assert(render);
/* fill VdpPictureInfoMPEG1Or2 struct */
switch(s->pict_type){
case AV_PICTURE_TYPE_B:
- next = (struct vdpau_render_state *)s->next_picture.data[0];
+ next = (struct vdpau_render_state *)s->next_picture.f.data[0];
assert(next);
render->info.mpeg.backward_reference = next->surface;
// no return here, going to set forward prediction
case AV_PICTURE_TYPE_P:
- last = (struct vdpau_render_state *)s->last_picture.data[0];
+ last = (struct vdpau_render_state *)s->last_picture.f.data[0];
if (!last) // FIXME: Does this test make sense?
last = render; // predict second field from the first
render->info.mpeg.forward_reference = last->surface;
VC1Context *v = s->avctx->priv_data;
struct vdpau_render_state *render, *last, *next;
- render = (struct vdpau_render_state *)s->current_picture.data[0];
+ render = (struct vdpau_render_state *)s->current_picture.f.data[0];
assert(render);
/* fill LvPictureInfoVC1 struct */
switch(s->pict_type){
case AV_PICTURE_TYPE_B:
- next = (struct vdpau_render_state *)s->next_picture.data[0];
+ next = (struct vdpau_render_state *)s->next_picture.f.data[0];
assert(next);
render->info.vc1.backward_reference = next->surface;
// no break here, going to set forward prediction
case AV_PICTURE_TYPE_P:
- last = (struct vdpau_render_state *)s->last_picture.data[0];
+ last = (struct vdpau_render_state *)s->last_picture.f.data[0];
if (!last) // FIXME: Does this test make sense?
last = render; // predict second field from the first
render->info.vc1.forward_reference = last->surface;
if (!s->current_picture_ptr) return;
- render = (struct vdpau_render_state *)s->current_picture_ptr->data[0];
+ render = (struct vdpau_render_state *)s->current_picture_ptr->f.data[0];
assert(render);
/* fill VdpPictureInfoMPEG4Part2 struct */
switch (s->pict_type) {
case AV_PICTURE_TYPE_B:
- next = (struct vdpau_render_state *)s->next_picture.data[0];
+ next = (struct vdpau_render_state *)s->next_picture.f.data[0];
assert(next);
render->info.mpeg4.backward_reference = next->surface;
render->info.mpeg4.vop_coding_type = 2;
// no break here, going to set forward prediction
case AV_PICTURE_TYPE_P:
- last = (struct vdpau_render_state *)s->last_picture.data[0];
+ last = (struct vdpau_render_state *)s->last_picture.f.data[0];
assert(last);
render->info.mpeg4.forward_reference = last->surface;
}