48 CUVIDPICPARAMS *pp = &
ctx->pic_params;
49 CUVIDAV1PICPARAMS *ppc = &pp->CodecSpecific.av1;
52 AVFrame *cur_frame =
s->cur_frame.tf.f;
66 *pp = (CUVIDPICPARAMS) {
67 .PicWidthInMbs = (cur_frame->
width + 15) / 16,
68 .FrameHeightInMbs = (cur_frame->
height + 15) / 16,
69 .CurrPicIdx = cf->
idx,
74 .CodecSpecific.av1 = {
75 .width = cur_frame->
width,
76 .height = cur_frame->
height,
106 .allow_screen_content_tools =
frame_header->allow_screen_content_tools,
112 .allow_high_precision_mv =
frame_header->allow_high_precision_mv,
114 .switchable_motion_mode =
frame_header->is_motion_mode_switchable,
116 .disable_frame_end_update_cdf =
frame_header->disable_frame_end_update_cdf,
120 .coded_lossless =
s->cur_frame.coded_lossless,
124 .allow_warped_motion =
frame_header->allow_warped_motion,
131 .context_update_tile_id =
frame_header->context_update_tile_id,
134 .cdef_damping_minus_3 =
frame_header->cdef_damping_minus_3,
139 s->cur_frame.skip_mode_frame_idx[0] : 0,
141 s->cur_frame.skip_mode_frame_idx[1] : 0,
155 .segmentation_enabled =
frame_header->segmentation_enabled,
156 .segmentation_update_map =
frame_header->segmentation_update_map,
157 .segmentation_update_data =
frame_header->segmentation_update_data,
158 .segmentation_temporal_update =
frame_header->segmentation_temporal_update,
161 .loop_filter_level[0] =
frame_header->loop_filter_level[0],
162 .loop_filter_level[1] =
frame_header->loop_filter_level[1],
163 .loop_filter_level_u =
frame_header->loop_filter_level[2],
164 .loop_filter_level_v =
frame_header->loop_filter_level[3],
165 .loop_filter_sharpness =
frame_header->loop_filter_sharpness,
166 .loop_filter_delta_enabled =
frame_header->loop_filter_delta_enabled,
167 .loop_filter_delta_update =
frame_header->loop_filter_delta_update,
168 .loop_filter_mode_deltas[0] =
frame_header->loop_filter_mode_deltas[0],
169 .loop_filter_mode_deltas[1] =
frame_header->loop_filter_mode_deltas[1],
183 .temporal_layer_id =
s->cur_frame.temporal_id,
184 .spatial_layer_id =
s->cur_frame.spatial_id,
187 .apply_grain = apply_grain,
199 .cb_mult = film_grain->
cb_mult,
202 .cr_mult = film_grain->
cr_mult,
213 ppc->tile_heights[
i] =
frame_header->height_in_sbs_minus_1[
i] + 1;
224 ppc->segmentation_feature_mask[
i] = 0;
226 ppc->segmentation_feature_mask[
i] |=
frame_header->feature_enabled[
i][j] << j;
227 ppc->segmentation_feature_data[
i][j] =
frame_header->feature_value[
i][j];
233 ppc->loop_filter_ref_deltas[
i] =
frame_header->loop_filter_ref_deltas[
i];
240 ppc->primary_ref_frame = -1;
243 ppc->primary_ref_frame = ppc->ref_frame_map[pri_ref_idx];
249 AVFrame *ref_frame =
s->ref[ref_idx].tf.f;
251 ppc->ref_frame[
i].index = ppc->ref_frame_map[ref_idx];
252 ppc->ref_frame[
i].width = ref_frame->
width;
253 ppc->ref_frame[
i].height = ref_frame->
height;
258 for (j = 0; j < 6; ++j) {
265 for (
i = 0;
i < 14; ++
i) {
269 for (
i = 0;
i < 10; ++
i) {
275 for (
i = 0;
i < 24; ++
i) {
278 for (
i = 0;
i < 25; ++
i) {
297 ctx->nb_slices * 2 *
sizeof(*
ctx->slice_offsets));
304 if (
ctx->nb_slices ==
s->tg_end -
s->tg_start + 1) {
308 for (
int i = 0;
i <
ctx->nb_slices; ++
i) {
309 ctx->slice_offsets[
i*2 ] =
s->tile_group_info[
i].tile_offset;
310 ctx->slice_offsets[
i*2 + 1] =
ctx->slice_offsets[
i*2] +
s->tile_group_info[
i].tile_size;
321 ctx->bitstream =
ctx->bitstream_internal =
tmp;
325 for (uint32_t tile_num =
s->tg_start; tile_num <= s->tg_end; ++tile_num) {
326 ctx->slice_offsets[tile_num*2 ] =
ctx->bitstream_len +
s->tile_group_info[tile_num].tile_offset;
327 ctx->slice_offsets[tile_num*2 + 1] =
ctx->slice_offsets[tile_num*2] +
s->tile_group_info[tile_num].tile_size;