40 dst->PicIdx = cf ? cf->idx : -1;
41 dst->FrameIdx = frame_idx;
42 dst->is_long_term =
src->long_ref;
43 dst->not_existing = 0;
44 dst->used_for_reference =
src->reference & 3;
45 dst->FieldOrderCnt[0] =
src->field_poc[0];
46 dst->FieldOrderCnt[1] =
src->field_poc[1];
57 CUVIDPICPARAMS *pp = &
ctx->pic_params;
58 CUVIDH264PICPARAMS *ppc = &pp->CodecSpecific.h264;
71 *pp = (CUVIDPICPARAMS) {
72 .PicWidthInMbs =
h->mb_width,
73 .FrameHeightInMbs =
h->mb_height,
74 .CurrPicIdx = cf->
idx,
78 .ref_pic_flag =
h->nal_ref_idc != 0,
81 .CodecSpecific.h264 = {
82 .log2_max_frame_num_minus4 =
sps->log2_max_frame_num - 4,
83 .pic_order_cnt_type =
sps->poc_type,
84 .log2_max_pic_order_cnt_lsb_minus4 =
FFMAX(
sps->log2_max_poc_lsb - 4, 0),
85 .delta_pic_order_always_zero_flag =
sps->delta_pic_order_always_zero_flag,
86 .frame_mbs_only_flag =
sps->frame_mbs_only_flag,
87 .direct_8x8_inference_flag =
sps->direct_8x8_inference_flag,
88 .num_ref_frames =
sps->ref_frame_count,
89 .residual_colour_transform_flag =
sps->residual_color_transform_flag,
90 .bit_depth_luma_minus8 =
sps->bit_depth_luma - 8,
91 .bit_depth_chroma_minus8 =
sps->bit_depth_chroma - 8,
92 .qpprime_y_zero_transform_bypass_flag =
sps->transform_bypass,
94 .entropy_coding_mode_flag =
pps->cabac,
95 .pic_order_present_flag =
pps->pic_order_present,
96 .num_ref_idx_l0_active_minus1 =
pps->ref_count[0] - 1,
97 .num_ref_idx_l1_active_minus1 =
pps->ref_count[1] - 1,
98 .weighted_pred_flag =
pps->weighted_pred,
99 .weighted_bipred_idc =
pps->weighted_bipred_idc,
100 .pic_init_qp_minus26 =
pps->init_qp - 26,
101 .deblocking_filter_control_present_flag =
pps->deblocking_filter_parameters_present,
102 .redundant_pic_cnt_present_flag =
pps->redundant_pic_cnt_present,
103 .transform_8x8_mode_flag =
pps->transform_8x8_mode,
105 .constrained_intra_pred_flag =
pps->constrained_intra_pred,
106 .chroma_qp_index_offset =
pps->chroma_qp_index_offset[0],
107 .second_chroma_qp_index_offset =
pps->chroma_qp_index_offset[1],
108 .ref_pic_flag =
h->nal_ref_idc != 0,
109 .frame_num =
h->poc.frame_num,
110 .CurrFieldOrderCnt[0] =
h->cur_pic_ptr->field_poc[0],
111 .CurrFieldOrderCnt[1] =
h->cur_pic_ptr->field_poc[1],
115 memcpy(ppc->WeightScale4x4,
pps->scaling_matrix4,
sizeof(ppc->WeightScale4x4));
116 memcpy(ppc->WeightScale8x8[0],
pps->scaling_matrix8[0],
sizeof(ppc->WeightScale8x8[0]));
117 memcpy(ppc->WeightScale8x8[1],
pps->scaling_matrix8[3],
sizeof(ppc->WeightScale8x8[0]));
120 for (
i = 0;
i <
h->short_ref_count;
i++)
122 for (
i = 0;
i < 16;
i++) {
128 ppc->dpb[
i].PicIdx = -1;
137 CUVIDPICPARAMS *pp = &
ctx->pic_params;
143 ctx->bitstream_len +
size + 3);
146 ctx->bitstream =
ctx->bitstream_internal =
tmp;
149 (
ctx->nb_slices + 1) *
sizeof(*
ctx->slice_offsets));
156 ctx->slice_offsets[
ctx->nb_slices] =
ctx->bitstream_len ;
157 ctx->bitstream_len +=
size + 3;
161 pp->intra_pic_flag = 0;
175 .
p.
name =
"h264_nvdec",