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;
Libavcodec external API header.
#define AV_CODEC_EXPORT_DATA_FILM_GRAIN
Decoding only.
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given buffer if it is not large enough, otherwise do nothing.
common internal API header
int ff_nvdec_start_frame_sep_ref(AVCodecContext *avctx, AVFrame *frame, int has_sep_ref)
int ff_nvdec_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx, int dpb_size, int supports_444)
int ff_nvdec_simple_end_frame(AVCodecContext *avctx)
int ff_nvdec_decode_init(AVCodecContext *avctx)
int ff_nvdec_get_ref_idx(AVFrame *frame)
int ff_nvdec_decode_uninit(AVCodecContext *avctx)
static int nvdec_av1_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
const AVHWAccel ff_av1_nvdec_hwaccel
static int get_bit_depth_from_seq(const AV1RawSequenceHeader *seq)
static int nvdec_av1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
static int nvdec_av1_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
@ AV_PIX_FMT_CUDA
HW acceleration through CUDA.
uint8_t ar_coeffs_y_plus_128[24]
uint8_t ar_coeff_shift_minus_6
uint8_t point_y_value[14]
uint8_t grain_scale_shift
uint8_t point_cb_scaling[10]
uint8_t point_cr_scaling[10]
uint8_t ar_coeffs_cr_plus_128[25]
uint8_t clip_to_restricted_range
uint8_t point_cr_value[10]
uint8_t point_cb_value[10]
uint8_t chroma_scaling_from_luma
uint8_t grain_scaling_minus_8
uint8_t point_y_scaling[14]
uint8_t ar_coeffs_cb_plus_128[25]
A reference to a data buffer.
uint8_t * data
The data buffer.
main external API structure.
int export_side_data
Bit set of AV_CODEC_EXPORT_DATA_* flags, which affects the kind of metadata exported in frame,...
struct AVCodecInternal * internal
Private context used for internal data.
void * hwaccel_priv_data
hwaccel-specific private data
This structure describes decoded (raw) audio or video data.
AVBufferRef * private_ref
AVBufferRef for internal use by a single libav* library.
const char * name
Name of the hardware accelerated codec.
This struct stores per-frame lavc-internal data and is attached to it via private_ref.
void * hwaccel_priv
Per-frame private data for hwaccels.