From d2cdae4aa0639507a9123b6e4ae3ce6fbe37b58c Mon Sep 17 00:00:00 2001 From: Felicia Lim Date: Fri, 18 Aug 2023 11:57:43 -0700 Subject: [PATCH] Improve Convention section --- index.bs | 70 ++++++++++++++++++++++---------------------------------- 1 file changed, 27 insertions(+), 43 deletions(-) diff --git a/index.bs b/index.bs index 5a2e21cb..95a86fd4 100644 --- a/index.bs +++ b/index.bs @@ -2614,7 +2614,24 @@ All syntax elements conform to the [=Syntactic Description Language=] specified string indicates a null-terminated (i.e., ending at the first byte set to 0x00), UTF-8 encoded as defined in [[!RFC3629]] and whose length SHALL be limited to 128 bytes. syntaxName is a human readable label. - + +### Function templates ### {#convention-function-templates} + +When the template keyword is used to decorate the class declaration, it indicates that the code is a template with a placeholder type that can be reused by other classes. Only classes that use the template present in the bitstream; the template itself does not present in the bitstream. Classes that use a function template pass a data type that is specified in either [[!MP4-Systems]] or [[#convention-data-types]]. + +Example + +``` +template +class Foo { + T t; +} + +class Bar { + Foo f; +} +``` + ## Arithmetic Operators ## {#convention-arithmetic-operators} @@ -2636,53 +2653,20 @@ All syntax elements conform to the [=Syntactic Description Language=] specified + + + + + + + + +
ceil(x)The smallest integer that is greater than or equal to x.
round(x)The integer value closest to x. It may be implemented as floor(x + 0.5).
sqrt(x)The square root of x.
Clip3(x, y, z)Conforms to [=Clip3=] specified in [[!AV1-Convention]].
pow(x, y)The value of x to the power of y.
-## Function ## {#convention-function} - -### Function templates ### {#convention-function-templates} - -When the template keyword is used to decorate the class declaration, it indicates that the code is a template with a placeholder type that can be reused by other classes. Only classes that use the template present in the bitstream; the template itself does not present in the bitstream. Classes that use a function template pass a data type that is specified in either [[!MP4-Systems]] or [[#convention-data-types]]. - -Example - -``` -template -class Foo { - T t; -} - -class Bar { - Foo f; -} -``` - -### Mathematical functions ### {#convention-function-mathematical} - -Clip3(x, y, z) - -It conforms to [=Clip3=] specified in [[!AV1-Convention]]. - -round(x) - -The round() function returns the integer value closest to x and may be implemented as - -``` -round(x) = floor(x + 0.5). -``` - -MOD(Number, Divisor) - -The MOD() function returns the remainder after Number is divided by Divisor. - -pow(x, y) - -The pow() function returns the value of x to the power of y. - - # Annex # {#annex} ## Annex A: ID Linking Scheme (Informative) ## {#Annex_A}