Add --source-scan-type parameter

Options progressive (default)
        tff for top field first
        bff for bottom field first
This commit is contained in:
Ari Lemmetti 2015-08-13 12:53:14 +03:00
parent 4dcc0d876d
commit fc038cb8bf
6 changed files with 14 additions and 1 deletions

View file

@ -57,6 +57,7 @@ static const struct option long_options[] = {
{ "tr-depth-intra", required_argument, NULL, 0 }, { "tr-depth-intra", required_argument, NULL, 0 },
{ "me", required_argument, NULL, 0 }, { "me", required_argument, NULL, 0 },
{ "subme", required_argument, NULL, 0 }, { "subme", required_argument, NULL, 0 },
{ "source-scan-type", required_argument, NULL, 0 },
{ "sar", required_argument, NULL, 0 }, { "sar", required_argument, NULL, 0 },
{ "overscan", required_argument, NULL, 0 }, { "overscan", required_argument, NULL, 0 },
{ "videoformat", required_argument, NULL, 0 }, { "videoformat", required_argument, NULL, 0 },
@ -284,6 +285,10 @@ void print_help(void)
" --cpuid <integer> : Disable runtime cpu optimizations with value 0.\n" " --cpuid <integer> : Disable runtime cpu optimizations with value 0.\n"
" --subme <integer> : Set fractional pixel motion estimation level [1].\n" " --subme <integer> : Set fractional pixel motion estimation level [1].\n"
" 0: only integer motion estimation\n" " 0: only integer motion estimation\n"
" --source-scan-type <string> : Set source scan type [\"progressive\"].\n"
" \"progressive\": progressive scan\n"
" \"tff\": top field first\n"
" \"bff\": bottom field first\n"
" 1: fractional pixel motion estimation enabled\n" " 1: fractional pixel motion estimation enabled\n"
" --pu-depth-inter <int>-<int> : Range for sizes of inter prediction units to try.\n" " --pu-depth-inter <int>-<int> : Range for sizes of inter prediction units to try.\n"
" 0: 64x64, 1: 32x32, 2: 16x16, 3: 8x8\n" " 0: 64x64, 1: 32x32, 2: 16x16, 3: 8x8\n"

View file

@ -70,6 +70,7 @@ int config_init(kvz_config *cfg)
cfg->tr_depth_intra = 0; cfg->tr_depth_intra = 0;
cfg->ime_algorithm = 0; /* hexbs */ cfg->ime_algorithm = 0; /* hexbs */
cfg->fme_level = 1; cfg->fme_level = 1;
cfg->source_scan_type = 0; /* progressive */
cfg->vui.sar_width = 0; cfg->vui.sar_width = 0;
cfg->vui.sar_height = 0; cfg->vui.sar_height = 0;
cfg->vui.overscan = 0; /* undef */ cfg->vui.overscan = 0; /* undef */
@ -276,6 +277,7 @@ static int parse_slice_specification(const char* const arg, int32_t * const nsli
int config_parse(kvz_config *cfg, const char *name, const char *value) int config_parse(kvz_config *cfg, const char *name, const char *value)
{ {
static const char * const me_names[] = { "hexbs", "tz", NULL }; static const char * const me_names[] = { "hexbs", "tz", NULL };
static const char * const source_scan_type_names[] = { "progressive", "tff", "bff", NULL };
static const char * const overscan_names[] = { "undef", "show", "crop", NULL }; static const char * const overscan_names[] = { "undef", "show", "crop", NULL };
static const char * const videoformat_names[] = { "component", "pal", "ntsc", "secam", "mac", "undef", NULL }; static const char * const videoformat_names[] = { "component", "pal", "ntsc", "secam", "mac", "undef", NULL };
@ -356,6 +358,8 @@ int config_parse(kvz_config *cfg, const char *name, const char *value)
} }
else if OPT("subme") else if OPT("subme")
cfg->fme_level = atoi(value); cfg->fme_level = atoi(value);
else if OPT("source-scan-type")
return parse_enum(value, source_scan_type_names, &cfg->source_scan_type);
else if OPT("sar") else if OPT("sar")
return sscanf(value, "%d:%d", &cfg->vui.sar_width, &cfg->vui.sar_height) == 2; return sscanf(value, "%d:%d", &cfg->vui.sar_width, &cfg->vui.sar_height) == 2;
else if OPT("overscan") else if OPT("overscan")

View file

@ -153,6 +153,8 @@ encoder_control_t* encoder_control_init(const kvz_config *const cfg) {
// Rate-distortion optimization level // Rate-distortion optimization level
encoder->rdo = 1; encoder->rdo = 1;
encoder->full_intra_search = 0; encoder->full_intra_search = 0;
// INTERLACING
encoder->in.source_scan_type = (int8_t)cfg->source_scan_type;
// Initialize the scaling list // Initialize the scaling list
scalinglist_init(&encoder->scaling_list); scalinglist_init(&encoder->scaling_list);

View file

@ -55,6 +55,7 @@ typedef struct encoder_control_t
int8_t video_format; int8_t video_format;
int8_t bitdepth; /*!< \brief input bit depth (8,10) */ int8_t bitdepth; /*!< \brief input bit depth (8,10) */
int64_t pixels_per_pic; int64_t pixels_per_pic;
int8_t source_scan_type;
} in; } in;
/* TODO: add ME data */ /* TODO: add ME data */

View file

@ -112,6 +112,7 @@ typedef struct kvz_config
int32_t tr_depth_intra; /*!< \brief Maximum transform depth for intra. */ int32_t tr_depth_intra; /*!< \brief Maximum transform depth for intra. */
enum kvz_ime_algorithm ime_algorithm; /*!< \brief Integer motion estimation algorithm. */ enum kvz_ime_algorithm ime_algorithm; /*!< \brief Integer motion estimation algorithm. */
int32_t fme_level; /*!< \brief Fractional pixel motion estimation level (0: disabled, 1: enabled). */ int32_t fme_level; /*!< \brief Fractional pixel motion estimation level (0: disabled, 1: enabled). */
int8_t source_scan_type; /*!< \brief Source scan type (0: progressive, 1: top field first, 2: bottom field first).*/
int32_t bipred; /*!< \brief Bi-prediction (0: disabled, 1: enabled). */ int32_t bipred; /*!< \brief Bi-prediction (0: disabled, 1: enabled). */
int32_t deblock_beta; /*!< \brief (deblocking) beta offset (div 2), range -6...6 */ 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 */ int32_t deblock_tc; /*!< \brief (deblocking) tc offset (div 2), range -6...6 */

View file

@ -21,6 +21,6 @@
****************************************************************************/ ****************************************************************************/
// KVZ_API_VERSION is incremented every time the public api changes. // KVZ_API_VERSION is incremented every time the public api changes.
#define KVZ_API_VERSION 1 #define KVZ_API_VERSION 2
#endif // KVAZAAR_VERSION_H_ #endif // KVAZAAR_VERSION_H_