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