miscellaneous fixes

- bump library version
- add help desk for --clip-neighbour
- update the default values of --clip-neighbour and --intra-bits
- update tests to more sensible
This commit is contained in:
Joose Sainio 2020-03-19 10:47:28 +02:00
parent 2c345bc3cf
commit e823ac1dae
5 changed files with 25 additions and 12 deletions

View file

@ -23,7 +23,7 @@ AC_CONFIG_SRCDIR([src/encmain.c])
#
# Here is a somewhat sane guide to lib versioning: http://apr.apache.org/versioning.html
ver_major=5
ver_minor=0
ver_minor=1
ver_release=0
# Prevents configure from adding a lot of defines to the CFLAGS

View file

@ -153,8 +153,8 @@ int kvz_config_init(kvz_config *cfg)
cfg->zero_coeff_rdo = true;
cfg->rc_algorithm = KVZ_NO_RC;
cfg->intra_bit_allocation = true;
cfg->clip_neighbour = false;
cfg->intra_bit_allocation = false;
cfg->clip_neighbour = true;
return 1;
}
@ -956,16 +956,21 @@ int kvz_config_parse(kvz_config *cfg, const char *name, const char *value)
cfg->gop_lp_definition.d = gop.d;
cfg->gop_lp_definition.t = gop.t;
cfg->intra_bit_allocation = false;
cfg->intra_bit_allocation = true;
cfg->clip_neighbour = false;
} else if (atoi(value) == 8) {
cfg->gop_lowdelay = 0;
cfg->gop_len = sizeof(kvz_gop_ra8) / sizeof(kvz_gop_ra8[0]);
memcpy(cfg->gop, kvz_gop_ra8, sizeof(kvz_gop_ra8));
cfg->intra_bit_allocation = false;
cfg->clip_neighbour = true;
} else if (atoi(value) == 16) {
cfg->gop_lowdelay = 0;
cfg->gop_len = sizeof(kvz_gop_ra16) / sizeof(kvz_gop_ra16[0]);
memcpy(cfg->gop, kvz_gop_ra16, sizeof(kvz_gop_ra16));
cfg->intra_bit_allocation = false;
cfg->clip_neighbour = true;
} else if (atoi(value) == 0) {
//Disable gop
@ -1626,11 +1631,16 @@ int kvz_config_validate(const kvz_config *const cfg)
error = 1;
}
if(cfg->target_bitrate > 0 && cfg->rc_algorithm == 0) {
if(cfg->target_bitrate > 0 && cfg->rc_algorithm == KVZ_NO_RC) {
fprintf(stderr, "Bitrate set but rc-algorithm is turned off.\n");
error = 1;
}
if(cfg->target_bitrate == 0 && cfg->rc_algorithm != KVZ_NO_RC) {
fprintf(stderr, "Rate control algorithm set but bitrate not set.\n");
error = 1;
}
return !error;
}

View file

@ -426,8 +426,11 @@ void print_help(void)
" - lambda: rate control from:\n"
" DOI: 10.1109/TIP.2014.2336550 \n"
" - oba: DOI: 10.1109/TCSVT.2016.2589878\n"
" --intra-bits : Use Hadamard cost based allocation for intra\n"
" --(no-)intra-bits : Use Hadamard cost based allocation for intra\n"
" frames. Default on for gop 8 and off for lp-gop\n"
" --(no-)clip-neighbour : On oba based rate control whether to clip \n"
" lambda values to same frame's ctus or previous'.\n"
" Default on for RA GOPS and disabled for LP.\n"
" --(no-)lossless : Use lossless coding. [disabled]\n"
" --mv-constraint <string> : Constrain movement vectors. [none]\n"
" - none: No constraint\n"

View file

@ -121,7 +121,7 @@ typedef struct encoder_state_config_frame_t {
//! Number of bits written in the current GOP.
uint64_t cur_gop_bits_coded;
//! Number of bits written in the current GOP.
//! Number of bits written in the current frame.
uint64_t cur_frame_bits_coded;
//! Number of bits targeted for the current GOP.
@ -158,7 +158,7 @@ typedef struct encoder_state_config_frame_t {
struct kvz_rc_data *new_ratecontrol;
struct encoder_state_t *previous_layer_state;
struct encoder_state_t const *previous_layer_state;
/**
* \brief Whether next NAL is the first NAL in the access unit.

View file

@ -5,8 +5,8 @@ set -eu
valgrind_test 264x130 10 --bitrate=500000 -p0 -r1 --owf=1 --threads=2 --rd=0 --no-rdoq --no-deblock --no-sao --no-signhide --subme=0 --pu-depth-inter=1-3 --pu-depth-intra=2-3
if [ ! -z ${GITLAB_CI+x} ];then valgrind_test 512x512 30 --bitrate=100000 -p0 -r1 --owf=1 --threads=2 --rd=0 --no-rdoq --no-deblock --no-sao --no-signhide --subme=2 --pu-depth-inter=1-3 --pu-depth-intra=2-3 --bipred; fi
if [ ! -z ${GITLAB_CI+x} ];then valgrind_test 512x512 30 --bitrate=100000 -p0 -r1 --owf=1 --threads=2 --rd=0 --no-rdoq --no-deblock --no-sao --no-signhide --subme=2 --pu-depth-inter=1-3 --pu-depth-intra=2-3 --bipred --rc-algorithm oba --no-intra-bits; fi
if [ ! -z ${GITLAB_CI+x} ];then valgrind_test 512x512 30 --bitrate=100000 -p0 -r1 --owf=1 --threads=2 --rd=0 --no-rdoq --no-deblock --no-sao --no-signhide --subme=2 --pu-depth-inter=1-3 --pu-depth-intra=2-3 --bipred --rc-algorithm oba --intra-bits; fi
if [ ! -z ${GITLAB_CI+x} ];then valgrind_test 512x512 30 --bitrate=100000 -p0 -r1 --owf=1 --threads=2 --rd=0 --no-rdoq --no-deblock --no-sao --no-signhide --subme=2 --pu-depth-inter=1-3 --pu-depth-intra=2-3 --bipred --gop lp-g8d4t1 --rc-algorithm oba --no-intra-bits; fi
if [ ! -z ${GITLAB_CI+x} ];then valgrind_test 512x512 30 --bitrate=100000 -p0 -r1 --owf=1 --threads=2 --rd=0 --no-rdoq --no-deblock --no-sao --no-signhide --subme=2 --pu-depth-inter=1-3 --pu-depth-intra=2-3 --bipred --gop lp-g8d4t1 --rc-algorithm oba --intra-bits; fi
if [ ! -z ${GITLAB_CI+x} ];then valgrind_test 264x130 10 --bitrate=500000 -p0 -r1 --owf=1 --threads=2 --rd=0 --no-rdoq --no-deblock --no-sao --no-signhide --subme=0 --pu-depth-inter=1-3 --pu-depth-intra=2-3 --bipred --gop 8 --rc-algorithm oba --no-intra-bits --no-clip-neighbour; fi
if [ ! -z ${GITLAB_CI+x} ];then valgrind_test 264x130 10 --bitrate=500000 -p0 -r1 --owf=1 --threads=2 --rd=0 --no-rdoq --no-deblock --no-sao --no-signhide --subme=0 --pu-depth-inter=1-3 --pu-depth-intra=2-3 --bipred --gop 8 --rc-algorithm oba --intra-bits --clip-neighbour; fi
if [ ! -z ${GITLAB_CI+x} ];then valgrind_test 264x130 10 --bitrate=500000 -p0 -r1 --owf=1 --threads=2 --rd=0 --no-rdoq --no-deblock --no-sao --no-signhide --subme=0 --pu-depth-inter=1-3 --pu-depth-intra=2-3 --bipred --gop lp-g8d4t1 --rc-algorithm oba --no-intra-bits --no-clip-neighbour; fi
if [ ! -z ${GITLAB_CI+x} ];then valgrind_test 264x130 10 --bitrate=500000 -p0 -r1 --owf=1 --threads=2 --rd=0 --no-rdoq --no-deblock --no-sao --no-signhide --subme=0 --pu-depth-inter=1-3 --pu-depth-intra=2-3 --bipred --gop lp-g8d4t1 --rc-algorithm oba --intra-bits --clip-neighbour; fi