An ADU is made of several packetization units. If a packetization unit is bigger than the maximum size of an RTP packet payload, the unit is split into multiple RTP packet payloads, as illustrated in
Figure 1. As seen there, each packet
SHALL contain (part of) one, and only one, packetization unit. A packetization unit may extend over multiple packets. The payload of every packet
SHALL have the same size (based, e.g., on the Maximum Transfer Unit of the network) with the possible exception of the last packet of a packetization unit. The boundaries of a packetization unit
SHALL coincide with the boundaries of the payload of a packet (excluding the payload header), i.e., the first (or, respectively, last) byte of the packetization unit
SHALL be the first (or, respectively, last) byte of the payload (excluding its header).
RTP +-----+------------------------+
Packet #1 | Hdr | Packetization unit #1 |
+-----+------------------------+
RTP +-----+--------------------------------------+
Packet #2 | Hdr | Packetization unit #2 |
+-----+--------------------------------------+
RTP +-----+--------------------------------------------------+
Packet #3 | Hdr | Packetization unit #3 (part 1/3) |
+-----+--------------------------------------------------+
RTP +-----+--------------------------------------------------+
Packet #4 | Hdr | Packetization unit #3 (part 2/3) |
+-----+--------------------------------------------------+
RTP +-----+----------------------------------------------+
Packet #5 | Hdr | Packetization unit #3 (part 3/3) |
+-----+----------------------------------------------+
...
RTP +-----+-----------------------------------------+
Packet #P | Hdr | Packetization unit #N (part q/q) |
+-----+-----------------------------------------+
There are two different packetization modes defined for this RTP payload format.
-
Codestream packetization mode:
-
In this mode, the packetization unit SHALL be the entireJPEG XS picture segment (i.e., codestream preceded by boxes). This means thata progressive frame will have a single packetization unit, while an interlacedframe will have two. The progressive case is illustrated in Figure 2.
-
Slice packetization mode:
-
In this mode, the packetization unit SHALL be the slice,i.e., there SHALL be data from no more than one slice per RTPpacket. The first packetization unit SHALL be made of the JPEGXS header segment (i.e., the concatenation of the VS box, the CS box, and theJPEG XS codestream header). This first unit is then followed by successiveunits, each containing one and only one slice. The packetization unitcontaining the last slice of a JPEG XS codestream SHALL alsocontain the EOC marker immediately following this last slice. This isillustrated in Figure 3. In thecase of an interlaced frame, the JPEG XS header segment of the second fieldSHALL be in its own packetization unit.
RTP +-----+--------------------------------------------------+
Packet #1 | Hdr | VS box + CS box + JPEG XS codestream (part 1/q) |
+-----+--------------------------------------------------+
RTP +-----+--------------------------------------------------+
Packet #2 | Hdr | JPEG XS codestream (part 2/q) |
+-----+--------------------------------------------------+
...
RTP +-----+--------------------------------------+
Packet #P | Hdr | JPEG XS codestream (part q/q) |
+-----+--------------------------------------+
RTP +-----+----------------------------+
Packet #1 | Hdr | JPEG XS header segment |
+-----+----------------------------+
RTP +-----+--------------------------------------------------+
Packet #2 | Hdr | Slice #1 (part 1/2) |
+-----+--------------------------------------------------+
RTP +-----+-------------------------------------------+
Packet #3 | Hdr | Slice #1 (part 2/2) |
+-----+-------------------------------------------+
RTP +-----+--------------------------------------------------+
Packet #4 | Hdr | Slice #2 (part 1/3) |
+-----+--------------------------------------------------+
...
RTP +-----+---------------------------------------+
Packet #P | Hdr | Slice #N (part q/q) + EOC marker |
+-----+---------------------------------------+
In a constant bitrate (CBR) scenario of JPEG XS, the codestream packetization mode guarantees that a JPEG XS RTP stream will produce both a constant number of bytes per video frame and a constant number of RTP packets per video frame. However, to provide similar guarantees with JPEG XS in a variable bitrate (VBR) mode or when using the slice packetization mode (for either CBR or VBR), additional mechanisms are needed. This can involve a constraint at the rate allocation stage in the JPEG XS encoder to impose a CBR at the slice level, the usage of padding data, or the insertion of empty RTP packets (i.e., an RTP packet whose payload data is empty). But, management of the amount of produced packets per video frame is application dependent and not a strict requirement of this RTP payload specification.
The format of the RTP header is specified in [
RFC 3550] and reprinted in
Figure 4 for convenience. This RTP payload format uses the fields of the header in a manner consistent with that specification.
The RTP payload (and the settings for some RTP header bits) for packetization units are specified in
Section 4.3.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|V=2|P|X| CC |M| PT | sequence number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| timestamp |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| synchronization source (SSRC) identifier |
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
| contributing source (CSRC) identifiers |
| .... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The version (V), padding (P), extension (X), CSRC count (CC), sequence number, synchronization source (SSRC), and contributing source (CSRC) fields follow their respective definitions in [
RFC 3550].
The remaining RTP header information to be set according to this RTP payload format is set as follows:
-
Marker (M) [1 bit]:
-
If progressive scan video is being transmitted, the marker bit denotes the end of a video frame. If interlaced video is being transmitted, it denotes the end of the field. The marker bit SHALL be set to 1 for the last packet of the video frame/field. It SHALL be set to 0 for all other packets.
-
Payload Type (PT) [7 bits]:
-
The payload type is a dynamically allocated payload type field that designates the payload as JPEG XS video.
-
Timestamp [32 bits]:
-
The RTP timestamp is set to the sampling timestamp of the content. A 90 kHz clock rate SHALL be used.
As specified in [RFC 3550] and [RFC 4175], the RTP timestamp designates the sampling instant of the first octet of the video frame to which the RTP packet belongs. Packets SHALL NOT include data from multiple video frames, and all packets belonging to the same video frame SHALL have the same timestamp. Several successive RTP packets will consequently have equal timestamps if they belong to the same video frame (that is until the marker bit is set to 1, marking the last packet of the video frame), and the timestamp is only increased when a new video frame begins.
If the sampling instant does not correspond to an integer value of the clock, the value SHALL be truncated to the next lowest integer, with no ambiguity.
The payload data of a JPEG XS RTP stream consists of a concatenation of multiple JPEG XS frames. Within the RTP stream, all of the video support boxes and all of the color specification boxes
SHALL retain their respective layouts for each JPEG XS frame. Thus, each video support box in the RTP stream
SHALL define the same sub boxes. The effective values in the boxes are allowed to change under the condition that their relative byte offsets
SHALL NOT change.
Each JPEG XS frame is the concatenation of one or more packetization unit(s), as explained in
Section 4.1.
Figure 6 depicts this layout for a progressive video frame in the codestream packetization mode,
Figure 7 depicts this layout for an interlaced video frame in the codestream packetization mode,
Figure 8 depicts this layout for a progressive video frame in the slice packetization mode, and
Figure 9 depicts this layout for an interlaced video frame in the slice packetization mode. The Frame counter value is not indicated because the value is constant for all packetization units of a given video frame.
+=====[ Packetization unit (PU) #1 ]====+
| Video support box | SEP counter=0
| +---------------------------------+ | P counter=0
| : Sub boxes of the VS box : |
| +---------------------------------+ |
+- - - - - - - - - - - - - - - - - - - -+
| Color specification box |
| +---------------------------------+ |
| : Fields of the CS box : |
| +---------------------------------+ |
+- - - - - - - - - - - - - - - - - - - -+
| JPEG XS codestream |
: (part 1/q) : M=0, K=0, L=0, I=00
+---------------------------------------+
| JPEG XS codestream | SEP counter=0
| (part 2/q) | P counter=1
: : M=0, K=0, L=0, I=00
+---------------------------------------+
| JPEG XS codestream | SEP counter=0
| (part 3/q) | P counter=2
: : M=0, K=0, L=0, I=00
+---------------------------------------+
: :
+---------------------------------------+
| JPEG XS codestream | SEP counter=1
| (part 2049/q) | P counter=0
: : M=0, K=0, L=0, I=00
+---------------------------------------+
: :
+---------------------------------------+
| JPEG XS codestream | SEP counter=(q-1) div 2048
| (part q/q) | P counter=(q-1) mod 2048
: : M=1, K=0, L=1, I=00
+=======================================+
+=====[ Packetization unit (PU) #1 ]====+
| Video support box | SEP counter=0
+- - - - - - - - - - - - - - - - - - - -+ P counter=0
| Color specification box |
+- - - - - - - - - - - - - - - - - - - -+
| JPEG XS codestream (1st field) |
: (part 1/q) : M=0, K=0, L=0, I=10
+---------------------------------------+
| JPEG XS codestream (1st field) | SEP counter=0
| (part 2/q) | P counter=1
: : M=0, K=0, L=0, I=10
+---------------------------------------+
: :
+---------------------------------------+
| JPEG XS codestream (1st field) | SEP counter=1
| (part 2049/q) | P counter=0
: : M=0, K=0, L=0, I=10
+---------------------------------------+
: :
+---------------------------------------+
| JPEG XS codestream (1st field) | SEP counter=(q-1) div 2048
| (part q/q) | P counter=(q-1) mod 2048
: : M=1, K=0, L=1, I=10
+===============[ PU #2 ]===============+
| Video support box | SEP counter=0
+- - - - - - - - - - - - - - - - - - - -+ P counter=0
| Color specification box |
+- - - - - - - - - - - - - - - - - - - -+
| JPEG XS codestream (2nd field) |
| (part 1/q) |
: : M=0, K=0, L=0, I=11
+---------------------------------------+
| JPEG XS codestream (2nd field) | SEP counter=0
| (part 2/q) | P counter=1
: : M=0, K=0, L=0, I=11
+---------------------------------------+
: :
+---------------------------------------+
| JPEG XS codestream (2nd field) | SEP counter=(q-1) div 2048
| (part q/q) | P counter=(q-1) mod 2048
: : M=1, K=0, L=1, I=11
+=======================================+
+===[ PU #1: JPEG XS Header segment ]===+
| Video support box | SEP counter=0x07FF
+- - - - - - - - - - - - - - - - - - - -+ P counter=0
| Color specification box |
+- - - - - - - - - - - - - - - - - - - -+
| JPEG XS codestream header |
| +---------------------------------+ |
| : Markers and marker segments : |
| +---------------------------------+ | M=0, T=0, K=1, L=1, I=00
+==========[ PU #2: Slice #1 ]==========+
| +---------------------------------+ | SEP counter=0
| | SLH Marker | | P counter=0
| +---------------------------------+ |
| : Entropy Coded Data : |
| +---------------------------------+ | M=0, T=0, K=1, L=1, I=00
+==========[ PU #3: Slice #2 ]==========+
| Slice #2 | SEP counter=1
| (part 1/q) | P counter=0
: : M=0, T=0, K=1, L=0, I=00
+---------------------------------------+
| Slice #2 | SEP counter=1
| (part 2/q) | P counter=1
: : M=0, T=0, K=1, L=0, I=00
+---------------------------------------+
: :
+---------------------------------------+
| Slice #2 | SEP counter=1
| (part q/q) | P counter=q-1
: : M=0, T=0, K=1, L=1, I=00
+=======================================+
: :
+========[ PU #N: Slice #(N-1) ]========+
| Slice #(N-1) | SEP counter=N-2
| (part 1/r) | P counter=0
: : M=0, T=0, K=1, L=0, I=00
+---------------------------------------+
: :
+---------------------------------------+
| Slice #(N-1) | SEP counter=N-2
| (part r/r) | P counter=r-1
: + EOC marker : M=1, T=0, K=1, L=1, I=00
+=======================================+
+====[ PU #1: JPEG XS Hdr segment 1 ]===+
| Video support box | SEP counter=0x07FF
+- - - - - - - - - - - - - - - - - - - -+ P counter=0
| Color specification box |
+- - - - - - - - - - - - - - - - - - - -+
| JPEG XS codestream header 1 |
| +---------------------------------+ |
| : Markers and marker segments : |
| +---------------------------------+ | M=0, T=0, K=1, L=1, I=10
+====[ PU #2: Slice #1 (1st field) ]====+
| +---------------------------------+ | SEP counter=0
| | SLH Marker | | P counter=0
| +---------------------------------+ |
| : Entropy Coded Data : |
| +---------------------------------+ | M=0, T=0, K=1, L=1, I=10
+====[ PU #3: Slice #2 (1st field) ]====+
| Slice #2 | SEP counter=1
| (part 1/q) | P counter=0
: : M=0, T=0, K=1, L=0, I=10
+---------------------------------------+
| Slice #2 | SEP counter=1
| (part 2/q) | P counter=1
: : M=0, T=0, K=1, L=0, I=10
+---------------------------------------+
: :
+---------------------------------------+
| Slice #2 | SEP counter=1
| (part q/q) | P counter=q-1
: : M=0, T=0, K=1, L=1, I=10
+=======================================+
: :
+==[ PU #N: Slice #(N-1) (1st field) ]==+
| Slice #(N-1) | SEP counter=N-2
| (part 1/r) | P counter=0
: : M=0, T=0, K=1, L=0, I=10
+---------------------------------------+
: :
+---------------------------------------+
| Slice #(N-1) | SEP counter=N-2
| (part r/r) | P counter=r-1
: + EOC marker : M=1, T=0, K=1, L=1, I=10
+=======================================+
+===[ PU #N+1: JPEG XS Hdr segment 2 ]==+
| Video support box | SEP counter=0x07FF
+- - - - - - - - - - - - - - - - - - - -+ P counter=0
| Color specification box |
+- - - - - - - - - - - - - - - - - - - -+
| JPEG XS codestream header 2 |
| +---------------------------------+ |
| : Markers and marker segments : |
| +---------------------------------+ | M=0, T=0, K=1, L=1, I=11
+===[ PU #N+2: Slice #1 (2nd field) ]===+
| +---------------------------------+ | SEP counter=0
| | SLH Marker | | P counter=0
| +---------------------------------+ |
| : Entropy Coded Data : |
| +---------------------------------+ | M=0, T=0, K=1, L=1, I=11
+===[ PU #N+3: Slice #2 (2nd field) ]===+
| Slice #2 | SEP counter=1
| (part 1/s) | P counter=0
: : M=0, T=0, K=1, L=0, I=11
+---------------------------------------+
| Slice #2 | SEP counter=1
| (part 2/s) | P counter=1
: : M=0, T=0, K=1, L=0, I=11
+---------------------------------------+
: :
+---------------------------------------+
| Slice #2 | SEP counter=1
| (part s/s) | P counter=s-1
: : M=0, T=0, K=1, L=1, I=11
+=======================================+
: :
+==[ PU #2N: Slice #(N-1) (2nd field) ]=+
| Slice #(N-1) | SEP counter=N-2
| (part 1/t) | P counter=0
: : M=0, T=0, K=1, L=0, I=11
+---------------------------------------+
: :
+---------------------------------------+
| Slice #(N-1) | SEP counter=N-2
| (part t/t) | P counter=t-1
: + EOC marker : M=1, T=0, K=1, L=1, I=11
+=======================================+