URL
https://opencores.org/ocsvn/nova/nova/trunk
[/] [nova/] [trunk/] [test/] [hex2bin.cpp] - Diff between revs 7 and 11
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 7 |
Rev 11 |
// Author(s) : Ke Xu
|
// Author(s) : Ke Xu
|
// Email : eexuke@yahoo.com
|
// Email : eexuke@yahoo.com
|
// Description: Convert text file to binary (.yuv) file
|
// Description: Convert text file to binary (.yuv) file
|
// Copyright (C) 2008 Ke Xu
|
// Copyright (C) 2008 Ke Xu
|
|
|
#include <stdio.h>
|
#include <stdio.h>
|
int main ()
|
int main ()
|
{
|
{
|
int buffer;
|
int buffer;
|
int i;
|
int i;
|
FILE * inFile;
|
FILE * inFile;
|
FILE * outFile;
|
FILE * outFile;
|
inFile = fopen ("C:/xxx/xxx/nova_display.log","r");
|
inFile = fopen ("C:/xxx/xxx/nova_display.log","r");
|
outFile = fopen ("C:/xxx/xxx/nova300.yuv", "w+b");
|
outFile = fopen ("C:/xxx/xxx/nova300.yuv", "w+b");
|
|
|
//1 frame:9504 x 32bit
|
//1 frame:9504 x 32bit
|
//300 frame:9504 x 300 x 32 bit = 2851200 x 32bit
|
//300 frame:9504 x 300 x 32 bit = 2851200 x 32bit
|
for (i = 0; i < 2851200; i++)
|
for (i = 0; i < 2851200; i++)
|
{
|
{
|
fscanf (inFile,"%x",&buffer);
|
fscanf (inFile,"%x",&buffer);
|
fwrite (&buffer,4,1,outFile);
|
fwrite (&buffer,4,1,outFile);
|
}
|
}
|
fclose (inFile);
|
fclose (inFile);
|
fclose (outFile);
|
fclose (outFile);
|
return 0;
|
return 0;
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.