#include <sys/time.h>
#include "hb.h"
+#include "x264.h"
#include "lang.h"
#include "common.h"
+#include "h264_common.h"
#ifdef USE_QSV
#include "qsv_common.h"
#endif
}
}
+const char* const* hb_video_encoder_get_presets(int encoder)
+{
+ switch (encoder)
+ {
+ case HB_VCODEC_X264:
+ return x264_preset_names;
+
+#ifdef USE_QSV
+ case HB_VCODEC_QSV_H264:
+ return hb_qsv_preset_get_names();
+#endif
+
+ default:
+ return NULL;
+ }
+}
+
+const char* const* hb_video_encoder_get_tunes(int encoder)
+{
+ switch (encoder)
+ {
+ case HB_VCODEC_X264:
+ return x264_tune_names;
+
+ default:
+ return NULL;
+ }
+}
+
+const char* const* hb_video_encoder_get_profiles(int encoder)
+{
+ switch (encoder)
+ {
+ case HB_VCODEC_X264:
+ case HB_VCODEC_QSV_H264:
+ return hb_h264_profile_names;
+
+ default:
+ return NULL;
+ }
+}
+
+const char* const* hb_video_encoder_get_levels(int encoder)
+{
+ switch (encoder)
+ {
+ case HB_VCODEC_X264:
+ case HB_VCODEC_QSV_H264:
+ return hb_h264_level_names;
+
+ default:
+ return NULL;
+ }
+}
+
// Get limits and hints for the UIs.
//
// granularity sets the minimum step increments that should be used
void hb_video_quality_get_limits(uint32_t codec, float *low, float *high, float *granularity, int *direction);
const char* hb_video_quality_get_name(uint32_t codec);
+const char* const* hb_video_encoder_get_presets (int encoder);
+const char* const* hb_video_encoder_get_tunes (int encoder);
+const char* const* hb_video_encoder_get_profiles(int encoder);
+const char* const* hb_video_encoder_get_levels (int encoder);
+
void hb_audio_quality_get_limits(uint32_t codec, float *low, float *high, float *granularity, int *direction);
float hb_audio_quality_get_best(uint32_t codec, float quality);
float hb_audio_quality_get_default(uint32_t codec);
const char *x264_encopts, const char *h264_profile,
const char *h264_level, int width, int height);
+#define HB_API_OLD_PRESET_GETTERS
+#ifdef HB_API_OLD_PRESET_GETTERS
// x264 preset/tune, qsv preset & h264 profile/level helpers
const char * const * hb_x264_presets();
const char * const * hb_x264_tunes();
#endif
const char * const * hb_h264_profiles();
const char * const * hb_h264_levels();
+#endif
// x264 option name/synonym helper
const char * hb_x264_encopt_name( const char * name );
return error ? HB_QSV_PARAM_BAD_VALUE : HB_QSV_PARAM_OK;
}
-const char* const* hb_qsv_presets()
+const char* const* hb_qsv_preset_get_names()
{
if (hb_get_cpu_platform() >= HB_CPU_PLATFORM_INTEL_HSW)
{
}
}
+#ifdef HB_API_OLD_PRESET_GETTERS
+const char* const* hb_qsv_presets()
+{
+ return hb_qsv_preset_get_names();
+}
+#endif
+
int hb_qsv_param_default_preset(hb_qsv_param_t *param,
mfxVideoParam *videoParam, const char *preset)
{
mfxVideoParam *videoParam;
} hb_qsv_param_t;
+const char* const* hb_qsv_preset_get_names();
static const char* const hb_qsv_preset_names1[] = { "speed", "balanced", NULL, };
static const char* const hb_qsv_preset_names2[] = { "speed", "balanced", "quality", NULL, };
fprintf( out,
" --x264-preset When using x264, selects the x264 preset:\n"
" <string> ");
- x264_opts = hb_x264_presets();
+ x264_opts = hb_video_encoder_get_presets(HB_VCODEC_X264);
tmp[0] = 0;
len = 0;
while( x264_opts && *x264_opts )
fprintf( out,
" --x264-tune When using x264, selects the x264 tuning:\n"
" <string> ");
- x264_opts = hb_x264_tunes();
+ x264_opts = hb_video_encoder_get_tunes(HB_VCODEC_X264);
tmp[0] = 0;
len = 0;
while( x264_opts && *x264_opts )
fprintf(out,
" --qsv-preset When using QSV, selects the QSV preset:\n"
" <string> ");
- x264_opts = hb_qsv_presets();
+ x264_opts = hb_video_encoder_get_presets(HB_VCODEC_QSV_H264);
tmp[0] = 0;
len = 0;
while (x264_opts != NULL && *x264_opts != NULL)
" --h264-profile When using H.264, ensures compliance with the\n"
" <string> specified H.264 profile:\n"
" ");
- x264_opts = hb_h264_profiles();
+ x264_opts = hb_video_encoder_get_profiles(HB_VCODEC_X264);
tmp[0] = 0;
len = 0;
while( x264_opts && *x264_opts )
" --h264-level When using H.264, ensures compliance with the\n"
" <string> specified H.264 level:\n"
" ");
- x264_opts = hb_h264_levels();
+ x264_opts = hb_video_encoder_get_levels(HB_VCODEC_X264);
tmp[0] = 0;
len = 0;
while( x264_opts && *x264_opts )