Add a script for updating README

Adds script tools/update_readme.sh for regenerating the "Using Kvazaar"
section of README.md from the output of "kvazaar --help".
This commit is contained in:
Arttu Ylä-Outinen 2016-02-05 16:16:18 +02:00
parent aac5373095
commit 40c7198f7d
5 changed files with 182 additions and 140 deletions

235
README.md
View file

@ -13,129 +13,132 @@ http://ultravideo.cs.tut.fi/#encoder for more information.
##Using Kvazaar
Usage:
kvazaar -i <input> --input-res <width>x<height> -o <output>
[comment]: # (BEGIN KVAZAAR HELP MESSAGE)
```
Usage:
kvazaar -i <input> --input-res <width>x<height> -o <output>
Optional parameters:
--help : Print this help message and exit
--version : Print version information and exit
-n, --frames <integer> : Number of frames to code [all]
--seek <integer> : First frame to code [0]
--input-res <int>x<int> : Input resolution (width x height) or
auto : try to detect from file name [auto]
--input-fps <num>/<denom> : Framerate of the input video [25.0]
-q, --qp <integer> : Quantization Parameter [32]
-p, --period <integer> : Period of intra pictures [0]
0: only first picture is intra
1: all pictures are intra
2-N: every Nth picture is intra
--vps-period <integer> : Specify how often the video parameter set is
re-sent. [0]
0: only send VPS with the first frame
1: send VPS with every intra frame
N: send VPS with every Nth intra frame
-r, --ref <integer> : Reference frames, range 1..15 [3]
--no-deblock : Disable deblocking filter
--deblock <beta:tc> : Deblocking filter parameters
beta and tc range is -6..6 [0:0]
--no-sao : Disable sample adaptive offset
--no-rdoq : Disable RDO quantization
--no-signhide : Disable sign hiding in quantization
--smp : Enable Symmetric Motion Partition
--amp : Enable Asymmetric Motion Partition
--rd <integer> : Rate-Distortion Optimization level [1]
0: no RDO
1: estimated RDO
2: full RDO
--mv-rdo : Enable Rate-Distortion Optimized motion vector costs
--full-intra-search : Try all intra modes.
--no-transform-skip : Disable transform skip
--aud : Use access unit delimiters
--cqmfile <string> : Custom Quantization Matrices from a file
--debug <string> : Output encoders reconstruction.
--cpuid <integer> : Disable runtime cpu optimizations with value 0.
--me <string> : Set integer motion estimation algorithm ["hexbs"]
"hexbs": Hexagon Based Search (faster)
"tz": Test Zone Search (better quality)
"full": Full Search (super slow)
--subme <integer> : Set fractional pixel motion estimation level [1].
0: only integer motion estimation
1: fractional pixel motion estimation enabled
--source-scan-type <string> : Set source scan type ["progressive"].
"progressive": progressive scan
"tff": top field first
"bff": bottom field first
--pu-depth-inter <int>-<int> : Range for sizes of inter prediction units to try.
0: 64x64, 1: 32x32, 2: 16x16, 3: 8x8
--pu-depth-intra <int>-<int> : Range for sizes of intra prediction units to try.
0: 64x64, 1: 32x32, 2: 16x16, 3: 8x8, 4: 4x4
--no-info : Don't add information about the encoder to settings.
--gop <string> : Definition for GOP [0]
- 0 disabled
- 8 B-frame pyramid of length 8
- lp-gop syntax, defined below (example: g8d4r3t2)
--bipred : Enable bi-prediction search
--bitrate <integer> : Target bitrate. [0]
0: disable rate-control
N: target N bits per second
--preset <string> : Use preset. This will override previous options.
ultrafast, superfast,veryfast, faster,
fast, medium, slow, slower, veryslow, placebo
--no-psnr : Don't calculate PSNR for frames
Optional parameters:
--help : Print this help message and exit
--version : Print version information and exit
-n, --frames <integer> : Number of frames to code [all]
--seek <integer> : First frame to code [0]
--input-res <int>x<int> : Input resolution (width x height) or
auto : try to detect from file name [auto]
--input-fps <num>/<denom> : Framerate of the input video [25.0]
-q, --qp <integer> : Quantization Parameter [32]
-p, --period <integer> : Period of intra pictures [0]
0: only first picture is intra
1: all pictures are intra
2-N: every Nth picture is intra
--vps-period <integer> : Specify how often the video parameter set is
re-sent. [0]
0: only send VPS with the first frame
1: send VPS with every intra frame
N: send VPS with every Nth intra frame
-r, --ref <integer> : Reference frames, range 1..15 [3]
--no-deblock : Disable deblocking filter
--deblock <beta:tc> : Deblocking filter parameters
beta and tc range is -6..6 [0:0]
--no-sao : Disable sample adaptive offset
--no-rdoq : Disable RDO quantization
--no-signhide : Disable sign hiding in quantization
--smp : Enable Symmetric Motion Partition
--amp : Enable Asymmetric Motion Partition
--rd <integer> : Rate-Distortion Optimization level [1]
0: no RDO
1: estimated RDO
2: full RDO
--mv-rdo : Enable Rate-Distortion Optimized motion vector costs
--full-intra-search : Try all intra modes.
--no-transform-skip : Disable transform skip
--aud : Use access unit delimiters
--cqmfile <string> : Custom Quantization Matrices from a file
--debug <string> : Output encoders reconstruction.
--cpuid <integer> : Disable runtime cpu optimizations with value 0.
--me <string> : Set integer motion estimation algorithm ["hexbs"]
"hexbs": Hexagon Based Search (faster)
"tz": Test Zone Search (better quality)
"full": Full Search (super slow)
--subme <integer> : Set fractional pixel motion estimation level [1].
0: only integer motion estimation
1: fractional pixel motion estimation enabled
--source-scan-type <string> : Set source scan type ["progressive"].
"progressive": progressive scan
"tff": top field first
"bff": bottom field first
--pu-depth-inter <int>-<int> : Range for sizes of inter prediction units to try.
0: 64x64, 1: 32x32, 2: 16x16, 3: 8x8
--pu-depth-intra <int>-<int> : Range for sizes of intra prediction units to try.
0: 64x64, 1: 32x32, 2: 16x16, 3: 8x8, 4: 4x4
--no-info : Don't add information about the encoder to settings.
--gop <string> : Definition of GOP structure [0]
"0": disabled
"8": B-frame pyramid of length 8
"lp-<string>": lp-gop definition (e.g. lp-g8d4r3t2)
--bipred : Enable bi-prediction search
--bitrate <integer> : Target bitrate. [0]
0: disable rate-control
N: target N bits per second
--preset <string> : Use preset. This will override previous options.
ultrafast, superfast,veryfast, faster,
fast, medium, slow, slower, veryslow, placebo
--no-psnr : Don't calculate PSNR for frames
Video Usability Information:
--sar <width:height> : Specify Sample Aspect Ratio
--overscan <string> : Specify crop overscan setting ["undef"]
- undef, show, crop
--videoformat <string> : Specify video format ["undef"]
- component, pal, ntsc, secam, mac, undef
--range <string> : Specify color range ["tv"]
- tv, pc
--colorprim <string> : Specify color primaries ["undef"]
- undef, bt709, bt470m, bt470bg,
smpte170m, smpte240m, film, bt2020
--transfer <string> : Specify transfer characteristics ["undef"]
- undef, bt709, bt470m, bt470bg,
smpte170m, smpte240m, linear, log100,
log316, iec61966-2-4, bt1361e,
iec61966-2-1, bt2020-10, bt2020-12
--colormatrix <string> : Specify color matrix setting ["undef"]
- undef, bt709, fcc, bt470bg, smpte170m,
smpte240m, GBR, YCgCo, bt2020nc, bt2020c
--chromaloc <integer> : Specify chroma sample location (0 to 5) [0]
Video Usability Information:
--sar <width:height> : Specify Sample Aspect Ratio
--overscan <string> : Specify crop overscan setting ["undef"]
- undef, show, crop
--videoformat <string> : Specify video format ["undef"]
- component, pal, ntsc, secam, mac, undef
--range <string> : Specify color range ["tv"]
- tv, pc
--colorprim <string> : Specify color primaries ["undef"]
- undef, bt709, bt470m, bt470bg,
smpte170m, smpte240m, film, bt2020
--transfer <string> : Specify transfer characteristics ["undef"]
- undef, bt709, bt470m, bt470bg,
smpte170m, smpte240m, linear, log100,
log316, iec61966-2-4, bt1361e,
iec61966-2-1, bt2020-10, bt2020-12
--colormatrix <string> : Specify color matrix setting ["undef"]
- undef, bt709, fcc, bt470bg, smpte170m,
smpte240m, GBR, YCgCo, bt2020nc, bt2020c
--chromaloc <integer> : Specify chroma sample location (0 to 5) [0]
Parallel processing:
--threads <integer> : Maximum number of threads to use.
Disable threads if set to 0.
Parallel processing:
--threads <integer> : Maximum number of threads to use.
Disable threads if set to 0.
Tiles:
--tiles-width-split <string>|u<int> :
Specifies a comma separated list of pixel
positions of tiles columns separation coordinates.
Can also be u followed by and a single int n,
in which case it produces columns of uniform width.
--tiles-height-split <string>|u<int> :
Specifies a comma separated list of pixel
positions of tiles rows separation coordinates.
Can also be u followed by and a single int n,
in which case it produces rows of uniform height.
Tiles:
--tiles-width-split <string>|u<int> :
Specifies a comma separated list of pixel
positions of tiles columns separation coordinates.
Can also be u followed by and a single int n,
in which case it produces columns of uniform width.
--tiles-height-split <string>|u<int> :
Specifies a comma separated list of pixel
positions of tiles rows separation coordinates.
Can also be u followed by and a single int n,
in which case it produces rows of uniform height.
Wpp:
--wpp : Enable wavefront parallel processing
--owf <integer>|auto : Number of parallel frames to process. 0 to disable.
Wpp:
--wpp : Enable wavefront parallel processing
--owf <integer>|auto : Number of parallel frames to process. 0 to disable.
Slices:
--slice-addresses <string>|u<int>:
Specifies a comma separated list of LCU
positions in tile scan order of tile separations.
Can also be u followed by and a single int n,
in which case it produces uniform slice length.
Deprecated parameters: (might be removed at some point)
Use --input-res:
-w, --width : Width of input in pixels
-h, --height : Height of input in pixels
Slices:
--slice-addresses <string>|u<int> :
Specifies a comma separated list of LCU
positions in tile scan order of tile separations.
Can also be u followed by and a single int n,
in which case it produces uniform slice length.
Deprecated parameters: (might be removed at some point)
Use --input-res:
-w, --width : Width of input in pixels
-h, --height : Height of input in pixels
```
[comment]: # (END KVAZAAR HELP MESSAGE)
###For example:

View file

@ -18,8 +18,8 @@ kvazaar \- open source HEVC encoder
EOF
kvazaar --help 2>&1 | tail -n+5 | head -n-4 | \
sed 's| : |\n|g;
s|>: $|>|g;
sed 's| : |\n|g;
s| :$||g;
s|^ --|.TP\n\\fB--|g;
s|^ --|.TP\n\\fB--|g;
s|^ -|.TP\n\\fB-|g;

View file

@ -22,7 +22,7 @@ Input resolution (width x height) or
auto
try to detect from file name [auto]
.TP
\fB\-\-input\-fps <number>
\fB\-\-input\-fps <num>/<denom>
Framerate of the input video [25.0]
.TP
\fB\-q\fR, \fB\-\-qp <integer>
@ -78,12 +78,6 @@ Enable Rate\-Distortion Optimized motion vector costs
\fB\-\-full\-intra\-search
Try all intra modes.
.TP
\fB\-\-me <string>
Set integer motion estimation algorithm ["hexbs"]
"hexbs": Hexagon Based Search (faster)
"tz": Test Zone Search (better quality)
"full": Full Search (super slow)
.TP
\fB\-\-no\-transform\-skip
Disable transform skip
.TP
@ -99,6 +93,12 @@ Output encoders reconstruction.
\fB\-\-cpuid <integer>
Disable runtime cpu optimizations with value 0.
.TP
\fB\-\-me <string>
Set integer motion estimation algorithm ["hexbs"]
"hexbs": Hexagon Based Search (faster)
"tz": Test Zone Search (better quality)
"full": Full Search (super slow)
.TP
\fB\-\-subme <integer>
Set fractional pixel motion estimation level [1].
0: only integer motion estimation
@ -121,8 +121,11 @@ Range for sizes of intra prediction units to try.
\fB\-\-no\-info
Don't add information about the encoder to settings.
.TP
\fB\-\-gop <int>
Length of Group of Pictures, must be 8 or 0 [0]
\fB\-\-gop <string>
Definition of GOP structure [0]
"0": disabled
"8": B\-frame pyramid of length 8
"lp\-<string>": lp\-gop definition (e.g. lp\-g8d4r3t2)
.TP
\fB\-\-bipred
Enable bi\-prediction search
@ -133,7 +136,7 @@ Target bitrate. [0]
N: target N bits per second
.TP
\fB\-\-preset <string>
Use preset
Use preset. This will override previous options.
ultrafast, superfast,veryfast, faster,
fast, medium, slow, slower, veryslow, placebo
.TP
@ -186,14 +189,12 @@ Disable threads if set to 0.
.SS "Tiles:"
.TP
\fB\-\-tiles\-width\-split <string>|u<int>
Specifies a comma separated list of pixel
positions of tiles columns separation coordinates.
Can also be u followed by and a single int n,
in which case it produces columns of uniform width.
.TP
\fB\-\-tiles\-height\-split <string>|u<int>
Specifies a comma separated list of pixel
positions of tiles rows separation coordinates.
Can also be u followed by and a single int n,

View file

@ -300,7 +300,7 @@ void print_help(void)
" --seek <integer> : First frame to code [0]\n"
" --input-res <int>x<int> : Input resolution (width x height) or\n"
" auto : try to detect from file name [auto]\n"
" --input-fps <number> : Framerate of the input video [25.0]\n"
" --input-fps <num>/<denom> : Framerate of the input video [25.0]\n"
" -q, --qp <integer> : Quantization Parameter [32]\n"
" -p, --period <integer> : Period of intra pictures [0]\n"
" 0: only first picture is intra\n"
@ -326,15 +326,15 @@ void print_help(void)
" 2: full RDO\n"
" --mv-rdo : Enable Rate-Distortion Optimized motion vector costs\n"
" --full-intra-search : Try all intra modes.\n"
" --me <string> : Set integer motion estimation algorithm [\"hexbs\"]\n"
" \"hexbs\": Hexagon Based Search (faster)\n"
" \"tz\": Test Zone Search (better quality)\n"
" \"full\": Full Search (super slow)\n"
" --no-transform-skip : Disable transform skip\n"
" --aud : Use access unit delimiters\n"
" --cqmfile <string> : Custom Quantization Matrices from a file\n"
" --debug <string> : Output encoders reconstruction.\n"
" --cpuid <integer> : Disable runtime cpu optimizations with value 0.\n"
" --me <string> : Set integer motion estimation algorithm [\"hexbs\"]\n"
" \"hexbs\": Hexagon Based Search (faster)\n"
" \"tz\": Test Zone Search (better quality)\n"
" \"full\": Full Search (super slow)\n"
" --subme <integer> : Set fractional pixel motion estimation level [1].\n"
" 0: only integer motion estimation\n"
" 1: fractional pixel motion estimation enabled\n"
@ -347,12 +347,15 @@ void print_help(void)
" --pu-depth-intra <int>-<int> : Range for sizes of intra prediction units to try.\n"
" 0: 64x64, 1: 32x32, 2: 16x16, 3: 8x8, 4: 4x4\n"
" --no-info : Don't add information about the encoder to settings.\n"
" --gop <int> : Length of Group of Pictures, must be 8 or 0 [0]\n"
" --gop <string> : Definition of GOP structure [0]\n"
" \"0\": disabled\n"
" \"8\": B-frame pyramid of length 8\n"
" \"lp-<string>\": lp-gop definition (e.g. lp-g8d4r3t2)\n"
" --bipred : Enable bi-prediction search\n"
" --bitrate <integer> : Target bitrate. [0]\n"
" 0: disable rate-control\n"
" N: target N bits per second\n"
" --preset <string> : Use preset\n"
" --preset <string> : Use preset. This will override previous options.\n"
" ultrafast, superfast,veryfast, faster,\n"
" fast, medium, slow, slower, veryslow, placebo\n"
" --no-psnr : Don't calculate PSNR for frames\n"
@ -383,12 +386,12 @@ void print_help(void)
" Disable threads if set to 0.\n"
"\n"
" Tiles:\n"
" --tiles-width-split <string>|u<int> : \n"
" --tiles-width-split <string>|u<int> :\n"
" Specifies a comma separated list of pixel\n"
" positions of tiles columns separation coordinates.\n"
" Can also be u followed by and a single int n,\n"
" in which case it produces columns of uniform width.\n"
" --tiles-height-split <string>|u<int> : \n"
" --tiles-height-split <string>|u<int> :\n"
" Specifies a comma separated list of pixel\n"
" positions of tiles rows separation coordinates.\n"
" Can also be u followed by and a single int n,\n"
@ -399,7 +402,7 @@ void print_help(void)
" --owf <integer>|auto : Number of parallel frames to process. 0 to disable.\n"
"\n"
" Slices:\n"
" --slice-addresses <string>|u<int>: \n"
" --slice-addresses <string>|u<int> :\n"
" Specifies a comma separated list of LCU\n"
" positions in tile scan order of tile separations.\n"
" Can also be u followed by and a single int n,\n"

35
tools/update_readme.sh Executable file
View file

@ -0,0 +1,35 @@
#!/bin/bash
# This file is part of Kvazaar HEVC encoder.
#
# Copyright (C) 2013-2016 Tampere University of Technology and others (see
# COPYING file).
#
# Kvazaar is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 2.1 as
# published by the Free Software Foundation.
#
# Kvazaar is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Kvazaar. If not, see <http://www.gnu.org/licenses/>.
if [[ $# != 1 ]]; then
printf "Usage: $0 README.md\n"
exit 1
fi
tmpfile="$(mktemp)"
{
sed '/BEGIN KVAZAAR HELP MESSAGE/q' -- "$1";
printf '```\n';
kvazaar --help;
printf '```\n';
sed -n '/END KVAZAAR HELP MESSAGE/{:a;p;n;ba}' -- "$1";
} >> "$tmpfile"
mv -- "$tmpfile" "$1"