Howcan I force a GOP structure in VP9 encoder?

Skip to first unread message

Anton Bilan

Dec 11, 2020, 1:32:44 AM12/11/20

I would like to have some P-pictures and B-pictures (by B-pictures I mean that some blocks during motion estimation can be used either in one reference frame or in the other, not compounding). It looks like a frame can reference 3 other frames for prediction in VPX, so it seems I can disable altref frames and then set reference for VP8_LAST_FRAME and for VP8_GOLD_FRAME as in the example vp9cx_set_ref.c using vpx_codec_controls' VP8_SET_REFERENCE. But for that I would need to get already decoded (quantized/dequantized) versions for the reference frames plus it seems it is not going to work out of the box on the decoder side.

I have my frames already reordered and what I really would like to do is simply to tell VPX:
here is frame 1;
here is frame 3, use frame 1 as a reference;
here is frame 2, use frames 1 and 3 as references;
Is there a way to do it ?

Message has been deleted

Anton Bilan

Dec 25, 2020, 10:00:39 AM12/25/20
to Hyun-Gyu Kim, Codec Developers
Thank you for your answer.
Could explain to me how prediction for the frame 3 is performed in this example:
1. Frame 1 is coded with flags VPX_EFLAG_FORCE_KF and VP8_EFLAG_FORCE_GF set
2. Frame 2 is coded with flags VP8_EFLAG_NO_UPD_GF set
3. Now comes Frame 3, can it reference for some of the blocks Frame 1 (golden frame) and for the others Frame 2 (last frame) or it must reference only one of these for all the blocks?
Thank you.

On Mon, Dec 14, 2020 at 8:09 AM Hyun-Gyu Kim <> wrote:

Since there is no reordering option in VP9,  VPx generally uses ALT_REF for bi-prediction.
In this case, ALT_REF is copied from a future frame in the GOP and coded as ALT_REF.
Because ALT_REF is not displayed, it works likes bi-prediction without reordering. 

For more details, Please refer "5. The Alternate (or Constructed) Reference Frame" in 

Reply all
Reply to author
0 new messages