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

Subversion Repositories nova

[/] [nova/] [trunk/] [test/] [bin2hex.pl] - Blame information for rev 11

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 7 eexuke
#! /usr/bin/perl
2
 
3
# Author(s)  : Ke Xu
4
# Email      : eexuke@yahoo.com
5
# Description: Convert binary .264 file to text format
6
# Usage      : bin2hex.pl xxx.264                
7
# Copyright (C) 2008 Ke Xu
8
 
9
open STDOUT,    ">akiyo300_1ref.txt" || die "Can't open output file:$!\n";
10
if (open(BINFILE,"<".$ARGV[0]))
11
{
12
        binmode(BINFILE);
13
        $s = '';
14
        $i = 0;
15
        while (!eof(BINFILE))
16
        {
17
                if ($i >= 2)
18
                {
19
                        printf "%s\n",$s;
20
                        $s = '';
21
                        $i = 0;
22
                }
23
                else
24
                {
25
                        $i++;
26
                        $s .= sprintf("%02X",ord(getc(BINFILE)));
27
                }
28
        }
29
        ###if last line of BINFILE is less than 16 byte
30
        if ($i < 2)
31
        {
32
                printf "%s",$s;
33
        }
34
        close (BINFILE);
35
}

powered by: WebSVN 2.1.0

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