*quant=(int) floor(cur_picture->AQ+0.49);
*quant=cur_picture->averageQuant;
void putseq_next( int *type,int *quant ){	// feed frame	/* loop through all frames in encoding/decoding order */	{		old_picture = cur_picture;		/* Each bigroup starts once all the B frames of its predecessor		   have finished.		*/		if ( ss.b == 0)		{			cur_ref_idx = (cur_ref_idx + 1) % R_PICS;			old_ref_picture = new_ref_picture;			new_ref_picture = &ref_pictures[cur_ref_idx];//			new_ref_picture->ref_frame_completion = &old_ref_picture->completion;//			new_ref_picture->prev_frame_completion = &cur_picture->completion;			I_or_P_frame_struct(&ss, new_ref_picture);			cur_picture = new_ref_picture;		}		else		{			Picture *new_b_picture;			/* B frame: no need to change the reference frames.			   The current frame data pointers are a 3rd set			   seperate from the reference data pointers.			*/			cur_b_idx = ( cur_b_idx + 1) % B_PICS;			new_b_picture = &b_pictures[cur_b_idx];			new_b_picture->oldorg = new_ref_picture->oldorg;			new_b_picture->oldref = new_ref_picture->oldref;			new_b_picture->neworg = new_ref_picture->neworg;			new_b_picture->newref = new_ref_picture->newref;//			new_b_picture->ref_frame_completion = &new_ref_picture->completion;//			new_b_picture->prev_frame_completion = &cur_picture->completion;			B_frame_struct( &ss, new_b_picture );			cur_picture = new_b_picture;		}//		sync_guard_update( &cur_picture->completion, 0 );#ifdef PUSH		assert(0==pushframe(cur_picture->temp_ref+ss.gop_start_frame,					cur_picture->curorg));#else							if( readframe(cur_picture->temp_ref+ss.gop_start_frame,cur_picture->curorg) )		{		    mjpeg_error_exit1("Corrupt frame data in frame %d aborting!",							  cur_picture->temp_ref+ss.gop_start_frame );		}#endif		set_pic_params( ss.i, ss.b,   cur_picture );		if( ctl->max_encoding_frames > 1 )			parencodepict( cur_picture );		else			stencodeworker( cur_picture );		*type=cur_picture->pict_type;		*quant=(int) floor(cur_picture->AQ+0.49);#ifdef DEBUG		writeframe(cur_picture->temp_ref+ss.gop_start_frame,cur_picture->curref);#endif		next_seq_state( &ss );		alignbits(); //MEANX we want to finish on a start state bitwise		++frame_num;	}}