mpv-player / mpv-player/mpv

[gpu-next] Provide control over internal texture bit depth

Open
#17,709 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

meta:feature-request
Dominant language
C
Stars
37k
Forks
3.5k
Avg merge
1d 10h
Merged PRs (30d)
22

Description

    As of now, gpu-next only uses rgba16hf internal texture format even for HDR, with no ability to change it, but gpu has fbo-format with high range of options. Given rgba16hf is a half float with 1 sign, 5 exponent and 10 mantissa bits, we're left with ~11 bits of usable precision. It's not enough headroom to prevent rounding errors during 10bit video tone mapping, color adjustments, shader processing and even representing 12bit video isn't mathematically possible. Many people use at least 1-3 shaders, use tone mapping or LUTs, adjust contrast or saturation, so mathematical errors can creep up and manifest as banding and color inaccuracies. This is the reason why 32bit float is required for proper audio processing even though the output is 16bit, for example.

    Given all that, I request for an option that can change internal format to rgba32f or similar, like fbo-format in gpu, or combine them into vo-internal-precision for simplicity. And it's important to make sure that all decoding and processing is done in this exact bit depth right up to dithering pass.
    For a reasonable performance impact this ensures that all processing is perfectly clean and doesn't add any digital artifacts by itself.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing gpu-next's internal texture format handling and compare it with gpu's existing fbo-format option. Verify how decoding, processing, shader work, and the dithering pass select their formats; done means a configurable rgba32f or similar precision is used consistently through dithering.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
computer-graphics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.