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: Usage:
hevc_encoder -i <input> -w <width> -h <height> -o <output> hevc_encoder -i <input> -w <width> -h <height> -o <output>
Optional parameters: Optional parameters:
-n, --frames <integer> : number of frames to decode -n, --frames <integer> : number of frames to code [all]
-q, --qp <integer> : Quantization Parameter, default 32 -q, --qp <integer> : Quantization Parameter [32]
-p, --period <integer> : Period of intra pictures, default 0 -p, --period <integer> : Period of intra pictures [0]
0: only first picture is intra 0: only first picture is intra
1: all pictures are intra 1: all pictures are intra
2-N: every Nth picture is intra 2-N: every Nth picture is intra
--no-deblock : Disable deblocking filter --no-deblock : Disable deblocking filter
--deblock <beta:tc> : Deblocking filter parameters --deblock <beta:tc> : Deblocking filter parameters
beta and tc range is -6..6 [0:0]
--no-sao : Disable sample adaptive offset --no-sao : Disable sample adaptive offset
Example: 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; cfg->deblock_tc = cfg->deblock_beta;
} else } else
cfg->deblock_enable = atobool(value); 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") OPT("sao")
cfg->sao_enable = atobool(value); cfg->sao_enable = atobool(value);

View file

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