estimation.cpp in estimation_release08


This is the codec in the motion estimation code (which has debug through) useful...Original Link
    Sponsored links

			
// estimation.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#include "stdio.h"

int main()
{
    int row,col;
	int total_no,sad;
	long int sad_min;
	char * src_path;
	char * out_path;
    int i,j,k,m,p,q,k1,m1,p1,q1;
//	i=17;
//	j=21;

	int width = 352,mb_width=width /16;					
    int height = 288,mb_height= height/16;	                    
//	int a[16][16],b[16][16],c[16][16];
	int sad_MATRIX[336][272];     	
	
	total_no= 300;				                              //total frame number
    sad=0;

    src_path = "G:\\videos\\foreman_cif.yuv";
    out_path = "C:\\my_work\\sousuo\\estimation_cif_test.yuv";
	
	int temp = 0;
    int size;
	FILE *in_file, *out_file;
    unsigned char * buf1[3];
	unsigned char * buf2[3];
	unsigned char * buf3[3];
    int frame_no;
    
	size=height * width + (height * width >> 1);

    unsigned char srcYBuf1[352*288];   
    unsigned char srcUBuf1[352/2 * 288/2];
    unsigned char srcVBuf1[352/2 * 288/2];
	
	unsigned char srcYBuf2[352*288];   
    unsigned char srcUBuf2[352/2 * 288/2];
    unsigned char srcVBuf2[352/2 * 288/2];

	unsigned char srcYBuf3[352*288];   
//  unsigned char srcUBuf3[width/2 * height/2];
//  unsigned char srcVBuf3[width/2 * height/2];
	
    buf1[0] = srcYBuf1;
    buf1[1]	= srcUBuf1;                       
    buf1[2]	= srcVBuf1;   

	buf2[0] = srcYBuf2;
    buf2[1]	= srcUBuf2;                       
    buf2[2]	= srcVBuf2; 

	buf3[0] = srcYBuf3;
//  buf3[1]	= srcUBuf3;                       
//  buf3[2]	= srcVBuf3;

    
	in_file = fopen(src_path, "rb");
   
    if (!in_file)
    {
        printf("cannot open input file.");
        return 0;
    }

    out_file = fopen(out_path, "wb");
    if (!out_file)
    {
        printf("cannot write file.\n");
        return 0;
    }
   
    frame_no =0;
    fread(buf1[0],   width,      height,    in_file);
    fread(buf1[1], (width>>1), (height>>1), in_file);
    fread(buf1[2], (width>>1), (height>>1), in_file);

    			

			...
			...
			... to be continued.

  This is a preview. To get the complete source file, 
  please click here to download the whole source code package.

			
			


Project Files

    Sponsored links
NameSizeDate
 <Debug>0.00 B11-08-08 12:45
 estimation.cpp4.94 kB11-08-08 12:43
 estimation.ncb27.00 kB11-08-08 12:44
 estimation.sln909.00 B06-08-08 14:33
 estimation.suo8.50 kB11-08-08 12:44
 estimation.vcproj3.85 kB11-08-08 11:41
 ReadMe.txt1,009.00 B06-08-08 14:33
 <Release>0.00 B11-08-08 12:45
 stdafx.cpp214.00 B06-08-08 14:33
 stdafx.h195.00 B06-08-08 14:33
 <estimation_release08_11_16x16>0.00 B11-08-08 12:45
...

Related Items

    Sponsored links