From: Anton Khirnov <anton@khirnov.net> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH 1/3] doc/developer.texi: document the use of other languages than C Date: Wed, 15 Mar 2023 15:07:44 +0100 Message-ID: <20230315140746.14692-1-anton@khirnov.net> (raw) --- doc/developer.texi | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) 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: -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next reply other threads:[~2023-03-15 14:08 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-03-15 14:07 Anton Khirnov [this message] 2023-03-15 14:07 ` [FFmpeg-devel] [PATCH 2/3] doc/developer.texi: document checkasm Anton Khirnov 2023-03-20 22:13 ` Stefano Sabatini 2023-03-15 14:07 ` [FFmpeg-devel] [PATCH 3/3] doc/developer.texi: add a section on API/ABI compatibility Anton Khirnov 2023-03-20 22:26 ` Stefano Sabatini 2023-03-21 8:10 ` Anton Khirnov 2023-03-20 22:13 ` [FFmpeg-devel] [PATCH 1/3] doc/developer.texi: document the use of other languages than C Stefano Sabatini
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230315140746.14692-1-anton@khirnov.net \ --to=anton@khirnov.net \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git