FFmpeg
vdpau_av1.c
Go to the documentation of this file.
1 /*
2  * AV1 HW decode acceleration through VDPAU
3  *
4  * Copyright (c) 2022 Manoj Gupta Bonda
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #include <vdpau/vdpau.h>
24 #include "libavutil/pixdesc.h"
25 #include "avcodec.h"
26 #include "internal.h"
27 #include "av1dec.h"
28 #include "hwaccel_internal.h"
29 #include "vdpau.h"
30 #include "vdpau_internal.h"
31 
33 {
34  if (seq->seq_profile == 2 && seq->color_config.high_bitdepth) {
35  return seq->color_config.twelve_bit ? 12 : 10;
36  } else if (seq->seq_profile <= 2 && seq->color_config.high_bitdepth) {
37  return 10;
38  } else {
39  return 8;
40  }
41 }
42 
44  const uint8_t *buffer, uint32_t size)
45 {
46  AV1DecContext *s = avctx->priv_data;
47  const AV1RawSequenceHeader *seq = s->raw_seq;
48  const AV1RawFrameHeader *frame_header = s->raw_frame_header;
49  const AV1RawFilmGrainParams *film_grain = &s->cur_frame.film_grain;
50 
51  struct vdpau_picture_context *pic_ctx = s->cur_frame.hwaccel_picture_private;
52  int i,j;
53 
54  unsigned char remap_lr_type[4] = { AV1_RESTORE_NONE, AV1_RESTORE_SWITCHABLE, AV1_RESTORE_WIENER, AV1_RESTORE_SGRPROJ };
55 
56 
57  VdpPictureInfoAV1 *info = &pic_ctx->info.av1;
58  const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(avctx->sw_pix_fmt);
59  if (!pixdesc) {
60  return AV_PIX_FMT_NONE;
61  }
62 
63  info->width = avctx->width;
64  info->height = avctx->height;
65 
66 
67  info->frame_offset = frame_header->order_hint;
68 
69  /* Sequence Header */
70  info->profile = seq->seq_profile;
71  info->use_128x128_superblock = seq->use_128x128_superblock;
72  info->subsampling_x = seq->color_config.subsampling_x;
73  info->subsampling_y = seq->color_config.subsampling_y;
74  info->mono_chrome = seq->color_config.mono_chrome;
75  info->bit_depth_minus8 = get_bit_depth_from_seq(seq) - 8;
76  info->enable_filter_intra = seq->enable_filter_intra;
77  info->enable_intra_edge_filter = seq->enable_intra_edge_filter;
78  info->enable_interintra_compound = seq->enable_interintra_compound;
79  info->enable_masked_compound = seq->enable_masked_compound;
80  info->enable_dual_filter = seq->enable_dual_filter;
81  info->enable_order_hint = seq->enable_order_hint;
82  info->order_hint_bits_minus1 = seq->order_hint_bits_minus_1;
83  info->enable_jnt_comp = seq->enable_jnt_comp;
84  info->enable_superres = seq->enable_superres;
85  info->enable_cdef = seq->enable_cdef;
86  info->enable_restoration = seq->enable_restoration;
87  info->enable_fgs = seq->film_grain_params_present;
88 
89  /* Frame Header */
90  info->frame_type = frame_header->frame_type;
91  info->show_frame = frame_header->show_frame;
92  info->disable_cdf_update = frame_header->disable_cdf_update;
93  info->allow_screen_content_tools = frame_header->allow_screen_content_tools;
94  info->force_integer_mv = s->cur_frame.force_integer_mv;
95  info->coded_denom = frame_header->coded_denom;
96  info->allow_intrabc = frame_header->allow_intrabc;
97  info->allow_high_precision_mv = frame_header->allow_high_precision_mv;
98  info->interp_filter = frame_header->interpolation_filter;
99  info->switchable_motion_mode = frame_header->is_motion_mode_switchable;
100  info->use_ref_frame_mvs = frame_header->use_ref_frame_mvs;
101  info->disable_frame_end_update_cdf = frame_header->disable_frame_end_update_cdf;
102  info->delta_q_present = frame_header->delta_q_present;
103  info->delta_q_res = frame_header->delta_q_res;
104  info->using_qmatrix = frame_header->using_qmatrix;
105  info->coded_lossless = s->cur_frame.coded_lossless;
106  info->use_superres = frame_header->use_superres;
107  info->tx_mode = frame_header->tx_mode;
108  info->reference_mode = frame_header->reference_select;
109  info->allow_warped_motion = frame_header->allow_warped_motion;
110  info->reduced_tx_set = frame_header->reduced_tx_set;
111  info->skip_mode = frame_header->skip_mode_present;
112 
113  /* Tiling Info */
114  info->num_tile_cols = frame_header->tile_cols;
115  info->num_tile_rows = frame_header->tile_rows;
116  info->context_update_tile_id = frame_header->context_update_tile_id;
117 
118  /* CDEF */
119  info->cdef_damping_minus_3 = frame_header->cdef_damping_minus_3;
120  info->cdef_bits = frame_header->cdef_bits;
121 
122  /* SkipModeFrames */
123  info->SkipModeFrame0 = frame_header->skip_mode_present ?
124  s->cur_frame.skip_mode_frame_idx[0] : 0;
125  info->SkipModeFrame1 = frame_header->skip_mode_present ?
126  s->cur_frame.skip_mode_frame_idx[1] : 0;
127 
128  /* QP Information */
129  info->base_qindex = frame_header->base_q_idx;
130  info->qp_y_dc_delta_q = frame_header->delta_q_y_dc;
131  info->qp_u_dc_delta_q = frame_header->delta_q_u_dc;
132  info->qp_v_dc_delta_q = frame_header->delta_q_v_dc;
133  info->qp_u_ac_delta_q = frame_header->delta_q_u_ac;
134  info->qp_v_ac_delta_q = frame_header->delta_q_v_ac;
135  info->qm_y = frame_header->qm_y;
136  info->qm_u = frame_header->qm_u;
137  info->qm_v = frame_header->qm_v;
138 
139  /* Segmentation */
140  info->segmentation_enabled = frame_header->segmentation_enabled;
141  info->segmentation_update_map = frame_header->segmentation_update_map;
142  info->segmentation_update_data = frame_header->segmentation_update_data;
143  info->segmentation_temporal_update = frame_header->segmentation_temporal_update;
144 
145  /* Loopfilter */
146  info->loop_filter_level[0] = frame_header->loop_filter_level[0];
147  info->loop_filter_level[1] = frame_header->loop_filter_level[1];
148  info->loop_filter_level_u = frame_header->loop_filter_level[2];
149  info->loop_filter_level_v = frame_header->loop_filter_level[3];
150  info->loop_filter_sharpness = frame_header->loop_filter_sharpness;
151  info->loop_filter_delta_enabled = frame_header->loop_filter_delta_enabled;
152  info->loop_filter_delta_update = frame_header->loop_filter_delta_update;
153  info->loop_filter_mode_deltas[0] = frame_header->loop_filter_mode_deltas[0];
154  info->loop_filter_mode_deltas[1] = frame_header->loop_filter_mode_deltas[1];
155  info->delta_lf_present = frame_header->delta_lf_present;
156  info->delta_lf_res = frame_header->delta_lf_res;
157  info->delta_lf_multi = frame_header->delta_lf_multi;
158 
159  /* Restoration */
160  info->lr_type[0] = remap_lr_type[frame_header->lr_type[0]];
161  info->lr_type[1] = remap_lr_type[frame_header->lr_type[1]];
162  info->lr_type[2] = remap_lr_type[frame_header->lr_type[2]];
163  info->lr_unit_size[0] = 1 + frame_header->lr_unit_shift;
164  info->lr_unit_size[1] = 1 + frame_header->lr_unit_shift - frame_header->lr_uv_shift;
165  info->lr_unit_size[2] = 1 + frame_header->lr_unit_shift - frame_header->lr_uv_shift;
166 
167  /* Reference Frames */
168  info->temporal_layer_id = s->cur_frame.temporal_id;
169  info->spatial_layer_id = s->cur_frame.spatial_id;
170 
171  /* Film Grain Params */
172  info->apply_grain = film_grain->apply_grain;
173  info->overlap_flag = film_grain->overlap_flag;
174  info->scaling_shift_minus8 = film_grain->grain_scaling_minus_8;
175  info->chroma_scaling_from_luma = film_grain->chroma_scaling_from_luma;
176  info->ar_coeff_lag = film_grain->ar_coeff_lag;
177  info->ar_coeff_shift_minus6 = film_grain->ar_coeff_shift_minus_6;
178  info->grain_scale_shift = film_grain->grain_scale_shift;
179  info->clip_to_restricted_range = film_grain->clip_to_restricted_range;
180  info->num_y_points = film_grain->num_y_points;
181  info->num_cb_points = film_grain->num_cb_points;
182  info->num_cr_points = film_grain->num_cr_points;
183  info->random_seed = film_grain->grain_seed;
184  info->cb_mult = film_grain->cb_mult;
185  info->cb_luma_mult = film_grain->cb_luma_mult;
186  info->cb_offset = film_grain->cb_offset;
187  info->cr_mult = film_grain->cr_mult;
188  info->cr_luma_mult = film_grain->cr_luma_mult;
189  info->cr_offset = film_grain->cr_offset;
190 
191  /* Tiling Info */
192  for (i = 0; i < frame_header->tile_cols; ++i) {
193  info->tile_widths[i] = frame_header->width_in_sbs_minus_1[i] + 1;
194  }
195  for (i = 0; i < frame_header->tile_rows; ++i) {
196  info->tile_heights[i] = frame_header->height_in_sbs_minus_1[i] + 1;
197  }
198 
199  /* CDEF */
200  for (i = 0; i < (1 << frame_header->cdef_bits); ++i) {
201  info->cdef_y_strength[i] = (frame_header->cdef_y_pri_strength[i] & 0x0F) | (frame_header->cdef_y_sec_strength[i] << 4);
202  info->cdef_uv_strength[i] = (frame_header->cdef_uv_pri_strength[i] & 0x0F) | (frame_header->cdef_uv_sec_strength[i] << 4);
203  }
204 
205 
206  /* Segmentation */
207  for (i = 0; i < AV1_MAX_SEGMENTS; ++i) {
208  info->segmentation_feature_mask[i] = 0;
209  for (j = 0; j < AV1_SEG_LVL_MAX; ++j) {
210  info->segmentation_feature_mask[i] |= frame_header->feature_enabled[i][j] << j;
211  info->segmentation_feature_data[i][j] = frame_header->feature_value[i][j];
212  }
213  }
214 
215  for (i = 0; i < AV1_NUM_REF_FRAMES; ++i) {
216  /* Loopfilter */
217  info->loop_filter_ref_deltas[i] = frame_header->loop_filter_ref_deltas[i];
218 
219  /* Reference Frames */
220  info->ref_frame_map[i] = s->ref[i].f && ff_vdpau_get_surface_id(s->ref[i].f) ?
221  ff_vdpau_get_surface_id(s->ref[i].f) : VDP_INVALID_HANDLE;
222  }
223 
224  if (frame_header->primary_ref_frame == AV1_PRIMARY_REF_NONE) {
225  info->primary_ref_frame = -1;
226  } else {
227  int8_t pri_ref_idx = frame_header->ref_frame_idx[frame_header->primary_ref_frame];
228  info->primary_ref_frame = info->ref_frame_map[pri_ref_idx];
229  }
230 
231  for (i = 0; i < AV1_REFS_PER_FRAME; ++i) {
232  /* Ref Frame List */
233  int8_t ref_idx = frame_header->ref_frame_idx[i];
234  AVFrame *ref_frame = s->ref[ref_idx].f;
235 
236  info->ref_frame[i].index = info->ref_frame_map[ref_idx];
237  info->ref_frame[i].width = ref_frame ? ref_frame->width : 0;
238  info->ref_frame[i].height = ref_frame ? ref_frame->height : 0;
239 
240  /* Global Motion */
241  info->global_motion[i].invalid = !frame_header->is_global[AV1_REF_FRAME_LAST + i];
242  info->global_motion[i].wmtype = s->cur_frame.gm_type[AV1_REF_FRAME_LAST + i];
243  for (j = 0; j < 6; ++j) {
244  info->global_motion[i].wmmat[j] = s->cur_frame.gm_params[AV1_REF_FRAME_LAST + i][j];
245  }
246  }
247 
248  /* Film Grain Params */
249  if (film_grain->apply_grain) {
250  for (i = 0; i < 14; ++i) {
251  info->scaling_points_y[i][0] = film_grain->point_y_value[i];
252  info->scaling_points_y[i][1] = film_grain->point_y_scaling[i];
253  }
254  for (i = 0; i < 10; ++i) {
255  info->scaling_points_cb[i][0] = film_grain->point_cb_value[i];
256  info->scaling_points_cb[i][1] = film_grain->point_cb_scaling[i];
257  info->scaling_points_cr[i][0] = film_grain->point_cr_value[i];
258  info->scaling_points_cr[i][1] = film_grain->point_cr_scaling[i];
259  }
260  for (i = 0; i < 24; ++i) {
261  info->ar_coeffs_y[i] = (short)film_grain->ar_coeffs_y_plus_128[i] - 128;
262  }
263  for (i = 0; i < 25; ++i) {
264  info->ar_coeffs_cb[i] = (short)film_grain->ar_coeffs_cb_plus_128[i] - 128;
265  info->ar_coeffs_cr[i] = (short)film_grain->ar_coeffs_cr_plus_128[i] - 128;
266  }
267  }
268 
269 
270  return ff_vdpau_common_start_frame(pic_ctx, buffer, size);
271 
272 }
273 
275  const uint8_t *buffer, uint32_t size)
276 {
277  const AV1DecContext *s = avctx->priv_data;
278  const AV1RawFrameHeader *frame_header = s->raw_frame_header;
279  struct vdpau_picture_context *pic_ctx = s->cur_frame.hwaccel_picture_private;
280  VdpPictureInfoAV1 *info = &pic_ctx->info.av1;
281  int val;
282  int nb_slices;
283  VdpBitstreamBuffer *buffers = pic_ctx->bitstream_buffers;
284  int bitstream_len = 0;
285 
286  nb_slices = frame_header->tile_cols * frame_header->tile_rows;
287  /* Shortcut if all tiles are in the same buffer*/
288  if (nb_slices == s->tg_end - s->tg_start + 1) {
289  for (int i = 0; i < nb_slices; ++i) {
290  info->tile_info[i*2 ] = s->tile_group_info[i].tile_offset;
291  info->tile_info[i*2 + 1] = info->tile_info[i*2] + s->tile_group_info[i].tile_size;
292  }
293  val = ff_vdpau_add_buffer(pic_ctx, buffer, size);
294  if (val) {
295  return val;
296  }
297 
298  return 0;
299  }
300 
301  for(int i = 0; i < pic_ctx->bitstream_buffers_used; i++) {
302  bitstream_len += buffers->bitstream_bytes;
303  buffers++;
304  }
305 
306  for (uint32_t tile_num = s->tg_start; tile_num <= s->tg_end; ++tile_num) {
307  info->tile_info[tile_num*2 ] = bitstream_len + s->tile_group_info[tile_num].tile_offset;
308  info->tile_info[tile_num*2 + 1] = info->tile_info[tile_num*2] + s->tile_group_info[tile_num].tile_size;
309  }
310 
311  val = ff_vdpau_add_buffer(pic_ctx, buffer, size);
312  if (val) {
313  return val;
314  }
315 
316  return 0;
317 }
318 
320 {
321  const AV1DecContext *s = avctx->priv_data;
322  struct vdpau_picture_context *pic_ctx = s->cur_frame.hwaccel_picture_private;
323 
324  int val;
325 
326  val = ff_vdpau_common_end_frame(avctx, s->cur_frame.f, pic_ctx);
327  if (val < 0)
328  return val;
329 
330  return 0;
331 }
332 
333 static int vdpau_av1_init(AVCodecContext *avctx)
334 {
335  VdpDecoderProfile profile;
336  uint32_t level = avctx->level;
337 
338  switch (avctx->profile) {
339  case AV_PROFILE_AV1_MAIN:
340  profile = VDP_DECODER_PROFILE_AV1_MAIN;
341  break;
342  case AV_PROFILE_AV1_HIGH:
343  profile = VDP_DECODER_PROFILE_AV1_HIGH;
344  break;
346  profile = VDP_DECODER_PROFILE_AV1_PROFESSIONAL;
347  break;
348  default:
349  return AVERROR(ENOTSUP);
350  }
351 
352  return ff_vdpau_common_init(avctx, profile, level);
353 }
354 
356  .p.name = "av1_vdpau",
357  .p.type = AVMEDIA_TYPE_VIDEO,
358  .p.id = AV_CODEC_ID_AV1,
359  .p.pix_fmt = AV_PIX_FMT_VDPAU,
360  .start_frame = vdpau_av1_start_frame,
361  .end_frame = vdpau_av1_end_frame,
362  .decode_slice = vdpau_av1_decode_slice,
363  .frame_priv_data_size = sizeof(struct vdpau_picture_context),
364  .init = vdpau_av1_init,
365  .uninit = ff_vdpau_common_uninit,
366  .frame_params = ff_vdpau_common_frame_params,
367  .priv_data_size = sizeof(VDPAUContext),
368  .caps_internal = HWACCEL_CAP_ASYNC_SAFE,
369 };
vdpau_av1_start_frame
static int vdpau_av1_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
Definition: vdpau_av1.c:43
level
uint8_t level
Definition: svq3.c:205
ff_vdpau_common_frame_params
int ff_vdpau_common_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
Definition: vdpau.c:123
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
AV1RawFilmGrainParams::clip_to_restricted_range
uint8_t clip_to_restricted_range
Definition: cbs_av1.h:162
AV1RawFilmGrainParams::grain_seed
uint16_t grain_seed
Definition: cbs_av1.h:135
AV1RawSequenceHeader
Definition: cbs_av1.h:73
av_pix_fmt_desc_get
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2965
ff_av1_vdpau_hwaccel
const FFHWAccel ff_av1_vdpau_hwaccel
Definition: vdpau_av1.c:355
AV1RawFilmGrainParams::point_cb_value
uint8_t point_cb_value[10]
Definition: cbs_av1.h:143
AV1RawFilmGrainParams::apply_grain
uint8_t apply_grain
Definition: cbs_av1.h:134
AV1_RESTORE_NONE
@ AV1_RESTORE_NONE
Definition: av1.h:173
FFHWAccel::p
AVHWAccel p
The public AVHWAccel.
Definition: hwaccel_internal.h:38
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:374
pixdesc.h
vdpau_picture_context::bitstream_buffers_used
int bitstream_buffers_used
Useful bitstream buffers in the bitstream buffers table.
Definition: vdpau_internal.h:112
AV1RawFilmGrainParams::point_y_value
uint8_t point_y_value[14]
Definition: cbs_av1.h:139
internal.h
get_bit_depth_from_seq
static int get_bit_depth_from_seq(const AV1RawSequenceHeader *seq)
Definition: vdpau_av1.c:32
AV_PROFILE_AV1_PROFESSIONAL
#define AV_PROFILE_AV1_PROFESSIONAL
Definition: defs.h:169
vdpau_av1_end_frame
static int vdpau_av1_end_frame(AVCodecContext *avctx)
Definition: vdpau_av1.c:319
vdpau_internal.h
AV1RawSequenceHeader::seq_profile
uint8_t seq_profile
Definition: cbs_av1.h:74
AV1RawColorConfig::subsampling_y
uint8_t subsampling_y
Definition: cbs_av1.h:53
AV1RawFilmGrainParams::cr_mult
uint8_t cr_mult
Definition: cbs_av1.h:158
AV1RawFilmGrainParams::chroma_scaling_from_luma
uint8_t chroma_scaling_from_luma
Definition: cbs_av1.h:141
AV1RawFilmGrainParams::ar_coeffs_cr_plus_128
uint8_t ar_coeffs_cr_plus_128[25]
Definition: cbs_av1.h:152
AV1RawSequenceHeader::film_grain_params_present
uint8_t film_grain_params_present
Definition: cbs_av1.h:130
vdpau_picture_context
Definition: vdpau_internal.h:98
FFHWAccel
Definition: hwaccel_internal.h:34
ref_frame
static int ref_frame(VVCFrame *dst, const VVCFrame *src)
Definition: dec.c:558
AV1RawSequenceHeader::enable_filter_intra
uint8_t enable_filter_intra
Definition: cbs_av1.h:106
AV1RawFilmGrainParams::point_cr_scaling
uint8_t point_cr_scaling[10]
Definition: cbs_av1.h:147
val
static double val(void *priv, double ch)
Definition: aeval.c:78
AV1RawFilmGrainParams::ar_coeff_shift_minus_6
uint8_t ar_coeff_shift_minus_6
Definition: cbs_av1.h:153
AV1RawFilmGrainParams::num_y_points
uint8_t num_y_points
Definition: cbs_av1.h:138
vdpau_av1_init
static int vdpau_av1_init(AVCodecContext *avctx)
Definition: vdpau_av1.c:333
ff_vdpau_add_buffer
int ff_vdpau_add_buffer(struct vdpau_picture_context *pic_ctx, const uint8_t *buf, uint32_t size)
Definition: vdpau.c:386
AV1RawFilmGrainParams::num_cb_points
uint8_t num_cb_points
Definition: cbs_av1.h:142
AV1RawFilmGrainParams::cb_luma_mult
uint8_t cb_luma_mult
Definition: cbs_av1.h:156
AV1_REF_FRAME_LAST
@ AV1_REF_FRAME_LAST
Definition: av1.h:63
AV1RawFilmGrainParams::overlap_flag
uint8_t overlap_flag
Definition: cbs_av1.h:161
AV1RawSequenceHeader::enable_masked_compound
uint8_t enable_masked_compound
Definition: cbs_av1.h:109
ff_vdpau_common_init
int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile, int level)
Definition: vdpau.c:142
vdpau.h
AV1_REFS_PER_FRAME
@ AV1_REFS_PER_FRAME
Definition: av1.h:85
AV1RawFilmGrainParams::grain_scaling_minus_8
uint8_t grain_scaling_minus_8
Definition: cbs_av1.h:148
s
#define s(width, name)
Definition: cbs_vp9.c:198
info
MIPS optimizations info
Definition: mips.txt:2
ff_vdpau_common_start_frame
int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic_ctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
Definition: vdpau.c:331
av1dec.h
ff_vdpau_get_surface_id
static uintptr_t ff_vdpau_get_surface_id(AVFrame *pic)
Extract VdpVideoSurface from an AVFrame.
Definition: vdpau_internal.h:38
HWACCEL_CAP_ASYNC_SAFE
#define HWACCEL_CAP_ASYNC_SAFE
Header providing the internals of AVHWAccel.
Definition: hwaccel_internal.h:31
AV1RawFilmGrainParams::cb_mult
uint8_t cb_mult
Definition: cbs_av1.h:155
AV_CODEC_ID_AV1
@ AV_CODEC_ID_AV1
Definition: codec_id.h:280
hwaccel_internal.h
AV1RawFrameHeader
Definition: cbs_av1.h:165
ff_vdpau_common_end_frame
int ff_vdpau_common_end_frame(AVCodecContext *avctx, AVFrame *frame, struct vdpau_picture_context *pic_ctx)
Definition: vdpau.c:341
AV1RawSequenceHeader::enable_jnt_comp
uint8_t enable_jnt_comp
Definition: cbs_av1.h:114
AVCodecContext::level
int level
Encoding level descriptor.
Definition: avcodec.h:1784
ff_vdpau_common_uninit
int ff_vdpau_common_uninit(AVCodecContext *avctx)
Definition: vdpau.c:293
VDPAUContext
Definition: vdpau_internal.h:73
AV1RawFilmGrainParams::point_cr_value
uint8_t point_cr_value[10]
Definition: cbs_av1.h:146
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:366
AV1RawFilmGrainParams::cb_offset
uint16_t cb_offset
Definition: cbs_av1.h:157
size
int size
Definition: twinvq_data.h:10344
AV1DecContext
Definition: av1dec.h:85
AV1RawSequenceHeader::use_128x128_superblock
uint8_t use_128x128_superblock
Definition: cbs_av1.h:105
AV_PROFILE_AV1_HIGH
#define AV_PROFILE_AV1_HIGH
Definition: defs.h:168
AV1RawFilmGrainParams::grain_scale_shift
uint8_t grain_scale_shift
Definition: cbs_av1.h:154
AV1RawSequenceHeader::enable_interintra_compound
uint8_t enable_interintra_compound
Definition: cbs_av1.h:108
AV1_RESTORE_WIENER
@ AV1_RESTORE_WIENER
Definition: av1.h:174
AV_PIX_FMT_VDPAU
@ AV_PIX_FMT_VDPAU
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface.
Definition: pixfmt.h:194
AVHWAccel::name
const char * name
Name of the hardware accelerated codec.
Definition: avcodec.h:2095
AV1_SEG_LVL_MAX
@ AV1_SEG_LVL_MAX
Definition: av1.h:90
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
AV1RawSequenceHeader::enable_dual_filter
uint8_t enable_dual_filter
Definition: cbs_av1.h:111
AV1RawSequenceHeader::enable_superres
uint8_t enable_superres
Definition: cbs_av1.h:124
AV1_NUM_REF_FRAMES
@ AV1_NUM_REF_FRAMES
Definition: av1.h:84
vdpau_av1_decode_slice
static int vdpau_av1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
Definition: vdpau_av1.c:274
vdpau_picture_context::bitstream_buffers
VdpBitstreamBuffer * bitstream_buffers
Table of bitstream buffers.
Definition: vdpau_internal.h:117
AV1RawSequenceHeader::enable_intra_edge_filter
uint8_t enable_intra_edge_filter
Definition: cbs_av1.h:107
AV1RawSequenceHeader::color_config
AV1RawColorConfig color_config
Definition: cbs_av1.h:128
profile
int profile
Definition: mxfenc.c:2227
AV1RawSequenceHeader::enable_order_hint
uint8_t enable_order_hint
Definition: cbs_av1.h:113
AVCodecContext::height
int height
Definition: avcodec.h:618
AV1_MAX_SEGMENTS
@ AV1_MAX_SEGMENTS
Definition: av1.h:89
AV1_RESTORE_SGRPROJ
@ AV1_RESTORE_SGRPROJ
Definition: av1.h:175
avcodec.h
AV1RawColorConfig::subsampling_x
uint8_t subsampling_x
Definition: cbs_av1.h:52
AV1RawColorConfig::high_bitdepth
uint8_t high_bitdepth
Definition: cbs_av1.h:42
AV1RawFilmGrainParams::cr_luma_mult
uint8_t cr_luma_mult
Definition: cbs_av1.h:159
AVCodecContext
main external API structure.
Definition: avcodec.h:445
frame_header
Definition: truemotion1.c:88
vdpau_picture_context::info
union VDPAUPictureInfo info
VDPAU picture information.
Definition: vdpau_internal.h:102
buffer
the frame and frame reference mechanism is intended to as much as expensive copies of that data while still allowing the filters to produce correct results The data is stored in buffers represented by AVFrame structures Several references can point to the same frame buffer
Definition: filter_design.txt:49
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AVCodecContext::profile
int profile
profile
Definition: avcodec.h:1640
AV1RawFilmGrainParams::ar_coeff_lag
uint8_t ar_coeff_lag
Definition: cbs_av1.h:149
AV1RawColorConfig::mono_chrome
uint8_t mono_chrome
Definition: cbs_av1.h:44
AV1_RESTORE_SWITCHABLE
@ AV1_RESTORE_SWITCHABLE
Definition: av1.h:176
AV1RawFilmGrainParams::ar_coeffs_cb_plus_128
uint8_t ar_coeffs_cb_plus_128[25]
Definition: cbs_av1.h:151
AV1RawFilmGrainParams::ar_coeffs_y_plus_128
uint8_t ar_coeffs_y_plus_128[24]
Definition: cbs_av1.h:150
AV1RawSequenceHeader::order_hint_bits_minus_1
uint8_t order_hint_bits_minus_1
Definition: cbs_av1.h:122
AV1RawFilmGrainParams::cr_offset
uint16_t cr_offset
Definition: cbs_av1.h:160
AV1RawFilmGrainParams::point_y_scaling
uint8_t point_y_scaling[14]
Definition: cbs_av1.h:140
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV1RawFilmGrainParams::point_cb_scaling
uint8_t point_cb_scaling[10]
Definition: cbs_av1.h:144
AV1_PRIMARY_REF_NONE
@ AV1_PRIMARY_REF_NONE
Definition: av1.h:87
AVPixFmtDescriptor
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:69
AV1RawSequenceHeader::enable_restoration
uint8_t enable_restoration
Definition: cbs_av1.h:126
AV1RawColorConfig::twelve_bit
uint8_t twelve_bit
Definition: cbs_av1.h:43
AVCodecContext::priv_data
void * priv_data
Definition: avcodec.h:472
AV1RawSequenceHeader::enable_cdef
uint8_t enable_cdef
Definition: cbs_av1.h:125
AVCodecContext::width
int width
picture width / height.
Definition: avcodec.h:618
AV1RawFilmGrainParams
Definition: cbs_av1.h:133
AVCodecContext::sw_pix_fmt
enum AVPixelFormat sw_pix_fmt
Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx.
Definition: avcodec.h:664
AV_PROFILE_AV1_MAIN
#define AV_PROFILE_AV1_MAIN
Definition: defs.h:167
short
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option keep it simple and lowercase description are short
Definition: writing_filters.txt:89
AV1RawFilmGrainParams::num_cr_points
uint8_t num_cr_points
Definition: cbs_av1.h:145