X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=o-du%2Fphy.git;a=blobdiff_plain;f=fhi_lib%2Flib%2Fapi%2Fxran_compression.h;h=fc4f7ad9ca61984aa0adb96b678e1082014755fe;hp=063bc49a80441749cbfcdf1573b600ee1e262e0c;hb=2fbf70096f64af622da983e88c5a64e90ad9bdbd;hpb=9e108bb6d4caf2f6d4e920c640882fa49c15684c diff --git a/fhi_lib/lib/api/xran_compression.h b/fhi_lib/lib/api/xran_compression.h index 063bc49..fc4f7ad 100644 --- a/fhi_lib/lib/api/xran_compression.h +++ b/fhi_lib/lib/api/xran_compression.h @@ -1,132 +1,132 @@ -/****************************************************************************** -* -* Copyright (c) 2019 Intel. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -*******************************************************************************/ - -/*! - \file xran_compression.h - \brief External API for compading with the use BFP algorithm. -*/ - -#ifndef _XRAN_COMPRESSION_H_ -#define _XRAN_COMPRESSION_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/*! - \struct xranlib_compress_request - \brief Request structure containing pointer to data and its length. -*/ -struct xranlib_compress_request { - int16_t *data_in; /*!< Pointer to data to compress. */ - int16_t numRBs; /*!< numRBs */ - int16_t compMethod; /*!< Compression method */ - int16_t iqWidth; /*!< Bit size */ - int32_t len; /*!< Length of input buffer in bytes */ -}; - -/*! - \struct xranlib_compress_response - \brief Response structure containing pointer to data and its length. -*/ -struct xranlib_compress_response { - int8_t *data_out; /*!< Pointer to data after compression. */ - - int32_t len; /*!< Length of output data. */ -}; - -/*! - \struct xranlib_decompress_request - \brief Request structure containing pointer to data and its length. -*/ -struct xranlib_decompress_request { - int8_t *data_in; /*!< Pointer to data to decompress. */ - int16_t numRBs; /*!< numRBs */ - int16_t compMethod; /*!< Compression method */ - int16_t iqWidth; /*!< Bit size */ - - int32_t len; /*!< Length of input data. */ -}; - -/*! - \struct xranlib_decompress_response - \brief Response structure containing pointer to data and its length. -*/ -struct xranlib_decompress_response { - int16_t *data_out; /*!< Pointer to data after decompression. */ - - int32_t len; /*!< Length of output data. */ -}; - -/*! - \brief Report the version number for the xranlib_companding library. - \param [in] version Pointer to a char buffer where the version string should be copied. - \param [in] buffer_size The length of the string buffer, must be at least - xranlib_SDK_VERSION_STRING_MAX_LEN characters. - \return 0 if the version string was populated, otherwise -1. -*/ -int16_t -xranlib_companding_version(char *version, int buffer_size); - -//! @{ -/*! - \brief Compress functions - it converts a 16-bit linear PCM value to 8-bt A-law. - \param [in] request Structure containing the input data and data length. - \param [out] response Structure containing the output data and data length. - \return 0 for success, -1 for error -*/ -int -xranlib_compress(const struct xranlib_compress_request *request, - struct xranlib_compress_response *response); - -int xranlib_compress_sse(const struct xranlib_compress_request *request, - struct xranlib_compress_response *response); -int xranlib_compress_avx2(const struct xranlib_compress_request *request, - struct xranlib_compress_response *response); -int xranlib_compress_avx512(const struct xranlib_compress_request *request, - struct xranlib_compress_response *response); -int xranlib_compress_avx512_bfw(const struct xranlib_compress_request *request, - struct xranlib_compress_response *response); -//! @} - -//! @{ -/*! - \brief Decompress function - it converts an A-law value to 16-bit linear PCM. - \param [in] request Structure containing the input data and data length. - \param [out] response Structure containing the output data and data length. - \return 0 for success, -1 for error. -**/ -int -xranlib_decompress(const struct xranlib_decompress_request *request, - struct xranlib_decompress_response *response); - -int xranlib_decompress_sse(const struct xranlib_decompress_request *request, - struct xranlib_decompress_response *response); -int xranlib_decompress_avx2(const struct xranlib_decompress_request *request, - struct xranlib_decompress_response *response); -int xranlib_decompress_avx512(const struct xranlib_decompress_request *request, - struct xranlib_decompress_response *response); -//! @} - -#ifdef __cplusplus -} -#endif - -#endif /* _XRAN_COMPRESSION_H_ */ +/****************************************************************************** +* +* Copyright (c) 2019 Intel. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +*******************************************************************************/ + +/*! + \file xran_compression.h + \brief External API for compading with the use BFP algorithm. +*/ + +#ifndef _XRAN_COMPRESSION_H_ +#define _XRAN_COMPRESSION_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + \struct xranlib_compress_request + \brief Request structure containing pointer to data and its length. +*/ +struct xranlib_compress_request { + int16_t *data_in; /*!< Pointer to data to compress. */ + int16_t numRBs; /*!< numRBs */ + int16_t compMethod; /*!< Compression method */ + int16_t iqWidth; /*!< Bit size */ + int32_t len; /*!< Length of input buffer in bytes */ +}; + +/*! + \struct xranlib_compress_response + \brief Response structure containing pointer to data and its length. +*/ +struct xranlib_compress_response { + int8_t *data_out; /*!< Pointer to data after compression. */ + + int32_t len; /*!< Length of output data. */ +}; + +/*! + \struct xranlib_decompress_request + \brief Request structure containing pointer to data and its length. +*/ +struct xranlib_decompress_request { + int8_t *data_in; /*!< Pointer to data to decompress. */ + int16_t numRBs; /*!< numRBs */ + int16_t compMethod; /*!< Compression method */ + int16_t iqWidth; /*!< Bit size */ + + int32_t len; /*!< Length of input data. */ +}; + +/*! + \struct xranlib_decompress_response + \brief Response structure containing pointer to data and its length. +*/ +struct xranlib_decompress_response { + int16_t *data_out; /*!< Pointer to data after decompression. */ + + int32_t len; /*!< Length of output data. */ +}; + +/*! + \brief Report the version number for the xranlib_companding library. + \param [in] version Pointer to a char buffer where the version string should be copied. + \param [in] buffer_size The length of the string buffer, must be at least + xranlib_SDK_VERSION_STRING_MAX_LEN characters. + \return 0 if the version string was populated, otherwise -1. +*/ +int16_t +xranlib_companding_version(char *version, int buffer_size); + +//! @{ +/*! + \brief Compress functions - it converts a 16-bit linear PCM value to 8-bt A-law. + \param [in] request Structure containing the input data and data length. + \param [out] response Structure containing the output data and data length. + \return 0 for success, -1 for error +*/ +int +xranlib_compress(const struct xranlib_compress_request *request, + struct xranlib_compress_response *response); + +int xranlib_compress_sse(const struct xranlib_compress_request *request, + struct xranlib_compress_response *response); +int xranlib_compress_avx2(const struct xranlib_compress_request *request, + struct xranlib_compress_response *response); +int xranlib_compress_avx512(const struct xranlib_compress_request *request, + struct xranlib_compress_response *response); +int xranlib_compress_avx512_bfw(const struct xranlib_compress_request *request, + struct xranlib_compress_response *response); +//! @} + +//! @{ +/*! + \brief Decompress function - it converts an A-law value to 16-bit linear PCM. + \param [in] request Structure containing the input data and data length. + \param [out] response Structure containing the output data and data length. + \return 0 for success, -1 for error. +**/ +int +xranlib_decompress(const struct xranlib_decompress_request *request, + struct xranlib_decompress_response *response); + +int xranlib_decompress_sse(const struct xranlib_decompress_request *request, + struct xranlib_decompress_response *response); +int xranlib_decompress_avx2(const struct xranlib_decompress_request *request, + struct xranlib_decompress_response *response); +int xranlib_decompress_avx512(const struct xranlib_decompress_request *request, + struct xranlib_decompress_response *response); +//! @} + +#ifdef __cplusplus +} +#endif + +#endif /* _XRAN_COMPRESSION_H_ */