man3/AF_comp_u.3

#

    AF_comp_u(3)							 AF_comp_u(3)

    NAME
      AF_comp_u, AF_comp_a - linear	to ULAW	and ALAW compression tables

    SYNTAX
      #include <AF/AFUtils.h>

      extern unsigned char AF_comp_u[];

      extern unsigned char AF_comp_a[];

    DESCRIPTION
      AF_comp_u and	AF_comp_a are precomputed tables you can link with your
      application.	Each is	indexed	by the low 14 bits of a	linear twos-
      complement value in the range	between	-8192 and +8191.  AF_comp_u contains
      the corresponding U255 law encoding while AF_comp_a contains the
      corresponding	ALAW encoding.

    EXAMPLES
      Typical usage	is:

      unsigned char	ulaw;
      int input;
      /* first limit the signal to the proper range	*/
      if (input > 8191) input = 8191;
      else if (input < -8181) input	= -8191;
      /* then translate */
      ulaw = AF_comp_u[ input & 0x3fff ];

    DIAGNOSTICS
      If you index the table with an out-of-range linear value you may cause a
      protection fault and crash your application.

    SEE ALSO
      AF_exp_u(3), AF_exp_a(3), AF_cvt_u2s(3), AF_cvt_a2s(3), AF_cvt_u2f(3),
      AF_cvt_a2f(3)
      AF(1)

    BUGS
      If you encounter a reproducible bug, please submit a problem report to
      (af-bugs@crl.dec.com).

    COPYRIGHT
      Copyright 1990-1994, Digital Equipment Corporation.
      See AF(1) for	a full statement of rights and permissions.

    AUTHORS
      Tom Levergood	and Larry Stewart, Digital Cambridge Research Lab