libs: encoder: h265: add multi reference support
authorHyunjun Ko <zzoon@igalia.com>
Wed, 13 Sep 2017 02:39:09 +0000 (11:39 +0900)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Wed, 13 Sep 2017 08:36:34 +0000 (10:36 +0200)
commitaa6aa996d672996227f8b529b21b7396063d63c4
tree54d726e249fc817003c134061080a79c036143cb
parent3dbf44037307916afd0193e705a9300bf0b9d7e5
libs: encoder: h265: add multi reference support

This is doing the same as h264 encoder as the following:

Using num_ref_frames provided and the result of the Query
VAConfigAttribEncMaxRefFrames, it determines the size of reference list
and perform encoding with multi reference frames as the following:

1\ The num_ref_frames is being considered as the number of
reference picture list0
2\ Encoder adds 1 reference frame more to the reference picture list1
internally if b-frame encoding.
3\ If num_ref_frames is bigger than the number of refrence frames
supported in the driver, it will be lowered.

Also this patch includes:
- Set num_negative_pics and num_positive_pics according to the number of
refs.
- Set delta_poc according to the number of refs.
- Increase max_dec_pic_buffering according to the number of refs
- Change max_num_reorder_pics according to num of bframes

https://bugzilla.gnome.org/show_bug.cgi?id=783804
gst-libs/gst/vaapi/gstvaapiencoder_h265.c