1
/**************************************************************************
3
* Copyright 2013 Advanced Micro Devices, Inc.
6
* Permission is hereby granted, free of charge, to any person obtaining a
7
* copy of this software and associated documentation files (the
8
* "Software"), to deal in the Software without restriction, including
9
* without limitation the rights to use, copy, modify, merge, publish,
10
* distribute, sub license, and/or sell copies of the Software, and to
11
* permit persons to whom the Software is furnished to do so, subject to
12
* the following conditions:
14
* The above copyright notice and this permission notice (including the
15
* next paragraph) shall be included in all copies or substantial portions
18
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21
* IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
22
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
**************************************************************************/
28
#ifndef VID_DEC_COMMON_H
29
#define VID_DEC_COMMON_H
31
#include "util/list.h"
32
#include "util/vl_rbsp.h"
34
#include "vl/vl_compositor.h"
35
#include "vl/vl_zscan.h"
37
#include "bellagio/vid_dec_av1.h"
40
#include <OMX_Types.h>
42
#if ENABLE_ST_OMX_BELLAGIO
44
#include <bellagio/st_static_component_loader.h>
45
#include <bellagio/omx_base_filter.h>
46
#include <bellagio/omx_base_video_port.h>
48
DERIVEDCLASS(vid_dec_PrivateType, omx_base_filter_PrivateType)
49
#define vid_dec_PrivateType_FIELDS omx_base_filter_PrivateType_FIELDS \
50
enum pipe_video_profile profile; \
51
struct vl_screen *screen; \
52
struct pipe_context *pipe; \
53
struct pipe_video_codec *codec; \
54
void (*Decode)(vid_dec_PrivateType *priv, struct vl_vlc *vlc, unsigned min_bits_left); \
55
void (*EndFrame)(vid_dec_PrivateType *priv); \
56
struct pipe_video_buffer *(*Flush)(vid_dec_PrivateType *priv, OMX_TICKS *timestamp); \
57
struct pipe_video_buffer *target, *shadow; \
60
uint8_t intra_matrix[64]; \
61
uint8_t non_intra_matrix[64]; \
64
unsigned nal_ref_idc; \
66
unsigned idr_pic_id; \
67
unsigned pic_order_cnt_lsb; \
68
unsigned pic_order_cnt_msb; \
69
unsigned delta_pic_order_cnt_bottom; \
70
unsigned delta_pic_order_cnt[2]; \
71
unsigned prevFrameNumOffset; \
72
struct pipe_h264_sps sps[32]; \
73
struct pipe_h264_pps pps[256]; \
74
struct list_head dpb_list; \
78
unsigned temporal_id; \
80
unsigned pic_width_in_luma_samples; \
81
unsigned pic_height_in_luma_samples; \
84
void *ref_pic_set_list; \
86
struct pipe_h265_sps sps[16]; \
87
struct pipe_h265_pps pps[64]; \
88
struct list_head dpb_list; \
94
struct pipe_picture_desc base; \
95
struct pipe_mpeg12_picture_desc mpeg12; \
96
struct pipe_h264_picture_desc h264; \
97
struct pipe_h265_picture_desc h265; \
98
struct pipe_av1_picture_desc av1; \
100
unsigned num_in_buffers; \
101
OMX_BUFFERHEADERTYPE *in_buffers[2]; \
102
const void *inputs[2]; \
104
OMX_TICKS timestamps[2]; \
105
OMX_TICKS timestamp; \
106
bool first_buf_in_frame; \
107
bool frame_finished; \
108
bool frame_started; \
109
unsigned bytes_left; \
111
bool disable_tunnel; \
112
struct vl_compositor compositor; \
113
struct vl_compositor_state cstate;
114
ENDCLASS(vid_dec_PrivateType)
118
#include <tizprc_decls.h>
119
#include <tizport_decls.h>
121
#include "util/list.h"
122
#include "util/u_hash_table.h"
124
#include "pipe/p_video_state.h"
126
typedef struct h264d_prc_class h264d_prc_class_t;
127
struct h264d_prc_class
130
const tiz_prc_class_t _;
131
/* NOTE: Class methods might be added in the future */
134
typedef struct h264d_stream_info h264d_stream_info_t;
135
struct h264d_stream_info
141
typedef struct h264d_prc vid_dec_PrivateType;
146
OMX_BUFFERHEADERTYPE *in_buffers[2];
147
OMX_BUFFERHEADERTYPE *p_inhdr_;
148
OMX_BUFFERHEADERTYPE *p_outhdr_;
149
OMX_PARAM_PORTDEFINITIONTYPE out_port_def_;
150
const void *inputs[2];
152
OMX_TICKS timestamps[2];
155
bool in_port_disabled_;
156
bool out_port_disabled_;
157
struct vl_screen *screen;
158
struct pipe_context *pipe;
159
struct pipe_video_codec *codec;
160
struct pipe_video_buffer *target;
161
enum pipe_video_profile profile;
162
struct hash_table *video_buffer_map;
165
unsigned nal_ref_idc;
168
unsigned pic_order_cnt_lsb;
169
unsigned pic_order_cnt_msb;
170
unsigned delta_pic_order_cnt_bottom;
171
unsigned delta_pic_order_cnt[2];
172
unsigned prevFrameNumOffset;
173
struct pipe_h264_sps sps[32];
174
struct pipe_h264_pps pps[256];
175
struct list_head dpb_list;
180
struct pipe_picture_desc base;
181
struct pipe_h264_picture_desc h264;
183
h264d_stream_info_t stream_info;
184
unsigned num_in_buffers;
185
bool first_buf_in_frame;
191
struct vl_compositor compositor;
192
struct vl_compositor_state cstate;
198
void vid_dec_NeedTarget(vid_dec_PrivateType* priv);
199
void vid_dec_FillOutput(vid_dec_PrivateType* priv, struct pipe_video_buffer* buf,
200
OMX_BUFFERHEADERTYPE* output);