[Mp4-tech] B frame bit-rate in H.264 stream

Gary Sullivan garysull windows.microsoft.com
Thu Sep 20 12:56:49 EDT 2007


Chanfeng et al,
After re-reading your orginal message, I am not sure whether or not the question that you were asking is the one that I was answering.  I thought you were commenting on differences in behavior depending on whether the first of two consecutive B frames is used as a reference or not.  But now I think maybe your question was different.
Some things to think about include the ordering of the reference picture lists (which is determined by the encoder) and the potential effects of the entropy coding mode -- you didn't say which mode you were using.  CABAC has a greater ability to adapt to the statistics of what the encoder is actually doing, while VLC operation may cause excess overhead if the statistics of the macroblock/sub-macroblock prediction modes and reference picture index values are not well matched to the ue(v) Exp-Golomb VLC code that is used to represent them.
Best Regards,
Gary Sullivan
________________________________
From: mp4-tech-bounces lists.mpegif.org [mailto:mp4-tech-bounces lists.mpegif.org] On Behalf Of Gary Sullivan
Sent: Thursday, September 20, 2023 10:42 AM
To: changfeng niu; mp4-tech lists.mpegif.org
Subject: RE: [Mp4-tech] B frame bit-rate in H.264 stream
Chanfeng et al,
You didn't say exactly what bitstream order and output order these frames are following.
If I make the old-fashioned MPEG-2-style assumption, it would look like this temporally:
I0, B1, B2, P3, B4, ..., Pn, Bn+1, Bn+2, Pn+3, ...
and would look like this in bitstream order
I0, P3, B1, B2, P6, ..., Pn+3, Bn+1, Bn+2, Pn+6, ...
Where, in the MPEG-2 case, Bn+1 and Bn+2 use Pn and Pn+3 as references.
I think what you are saying is that you see a lower bit rate for Bn+2 when Bn+1 and Pn+3 are used as references than when Pn and Pn+3 are used as references.
This only makes sense, because Bn+1 is temporally much closer to Bn+2 than Pn is.
The temporal prediction distance to Bn+1 is cut in half, so it should be obvious that Bn+2 should be a better predictor than Pn.
This may somewhat depend, however, on the fidelity used for the encoding of the different pictures.  For overall average PSNR optimization, it is typically better to decrease fidelity somewhat as one moves upward in the prediction structure.  So ordinarily, when using B frames as reference pictures, I0 would use the highest fidelity, Pn+3 would have the next highest fidelity, Bn+1 would have the next highest fidelity, and Bn+2 would have the lowest fidelity.  However, that rule of thumb might need some adjustment for perceptual optimization purposes.
Best Regards,
Gary Sullivan
________________________________
From: mp4-tech-bounces lists.mpegif.org [mailto:mp4-tech-bounces lists.mpegif.org] On Behalf Of changfeng niu
Sent: Wednesday, September 19, 2023 6:48 PM
To: mp4-tech lists.mpegif.org
Subject: [Mp4-tech] B frame bit-rate in H.264 stream
Hello everyone:
 First, I would like to ask a question about H.264 video coding. When I use JM
8.6 to code, I find that for almost all sequences the second one of  two
successive B frames mostly has fewer bits than the first one without B frame as a
reference. Why?
  Now, I am working on transcoding from MPEG2 to H.264. I meet such a similar
question. When coding with MPEG2 decoder reconstruction picture as JM 8.6
inputfile, I frame, P frame and the first one of two successive B frames without B
frame as a reference have almost the same bits and PSNR as tanscoing procedure and
coding bits of the second one of two successive B frames are fewer notably than
the first one of two successive B frames .However two successive B frames mostly
have the same bits without B frame as a reference in our transcoding procedure .
  Our transcoding procedure has the same configuration parameters except following
two differences  with JM 8.6.
1. Whether a macroblock is coded as a intra one or a inter one lies on MPEG2
encoder in transcoding  procedure while it is decided by mode selection in JM 8.6.
2. In transcoing procedure mv of a macroblock constitutes of MPEG2 mv integer and
inserted subpixell using H.264 arithmetic while it is get by full searching
restricted to 16 pixels in JM 8.6.
I don't know whether mv makes an influence or not.
Waiting for your answer.Thanks very much!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/mp4-tech/attachments/20070920/c325f1ba/attachment-0001.html


More information about the Mp4-tech mailing list