summaryrefslogtreecommitdiffstats
path: root/libhb/encx264.c
diff options
context:
space:
mode:
authorRodeo <[email protected]>2012-11-05 14:17:38 +0000
committerRodeo <[email protected]>2012-11-05 14:17:38 +0000
commit20c5dd3faa9a524efa9772faf1300523f3ae675a (patch)
tree469ecf8304b017c021e2fa8d29deb2c867a93726 /libhb/encx264.c
parent48e2482dc710dc2b53f1bce12c5cbda761915fb2 (diff)
Add a utility function to check whether an H.264 level can be used given the current encoding parameters.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5044 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/encx264.c')
-rw-r--r--libhb/encx264.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libhb/encx264.c b/libhb/encx264.c
index 49e99973a..2da886a68 100644
--- a/libhb/encx264.c
+++ b/libhb/encx264.c
@@ -627,6 +627,21 @@ int encx264Work( hb_work_object_t * w, hb_buffer_t ** buf_in,
return HB_WORK_OK;
}
+int hb_check_h264_level(const char *h264_level, int width, int height,
+ int fps_num, int fps_den, int interlaced,
+ int fake_interlaced)
+{
+ x264_param_t param;
+ x264_param_default(&param);
+ param.i_width = width;
+ param.i_height = height;
+ param.i_fps_num = fps_num;
+ param.i_fps_den = fps_den;
+ param.b_interlaced = !!interlaced;
+ param.b_fake_interlaced = !!fake_interlaced;
+ return (hb_apply_h264_level(&param, h264_level, NULL, 1) != 0);
+}
+
int hb_apply_h264_level(x264_param_t *param, const char *h264_level,
const char *x264_profile, int be_quiet)
{