MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / vaapi_mpeg4_start_frame

Function vaapi_mpeg4_start_frame

libavcodec/vaapi_mpeg4.c:48–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48static int vaapi_mpeg4_start_frame(AVCodecContext *avctx,
49 av_unused const AVBufferRef *buffer_ref,
50 av_unused const uint8_t *buffer,
51 av_unused uint32_t size)
52{
53 Mpeg4DecContext *ctx = avctx->priv_data;
54 MPVContext *const s = &ctx->h.c;
55 VAAPIDecodePicture *pic = s->cur_pic.ptr->hwaccel_picture_private;
56 VAPictureParameterBufferMPEG4 pic_param;
57 int i, err;
58
59 pic->output_surface = ff_vaapi_get_surface_id(s->cur_pic.ptr->f);
60
61 pic_param = (VAPictureParameterBufferMPEG4) {
62 .vop_width = s->width,
63 .vop_height = s->height,
64 .forward_reference_picture = VA_INVALID_ID,
65 .backward_reference_picture = VA_INVALID_ID,
66 .vol_fields.bits = {
67 .short_video_header = avctx->codec->id == AV_CODEC_ID_H263,
68 .chroma_format = CHROMA_420,
69 .interlaced = !s->progressive_sequence,
70 .obmc_disable = 1,
71 .sprite_enable = ctx->vol_sprite_usage,
72 .sprite_warping_accuracy = ctx->sprite_warping_accuracy,
73 .quant_type = ctx->mpeg_quant,
74 .quarter_sample = s->quarter_sample,
75 .data_partitioned = ctx->h.data_partitioning,
76 .reversible_vlc = ctx->rvlc,
77 .resync_marker_disable = !ctx->resync_marker,
78 },
79 .no_of_sprite_warping_points = ctx->num_sprite_warping_points,
80 .quant_precision = ctx->quant_precision,
81 .vop_fields.bits = {
82 .vop_coding_type = s->pict_type - AV_PICTURE_TYPE_I,
83 .backward_reference_vop_coding_type =
84 s->pict_type == AV_PICTURE_TYPE_B ? s->next_pic.ptr->f->pict_type - AV_PICTURE_TYPE_I : 0,
85 .vop_rounding_type = s->no_rounding,
86 .intra_dc_vlc_thr = mpeg4_get_intra_dc_vlc_thr(ctx),
87 .top_field_first = s->top_field_first,
88 .alternate_vertical_scan_flag = s->alternate_scan,
89 },
90 .vop_fcode_forward = ctx->f_code,
91 .vop_fcode_backward = ctx->b_code,
92 .vop_time_increment_resolution = avctx->framerate.num,
93 .num_macroblocks_in_gob = s->mb_width * H263_GOB_HEIGHT(s->height),
94 .num_gobs_in_vop =
95 (s->mb_width * s->mb_height) / (s->mb_width * H263_GOB_HEIGHT(s->height)),
96 .TRB = s->pb_time,
97 .TRD = s->pp_time,
98 };
99
100 for (i = 0; i < ctx->num_sprite_warping_points && i < 3; i++) {
101 pic_param.sprite_trajectory_du[i] = ctx->sprite_traj[i][0];
102 pic_param.sprite_trajectory_dv[i] = ctx->sprite_traj[i][1];
103 }
104
105 if (s->pict_type == AV_PICTURE_TYPE_B)

Callers

nothing calls this directly

Calls 4

ff_vaapi_get_surface_idFunction · 0.85
ff_vaapi_decode_cancelFunction · 0.85

Tested by

no test coverage detected