<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<!-- lifted from troff+man by doclifter -->
<refentry id='diffbyts1'>
<!--  @(#)diffbyts.1 2001/04/02 NIST -->
<!--  I Image Group -->
<!--  Craig Watson -->

<refmeta>
<refentrytitle>DIFFBYTS</refentrytitle>
<manvolnum>1D</manvolnum>
<refmiscinfo class='date'>02 April 2001</refmiscinfo>
<refmiscinfo class='source'>NIST</refmiscinfo>
<refmiscinfo class='manual'>NFIS Reference Manual</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>diffbyts</refname>
<refpurpose>takes two binary data files and compares them byte for byte, compiling a cumulative histogram of differences.</refpurpose>
</refnamediv>
<!-- body begins here -->
<refsynopsisdiv id='synopsis'>
<cmdsynopsis>
  <command>diffbyts</command>    
    <arg choice='plain'><replaceable>&lt;file1&gt;&lt;file2&gt;</replaceable></arg>
    <sbr/>
</cmdsynopsis>
</refsynopsisdiv>


<refsect1 id='description'><title>DESCRIPTION</title>
<para><emphasis remap='B'>Diffbyts</emphasis>
takes as input two binary files of equal length and compares the
contents between the two files byte for byte.  The differences
between corresponding pairs of bytes are accumulated into a histogram,
where each bin in the histogram represents the integer difference
between the byte pairs.  Therefore, the first bin in the histogram
contains the count of all those byte pairs that are exactly the same
(a difference of 0); the next bin contains the count of all those
byte pairs that are different by exactly 1; and so on.</para>

<para>Upon completion, this utility prints a formatted report of the
accumulated histogram to standard output.  Each difference
bin in the histogram is listed on separate line in the report
and formatted at follows:</para>

<!-- .RS -->
<para>d[<emphasis remap='I'>b</emphasis>] = <emphasis remap='I'>c</emphasis> : <emphasis remap='I'>p</emphasis>
<!-- .RE -->
<!-- .br -->
where</para>
<!-- .br -->
<!-- .RS -->
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>b</emphasis></term>
  <listitem>
<para>is the current bin's byte pair difference.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>c</emphasis></term>
  <listitem>
<para>is the number of corresponding byte pairs with difference
equal to <emphasis remap='I'>b</emphasis>.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>p</emphasis></term>
  <listitem>
<para>is the cumulative percentage of corresponding pairs of bytes
counted in all the bins up to and including the current bin.</para>
  </listitem>
  </varlistentry>
</variablelist>
<!-- .RE -->

</refsect1>

<refsect1 id='options'><title>OPTIONS</title>
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>&lt;file1&gt;</emphasis></term>
  <listitem>
<para>a binary file to be compared byte for byte to <emphasis remap='I'>file2</emphasis>.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&lt;file2&gt;</emphasis></term>
  <listitem>
<para>a binary file to be compared byte for byte to <emphasis remap='I'>file1</emphasis>.</para>

  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='examples'><title>EXAMPLES</title>
<para>From <emphasis remap='I'>test/imgtools/execs/diffbyts/diffbyts.src</emphasis>:</para>
<!-- .RS -->

<para><emphasis remap='B'>% diffbyts ../../data/finger/gray/raw/finger.raw ../dwsq/finger.raw &gt; finger.hst</emphasis>
<!-- .br -->
compiles and stores a byte-difference histogram reporting
the amount of image degradation due to lossy WSQ compression.</para>

</refsect1>

<refsect1 id='author'><title>AUTHOR</title>
<para>NIST/ITL/DIV894/Image Group</para>
</refsect1>
</refentry>

