From 6b0a4fd63454e3c2185efe741e50e80df5c9a4a4 Mon Sep 17 00:00:00 2001
From: Jing Sun <jing.a.sun@intel.com>
Date: Tue, 5 Mar 2019 15:04:58 +0800
Subject: [PATCH 2/2] doc: Add libsvt_hevc encoder docs

Add docs for libsvt_hevc encoder in encoders.texi and general.texi

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Zhengxu Huang <zhengxu.huang@intel.com>
Signed-off-by: Hassene Tmar <hassene.tmar@intel.com>
Signed-off-by: Jing Sun <jing.a.sun@intel.com>
---
 doc/encoders.texi         | 152 ++++++++++++++++++++++++++++++++++++++
 doc/general_contents.texi |   8 ++
 2 files changed, 160 insertions(+)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index a92eb0eb2f..535e15764b 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -1884,6 +1884,158 @@ Set maximum NAL size in bytes.
 Allow skipping frames to hit the target bitrate if set to 1.
 @end table
 
+@section libsvt_hevc
+
+Scalable Video Technology for HEVC (SVT-HEVC) encoder wrapper.
+
+This encoder requires the presence of the headers and
+library during configuration. You need to explicitly configure the
+build with @code{--enable-libsvthevc}. The library is detected using
+@command{pkg-config}.
+
+For more information about the library see
+@url{https://github.com/intel/SVT-HEVC.git}.
+
+@subsection Options
+
+The following FFmpeg global options affect the configurations of the
+libsvt_hevc encoder:
+
+@table @option
+@item b  (@emph{bitrate})
+Set the bitrate (as a number of bits per second). Default is 7M.
+
+@item g  / @option{gop_size}
+Set the GOP size. Default is -2 (unspecified).
+
+@item flags +cgop
+Enable closed GOP.
+
+@item qmin (@emph{min-q})
+Default is 10
+
+@item qmax (@emph{max-q})
+Default is 48
+
+Set minimum/maximum quantisation values.  Valid range is from 0 to 51
+(Only used when bit rate control mode @option{rc} is set to 1(vbr) mode.
+It is required that qmax >= qmin).
+
+@item profile (@emph{profile})
+Set profile restrictions. Can assume one of the following possible values:
+
+@table @samp
+@item main
+main profile
+@item main10
+main10 profile
+@item rext
+rext profile
+@end table
+
+Default is 1 (main).
+
+@item level (@emph{level})
+
+@option{level} sets the value of @emph{level}.
+Set level (level_idc). Default is 0 (to be determined by the encoder).
+
+@end table
+
+The encoder also has its own specific options:
+
+@table @option
+@item aud (@emph{aud})
+Enable use of access unit delimiters when set to 1. Default is 0 (Off).
+
+@item hielevel
+Set hierarchical levels. Can assume one of the following possible values:
+
+@table @samp
+@item flat
+flat more
+@item 1 level
+Minigop size is 2^1
+@item 2 level
+Minigop size is 2^2
+@item 3 level
+Minigop size is 2^3
+@end table
+
+Default is 3 level.
+
+@item la_depth
+Set look-ahead depth, depending on @option{rc}: for @var{vbr}, it's recommended
+to unset it and use the default value (the intra period); for @var{cqp}, better
+specify the look-ahead depth.
+
+The range is @var{-1-256}. Default is -1 (unset and the default value to be used).
+
+@item preset
+Set the quality vs density tradeoff point at which the encoding is to be performed.
+Higher perset value, higher density and lower quality.
+
+The range is @var{0-12}. Default is 9.
+
+@item tier
+Set @emph{general_tier_flag}.  This may affect the level chosen for the stream
+if it is not explicitly specified. Can assume one of the following possible values:
+
+@item socket
+Target CPU socket to use. 0 or 1 are supported. -1 use all available (default)
+
+@table @samp
+@item main
+main tier
+@item high
+high tier
+@end table
+
+Default is 1 (main).
+
+@item rc
+Set bit rate control mode. Can assume one of the following possible values:
+
+@table @samp
+@item cqp
+Constant QP (CQP) mode
+@item vbr
+Variable Bit Rate (VBR) mode
+@end table
+
+Default is 0 (cqp).
+
+@item forced_idr
+Force keyframes to be IDR if set to >=0 (the value sets headers insertion interval). Default is -1 (CRA).
+
+@item asm_type
+Auto select highest supported asm if set to 1 or C only if 0. Default is 1.
+
+@item qp
+Initial quantization parameter for the intra pictures used when
+@option{rc} is cqp mode. The range is from @var{0-51}. Default is 32.
+
+@item sc_detection
+Enables or disables the scene change detection algorithm. Default is 0 (disabled).
+
+@item tune
+Set quality tuning mode. Can assume one of the following possible values:
+
+@table @samp
+@item sq
+Visually optimized mode
+@item oq
+PSNR / SSIM optimized mode
+@item vmaf
+VMAF optimized mode
+@end table
+
+Default is 1 (oq).
+
+@item bl_mode
+Enables or disables Random Access Prediction. Default is 0 (disabled).
+@end table
+
 @section libtheora
 
 libtheora Theora encoder wrapper.
diff --git a/doc/general_contents.texi b/doc/general_contents.texi
index 33ece6e884..cd46332fc4 100644
--- a/doc/general_contents.texi
+++ b/doc/general_contents.texi
@@ -267,6 +267,14 @@ Go to @url{https://github.com/OpenVisualCloud/SVT-AV1/} and follow the instructi
 for installing the library. Then pass @code{--enable-libsvtav1} to configure to
 enable it.
 
+@section Scalable Video Technology for HEVC
+
+FFmpeg can make use of the SVT-HEVC library for HEVC encoding.
+
+Go to @url{https://github.com/intel/SVT-HEVC.git} and follow the instructions
+for installing the library. Pass @code{--enable-libsvthevc} to configure to
+enable it.
+
 @section TwoLAME
 
 FFmpeg can make use of the TwoLAME library for MP2 encoding.
-- 
1.8.3.1

