diff mbox series

[FFmpeg-devel,1/3] doc/developer.texi: document the use of other languages than C

Message ID 20230315140746.14692-1-anton@khirnov.net
State Accepted
Commit a36ad2c649c5da5e09d6f4491c5b9e18194e7289
Headers show
Series [FFmpeg-devel,1/3] doc/developer.texi: document the use of other languages than C | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov March 15, 2023, 2:07 p.m. UTC
---
 doc/developer.texi | 38 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 36 insertions(+), 2 deletions(-)

Comments

Stefano Sabatini March 20, 2023, 10:13 p.m. UTC | #1
On date Wednesday 2023-03-15 15:07:44 +0100, Anton Khirnov wrote:
> ---
>  doc/developer.texi | 38 ++++++++++++++++++++++++++++++++++++--
>  1 file changed, 36 insertions(+), 2 deletions(-)

LGTM, thanks.
diff mbox series

Patch

diff --git a/doc/developer.texi b/doc/developer.texi
index 1275fa4f84..db5afafa4b 100644
--- a/doc/developer.texi
+++ b/doc/developer.texi
@@ -56,9 +56,9 @@  and should try to fix issues their commit causes.
 @anchor{Coding Rules}
 @chapter Coding Rules
 
-@section C language features
+@section Language
 
-FFmpeg is programmed in the ISO C99 language, extended with:
+FFmpeg is mainly programmed in the ISO C99 language, extended with:
 @itemize @bullet
 @item
 Atomic operations from C11 @file{stdatomic.h}. They are emulated on
@@ -83,6 +83,40 @@  complex numbers;
 mixed statements and declarations.
 @end itemize
 
+@subsection SIMD/DSP
+@anchor{SIMD/DSP}
+
+As modern compilers are unable to generate efficient SIMD or other
+performance-critical DSP code from plain C, handwritten assembly is used.
+Usually such code is isolated in a separate function. Then the standard approach
+is writing multiple versions of this function – a plain C one that works
+everywhere and may also be useful for debugging, and potentially multiple
+architecture-specific optimized implementations. Initialization code then
+chooses the best available version at runtime and loads it into a function
+pointer; the function in question is then always called through this pointer.
+
+The specific syntax used for writing assembly is:
+@itemize @bullet
+@item
+NASM on x86;
+
+@item
+GAS on ARM.
+@end itemize
+
+@subsection Other languages
+
+Other languages than C may be used in special cases:
+@itemize @bullet
+@item
+Compiler intrinsics or inline assembly when the code in question cannot be
+written in the standard way described in the @ref{SIMD/DSP} section. This
+typically applies to code that needs to be inlined.
+
+@item
+Objective-C where required for interacting with macOS-specific interfaces.
+@end itemize
+
 @section Code formatting conventions
 
 There are the following guidelines regarding the indentation in files: