Commit e96703d7 authored by Laurent Aimar's avatar Laurent Aimar

* encoder: simpler scene cut detection (seems better but do not check

size anymore, so need more testing).


git-svn-id: svn://svn.videolan.org/x264/trunk@20 df754926-b1dd-0310-bc7b-ec298dee348c
parent 11e1b0c2
......@@ -1052,20 +1052,31 @@ do_encode:
#if 1
if( i_slice_type != SLICE_TYPE_I)
{
int i_bias;
int i_mb_i = i_mb_count[I_4x4] + i_mb_count[I_16x16];
int i_mb = h->sps->i_mb_width * h->sps->i_mb_height;
if( h->param.i_iframe > 0 )
i_bias = 30 * X264_MIN( 3*h->frames.i_last_i, h->param.i_iframe ) / h->param.i_iframe;
else
i_bias = 15;
/* Bad P will be reencoded as I */
if( i_slice_type == SLICE_TYPE_P &&
100 * i_mb_i >= (100 - i_bias) * i_mb )
/*
h->out.nal[h->out.i_nal-1].i_payload > h->i_last_intra_size +
h->i_last_intra_size * (3+h->i_last_intra_qp - i_global_qp) / 16 &&
i_mb_count[I_4x4] + i_mb_count[I_16x16] > i_mb_count[P_SKIP] + i_mb_count[P_L0]/2 &&
h->out.nal[h->out.i_nal-1].i_payload > 2 * h->i_last_inter_size &&
h->frames.i_last_i > 4)
h->frames.i_last_i > 4)*/
{
fprintf( stderr, "scene cut at %d size=%d last I:%d last P:%d Intra:%d Skip:%d PL0:%d\n",
fprintf( stderr, "scene cut at %d size=%d last I:%d last P:%d Intra:%d Inter=%d Ratio=%d Bias=%d (Skip:%d PL0:%d)\n",
h->i_frame - 1,
h->out.nal[h->out.i_nal-1].i_payload,
h->i_last_intra_size, h->i_last_inter_size,
i_mb_count[I_4x4] + i_mb_count[I_16x16],
i_mb_i, i_mb, 100 * i_mb_i / i_mb, i_bias,
i_mb_count[P_SKIP],
i_mb_count[P_L0] );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment