Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NVIDIA Video Codec SDK 8.2.15 の NVENC_VideoEncoder_API_ProgGuide.pdf より
- 「3.8.3 Rate control」を抜粋。
- ---
- 3.8.3 Rate control
- NVENC supports several rate control modes and provides control over various parameters
- related to the rate control algorithm via structure NV_ENC_INITIALIZE_PARAMS::encodeConfig::rcParams.
- The rate control algorithm is implemented in NVENC firmware.
- NVENC supports 1-pass (NV_ENC_PARAMS_RC_VBR and NV_ENC_PARAMS_RC_CBR),
- 2-pass (NV_ENC_PARAMS_RC_CBR_LOWDELAY_HQ, NV_ENC_PARAMS_RC_CBR_HQ and NV_ENC_PARAMS_RC_VBR_HQ),
- constant QP and Constant quality rate control modes.
- In 1-pass rate control mode,NVENC estimates the required QP for the macroblock
- and immediately encodes the macroblock.
- In 2-pass rate control modes, NVENC estimates the complexity of the frame to be encoded
- and determines bit distribution across the frame in the first pass.
- In the second pass, NVENC encodes macroblocks in the frame using the distribution determined in the first pass.
- As a result, quality of the encoded bitstream is generally better with 2-pass encoding, at the cost of some performance.
- At a high level, NVENC supports following rate control modes:
- ➢ Constant bitrate (CBR):
- Constant bitrate is specified by setting rateControlMode to
- NV_ENC_PARAMS_RC_CBR, NV_ENC_PARAMS_RC_CBR_LOWDELAY_HQ or NV_ENC_PARAMS_RC_CBR_HQ.
- In this mode, only averageBitRate is required and used as the target output bitrate by the rate control algorithm.
- ➢ Variable bitrate (VBR):
- Variable bitrate is specified by setting rateControlMode to NV_ENC_PARAMS_RC_VBR or NV_ENC_PARAMS_RC_VBR_HQ.
- The encoder tries to conform to average bitrate of averageBitRate over the long term
- while not exceeding maxBitRate any time during the encoding.
- In this mode, averageBitRate must be specified.
- If maxBitRate isn’t specified, NVENC will set it to an internally determined default value.
- It is recommended that the client specify both parameters maxBitRate and averageBitRate for better control.
- ➢ Constant QP:
- This mode is specified by setting rateControlMode to NV_ENC_PARAMS_RC_CONSTQP.
- In this mode, the entire frame is encoded using QP specified in NV_ENC_RC_PARAMS::constQP.
- ➢ Target quality:
- This mode is specified by setting rateControlMode to one of the VBR modes and desired target quality in targetQuality.
- The range of this target quality is 0 to 51(fractional values are also supported in Video Codec SDK 8.0 and above).
- In this mode, the encoder tries to maintain constant quality for each frame,
- by allowing the bitrate to vary subject to the bitrate parameter specified in maxBitRate.
- The resulting average bitrate can, therefore, vary significantly depending on the video content being encoded.
- If maxBitRate is not specified, the encoder will use as many bits as needed to achieve the target quality.
- However, if maxBitRate is set, it will form an upper bound on the actual bitrate.
- If maxBitRate is set too low in this mode, the bitrate may become constrained,
- resulting in the desired target quality possibly not being achieved.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement