39 DXVA_PicParams_AV1
pp;
57 DXVA_PicParams_AV1 *pp)
67 memset(pp, 0,
sizeof(*pp));
69 pp->width = avctx->
width;
70 pp->height = avctx->
height;
85 for (i = 0; i < pp->tiles.cols; i++)
88 for (i = 0; i < pp->tiles.rows; i++)
114 pp->coding.tx_mode = frame_header->
tx_mode;
117 pp->coding.reference_frame_update = 1;
120 pp->format.frame_type = frame_header->
frame_type;
121 pp->format.show_frame = frame_header->
show_frame;
132 memset(pp->RefFrameMapTextureIndex, 0xFF,
sizeof(pp->RefFrameMapTextureIndex));
138 pp->frame_refs[
i].height = ref_frame->
height;
139 pp->frame_refs[
i].Index = ref_frame->
buf[0] ? ref_idx : 0xFF;
144 for (j = 0; j < 6; ++j) {
150 if (ref_frame->
buf[0])
164 pp->loop_filter.delta_lf_res = frame_header->
delta_lf_res;
172 pp->loop_filter.frame_restoration_type[0] = remap_lr_type[frame_header->
lr_type[0]];
173 pp->loop_filter.frame_restoration_type[1] = remap_lr_type[frame_header->
lr_type[1]];
174 pp->loop_filter.frame_restoration_type[2] = remap_lr_type[frame_header->
lr_type[2]];
176 pp->loop_filter.log2_restoration_unit_size[0] = uses_lr ? (6 + frame_header->
lr_unit_shift) : 8;
177 pp->loop_filter.log2_restoration_unit_size[1] = uses_lr ? (6 + frame_header->
lr_unit_shift - frame_header->
lr_uv_shift) : 8;
178 pp->loop_filter.log2_restoration_unit_size[2] = uses_lr ? (6 + frame_header->
lr_unit_shift - frame_header->
lr_uv_shift) : 8;
182 pp->quantization.delta_q_res = frame_header->
delta_q_res;
183 pp->quantization.base_qindex = frame_header->
base_q_idx;
184 pp->quantization.y_dc_delta_q = frame_header->
delta_q_y_dc;
185 pp->quantization.u_dc_delta_q = frame_header->
delta_q_u_dc;
186 pp->quantization.v_dc_delta_q = frame_header->
delta_q_v_dc;
187 pp->quantization.u_ac_delta_q = frame_header->
delta_q_u_ac;
188 pp->quantization.v_ac_delta_q = frame_header->
delta_q_v_ac;
196 for (i = 0; i < 8; i++) {
213 pp->segmentation.feature_mask[
i].mask |= frame_header->
feature_enabled[
i][j] << j;
214 pp->segmentation.feature_data[
i][j] = frame_header->
feature_value[
i][j];
220 pp->film_grain.apply_grain = 1;
230 pp->film_grain.grain_seed = film_grain->
grain_seed;
246 for (i = 0; i < 24; i++) {
249 for (i = 0; i < 25; i++) {
253 pp->film_grain.cb_mult = film_grain->
cb_mult;
255 pp->film_grain.cr_mult = film_grain->
cr_mult;
257 pp->film_grain.cb_offset = film_grain->
cb_offset;
258 pp->film_grain.cr_offset = film_grain->
cr_offset;
259 pp->film_grain.cr_offset = film_grain->
cr_offset;
276 if (!DXVA_CONTEXT_VALID(avctx, ctx))
310 for (uint32_t tile_num = 0; tile_num < ctx_pic->
tile_count; tile_num++) {
315 ctx_pic->
tiles[tile_num].anchor_frame = 0xFF;
331 for (uint32_t tile_num = h->
tg_start; tile_num <= h->tg_end; tile_num++) {
336 ctx_pic->
tiles[tile_num].anchor_frame = 0xFF;
359 type = D3D11_VIDEO_DECODER_BUFFER_BITSTREAM;
360 if (FAILED(ID3D11VideoContext_GetDecoderBuffer(
D3D11VA_CONTEXT(ctx)->video_context,
363 &dxva_size, &dxva_data_ptr)))
369 type = DXVA2_BitStreamDateBufferType;
372 &dxva_data_ptr, &dxva_size)))
377 dxva_data = dxva_data_ptr;
405 D3D11_VIDEO_DECODER_BUFFER_DESC *dsc11 = bs;
406 memset(dsc11, 0,
sizeof(*dsc11));
407 dsc11->BufferType =
type;
409 dsc11->NumMBsInBuffer = 0;
411 type = D3D11_VIDEO_DECODER_BUFFER_SLICE_CONTROL;
416 DXVA2_DecodeBufferDesc *dsc2 = bs;
417 memset(dsc2, 0,
sizeof(*dsc2));
418 dsc2->CompressedBufferType =
type;
420 dsc2->NumMBsInBuffer = 0;
422 type = DXVA2_SliceControlBufferType;
440 &ctx_pic->
pp,
sizeof(ctx_pic->
pp),
457 #if CONFIG_AV1_DXVA2_HWACCEL 474 #if CONFIG_AV1_D3D11VA_HWACCEL 476 .
name =
"av1_d3d11va",
491 #if CONFIG_AV1_D3D11VA2_HWACCEL 493 .
name =
"av1_d3d11va2",
uint8_t clip_to_restricted_range
This structure describes decoded (raw) audio or video data.
AV1RawFrameHeader * raw_frame_header
static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, DECODER_BUFFER_DESC *bs, DECODER_BUFFER_DESC *sc)
AVBufferRef * buf[AV_NUM_DATA_POINTERS]
AVBuffer references backing the data for this frame.
uint8_t ar_coeffs_cb_plus_128[25]
static int dxva2_av1_end_frame(AVCodecContext *avctx)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB)
#define D3D11VA_CONTEXT(ctx)
unsigned int bitstream_allocated
uint8_t point_cr_scaling[10]
#define av_assert0(cond)
assert() equivalent, that is always enabled.
TileGroupInfo * tile_group_info
uint8_t matrix_coefficients
int ff_dxva2_common_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
int ff_dxva2_decode_uninit(AVCodecContext *avctx)
int export_side_data
Bit set of AV_CODEC_EXPORT_DATA_* flags, which affects the kind of metadata exported in frame...
uint8_t chroma_scaling_from_luma
static int fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *ctx, const AV1DecContext *h, DXVA_PicParams_AV1 *pp)
int ff_dxva2_common_end_frame(AVCodecContext *avctx, AVFrame *frame, const void *pp, unsigned pp_size, const void *qm, unsigned qm_size, int(*commit_bs_si)(AVCodecContext *, DECODER_BUFFER_DESC *bs, DECODER_BUFFER_DESC *slice))
uint8_t grain_scale_shift
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int dxva2_av1_uninit(AVCodecContext *avctx)
int ff_dxva2_is_d3d11(const AVCodecContext *avctx)
#define DXVA2_CONTEXT(ctx)
uint8_t point_cr_value[10]
const AVHWAccel ff_av1_d3d11va_hwaccel
simple assert() macros that are a bit more flexible than ISO C assert().
static int dxva2_av1_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
const char * name
Name of the hardware accelerated codec.
static const chunk_decoder decoder[8]
int width
picture width / height.
int ff_dxva2_decode_init(AVCodecContext *avctx)
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.
uint8_t ar_coeffs_cr_plus_128[25]
AV1RawFilmGrainParams film_grain
uint8_t grain_scaling_minus_8
uint8_t point_cb_scaling[10]
const AVHWAccel ff_av1_dxva2_hwaccel
#define AV_CODEC_EXPORT_DATA_FILM_GRAIN
Decoding only.
uint8_t ar_coeff_shift_minus_6
unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx, const AVDXVAContext *ctx, const AVFrame *frame)
main external API structure.
int ff_dxva2_commit_buffer(AVCodecContext *avctx, AVDXVAContext *ctx, DECODER_BUFFER_DESC *dsc, unsigned type, const void *data, unsigned size, unsigned mb_count)
uint8_t point_cb_value[10]
uint8_t point_y_scaling[14]
HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer. ...
int32_t gm_params[AV1_NUM_REF_FRAMES][6]
DXVA_Tile_AV1 tiles[MAX_TILES]
Hardware surfaces for Direct3D11.
const AVHWAccel ff_av1_d3d11va2_hwaccel
AV1Frame ref[AV1_NUM_REF_FRAMES]
void * hwaccel_priv_data
hwaccel-specific private data
AV1RawSequenceHeader * raw_seq
uint8_t point_y_value[14]
uint8_t * bitstream_cache
struct AVCodecInternal * internal
Private context used for internal data.
#define DXVA_CONTEXT(avctx)
FFDXVASharedContext shared
HW decoding through Direct3D11 via old API, Picture.data[3] contains a ID3D11VideoDecoderOutputView p...
uint8_t gm_type[AV1_NUM_REF_FRAMES]
static int get_bit_depth_from_seq(const AV1RawSequenceHeader *seq)
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
void * hwaccel_picture_private
static int dxva2_av1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
uint8_t ar_coeffs_y_plus_128[24]