657ccb5ac7]
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>tags/n0.9
| @@ -24,7 +24,7 @@ | |||||
| void *ff_dxva2_get_surface(const Picture *picture) | void *ff_dxva2_get_surface(const Picture *picture) | ||||
| { | { | ||||
| return picture->data[3]; | |||||
| return picture->f.data[3]; | |||||
| } | } | ||||
| unsigned ff_dxva2_get_surface_index(const struct dxva_context *ctx, | unsigned ff_dxva2_get_surface_index(const struct dxva_context *ctx, | ||||
| @@ -70,15 +70,15 @@ static void fill_picture_parameters(struct dxva_context *ctx, const H264Context | |||||
| ff_dxva2_get_surface_index(ctx, r), | ff_dxva2_get_surface_index(ctx, r), | ||||
| r->long_ref != 0); | r->long_ref != 0); | ||||
| if ((r->reference & PICT_TOP_FIELD) && r->field_poc[0] != INT_MAX) | |||||
| if ((r->f.reference & PICT_TOP_FIELD) && r->field_poc[0] != INT_MAX) | |||||
| pp->FieldOrderCntList[i][0] = r->field_poc[0]; | pp->FieldOrderCntList[i][0] = r->field_poc[0]; | ||||
| if ((r->reference & PICT_BOTTOM_FIELD) && r->field_poc[1] != INT_MAX) | |||||
| if ((r->f.reference & PICT_BOTTOM_FIELD) && r->field_poc[1] != INT_MAX) | |||||
| pp->FieldOrderCntList[i][1] = r->field_poc[1]; | pp->FieldOrderCntList[i][1] = r->field_poc[1]; | ||||
| pp->FrameNumList[i] = r->long_ref ? r->pic_id : r->frame_num; | pp->FrameNumList[i] = r->long_ref ? r->pic_id : r->frame_num; | ||||
| if (r->reference & PICT_TOP_FIELD) | |||||
| if (r->f.reference & PICT_TOP_FIELD) | |||||
| pp->UsedForReferenceFlags |= 1 << (2*i + 0); | pp->UsedForReferenceFlags |= 1 << (2*i + 0); | ||||
| if (r->reference & PICT_BOTTOM_FIELD) | |||||
| if (r->f.reference & PICT_BOTTOM_FIELD) | |||||
| pp->UsedForReferenceFlags |= 1 << (2*i + 1); | pp->UsedForReferenceFlags |= 1 << (2*i + 1); | ||||
| } else { | } else { | ||||
| pp->RefFrameList[i].bPicEntry = 0xff; | pp->RefFrameList[i].bPicEntry = 0xff; | ||||
| @@ -216,7 +216,7 @@ static void fill_slice_long(AVCodecContext *avctx, DXVA_Slice_H264_Long *slice, | |||||
| unsigned plane; | unsigned plane; | ||||
| fill_picture_entry(&slice->RefPicList[list][i], | fill_picture_entry(&slice->RefPicList[list][i], | ||||
| ff_dxva2_get_surface_index(ctx, r), | ff_dxva2_get_surface_index(ctx, r), | ||||
| r->reference == PICT_BOTTOM_FIELD); | |||||
| r->f.reference == PICT_BOTTOM_FIELD); | |||||
| for (plane = 0; plane < 3; plane++) { | for (plane = 0; plane < 3; plane++) { | ||||
| int w, o; | int w, o; | ||||
| if (plane == 0 && h->luma_weight_flag[list]) { | if (plane == 0 && h->luma_weight_flag[list]) { | ||||
| @@ -265,7 +265,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, | |||||
| const unsigned mb_count = s->mb_width * s->mb_height; | const unsigned mb_count = s->mb_width * s->mb_height; | ||||
| struct dxva_context *ctx = avctx->hwaccel_context; | struct dxva_context *ctx = avctx->hwaccel_context; | ||||
| const Picture *current_picture = h->s.current_picture_ptr; | const Picture *current_picture = h->s.current_picture_ptr; | ||||
| struct dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private; | |||||
| struct dxva2_picture_context *ctx_pic = current_picture->f.hwaccel_picture_private; | |||||
| DXVA_Slice_H264_Short *slice = NULL; | DXVA_Slice_H264_Short *slice = NULL; | ||||
| uint8_t *dxva_data, *current, *end; | uint8_t *dxva_data, *current, *end; | ||||
| unsigned dxva_size; | unsigned dxva_size; | ||||
| @@ -360,7 +360,7 @@ static int start_frame(AVCodecContext *avctx, | |||||
| { | { | ||||
| const H264Context *h = avctx->priv_data; | const H264Context *h = avctx->priv_data; | ||||
| struct dxva_context *ctx = avctx->hwaccel_context; | struct dxva_context *ctx = avctx->hwaccel_context; | ||||
| struct dxva2_picture_context *ctx_pic = h->s.current_picture_ptr->hwaccel_picture_private; | |||||
| struct dxva2_picture_context *ctx_pic = h->s.current_picture_ptr->f.hwaccel_picture_private; | |||||
| if (!ctx->decoder || !ctx->cfg || ctx->surface_count <= 0) | if (!ctx->decoder || !ctx->cfg || ctx->surface_count <= 0) | ||||
| return -1; | return -1; | ||||
| @@ -384,7 +384,7 @@ static int decode_slice(AVCodecContext *avctx, | |||||
| const H264Context *h = avctx->priv_data; | const H264Context *h = avctx->priv_data; | ||||
| struct dxva_context *ctx = avctx->hwaccel_context; | struct dxva_context *ctx = avctx->hwaccel_context; | ||||
| const Picture *current_picture = h->s.current_picture_ptr; | const Picture *current_picture = h->s.current_picture_ptr; | ||||
| struct dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private; | |||||
| struct dxva2_picture_context *ctx_pic = current_picture->f.hwaccel_picture_private; | |||||
| unsigned position; | unsigned position; | ||||
| if (ctx_pic->slice_count >= MAX_SLICES) | if (ctx_pic->slice_count >= MAX_SLICES) | ||||
| @@ -413,7 +413,7 @@ static int end_frame(AVCodecContext *avctx) | |||||
| H264Context *h = avctx->priv_data; | H264Context *h = avctx->priv_data; | ||||
| MpegEncContext *s = &h->s; | MpegEncContext *s = &h->s; | ||||
| struct dxva2_picture_context *ctx_pic = | struct dxva2_picture_context *ctx_pic = | ||||
| h->s.current_picture_ptr->hwaccel_picture_private; | |||||
| h->s.current_picture_ptr->f.hwaccel_picture_private; | |||||
| if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) | if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) | ||||
| return -1; | return -1; | ||||
| @@ -151,7 +151,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, | |||||
| const struct MpegEncContext *s = avctx->priv_data; | const struct MpegEncContext *s = avctx->priv_data; | ||||
| struct dxva_context *ctx = avctx->hwaccel_context; | struct dxva_context *ctx = avctx->hwaccel_context; | ||||
| struct dxva2_picture_context *ctx_pic = | struct dxva2_picture_context *ctx_pic = | ||||
| s->current_picture_ptr->hwaccel_picture_private; | |||||
| s->current_picture_ptr->f.hwaccel_picture_private; | |||||
| const int is_field = s->picture_structure != PICT_FRAME; | const int is_field = s->picture_structure != PICT_FRAME; | ||||
| const unsigned mb_count = s->mb_width * (s->mb_height >> is_field); | const unsigned mb_count = s->mb_width * (s->mb_height >> is_field); | ||||
| uint8_t *dxva_data, *current, *end; | uint8_t *dxva_data, *current, *end; | ||||
| @@ -210,7 +210,7 @@ static int start_frame(AVCodecContext *avctx, | |||||
| const struct MpegEncContext *s = avctx->priv_data; | const struct MpegEncContext *s = avctx->priv_data; | ||||
| struct dxva_context *ctx = avctx->hwaccel_context; | struct dxva_context *ctx = avctx->hwaccel_context; | ||||
| struct dxva2_picture_context *ctx_pic = | struct dxva2_picture_context *ctx_pic = | ||||
| s->current_picture_ptr->hwaccel_picture_private; | |||||
| s->current_picture_ptr->f.hwaccel_picture_private; | |||||
| if (!ctx->decoder || !ctx->cfg || ctx->surface_count <= 0) | if (!ctx->decoder || !ctx->cfg || ctx->surface_count <= 0) | ||||
| return -1; | return -1; | ||||
| @@ -230,7 +230,7 @@ static int decode_slice(AVCodecContext *avctx, | |||||
| { | { | ||||
| const struct MpegEncContext *s = avctx->priv_data; | const struct MpegEncContext *s = avctx->priv_data; | ||||
| struct dxva2_picture_context *ctx_pic = | struct dxva2_picture_context *ctx_pic = | ||||
| s->current_picture_ptr->hwaccel_picture_private; | |||||
| s->current_picture_ptr->f.hwaccel_picture_private; | |||||
| unsigned position; | unsigned position; | ||||
| if (ctx_pic->slice_count >= MAX_SLICES) | if (ctx_pic->slice_count >= MAX_SLICES) | ||||
| @@ -250,7 +250,7 @@ static int end_frame(AVCodecContext *avctx) | |||||
| { | { | ||||
| struct MpegEncContext *s = avctx->priv_data; | struct MpegEncContext *s = avctx->priv_data; | ||||
| struct dxva2_picture_context *ctx_pic = | struct dxva2_picture_context *ctx_pic = | ||||
| s->current_picture_ptr->hwaccel_picture_private; | |||||
| s->current_picture_ptr->f.hwaccel_picture_private; | |||||
| if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) | if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) | ||||
| return -1; | return -1; | ||||
| @@ -161,7 +161,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, | |||||
| const VC1Context *v = avctx->priv_data; | const VC1Context *v = avctx->priv_data; | ||||
| struct dxva_context *ctx = avctx->hwaccel_context; | struct dxva_context *ctx = avctx->hwaccel_context; | ||||
| const MpegEncContext *s = &v->s; | const MpegEncContext *s = &v->s; | ||||
| struct dxva2_picture_context *ctx_pic = s->current_picture_ptr->hwaccel_picture_private; | |||||
| struct dxva2_picture_context *ctx_pic = s->current_picture_ptr->f.hwaccel_picture_private; | |||||
| DXVA_SliceInfo *slice = &ctx_pic->si; | DXVA_SliceInfo *slice = &ctx_pic->si; | ||||
| @@ -213,7 +213,7 @@ static int start_frame(AVCodecContext *avctx, | |||||
| { | { | ||||
| const VC1Context *v = avctx->priv_data; | const VC1Context *v = avctx->priv_data; | ||||
| struct dxva_context *ctx = avctx->hwaccel_context; | struct dxva_context *ctx = avctx->hwaccel_context; | ||||
| struct dxva2_picture_context *ctx_pic = v->s.current_picture_ptr->hwaccel_picture_private; | |||||
| struct dxva2_picture_context *ctx_pic = v->s.current_picture_ptr->f.hwaccel_picture_private; | |||||
| if (!ctx->decoder || !ctx->cfg || ctx->surface_count <= 0) | if (!ctx->decoder || !ctx->cfg || ctx->surface_count <= 0) | ||||
| return -1; | return -1; | ||||
| @@ -231,7 +231,7 @@ static int decode_slice(AVCodecContext *avctx, | |||||
| { | { | ||||
| const VC1Context *v = avctx->priv_data; | const VC1Context *v = avctx->priv_data; | ||||
| const Picture *current_picture = v->s.current_picture_ptr; | const Picture *current_picture = v->s.current_picture_ptr; | ||||
| struct dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private; | |||||
| struct dxva2_picture_context *ctx_pic = current_picture->f.hwaccel_picture_private; | |||||
| if (ctx_pic->bitstream_size > 0) | if (ctx_pic->bitstream_size > 0) | ||||
| return -1; | return -1; | ||||
| @@ -252,7 +252,7 @@ static int decode_slice(AVCodecContext *avctx, | |||||
| static int end_frame(AVCodecContext *avctx) | static int end_frame(AVCodecContext *avctx) | ||||
| { | { | ||||
| VC1Context *v = avctx->priv_data; | VC1Context *v = avctx->priv_data; | ||||
| struct dxva2_picture_context *ctx_pic = v->s.current_picture_ptr->hwaccel_picture_private; | |||||
| struct dxva2_picture_context *ctx_pic = v->s.current_picture_ptr->f.hwaccel_picture_private; | |||||
| if (ctx_pic->bitstream_size <= 0) | if (ctx_pic->bitstream_size <= 0) | ||||
| return -1; | return -1; | ||||