24 #include <vdpau/vdpau.h>
42 rf->surface = VDP_INVALID_HANDLE;
43 rf->is_long_term = VDP_FALSE;
44 rf->top_is_reference = VDP_FALSE;
45 rf->bottom_is_reference = VDP_FALSE;
46 rf->field_order_cnt[0] = 0;
47 rf->field_order_cnt[1] = 0;
56 if (pic_structure == 0)
59 rf->surface = surface;
72 VdpPictureInfoH264 *info = &pic_ctx->info.h264;
75 VdpReferenceFrameH264 *rf = &info->referenceFrames[0];
76 #define H264_RF_COUNT FF_ARRAY_ELEMS(info->referenceFrames)
78 for (list = 0; list < 2; ++list) {
82 for (i = 0; i < ls; ++i) {
84 VdpReferenceFrameH264 *rf2;
85 VdpVideoSurface surface_ref;
93 rf2 = &info->referenceFrames[0];
95 if ((rf2->surface == surface_ref) &&
96 (rf2->is_long_term == pic->
long_ref) &&
97 (rf2->frame_idx == pic_frame_idx))
125 VdpPictureInfoH264 *info = &pic_ctx->info.h264;
126 #ifdef VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE
127 VdpPictureInfoH264Predictive *info2 = &pic_ctx->info.h264_predictive;
131 info->slice_count = 0;
139 info->mb_adaptive_frame_field_flag = h->
sps.
mb_aff && !info->field_pic_flag;
147 info->pic_init_qp_minus26 = h->
pps.
init_qp - 26;
148 info->num_ref_idx_l0_active_minus1 = h->
pps.
ref_count[0] - 1;
149 info->num_ref_idx_l1_active_minus1 = h->
pps.
ref_count[1] - 1;
155 #ifdef VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE
159 info->entropy_coding_mode_flag = h->
pps.
cabac;
165 sizeof(info->scaling_lists_4x4));
167 sizeof(info->scaling_lists_8x8[0]));
169 sizeof(info->scaling_lists_8x8[1]));
194 pic_ctx->info.h264.slice_count++;
221 profile = VDP_DECODER_PROFILE_H264_BASELINE;
224 #ifdef VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE
225 profile = VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE;
229 profile = VDP_DECODER_PROFILE_H264_MAIN;
232 profile = VDP_DECODER_PROFILE_H264_HIGH;
234 #ifdef VDP_DECODER_PROFILE_H264_EXTENDED
236 profile = VDP_DECODER_PROFILE_H264_EXTENDED;
242 profile = VDP_DECODER_PROFILE_H264_HIGH;
244 #ifdef VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE
248 profile = VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE;
256 level = VDP_DECODER_LEVEL_H264_1b;
262 .
name =
"h264_vdpau",
269 .frame_priv_data_size =
sizeof(
struct vdpau_picture_context),
#define FF_PROFILE_H264_HIGH_10
const char const char void * val
int long_ref
1->long term reference 0->short term reference
int chroma_qp_index_offset[2]
int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic_ctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
unsigned int ref_count[2]
num_ref_idx_l0/1_active_minus1 + 1
void ff_h264_draw_horiz_band(const H264Context *h, H264SliceContext *sl, int y, int height)
Public libavcodec VDPAU header.
#define FF_PROFILE_H264_MAIN
static void vdpau_h264_clear_rf(VdpReferenceFrameH264 *rf)
H264Picture * long_ref[32]
AVHWAccel ff_h264_vdpau_hwaccel
uint8_t scaling_matrix4[6][16]
int deblocking_filter_parameters_present
deblocking_filter_parameters_present_flag
int ff_vdpau_common_uninit(AVCodecContext *avctx)
#define FF_PROFILE_H264_EXTENDED
int cabac
entropy_coding_mode_flag
#define PICT_BOTTOM_FIELD
int transform_bypass
qpprime_y_zero_transform_bypass_flag
static int vdpau_h264_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
int redundant_pic_cnt_present
redundant_pic_cnt_present_flag
static void vdpau_h264_set_rf(VdpReferenceFrameH264 *rf, H264Picture *pic, int pic_structure)
H.264 / AVC / MPEG4 part10 codec.
static int32_t h264_foc(int foc)
int mb_aff
mb_adaptive_frame_field_flag
int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile, int level)
int poc_type
pic_order_cnt_type
int constrained_intra_pred
constrained_intra_pred_flag
void * hwaccel_picture_private
hardware accelerator private data
int weighted_pred
weighted_pred_flag
int frame_num
frame_num (raw frame_num from slice header)
int residual_color_transform_flag
residual_colour_transform_flag
Libavcodec external API header.
int delta_pic_order_always_zero_flag
uint8_t scaling_matrix8[6][64]
int ref_frame_count
num_ref_frames
const char * name
Name of the hardware accelerated codec.
static int vdpau_h264_end_frame(AVCodecContext *avctx)
static int vdpau_h264_init(AVCodecContext *avctx)
static void vdpau_h264_set_reference_frames(AVCodecContext *avctx)
int init_qp
pic_init_qp_minus26 + 26
H264SliceContext * slice_ctx
int direct_8x8_inference_flag
int pic_order_present
pic_order_present_flag
static const uint8_t start_code_prefix[3]
H264Picture * short_ref[32]
int field_poc[2]
top/bottom POC
#define FF_PROFILE_H264_HIGH_444_PREDICTIVE
main external API structure.
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface.
H264Picture * cur_pic_ptr
#define FF_PROFILE_H264_CAVLC_444
int log2_max_poc_lsb
log2_max_pic_order_cnt_lsb_minus4
#define FF_PROFILE_H264_INTRA
int transform_8x8_mode
transform_8x8_mode_flag
#define FF_PROFILE_H264_HIGH
int pic_id
pic_num (short -> no wrap version of pic_num, pic_num & max_pic_num; long -> long_pic_num) ...
common internal api header.
int ff_vdpau_add_buffer(struct vdpau_picture_context *pic_ctx, const uint8_t *buf, uint32_t size)
int log2_max_frame_num
log2_max_frame_num_minus4 + 4
int ff_vdpau_common_end_frame(AVCodecContext *avctx, AVFrame *frame, struct vdpau_picture_context *pic_ctx)
#define FF_PROFILE_H264_CONSTRAINED_BASELINE
static int vdpau_h264_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
#define FF_PROFILE_H264_BASELINE
#define FF_PROFILE_H264_HIGH_422
static uintptr_t ff_vdpau_get_surface_id(AVFrame *pic)
Extract VdpVideoSurface from an AVFrame.
int short_ref_count
number of actual short term references