Hi, not really sure if this is the right section for this question, please move it if required.

I'm trying to implement the gamut mapping algorithm proposed in Annex 5 of ITU Report BT.2407-0, here is the link:

https://www.itu.int/dms_pub/itu-r/opb/rep/R-REP-BT.2407-2017-PDF-E.pdf

The problem is that I think that there are some mistakes in the algorithm steps proposed at the end, and I cannot figure out which should be the right way.

First, I think that the projections p2020 and p709 in step 4 should refer to the projections in the full 2020 and 709 gamut boundaries, since these are the source and target gamuts, and not the effective source and target gamuts projections computed in step 3. Then in step 6, w + [tex]\overline{w p709}[/tex] should refer again to the full gamut projection, but f([tex]\overline{w p2100}/\overline{w p709}[/tex]) should refer to the effective gamut projections. This way, any value of [tex]\overline{w p2100}/\overline{w p709}[/tex] (effective gamut proyections) above 1+ [tex]\alpha[/tex] (full gamut projections) should map to the boundary of the full target gamut. But anyway [tex]\overline{w p2100}/\overline{w p709}[/tex] will always be above 1, and 1-[tex]\beta[/tex] = 0.8, so f(r) will never be r.

The text refers sometimes to 2020 and others to 2100, but both are the same gamut so I don't think the errors are related to this.

I would be most grateful if someone can deduce which should be the right algorithm steps.