2 * gstvaapiencoder_h264_priv.h - H.264 encoder (private definitions)
4 * Copyright (C) 2013 Intel Corporation
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public License
8 * as published by the Free Software Foundation; either version 2.1
9 * of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free
18 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301 USA
22 #ifndef GST_VAAPI_ENCODER_H264_PRIV_H
23 #define GST_VAAPI_ENCODER_H264_PRIV_H
26 #include <gst/base/gstbitwriter.h>
27 #include <gst/vaapi/gstvaapiencoder.h>
28 #include <gst/vaapi/gstvaapiencoder_priv.h>
32 #define GST_VAAPI_ENCODER_H264(encoder) \
33 ((GstVaapiEncoderH264 *)(encoder))
34 #define GST_VAAPI_ENCODER_H264_CAST(encoder) \
35 ((GstVaapiEncoderH264 *)(encoder))
36 #define GST_VAAPI_ENCODER_H264_CLASS(klass) \
37 ((GstVaapiEncoderH264Class *)(klass))
38 #define GST_IS_VAAPI_ENCODER_H264_CLASS(klass) \
40 #define GST_VAAPI_ENCODER_H264_GET_CLASS(obj) \
41 GST_VAAPI_ENCODER_H264_CLASS(GST_VAAPI_MINI_OBJECT_GET_CLASS(obj))
43 typedef struct _GstVaapiEncoderH264Class GstVaapiEncoderH264Class;
47 GST_VAAPI_ENCODER_H264_LEVEL_10 = 10, /* QCIF format, < 380160 samples/sec */
48 GST_VAAPI_ENCODER_H264_LEVEL_11 = 11, /* CIF format, < 768000 samples/sec */
49 GST_VAAPI_ENCODER_H264_LEVEL_12 = 12, /* CIF format, < 1536000 samples/sec */
50 GST_VAAPI_ENCODER_H264_LEVEL_13 = 13, /* CIF format, < 3041280 samples/sec */
51 GST_VAAPI_ENCODER_H264_LEVEL_20 = 20, /* CIF format, < 3041280 samples/sec */
52 GST_VAAPI_ENCODER_H264_LEVEL_21 = 21, /* HHR format, < 5068800 samples/sec */
53 GST_VAAPI_ENCODER_H264_LEVEL_22 = 22, /* SD/4CIF format, < 5184000 samples/sec */
54 GST_VAAPI_ENCODER_H264_LEVEL_30 = 30, /* SD/4CIF format, < 10368000 samples/sec */
55 GST_VAAPI_ENCODER_H264_LEVEL_31 = 31, /* 720pHD format, < 27648000 samples/sec */
56 GST_VAAPI_ENCODER_H264_LEVEL_32 = 32, /* SXGA format, < 55296000 samples/sec */
57 GST_VAAPI_ENCODER_H264_LEVEL_40 = 40, /* 2Kx1K format, < 62914560 samples/sec */
58 GST_VAAPI_ENCODER_H264_LEVEL_41 = 41, /* 2Kx1K format, < 62914560 samples/sec */
59 GST_VAAPI_ENCODER_H264_LEVEL_42 = 42, /* 2Kx1K format, < 125829120 samples/sec */
60 GST_VAAPI_ENCODER_H264_LEVEL_50 = 50, /* 3672x1536 format, < 150994944 samples/sec */
61 GST_VAAPI_ENCODER_H264_LEVEL_51 = 51, /* 4096x2304 format, < 251658240 samples/sec */
62 } GstVaapiEncoderH264Level;
64 #define GST_VAAPI_ENCODER_H264_DEFAULT_PROFILE GST_VAAPI_PROFILE_H264_BASELINE
65 #define GST_VAAPI_ENCODER_H264_DEFAULT_LEVEL GST_VAAPI_ENCODER_H264_LEVEL_31
66 #define GST_VAAPI_ENCODER_H264_DEFAULT_INIT_QP 26
67 #define GST_VAAPI_ENCODER_H264_DEFAULT_MIN_QP 1
68 #define GST_VAAPI_ENCODER_H264_DEFAULT_INTRA_PERIOD 30
69 #define GST_VAAPI_ENCODER_H264_MAX_INTRA_PERIOD 512
70 #define GST_VAAPI_ENCODER_H264_MAX_IDR_PERIOD 512
72 #define GST_VAAPI_ENCODER_H264_DEFAULT_SLICE_NUM 1
74 struct _GstVaapiEncoderH264
76 GstVaapiEncoder parent;
81 guint32 bitrate; /*kbps */
84 guint32 init_qp; /*default 24 */
85 guint32 min_qp; /*default 1 */
90 gboolean is_avc; /* avc or bytestream */
92 GQueue reorder_frame_list;
96 guint cur_present_index;
97 GstClockTime cts_offset;
102 /* max reflist count */
103 guint max_reflist0_count;
104 guint max_reflist1_count;
107 guint32 max_frame_num;
108 guint32 log2_max_frame_num;
109 guint32 max_pic_order_cnt;
110 guint32 log2_max_pic_order_cnt;
118 struct _GstVaapiEncoderH264Class
121 GstVaapiEncoderClass parent_class;
126 #endif /*GST_VAAPI_ENCODER_H264_PRIV_H */