<blockquote>
<p>A P frame stores only the changes from the previous frame and a B
frame stores only the changes in either direction.</p>
</blockquote>
<p>Not exactly - encoding happens at the macroblock level, and macroblocks, like frames, can be I, P or B (or Skip, but we'll ignore those here).  Frame type definitions follow from these:</p>
<ul>
<li>I frames may only have I macroblocks (remember, we are ignoring skip blocks)</li>
<li>P frames may have I and P macroblocks</li>
<li>B frames may have I, P, and B macroblocks</li>
</ul>
<p>P (and B) blocks are reconstructed by starting with a reference block (or two, whose time offsets may be from the same direction, not necessarily both) that typically has a spatial offset (&quot;motion vector&quot;), and then adding the reconstructed residual to the reference block (or weighted combination of reference blocks).  So it isn't straightforward at all to characterize what happens in generic P and B frames.</p>

CC BY-SA 4.0
2023-11-16T21:51:34.827Z
2023-11-16T21:51:34.827Z
Doug Poland
<p>First we need a primer on I, P and B frames.  An I frame is a frame that is a completely independant picture of the frame.  It doesn't depend on any other frames and is a frame which B and P frames are based on.  A P frame stores only the changes from the previous frame and a B frame stores only the changes in either direction.  IPB uses a mix of all 3 frame types in a set sequence to capture video with much lower data usage, but every P and B frame is an approximation of what the frame that was originally captured was.  They are not exact.</p>

<p>For the same size I frame, all I will ALWAYS be better quality, however, it could be possible for IPB to be better if the camera has a set limit rate for I frame that could end up with larger I frames for the IPB due to the saved space, but that would depend on the exact data rates used by the camera.  The theory behind it would be to say we have all I with 3k per frame (making this number up completely) then we have 30 pictures of whatever quality we can get out of 3k.  Now, if the IPB frame, if we had say 1k per frame on average, but the P and B frames are very small, then it might be possible for the I frame to use 5k of data and the P and B frames to use only .5k each and result in a higher overall quality.</p>

<p>This would depend on the quality of the motion and the data rates being used by the camera however.  In most cases, recording all I on the camera is probably going to produce I frames equal or larger in size than those in IPB.  However, when doing a final output, the highest quality for a given size will almost always be compressing to IPB.  All I will also capture fast motion better since the difference between frames will be larger.</p>

CC BY-SA 3.0
2013-07-03T04:38:02.177Z
2013-07-03T04:38:02.177Z
AJ Henderson
<p>I'm fairly new do filmmaking. I've been trying to figure out which is best, but people seem to have very different opinions and everyone has his own arguments. My guess is that ALL-I should be better because they are all I-Frames, whereas IPB should be used when storage is a concern. However, some people are saying IPB is actually better.  </p>

<p>Any thoughts?</p>

<compression><codec>
ALL-I vs IPB. Which one to use
zzzbbx
# ALL-I vs IPB. Which one to use

(Asked by: username_0 on 2013-07-03)

I'm fairly new do filmmaking. I've been trying to figure out which is best, but people seem to have very different opinions and everyone has his own arguments. My guess is that ALL-I should be better because they are all I-Frames, whereas IPB should be used when storage is a concern. However, some people are saying IPB is actually better.

Any thoughts?

**Tags:** compression, codec


---

## 2 answers

### Answer by username_2 on 2013-07-03. Score: 4 | Accepted answer

First we need a primer on I, P and B frames. An I frame is a frame that is a completely independant picture of the frame. It doesn't depend on any other frames and is a frame which B and P frames are based on. A P frame stores only the changes from the previous frame and a B frame stores only the changes in either direction. IPB uses a mix of all 3 frame types in a set sequence to capture video with much lower data usage, but every P and B frame is an approximation of what the frame that was originally captured was. They are not exact.

For the same size I frame, all I will ALWAYS be better quality, however, it could be possible for IPB to be better if the camera has a set limit rate for I frame that could end up with larger I frames for the IPB due to the saved space, but that would depend on the exact data rates used by the camera. The theory behind it would be to say we have all I with 3k per frame (making this number up completely) then we have 30 pictures of whatever quality we can get out of 3k. Now, if the IPB frame, if we had say 1k per frame on average, but the P and B frames are very small, then it might be possible for the I frame to use 5k of data and the P and B frames to use only .5k each and result in a higher overall quality.

This would depend on the quality of the motion and the data rates being used by the camera however. In most cases, recording all I on the camera is probably going to produce I frames equal or larger in size than those in IPB. However, when doing a final output, the highest quality for a given size will almost always be compressing to IPB. All I will also capture fast motion better since the difference between frames will be larger.


---

### Answer by username_1 on 2023-11-16. Score: 1

> A P frame stores only the changes from the previous frame and a B
> frame stores only the changes in either direction.

Not exactly - encoding happens at the macroblock level, and macroblocks, like frames, can be I, P or B (or Skip, but we'll ignore those here). Frame type definitions follow from these:

* I frames may only have I macroblocks (remember, we are ignoring skip blocks)
* P frames may have I and P macroblocks
* B frames may have I, P, and B macroblocks

P (and B) blocks are reconstructed by starting with a reference block (or two, whose time offsets may be from the same direction, not necessarily both) that typically has a spatial offset ("motion vector"), and then adding the reconstructed residual to the reference block (or weighted combination of reference blocks). So it isn't straightforward at all to characterize what happens in generic P and B frames.


---

