39 pp->RefPicIdx[idx] = cf ? cf->idx : -1;
40 pp->PicOrderCntVal[idx] =
src->poc;
46 const ScalingList *sl =
s->ps.pps->scaling_list_data_present_flag ?
47 &
s->ps.pps->scaling_list : &
s->ps.sps->scaling_list;
50 for (
i = 0;
i < 6;
i++) {
51 for (j = 0; j < 16; j++) {
53 ppc->ScalingList4x4[
i][j] = sl->
sl[0][
i][
pos];
56 for (j = 0; j < 64; j++) {
58 ppc->ScalingList8x8[
i][j] = sl->
sl[1][
i][
pos];
59 ppc->ScalingList16x16[
i][j] = sl->
sl[2][
i][
pos];
62 ppc->ScalingList32x32[
i][j] = sl->
sl[3][
i * 3][
pos];
65 ppc->ScalingListDCCoeff16x16[
i] = sl->
sl_dc[0][
i];
67 ppc->ScalingListDCCoeff32x32[
i] = sl->
sl_dc[1][
i * 3];
79 CUVIDPICPARAMS *pp = &
ctx->pic_params;
80 CUVIDHEVCPICPARAMS *ppc = &pp->CodecSpecific.hevc;
93 *pp = (CUVIDPICPARAMS) {
94 .PicWidthInMbs =
sps->width / 16,
95 .FrameHeightInMbs =
sps->height / 16,
96 .CurrPicIdx = cf->
idx,
100 .CodecSpecific.hevc = {
101 .pic_width_in_luma_samples =
sps->width,
102 .pic_height_in_luma_samples =
sps->height,
103 .log2_min_luma_coding_block_size_minus3 =
sps->log2_min_cb_size - 3,
104 .log2_diff_max_min_luma_coding_block_size =
sps->log2_diff_max_min_coding_block_size,
105 .log2_min_transform_block_size_minus2 =
sps->log2_min_tb_size - 2,
106 .log2_diff_max_min_transform_block_size =
sps->log2_max_trafo_size -
sps->log2_min_tb_size,
107 .pcm_enabled_flag =
sps->pcm_enabled_flag,
108 .log2_min_pcm_luma_coding_block_size_minus3 =
sps->pcm_enabled_flag ?
sps->pcm.log2_min_pcm_cb_size - 3 : 0,
109 .log2_diff_max_min_pcm_luma_coding_block_size =
sps->pcm.log2_max_pcm_cb_size -
sps->pcm.log2_min_pcm_cb_size,
110 .pcm_sample_bit_depth_luma_minus1 =
sps->pcm_enabled_flag ?
sps->pcm.bit_depth - 1 : 0,
111 .pcm_sample_bit_depth_chroma_minus1 =
sps->pcm_enabled_flag ?
sps->pcm.bit_depth_chroma - 1 : 0,
112 #if NVDECAPI_CHECK_VERSION(8, 1)
113 .log2_max_transform_skip_block_size_minus2 =
pps->log2_max_transform_skip_block_size - 2,
114 .log2_sao_offset_scale_luma =
pps->log2_sao_offset_scale_luma,
115 .log2_sao_offset_scale_chroma =
pps->log2_sao_offset_scale_chroma,
116 .high_precision_offsets_enabled_flag =
sps->high_precision_offsets_enabled_flag,
118 .pcm_loop_filter_disabled_flag =
sps->pcm.loop_filter_disable_flag,
119 .strong_intra_smoothing_enabled_flag =
sps->sps_strong_intra_smoothing_enable_flag,
120 .max_transform_hierarchy_depth_intra =
sps->max_transform_hierarchy_depth_intra,
121 .max_transform_hierarchy_depth_inter =
sps->max_transform_hierarchy_depth_inter,
122 .amp_enabled_flag =
sps->amp_enabled_flag,
123 .separate_colour_plane_flag =
sps->separate_colour_plane_flag,
124 .log2_max_pic_order_cnt_lsb_minus4 =
sps->log2_max_poc_lsb - 4,
125 .num_short_term_ref_pic_sets =
sps->nb_st_rps,
126 .long_term_ref_pics_present_flag =
sps->long_term_ref_pics_present_flag,
127 .num_long_term_ref_pics_sps =
sps->num_long_term_ref_pics_sps,
128 .sps_temporal_mvp_enabled_flag =
sps->sps_temporal_mvp_enabled_flag,
129 .sample_adaptive_offset_enabled_flag =
sps->sao_enabled,
130 .scaling_list_enable_flag =
sps->scaling_list_enable_flag,
133 .bit_depth_luma_minus8 =
sps->bit_depth - 8,
134 .bit_depth_chroma_minus8 =
sps->bit_depth - 8,
135 #if NVDECAPI_CHECK_VERSION(9, 0)
136 .sps_range_extension_flag =
sps->sps_range_extension_flag,
137 .transform_skip_rotation_enabled_flag =
sps->transform_skip_rotation_enabled_flag,
138 .transform_skip_context_enabled_flag =
sps->transform_skip_context_enabled_flag,
139 .implicit_rdpcm_enabled_flag =
sps->implicit_rdpcm_enabled_flag,
140 .explicit_rdpcm_enabled_flag =
sps->explicit_rdpcm_enabled_flag,
141 .extended_precision_processing_flag =
sps->extended_precision_processing_flag,
142 .intra_smoothing_disabled_flag =
sps->intra_smoothing_disabled_flag,
143 .persistent_rice_adaptation_enabled_flag =
sps->persistent_rice_adaptation_enabled_flag,
144 .cabac_bypass_alignment_enabled_flag =
sps->cabac_bypass_alignment_enabled_flag,
147 .dependent_slice_segments_enabled_flag =
pps->dependent_slice_segments_enabled_flag,
148 .slice_segment_header_extension_present_flag =
pps->slice_header_extension_present_flag,
149 .sign_data_hiding_enabled_flag =
pps->sign_data_hiding_flag,
150 .cu_qp_delta_enabled_flag =
pps->cu_qp_delta_enabled_flag,
151 .diff_cu_qp_delta_depth =
pps->diff_cu_qp_delta_depth,
152 .init_qp_minus26 =
pps->pic_init_qp_minus26,
153 .pps_cb_qp_offset =
pps->cb_qp_offset,
154 .pps_cr_qp_offset =
pps->cr_qp_offset,
155 .constrained_intra_pred_flag =
pps->constrained_intra_pred_flag,
156 .weighted_pred_flag =
pps->weighted_pred_flag,
157 .weighted_bipred_flag =
pps->weighted_bipred_flag,
158 .transform_skip_enabled_flag =
pps->transform_skip_enabled_flag,
159 .transquant_bypass_enabled_flag =
pps->transquant_bypass_enable_flag,
160 .entropy_coding_sync_enabled_flag =
pps->entropy_coding_sync_enabled_flag,
161 .log2_parallel_merge_level_minus2 =
pps->log2_parallel_merge_level - 2,
162 .num_extra_slice_header_bits =
pps->num_extra_slice_header_bits,
163 .loop_filter_across_tiles_enabled_flag =
pps->loop_filter_across_tiles_enabled_flag,
164 .loop_filter_across_slices_enabled_flag =
pps->seq_loop_filter_across_slices_enabled_flag,
165 .output_flag_present_flag =
pps->output_flag_present_flag,
166 .num_ref_idx_l0_default_active_minus1 =
pps->num_ref_idx_l0_default_active - 1,
167 .num_ref_idx_l1_default_active_minus1 =
pps->num_ref_idx_l1_default_active - 1,
168 .lists_modification_present_flag =
pps->lists_modification_present_flag,
169 .cabac_init_present_flag =
pps->cabac_init_present_flag,
170 .pps_slice_chroma_qp_offsets_present_flag =
pps->pic_slice_level_chroma_qp_offsets_present_flag,
171 .deblocking_filter_override_enabled_flag =
pps->deblocking_filter_override_enabled_flag,
172 .pps_deblocking_filter_disabled_flag =
pps->disable_dbf,
173 .pps_beta_offset_div2 =
pps->beta_offset / 2,
174 .pps_tc_offset_div2 =
pps->tc_offset / 2,
175 .tiles_enabled_flag =
pps->tiles_enabled_flag,
176 .uniform_spacing_flag =
pps->uniform_spacing_flag,
177 .num_tile_columns_minus1 =
pps->num_tile_columns - 1,
178 .num_tile_rows_minus1 =
pps->num_tile_rows - 1,
179 #if NVDECAPI_CHECK_VERSION(9, 0)
180 .pps_range_extension_flag =
pps->pps_range_extensions_flag,
181 .cross_component_prediction_enabled_flag =
pps->cross_component_prediction_enabled_flag,
182 .chroma_qp_offset_list_enabled_flag =
pps->chroma_qp_offset_list_enabled_flag,
183 .diff_cu_chroma_qp_offset_depth =
pps->diff_cu_chroma_qp_offset_depth,
184 .chroma_qp_offset_list_len_minus1 =
pps->chroma_qp_offset_list_len_minus1,
187 .NumBitsForShortTermRPSInSlice =
s->sh.short_term_rps ?
s->sh.short_term_ref_pic_set_size : 0,
188 .NumDeltaPocsOfRefRpsIdx =
s->sh.short_term_rps ?
s->sh.short_term_rps->rps_idx_num_delta_pocs : 0,
192 .NumPocLtCurr =
s->rps[
LT_CURR].nb_refs,
193 .CurrPicOrderCntVal =
s->ref->poc,
202 for (
i = 0;
i <
pps->num_tile_columns;
i++)
203 ppc->column_width_minus1[
i] =
pps->column_width[
i] - 1;
205 ppc->row_height_minus1[
i] =
pps->row_height[
i] - 1;
208 if (
pps->chroma_qp_offset_list_len_minus1 >=
FF_ARRAY_ELEMS(ppc->cb_qp_offset_list) ||
209 pps->chroma_qp_offset_list_len_minus1 >=
FF_ARRAY_ELEMS(ppc->cr_qp_offset_list)) {
213 for (
i = 0;
i <=
pps->chroma_qp_offset_list_len_minus1;
i++) {
214 ppc->cb_qp_offset_list[
i] =
pps->cb_qp_offset_list[
i];
215 ppc->cr_qp_offset_list[
i] =
pps->cr_qp_offset_list[
i];
239 ppc->RefPicIdx[
i] = -1;
244 ppc->RefPicSetStCurrBefore[
i] = j;
252 ppc->RefPicSetStCurrAfter[
i] = j;
259 if (ppc->PicOrderCntVal[j] ==
s->rps[
LT_CURR].list[
i]) {
260 ppc->RefPicSetLtCurr[
i] = j;
278 ctx->bitstream_len +
size + 3);
281 ctx->bitstream =
ctx->bitstream_internal =
tmp;
284 (
ctx->nb_slices + 1) *
sizeof(*
ctx->slice_offsets));
291 ctx->slice_offsets[
ctx->nb_slices] =
ctx->bitstream_len ;
292 ctx->bitstream_len +=
size + 3;
308 ctx->supports_444 = 1;
322 .
p.
name =
"hevc_nvdec",