[FFmpeg-devel] [PATCH 3/4] FFV1 specification: Add conventions

Jerome Martinez jerome at mediaarea.net
Fri May 1 13:56:19 CEST 2015


Le 01/05/2015 13:50, Michael Niedermayer a écrit :
> duplicate patch [...]

I forgot to attach the patch. Attached now.
-------------- next part --------------
>From 591d517e4aafb981e4f2cb21cfc212134a719d0a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Martinez?= <jerome at mediaarea.net>
Date: Fri, 1 May 2015 12:02:56 +0200
Subject: [PATCH 3/4] Add conventions.

Arithmetic operators, assignment operators, comparison operators, order of operation precedence, range.
---
 ffv1.lyx | 606 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 606 insertions(+)

diff --git a/ffv1.lyx b/ffv1.lyx
index ace5908..228f40f 100644
--- a/ffv1.lyx
+++ b/ffv1.lyx
@@ -311,6 +311,589 @@ VLC Variable length code
 \end_layout
 
 \begin_layout Section
+Conventions
+\end_layout
+
+\begin_layout Standard
+Note: the operators and the order of precedence are the same as used in
+ the C programming language
+\begin_inset CommandInset citation
+LatexCommand cite
+key "ISO9899"
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Subsection
+Arithmetic operators
+\end_layout
+
+\begin_layout Description
+a
+\begin_inset space ~
+\end_inset
+
++
+\begin_inset space ~
+\end_inset
+
+b means a plus b.
+\end_layout
+
+\begin_layout Description
+a
+\begin_inset space ~
+\end_inset
+
+-
+\begin_inset space ~
+\end_inset
+
+b means a minus b.
+\end_layout
+
+\begin_layout Description
+-a means negation of a.
+\end_layout
+
+\begin_layout Description
+a
+\begin_inset space ~
+\end_inset
+
+*
+\begin_inset space ~
+\end_inset
+
+b means a multiplied by b.
+\end_layout
+
+\begin_layout Description
+a
+\begin_inset space ~
+\end_inset
+
+/
+\begin_inset space ~
+\end_inset
+
+b means a divided by b with truncation of the result toward zero.
+\end_layout
+
+\begin_layout Description
+a
+\begin_inset space ~
+\end_inset
+
+%
+\begin_inset space ~
+\end_inset
+
+b means remainder of a divided by b.
+\end_layout
+
+\begin_layout Description
+a
+\begin_inset space ~
+\end_inset
+
+&
+\begin_inset space ~
+\end_inset
+
+b means bit-wise 
+\begin_inset Quotes eld
+\end_inset
+
+and
+\begin_inset Quotes erd
+\end_inset
+
+ of a and b.
+\end_layout
+
+\begin_layout Description
+a
+\begin_inset space ~
+\end_inset
+
+|
+\begin_inset space ~
+\end_inset
+
+b means bit-wise 
+\begin_inset Quotes eld
+\end_inset
+
+or
+\begin_inset Quotes erd
+\end_inset
+
+ of a and b.
+\end_layout
+
+\begin_layout Description
+a
+\begin_inset space ~
+\end_inset
+
+>>
+\begin_inset space ~
+\end_inset
+
+b means arithmetic righ shift of two's complement integer representation
+ of a by b binary digits.
+\end_layout
+
+\begin_layout Description
+a
+\begin_inset space ~
+\end_inset
+
+<<
+\begin_inset space ~
+\end_inset
+
+b means arithmetic left shift of two's complement integer representation
+ of a by b binary digits.
+\end_layout
+
+\begin_layout Subsection
+Assignment operators
+\end_layout
+
+\begin_layout Description
+a
+\begin_inset space ~
+\end_inset
+
+=
+\begin_inset space ~
+\end_inset
+
+b means a is assigned b.
+\end_layout
+
+\begin_layout Description
+a++ is equivalent to a
+\begin_inset space ~
+\end_inset
+
+=
+\begin_inset space ~
+\end_inset
+
+a
+\begin_inset space ~
+\end_inset
+
++
+\begin_inset space ~
+\end_inset
+
+1.
+\end_layout
+
+\begin_layout Description
+a-- is equivalent to a
+\begin_inset space ~
+\end_inset
+
+=
+\begin_inset space ~
+\end_inset
+
+a
+\begin_inset space ~
+\end_inset
+
+-
+\begin_inset space ~
+\end_inset
+
+1.
+\end_layout
+
+\begin_layout Description
+a
+\begin_inset space ~
+\end_inset
+
++=
+\begin_inset space ~
+\end_inset
+
+b is equivalent to a
+\begin_inset space ~
+\end_inset
+
+=
+\begin_inset space ~
+\end_inset
+
+a
+\begin_inset space ~
+\end_inset
+
++
+\begin_inset space ~
+\end_inset
+
+b.
+\end_layout
+
+\begin_layout Description
+a
+\begin_inset space ~
+\end_inset
+
+-=
+\begin_inset space ~
+\end_inset
+
+b is equivalent to a
+\begin_inset space ~
+\end_inset
+
+=
+\begin_inset space ~
+\end_inset
+
+a
+\begin_inset space ~
+\end_inset
+
+-
+\begin_inset space ~
+\end_inset
+
+b.
+\end_layout
+
+\begin_layout Subsection
+Comparison operators
+\end_layout
+
+\begin_layout Description
+a
+\begin_inset space ~
+\end_inset
+
+>
+\begin_inset space ~
+\end_inset
+
+b means a greater than b.
+\end_layout
+
+\begin_layout Description
+a
+\begin_inset space ~
+\end_inset
+
+>=
+\begin_inset space ~
+\end_inset
+
+b means a greater than or equal to b.
+\end_layout
+
+\begin_layout Description
+a
+\begin_inset space ~
+\end_inset
+
+<
+\begin_inset space ~
+\end_inset
+
+b means a less than b.
+\end_layout
+
+\begin_layout Description
+a
+\begin_inset space ~
+\end_inset
+
+<=
+\begin_inset space ~
+\end_inset
+
+b means a less than or equal b.
+\end_layout
+
+\begin_layout Description
+a
+\begin_inset space ~
+\end_inset
+
+==
+\begin_inset space ~
+\end_inset
+
+b means a equal to b.
+\end_layout
+
+\begin_layout Description
+a
+\begin_inset space ~
+\end_inset
+
+!=
+\begin_inset space ~
+\end_inset
+
+b means a not equalto b.
+\end_layout
+
+\begin_layout Description
+a
+\begin_inset space ~
+\end_inset
+
+&&
+\begin_inset space ~
+\end_inset
+
+b means boolean logical 
+\begin_inset Quotes eld
+\end_inset
+
+and
+\begin_inset Quotes erd
+\end_inset
+
+ of a and b.
+\end_layout
+
+\begin_layout Description
+a
+\begin_inset space ~
+\end_inset
+
+||
+\begin_inset space ~
+\end_inset
+
+b means boolean logical 
+\begin_inset Quotes eld
+\end_inset
+
+or
+\begin_inset Quotes erd
+\end_inset
+
+ of a and b.
+\end_layout
+
+\begin_layout Description
+!a means boolean logical 
+\begin_inset Quotes eld
+\end_inset
+
+not
+\begin_inset Quotes erd
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Description
+a
+\begin_inset space ~
+\end_inset
+
+?
+\begin_inset space ~
+\end_inset
+
+b
+\begin_inset space ~
+\end_inset
+
+:
+\begin_inset space ~
+\end_inset
+
+c means b if a is true otherwise c.
+\end_layout
+
+\begin_layout Subsection
+Order of operation precedence
+\end_layout
+
+\begin_layout Standard
+When order of precedence is not indicated explicitly by use of parentheses,
+ operations are evaluated in the following order (from top to bottom, operations
+ of same precedence being evaluated from left to right):
+\end_layout
+
+\begin_layout Standard
+\begin_inset Tabular
+<lyxtabular version="3" rows="13" columns="1">
+<features rotate="0" tabularvalignment="middle">
+<column alignment="center" valignment="top">
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+a++, a--
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+!a, -a
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+a * b, a / b, a % b
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+a + b, a - b
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+a << b, a >> b
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+a < b, a <= b, a > b, a >= b
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+a == b, a != b
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+a & b
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+a | b
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+a && b
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+a || b
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+a ? b : c
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+a = b, a += b, a -= b
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Range
+\end_layout
+
+\begin_layout Description
+a...b means any value starting from a to b, inclusive.
+\end_layout
+
+\begin_layout Section
 General Description
 \end_layout
 
@@ -8940,6 +9523,29 @@ Bibliography
 \labelwidthstring References
 \begin_inset CommandInset bibitem
 LatexCommand bibitem
+label "ISO/IEC 9899"
+key "ISO9899"
+
+\end_inset
+
+ISO/IEC 9899 - Programming languages - C 
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+http://www.open-std.org/JTC1/SC22/WG14/www/standards
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Bibliography
+\labelwidthstring References
+\begin_inset CommandInset bibitem
+LatexCommand bibitem
 label "JPEGLS"
 key "JPEGLS"
 
-- 
1.9.5.msysgit.1



More information about the ffmpeg-devel mailing list