Frame-num - defines decoding order of AUs (Access Units) in the encoded bitstream. According to H264 standard frame_num is stored in the slice header, setted to zero on each IDR AU and incremented on each reference frame.
For more information please refer to 7.4.3 section of ITU-T H.264.
POC(Picture Order Count) - defines display order of AUs in the encoded bitstream. According to H264 standard POC is derived from slice headers proportional to AUs timings starting from the first IDR AU where POC is equal to 0. POC is defined in H264 standard by TopFieldOrderCount and BottomFieldOrderCount.
There are several types of POC calculation (in H264 standard):
- TopFieldOrderCount can be calculated as POCMsb + POCLsb, where POCLsb is encoded in each slice header, and POCMsb increased when POCLsb reaches its limit. delta_POC_bottom may be presented in the slice header and define the delta POC between the top and bottom fields. By default delta_POC_bottom is 0, so paired fields have the same display order, but some encoders prefer to define it as 1 to represent field ordering.
- Encoder sets up incrementing options in SPS and writes only delta if there are any changes in the expected delta. This type of POC calculation is preferably used in the case of cyclic GOPs without adaptive changes in order.
This type of POC calculation uses a number of POC cycles (groups of non-reference frames between reference frames, sometimes also called mini-GOP), frame position in the current cycle, expected POC for the last reference frame
- In case the display order is equal to decode order and there is only one non-reference frame between two reference frames type 3 of the POC calculation algorithm is:
if current frame is reference POC = 2*frame_num, else POC = 2*frame_num-1.
For more information please refer to 8.2.1 section of ITU-T H.264.