public class OpusProjection
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
OpusProjection.Functions
Contains the function pointers loaded from
Opus.getLibrary(). |
| Modifier and Type | Field and Description |
|---|---|
static int |
OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN_REQUEST
Projection CTLs
|
static int |
OPUS_PROJECTION_GET_DEMIXING_MATRIX_REQUEST
Projection CTLs
|
static int |
OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE_REQUEST
Projection CTLs
|
| Modifier and Type | Method and Description |
|---|---|
static long |
nopus_projection_ambisonics_encoder_create(int Fs,
int channels,
int mapping_family,
long streams,
long coupled_streams,
int application,
long error)
Unsafe version of:
projection_ambisonics_encoder_create |
static int |
nopus_projection_ambisonics_encoder_init(long st,
int Fs,
int channels,
int mapping_family,
long streams,
long coupled_streams,
int application)
Unsafe version of:
projection_ambisonics_encoder_init |
static int |
nopus_projection_decode_float(long st,
long data,
int len,
long pcm,
int frame_size,
int decode_fec)
Unsafe version of:
projection_decode_float |
static int |
nopus_projection_decode(long st,
long data,
int len,
long pcm,
int frame_size,
int decode_fec)
Unsafe version of:
projection_decode |
static long |
nopus_projection_decoder_create(int Fs,
int channels,
int streams,
int coupled_streams,
long demixing_matrix,
int demixing_matrix_size,
long error)
Unsafe version of:
projection_decoder_create |
static int |
nopus_projection_decoder_init(long st,
int Fs,
int channels,
int streams,
int coupled_streams,
long demixing_matrix,
int demixing_matrix_size)
Unsafe version of:
projection_decoder_init |
static int |
nopus_projection_encode_float(long st,
long pcm,
int frame_size,
long data,
int max_data_bytes)
Unsafe version of:
projection_encode_float |
static int |
nopus_projection_encode(long st,
long pcm,
int frame_size,
long data,
int max_data_bytes)
Unsafe version of:
projection_encode |
static long |
opus_projection_ambisonics_encoder_create(int Fs,
int channels,
int mapping_family,
java.nio.IntBuffer streams,
java.nio.IntBuffer coupled_streams,
int application,
java.nio.IntBuffer error)
Allocates and initializes a projection encoder state.
|
static int |
opus_projection_ambisonics_encoder_get_size(int channels,
int mapping_family)
Gets the size of an
OpusProjectionEncoder structure. |
static int |
opus_projection_ambisonics_encoder_init(long st,
int Fs,
int channels,
int mapping_family,
java.nio.IntBuffer streams,
java.nio.IntBuffer coupled_streams,
int application)
Initialize a previously allocated projection encoder state.
|
static int |
opus_projection_decode_float(long st,
java.nio.ByteBuffer data,
java.nio.FloatBuffer pcm,
int frame_size,
int decode_fec)
Decode a projection Opus packet with floating point output.
|
static int |
opus_projection_decode(long st,
java.nio.ByteBuffer data,
java.nio.ShortBuffer pcm,
int frame_size,
int decode_fec)
Decode a projection Opus packet.
|
static long |
opus_projection_decoder_create(int Fs,
int channels,
int streams,
int coupled_streams,
java.nio.ByteBuffer demixing_matrix,
java.nio.IntBuffer error)
Allocates and initializes a projection decoder state.
|
static int |
opus_projection_decoder_ctl(long st,
int request)
Performs a CTL function on a projection Opus decoder.
|
static int |
opus_projection_decoder_ctl(long st,
Opus.CTLRequest request)
Performs a CTL function on a projection Opus decoder.
|
static int |
opus_projection_decoder_destroy(long st)
Frees an
OpusProjectionDecoder allocated by projection_decoder_create. |
static int |
opus_projection_decoder_get_size(int channels,
int streams,
int coupled_streams)
Gets the size of an
OpusProjectionDecoder structure. |
static int |
opus_projection_decoder_init(long st,
int Fs,
int channels,
int streams,
int coupled_streams,
java.nio.ByteBuffer demixing_matrix)
Initialize a previously allocated projection decoder state object.
|
static int |
opus_projection_encode_float(long st,
java.nio.FloatBuffer pcm,
int frame_size,
java.nio.ByteBuffer data)
Encodes a projection Opus frame from floating point input.
|
static int |
opus_projection_encode(long st,
java.nio.ShortBuffer pcm,
int frame_size,
java.nio.ByteBuffer data)
Encodes a projection Opus frame.
|
static int |
opus_projection_encoder_ctl(long st,
int request)
Performs a CTL function on an projection Opus encoder.
|
static int |
opus_projection_encoder_ctl(long st,
Opus.CTLRequest request)
Performs a CTL function on an projection Opus encoder.
|
static int |
opus_projection_encoder_destroy(long st)
Frees an
OpusProjectionEncoder allocated by projection_ambisonics_encoder_create. |
static Opus.CTLRequest |
OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN(java.nio.IntBuffer value)
Gets the gain (in dB.
|
static Opus.CTLRequest |
OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE(java.nio.IntBuffer value)
Gets the size in bytes of the demixing matrix from the encoder.
|
static Opus.CTLRequest |
OPUS_PROJECTION_GET_DEMIXING_MATRIX(java.nio.ByteBuffer matrix)
Copies the demixing matrix to the supplied pointer location.
|
public static final int OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN_REQUEST
public static final int OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE_REQUEST
public static final int OPUS_PROJECTION_GET_DEMIXING_MATRIX_REQUEST
public static int opus_projection_ambisonics_encoder_get_size(int channels,
int mapping_family)
OpusProjectionEncoder structure.channels - the total number of input channels to encode. This must be no more than 255.mapping_family - the mapping family to use for selecting the appropriate projectionpublic static long nopus_projection_ambisonics_encoder_create(int Fs,
int channels,
int mapping_family,
long streams,
long coupled_streams,
int application,
long error)
projection_ambisonics_encoder_createpublic static long opus_projection_ambisonics_encoder_create(int Fs,
int channels,
int mapping_family,
java.nio.IntBuffer streams,
java.nio.IntBuffer coupled_streams,
int application,
@Nullable
java.nio.IntBuffer error)
Call projection_encoder_destroy to release this object when finished.
Fs - sampling rate of the input signal (in Hz). One of:| 8000 | 12000 | 16000 | 24000 | 48000 |
channels - number of channels in the input signal. This must be at most 255. It may be greater than the number of coded channels (streams +
coupled_streams).mapping_family - the mapping family to use for selecting the appropriate projectionstreams - the total number of streams that will be encoded from the inputcoupled_streams - number of coupled (2 channel) streams to encode that will be encoded from the inputapplication - the target encoder applicationerror - returns OK on success, or a negative error code on failurepublic static int nopus_projection_ambisonics_encoder_init(long st,
int Fs,
int channels,
int mapping_family,
long streams,
long coupled_streams,
int application)
projection_ambisonics_encoder_initpublic static int opus_projection_ambisonics_encoder_init(long st,
int Fs,
int channels,
int mapping_family,
java.nio.IntBuffer streams,
java.nio.IntBuffer coupled_streams,
int application)
The memory pointed to by st must be at least the size returned by projection_ambisonics_encoder_get_size. This is intended for applications
which use their own allocator instead of malloc.
To reset a previously initialized state, use the RESET_STATE CTL.
st - projection encoder state to initializeFs - sampling rate of the input signal (in Hz). One of:| 8000 | 12000 | 16000 | 24000 | 48000 |
channels - number of channels in the input signal. This must be at most 255. It may be greater than the number of coded channels (streams +
coupled_streams).streams - the total number of streams that will be encoded from the inputcoupled_streams - number of coupled (2 channel) streams to encode that will be encoded from the input. Additionally, the total number of encoded channels
(streams + coupled_streams) must be no more than the number of input channels.application - the target encoder applicationOK on success, or a negative error code on failurepublic static int nopus_projection_encode(long st,
long pcm,
int frame_size,
long data,
int max_data_bytes)
projection_encodemax_data_bytes - size of the allocated memory for the output payload. This may be used to impose an upper limit on the instant bitrate, but should not be used as
the only bitrate control. Use SET_BITRATE_REQUEST to control the bitrate.public static int opus_projection_encode(long st,
java.nio.ShortBuffer pcm,
int frame_size,
java.nio.ByteBuffer data)
st - projection encoder statepcm - the input signal as interleaved samples. This must contain frame_size*channels samples.frame_size - number of samples per channel in the input signal. This must be an Opus frame size for the encoder's sampling rate. For example, at 48 kHz the
permitted values are 120, 240, 480, 960, 1920, and 2880. Passing in a duration of less than 10 ms (480 samples at 48 kHz) will prevent the encoder
from using the LPC or hybrid modes.data - output payload. This must contain storage for at max_data_bytes.public static int nopus_projection_encode_float(long st,
long pcm,
int frame_size,
long data,
int max_data_bytes)
projection_encode_floatmax_data_bytes - size of the allocated memory for the output payload. This may be used to impose an upper limit on the instant bitrate, but should not be used as
the only bitrate control. Use SET_BITRATE_REQUEST to control the bitrate.public static int opus_projection_encode_float(long st,
java.nio.FloatBuffer pcm,
int frame_size,
java.nio.ByteBuffer data)
st - projection encoder statepcm - the input signal as interleaved samples with a normal range of +/-1.0. Samples with a range beyond +/-1.0 are supported but will be
clipped by decoders using the integer API and should only be used if it is known that the far end supports extended dynamic range. This must
contain frame_size*channels samples.frame_size - number of samples per channel in the input signal. This must be an Opus frame size for the encoder's sampling rate. For example, at 48 kHz the
permitted values are 120, 240, 480, 960, 1920, and 2880. Passing in a duration of less than 10 ms (480 samples at 48 kHz) will prevent the encoder
from using the LPC or hybrid modes.data - output payload. This must contain storage for at max_data_bytes.public static int opus_projection_encoder_destroy(long st)
OpusProjectionEncoder allocated by projection_ambisonics_encoder_create.st - projection encoder state to be freedpublic static int opus_projection_decoder_get_size(int channels,
int streams,
int coupled_streams)
OpusProjectionDecoder structure.channels - the total number of output channels. This must be no more than 255.streams - the total number of streams coded in the inputcoupled_streams - number streams to decode as coupled (2 channel) streams. This must be no larger than the total number of streams. Additionally, The total number of
coded channels (streams + coupled_streams) must be no more than 255.public static long nopus_projection_decoder_create(int Fs,
int channels,
int streams,
int coupled_streams,
long demixing_matrix,
int demixing_matrix_size,
long error)
projection_decoder_createdemixing_matrix_size - the size in bytes if the demixing matrixpublic static long opus_projection_decoder_create(int Fs,
int channels,
int streams,
int coupled_streams,
java.nio.ByteBuffer demixing_matrix,
@Nullable
java.nio.IntBuffer error)
Call projection_decoder_destroy to release this object when finished.
Fs - sampling rate of input signal (Hz). One of:| 8000 | 12000 | 16000 | 24000 | 48000 |
channels - number of channels to outputstreams - the total number of streams coded in the input. This must be no more than 255.coupled_streams - number streams to decode as coupled (2 channel) streams. This must be no larger than the total number of streams. Additionally, The total number of
coded channels (streams + coupled_streams) must be no more than 255.demixing_matrix - demixing matrix that maps from coded channels to output channelserror - returns OK on success, or a negative error code on failurepublic static int nopus_projection_decoder_init(long st,
int Fs,
int channels,
int streams,
int coupled_streams,
long demixing_matrix,
int demixing_matrix_size)
projection_decoder_initdemixing_matrix_size - the size in bytes if the demixing matrixpublic static int opus_projection_decoder_init(long st,
int Fs,
int channels,
int streams,
int coupled_streams,
java.nio.ByteBuffer demixing_matrix)
The memory pointed to by st must be at least the size returned by projection_decoder_get_size. This is intended for applications which use
their own allocator instead of malloc.
To reset a previously initialized state, use the RESET_STATE CTL.
st - projection decoder state to initializeFs - sampling rate of input signal (Hz). One of:| 8000 | 12000 | 16000 | 24000 | 48000 |
channels - number of channels to output. This mustbe at most 255. It may be different from the number of coded channels (stream + coupled_streams).streams - the total number of streams coded in the input. This must be no more than 255.coupled_streams - number streams to decode as coupled (2 channel) streams. This must be no larger than the total number of streams. Additionally, The total number of
coded channels (streams + coupled_streams) must be no more than 255.demixing_matrix - demixing matrix that maps from coded channels to output channelsOK on success, or a negative error code on failurepublic static int nopus_projection_decode(long st,
long data,
int len,
long pcm,
int frame_size,
int decode_fec)
projection_decodelen - number of bytes in payloadpublic static int opus_projection_decode(long st,
@Nullable
java.nio.ByteBuffer data,
java.nio.ShortBuffer pcm,
int frame_size,
int decode_fec)
st - projection decoder statedata - input payload (Use a NULL pointer to indicate packet loss)pcm - output signal, with interleaved samples. This must contain room for frame_size*channels samples.frame_size - number of samples per channel of available space in pcm.
If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will not be capable of decoding some packets. In the case
of PLC (data==NULL) or FEC (decode_fec=1), then frame_size needs to be exactly the duration of audio that is missing,
otherwise the decoder will not be in the optimal state to decode the next incoming packet. For the PLC and FEC cases, frame_size
must be a multiple of 2.5 ms.
decode_fec - flag (0 or 1) to request that any in-band forward error correction data be decoded. If no such data is available, the frame is decoded as if it
were lost.public static int nopus_projection_decode_float(long st,
long data,
int len,
long pcm,
int frame_size,
int decode_fec)
projection_decode_floatlen - number of bytes in payloadpublic static int opus_projection_decode_float(long st,
@Nullable
java.nio.ByteBuffer data,
java.nio.FloatBuffer pcm,
int frame_size,
int decode_fec)
st - projection decoder statedata - input payload. Use a NULL pointer to indicate packet losspcm - output signal, with interleaved samples. (This must contain room for frame_size*channels samples.)frame_size - number of samples per channel of available space in pcm.
If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will not be capable of decoding some packets. In the case
of PLC (data==NULL) or FEC (decode_fec=1), then frame_size needs to be exactly the duration of audio that is missing,
otherwise the decoder will not be in the optimal state to decode the next incoming packet. For the PLC and FEC cases, frame_size
must be a multiple of 2.5 ms.
decode_fec - flag (0 or 1) to request that any in-band forward error correction data be decoded. If no such data is available, the frame is decoded as if it
were lost.public static int opus_projection_decoder_destroy(long st)
OpusProjectionDecoder allocated by projection_decoder_create.st - projection decoder state to be freedpublic static int opus_projection_encoder_ctl(long st,
int request)
st - projection encoder staterequest - CTL requestpublic static int opus_projection_encoder_ctl(long st,
Opus.CTLRequest request)
st - projection encoder staterequest - CTL requestpublic static int opus_projection_decoder_ctl(long st,
int request)
st - projection decoder staterequest - CTL requestpublic static int opus_projection_decoder_ctl(long st,
Opus.CTLRequest request)
st - projection decoder staterequest - CTL requestpublic static Opus.CTLRequest OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN(java.nio.IntBuffer value)
public static Opus.CTLRequest OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE(java.nio.IntBuffer value)
public static Opus.CTLRequest OPUS_PROJECTION_GET_DEMIXING_MATRIX(java.nio.ByteBuffer matrix)
matrix - returns the demixing matrix to the supplied pointer location.Copyright LWJGL. All Rights Reserved. License terms.