OpenCores
URL https://opencores.org/ocsvn/nova/nova/trunk

Subversion Repositories nova

[/] [nova/] [trunk/] [test/] [bin2hex.pl] - Rev 11

Compare with Previous | Blame | View Log

#! /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); 
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.