mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 11:24:05 +00:00
Add option to disable fast intra search.
This commit is contained in:
parent
e27fc875c0
commit
94bc457b6c
|
@ -35,6 +35,7 @@ meant to be user configurable later.
|
|||
0: no RDO
|
||||
1: estimated RDO
|
||||
2: full RDO
|
||||
--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
|
||||
|
|
|
@ -66,6 +66,7 @@ int config_init(config *cfg)
|
|||
cfg->sao_enable = 1;
|
||||
cfg->rdoq_enable = 1;
|
||||
cfg->rdo = 1;
|
||||
cfg->full_intra_search = 0;
|
||||
cfg->trskip_enable = 1;
|
||||
cfg->vui.sar_width = 0;
|
||||
cfg->vui.sar_height = 0;
|
||||
|
@ -362,16 +363,19 @@ static int config_parse(config *cfg, const char *name, const char *value)
|
|||
cfg->sao_enable = atobool(value);
|
||||
else if OPT("rdoq")
|
||||
cfg->rdoq_enable = atobool(value);
|
||||
else if OPT("rd") {
|
||||
else if OPT("rd")
|
||||
{
|
||||
int rdo = 0;
|
||||
if (sscanf(value, "%d", &rdo)) {
|
||||
if(rdo < 0 || rdo > 2) {
|
||||
if (rdo < 0 || rdo > 2) {
|
||||
fprintf(stderr, "--rd parameter out of range [0..2], set to 1\n");
|
||||
rdo = 1;
|
||||
}
|
||||
cfg->rdo = rdo;
|
||||
}
|
||||
}
|
||||
else if OPT("full-intra-search")
|
||||
cfg->full_intra_search = atobool(value);
|
||||
else if OPT("transform-skip")
|
||||
cfg->trskip_enable = atobool(value);
|
||||
else if OPT("sar") {
|
||||
|
@ -458,6 +462,7 @@ int config_read(config *cfg,int argc, char *argv[])
|
|||
{ "no-sao", no_argument, NULL, 0 },
|
||||
{ "no-rdoq", no_argument, NULL, 0 },
|
||||
{ "rd", required_argument, NULL, 0 },
|
||||
{ "full-intra-search", no_argument, NULL, 0 },
|
||||
{ "no-transform-skip", no_argument, NULL, 0 },
|
||||
{ "sar", required_argument, NULL, 0 },
|
||||
{ "overscan", required_argument, NULL, 0 },
|
||||
|
|
|
@ -45,6 +45,7 @@ typedef struct
|
|||
int32_t sao_enable; /*!< \brief Flag to enable sample adaptive offset filter */
|
||||
int32_t rdoq_enable; /*!< \brief Flag to enable RD optimized quantization. */
|
||||
int32_t rdo; /*!< \brief RD-calculation level (0..2) */
|
||||
bool full_intra_search; /*!< \brief Don't skip modes in intra search.e */
|
||||
int32_t trskip_enable; /*!< \brief Flag to enable transform skip (for 4x4 blocks). */
|
||||
int32_t deblock_beta; /*!< \brief (deblocking) beta offset (div 2), range -6...6 */
|
||||
int32_t deblock_tc; /*!< \brief (deblocking) tc offset (div 2), range -6...6 */
|
||||
|
|
|
@ -120,6 +120,7 @@ int main(int argc, char *argv[])
|
|||
" 0: no RDO\n"
|
||||
" 1: estimated RDO\n"
|
||||
" 2: full RDO\n"
|
||||
" --full-intra-search : Try all intra modes.\n"
|
||||
" --no-transform-skip : Disable transform skip\n"
|
||||
" --aud : Use access unit delimiters\n"
|
||||
" --cqmfile <string> : Custom Quantization Matrices from a file\n"
|
||||
|
@ -256,6 +257,7 @@ int main(int argc, char *argv[])
|
|||
// RDO
|
||||
encoder.rdoq_enable = (int8_t)encoder.cfg->rdoq_enable;
|
||||
encoder.rdo = (int8_t)encoder.cfg->rdo;
|
||||
encoder.full_intra_search = (int8_t)encoder.cfg->full_intra_search;
|
||||
// TR SKIP
|
||||
encoder.trskip_enable = (int8_t)encoder.cfg->trskip_enable;
|
||||
// VUI
|
||||
|
|
|
@ -72,6 +72,7 @@ int encoder_control_init(encoder_control * const encoder, const config * const c
|
|||
encoder->sao_enable = 1;
|
||||
// Rate-distortion optimization level
|
||||
encoder->rdo = 1;
|
||||
encoder->full_intra_search = 0;
|
||||
|
||||
// Initialize the scaling list
|
||||
scalinglist_init(&encoder->scaling_list);
|
||||
|
|
|
@ -78,6 +78,7 @@ typedef struct encoder_control
|
|||
int8_t sao_enable; // \brief Flag to enable sample adaptive offset filter
|
||||
int8_t rdoq_enable; // \brief Whether RDOQ is enabled or not.
|
||||
int8_t rdo; // \brief RDO level
|
||||
int8_t full_intra_search; // \brief Whether to skip intra modes during search.
|
||||
int8_t trskip_enable; // \brief Flag to enable transform skipping (4x4 intra)
|
||||
int8_t beta_offset_div2; // \brief (deblocking) beta offset (div 2), range -6...6
|
||||
int8_t tc_offset_div2; // \brief (deblocking)tc offset (div 2), range -6...6
|
||||
|
|
|
@ -878,7 +878,9 @@ static int8_t search_intra_rough(encoder_state * const encoder_state,
|
|||
// Initial offset decides how many modes are tried before moving on to the
|
||||
// recursive search.
|
||||
int offset;
|
||||
if (width == 4) {
|
||||
if (encoder_state->encoder_control->full_intra_search) {
|
||||
offset = 1;
|
||||
} else if (width == 4) {
|
||||
offset = 2;
|
||||
} else if (width == 8) {
|
||||
offset = 4;
|
||||
|
|
Loading…
Reference in a new issue