Index: encoder/encoder.c =================================================================== --- encoder/encoder.c (revision 650) +++ encoder/encoder.c (working copy) @@ -61,6 +61,8 @@ #define NALU_OVERHEAD 5 // startcode + NAL type costs 5 bytes per frame +#define dbg_printf(id) fprintf(stderr, "[%p] f=%d t=%"PRId64 id, h, h->fdec->i_frame, x264_mdate()); + static void x264_encoder_frame_end( x264_t *h, x264_t *thread_current, x264_nal_t **pp_nal, int *pi_nal, x264_picture_t *pic_out ); @@ -1215,6 +1217,8 @@ { int i_frame_size; + dbg_printf(" slice_start\n"); + #if VISUALIZE if( h->param.b_visualize ) x264_visualize_init( h ); @@ -1232,6 +1236,8 @@ } #endif + dbg_printf(" slice_stop\n"); + h->out.i_frame_size = i_frame_size; return 0; } @@ -1294,6 +1300,9 @@ /* 1: Copy the picture to a frame and move it to a buffer */ x264_frame_t *fenc = x264_frame_pop_unused( h ); + h->fdec->i_frame = h->frames.i_input; + dbg_printf(" encode_start\n"); + x264_frame_copy_picture( h, fenc, pic_in ); if( h->param.i_width != 16 * h->sps->i_mb_width || @@ -1316,6 +1325,8 @@ } } + dbg_printf(" prolog_cp\n"); + if( h->frames.current[0] == NULL ) { int bframes = 0; @@ -1345,6 +1356,8 @@ } TIMER_STOP( i_mtime_encode_frame ); + dbg_printf(" prolog_rc\n"); + /* ------------------- Get frame to be encoded ------------------------- */ /* 4: get picture to encode */ h->fenc = x264_frame_shift( h->frames.current ); @@ -1477,6 +1490,8 @@ x264_nal_end( h ); } + dbg_printf(" thread_create\n"); + /* Write frame */ if( h->param.i_threads > 1 ) { @@ -1600,8 +1615,10 @@ if( h->b_thread_active ) { + dbg_printf(" join?\n"); pthread_join( h->thread_handle, NULL ); h->b_thread_active = 0; + dbg_printf(" join.\n"); } if( !h->out.i_nal ) { @@ -1758,6 +1775,8 @@ /* Dump reconstructed frame */ x264_frame_dump( h, h->fdec, "fdec.yuv" ); #endif + + dbg_printf(" encode_stop\n"); } /****************************************************************************