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

View file

@ -13,10 +13,12 @@ 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:
Optional parameters:
--help : Print this help message and exit
--version : Print version information and exit
-n, --frames <integer> : Number of frames to code [all]
@ -70,10 +72,10 @@ http://ultravideo.cs.tut.fi/#encoder for more information.
--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)
--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
@ -125,7 +127,7 @@ http://ultravideo.cs.tut.fi/#encoder for more information.
--owf <integer>|auto : Number of parallel frames to process. 0 to disable.
Slices:
--slice-addresses <string>|u<int>:
--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,
@ -135,7 +137,8 @@ http://ultravideo.cs.tut.fi/#encoder for more information.
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

@ -19,7 +19,7 @@ EOF
kvazaar --help 2>&1 | tail -n+5 | head -n-4 | \
sed 's| : |\n|g;
s|>: $|>|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"