summaryrefslogtreecommitdiffstats
path: root/libhb/encx265.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2014-12-16 16:50:50 +0000
committerjstebbins <[email protected]>2014-12-16 16:50:50 +0000
commitf56efd7b52c89da8cac55b4d4a187f2c87fdfee6 (patch)
tree24eacb856704fa8e4b8b8f0edc76568916f70255 /libhb/encx265.c
parentd0a975e42dcab93e1d2eead350fb1ba3951d977c (diff)
json: add json APIs
There are several changes to job and title structs that break current windows interop code. The interop code should be changed such that it only uses json APIs. So if there is any missing features (or bugs) in these APIs, please let me know. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6602 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/encx265.c')
-rw-r--r--libhb/encx265.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/libhb/encx265.c b/libhb/encx265.c
index 60c1b38aa..588dc4343 100644
--- a/libhb/encx265.c
+++ b/libhb/encx265.c
@@ -94,7 +94,8 @@ int encx265Init(hb_work_object_t *w, hb_job_t *job)
pv->delayed_chapters = hb_list_init();
pv->job = job;
w->private_data = pv;
- int ret, vrate, vrate_base;
+ int ret;
+ hb_rational_t vrate;
x265_nal *nal;
uint32_t nnal;
@@ -133,10 +134,10 @@ int encx265Init(hb_work_object_t *w, hb_job_t *job)
* Some HandBrake-specific defaults; users can override them
* using the encoder_options string.
*/
- hb_reduce(&vrate, &vrate_base, job->vrate, job->vrate_base);
- param->fpsNum = vrate;
- param->fpsDenom = vrate_base;
- param->keyframeMin = (int)((double)vrate / (double)vrate_base + 0.5);
+ hb_reduce(&vrate.num, &vrate.den, job->vrate.num, job->vrate.den);
+ param->fpsNum = vrate.num;
+ param->fpsDenom = vrate.den;
+ param->keyframeMin = (double)vrate.num / vrate.den + 0.5;
param->keyframeMax = param->keyframeMin * 10;
/*
@@ -211,19 +212,16 @@ int encx265Init(hb_work_object_t *w, hb_job_t *job)
param->bRepeatHeaders = 0;
param->sourceWidth = job->width;
param->sourceHeight = job->height;
- if (job->anamorphic.mode)
+
+ /*
+ * Let x265 determnine whether to use an aspect ratio
+ * index vs. the extended SAR index + SAR width/height.
+ */
+ char sar[22];
+ snprintf(sar, sizeof(sar), "%d:%d", job->par.num, job->par.den);
+ if (param_parse(param, "sar", sar))
{
- /*
- * Let x265 determnine whether to use an aspect ratio
- * index vs. the extended SAR index + SAR width/height.
- */
- char sar[22];
- snprintf(sar, sizeof(sar), "%d:%d",
- job->anamorphic.par_width, job->anamorphic.par_height);
- if (param_parse(param, "sar", sar))
- {
- goto fail;
- }
+ goto fail;
}
if (job->vquality > 0)