/** Contains the state of an encoder. One encoder state is needed foreachstream.Itisinitializedonceatthebeginningofthe stream.Do*not*re-initializethestateforeveryframe. @briefEncoderstate
*/ typedefstruct OpusCustomEncoder OpusCustomEncoder;
/** State of the decoder. One decoder state is needed for each stream. Itisinitializedonceatthebeginningofthestream.Do*not* re-initializethestateforeveryframe. @briefDecoderstate
*/ typedefstruct OpusCustomDecoder OpusCustomDecoder;
/** The mode contains all the information necessary to create an encoder.Boththeencoderanddecoderneedtobeinitialized withexactlythesamemode,otherwisetheoutputwillbe corrupted.ThemodeMUSTNOTBEDESTROYEDuntiltheencodersand decodersthatuseitaredestroyedaswell. @briefModeconfiguration
*/ typedefstruct OpusCustomMode OpusCustomMode;
/** Creates a new mode struct. This will be passed to an encoder or *decoder.ThemodeMUSTNOTBEDESTROYEDuntiltheencodersand *decodersthatuseitaredestroyedaswell. *@param[in]Fs<tt>int</tt>:Samplingrate(8000to96000Hz) *@param[in]frame_size<tt>int</tt>:Numberofsamples(perchannel)toencodeineach *packet(64-1024,primefactorizationmustcontainzeroormore2s,3s,or5sandnootherprimes) *@param[out]error<tt>int*</tt>:Returnederrorcode(ifNULL,noerrorwillbereturned) *@returnAnewlycreatedmode
*/
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomMode *opus_custom_mode_create(opus_int32 Fs, int frame_size, int *error);
/** Destroys a mode struct. Only call this after all encoders and *decodersusingthismodearedestroyedaswell. *@param[in]mode<tt>OpusCustomMode*</tt>:Modetobefreed.
*/
OPUS_CUSTOM_EXPORT void opus_custom_mode_destroy(OpusCustomMode *mode);
/* Encoder */ /** Gets the size of an OpusCustomEncoder structure. *@param[in]mode<tt>OpusCustomMode*</tt>:Modeconfiguration *@param[in]channels<tt>int</tt>:Numberofchannels *@returnssize
*/
OPUS_CUSTOM_EXPORT_STATIC OPUS_WARN_UNUSED_RESULT int opus_custom_encoder_get_size( const OpusCustomMode *mode, int channels
) OPUS_ARG_NONNULL(1);
#ifdefined(CUSTOM_MODES) || defined(ENABLE_OPUS_CUSTOM_API) /** Initializes a previously allocated encoder state *Thememorypointedtobystmustbethesizereturnedbyopus_custom_encoder_get_size. *Thisisintendedforapplicationswhichusetheirownallocatorinsteadofmalloc. *@seeopus_custom_encoder_create(),opus_custom_encoder_get_size() *ToresetapreviouslyinitializedstateusetheOPUS_RESET_STATECTL. *@param[in]st<tt>OpusCustomEncoder*</tt>:Encoderstate *@param[in]mode<tt>OpusCustomMode*</tt>:Containsalltheinformationaboutthecharacteristicsof *thestream(mustbethesamecharacteristicsasusedforthe *decoder) *@param[in]channels<tt>int</tt>:Numberofchannels *@returnOPUS_OKSuccessor@refopus_errorcodes
*/
OPUS_CUSTOM_EXPORT int opus_custom_encoder_init(
OpusCustomEncoder *st, const OpusCustomMode *mode, int channels
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); # endif #endif
/** Creates a new encoder state. Each stream needs its own encoder *state(can'tbesharedacrosssimultaneousstreams). *@param[in]mode<tt>OpusCustomMode*</tt>:Containsalltheinformationaboutthecharacteristicsof *thestream(mustbethesamecharacteristicsasusedforthe *decoder) *@param[in]channels<tt>int</tt>:Numberofchannels *@param[out]error<tt>int*</tt>:Returnsanerrorcode *@returnNewlycreatedencoderstate.
*/
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomEncoder *opus_custom_encoder_create( const OpusCustomMode *mode, int channels, int *error
) OPUS_ARG_NONNULL(1);
/** Encodes a frame of audio. *@param[in]st<tt>OpusCustomEncoder*</tt>:Encoderstate *@param[in]pcm<tt>float*</tt>:PCMaudioinfloatformat,withanormalrangeof+/-1.0. *Sampleswitharangebeyond+/-1.0aresupportedbutwill *beclippedbydecodersusingtheintegerAPIandshould *onlybeusedifitisknownthatthefarendsupports *extendeddynamicrange.Theremustbeexactly *frame_sizesamplesperchannel. *@param[in]frame_size<tt>int</tt>:Numberofsamplesperframeofinputsignal *@param[out]compressed<tt>char*</tt>:Thecompresseddataiswrittenhere.ThismaynotaliaspcmandmustbeatleastmaxCompressedByteslong. *@param[in]maxCompressedBytes<tt>int</tt>:Maximumnumberofbytestouseforcompressingtheframe *(canchangefromoneframetoanother) *@returnNumberofbyteswrittento"compressed". *Ifnegative,anerrorhasoccurred(seeerrorcodes).ItisIMPORTANTthat *thelengthreturnedbesomehowtransmittedtothedecoder.Otherwise,no *decodingispossible.
*/
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_encode_float(
OpusCustomEncoder *st, constfloat *pcm, int frame_size, unsignedchar *compressed, int maxCompressedBytes
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
/** Encodes a frame of audio. *@param[in]st<tt>OpusCustomEncoder*</tt>:Encoderstate *@param[in]pcm<tt>opus_int16*</tt>:PCMaudioinsigned16-bitformat(nativeendian). *Theremustbeexactlyframe_sizesamplesperchannel. *@param[in]frame_size<tt>int</tt>:Numberofsamplesperframeofinputsignal *@param[out]compressed<tt>char*</tt>:Thecompresseddataiswrittenhere.ThismaynotaliaspcmandmustbeatleastmaxCompressedByteslong. *@param[in]maxCompressedBytes<tt>int</tt>:Maximumnumberofbytestouseforcompressingtheframe *(canchangefromoneframetoanother) *@returnNumberofbyteswrittento"compressed". *Ifnegative,anerrorhasoccurred(seeerrorcodes).ItisIMPORTANTthat *thelengthreturnedbesomehowtransmittedtothedecoder.Otherwise,no *decodingispossible.
*/
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_encode(
OpusCustomEncoder *st, const opus_int16 *pcm, int frame_size, unsignedchar *compressed, int maxCompressedBytes
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
/** Encodes a frame of audio. *@param[in]st<tt>OpusCustomEncoder*</tt>:Encoderstate *@param[in]pcm<tt>opus_int32*</tt>:PCMaudioinsigned32-bitformat(nativeendian)representing(orslightlyexceeding)24-bitvalues. *Theremustbeexactlyframe_sizesamplesperchannel. *@param[in]frame_size<tt>int</tt>:Numberofsamplesperframeofinputsignal *@param[out]compressed<tt>char*</tt>:Thecompresseddataiswrittenhere.ThismaynotaliaspcmandmustbeatleastmaxCompressedByteslong. *@param[in]maxCompressedBytes<tt>int</tt>:Maximumnumberofbytestouseforcompressingtheframe *(canchangefromoneframetoanother) *@returnNumberofbyteswrittento"compressed". *Ifnegative,anerrorhasoccurred(seeerrorcodes).ItisIMPORTANTthat *thelengthreturnedbesomehowtransmittedtothedecoder.Otherwise,no *decodingispossible.
*/
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_encode24(
OpusCustomEncoder *st, const opus_int32 *pcm, int frame_size, unsignedchar *compressed, int maxCompressedBytes
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
/** Perform a CTL function on an Opus custom encoder. * *Generallytherequestandsubsequentargumentsaregenerated *byaconveniencemacro. *@seeopus_encoderctls
*/
OPUS_CUSTOM_EXPORT int opus_custom_encoder_ctl(OpusCustomEncoder * OPUS_RESTRICT st, int request, ...) OPUS_ARG_NONNULL(1);
/** Gets the size of an OpusCustomDecoder structure. *@param[in]mode<tt>OpusCustomMode*</tt>:Modeconfiguration *@param[in]channels<tt>int</tt>:Numberofchannels *@returnssize
*/
OPUS_CUSTOM_EXPORT_STATIC OPUS_WARN_UNUSED_RESULT int opus_custom_decoder_get_size( const OpusCustomMode *mode, int channels
) OPUS_ARG_NONNULL(1);
/** Initializes a previously allocated decoder state *Thememorypointedtobystmustbethesizereturnedbyopus_custom_decoder_get_size. *Thisisintendedforapplicationswhichusetheirownallocatorinsteadofmalloc. *@seeopus_custom_decoder_create(),opus_custom_decoder_get_size() *ToresetapreviouslyinitializedstateusetheOPUS_RESET_STATECTL. *@param[in]st<tt>OpusCustomDecoder*</tt>:Decoderstate *@param[in]mode<tt>OpusCustomMode*</tt>:Containsalltheinformationaboutthecharacteristicsof *thestream(mustbethesamecharacteristicsasusedforthe *encoder) *@param[in]channels<tt>int</tt>:Numberofchannels *@returnOPUS_OKSuccessor@refopus_errorcodes
*/
OPUS_CUSTOM_EXPORT_STATIC int opus_custom_decoder_init(
OpusCustomDecoder *st, const OpusCustomMode *mode, int channels
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2);
#endif
/** Creates a new decoder state. Each stream needs its own decoder state (can't *besharedacrosssimultaneousstreams). *@param[in]mode<tt>OpusCustomMode</tt>:Containsalltheinformationaboutthecharacteristicsofthe *stream(mustbethesamecharacteristicsasusedfortheencoder) *@param[in]channels<tt>int</tt>:Numberofchannels *@param[out]error<tt>int*</tt>:Returnsanerrorcode *@returnNewlycreateddecoderstate.
*/
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomDecoder *opus_custom_decoder_create( const OpusCustomMode *mode, int channels, int *error
) OPUS_ARG_NONNULL(1);
/** Decode an opus custom frame with floating point output *@param[in]st<tt>OpusCustomDecoder*</tt>:Decoderstate *@param[in]data<tt>char*</tt>:Inputpayload.UseaNULLpointertoindicatepacketloss *@param[in]len<tt>int</tt>:Numberofbytesinpayload *@param[out]pcm<tt>float*</tt>:Outputsignal(interleavedif2channels).length *isframe_size*channels*sizeof(float) *@param[in]frame_sizeNumberofsamplesperchannelofavailablespacein*pcm. *@returnsNumberofdecodedsamplesor@refopus_errorcodes
*/
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_decode_float(
OpusCustomDecoder *st, constunsignedchar *data, int len, float *pcm, int frame_size
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
/** Decode an opus custom frame *@param[in]st<tt>OpusCustomDecoder*</tt>:Decoderstate *@param[in]data<tt>char*</tt>:Inputpayload.UseaNULLpointertoindicatepacketloss *@param[in]len<tt>int</tt>:Numberofbytesinpayload *@param[out]pcm<tt>opus_int16*</tt>:Outputsignal(interleavedif2channels).length *isframe_size*channels*sizeof(opus_int16) *@param[in]frame_sizeNumberofsamplesperchannelofavailablespacein*pcm. *@returnsNumberofdecodedsamplesor@refopus_errorcodes
*/
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_decode(
OpusCustomDecoder *st, constunsignedchar *data, int len,
opus_int16 *pcm, int frame_size
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
/** Decode an opus custom frame *@param[in]st<tt>OpusCustomDecoder*</tt>:Decoderstate *@param[in]data<tt>char*</tt>:Inputpayload.UseaNULLpointertoindicatepacketloss *@param[in]len<tt>int</tt>:Numberofbytesinpayload *@param[out]pcm<tt>opus_int32*</tt>:Outputsignal(interleavedif2channels)representing(orslightlyexceeding)24-bitvalues.length *isframe_size*channels*sizeof(opus_int32) *@param[in]frame_sizeNumberofsamplesperchannelofavailablespacein*pcm. *@returnsNumberofdecodedsamplesor@refopus_errorcodes
*/
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_decode24(
OpusCustomDecoder *st, constunsignedchar *data, int len,
opus_int32 *pcm, int frame_size
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
/** Perform a CTL function on an Opus custom decoder. * *Generallytherequestandsubsequentargumentsaregenerated *byaconveniencemacro. *@seeopus_genericctls
*/
OPUS_CUSTOM_EXPORT int opus_custom_decoder_ctl(OpusCustomDecoder * OPUS_RESTRICT st, int request, ...) OPUS_ARG_NONNULL(1);
/**@}*/
#ifdef __cplusplus
} #endif
#endif/* OPUS_CUSTOM_H */
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.18 Sekunden
(vorverarbeitet am 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.