Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/platform/linux/vaapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,6 @@ namespace va {
return 0;
}

void
init_codec_options(AVCodecContext *ctx, AVDictionary *options) override {
// Don't set the RC buffer size when using H.264 on Intel GPUs. It causes
// major encoding quality degradation.
auto vendor = vaQueryVendorString(va_display);
if (ctx->codec_id != AV_CODEC_ID_H264 || (vendor && !strstr(vendor, "Intel"))) {
ctx->rc_buffer_size = ctx->bit_rate * ctx->framerate.den / ctx->framerate.num;
}
}

int
set_frame(AVFrame *frame, AVBufferRef *hw_frames_ctx_buf) override {
this->hwframe.reset(frame);
Expand Down
6 changes: 4 additions & 2 deletions src/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,7 @@ namespace video {
{ "low_power"s, 1 },
{ "async_depth"s, 1 },
{ "idr_interval"s, std::numeric_limits<int>::max() },
{ "rc_mode"s, "VBR"s },
},
{}, // SDR-specific options
{}, // HDR-specific options
Expand All @@ -879,6 +880,7 @@ namespace video {
{ "async_depth"s, 1 },
{ "sei"s, 0 },
{ "idr_interval"s, std::numeric_limits<int>::max() },
{ "rc_mode"s, "VBR"s },
},
{}, // SDR-specific options
{}, // HDR-specific options
Expand All @@ -898,6 +900,7 @@ namespace video {
{ "async_depth"s, 1 },
{ "sei"s, 0 },
{ "idr_interval"s, std::numeric_limits<int>::max() },
{ "rc_mode"s, "VBR"s },
},
{}, // SDR-specific options
{}, // HDR-specific options
Expand All @@ -910,8 +913,7 @@ namespace video {
std::make_optional<encoder_t::option_t>("qp"s, &config::video.qp),
"h264_vaapi"s,
},
// RC buffer size will be set in platform code if supported
LIMITED_GOP_SIZE | PARALLEL_ENCODING | SINGLE_SLICE_ONLY | NO_RC_BUF_LIMIT
LIMITED_GOP_SIZE | PARALLEL_ENCODING | SINGLE_SLICE_ONLY
};
#endif

Expand Down