[x264-devel] [PATCH] disable bframe adaptive can't work
Limin Wang
lance.lmwang at gmail.com
Wed Jul 11 11:04:48 CEST 2007
Hi,
> > Thanks, I have updated the patch again. By the test, the result is expected.
> > Please review it, maybe there are other better way to achieve that?
>
> I think that if you enter the first section because num_frames == 1, you
> should still use a P frame (whatever the h->param.b_bframe_adaptive status)
Yes, it's true in order to consist with the original design although I don't
know why it need to P-frame before scenecut detection?
anyway, update the patch again.
Thanks,
Limin
-------------- next part --------------
Index: encoder/slicetype.c
===================================================================
--- encoder/slicetype.c (revision 664)
+++ encoder/slicetype.c (working copy)
@@ -391,7 +391,11 @@
if( num_frames == 1 )
{
no_b_frames:
- frames[1]->i_type = X264_TYPE_P;
+ if( num_frames == 1 || h->param.b_bframe_adaptive )
+ frames[1]->i_type = X264_TYPE_P;
+ else
+ frames[1]->i_type = X264_TYPE_B;
+
if( h->param.b_pre_scenecut )
{
x264_slicetype_frame_cost( h, &a, frames, 0, 1, 1, 0 );
@@ -425,7 +429,7 @@
// fprintf( stderr, "frm%d+%d: %d <=> %d, I:%d/%d \n",
// frames[0]->i_frame, j-1, pthresh, pcost/i_mb_count,
// frames[j+1]->i_intra_mbs[j+1], i_mb_count );
- if( pcost > pthresh*i_mb_count || frames[j+1]->i_intra_mbs[j+1] > i_mb_count/3 )
+ if( h->param.b_bframe_adaptive && (pcost > pthresh*i_mb_count || frames[j+1]->i_intra_mbs[j+1] > i_mb_count/3) )
{
frames[j]->i_type = X264_TYPE_P;
break;
-------------- next part --------------
_______________________________________________
x264-devel mailing list
x264-devel at videolan.org
http://mailman.videolan.org/listinfo/x264-devel
More information about the x264-devel
mailing list