Changing maxNumRefFramesInDPB and ltrNumFrames values (between 1 - 16, technically HEVC standard allows up to 15 long term reference pictures) don’t seem to make any difference. Output HEVC file size remains almost the same (in few kilobytes difference only).
Any nvidia staff can explain? What exactly am I suppose to expect from nvidia nvenc when enabling LTR for HEVC encoding?
Just changing maxNumRefFramesInDPB and ltrNumFrames in the API will not change anything in the bitstream other than signaling in the bitstream the changed DPB parameters. To actually affect the bitstream, you will need to request the encoder to use specific LTR frames for encoding the picture.
Note that ltrTrustMode = 1 mode of operation may be deprecated in the future so we discourage using this mode of operation. Instead, use ltrNumFrames, ltrMarkFrame, ltrUseFrames, ltrUseFrameBitmap and ltrMarkFrameIdx to use long-term reference frame functionality.
So, this means, one needs to ‘manually’ send a request to encoder to mark a frame as LTR for it to be used to encode next frame.
Thus;
maxNumRefFramesInDPB = 16
ltrNumFrames = 16
Since ltrTrustMode will be deprecated soon, you are saying developer should use HEVC specific enc pic params. sent on a per frame basis
ltrMarkFrame = 1 (If ltrMarkFrame=1, ltrNumFrames specifies maximum number of ltr frames in DPB)
ltrUseFrames = 1 ltrMarkFrameIdx and ltrUseFrameBitmap = what value should be used here?
How about ltrUsageMode? Set it as 0 for no constraint?