summaryrefslogtreecommitdiffstats
path: root/libhb/common.c
diff options
context:
space:
mode:
authorRodeo <[email protected]>2013-07-13 18:16:00 +0000
committerRodeo <[email protected]>2013-07-13 18:16:00 +0000
commit8228a6411ed3c76d521dc398ddb5329154786f43 (patch)
treef6314fa9a64726b5c5cd1c781d46725456145b27 /libhb/common.c
parent00b5d615c59958cb0078a6d3d8a126337335b734 (diff)
Add hb_video_quality_get_limits and hb_video_quality_get_name to libhb API.
Includes a MacGui implementation. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5647 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/common.c')
-rw-r--r--libhb/common.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/libhb/common.c b/libhb/common.c
index 18302e3b8..3eaa941b3 100644
--- a/libhb/common.c
+++ b/libhb/common.c
@@ -1087,6 +1087,55 @@ const hb_rate_t* hb_audio_bitrate_get_next(const hb_rate_t *last)
//
// direction says whether 'low' limit is highest or lowest
// quality (direction 0 == lowest value is worst quality)
+void hb_video_quality_get_limits(uint32_t codec, float *low, float *high,
+ float *granularity, int *direction)
+{
+ switch (codec)
+ {
+ case HB_VCODEC_X264:
+ *direction = 1;
+ *granularity = 0.1;
+ *low = 0.;
+ *high = 51.;
+ break;
+
+ case HB_VCODEC_THEORA:
+ *direction = 0;
+ *granularity = 1.;
+ *low = 0.;
+ *high = 63.;
+ break;
+
+ case HB_VCODEC_FFMPEG_MPEG2:
+ case HB_VCODEC_FFMPEG_MPEG4:
+ default:
+ *direction = 1;
+ *granularity = 1.;
+ *low = 1.;
+ *high = 31.;
+ break;
+ }
+}
+
+const char* hb_video_quality_get_name(uint32_t codec)
+{
+ switch (codec)
+ {
+ case HB_VCODEC_X264:
+ return "RF";
+
+ default:
+ return "QP";
+ }
+}
+
+// Get limits and hints for the UIs.
+//
+// granularity sets the minimum step increments that should be used
+// (it's ok to round up to some nice multiple if you like)
+//
+// direction says whether 'low' limit is highest or lowest
+// quality (direction 0 == lowest value is worst quality)
void hb_audio_quality_get_limits(uint32_t codec, float *low, float *high,
float *granularity, int *direction)
{