23 #include <vdpau/vdpau.h>
38 VdpPictureInfoHEVC *info = &pic_ctx->info.hevc;
51 info->pic_width_in_luma_samples = sps->
width;
52 info->pic_height_in_luma_samples = sps->
height;
53 info->bit_depth_luma_minus8 = sps->
bit_depth - 8;
54 info->bit_depth_chroma_minus8 = sps->
bit_depth - 8;
67 for (
size_t i = 0; i < 6; i++) {
68 for (
size_t j = 0; j < 16; j++) {
72 info->ScalingList4x4[i][j] = sl->
sl[0][i][pos];
74 for (
size_t j = 0; j < 64; j++) {
78 info->ScalingList8x8[i][j] = sl->
sl[1][i][pos];
81 info->ScalingList16x16[i][j] = sl->
sl[2][i][pos];
85 info->ScalingList32x32[i][j] = sl->
sl[3][i * 3][pos];
90 info->ScalingListDCCoeff16x16[i] = sl->
sl_dc[0][i];
94 info->ScalingListDCCoeff32x32[i] = sl->
sl_dc[1][i * 3];
98 info->sample_adaptive_offset_enabled_flag = sps->
sao_enabled;
100 if (info->pcm_enabled_flag) {
102 info->pcm_sample_bit_depth_luma_minus1 = sps->
pcm.
bit_depth - 1;
114 info->num_short_term_ref_pic_sets = sps->
nb_st_rps;
148 if (info->tiles_enabled_flag) {
159 info->column_width_minus1[i] = pps->
column_width[i] - 1;
165 info->row_height_minus1[i] = pps->
row_height[i] - 1;
178 info->pps_deblocking_filter_disabled_flag = pps->
disable_dbf;
184 info->pps_tc_offset_div2 = pps->
tc_offset / 2;
196 info->IDRPicFlag =
IS_IDR(h);
203 for (
size_t i = 0; i < sps->
nb_st_rps; i++) {
205 info->CurrRpsIdx = i;
236 info->CurrPicOrderCntVal = h->
poc;
239 for (
size_t i = 0; i < 16; i++) {
240 info->RefPics[i] = VDP_INVALID_HANDLE;
241 info->PicOrderCntVal[i] = 0;
242 info->IsLongTerm[i] = 0;
250 "VDPAU only supports up to 16 references in the DPB. "
251 "This frame may not be decoded correctly.\n");
259 info->PicOrderCntVal[j] = frame->
poc;
266 info->IsLongTerm[j] = 0;
273 if (info->NumPocStCurrBefore > 8) {
275 "VDPAU only supports up to 8 references in StCurrBefore. "
276 "This frame may not be decoded correctly.\n");
277 info->NumPocStCurrBefore = 8;
282 if (info->NumPocStCurrAfter > 8) {
284 "VDPAU only supports up to 8 references in StCurrAfter. "
285 "This frame may not be decoded correctly.\n");
286 info->NumPocStCurrAfter = 8;
291 if (info->NumPocLtCurr > 8) {
293 "VDPAU only supports up to 8 references in LtCurr. "
294 "This frame may not be decoded correctly.\n");
295 info->NumPocLtCurr = 8;
304 for (
size_t k = 0; k < 16; k++) {
305 if (
id == info->RefPics[k]) {
306 info->RefPicSetStCurrBefore[j] = k;
327 for (
size_t k = 0; k < 16; k++) {
328 if (
id == info->RefPics[k]) {
329 info->RefPicSetStCurrAfter[j] = k;
350 for (
size_t k = 0; k < 16; k++) {
351 if (
id == info->RefPics[k]) {
352 info->RefPicSetLtCurr[j] = k;
410 profile = VDP_DECODER_PROFILE_HEVC_MAIN;
413 profile = VDP_DECODER_PROFILE_HEVC_MAIN_10;
416 profile = VDP_DECODER_PROFILE_HEVC_MAIN_STILL;
426 .
name =
"hevc_vdpau",
433 .frame_priv_data_size =
sizeof(
struct vdpau_picture_context),
unsigned int log2_min_cb_size
const char const char void * val
int ff_hevc_frame_nb_refs(HEVCContext *s)
Get the number of candidate references for the current frame.
int max_dec_pic_buffering
#define AV_LOG_WARNING
Something somehow does not look correct.
unsigned int * row_height
RowHeight.
int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic_ctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
void * hwaccel_picture_private
const uint8_t ff_hevc_diag_scan4x4_x[16]
uint8_t weighted_bipred_flag
uint8_t seq_loop_filter_across_slices_enabled_flag
uint8_t cabac_init_present_flag
int num_ref_idx_l0_default_active
num_ref_idx_l0_default_active_minus1 + 1
Public libavcodec VDPAU header.
struct HEVCFrame * ref[MAX_REFS]
ShortTermRPS st_rps[MAX_SHORT_TERM_RPS_COUNT]
uint8_t entropy_coding_sync_enabled_flag
int log2_parallel_merge_level
log2_parallel_merge_level_minus2 + 2
unsigned int log2_max_trafo_size
int ff_vdpau_common_uninit(AVCodecContext *avctx)
#define FF_PROFILE_HEVC_MAIN
int num_ref_idx_l1_default_active
num_ref_idx_l1_default_active_minus1 + 1
unsigned int log2_min_pcm_cb_size
static int vdpau_hevc_end_frame(AVCodecContext *avctx)
uint8_t scaling_list_data_present_flag
uint8_t loop_filter_disable_flag
#define FF_PROFILE_HEVC_MAIN_10
static int vdpau_hevc_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
uint8_t transquant_bypass_enable_flag
#define HEVC_FRAME_FLAG_LONG_REF
int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile, int level)
unsigned int log2_max_poc_lsb
static int vdpau_hevc_init(AVCodecContext *avctx)
uint8_t tiles_enabled_flag
uint8_t lists_modification_present_flag
#define HEVC_FRAME_FLAG_SHORT_REF
const char * name
Name of the hardware accelerated codec.
int max_transform_hierarchy_depth_inter
int num_tile_columns
num_tile_columns_minus1 + 1
#define FF_PROFILE_HEVC_MAIN_STILL_PICTURE
uint8_t cu_qp_delta_enabled_flag
uint8_t sign_data_hiding_flag
uint8_t output_flag_present_flag
#define FF_ARRAY_ELEMS(a)
uint8_t constrained_intra_pred_flag
uint8_t pic_slice_level_chroma_qp_offsets_present_flag
uint8_t transform_skip_enabled_flag
Libavcodec external API header.
uint8_t uniform_spacing_flag
main external API structure.
int num_extra_slice_header_bits
static int vdpau_hevc_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
uint8_t loop_filter_across_tiles_enabled_flag
uint8_t num_long_term_ref_pics_sps
uint8_t deblocking_filter_control_present_flag
uint8_t sps_temporal_mvp_enabled_flag
int num_tile_rows
num_tile_rows_minus1 + 1
const uint8_t ff_hevc_diag_scan8x8_y[64]
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface.
unsigned int log2_min_tb_size
uint8_t scaling_list_enable_flag
struct HEVCSPS::@52 temporal_layer[MAX_SUB_LAYERS]
int tc_offset
tc_offset_div2 * 2
uint8_t flags
A combination of HEVC_FRAME_FLAG_*.
unsigned int log2_diff_max_min_coding_block_size
unsigned int log2_max_pcm_cb_size
int max_transform_hierarchy_depth_intra
common internal api header.
uint8_t weighted_pred_flag
int ff_vdpau_add_buffer(struct vdpau_picture_context *pic_ctx, const uint8_t *buf, uint32_t size)
unsigned int * column_width
ColumnWidth.
uint8_t slice_header_extension_present_flag
int ff_vdpau_common_end_frame(AVCodecContext *avctx, AVFrame *frame, struct vdpau_picture_context *pic_ctx)
AVHWAccel ff_hevc_vdpau_hwaccel
uint8_t sps_strong_intra_smoothing_enable_flag
int rps_idx_num_delta_pocs
uint8_t long_term_ref_pics_present_flag
int diff_cu_qp_delta_depth
const uint8_t ff_hevc_diag_scan8x8_x[64]
uint8_t deblocking_filter_override_enabled_flag
int beta_offset
beta_offset_div2 * 2
static const uint8_t start_code_prefix[3]
uint8_t separate_colour_plane_flag
output (i.e. cropped) values
const uint8_t ff_hevc_diag_scan4x4_y[16]
static uintptr_t ff_vdpau_get_surface_id(AVFrame *pic)
Extract VdpVideoSurface from an AVFrame.
uint8_t dependent_slice_segments_enabled_flag