Many parameter set fields are encoded in a form that is modified I am guessing for the purpose of maximizing the range of possible encoded values but are probably more useful for the encoding of frames in their unmodified forms. For example, both the VPS and SPS have a field called m_maxSubLayersMinus1 but m_maxSubLayers may be more useful for analyzing and encoding of frames.

When the unmodified form is more useful, I think it would be less confusing to use the unmodified form with the variable name without the modification and then modify the field at the time of encoding. That is, use m_maxSubLayers, then at the time of encoding in TEncSbac, encode m_maxSubLayers - 1.

This would break from naming h265 fields after the names used in the specification but removes any thought of "Do I need to add one to m_maxSubLayersMinus1 before using it.." or "do I need to subtract 1 before encoding it.." I don't think removing MinusX or PlusX from a field name is going to hurt too much, especially if it's documented in comments at it's declaration.

Of course some fields may be more useful in their modified form. Either way, I prefer to have the name of the field match the state of the value it holds. If anyone knows of any particular field that should be treated one way or the other please let me know.
_______________________________________________
x265-devel mailing list
[email protected]
https://mailman.videolan.org/listinfo/x265-devel

Reply via email to