Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
3rd June 2021, 12:36 | #1 | Link | |
Registered User
Join Date: Mar 2021
Posts: 84
|
The first IDR-frame as reference for the first 2 B-frames
H.264 specs says :
Quote:
As you can see ,only one I/P frame can be used as reference for B-frames. it means the same reference frame can use for both RefPicList0 and RefPicList1, but the document does not have enough details about it.( or it is difficalt to understand at least to me) my question: How to set the first IDR-frame as the only reference for the first B-frames in the open-GOP stream with this pattern:BBIBBPBB...? / How to implement it in the x264/libx264 source code? Note: I want this to be done for the first two B-frames , not the rest of the stream. (sorry if my English is bad) Last edited by Mitra; 6th June 2021 at 18:41. |
|
3rd June 2021, 20:53 | #2 | Link |
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,893
|
I'm confused. A B-frame can absolutely have more than one I/P frame it can reference. And a non-reference b-frame can reference more than one I/P/B frame. A B-frame is really defined by referencing both a past and a future frame.
Are you trying to force a single reference for some reason? In a way that --ref 1 wouldn't give you? |
3rd June 2021, 22:26 | #3 | Link | |
Registered User
Join Date: Mar 2021
Posts: 84
|
Quote:
Unfortunately, Common mistakes on the Internet is confusing. . . . I used to think like you until a while ago, but according to the ITU document, this does not seem to be true. Also many commercial encoders starts open-GOP stream with this pattern: BBIBBPBB...(stream order) , in this pattern, the first I(DR) is the only reference for both first B-frames. As you know ref parameter can set the number of previous frames each P-frame can use as references,but ref=1 does not work for B-Frames. Last edited by Mitra; 28th June 2021 at 08:30. |
|
4th June 2021, 00:20 | #4 | Link | |
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,893
|
Quote:
B-frames have ALWAYS used both forward and backward prediction, and thus at least 2 frames, all the way back to MPEG-1. Older codecs like MPEG-1/2 and VC-1 supported 2 reference frames for B-frames while allowing only 1 reference for P-frames. The resulting improvement in compression efficiency from the bidirectional prediction making B-frames smaller is a key motivation for B-frames in the first place (they also reduced cumulative drift due to different floating point implementations in MPEG-1/2). The x264/x265 --ref syntax is dumb as it means different things with and without B-frames. It should really follow the bitstream syntax parameter, so the max ref frames is the same with and without B-frames |
|
4th June 2021, 06:52 | #5 | Link | |
Registered User
Join Date: Mar 2021
Posts: 84
|
Quote:
So, please explain the reference of the first two B-frames of this sample and show me how we can do this by x264 , Etc. StreamEye says the only reference for both is the first IDR. Note: I'm talking about the first 2 B-frames , not the rest of the stream. Last edited by Mitra; 4th June 2021 at 07:08. |
|
4th June 2021, 20:34 | #6 | Link | |
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,893
|
Quote:
I think it is technically possible for one of those to reference a P-frame after the IDR, but for most content the encoder wouldn't find useful references there to use, so they wouldn't be in the list. x264 doesn't have --radl, of course. You could evaluate this if you used a QPfile to force a "bbIP" start sequence, and make the P a better reference for the bb than the I is. |
|
4th June 2021, 21:12 | #7 | Link | |
Registered User
Join Date: Mar 2021
Posts: 84
|
Quote:
Thanks for your explanation, but unfortunately not possible with QPfile ,because using QPfile, the first frame in stream order will always be IDR ,not B. Last edited by Mitra; 4th June 2021 at 22:24. |
|
Tags |
h.264 encoder, libx264.dll, video codec, x264 |
Thread Tools | Search this Thread |
Display Modes | |
|
|