Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rate control for AMD cards using VAAPI #2821

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

cgutman
Copy link
Collaborator

@cgutman cgutman commented Jul 8, 2024

Description

Intel needs RC buffer size unset for their H.264 encoder to avoid horrible encoding quality, however this causes issues for AMD cards overshooting the expected maximum frame size and causing packet loss. Resolve this by adding a new hook in avcodec_encode_device_t to allow the platform encoding code to set additional options on the codec context and using the vendor string to distinguish Intel cards.

Screenshot

Issues Fixed or Closed

Fixes #2788

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

Copy link

codecov bot commented Jul 8, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 8.99%. Comparing base (5cea1e1) to head (e2c27c2).
Report is 133 commits behind head on master.

Files with missing lines Patch % Lines
src/platform/linux/vaapi.cpp 0.00% 4 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master   #2821   +/-   ##
======================================
  Coverage    8.98%   8.99%           
======================================
  Files          95      95           
  Lines       17304   17310    +6     
  Branches     8232    8234    +2     
======================================
+ Hits         1555    1557    +2     
- Misses      12884   12888    +4     
  Partials     2865    2865           
Flag Coverage Δ
Linux 6.80% <33.33%> (+0.01%) ⬆️
Windows 4.16% <0.00%> (-0.01%) ⬇️
macOS-12 10.10% <50.00%> (+<0.01%) ⬆️
macOS-13 10.02% <50.00%> (+<0.01%) ⬆️
macOS-14 10.31% <50.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/platform/common.h 35.36% <100.00%> (+0.79%) ⬆️
src/video.cpp 25.30% <100.00%> (+0.06%) ⬆️
src/platform/linux/vaapi.cpp 2.73% <0.00%> (-0.07%) ⬇️

@CypherGrue
Copy link

CypherGrue commented Jul 8, 2024

I have tested and can confirm that e8f6f7c fixes #2788 for my Radeon hardware.

@ReenigneArcher ReenigneArcher enabled auto-merge (squash) July 8, 2024 14:07
@ReenigneArcher ReenigneArcher merged commit 38c13c8 into LizardByte:master Jul 8, 2024
49 checks passed
@goncalossilva
Copy link

goncalossilva commented Jul 8, 2024

Great to see this merged so quickly! Looking forward to the next release. 😊

@KuleRucket
Copy link
Contributor

I was getting the "Number of fragments for reed solomon exceeds DATA_SHARDS_MAX" error previously but not with this fix. It has made a nice performance improvement, particularly when using HDR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vaapi encoder on AMD exceeds DATA_SHARDS_MAX due to NO_RC_BUF_LIMIT
5 participants