Search code examples
webrtc

Why the num_references is 1 for p frames in webrtc?


In webrtc, the reference frame for non-keyframe is 1:

frame->num_references = frame->frame_type() == kVideoFrameKey ? 0 : 1;

But for h264, the reference frames can be at most 16? Why it is 1 in webrtc?


Solution

  • I suppose you look on this rtp code https://webrtc.googlesource.com/src/webrtc/+/f54860e9ef0b68e182a01edc994626d21961bc4b/modules/video_coding/rtp_frame_reference_finder.cc

    Take a look on other occurrences of frame->num_references in the file and you will see that it is not always 0 or 1.