#include #include #include #include /******************************/ #include "global.h" #include "config.h" #include "mpeg2dec.h" #include "common.h" void resizefunc(int width,int height) { /**************** VARIABLE DECLEARATION ***********************************************************/ int i,j,a,b,q,r,c,d,c1,d1,x,y; int hr_st_integer,hr_end_integer,vr_st_integer,vr_end_integer; int vr_start,vr_end,hr_start,hr_end; /*intermediate indexes*/ //int res_width,res_height; int x1,y1,x2,y2,x3,y3,x4,y4,type; float sum2; float current_hor_total,hr_st_decimal,hr_end_decimal; float current_ver_total,vr_st_decimal,vr_end_decimal; float tmp,avg; float curwindow[10][10],curwindow1[10][10]; //float sum[100][100]; float rwmbno; float rhmbno; FILE *f1; /**************** VARIABLE DECLEARATION END ***********************************************************/ /**************** Calculation of rescaled height and width ***********************************************************/ /*if((f1=fopen("/home/usr/dpatel/mar19/1/xdec/inputdata.txt","r"))==NULL) printf("file inputdata.txt does not open\n"); fscanf(f1,"%f\t%f\n",&hor_factor,&ver_factor); printf("%f %f\n",hor_factor,ver_factor); fclose(f1);*/ /*res_width = (int) (width/hor_factor); res_height = (int)(height/ver_factor); if(res_width%2 != 0) //making sure that rescaled height&width are even integers res_width = res_width - 1; if(res_height%2 != 0) res_height = res_height - 1;*/ if(resecho){ //printf("res_width=%d res_height=%d\n",res_width,res_height); printf("width=%d height=%d\n",width,height); getchar();} /**************** Calculation of rescaled height and width ENDS ***********************************************************/ /**************** Setting type values to 1or 2 according to the orig_height and width ***********************************************************/ /**************** Setting type values to 1or 2 according to the orig_height and width ENDS **********************************************/ /**************** Initialising the buffers used and the variables used ***********************************************************/ //Initialisation of the convertvalue matrix for(x1 = 0; x1<1000;x1++) for(y1 = 0; y1<1000;y1++) { convertvalues[x1][y1] = 0; } /*initialisation of first window for(x2 = 0; x2<10;x2++) for(y2 = 0; y2<10;y2++) { curwindow[x2][y2] = 0; }*/ //initialisation of second window for(x3 = 0; x3<10;x3++) for(y3 = 0; y3<10;y3++) { curwindow1[x3][y3] = 0; } /**************** Initialising the buffers used and the variables used ENDS ***********************************************************/ /***************** Calculation beigns **************************************************************************************************/ // fprintf(convalfd,"the y comp-begins\n"); for(a = 0;a