use max_num_ref_frames to check the number of refs

https://rbcommons.com/s/OpenH264/r/116/