Skip to content

demos/sdlimage: set palette as source lut#122

Open
lukaslihotzki wants to merge 1 commit intohaasn:masterfrom
lukaslihotzki:palette
Open

demos/sdlimage: set palette as source lut#122
lukaslihotzki wants to merge 1 commit intohaasn:masterfrom
lukaslihotzki:palette

Conversation

@lukaslihotzki
Copy link
Copy Markdown

A 3D LUT can be used to describe the palette for indexed formats. This is not ideal, but probably more helpful for users who want to display indexed formats than converting to ABGR8888 on the CPU.

Remaining issues:

  • Debanding must be turned off (see the comment).
  • The palette commonly encoded as bytes must be converted to float, so byte LUT support in libplacebo would be nice.
  • The LUT must be extended with trailing zeros to a power of two, so support for extending the LUT with trailing zeros in libplacebo while copying the data to the GPU would be nice.
  • For some cases of video playback, the LUT should be changeable per frame without recreating the pipeline. In this case, libplacebo must store the LUT as texture or uniform (not as literal) and offer an interface for replacing the data.
  • libplacebo should support PL_FMT_UINT as plane format when using indexed colors to avoid the useless intermediate step over float. The shader would directly index the lut array in the uniform or use texelFetch to access the lut texture.
  • 3D LUTs are overly complex for the palette LUT, as two dimensions are always one. Also, they cannot output an alpha channel. Generic N-to-M-dimension-LUT support in libplacebo would be nice.

@haasn
Copy link
Copy Markdown
Owner

haasn commented Apr 4, 2022

@haasn
Copy link
Copy Markdown
Owner

haasn commented Apr 4, 2022

I'm not sure I'm happy with this way of handling it. Besides debanding, a lot of other things are already distorting palettes, e.g. custom shaders, interpolation, color range expansion...

Proper palette format support needs to be implemented in libplacebo directly, as an initial input step before anything else. (It's also semantically unlike the custom_lut, which is supposed to be for colorspace transformations)

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.

2 participants