X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;ds=sidebyside;f=libhb%2Fencx264.c;h=91b53f7646d6222eed947c102e8d41da70e5cae2;hb=4f0019f03c2e85e8634150ff0c9a31bee6d35ce5;hp=407df689dd50c469ae9bd07f734bd227c0348b7f;hpb=44923dc2662c30139d5f069928d2609185d29950;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/libhb/encx264.c b/libhb/encx264.c index 407df689..91b53f76 100644 --- a/libhb/encx264.c +++ b/libhb/encx264.c @@ -124,7 +124,7 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job ) } /* Temporary hack to use old b-pyramid default */ - param.i_bframe_pyramid = 0; + param.i_bframe_pyramid = X264_B_PYRAMID_NONE; /* Enable metrics */ param.analyse.b_psnr = 1; @@ -161,14 +161,12 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job ) we still want the same keyframe intervals as the 1st pass, so the 1st pass stats won't conflict on frame decisions. */ hb_interjob_t * interjob = hb_interjob_get( job->h ); - param.i_keyint_min = ( ( (double)interjob->vrate / (double)interjob->vrate_base ) + 0.5 ); param.i_keyint_max = ( ( 10 * (double)interjob->vrate / (double)interjob->vrate_base ) + 0.5 ); } else { /* adjust +0.5 for when fps has remainder to bump { 23.976, 29.976, 59.94 } to { 24, 30, 60 } */ - param.i_keyint_min = ( ( (double)job->vrate / (double)job->vrate_base ) + 0.5 ); param.i_keyint_max = ( ( 10 * (double)job->vrate / (double)job->vrate_base ) + 0.5 ); } } @@ -267,8 +265,9 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job ) job->areBframes = 0; } - if( param.i_keyint_min != 25 || param.i_keyint_max != 250 ) - hb_log("encx264: keyint-min: %i, keyint-max: %i", param.i_keyint_min, param.i_keyint_max); + if( param.i_keyint_min != X264_KEYINT_MIN_AUTO || param.i_keyint_max != 250 ) + hb_log("encx264: min-keyint: %i, keyint: %i", param.i_keyint_min == X264_KEYINT_MIN_AUTO ? param.i_keyint_max / 10 : param.i_keyint_min, + param.i_keyint_max); /* set up the VUI color model & gamma to match what the COLR atom * set in muxmp4.c says. See libhb/muxmp4.c for notes. */ @@ -623,10 +622,12 @@ int encx264Work( hb_work_object_t * w, hb_buffer_t ** buf_in, x264_nal_t *nal; hb_buffer_t *last_buf = NULL; - while (1) + while ( x264_encoder_delayed_frames( pv->x264 ) ) { x264_encoder_encode( pv->x264, &nal, &i_nal, NULL, &pic_out ); - if ( i_nal <= 0 ) + if ( i_nal == 0 ) + continue; + if ( i_nal < 0 ) break; hb_buffer_t *buf = nal_encode( w, &pic_out, i_nal, nal );