title: h264 syntax (P frames syntax details)
body: <p>I'm parsing h264 NAL Units. In my sequence - there are NAL Units with picture parameters set, sequence parameters set, I frames (they are also IDR) and P frames (I and P frames consits of single slice). (No B frames at all)</p>
  
  <p>So I have the stream of NAL Units looks like:</p>
  
  <pre><code>[SPS] [PPS] [I(IDR)] [P] [P] [P] ... [P] [P] [SPS] [PPS] [I(IDR)] [P] [P] [P] ....
  </code></pre>
  
  <p>Each I frame in my stream is also IDR frame, so its frame_num is 0 (acording to h.264 standart).</p>
  
  <p>Also each P frame has <code>frame_num</code> per unit greater than the previous frame.</p>
  
  <p>But, I'm confused about <code>pic_order_cnt_lsb</code>.</p>
  
  <p>What does <code>pic_order_cnt_lsb</code> represents?</p>
  
  <p>In my sequence:</p>
  
  <ul>
  <li>if P frame has <code>frame_num==2</code> its
  <code>pic_order_cnt_lsb==4</code> </li>
  <li>if P frame has    <code>frame_num==3</code> its 
  <code>pic_order_cnt_lsb==6</code> </li>
  <li>if P frame has    <code>frame_num==4</code> its 
  <code>pic_order_cnt_lsb==8</code></li>
  <li>etc... (in my situation <code>pic_order_cnt_lsb == 2*frame_num</code>)</li>
  </ul>
  
  <p>And why there is such correlation between <code>frame_num</code> and <code>pic_order_cnt_lsb</code>?</p>
  
  <p>Thanks,</p>