Skip to content

Commit

Permalink
lint: missing formats
Browse files Browse the repository at this point in the history
  • Loading branch information
Hazer committed Jun 1, 2024
1 parent 2949d36 commit 098210f
Show file tree
Hide file tree
Showing 35 changed files with 721 additions and 880 deletions.
165 changes: 97 additions & 68 deletions src/nvenc/nvenc_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

namespace {

GUID
quality_preset_guid_from_number(unsigned number) {
if (number > 7) number = 7;
GUID quality_preset_guid_from_number(unsigned number) {

Check warning on line 20 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L20

Added line #L20 was not covered by tests
if (number > 7)
number = 7;

Check warning on line 22 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L22

Added line #L22 was not covered by tests

switch (number) {
case 1:
Expand All @@ -46,13 +46,11 @@ namespace {
}
};

bool
equal_guids(const GUID &guid1, const GUID &guid2) {
bool equal_guids(const GUID &guid1, const GUID &guid2) {

Check warning on line 49 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L49

Added line #L49 was not covered by tests
return std::memcmp(&guid1, &guid2, sizeof(GUID)) == 0;
}

auto
quality_preset_string_from_guid(const GUID &guid) {
auto quality_preset_string_from_guid(const GUID &guid) {

Check warning on line 53 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L53

Added line #L53 was not covered by tests
if (equal_guids(guid, NV_ENC_PRESET_P1_GUID)) {
return "P1";
}
Expand Down Expand Up @@ -81,32 +79,39 @@ namespace {

namespace nvenc {

nvenc_base::nvenc_base(NV_ENC_DEVICE_TYPE device_type, void *device):
device_type(device_type),
device(device) {
nvenc_base::nvenc_base(NV_ENC_DEVICE_TYPE device_type, void *device): device_type(device_type), device(device) {

Check warning on line 82 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L82

Added line #L82 was not covered by tests
}

nvenc_base::~nvenc_base() {
// Use destroy_encoder() instead
}

bool
nvenc_base::create_encoder(const nvenc_config &config, const video::config_t &client_config, const nvenc_colorspace_t &colorspace, NV_ENC_BUFFER_FORMAT buffer_format) {
bool nvenc_base::create_encoder(

Check warning on line 89 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L89

Added line #L89 was not covered by tests
const nvenc_config &config,
const video::config_t &client_config,
const nvenc_colorspace_t &colorspace,
NV_ENC_BUFFER_FORMAT buffer_format
) {
// Pick the minimum NvEncode API version required to support the specified codec
// to maximize driver compatibility. AV1 was introduced in SDK v12.0.
minimum_api_version = (client_config.videoFormat <= 1) ? MAKE_NVENC_VER(11U, 0U) : MAKE_NVENC_VER(12U, 0U);

if (!nvenc && !init_library()) return false;
if (!nvenc && !init_library())
return false;

Check warning on line 100 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L100

Added line #L100 was not covered by tests

if (encoder) destroy_encoder();
auto fail_guard = util::fail_guard([this] { destroy_encoder(); });
if (encoder)
destroy_encoder();

Check warning on line 103 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L103

Added line #L103 was not covered by tests
auto fail_guard = util::fail_guard([this] {
destroy_encoder();

Check warning on line 105 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L105

Added line #L105 was not covered by tests
});

encoder_params.width = client_config.width;
encoder_params.height = client_config.height;
encoder_params.buffer_format = buffer_format;
encoder_params.rfi = true;

NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS session_params = { min_struct_version(NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS_VER) };
NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS session_params

Check warning on line 113 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L113

Added line #L113 was not covered by tests
= { min_struct_version(NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS_VER) };
session_params.device = device;
session_params.deviceType = device_type;
session_params.apiVersion = minimum_api_version;
Expand All @@ -122,7 +127,8 @@ namespace nvenc {
};

std::vector<GUID> encode_guids(encode_guid_count);
if (nvenc_failed(nvenc->nvEncGetEncodeGUIDs(encoder, encode_guids.data(), encode_guids.size(), &encode_guid_count))) {
if (nvenc_failed(nvenc->nvEncGetEncodeGUIDs(encoder, encode_guids.data(), encode_guids.size(), &encode_guid_count)
)) {
BOOST_LOG(error) << "NvEncGetEncodeGUIDs failed: " << last_error_string;
return false;
}
Expand Down Expand Up @@ -179,7 +185,8 @@ namespace nvenc {
auto supported_width = get_encoder_cap(NV_ENC_CAPS_WIDTH_MAX);
auto supported_height = get_encoder_cap(NV_ENC_CAPS_HEIGHT_MAX);
if (encoder_params.width > supported_width || encoder_params.height > supported_height) {
BOOST_LOG(error) << "NvEnc: gpu max encode resolution " << supported_width << "x" << supported_height << ", requested " << encoder_params.width << "x" << encoder_params.height;
BOOST_LOG(error) << "NvEnc: gpu max encode resolution " << supported_width << "x" << supported_height
<< ", requested " << encoder_params.width << "x" << encoder_params.height;
return false;
}
}
Expand All @@ -205,7 +212,8 @@ namespace nvenc {
init_params.tuningInfo = NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY;
init_params.enablePTD = 1;
init_params.enableEncodeAsync = async_event_handle ? 1 : 0;
init_params.enableWeightedPrediction = config.weighted_prediction && get_encoder_cap(NV_ENC_CAPS_SUPPORT_WEIGHTED_PREDICTION);
init_params.enableWeightedPrediction

Check warning on line 215 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L215

Added line #L215 was not covered by tests
= config.weighted_prediction && get_encoder_cap(NV_ENC_CAPS_SUPPORT_WEIGHTED_PREDICTION);

init_params.encodeWidth = encoder_params.width;
init_params.darWidth = encoder_params.width;
Expand All @@ -214,8 +222,15 @@ namespace nvenc {
init_params.frameRateNum = client_config.framerate;
init_params.frameRateDen = 1;

NV_ENC_PRESET_CONFIG preset_config = { min_struct_version(NV_ENC_PRESET_CONFIG_VER), { min_struct_version(NV_ENC_CONFIG_VER, 7, 8) } };
if (nvenc_failed(nvenc->nvEncGetEncodePresetConfigEx(encoder, init_params.encodeGUID, init_params.presetGUID, init_params.tuningInfo, &preset_config))) {
NV_ENC_PRESET_CONFIG preset_config

Check warning on line 225 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L225

Added line #L225 was not covered by tests
= { min_struct_version(NV_ENC_PRESET_CONFIG_VER), { min_struct_version(NV_ENC_CONFIG_VER, 7, 8) } };
if (nvenc_failed(nvenc->nvEncGetEncodePresetConfigEx(
encoder,
init_params.encodeGUID,
init_params.presetGUID,
init_params.tuningInfo,

Check warning on line 231 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L228-L231

Added lines #L228 - L231 were not covered by tests
&preset_config
))) {
BOOST_LOG(error) << "NvEncGetEncodePresetConfigEx failed: " << last_error_string;
return false;
}
Expand All @@ -229,9 +244,10 @@ namespace nvenc {
enc_config.rcParams.zeroReorderDelay = 1;
enc_config.rcParams.enableLookahead = 0;
enc_config.rcParams.lowDelayKeyFrameScale = 1;
enc_config.rcParams.multiPass = config.two_pass == nvenc_two_pass::quarter_resolution ? NV_ENC_TWO_PASS_QUARTER_RESOLUTION :
config.two_pass == nvenc_two_pass::full_resolution ? NV_ENC_TWO_PASS_FULL_RESOLUTION :
NV_ENC_MULTI_PASS_DISABLED;
enc_config.rcParams.multiPass

Check warning on line 247 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L247

Added line #L247 was not covered by tests
= config.two_pass == nvenc_two_pass::quarter_resolution ? NV_ENC_TWO_PASS_QUARTER_RESOLUTION :
config.two_pass == nvenc_two_pass::full_resolution ? NV_ENC_TWO_PASS_FULL_RESOLUTION :
NV_ENC_MULTI_PASS_DISABLED;

enc_config.rcParams.enableAQ = config.adaptive_quantization;
enc_config.rcParams.averageBitRate = client_config.bitrate * 1000;
Expand All @@ -254,21 +270,23 @@ namespace nvenc {
format_config.enableFillerDataInsertion = config.insert_filler_data;
};

auto set_ref_frames = [&](uint32_t &ref_frames_option, NV_ENC_NUM_REF_FRAMES &L0_option, uint32_t ref_frames_default) {
if (client_config.numRefFrames > 0) {
ref_frames_option = client_config.numRefFrames;
}
else {
ref_frames_option = ref_frames_default;
}
if (ref_frames_option > 0 && !get_encoder_cap(NV_ENC_CAPS_SUPPORT_MULTIPLE_REF_FRAMES)) {
ref_frames_option = 1;
encoder_params.rfi = false;
}
encoder_params.ref_frames_in_dpb = ref_frames_option;
// This limits ref frames any frame can use to 1, but allows larger buffer size for fallback if some frames are invalidated through rfi
L0_option = NV_ENC_NUM_REF_FRAMES_1;
};
auto set_ref_frames
= [&](uint32_t &ref_frames_option, NV_ENC_NUM_REF_FRAMES &L0_option, uint32_t ref_frames_default) {

Check warning on line 274 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L273-L274

Added lines #L273 - L274 were not covered by tests
if (client_config.numRefFrames > 0) {
ref_frames_option = client_config.numRefFrames;

Check warning on line 276 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L276

Added line #L276 was not covered by tests
}
else {
ref_frames_option = ref_frames_default;

Check warning on line 279 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L279

Added line #L279 was not covered by tests
}
if (ref_frames_option > 0 && !get_encoder_cap(NV_ENC_CAPS_SUPPORT_MULTIPLE_REF_FRAMES)) {
ref_frames_option = 1;
encoder_params.rfi = false;

Check warning on line 283 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L282-L283

Added lines #L282 - L283 were not covered by tests
}
encoder_params.ref_frames_in_dpb = ref_frames_option;

Check warning on line 285 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L285

Added line #L285 was not covered by tests
// This limits ref frames any frame can use to 1, but allows larger buffer size for fallback if some frames
// are invalidated through rfi
L0_option = NV_ENC_NUM_REF_FRAMES_1;
};

Check warning on line 289 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L288-L289

Added lines #L288 - L289 were not covered by tests

auto set_minqp_if_enabled = [&](int value) {
if (config.enable_min_qp) {
Expand Down Expand Up @@ -380,20 +398,30 @@ namespace nvenc {

{
auto f = stat_trackers::one_digit_after_decimal();
BOOST_LOG(debug) << "NvEnc: requested encoded frame size " << f % (client_config.bitrate / 8. / client_config.framerate) << " kB";
BOOST_LOG(debug) << "NvEnc: requested encoded frame size "
<< f % (client_config.bitrate / 8. / client_config.framerate) << " kB";
}

{
std::string extra;
if (init_params.enableEncodeAsync) extra += " async";
if (buffer_is_10bit()) extra += " 10-bit";
if (enc_config.rcParams.multiPass != NV_ENC_MULTI_PASS_DISABLED) extra += " two-pass";
if (config.vbv_percentage_increase > 0 && get_encoder_cap(NV_ENC_CAPS_SUPPORT_CUSTOM_VBV_BUF_SIZE)) extra += " vbv+" + std::to_string(config.vbv_percentage_increase);
if (encoder_params.rfi) extra += " rfi";
if (init_params.enableWeightedPrediction) extra += " weighted-prediction";
if (enc_config.rcParams.enableAQ) extra += " spatial-aq";
if (enc_config.rcParams.enableMinQP) extra += " qpmin=" + std::to_string(enc_config.rcParams.minQP.qpInterP);
if (config.insert_filler_data) extra += " filler-data";
if (init_params.enableEncodeAsync)
extra += " async";
if (buffer_is_10bit())
extra += " 10-bit";
if (enc_config.rcParams.multiPass != NV_ENC_MULTI_PASS_DISABLED)
extra += " two-pass";
if (config.vbv_percentage_increase > 0 && get_encoder_cap(NV_ENC_CAPS_SUPPORT_CUSTOM_VBV_BUF_SIZE))
extra += " vbv+" + std::to_string(config.vbv_percentage_increase);
if (encoder_params.rfi)
extra += " rfi";
if (init_params.enableWeightedPrediction)
extra += " weighted-prediction";
if (enc_config.rcParams.enableAQ)
extra += " spatial-aq";
if (enc_config.rcParams.enableMinQP)
extra += " qpmin=" + std::to_string(enc_config.rcParams.minQP.qpInterP);
if (config.insert_filler_data)
extra += " filler-data";
BOOST_LOG(info) << "NvEnc: created encoder " << quality_preset_string_from_guid(init_params.presetGUID) << extra;
}

Expand All @@ -402,8 +430,7 @@ namespace nvenc {
return true;
}

void
nvenc_base::destroy_encoder() {
void nvenc_base::destroy_encoder() {

Check warning on line 433 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L433

Added line #L433 was not covered by tests
if (output_bitstream) {
nvenc->nvEncDestroyBitstreamBuffer(encoder, output_bitstream);
output_bitstream = nullptr;
Expand All @@ -426,8 +453,7 @@ namespace nvenc {
encoder_params = {};
}

nvenc_encoded_frame
nvenc_base::encode_frame(uint64_t frame_index, bool force_idr) {
nvenc_encoded_frame nvenc_base::encode_frame(uint64_t frame_index, bool force_idr) {

Check warning on line 456 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L456

Added line #L456 was not covered by tests
if (!encoder) {
return {};
}
Expand All @@ -442,7 +468,9 @@ namespace nvenc {
BOOST_LOG(error) << "NvEncMapInputResource failed: " << last_error_string;
return {};
}
auto unmap_guard = util::fail_guard([&] { nvenc->nvEncUnmapInputResource(encoder, &mapped_input_buffer); });
auto unmap_guard = util::fail_guard([&] {
nvenc->nvEncUnmapInputResource(encoder, &mapped_input_buffer);

Check warning on line 472 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L472

Added line #L472 was not covered by tests
});

NV_ENC_PIC_PARAMS pic_params = { min_struct_version(NV_ENC_PIC_PARAMS_VER, 4, 6) };
pic_params.inputWidth = encoder_params.width;
Expand Down Expand Up @@ -501,21 +529,22 @@ namespace nvenc {
// Print encoded frame size stats to debug log every 20 seconds
auto callback = [&](float stat_min, float stat_max, double stat_avg) {
auto f = stat_trackers::one_digit_after_decimal();
BOOST_LOG(debug) << "NvEnc: encoded frame sizes (min max avg) " << f % stat_min << " " << f % stat_max << " " << f % stat_avg << " kB";
BOOST_LOG(debug) << "NvEnc: encoded frame sizes (min max avg) " << f % stat_min << " " << f % stat_max << " "
<< f % stat_avg << " kB";
};
using namespace std::literals;
encoder_state.frame_size_tracker.collect_and_callback_on_interval(encoded_frame.data.size() / 1000., callback, 20s);
encoder_state.frame_size_tracker

Check warning on line 536 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L536

Added line #L536 was not covered by tests
.collect_and_callback_on_interval(encoded_frame.data.size() / 1000., callback, 20s);
}

return encoded_frame;
}

bool
nvenc_base::invalidate_ref_frames(uint64_t first_frame, uint64_t last_frame) {
if (!encoder || !encoder_params.rfi) return false;
bool nvenc_base::invalidate_ref_frames(uint64_t first_frame, uint64_t last_frame) {

Check warning on line 543 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L543

Added line #L543 was not covered by tests
if (!encoder || !encoder_params.rfi)
return false;

Check warning on line 545 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L545

Added line #L545 was not covered by tests

if (first_frame >= encoder_state.last_rfi_range.first &&
last_frame <= encoder_state.last_rfi_range.second) {
if (first_frame >= encoder_state.last_rfi_range.first && last_frame <= encoder_state.last_rfi_range.second) {
BOOST_LOG(debug) << "NvEnc: rfi request " << first_frame << "-" << last_frame << " already done";
return true;
}
Expand All @@ -527,7 +556,8 @@ namespace nvenc {
return false;
}

BOOST_LOG(debug) << "NvEnc: rfi request " << first_frame << "-" << last_frame << " expanding to last encoded frame " << encoder_state.last_encoded_frame_index;
BOOST_LOG(debug) << "NvEnc: rfi request " << first_frame << "-" << last_frame << " expanding to last encoded frame "
<< encoder_state.last_encoded_frame_index;
last_frame = encoder_state.last_encoded_frame_index;

encoder_state.last_rfi_range = { first_frame, last_frame };
Expand All @@ -547,12 +577,11 @@ namespace nvenc {
return true;
}

bool
nvenc_base::nvenc_failed(NVENCSTATUS status) {
bool nvenc_base::nvenc_failed(NVENCSTATUS status) {

Check warning on line 580 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L580

Added line #L580 was not covered by tests
auto status_string = [](NVENCSTATUS status) -> std::string {
switch (status) {
#define nvenc_status_case(x) \
case x: \
case x: \
return #x;
nvenc_status_case(NV_ENC_SUCCESS);
nvenc_status_case(NV_ENC_ERR_NO_ENCODE_DEVICE);
Expand Down Expand Up @@ -591,7 +620,8 @@ namespace nvenc {
if (status != NV_ENC_SUCCESS) {
if (nvenc && encoder) {
last_error_string = nvenc->nvEncGetLastErrorString(encoder);
if (!last_error_string.empty()) last_error_string += " ";
if (!last_error_string.empty())
last_error_string += " ";

Check warning on line 624 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L624

Added line #L624 was not covered by tests
}
last_error_string += status_string(status);
return true;
Expand All @@ -608,8 +638,7 @@ namespace nvenc {
* @param v12_struct_version Optionally specifies the struct version to use with v12 SDK major versions.
* @return A suitable struct version for the active codec.
*/
uint32_t
nvenc_base::min_struct_version(uint32_t version, uint32_t v11_struct_version, uint32_t v12_struct_version) {
uint32_t nvenc_base::min_struct_version(uint32_t version, uint32_t v11_struct_version, uint32_t v12_struct_version) {

Check warning on line 641 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L641

Added line #L641 was not covered by tests
assert(minimum_api_version);

// Mask off and replace the original NVENCAPI_VERSION
Expand Down
37 changes: 17 additions & 20 deletions src/nvenc/nvenc_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,31 @@ namespace nvenc {
virtual ~nvenc_base();

nvenc_base(const nvenc_base &) = delete;
nvenc_base &
operator=(const nvenc_base &) = delete;
nvenc_base &operator=(const nvenc_base &) = delete;

bool
create_encoder(const nvenc_config &config, const video::config_t &client_config, const nvenc_colorspace_t &colorspace, NV_ENC_BUFFER_FORMAT buffer_format);
bool create_encoder(
const nvenc_config &config,
const video::config_t &client_config,
const nvenc_colorspace_t &colorspace,
NV_ENC_BUFFER_FORMAT buffer_format
);

void
destroy_encoder();
void destroy_encoder();

nvenc_encoded_frame
encode_frame(uint64_t frame_index, bool force_idr);
nvenc_encoded_frame encode_frame(uint64_t frame_index, bool force_idr);

bool
invalidate_ref_frames(uint64_t first_frame, uint64_t last_frame);
bool invalidate_ref_frames(uint64_t first_frame, uint64_t last_frame);

protected:
virtual bool
init_library() = 0;
virtual bool init_library() = 0;

virtual bool
create_and_register_input_buffer() = 0;
virtual bool create_and_register_input_buffer() = 0;

virtual bool
wait_for_async_event(uint32_t timeout_ms) { return false; }
virtual bool wait_for_async_event(uint32_t timeout_ms) {
return false;

Check warning on line 41 in src/nvenc/nvenc_base.h

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.h#L40-L41

Added lines #L40 - L41 were not covered by tests
}

bool
nvenc_failed(NVENCSTATUS status);
bool nvenc_failed(NVENCSTATUS status);

/**
* @brief This function returns the corresponding struct version for the minimum API required by the codec.
Expand All @@ -53,8 +51,7 @@ namespace nvenc {
* @param v12_struct_version Optionally specifies the struct version to use with v12 SDK major versions.
* @return A suitable struct version for the active codec.
*/
uint32_t
min_struct_version(uint32_t version, uint32_t v11_struct_version = 0, uint32_t v12_struct_version = 0);
uint32_t min_struct_version(uint32_t version, uint32_t v11_struct_version = 0, uint32_t v12_struct_version = 0);

const NV_ENC_DEVICE_TYPE device_type;
void *const device;
Expand Down
3 changes: 2 additions & 1 deletion src/nvenc/nvenc_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ namespace nvenc {
// Quality preset from 1 to 7, higher is slower
int quality_preset = 1;

// Use optional preliminary pass for better motion vectors, bitrate distribution and stricter VBV(HRD), uses CUDA cores
// Use optional preliminary pass for better motion vectors, bitrate distribution and stricter VBV(HRD), uses CUDA
// cores
nvenc_two_pass two_pass = nvenc_two_pass::quarter_resolution;

// Percentage increase of VBV/HRD from the default single frame, allows low-latency variable bitrate
Expand Down
Loading

0 comments on commit 098210f

Please sign in to comment.