2 * Copyright (C) 2012 Samsung Electronics Co., Ltd. All rights reserved.
4 * Author: Sunghyun Eum <sunghyun.eum@samsung.com>
6 * This library is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU Lesser General Public License as published by the
8 * Free Software Foundation; either version 2.1 of the License, or (at your option)
11 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 * License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this library; if not, write to the Free Software Foundation, Inc., 51
18 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
27 /* modification: byte-stream(nal) - packetized (3gpp) converting (h264dec, h264enc) */
28 #define GSTOMX_H264_MDATA 6 /* packtized meta data size. (ver, profile...) */
29 #define GSTOMX_H264_A_DCI_LEN 4 /* 4-byte sps, pps size field in append dci*/
30 #define GSTOMX_H264_C_DCI_LEN 2 /* 2-byte sps, pps size field in codec data*/
31 #define GSTOMX_H264_CNT_LEN 1 /* 1-byte sps, pps count field */
33 #define GSTOMX_H264_NAL_START_LEN 4
34 #define GSTOMX_H264_SPSPPS_LEN 2
38 GSTOMX_H264_NUT_UNKNOWN = 0,
39 GSTOMX_H264_NUT_SLICE = 1,
40 GSTOMX_H264_NUT_DPA = 2,
41 GSTOMX_H264_NUT_DPB = 3,
42 GSTOMX_H264_NUT_DPC = 4,
43 GSTOMX_H264_NUT_IDR = 5,
44 GSTOMX_H264_NUT_SEI = 6,
45 GSTOMX_H264_NUT_SPS = 7,
46 GSTOMX_H264_NUT_PPS = 8,
47 GSTOMX_H264_NUT_AUD = 9,
48 GSTOMX_H264_NUT_EOSEQ = 10,
49 GSTOMX_H264_NUT_EOSTREAM = 11,
50 GSTOMX_H264_NUT_FILL = 12,
51 GSTOMX_H264_NUT_MIXED = 24,
52 } GSTOMX_H264_NAL_UNIT_TYPE;
56 GSTOMX_H264_FORMAT_UNKNOWN,
57 GSTOMX_H264_FORMAT_PACKETIZED,
58 GSTOMX_H264_FORMAT_BYTE_STREAM,
59 } GSTOMX_H264_STREAM_FORMAT;
61 #define GSTOMX_H264_WB32(p, d) \
63 ((unsigned char*)(p))[3] = (d); \
64 ((unsigned char*)(p))[2] = (d)>>8; \
65 ((unsigned char*)(p))[1] = (d)>>16; \
66 ((unsigned char*)(p))[0] = (d)>>24; \
69 #define GSTOMX_H264_WB16(p, d) \
71 ((unsigned char*)(p))[1] = (d); \
72 ((unsigned char*)(p))[0] = (d)>>8; \
75 #define GSTOMX_H264_RB16(x) ((((const unsigned char*)(x))[0] << 8) | ((const unsigned char*)(x))[1])
77 #define GSTOMX_H264_RB32(x) ((((const unsigned char*)(x))[0] << 24) | \
78 (((const unsigned char*)(x))[1] << 16) | \
79 (((const unsigned char*)(x))[2] << 8) | \
80 ((const unsigned char*)(x))[3])
83 #endif /* GSTOMX_H264_H */