2 * Copyright (C) 2009 Wim Taymans <wim.taymans@gmail.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
21 #ifndef __GST_RTP_J2K_COMMON_H__
22 #define __GST_RTP_J2K_COMMON_H__
26 /* Sampling values from RFC 5371 for JPEG 2000 over RTP : https://datatracker.ietf.org/doc/rfc5371/C
28 RGB: standard Red, Green, Blue color space.
30 BGR: standard Blue, Green, Red color space.
32 RGBA: standard Red, Green, Blue, Alpha color space.
34 BGRA: standard Blue, Green, Red, Alpha color space.
36 YCbCr-4:4:4: standard YCbCr color space; no subsampling.
38 YCbCr-4:2:2: standard YCbCr color space; Cb and Cr are subsampled horizontally by 1/2.
40 YCbCr-4:2:0: standard YCbCr color space; Cb and Cr are subsampled horizontally and vertically by 1/2.
42 YCbCr-4:1:1: standard YCbCr color space; Cb and Cr are subsampled vertically by 1/4.
44 GRAYSCALE: basically, a single component image of just multilevels of grey.
48 #define GST_RTP_J2K_RGB "RGB"
49 #define GST_RTP_J2K_BGR "BGR"
50 #define GST_RTP_J2K_RGBA "RGBA"
51 #define GST_RTP_J2K_BGRA "BGRA"
52 #define GST_RTP_J2K_YBRA "YCbCrA"
53 #define GST_RTP_J2K_YBR444 "YCbCr-4:4:4"
54 #define GST_RTP_J2K_YBR422 "YCbCr-4:2:2"
55 #define GST_RTP_J2K_YBR420 "YCbCr-4:2:0"
56 #define GST_RTP_J2K_YBR410 "YCbCr-4:1:0"
57 #define GST_RTP_J2K_GRAYSCALE "GRAYSCALE"
59 #define GST_RTP_J2K_SAMPLING_LIST "sampling = (string) {\"RGB\", \"BGR\", \"RGBA\", \"BGRA\", \"YCbCrA\", \"YCbCr-4:4:4\", \"YCbCr-4:2:2\", \"YCbCr-4:2:0\", \"YCbCr-4:1:1\", \"GRAYSCALE\"}"
64 GST_RTP_SAMPLING_NONE,
67 GST_RTP_SAMPLING_RGBA,
68 GST_RTP_SAMPLING_BGRA,
69 GST_RTP_SAMPLING_YBRA,
70 GST_RTP_SAMPLING_YBR444,
71 GST_RTP_SAMPLING_YBR422,
72 GST_RTP_SAMPLING_YBR420,
73 GST_RTP_SAMPLING_YBR410,
74 GST_RTP_SAMPLING_GRAYSCALE
80 * @GST_J2K_MARKER: Prefix for JPEG 2000 marker
81 * @GST_J2K_MARKER_SOC: Start of Codestream
82 * @GST_J2K_MARKER_SOT: Start of tile
83 * @GST_J2K_MARKER_EOC: End of Codestream
85 * Identifiers for markers in JPEG 2000 code streams
89 GST_J2K_MARKER = 0xFF,
90 GST_J2K_MARKER_SOC = 0x4F,
91 GST_J2K_MARKER_SOT = 0x90,
92 GST_J2K_MARKER_SOP = 0x91,
93 GST_J2K_MARKER_EPH = 0x92,
94 GST_J2K_MARKER_SOD = 0x93,
95 GST_J2K_MARKER_EOC = 0xD9
99 #define GST_RTP_J2K_HEADER_SIZE 8
102 #endif /* __GST_RTP_J2K_COMMON_H__ */