if( ctl->max_encoding_frames > 1 ) create_threads( worker_threads, 2, parencodeworker );
void putseq_init(void){	bits_after_mux=0;	frame_periods=0;	cur_picture=old_picture=NULL;	new_ref_picture=old_ref_picture=NULL;    	bitrate_controller = new OnTheFlyRateCtl;;    	cur_ref_idx = 0;    	cur_b_idx = 0;    /* DEBUG */	init_pictures( ref_pictures, b_pictures );	if( ctl->max_encoding_frames > 1 )		create_threads( worker_threads, 2, parencodeworker );	/* Initialize image dependencies and synchronisation.  The	   first frame encoded has no predecessor whose completion it	   must wait on.	*/	old_ref_picture = &ref_pictures[R_PICS-1];	new_ref_picture = &ref_pictures[cur_ref_idx];	cur_picture = old_ref_picture;	bitrate_controller->InitSeq(false);	ss.i = 0;		                /* Index in current MPEG sequence */	ss.g = 0;						/* Index in current GOP */	ss.b = 0;						/* B frames since last I/P */	ss.gop_length = 0;				/* Length of current GOP init 0									   0 force new GOP at start 1st sequence */	ss.seq_start_frame = 0;		/* Index start current sequence in								   input stream */	ss.gop_start_frame = 0;		/* Index start current gop in input stream */	ss.seq_split_length = ((int64_t)ctl->seq_length_limit)*(8*1024*1024);	ss.next_split_point = BITCOUNT_OFFSET + ss.seq_split_length;	mjpeg_debug( "Split len = %%llu", ss.seq_split_length );	frame_num = 0;              /* Encoding number */	gop_start(&ss);}