summaryrefslogtreecommitdiffstats
path: root/libhb/encavcodec.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/encavcodec.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/encavcodec.c')
-rw-r--r--libhb/encavcodec.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/libhb/encavcodec.c b/libhb/encavcodec.c
index 271d6f3d0..45645c8d5 100644
--- a/libhb/encavcodec.c
+++ b/libhb/encavcodec.c
@@ -102,13 +102,13 @@ int encavcodecInit( hb_work_object_t * w, hb_job_t * job )
if( job->pass == 2 )
{
hb_interjob_t * interjob = hb_interjob_get( job->h );
- fps.den = interjob->vrate_base;
- fps.num = interjob->vrate;
+ fps.den = interjob->vrate.den;
+ fps.num = interjob->vrate.num;
}
else
{
- fps.den = job->vrate_base;
- fps.num = job->vrate;
+ fps.den = job->vrate.den;
+ fps.num = job->vrate.num;
}
// If the fps.num is 27000000, there's a good chance this is
@@ -160,7 +160,7 @@ int encavcodecInit( hb_work_object_t * w, hb_job_t * job )
context->time_base.den = fps.num;
context->time_base.num = fps.den;
- context->gop_size = 10 * (int)( (double)job->vrate / (double)job->vrate_base + 0.5 );
+ context->gop_size = 10 * ((double)job->vrate.num / job->vrate.den + 0.5);
/* place job->encoder_options in an hb_dict_t for convenience */
hb_dict_t * lavc_opts = NULL;
@@ -209,7 +209,7 @@ int encavcodecInit( hb_work_object_t * w, hb_job_t * job )
//This value was chosen to make the bitrate high enough
//for libvpx to "turn off" the maximum bitrate feature
//that is normally applied to constant quality.
- context->bit_rate = job->width*job->height*( (double)fps.num / (double)fps.den );
+ context->bit_rate = job->width * job->height * fps.num / fps.den;
hb_log( "encavcodec: encoding at CQ %.2f", job->vquality );
}
else
@@ -222,14 +222,11 @@ int encavcodecInit( hb_work_object_t * w, hb_job_t * job )
context->height = job->height;
context->pix_fmt = AV_PIX_FMT_YUV420P;
- if( job->anamorphic.mode )
- {
- context->sample_aspect_ratio.num = job->anamorphic.par_width;
- context->sample_aspect_ratio.den = job->anamorphic.par_height;
+ context->sample_aspect_ratio.num = job->par.num;
+ context->sample_aspect_ratio.den = job->par.den;
- hb_log( "encavcodec: encoding with stored aspect %d/%d",
- job->anamorphic.par_width, job->anamorphic.par_height );
- }
+ hb_log( "encavcodec: encoding with stored aspect %d/%d",
+ job->par.num, job->par.den );
if( job->mux & HB_MUX_MASK_MP4 )
{
@@ -560,7 +557,7 @@ int encavcodecWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
{
av_init_packet(&pkt);
/* Should be way too large */
- buf = hb_video_buffer_init( job->width, job->height );
+ buf = hb_video_buffer_init(job->width, job->height);
pkt.data = buf->data;
pkt.size = buf->alloc;