Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.codec.audio.g729
Class Util

java.lang.Object
  extended by net.java.sip.communicator.impl.neomedia.codec.audio.g729.Util

 class Util
extends Object

Auxiliary functions.

Author:
Lubomir Marinov (translation of ITU-T C source code to Java)

Constructor Summary
Util()
           
 
Method Summary
(package private) static void copy(float[] x, float[] y, int L)
          Copies an array from the specified x array, to the specified y array.
(package private) static void copy(float[] x, int x_offset, float[] y, int L)
          Copies an array from the specified source array, beginning at the specified destination array.
(package private) static void copy(float[] x, int x_offset, float[] y, int y_offset, int L)
          Copies an array from the specified source array, beginning at the specified position, to the specified position of the destination array.
(package private) static int fread(short[] data, int length, InputStream fp)
          Read data from fp.
(package private) static void fwrite(short[] data, int length, OutputStream fp)
          Write data in fp
(package private) static short random_g729()
          Return random short.
(package private) static void set_zero(float[] x, int L)
          Assigns the value zero to element of the specified array of floats.
(package private) static void set_zero(float[] x, int offset, int length)
          Assigns the value zero to element of the specified array of floats.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

Util()
Method Detail

set_zero

static void set_zero(float[] x,
                     int L)
Assigns the value zero to element of the specified array of floats. The number of components set to zero equal to the length argument.

Parameters:
x - (o) : vector to clear
L - (i) : length of vector

set_zero

static void set_zero(float[] x,
                     int offset,
                     int length)
Assigns the value zero to element of the specified array of floats. The number of components set to zero equal to the length argument. The components at positions offset through offset+length-1 in the array are set to zero.

Parameters:
x - (o) : vector to clear
offset - (i) : offset of vector
length - (i) : length of vector

copy

static void copy(float[] x,
                 float[] y,
                 int L)
Copies an array from the specified x array, to the specified y array. The number of components copied is equal to the length argument.

Parameters:
x - (i) : input vector
y - (o) : output vector
L - (i) : vector length

copy

static void copy(float[] x,
                 int x_offset,
                 float[] y,
                 int L)
Copies an array from the specified source array, beginning at the specified destination array. A subsequence of array components are copied from the source array referenced by x to the destination array referenced by y. The number of components copied is equal to the length argument. The components at positions x_offset through x_offset+length-1 in the source array are copied into positions 0 through length-1, respectively, of the destination array.

Parameters:
x - (i) : input vector
x_offset - (i) : input vector offset
y - (o) : output vector
L - (i) : vector length

copy

static void copy(float[] x,
                 int x_offset,
                 float[] y,
                 int y_offset,
                 int L)
Copies an array from the specified source array, beginning at the specified position, to the specified position of the destination array. A subsequence of array components are copied from the source array referenced by x to the destination array referenced by y. The number of components copied is equal to the length argument. The components at positions x_offset through x_offset+length-1 in the source array are copied into positions y_offset through y_offset+length-1, respectively, of the destination array.

Parameters:
x - (i) : input vector
x_offset - (i) : input vector offset
y - (o) : output vector
y_offset - (i) : output vector offset
L - (i) : vector length

random_g729

static short random_g729()
Return random short.

Returns:
random short

fwrite

static void fwrite(short[] data,
                   int length,
                   OutputStream fp)
            throws IOException
Write data in fp

Parameters:
data -
length -
fp -
Throws:
IOException

fread

static int fread(short[] data,
                 int length,
                 InputStream fp)
          throws IOException
Read data from fp.

Parameters:
data -
length -
fp -
Returns:
length of resulting data array
Throws:
IOException

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.