23 #include <vdpau/vdpau.h>
40 VdpPictureInfoHEVC *
info = &pic_ctx->
info.hevc;
53 info->pic_width_in_luma_samples = sps->
width;
54 info->pic_height_in_luma_samples = sps->
height;
55 info->bit_depth_luma_minus8 = sps->
bit_depth - 8;
56 info->bit_depth_chroma_minus8 = sps->
bit_depth - 8;
69 for (
size_t i = 0; i < 6; i++) {
70 for (
size_t j = 0; j < 16; j++) {
74 info->ScalingList4x4[i][j] = sl->
sl[0][i][pos];
76 for (
size_t j = 0; j < 64; j++) {
80 info->ScalingList8x8[i][j] = sl->
sl[1][i][pos];
83 info->ScalingList16x16[i][j] = sl->
sl[2][i][pos];
87 info->ScalingList32x32[i][j] = sl->
sl[3][i * 3][pos];
92 info->ScalingListDCCoeff16x16[i] = sl->
sl_dc[0][i];
96 info->ScalingListDCCoeff32x32[i] = sl->
sl_dc[1][i * 3];
100 info->sample_adaptive_offset_enabled_flag = sps->
sao_enabled;
102 if (info->pcm_enabled_flag) {
104 info->pcm_sample_bit_depth_luma_minus1 = sps->
pcm.
bit_depth - 1;
116 info->num_short_term_ref_pic_sets = sps->
nb_st_rps;
146 if (info->tiles_enabled_flag) {
157 info->column_width_minus1[i] = pps->
column_width[i] - 1;
163 info->row_height_minus1[i] = pps->
row_height[i] - 1;
176 info->pps_deblocking_filter_disabled_flag = pps->
disable_dbf;
182 info->pps_tc_offset_div2 = pps->
tc_offset / 2;
189 info->IDRPicFlag =
IS_IDR(h);
196 for (
size_t i = 0; i < sps->
nb_st_rps; i++) {
198 info->CurrRpsIdx = i;
227 info->CurrPicOrderCntVal = h->
poc;
230 for (
size_t i = 0; i < 16; i++) {
231 info->RefPics[i] = VDP_INVALID_HANDLE;
232 info->PicOrderCntVal[i] = 0;
233 info->IsLongTerm[i] = 0;
241 "VDPAU only supports up to 16 references in the DPB. "
242 "This frame may not be decoded correctly.\n");
250 info->PicOrderCntVal[j] = frame->
poc;
257 info->IsLongTerm[j] = 0;
264 if (info->NumPocStCurrBefore > 8) {
266 "VDPAU only supports up to 8 references in StCurrBefore. "
267 "This frame may not be decoded correctly.\n");
268 info->NumPocStCurrBefore = 8;
273 if (info->NumPocStCurrAfter > 8) {
275 "VDPAU only supports up to 8 references in StCurrAfter. "
276 "This frame may not be decoded correctly.\n");
277 info->NumPocStCurrAfter = 8;
282 if (info->NumPocLtCurr > 8) {
284 "VDPAU only supports up to 8 references in LtCurr. "
285 "This frame may not be decoded correctly.\n");
286 info->NumPocLtCurr = 8;
295 for (
size_t k = 0; k < 16; k++) {
296 if (
id == info->RefPics[k]) {
297 info->RefPicSetStCurrBefore[j] = k;
318 for (
size_t k = 0; k < 16; k++) {
319 if (
id == info->RefPics[k]) {
320 info->RefPicSetStCurrAfter[j] = k;
341 for (
size_t k = 0; k < 16; k++) {
342 if (
id == info->RefPics[k]) {
343 info->RefPicSetLtCurr[j] = k;
401 profile = VDP_DECODER_PROFILE_HEVC_MAIN;
404 profile = VDP_DECODER_PROFILE_HEVC_MAIN_10;
407 profile = VDP_DECODER_PROFILE_HEVC_MAIN_STILL;
417 .
name =
"hevc_vdpau",
unsigned int log2_min_cb_size
const char const char void * val
int max_dec_pic_buffering
#define AV_LOG_WARNING
Something somehow does not look correct.
unsigned int * row_height
RowHeight.
ShortTermRPS st_rps[HEVC_MAX_SHORT_TERM_RPS_COUNT]
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
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.
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)
struct HEVCFrame * ref[HEVC_MAX_REFS]
#define FF_PROFILE_HEVC_MAIN
const uint8_t ff_hevc_diag_scan8x8_x[64]
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
int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile, int level)
unsigned int log2_max_poc_lsb
#define HEVC_FRAME_FLAG_LONG_REF
static int vdpau_hevc_init(AVCodecContext *avctx)
#define HEVC_FRAME_FLAG_SHORT_REF
uint8_t tiles_enabled_flag
uint8_t lists_modification_present_flag
const char * name
Name of the hardware accelerated codec.
int max_transform_hierarchy_depth_inter
int num_tile_columns
num_tile_columns_minus1 + 1
struct HEVCSPS::@67 temporal_layer[HEVC_MAX_SUB_LAYERS]
#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
const uint8_t ff_hevc_diag_scan4x4_y[16]
#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
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface.
unsigned int log2_min_tb_size
uint8_t scaling_list_enable_flag
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
const uint8_t ff_hevc_diag_scan4x4_x[16]
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)
const uint8_t ff_hevc_diag_scan8x8_y[64]
#define HWACCEL_CAP_ASYNC_SAFE
AVHWAccel ff_hevc_vdpau_hwaccel
uint8_t sps_strong_intra_smoothing_enable_flag
int rps_idx_num_delta_pocs
union VDPAUPictureInfo info
VDPAU picture information.
int ff_hevc_frame_nb_refs(HEVCContext *s)
Get the number of candidate references for the current frame.
uint8_t long_term_ref_pics_present_flag
int diff_cu_qp_delta_depth
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
static uintptr_t ff_vdpau_get_surface_id(AVFrame *pic)
Extract VdpVideoSurface from an AVFrame.
uint8_t dependent_slice_segments_enabled_flag