View Full Version : Re-use of PPS id's legal?
Guest
26th July 2008, 16:22
I've come across a stream that uses FMO. It keeps using PPS id 0 even though the slice group data in the PPS changes. Is this legal? If so, it severely complicates random access, because I have to be much more careful about which PPS to inject.
Please tell me it is not legal. :)
Sergey A. Sablin
26th July 2008, 17:50
I've come across a stream that uses FMO. It keeps using PPS id 0 even though the slice group data in the PPS changes. Is this legal? If so, it severely complicates random access, because I have to be much more careful about which PPS to inject.
Please tell me it is not legal. :)
as said in 7.4.1.2.1:
Any picture parameter set NAL unit containing the value of pic_parameter_set_id for the active picture parameter set RBSP shall have the same content as that of the active picture parameter set RBSP unless it follows the last VCL NAL unit of a coded picture and precedes the first VCL NAL unit of another coded picture.
where new sequence is obviously identified by NAL unit containing End Of Sequence RBSP.
Guest
26th July 2008, 18:04
where new sequence is obviously identified by NAL unit containing End Of Sequence RBSP. That's relevant to SPS and I was talking about PPS. According to the quoted section, the PPS contents can change between pictures, so the scenario I gave is indeed legal, and I need to handle it properly.
Sergey A. Sablin
27th July 2008, 10:51
That's relevant to SPS and I was talking about PPS. According to the quoted section, the PPS contents can change between pictures, so the scenario I gave is indeed legal, and I need to handle it properly.
yeah, right. i've read both, than post pps related citation and ... comment on sps :)
strange anyway, I was though it's illegal inside one sequence.
akupenguin
27th July 2008, 11:44
What's the problem with random access, and why are you "injecting" a PPS?
If a stream has global headers, then forget semantic rules; there is no syntactic way to describe multiple meanings for the same PPS id.
If a stream doesn't have global headers, then it should re-send PPS at each keyframe in addition to whenever they change, so you just update your interpretation of the id whenever you reach each PPS.
Guest
27th July 2008, 13:12
The streams I find in the wild do not always behave as they "should".
Try to implement frame accurate random access, and you'll soon see what the problems are. It's easy enough to jump randomly into a stream and start decoding and get the first decodable picture, but it might not be the one you want because you've jumped in just after the PPS you need, and you have to wait for the next one. For frame accuracy you need to start decoding exactly at an indexed frame, so you need to ensure that the required SPS's and PPS's have been injected. Consider, for example, that a stream can send these only once at the beginning of the stream. That's just one of the scenarios you need to deal with. (By "injecting" I mean feeding a NALU to the decoder.)
Another problem is the same as for MPEG2: you have to allow for open GOPs. If you want to navigate to the first frame of an open GOP, you've got a problem.
akupenguin
27th July 2008, 13:41
Frame-accurate seeking requires starting to decode at the keyframe whose dts precedes the indexed frame's pts, and throwing away intermediate decoded frames. So you found a stream that has neither PPS at each keyframe nor global headers? Far be it from me to discourage you, but if I saw such a thing I'd just say "no, you can't seek".
Guest
27th July 2008, 13:46
Frame-accurate seeking requires starting to decode at the keyframe preceding the indexed frame, and throwing away intermediate decoded frames. Of course. But even that won't work for open GOPs (you have to go back one more GOP to get the needed reference frames). But why are you telling me how to do this when I have been doing it for 5 years now with DGMPGDec and now DGAVCDec?
So you found a stream that has neither PPS at each keyframe nor global headers? Far be it from me to discourage you, but if I saw such a thing I'd just say "no, you can't seek". You can't discourage me because it is already working. My goal is to support all legal streams. The SPS/PPS's are available from the indexing operation, so it's just a matter of injecting the right ones when doing a frame accurate seek to a given frame. The code to implement that is simple.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.