23 #include <vdpau/vdpau.h> 42 VdpPictureInfoHEVC *
info = &pic_ctx->
info.hevc;
43 #ifdef VDP_YCBCR_FORMAT_Y_U_V_444 44 VdpPictureInfoHEVC444 *info2 = &pic_ctx->
info.hevc_444;
58 info->pic_width_in_luma_samples = sps->
width;
59 info->pic_height_in_luma_samples = sps->
height;
60 info->bit_depth_luma_minus8 = sps->
bit_depth - 8;
61 info->bit_depth_chroma_minus8 = sps->
bit_depth - 8;
74 for (
size_t i = 0;
i < 6;
i++) {
75 for (
size_t j = 0; j < 16; j++) {
79 info->ScalingList4x4[
i][j] = sl->
sl[0][
i][
pos];
81 for (
size_t j = 0; j < 64; j++) {
85 info->ScalingList8x8[
i][j] = sl->
sl[1][
i][
pos];
88 info->ScalingList16x16[
i][j] = sl->
sl[2][
i][
pos];
92 info->ScalingList32x32[
i][j] = sl->
sl[3][
i * 3][
pos];
97 info->ScalingListDCCoeff16x16[
i] = sl->
sl_dc[0][
i];
101 info->ScalingListDCCoeff32x32[
i] = sl->
sl_dc[1][
i * 3];
105 info->sample_adaptive_offset_enabled_flag = sps->
sao_enabled;
107 if (info->pcm_enabled_flag) {
109 info->pcm_sample_bit_depth_luma_minus1 = sps->
pcm.
bit_depth - 1;
121 info->num_short_term_ref_pic_sets = sps->
nb_st_rps;
151 if (info->tiles_enabled_flag) {
181 info->pps_deblocking_filter_disabled_flag = pps->
disable_dbf;
187 info->pps_tc_offset_div2 = pps->
tc_offset / 2;
194 info->IDRPicFlag =
IS_IDR(h);
203 info->CurrRpsIdx =
i;
232 info->CurrPicOrderCntVal = h->
poc;
235 for (
size_t i = 0;
i < 16;
i++) {
236 info->RefPics[
i] = VDP_INVALID_HANDLE;
237 info->PicOrderCntVal[
i] = 0;
238 info->IsLongTerm[
i] = 0;
246 "VDPAU only supports up to 16 references in the DPB. " 247 "This frame may not be decoded correctly.\n");
255 info->PicOrderCntVal[j] = frame->
poc;
262 info->IsLongTerm[j] = 0;
269 if (info->NumPocStCurrBefore > 8) {
271 "VDPAU only supports up to 8 references in StCurrBefore. " 272 "This frame may not be decoded correctly.\n");
273 info->NumPocStCurrBefore = 8;
278 if (info->NumPocStCurrAfter > 8) {
280 "VDPAU only supports up to 8 references in StCurrAfter. " 281 "This frame may not be decoded correctly.\n");
282 info->NumPocStCurrAfter = 8;
287 if (info->NumPocLtCurr > 8) {
289 "VDPAU only supports up to 8 references in LtCurr. " 290 "This frame may not be decoded correctly.\n");
291 info->NumPocLtCurr = 8;
300 for (
size_t k = 0; k < 16; k++) {
301 if (
id == info->RefPics[k]) {
302 info->RefPicSetStCurrBefore[j] = k;
323 for (
size_t k = 0; k < 16; k++) {
324 if (
id == info->RefPics[k]) {
325 info->RefPicSetStCurrAfter[j] = k;
346 for (
size_t k = 0; k < 16; k++) {
347 if (
id == info->RefPics[k]) {
348 info->RefPicSetLtCurr[j] = k;
363 #ifdef VDP_YCBCR_FORMAT_Y_U_V_444 365 info2->sps_range_extension_flag = 1;
376 info2->sps_range_extension_flag = 0;
379 info2->pps_range_extension_flag = 1;
387 for (ssize_t
i = 0;
i < info2->chromaQpAdjustmentTableSize;
i++)
394 info2->pps_range_extension_flag = 0;
445 #define copy_field(name) h265_raw_ptl->general_ ## name = general_ptl->name 487 *vdp_profile = VDP_DECODER_PROFILE_HEVC_MAIN;
493 if (!strcmp(profile->
name,
"Main 12") ||
494 !strcmp(profile->
name,
"Main 12 Intra"))
495 *vdp_profile = VDP_DECODER_PROFILE_HEVC_MAIN_12;
496 #ifdef VDP_DECODER_PROFILE_HEVC_MAIN_444 497 else if (!strcmp(profile->
name,
"Main 4:4:4") ||
498 !strcmp(profile->
name,
"Main 4:4:4 Intra"))
499 *vdp_profile = VDP_DECODER_PROFILE_HEVC_MAIN_444;
501 #ifdef VDP_DECODER_PROFILE_HEVC_MAIN_444_10 502 else if (!strcmp(profile->
name,
"Main 4:4:4 10") ||
503 !strcmp(profile->
name,
"Main 4:4:4 10 Intra"))
504 *vdp_profile = VDP_DECODER_PROFILE_HEVC_MAIN_444_10;
505 else if (!strcmp(profile->
name,
"Main 4:4:4 12") ||
506 !strcmp(profile->
name,
"Main 4:4:4 12 Intra"))
507 *vdp_profile = VDP_DECODER_PROFILE_HEVC_MAIN_444_12;
524 profile = VDP_DECODER_PROFILE_HEVC_MAIN;
527 profile = VDP_DECODER_PROFILE_HEVC_MAIN_10;
530 profile = VDP_DECODER_PROFILE_HEVC_MAIN_STILL;
545 .
name =
"hevc_vdpau",
unsigned int log2_min_cb_size
int extended_precision_processing_flag
uint8_t log2_sao_offset_scale_luma
uint8_t diff_cu_chroma_qp_offset_depth
int max_dec_pic_buffering
int transform_skip_rotation_enabled_flag
#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
uint8_t weighted_bipred_flag
uint8_t seq_loop_filter_across_slices_enabled_flag
uint8_t cabac_init_present_flag
#define FF_ARRAY_ELEMS(a)
ShortTermRPS st_rps[HEVC_MAX_SHORT_TERM_REF_PIC_SETS]
int explicit_rdpcm_enabled_flag
int num_ref_idx_l0_default_active
num_ref_idx_l0_default_active_minus1 + 1
Public libavcodec VDPAU header.
int8_t cr_qp_offset_list[6]
uint8_t general_profile_idc
uint8_t entropy_coding_sync_enabled_flag
int log2_parallel_merge_level
log2_parallel_merge_level_minus2 + 2
uint8_t log2_sao_offset_scale_chroma
unsigned int log2_max_trafo_size
uint8_t profile_compatibility_flag[32]
int ff_vdpau_common_uninit(AVCodecContext *avctx)
uint8_t log2_max_transform_skip_block_size
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
struct HEVCSPS::@69 temporal_layer[HEVC_MAX_SUB_LAYERS]
static int vdpau_hevc_end_frame(AVCodecContext *avctx)
const H265RawProfileTierLevel * ptl
uint8_t scaling_list_data_present_flag
int high_precision_offsets_enabled_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)
int8_t cb_qp_offset_list[6]
uint8_t transquant_bypass_enable_flag
static int vdpau_hevc_parse_rext_profile(AVCodecContext *avctx, VdpDecoderProfile *vdp_profile)
int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile, int level)
int ff_hevc_frame_nb_refs(const HEVCContext *s)
Get the number of candidate references for the current frame.
unsigned int log2_max_poc_lsb
#define HEVC_FRAME_FLAG_LONG_REF
static int vdpau_hevc_init(AVCodecContext *avctx)
int persistent_rice_adaptation_enabled_flag
static int ptl_convert(const PTLCommon *general_ptl, H265RawProfileTierLevel *h265_raw_ptl)
uint8_t general_tier_flag
uint8_t pps_range_extensions_flag
#define HEVC_FRAME_FLAG_SHORT_REF
uint8_t tiles_enabled_flag
#define HWACCEL_CAP_ASYNC_SAFE
uint8_t lists_modification_present_flag
const char * name
Name of the hardware accelerated codec.
int max_transform_hierarchy_depth_inter
#define FF_PROFILE_HEVC_MAIN_STILL_PICTURE
uint8_t cu_qp_delta_enabled_flag
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
uint8_t sign_data_hiding_flag
int ff_vdpau_common_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
uint8_t output_flag_present_flag
const uint8_t ff_hevc_diag_scan4x4_y[16]
int implicit_rdpcm_enabled_flag
uint8_t constrained_intra_pred_flag
uint8_t pic_slice_level_chroma_qp_offsets_present_flag
uint8_t transform_skip_enabled_flag
uint16_t num_tile_columns
num_tile_columns_minus1 + 1
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 cross_component_prediction_enabled_flag
const AVHWAccel ff_hevc_vdpau_hwaccel
uint8_t deblocking_filter_control_present_flag
int transform_skip_context_enabled_flag
uint8_t sps_temporal_mvp_enabled_flag
static int FUNC() pps(CodedBitstreamContext *ctx, RWContext *rw, H264RawPPS *current)
uint8_t chroma_qp_offset_list_enabled_flag
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface.
unsigned int log2_min_tb_size
static int FUNC() sps(CodedBitstreamContext *ctx, RWContext *rw, H264RawSPS *current)
uint8_t general_profile_compatibility_flag[32]
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)
uint16_t num_tile_rows
num_tile_rows_minus1 + 1
unsigned int * column_width
ColumnWidth.
uint8_t slice_header_extension_present_flag
int cabac_bypass_alignment_enabled_flag
coded frame dimension in various units
uint8_t chroma_qp_offset_list_len_minus1
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 FF_PROFILE_HEVC_REXT
uint8_t sps_strong_intra_smoothing_enable_flag
int rps_idx_num_delta_pocs
union VDPAUPictureInfo info
VDPAU picture information.
int sps_range_extension_flag
uint8_t long_term_ref_pics_present_flag
int diff_cu_qp_delta_depth
#define AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH
Hardware acceleration should still be attempted for decoding when the codec profile does not match th...
int hwaccel_flags
Bit set of AV_HWACCEL_FLAG_* flags, which affect hardware accelerated decoding (if active)...
uint8_t general_profile_space
uint8_t deblocking_filter_override_enabled_flag
int beta_offset
beta_offset_div2 * 2
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
const H265ProfileDescriptor * ff_h265_get_profile(const H265RawProfileTierLevel *ptl)
static const uint8_t start_code_prefix[3]
int intra_smoothing_disabled_flag
static double val(void *priv, double ch)
uint8_t separate_colour_plane_flag
static uintptr_t ff_vdpau_get_surface_id(AVFrame *pic)
Extract VdpVideoSurface from an AVFrame.
uint8_t dependent_slice_segments_enabled_flag