summaryrefslogtreecommitdiffstats
path: root/libhb/encavcodec.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2011-03-08 16:12:57 +0000
committerjstebbins <[email protected]>2011-03-08 16:12:57 +0000
commit673a841b1ef2dcd31647fce00829dc4a3f2b0715 (patch)
treeb11d12d19c798463a8756d8f5f989e6d2865765b /libhb/encavcodec.c
parent6444014c71cd881ad4874e96a6138ea268be8b4d (diff)
make keyint match between 1st and 2nd passes of vfr and pfr encodes.
make keyint and fps settings consistent across video encoders. make interjob->vrate changes for pfr mode like we do for vfr since pfr is the same as vfr except when it hits it's peak. in mkv, set track default duration to actual measured vrate on 2 pass encodes. thanks to Rodeo for the corrections in encx264 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3831 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/encavcodec.c')
-rw-r--r--libhb/encavcodec.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/libhb/encavcodec.c b/libhb/encavcodec.c
index eaf7b7020..07fc748a8 100644
--- a/libhb/encavcodec.c
+++ b/libhb/encavcodec.c
@@ -77,8 +77,18 @@ int encavcodecInit( hb_work_object_t * w, hb_job_t * job )
}
context->width = job->width;
context->height = job->height;
- rate_num = job->vrate_base;
- rate_den = job->vrate;
+
+ if( job->pass == 2 )
+ {
+ hb_interjob_t * interjob = hb_interjob_get( job->h );
+ rate_num = interjob->vrate_base;
+ rate_den = interjob->vrate;
+ }
+ else
+ {
+ rate_num = job->vrate_base;
+ rate_den = job->vrate;
+ }
if (rate_den == 27000000)
{
int ii;
@@ -103,7 +113,7 @@ int encavcodecInit( hb_work_object_t * w, hb_job_t * job )
rate_den >>= 1;
}
context->time_base = (AVRational) { rate_num, rate_den };
- context->gop_size = 10 * job->vrate / job->vrate_base;
+ context->gop_size = 10 * (int)( (double)job->vrate / (double)job->vrate_base + 0.5 );
context->pix_fmt = PIX_FMT_YUV420P;
if( job->anamorphic.mode )