/// <summary>
        /// Initialize for a processing pass.
        /// </summary>
        public void start_pass(J_BUF_MODE pass_mode)
        {
            switch (pass_mode)
            {
            case J_BUF_MODE.JBUF_PASS_THRU:
                if (m_cinfo.m_upsample.NeedContextRows())
                {
                    m_dataProcessor = DataProcessor.context_main;
                    make_funny_pointers(); /* Create the xbuffer[] lists */
                    m_whichFunny    = 0;   /* Read first iMCU row into xbuffer[0] */
                    m_context_state = CTX_PREPARE_FOR_IMCU;
                    m_iMCU_row_ctr  = 0;
                }
                else
                {
                    /* Simple case with no context needed */
                    m_dataProcessor = DataProcessor.simple_main;
                }
                m_buffer_full  = false;     /* Mark buffer empty */
                m_rowgroup_ctr = 0;
                break;

            case J_BUF_MODE.JBUF_CRANK_DEST:
                /* For last pass of 2-pass quantization, just crank the postprocessor */
                m_dataProcessor = DataProcessor.crank_post;
                break;

            default:
                m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
                break;
            }
        }
Example #2
0
		// Initialize for a processing pass.
		static void start_pass_coef(jpeg_compress cinfo, J_BUF_MODE pass_mode)
		{
			jpeg_lossy_c_codec lossyc=(jpeg_lossy_c_codec)cinfo.coef;
			c_coef_controller coef=(c_coef_controller)lossyc.coef_private;

			coef.iMCU_row_num=0;
			start_iMCU_row_c_coef(cinfo);

			switch(pass_mode)
			{
				case J_BUF_MODE.JBUF_PASS_THRU:
					if(coef.whole_image[0]!=null) ERREXIT(cinfo, J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
					lossyc.compress_data=compress_data_coef;
					break;
#if FULL_COEF_BUFFER_SUPPORTED
				case J_BUF_MODE.JBUF_SAVE_AND_PASS:
					if(coef.whole_image[0]==null) ERREXIT(cinfo, J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
					lossyc.compress_data=compress_first_pass_coef;
					break;
				case J_BUF_MODE.JBUF_CRANK_DEST:
					if(coef.whole_image[0]==null) ERREXIT(cinfo, J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
					lossyc.compress_data=compress_output_coef;
					break;
#endif
				default:
					ERREXIT(cinfo, J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
					break;
			}
		}
Example #3
0
        const int CTX_POSTPONED_ROW    = 2;             // feeding postponed row group
#endif
        // Initialize for a processing pass.
        static void start_pass_d_main(jpeg_decompress cinfo, J_BUF_MODE pass_mode)
        {
            my_d_main_controller main = (my_d_main_controller)cinfo.main;

            switch (pass_mode)
            {
            case J_BUF_MODE.JBUF_PASS_THRU:
#if UPSCALING_CONTEXT
                if (cinfo.upsample.need_context_rows)
                {
                    main.process_data  = process_data_context_d_main;
                    main.context_state = CTX_PREPARE_FOR_IMCU;
                    main.iMCU_row_ctr  = 0;
                }
                else
#endif
                main.process_data = process_data_simple_d_main; // Simple case with no context needed
                main.buffer_full  = false;                      // Mark buffer empty
                main.rowgroup_ctr = 0;
                break;

#if QUANT_2PASS_SUPPORTED
            case J_BUF_MODE.JBUF_CRANK_DEST: main.process_data = process_data_crank_post_d_main; break;                   // For last pass of 2-pass quantization, just crank the postprocessor
#endif
            default: ERREXIT(cinfo, J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE); break;
            }
        }
Example #4
0
        // Initialize for a processing pass.
        public virtual void start_pass(J_BUF_MODE pass_mode)
        {
            m_iMCU_row_num = 0;
            start_iMCU_row();

            switch (pass_mode)
            {
            case J_BUF_MODE.JBUF_PASS_THRU:
                if (m_whole_image[0] != null)
                {
                    m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
                }
                break;

            case J_BUF_MODE.JBUF_SAVE_AND_PASS:
                if (m_whole_image[0] == null)
                {
                    m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
                }
                break;

            case J_BUF_MODE.JBUF_CRANK_DEST:
                if (m_whole_image[0] == null)
                {
                    m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
                }
                break;

            default:
                m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
                break;
            }

            m_passModeSetByLastStartPass = pass_mode;
        }
Example #5
0
        // Initialize for a processing pass.
        static void start_pass_lossy(jpeg_compress cinfo, J_BUF_MODE pass_mode)
        {
            jpeg_lossy_c_codec lossyc = (jpeg_lossy_c_codec)cinfo.coef;

            lossyc.fdct_start_pass(cinfo);
            lossyc.coef_start_pass(cinfo, pass_mode);
        }
        // Initialize for a processing pass.
        public virtual void start_pass(J_BUF_MODE pass_mode)
        {
            m_iMCU_row_num = 0;
            start_iMCU_row();

            switch (pass_mode)
            {
                case J_BUF_MODE.JBUF_PASS_THRU:
                    if (m_whole_image[0] != null)
                        m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
                    break;

                case J_BUF_MODE.JBUF_SAVE_AND_PASS:
                    if (m_whole_image[0] == null)
                        m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
                    break;

                case J_BUF_MODE.JBUF_CRANK_DEST:
                    if (m_whole_image[0] == null)
                        m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
                    break;

                default:
                    m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
                    break;
            }

            m_passModeSetByLastStartPass = pass_mode;
        }
Example #7
0
		const int CTX_POSTPONED_ROW=2;		// feeding postponed row group
#endif
		// Initialize for a processing pass.
		static void start_pass_d_main(jpeg_decompress cinfo, J_BUF_MODE pass_mode)
		{
			my_d_main_controller main=(my_d_main_controller)cinfo.main;

			switch(pass_mode)
			{
				case J_BUF_MODE.JBUF_PASS_THRU:
#if UPSCALING_CONTEXT
					if(cinfo.upsample.need_context_rows)
					{
						main.process_data=process_data_context_d_main;
						main.context_state=CTX_PREPARE_FOR_IMCU;
						main.iMCU_row_ctr=0;
					}
					else
#endif
						main.process_data=process_data_simple_d_main; // Simple case with no context needed
					main.buffer_full=false;	// Mark buffer empty
					main.rowgroup_ctr=0;
					break;
#if QUANT_2PASS_SUPPORTED
				case J_BUF_MODE.JBUF_CRANK_DEST: main.process_data=process_data_crank_post_d_main; break; // For last pass of 2-pass quantization, just crank the postprocessor
#endif
				default: ERREXIT(cinfo, J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE); break;
			}
		}
Example #8
0
        // Initialize for a processing pass.
        static void start_pass_ls(jpeg_compress cinfo, J_BUF_MODE pass_mode)
        {
            jpeg_lossless_c_codec losslsc = (jpeg_lossless_c_codec)cinfo.coef;

            losslsc.scaler_start_pass(cinfo);
            losslsc.predict_start_pass(cinfo);
            losslsc.diff_start_pass(cinfo, pass_mode);
        }
        /// <summary>
        /// Initialize for a processing pass.
        /// </summary>
        public virtual void start_pass(J_BUF_MODE pass_mode)
        {
            if (pass_mode != J_BUF_MODE.JBUF_CRANK_DEST)
                m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);

            m_iMCU_row_num = 0;
            start_iMCU_row();
        }
Example #10
0
		// Initialize for a processing pass.
		static void start_pass_ls(jpeg_compress cinfo, J_BUF_MODE pass_mode)
		{
			jpeg_lossless_c_codec losslsc=(jpeg_lossless_c_codec)cinfo.coef;

			losslsc.scaler_start_pass(cinfo);
			losslsc.predict_start_pass(cinfo);
			losslsc.diff_start_pass(cinfo, pass_mode);
		}
Example #11
0
        /// <summary>
        /// Initialize for a processing pass.
        /// </summary>
        public virtual void start_pass(J_BUF_MODE pass_mode)
        {
            if (pass_mode != J_BUF_MODE.JBUF_CRANK_DEST)
            {
                m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
            }

            m_iMCU_row_num = 0;
            start_iMCU_row();
        }
        /// <summary>
        /// Initialize for a processing pass.
        /// </summary>
        public void start_pass(J_BUF_MODE pass_mode)
        {
            switch (pass_mode)
            {
            case J_BUF_MODE.JBUF_PASS_THRU:
                if (m_cinfo.m_quantize_colors)
                {
                    /* Single-pass processing with color quantization. */
                    m_processor = ProcessorType.OnePass;

                    /* We could be doing buffered-image output before starting a 2-pass
                     * color quantization; in that case, jinit_d_post_controller did not
                     * allocate a strip buffer.  Use the virtual-array buffer as workspace.
                     */
                    if (m_buffer == null)
                    {
                        m_buffer = m_whole_image.Access(0, m_strip_height);
                    }
                }
                else
                {
                    /* For single-pass processing without color quantization,
                     * I have no work to do; just call the upsampler directly.
                     */
                    m_processor = ProcessorType.Upsample;
                }
                break;

            case J_BUF_MODE.JBUF_SAVE_AND_PASS:
                /* First pass of 2-pass quantization */
                if (m_whole_image == null)
                {
                    m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
                }

                m_processor = ProcessorType.PrePass;
                break;

            case J_BUF_MODE.JBUF_CRANK_DEST:
                /* Second pass of 2-pass quantization */
                if (m_whole_image == null)
                {
                    m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
                }

                m_processor = ProcessorType.SecondPass;
                break;

            default:
                m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
                break;
            }
            m_starting_row = m_next_row = 0;
        }
Example #13
0
        // Initialize for a processing pass.
        static void start_pass_dpost(jpeg_decompress cinfo, J_BUF_MODE pass_mode)
        {
            my_post_controller post = (my_post_controller)cinfo.post;

            switch (pass_mode)
            {
            case J_BUF_MODE.JBUF_PASS_THRU:
                if (cinfo.quantize_colors)
                {
                    // Single-pass processing with color quantization.
                    post.post_process_data = post_process_1pass;

                    // We could be doing buffered-image output before starting a 2-pass
                    // color quantization; in that case, jinit_d_post_controller did not
                    // allocate a strip buffer. Use the virtual-array buffer as workspace.
                    if (post.buffer == null)
                    {
                        post.buffer        = post.whole_image;
                        post.buffer_offset = 0;
                    }
                }
                else
                {
                    // For single-pass processing without color quantization,
                    // I have no work to do; just call the upsampler directly.
                    post.post_process_data = cinfo.upsample.upsample;
                }
                break;

#if QUANT_2PASS_SUPPORTED
            case J_BUF_MODE.JBUF_SAVE_AND_PASS:
                // First pass of 2-pass quantization
                if (post.whole_image == null)
                {
                    ERREXIT(cinfo, J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
                }
                post.post_process_data = post_process_prepass;
                break;

            case J_BUF_MODE.JBUF_CRANK_DEST:
                // Second pass of 2-pass quantization
                if (post.whole_image == null)
                {
                    ERREXIT(cinfo, J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
                }
                post.post_process_data = post_process_2pass;
                break;
#endif // QUANT_2PASS_SUPPORTED
            default: ERREXIT(cinfo, J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE); break;
            }
            post.starting_row = post.next_row = 0;
        }
        // Initialize for a processing pass.
        public void start_pass(J_BUF_MODE pass_mode)
        {
            /* Do nothing in raw-data mode. */
            if (m_cinfo.m_raw_data_in)
                return;

            m_cur_iMCU_row = 0; /* initialize counters */
            m_rowgroup_ctr = 0;
            m_suspended = false;

            if (pass_mode != J_BUF_MODE.JBUF_PASS_THRU)
                m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
        }
        // Initialize for a processing pass.
        public void start_pass(J_BUF_MODE pass_mode)
        {
            /* Do nothing in raw-data mode. */
            if (m_cinfo.m_raw_data_in)
            {
                return;
            }

            m_cur_iMCU_row = 0; /* initialize counters */
            m_rowgroup_ctr = 0;
            m_suspended    = false;

            if (pass_mode != J_BUF_MODE.JBUF_PASS_THRU)
            {
                m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
            }
        }
Example #16
0
		// Initialize for a processing pass.
		static void start_pass_c_main(jpeg_compress cinfo, J_BUF_MODE pass_mode)
		{
			my_c_main_controller main=(my_c_main_controller)cinfo.main;

			// Do nothing in raw-data mode.
			if(cinfo.raw_data_in) return;

			main.cur_iMCU_row=0;		// initialize counters
			main.rowgroup_ctr=0;
			main.suspended=false;
			main.pass_mode=pass_mode;	// save mode for use by process_data

			switch(pass_mode)
			{
				case J_BUF_MODE.JBUF_PASS_THRU: main.process_data=process_data_simple_c_main; break;
				default: ERREXIT(cinfo, J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE); break;
			}
		}
Example #17
0
		// Initialize for a processing pass.
		static void start_pass_prep(jpeg_compress cinfo, J_BUF_MODE pass_mode)
		{
			my_prep_controller prep=(my_prep_controller)cinfo.prep;

			if(pass_mode!=J_BUF_MODE.JBUF_PASS_THRU) ERREXIT(cinfo, J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);

			// Initialize total-height counter for detecting bottom of image
			prep.rows_to_go=cinfo.image_height;
			// Mark the conversion buffer empty
			prep.next_buf_row=0;
#if CONTEXT_ROWS_SUPPORTED
			// Preset additional state variables for context mode.
			// These aren't used in non-context mode, so we needn't test which mode.
			prep.this_row_group=0;
			// Set next_buf_stop to stop after two row groups have been read in.
			prep.next_buf_stop=2*cinfo.max_v_samp_factor;
#endif
		}
Example #18
0
		// Initialize for a processing pass.
		static void start_pass_dpost(jpeg_decompress cinfo, J_BUF_MODE pass_mode)
		{
			my_post_controller post=(my_post_controller)cinfo.post;

			switch(pass_mode)
			{
				case J_BUF_MODE.JBUF_PASS_THRU:
					if(cinfo.quantize_colors)
					{
						// Single-pass processing with color quantization.
						post.post_process_data=post_process_1pass;

						// We could be doing buffered-image output before starting a 2-pass
						// color quantization; in that case, jinit_d_post_controller did not
						// allocate a strip buffer. Use the virtual-array buffer as workspace.
						if(post.buffer==null)
						{
							post.buffer=post.whole_image;
							post.buffer_offset=0;
						}
					}
					else
					{
						// For single-pass processing without color quantization,
						// I have no work to do; just call the upsampler directly.
						post.post_process_data=cinfo.upsample.upsample;
					}
					break;
#if QUANT_2PASS_SUPPORTED
				case J_BUF_MODE.JBUF_SAVE_AND_PASS:
					// First pass of 2-pass quantization
					if(post.whole_image==null) ERREXIT(cinfo, J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
					post.post_process_data=post_process_prepass;
					break;
				case J_BUF_MODE.JBUF_CRANK_DEST:
					// Second pass of 2-pass quantization
					if(post.whole_image==null) ERREXIT(cinfo, J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
					post.post_process_data=post_process_2pass;
					break;
#endif // QUANT_2PASS_SUPPORTED
				default: ERREXIT(cinfo, J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE); break;
			}
			post.starting_row=post.next_row=0;
		}
        /// <summary>
        /// Initialize for a processing pass.
        /// </summary>
        public void start_pass(J_BUF_MODE pass_mode)
        {
            switch (pass_mode)
            {
                case J_BUF_MODE.JBUF_PASS_THRU:
                    if (m_cinfo.m_quantize_colors)
                    {
                        /* Single-pass processing with color quantization. */
                        m_processor = ProcessorType.OnePass;
                        /* We could be doing buffered-image output before starting a 2-pass
                         * color quantization; in that case, jinit_d_post_controller did not
                         * allocate a strip buffer.  Use the virtual-array buffer as workspace.
                         */
                        if (m_buffer == null)
                            m_buffer = m_whole_image.Access(0, m_strip_height);
                    }
                    else
                    {
                        /* For single-pass processing without color quantization,
                         * I have no work to do; just call the upsampler directly.
                         */
                        m_processor = ProcessorType.Upsample;
                    }
                    break;
                case J_BUF_MODE.JBUF_SAVE_AND_PASS:
                    /* First pass of 2-pass quantization */
                    if (m_whole_image == null)
                        m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);

                    m_processor = ProcessorType.PrePass;
                    break;
                case J_BUF_MODE.JBUF_CRANK_DEST:
                    /* Second pass of 2-pass quantization */
                    if (m_whole_image == null)
                        m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);

                    m_processor = ProcessorType.SecondPass;
                    break;
                default:
                    m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
                    break;
            }
            m_starting_row = m_next_row = 0;
        }
        /// <summary>
        /// Initialize for a processing pass.
        /// </summary>
        public void start_pass(J_BUF_MODE pass_mode)
        {
            if (pass_mode != J_BUF_MODE.JBUF_PASS_THRU)
                m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);

            /* Initialize total-height counter for detecting bottom of image */
            m_rows_to_go = m_cinfo.m_image_height;

            /* Mark the conversion buffer empty */
            m_next_buf_row = 0;

            /* Preset additional state variables for context mode.
             * These aren't used in non-context mode, so we needn't test which mode.
             */
            m_this_row_group = 0;

            /* Set next_buf_stop to stop after two row groups have been read in. */
            m_next_buf_stop = 2 * m_cinfo.m_max_v_samp_factor;
        }
        /// <summary>
        /// Initialize for a processing pass.
        /// </summary>
        public void start_pass(J_BUF_MODE pass_mode)
        {
            if (pass_mode != J_BUF_MODE.JBUF_PASS_THRU)
            {
                m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
            }

            /* Initialize total-height counter for detecting bottom of image */
            m_rows_to_go = m_cinfo.m_image_height;

            /* Mark the conversion buffer empty */
            m_next_buf_row = 0;

            /* Preset additional state variables for context mode.
             * These aren't used in non-context mode, so we needn't test which mode.
             */
            m_this_row_group = 0;

            /* Set next_buf_stop to stop after two row groups have been read in. */
            m_next_buf_stop = 2 * m_cinfo.m_max_v_samp_factor;
        }
Example #22
0
        // Initialize for a processing pass.
        static void start_pass_prep(jpeg_compress cinfo, J_BUF_MODE pass_mode)
        {
            my_prep_controller prep = (my_prep_controller)cinfo.prep;

            if (pass_mode != J_BUF_MODE.JBUF_PASS_THRU)
            {
                ERREXIT(cinfo, J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
            }

            // Initialize total-height counter for detecting bottom of image
            prep.rows_to_go = cinfo.image_height;
            // Mark the conversion buffer empty
            prep.next_buf_row = 0;
#if CONTEXT_ROWS_SUPPORTED
            // Preset additional state variables for context mode.
            // These aren't used in non-context mode, so we needn't test which mode.
            prep.this_row_group = 0;
            // Set next_buf_stop to stop after two row groups have been read in.
            prep.next_buf_stop = 2 * cinfo.max_v_samp_factor;
#endif
        }
Example #23
0
        // Initialize for a processing pass.
        static void start_pass_coef(jpeg_compress cinfo, J_BUF_MODE pass_mode)
        {
            jpeg_lossy_c_codec lossyc = (jpeg_lossy_c_codec)cinfo.coef;
            c_coef_controller  coef   = (c_coef_controller)lossyc.coef_private;

            coef.iMCU_row_num = 0;
            start_iMCU_row_c_coef(cinfo);

            switch (pass_mode)
            {
            case J_BUF_MODE.JBUF_PASS_THRU:
                if (coef.whole_image[0] != null)
                {
                    ERREXIT(cinfo, J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
                }
                lossyc.compress_data = compress_data_coef;
                break;

#if FULL_COEF_BUFFER_SUPPORTED
            case J_BUF_MODE.JBUF_SAVE_AND_PASS:
                if (coef.whole_image[0] == null)
                {
                    ERREXIT(cinfo, J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
                }
                lossyc.compress_data = compress_first_pass_coef;
                break;

            case J_BUF_MODE.JBUF_CRANK_DEST:
                if (coef.whole_image[0] == null)
                {
                    ERREXIT(cinfo, J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
                }
                lossyc.compress_data = compress_output_coef;
                break;
#endif
            default:
                ERREXIT(cinfo, J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
                break;
            }
        }
Example #24
0
        // Initialize for a processing pass.
        static void start_pass_c_main(jpeg_compress cinfo, J_BUF_MODE pass_mode)
        {
            my_c_main_controller main = (my_c_main_controller)cinfo.main;

            // Do nothing in raw-data mode.
            if (cinfo.raw_data_in)
            {
                return;
            }

            main.cur_iMCU_row = 0;                      // initialize counters
            main.rowgroup_ctr = 0;
            main.suspended    = false;
            main.pass_mode    = pass_mode;              // save mode for use by process_data

            switch (pass_mode)
            {
            case J_BUF_MODE.JBUF_PASS_THRU: main.process_data = process_data_simple_c_main; break;

            default: ERREXIT(cinfo, J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE); break;
            }
        }
 /// <summary>
 /// Initialize for a processing pass.
 /// </summary>
 public void start_pass(J_BUF_MODE pass_mode)
 {
     switch (pass_mode)
     {
         case J_BUF_MODE.JBUF_PASS_THRU:
             if (m_cinfo.m_upsample.NeedContextRows())
             {
                 m_dataProcessor = DataProcessor.context_main;
                 make_funny_pointers(); /* Create the xbuffer[] lists */
                 m_whichFunny = 0; /* Read first iMCU row into xbuffer[0] */
                 m_context_state = CTX_PREPARE_FOR_IMCU;
                 m_iMCU_row_ctr = 0;
             }
             else
             {
                 /* Simple case with no context needed */
                 m_dataProcessor = DataProcessor.simple_main;
             }
             m_buffer_full = false;  /* Mark buffer empty */
             m_rowgroup_ctr = 0;
             break;
         case J_BUF_MODE.JBUF_CRANK_DEST:
             /* For last pass of 2-pass quantization, just crank the postprocessor */
             m_dataProcessor = DataProcessor.crank_post;
             break;
         default:
             m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_BAD_BUFFER_MODE);
             break;
     }
 }