Initial commit
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
#! /usr/bin/perl
|
||||
|
||||
# Author(s) : Ke Xu
|
||||
# Email : eexuke@yahoo.com
|
||||
# Description: Convert binary .264 file to text format
|
||||
# Usage : bin2hex.pl xxx.264
|
||||
# Copyright (C) 2008 Ke Xu
|
||||
|
||||
open STDOUT, ">akiyo300_1ref.txt" || die "Can't open output file:$!\n";
|
||||
if (open(BINFILE,"<".$ARGV[0]))
|
||||
{
|
||||
binmode(BINFILE);
|
||||
$s = '';
|
||||
$i = 0;
|
||||
while (!eof(BINFILE))
|
||||
{
|
||||
if ($i >= 2)
|
||||
{
|
||||
printf "%s\n",$s;
|
||||
$s = '';
|
||||
$i = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$i++;
|
||||
$s .= sprintf("%02X",ord(getc(BINFILE)));
|
||||
}
|
||||
}
|
||||
###if last line of BINFILE is less than 16 byte
|
||||
if ($i < 2)
|
||||
{
|
||||
printf "%s",$s;
|
||||
}
|
||||
close (BINFILE);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,27 @@
|
||||
// Author(s) : Ke Xu
|
||||
// Email : eexuke@yahoo.com
|
||||
// Description: Convert text file to binary (.yuv) file
|
||||
// Copyright (C) 2008 Ke Xu
|
||||
|
||||
#include <stdio.h>
|
||||
int main ()
|
||||
{
|
||||
int buffer;
|
||||
int i;
|
||||
FILE * inFile;
|
||||
FILE * outFile;
|
||||
inFile = fopen ("C:/xxx/xxx/nova_display.log","r");
|
||||
outFile = fopen ("C:/xxx/xxx/nova300.yuv", "w+b");
|
||||
|
||||
//1 frame:9504 x 32bit
|
||||
//300 frame:9504 x 300 x 32 bit = 2851200 x 32bit
|
||||
for (i = 0; i < 2851200; i++)
|
||||
{
|
||||
fscanf (inFile,"%x",&buffer);
|
||||
fwrite (&buffer,4,1,outFile);
|
||||
}
|
||||
fclose (inFile);
|
||||
fclose (outFile);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
bin2hex.pl :convert binary .264 into text format.
|
||||
|
||||
hex2bin.cpp:convert text format to binary .264.
|
||||
|
||||
bitstream folder:encoded bitstream .264 should be converted first by bin2hex.pl while .txt can be directly read into verilog.
|
||||
Reference in New Issue
Block a user