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))
39 GST_VAAPI_ENCODER_H264_LEVEL_10 = 10, /* QCIF format, < 380160 samples/sec */
40 GST_VAAPI_ENCODER_H264_LEVEL_11 = 11, /* CIF format, < 768000 samples/sec */
41 GST_VAAPI_ENCODER_H264_LEVEL_12 = 12, /* CIF format, < 1536000 samples/sec */
42 GST_VAAPI_ENCODER_H264_LEVEL_13 = 13, /* CIF format, < 3041280 samples/sec */
43 GST_VAAPI_ENCODER_H264_LEVEL_20 = 20, /* CIF format, < 3041280 samples/sec */
44 GST_VAAPI_ENCODER_H264_LEVEL_21 = 21, /* HHR format, < 5068800 samples/sec */
45 GST_VAAPI_ENCODER_H264_LEVEL_22 = 22, /* SD/4CIF format, < 5184000 samples/sec */
46 GST_VAAPI_ENCODER_H264_LEVEL_30 = 30, /* SD/4CIF format, < 10368000 samples/sec */
47 GST_VAAPI_ENCODER_H264_LEVEL_31 = 31, /* 720pHD format, < 27648000 samples/sec */
48 GST_VAAPI_ENCODER_H264_LEVEL_32 = 32, /* SXGA format, < 55296000 samples/sec */
49 GST_VAAPI_ENCODER_H264_LEVEL_40 = 40, /* 2Kx1K format, < 62914560 samples/sec */
50 GST_VAAPI_ENCODER_H264_LEVEL_41 = 41, /* 2Kx1K format, < 62914560 samples/sec */
51 GST_VAAPI_ENCODER_H264_LEVEL_42 = 42, /* 2Kx1K format, < 125829120 samples/sec */
52 GST_VAAPI_ENCODER_H264_LEVEL_50 = 50, /* 3672x1536 format, < 150994944 samples/sec */
53 GST_VAAPI_ENCODER_H264_LEVEL_51 = 51, /* 4096x2304 format, < 251658240 samples/sec */
54 } GstVaapiEncoderH264Level;
56 #define GST_VAAPI_ENCODER_H264_DEFAULT_PROFILE GST_VAAPI_PROFILE_H264_BASELINE
57 #define GST_VAAPI_ENCODER_H264_DEFAULT_LEVEL GST_VAAPI_ENCODER_H264_LEVEL_31
58 #define GST_VAAPI_ENCODER_H264_DEFAULT_INIT_QP 26
59 #define GST_VAAPI_ENCODER_H264_DEFAULT_MIN_QP 1
60 #define GST_VAAPI_ENCODER_H264_DEFAULT_INTRA_PERIOD 30
61 #define GST_VAAPI_ENCODER_H264_MAX_INTRA_PERIOD 512
62 #define GST_VAAPI_ENCODER_H264_MAX_IDR_PERIOD 512
64 #define GST_VAAPI_ENCODER_H264_DEFAULT_SLICE_NUM 1
66 struct _GstVaapiEncoderH264
68 GstVaapiEncoder parent;
73 guint32 bitrate; /*kbps */
76 guint32 init_qp; /*default 24 */
77 guint32 min_qp; /*default 1 */
82 gboolean is_avc; /* avc or bytestream */
84 GQueue reorder_frame_list;
88 guint cur_present_index;
89 GstClockTime cts_offset;
94 /* max reflist count */
95 guint max_reflist0_count;
96 guint max_reflist1_count;
99 guint32 max_frame_num;
100 guint32 log2_max_frame_num;
101 guint32 max_pic_order_cnt;
102 guint32 log2_max_pic_order_cnt;
112 #endif /*GST_VAAPI_ENCODER_H264_PRIV_H */