xine-lib: xine-lib-1.2.13/src/video_dec/libvdpau/vdec_hw_h264.h Source File

xine-lib 1.2.13-20230125hg15249

vdec_hw_h264.h
Go to the documentation of this file.
1/* kate: tab-indent on; indent-width 2; mixedindent off; indent-mode cstyle; remove-trailing-space on; */
2/*
3 * Copyright (C) 2008-2022 the xine project
4 *
5 * This file is part of xine, a free video player.
6 *
7 * xine is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * xine is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
20 *
21 * h264.h, a generic H264 video stream parser for VDPAU and VAAPI hardware decoders
22 */
23
24#ifndef VDEC_HW_H264_H
25#define VDEC_HW_H264_H
26
27#include <stdio.h>
28#include <stdlib.h>
29#include <string.h>
30#include <inttypes.h>
31#include <sys/types.h>
32
33 typedef struct vdec_hw_h264_s vdec_hw_h264_t;
34 typedef struct vdec_hw_h264_frame_info_s vdec_hw_h264_frame_info_t;
35
36 typedef struct {
37 void *user_data;
38 vdec_hw_h264_t *vdec;
39 int profile;
40 int level;
41 int width;
42 int height;
43 double ratio;
44 int64_t pts;
45 int duration;
46#define VDEC_HW_H264_FRAME_TOP_FIELD 1
47#define VDEC_HW_H264_FRAME_BOTTOM_FIELD 2
48#define VDEC_HW_H264_FRAME_NEW_SEQ 4
49 int flags;
50 int bad_frame;
51 int progressive_frame;
52 int top_field_first;
53 int color_matrix;
54 int num_ref_frames;
55 const vdec_hw_h264_frame_info_t *info;
56} vdec_hw_h264_frame_t;
57
58 typedef struct {
59 vdec_hw_h264_frame_t *frame;
60
61 int is_long_term;
62 int top_is_reference;
63 int bottom_is_reference;
64
65 int32_t field_order_cnt[2];
66 uint16_t frame_idx;
67} vdec_hw_h264_info_ref_frame_t;
68
69 struct vdec_hw_h264_frame_info_s {
70 const uint8_t * const *slices_bitstream;
71 const uint32_t *slices_bytes;
72 uint32_t slice_count;
73
74 int32_t field_order_cnt[2];
75 int is_reference;
76
77 uint16_t frame_num;
78 uint8_t field_pic_flag;
79 uint8_t bottom_field_flag;
80 uint8_t num_ref_frames;
81 uint8_t gaps_in_frame_num_value_allowed_flag;
82 uint8_t mb_adaptive_frame_field_flag;
83 uint8_t constrained_intra_pred_flag;
84 uint8_t weighted_pred_flag;
85 uint8_t weighted_bipred_idc;
86 uint8_t frame_mbs_only_flag;
87 uint8_t transform_8x8_mode_flag;
88 uint8_t chroma_format_idc;
89 uint8_t separate_colour_plane_flag;
90 uint8_t bit_depth_luma_minus8;
91 uint8_t bit_depth_chroma_minus8;
92 int8_t chroma_qp_index_offset;
93 int8_t second_chroma_qp_index_offset;
94 int8_t pic_init_qp_minus26;
95 int8_t pic_init_qs_minus26;
96 uint8_t num_ref_idx_l0_active_minus1;
97 uint8_t num_ref_idx_l1_active_minus1;
98 uint8_t log2_max_frame_num_minus4;
99 uint8_t pic_order_cnt_type;
100 uint8_t log2_max_pic_order_cnt_lsb_minus4;
101 uint8_t delta_pic_order_always_zero_flag;
102 uint8_t direct_8x8_inference_flag;
103 uint8_t entropy_coding_mode_flag;
104 uint8_t pic_order_present_flag;
105 uint8_t deblocking_filter_control_present_flag;
106 uint8_t redundant_pic_cnt_present_flag;
107 uint8_t num_slice_groups_minus1;
108 uint8_t slice_group_map_type;
109
110 uint8_t scaling_lists_4x4[6][16];
111 uint8_t scaling_lists_8x8[2][64];
112
113 vdec_hw_h264_info_ref_frame_t referenceFrames[16];
114};
115
116 typedef enum {
117 VDEC_HW_H264_LOGG_ERR = 0,
118 VDEC_HW_H264_LOGG_INFO,
119 VDEC_HW_H264_LOGG_DEBUG
120} vdec_hw_h264_logg_t;
121
122 vdec_hw_h264_t *vdec_hw_h264_new (
123 int __attribute__((format (printf, 3, 4))) (*logg) (void *user_data,
124 vdec_hw_h264_logg_t level, const char *fmt, ...),
125 void *user_data,
126 int (*frame_new) (void *user_data, vdec_hw_h264_frame_t *frame),
127 int (*frame_render) (void *user_data, vdec_hw_h264_frame_t *frame),
128 int (*frame_ready) (void *user_data, vdec_hw_h264_frame_t *frame),
129 void (*frame_delete) (void *user_data, vdec_hw_h264_frame_t *frame),
130 int num_frames
131);
133int vdec_hw_h264_reset (vdec_hw_h264_t *dec);
135int vdec_hw_h264_zero_pts (vdec_hw_h264_t *dec);
137int vdec_hw_h264_flush (vdec_hw_h264_t *dec);
139int vdec_hw_h264_put_container_info (vdec_hw_h264_t *dec, int width, int height, int duration, double ratio);
141int vdec_hw_h264_put_config (vdec_hw_h264_t *dec, const uint8_t *bitstream, uint32_t num_bytes);
143int vdec_hw_h264_put_frame (vdec_hw_h264_t *dec, int64_t pts, const uint8_t *bitstream, uint32_t num_bytes, int frame_end);
145void vdec_hw_h264_delete (vdec_hw_h264_t **dec);
146
147#endif
148
height
unsigned int height
Definition gfontrle.c:5
width
unsigned int width
Definition gfontrle.c:4
vdec_hw_h264_frame_info_s
Definition vdec_hw_h264.h:69
vdec_hw_h264_frame_info_s::frame_num
uint16_t frame_num
Definition vdec_hw_h264.h:77
vdec_hw_h264_frame_info_s::is_reference
int is_reference
Definition vdec_hw_h264.h:75
vdec_hw_h264_frame_info_s::referenceFrames
vdec_hw_h264_info_ref_frame_t referenceFrames[16]
Definition vdec_hw_h264.h:113
vdec_hw_h264_frame_info_s::delta_pic_order_always_zero_flag
uint8_t delta_pic_order_always_zero_flag
Definition vdec_hw_h264.h:101
vdec_hw_h264_frame_info_s::slice_group_map_type
uint8_t slice_group_map_type
Definition vdec_hw_h264.h:108
vdec_hw_h264_frame_info_s::bit_depth_luma_minus8
uint8_t bit_depth_luma_minus8
Definition vdec_hw_h264.h:90
vdec_hw_h264_frame_info_s::deblocking_filter_control_present_flag
uint8_t deblocking_filter_control_present_flag
Definition vdec_hw_h264.h:105
vdec_hw_h264_frame_info_s::second_chroma_qp_index_offset
int8_t second_chroma_qp_index_offset
Definition vdec_hw_h264.h:93
vdec_hw_h264_frame_info_s::weighted_pred_flag
uint8_t weighted_pred_flag
Definition vdec_hw_h264.h:84
vdec_hw_h264_frame_info_s::direct_8x8_inference_flag
uint8_t direct_8x8_inference_flag
Definition vdec_hw_h264.h:102
vdec_hw_h264_frame_info_s::chroma_format_idc
uint8_t chroma_format_idc
Definition vdec_hw_h264.h:88
vdec_hw_h264_frame_info_s::transform_8x8_mode_flag
uint8_t transform_8x8_mode_flag
Definition vdec_hw_h264.h:87
vdec_hw_h264_frame_info_s::chroma_qp_index_offset
int8_t chroma_qp_index_offset
Definition vdec_hw_h264.h:92
vdec_hw_h264_frame_info_s::log2_max_pic_order_cnt_lsb_minus4
uint8_t log2_max_pic_order_cnt_lsb_minus4
Definition vdec_hw_h264.h:100
vdec_hw_h264_frame_info_s::pic_order_cnt_type
uint8_t pic_order_cnt_type
Definition vdec_hw_h264.h:99
vdec_hw_h264_frame_info_s::pic_order_present_flag
uint8_t pic_order_present_flag
Definition vdec_hw_h264.h:104
vdec_hw_h264_frame_info_s::slice_count
uint32_t slice_count
Definition vdec_hw_h264.h:72
vdec_hw_h264_frame_info_s::num_slice_groups_minus1
uint8_t num_slice_groups_minus1
Definition vdec_hw_h264.h:107
vdec_hw_h264_frame_info_s::frame_mbs_only_flag
uint8_t frame_mbs_only_flag
Definition vdec_hw_h264.h:86
vdec_hw_h264_frame_info_s::slices_bitstream
const uint8_t *const * slices_bitstream
Definition vdec_hw_h264.h:70
vdec_hw_h264_frame_info_s::redundant_pic_cnt_present_flag
uint8_t redundant_pic_cnt_present_flag
Definition vdec_hw_h264.h:106
vdec_hw_h264_frame_info_s::bit_depth_chroma_minus8
uint8_t bit_depth_chroma_minus8
Definition vdec_hw_h264.h:91
vdec_hw_h264_frame_info_s::pic_init_qp_minus26
int8_t pic_init_qp_minus26
Definition vdec_hw_h264.h:94
vdec_hw_h264_frame_info_s::num_ref_idx_l1_active_minus1
uint8_t num_ref_idx_l1_active_minus1
Definition vdec_hw_h264.h:97
vdec_hw_h264_frame_info_s::num_ref_idx_l0_active_minus1
uint8_t num_ref_idx_l0_active_minus1
Definition vdec_hw_h264.h:96
vdec_hw_h264_frame_info_s::bottom_field_flag
uint8_t bottom_field_flag
Definition vdec_hw_h264.h:79
vdec_hw_h264_frame_info_s::num_ref_frames
uint8_t num_ref_frames
Definition vdec_hw_h264.h:80
vdec_hw_h264_frame_info_s::scaling_lists_8x8
uint8_t scaling_lists_8x8[2][64]
Definition vdec_hw_h264.h:111
vdec_hw_h264_frame_info_s::entropy_coding_mode_flag
uint8_t entropy_coding_mode_flag
Definition vdec_hw_h264.h:103
vdec_hw_h264_frame_info_s::separate_colour_plane_flag
uint8_t separate_colour_plane_flag
Definition vdec_hw_h264.h:89
vdec_hw_h264_frame_info_s::constrained_intra_pred_flag
uint8_t constrained_intra_pred_flag
Definition vdec_hw_h264.h:83
vdec_hw_h264_frame_info_s::log2_max_frame_num_minus4
uint8_t log2_max_frame_num_minus4
Definition vdec_hw_h264.h:98
vdec_hw_h264_frame_info_s::pic_init_qs_minus26
int8_t pic_init_qs_minus26
Definition vdec_hw_h264.h:95
vdec_hw_h264_frame_info_s::slices_bytes
const uint32_t * slices_bytes
Definition vdec_hw_h264.h:71
vdec_hw_h264_frame_info_s::field_pic_flag
uint8_t field_pic_flag
Definition vdec_hw_h264.h:78
vdec_hw_h264_frame_info_s::scaling_lists_4x4
uint8_t scaling_lists_4x4[6][16]
Definition vdec_hw_h264.h:110
vdec_hw_h264_frame_info_s::field_order_cnt
int32_t field_order_cnt[2]
Definition vdec_hw_h264.h:74
vdec_hw_h264_frame_info_s::weighted_bipred_idc
uint8_t weighted_bipred_idc
Definition vdec_hw_h264.h:85
vdec_hw_h264_frame_info_s::gaps_in_frame_num_value_allowed_flag
uint8_t gaps_in_frame_num_value_allowed_flag
Definition vdec_hw_h264.h:81
vdec_hw_h264_frame_info_s::mb_adaptive_frame_field_flag
uint8_t mb_adaptive_frame_field_flag
Definition vdec_hw_h264.h:82
vdec_hw_h264_frame_t
Definition vdec_hw_h264.h:36
vdec_hw_h264_frame_t::user_data
void * user_data
Definition vdec_hw_h264.h:37
vdec_hw_h264_frame_t::bad_frame
int bad_frame
Definition vdec_hw_h264.h:50
vdec_hw_h264_frame_t::num_ref_frames
int num_ref_frames
Definition vdec_hw_h264.h:54
vdec_hw_h264_frame_t::color_matrix
int color_matrix
Definition vdec_hw_h264.h:53
vdec_hw_h264_frame_t::duration
int duration
Definition vdec_hw_h264.h:45
vdec_hw_h264_frame_t::info
const vdec_hw_h264_frame_info_t * info
Definition vdec_hw_h264.h:55
vdec_hw_h264_frame_t::ratio
double ratio
Definition vdec_hw_h264.h:43
vdec_hw_h264_frame_t::flags
int flags
Definition vdec_hw_h264.h:49
vdec_hw_h264_frame_t::top_field_first
int top_field_first
Definition vdec_hw_h264.h:52
vdec_hw_h264_frame_t::vdec
vdec_hw_h264_t * vdec
Definition vdec_hw_h264.h:38
vdec_hw_h264_frame_t::profile
int profile
Definition vdec_hw_h264.h:39
vdec_hw_h264_frame_t::level
int level
Definition vdec_hw_h264.h:40
vdec_hw_h264_frame_t::progressive_frame
int progressive_frame
Definition vdec_hw_h264.h:51
vdec_hw_h264_frame_t::pts
int64_t pts
Definition vdec_hw_h264.h:44
vdec_hw_h264_frame_t::height
int height
Definition vdec_hw_h264.h:42
vdec_hw_h264_frame_t::width
int width
Definition vdec_hw_h264.h:41
vdec_hw_h264_info_ref_frame_t
Definition vdec_hw_h264.h:58
vdec_hw_h264_info_ref_frame_t::bottom_is_reference
int bottom_is_reference
Definition vdec_hw_h264.h:63
vdec_hw_h264_info_ref_frame_t::frame_idx
uint16_t frame_idx
Definition vdec_hw_h264.h:66
vdec_hw_h264_info_ref_frame_t::top_is_reference
int top_is_reference
Definition vdec_hw_h264.h:62
vdec_hw_h264_info_ref_frame_t::frame
vdec_hw_h264_frame_t * frame
Definition vdec_hw_h264.h:59
vdec_hw_h264_info_ref_frame_t::is_long_term
int is_long_term
Definition vdec_hw_h264.h:61
vdec_hw_h264_s
Definition vdec_hw_h264.c:295
vdec_hw_h264_put_config
int vdec_hw_h264_put_config(vdec_hw_h264_t *dec, const uint8_t *bitstream, uint32_t num_bytes)
Definition vdec_hw_h264.c:2031
vdec_hw_h264_reset
int vdec_hw_h264_reset(vdec_hw_h264_t *dec)
Definition vdec_hw_h264.c:2381
vdec_hw_h264_flush
int vdec_hw_h264_flush(vdec_hw_h264_t *dec)
Definition vdec_hw_h264.c:2299
vdec_hw_h264_delete
void vdec_hw_h264_delete(vdec_hw_h264_t **dec)
Definition vdec_hw_h264.c:2406
vdec_hw_h264_zero_pts
int vdec_hw_h264_zero_pts(vdec_hw_h264_t *dec)
Definition vdec_hw_h264.c:499
vdec_hw_h264_put_container_info
int vdec_hw_h264_put_container_info(vdec_hw_h264_t *dec, int width, int height, int duration, double ratio)
Definition vdec_hw_h264.c:2392
vdec_hw_h264_logg_t
vdec_hw_h264_logg_t
Definition vdec_hw_h264.h:116
VDEC_HW_H264_LOGG_DEBUG
@ VDEC_HW_H264_LOGG_DEBUG
Definition vdec_hw_h264.h:119
VDEC_HW_H264_LOGG_ERR
@ VDEC_HW_H264_LOGG_ERR
Definition vdec_hw_h264.h:117
VDEC_HW_H264_LOGG_INFO
@ VDEC_HW_H264_LOGG_INFO
Definition vdec_hw_h264.h:118
vdec_hw_h264_put_frame
int vdec_hw_h264_put_frame(vdec_hw_h264_t *dec, int64_t pts, const uint8_t *bitstream, uint32_t num_bytes, int frame_end)
Definition vdec_hw_h264.c:2117
vdec_hw_h264_new
vdec_hw_h264_t * vdec_hw_h264_new(int __attribute__((format(printf, 3, 4)))(*logg)(void *user_data, vdec_hw_h264_logg_t level, const char *fmt,...), void *user_data, int(*frame_new)(void *user_data, vdec_hw_h264_frame_t *frame), int(*frame_render)(void *user_data, vdec_hw_h264_frame_t *frame), int(*frame_ready)(void *user_data, vdec_hw_h264_frame_t *frame), void(*frame_delete)(void *user_data, vdec_hw_h264_frame_t *frame), int num_frames)
user_data
static void user_data(vdpau_mpeg4_decoder_t *this_gen, uint8_t *buffer, int len)
Definition vdpau_mpeg4.c:695
__attribute__
const plugin_info_t xine_plugin_info[] __attribute__((visibility("default")))