#ifndef RESAMPLE_H
#define RESAMPLE_H

typedef struct	 Resize_Parameters
{
	int input_width;
	int input_height;
	int output_width;
	int output_heigh;
	int crop_x0 ;
	int crop_y0 ;
	int crop_w ;
	int crop_h ;  
	int input_chroma_phase_shift_x ;
	int input_chroma_phase_shift_y ;
	int output_chroma_phase_shift_x ;
	int output_chroma_phase_shift_y ;

	int input_stride[3];  //input_stride Y U V
	int output_stride[3]; //output_stride Y U V

	int minValue;
	int maxValue;

	int down_sample;//1:downsampling ,0:upsampling

	imgpel* img_buffer[3];

	int img_stride;

	int* resize_buffer;
	int* resize_buffer_tmp;

	//!<0:Y 1:UV
	int* pos_x[2];
	int* pos_y[2];

	int NormalizeResolutionDepth;
}ResizeParameters;


extern int init_ImageResize(ResizeParameters* ResizeParams, 
							  int input_width, int intput_height, int output_width, int output_heigh );

extern void destroy_ImageResize(ResizeParameters* pResizeParams);



extern void generic_upsampler(ResizeParameters* ResizeParams,
							 imgpel**low_imgY,imgpel**low_imgU,imgpel**low_imgV,
							 imgpel**high_imgY,imgpel**high_imgU,imgpel**high_imgV,int component,int method);
#endif

