Skip to content

Add vlc_chroma_probe.h API: replace hardcoded chroma fallback mechanism

Thomas Guillem requested to merge tguillem/vlc:chroma-probe into master

This MR adds support for a dynamic chroma conversion list via the vlc_chroma_probe.h API.

Each "video converter" modules will declare their list of chroma conversion via new module helpers.

The vlc_chroma_conv_Probe function will return an array of all possibles conversions, sorted by quality. A quality of 100 means there are no quality loss: same color size and same YUV subsampling for example.

This new API allows to:

  • Remove recursivity from the chroma chain module
  • Remove the outdated chroma chain fallback array
  • Remove the outdated core Fallback list

There is a complete test, it can also be used for debugging purposes, here are some examples:

Indirect steps are only allowed with GPU chromas, here VLC_CODEC_VAAPI_420_10BPP

./test/test_src_misc_chroma_probe VAO0   
	res[0]: [c=33|q=100] VAO0 -> P010
	res[1]: [c=33|q=100] VAO0 -> I0AL
	res[2]: [c=49|q=100] VAO0 -> P010 -> I0AL
	res[3]: [c=49|q=100] VAO0 -> I0AL -> P010
	res[4]: [c=66|q=100] VAO0 -> P010 -> I0AL
	res[5]: [c=66|q=100] VAO0 -> P010 -> I0AB
	res[6]: [c=66|q=100] VAO0 -> I0AL -> I0AB
	res[7]: [c=66|q=100] VAO0 -> I0AL -> P010
	res[8]: [c=69|q=100] VAO0 -> P010 -> I0CL
	res[9]: [c=69|q=100] VAO0 -> P010 -> I0CB
	res[10]: [c=69|q=100] VAO0 -> I0AL -> I0CL
	res[11]: [c=69|q=100] VAO0 -> I0AL -> I0CB
	res[12]: [c=75|q=100] VAO0 -> P010 -> I0FL
	res[13]: [c=75|q=100] VAO0 -> P010 -> I0FB
	res[14]: [c=75|q=100] VAO0 -> P010 -> P016
	res[15]: [c=75|q=100] VAO0 -> I0AL -> I0FL
	res[16]: [c=75|q=100] VAO0 -> I0AL -> I0FB
	res[17]: [c=75|q=100] VAO0 -> I0AL -> P016
	res[18]: [c=64|q=90] VAO0 -> P010 -> I09L
	res[19]: [c=64|q=90] VAO0 -> P010 -> I09B
	res[20]: [c=64|q=90] VAO0 -> I0AL -> I09L
	res[21]: [c=64|q=90] VAO0 -> I0AL -> I09B
	res[22]: [c=71|q=90] VAO0 -> P010 -> I2AL
	res[23]: [c=71|q=90] VAO0 -> P010 -> I2AB
...

You can specify an out chroma:

./test/test_src_misc_chroma_probe VAO0-YV12
	res[0]: [c=62|q=80] VAO0 -> P010 -> YV12
	res[1]: [c=62|q=80] VAO0 -> I0AL -> YV12

No more indirect conversions with CPU chromas. Small advantage for I420-NV12 as there is a SEE3 converter.

	res[0]: [c=18|q=100] I420 -> NV12
	res[1]: [c=24|q=100] I420 -> YV12
	res[2]: [c=24|q=100] I420 -> NV21
	res[3]: [c=25|q=100] I420 -> I09L
	res[4]: [c=25|q=100] I420 -> I09B
	res[5]: [c=26|q=100] I420 -> VAOP
	res[6]: [c=27|q=100] I420 -> I0AL
	res[7]: [c=27|q=100] I420 -> I0AB
	res[8]: [c=27|q=100] I420 -> P010
	res[9]: [c=30|q=100] I420 -> I0CL
	res[10]: [c=30|q=100] I420 -> I0CB
	res[11]: [c=32|q=100] I420 -> I40A
	res[12]: [c=36|q=100] I420 -> I0FL
	res[13]: [c=36|q=100] I420 -> I0FB
	res[14]: [c=36|q=100] I420 -> P016
	res[15]: [c=21|q=90] I420 -> YUY2
	res[16]: [c=21|q=90] I420 -> YVYU
	res[17]: [c=21|q=90] I420 -> UYVY
	res[18]: [c=27|q=90] I420 -> RV32
	res[19]: [c=27|q=90] I420 -> RGBX
	res[20]: [c=27|q=90] I420 -> BGRX
	res[21]: [c=27|q=90] I420 -> XBGR
	res[22]: [c=28|q=90] I420 -> I440
	res[23]: [c=28|q=90] I420 -> I422
...
Edited by Thomas Guillem

Merge request reports

Loading