Added deblock beta/tc checking and allowed range to usage, closes issue #13

This commit is contained in:
Marko Viitanen 2014-02-06 14:32:30 +02:00
parent 4184818322
commit 4704a6adf4
3 changed files with 17 additions and 6 deletions

View file

@ -14,14 +14,15 @@ meant to be user configurable later.
Usage:
hevc_encoder -i <input> -w <width> -h <height> -o <output>
Optional parameters:
-n, --frames <integer> : number of frames to decode
-q, --qp <integer> : Quantization Parameter, default 32
-p, --period <integer> : Period of intra pictures, default 0
-n, --frames <integer> : number of frames to code [all]
-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
--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
Example:

View file

@ -159,6 +159,15 @@ static int config_parse(config *cfg, const char *name, const char *value)
cfg->deblock_tc = cfg->deblock_beta;
} else
cfg->deblock_enable = atobool(value);
if (cfg->deblock_beta < -6 || cfg->deblock_beta > 6) {
fprintf(stderr, "--deblock beta parameter out of range [-6..6], set to 0\n");
cfg->deblock_beta = 0;
}
if (cfg->deblock_tc < -6 || cfg->deblock_tc > 6) {
fprintf(stderr, "--deblock tc parameter out of range [-6..6], set to 0\n");
cfg->deblock_tc = 0;
}
}
OPT("sao")
cfg->sao_enable = atobool(value);

View file

@ -90,14 +90,15 @@ int main(int argc, char *argv[])
"Usage:\n"
"hevc_encoder -i <input> -w <width> -h <height> -o <output>\n"
"Optional parameters:\n"
" -n, --frames <integer> : number of frames to decode\n"
" -q, --qp <integer> : Quantization Parameter, default 32\n"
" -p, --period <integer> : Period of intra pictures, default 0\n"
" -n, --frames <integer> : number of frames to code [all]\n"
" -q, --qp <integer> : Quantization Parameter [32]\n"
" -p, --period <integer> : Period of intra pictures [0]\n"
" 0: only first picture is intra\n"
" 1: all pictures are intra\n"
" 2-N: every Nth picture is intra\n"
" --no-deblock : Disable deblocking filter\n"
" --deblock <beta:tc> : Deblocking filter parameters\n"
" beta and tc range is -6..6 [0:0]\n"
" --no-sao : Disable sample adaptive offset\n");
if (cfg)