Skip to content

Commit

Permalink
win: amf: HRD blacklist, expand UI docs and various fixes.
Browse files Browse the repository at this point in the history
* Add 'auto' default setting to 'rc_mode' and 'enforce_hrd' which defaults
  to 'cbr' and 'true', respectively.

* Implement HRD blacklist: if a device ID matches, 'rc_mode' and 'enforce_hrd'
  are set to 'vbr_latency' and 'false' when set to 'auto'. The current
  blacklist applies to most RX 400 and RX 500 series, but can be expanded.

* Document all new and existing AMF options in the docs and UI. Rearrange
  AMF options to better reflect importance (Usage is primary) and group by
  relatedness (RC and HRD influece each other's functionality), and group
  quality-related sub options.

* Various cleanups & fixes to AMF option parsing, including proper setting of
  defaults if when invalid configuration is parsed.
  • Loading branch information
psyke83 committed Apr 12, 2024
1 parent 6a01e58 commit 1adf72b
Show file tree
Hide file tree
Showing 8 changed files with 298 additions and 150 deletions.
116 changes: 74 additions & 42 deletions docs/source/about/advanced_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1471,34 +1471,42 @@ keybindings
`AMD AMF Encoder <https://localhost:47990/config/#amd-amf-encoder>`__
---------------------------------------------------------------------

`amd_quality <https://localhost:47990/config/#amd_quality>`__
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`amd_usage <https://localhost:47990/config/#amd_usage>`__
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

**Description**
The encoder preset to use.
The encoder usage profile is used to set the base set of encoding
parameters.

.. note:: This option only applies when using amdvce `encoder`_.

.. note:: The other AMF options that follow will override a subset
of the settings applied by your usage profile, but there are
hidden parameters set in usage profiles that cannot be
overridden elsewhere.

**Choices**

.. table::
:widths: auto

========== ===========
Value Description
========== ===========
speed prefer speed
balanced balanced
quality prefer quality
========== ===========
======================= ===========
Value Description
======================= ===========
transcoding transcoding (slowest)
webcam webcam (slow)
lowlatency_high_quality low latency, high quality (fast)
lowlatency low latency (faster)
ultralowlatency ultra low latency (fastest)
======================= ===========

**Default**
``balanced``
``ultralowlatency``

**Example**
.. code-block:: text
amd_quality = balanced
amd_usage = ultralowlatency
`amd_rc <https://localhost:47990/config/#amd_rc>`__
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -1508,6 +1516,9 @@ keybindings

.. note:: This option only applies when using amdvce `encoder`_.

.. warning:: the default rate control when 'auto' is selected
varies depending on the `amd_enforce_hrd`_ blacklist.

**Choices**

.. table::
Expand All @@ -1516,88 +1527,109 @@ keybindings
=========== ===========
Value Description
=========== ===========
auto cbr, or vbr_latency if HRD is blacklisted
cqp constant qp mode
cbr constant bitrate
vbr_latency variable bitrate, latency constrained
vbr_peak variable bitrate, peak constrained
=========== ===========

**Default**
``cbr``
``auto``

**Example**
.. code-block:: text
amd_rc = cbr
amd_rc = auto
`amd_usage <https://localhost:47990/config/#amd_usage>`__
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`amd_enforce_hrd <https://localhost:47990/config/#amd_enforce_hrd>`__
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

**Description**
The encoder usage profile, used to balance latency with encoding quality.
Enable Hypothetical Reference Decoder (HRD) enforcement to help constrain the target bitrate.

.. note:: This option only applies when using amdvce `encoder`_.

.. warning:: 'auto' will disable HRD if Sunshine detects a Polaris card that is
known to exhibit artifacts. If you experience encoding issues on 'auto' that can be
resolved by disabling HRD explicitly, please file an issue so that your card's
Device ID can be added to the blacklist in future releases.

**Choices**

.. table::
:widths: auto

======================= ===========
Value Description
======================= ===========
transcoding transcoding (slowest)
webcam webcam (slow)
lowlatency_high_quality low latency, high quality (fast)
lowlatency low latency (faster)
ultralowlatency ultra low latency (fastest)
======================= ===========
======== ===========
Value Description
======== ===========
auto enable HRD if card is not blacklisted
enabled enable HRD
disabled disable HRD
======== ===========

**Default**
``ultralowlatency``
``auto``

**Example**
.. code-block:: text
amd_usage = ultralowlatency
amd_enforce_hrd = auto
`amd_preanalysis <https://localhost:47990/config/#amd_preanalysis>`__
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`amd_quality <https://localhost:47990/config/#amd_quality>`__
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

**Description**
Preanalysis can increase encoding quality at the cost of latency.
The quality profile controls the tradeoff between
speed and quality of encoding.

.. note:: This option only applies when using amdvce `encoder`_.

**Choices**

.. table::
:widths: auto

========== ===========
Value Description
========== ===========
speed prefer speed
balanced balanced
quality prefer quality
========== ===========

**Default**
``disabled``
``balanced``

**Example**
.. code-block:: text
amd_preanalysis = disabled
amd_quality = balanced
`amd_vbaq <https://localhost:47990/config/#amd_vbaq>`__
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`amd_preanalysis <https://localhost:47990/config/#amd_preanalysis>`__
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

**Description**
Variance Based Adaptive Quantization (VBAQ) can increase subjective visual quality.
Preanalysis can increase encoding quality at the cost of latency.

.. note:: This option only applies when using amdvce `encoder`_.

**Default**
``enabled``
``disabled``

**Example**
.. code-block:: text
amd_vbaq = enabled
amd_preanalysis = disabled
`amd_enforce_hrd <https://localhost:47990/config/#amd_enforce_hrd>`__
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`amd_vbaq <https://localhost:47990/config/#amd_vbaq>`__
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

**Description**
Enable Hypothetical Reference Decoder (HRD) enforcement to help constrain the target bitrate.
Variance Based Adaptive Quantization (VBAQ) can increase subjective
visual quality by prioritizing allocation of more bits to smooth
areas compared to more textured areas.

.. note:: This option only applies when using amdvce `encoder`_.

Expand All @@ -1607,7 +1639,7 @@ keybindings
**Example**
.. code-block:: text
amd_enforce_hrd = enabled
amd_vbaq = enabled
`amd_coder <https://localhost:47990/config/#amd_coder>`__
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
Loading

0 comments on commit 1adf72b

Please sign in to comment.