From b6758cadb9be71ed6680a520a629d5180858de2e Mon Sep 17 00:00:00 2001 From: Yannis Guyon Date: Fri, 20 Sep 2024 11:05:13 +0000 Subject: [PATCH] Specify Sample Transform syntax versioning (#246) Increase unary operator range to 64+ to leave room for more operand token types. --- index.bs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/index.bs b/index.bs index 5c3b1b8..a4f14c2 100755 --- a/index.bs +++ b/index.bs @@ -417,9 +417,9 @@ aligned(8) class SampleTransform { // input image item to the stack. At most 'reference_count'. unsigned int(8) input_image_item_index; // 1-based } else { - if (token < 128) { + if (token >= 64 && token <= 67) { // Unary operator. Pop an operand from the stack. - } else { + } else if (token >= 128 && token <= 137) { // Binary operator. Pop the right operand // and then the left operand from the stack. } @@ -431,9 +431,9 @@ aligned(8) class SampleTransform {
Semantics
-version shall be equal to 0. Readers shall not process a SampleTransform with an unrecognized version number. +version shall be equal to 0. Readers shall ignore a SampleTransform with an unrecognized version number. -reserved shall be equal to 0 in files conforming to this version of this specification. The value of reserved shall be ignored by readers. +reserved shall be equal to 0. The value of reserved shall be ignored by readers. bit_depth determines the precision (from 8 to 64 bits, see Table 1) of the signed integer temporary variable supporting the intermediate results of the operations. It also determines the precision of the stack elements and the field size of the constant fields. This intermediate precision shall be high enough so that all input sample values fit into that signed bit depth. @@ -459,9 +459,9 @@ The result of any computation underflowing or overflowing the intermediate bit d token_count is the expected number of tokens to read. -token determines the type of the operand (constant or input image item sample) or the operator (how to transform one or two operands into the result). See Table 2. Values other than the ones in the table below are reserved. +token determines the type of the operand (constant or input image item sample) or the operator (how to transform one or two operands into the result). See Table 2. Values other than the ones in Table 2 below are reserved. Readers shall ignore a SampleTransform with a reserved token value. -Note: token values greater than 1 and less than 128 are unary operators, and token values greater than or equal to 128 are binary operators. +Note: token values greater than or equal to 64 and less than or equal to 67 are unary operators, and token values greater than or equal to 128 and less than or equal to 137 are binary operators. - + - + - + - +
@@ -492,28 +492,28 @@ Note: token values greater than 1 and less than 128 are unary opera
input image item sample value
264 negation operator 1 Negation of the left operand. -L
365 absolute value operator 1 Absolute value of the left operand. |L|
466 not operator 1 Bitwise complement of the operand. ¬L
567 bsr operator 1 0-based index of the most significant set bit of the left operand if the left operand is strictly positive, zero otherwise.