if( ctl->max_encoding_frames > 1 ) sync_guard_test( &cur_picture->completion );
void putseq_end( void ){	/* Wait for final frame's encoding to complete */	if( ctl->max_encoding_frames > 1 )		sync_guard_test( &cur_picture->completion );	putseqend();	if( opt->pulldown_32 )		frame_periods = (double)(ss.seq_start_frame + ss.i)*(5.0/4.0);	else		frame_periods = (double)(ss.seq_start_frame + ss.i);    /* DEBUG */    if( ctl->quant_floor > 0.0 )        bits_after_mux = bitcount() +            (uint64_t)((frame_periods / opt->frame_rate) * ctl->nonvid_bit_rate);    else        bits_after_mux = (uint64_t)((frame_periods / opt->frame_rate) *                                    (ctl->nonvid_bit_rate + opt->bit_rate));    mjpeg_info( "Guesstimated final muxed size = %lld\n", bits_after_mux/8 );    /* END DEBUG */    for(int i=0;i<B_PICS;i++)    {    			/*	delete [] b_pictures[i].blocks;				delete [] b_pictures[i].qblocks;				delete [] (b_pictures[i].curref);				delete [] (b_pictures[i].curorg);				delete [] (b_pictures[i].pred);			*/				 b_pictures[i].curref=NULL;				 b_pictures[i].curorg=NULL;				 b_pictures[i].pred=NULL;				 memset(&(b_pictures[i]),0,sizeof(Picture));    }    for(int i=0;i<R_PICS;i++)    {    	/*			    	delete [] ref_pictures[i].blocks;				delete [] ref_pictures[i].qblocks;				delete [] (ref_pictures[i].curref);				delete [] (ref_pictures[i].curorg);				delete [] (ref_pictures[i].pred);	*/				 memset(&(ref_pictures[i]),0,sizeof(Picture));    }    if(   bitrate_controller)    	{		delete bitrate_controller;	}  bitrate_controller=NULL;}