repo
stringlengths
1
152
file
stringlengths
15
205
code
stringlengths
0
41.6M
file_length
int64
0
41.6M
avg_line_length
float64
0
1.81M
max_line_length
int64
0
12.7M
extension_type
stringclasses
90 values
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/code/ndn-dash/libdash/libav/include/libavcodec/vda.h
/* * VDA HW acceleration * * copyright (c) 2011 Sebastien Zwickert * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef AVCODEC_VDA_H #define AVCODEC_VDA_H /** * @file * @ingroup lavc_codec_hwaccel_vda * Public libavcodec VDA header. */ #include "libavcodec/version.h" #if FF_API_VDA_ASYNC #include <pthread.h> #endif #include <stdint.h> // emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes // http://openradar.appspot.com/8026390 #undef __GNUC_STDC_INLINE__ #define Picture QuickdrawPicture #include <VideoDecodeAcceleration/VDADecoder.h> #undef Picture /** * @defgroup lavc_codec_hwaccel_vda VDA * @ingroup lavc_codec_hwaccel * * @{ */ #if FF_API_VDA_ASYNC /** * This structure is used to store decoded frame information and data. * * @deprecated Use synchronous decoding mode. */ typedef struct { /** * The PTS of the frame. * * - encoding: unused * - decoding: Set/Unset by libavcodec. */ int64_t pts; /** * The CoreVideo buffer that contains the decoded data. * * - encoding: unused * - decoding: Set/Unset by libavcodec. */ CVPixelBufferRef cv_buffer; /** * A pointer to the next frame. * * - encoding: unused * - decoding: Set/Unset by libavcodec. */ struct vda_frame *next_frame; } vda_frame; #endif /** * This structure is used to provide the necessary configurations and data * to the VDA FFmpeg HWAccel implementation. * * The application must make it available as AVCodecContext.hwaccel_context. */ struct vda_context { /** * VDA decoder object. * * - encoding: unused * - decoding: Set/Unset by libavcodec. */ VDADecoder decoder; /** * The Core Video pixel buffer that contains the current image data. * * encoding: unused * decoding: Set by libavcodec. Unset by user. */ CVPixelBufferRef cv_buffer; /** * Use the hardware decoder in synchronous mode. * * encoding: unused * decoding: Set by user. */ int use_sync_decoding; #if FF_API_VDA_ASYNC /** * VDA frames queue ordered by presentation timestamp. * * @deprecated Use synchronous decoding mode. * * - encoding: unused * - decoding: Set/Unset by libavcodec. */ vda_frame *queue; /** * Mutex for locking queue operations. * * @deprecated Use synchronous decoding mode. * * - encoding: unused * - decoding: Set/Unset by libavcodec. */ pthread_mutex_t queue_mutex; #endif /** * The frame width. * * - encoding: unused * - decoding: Set/Unset by user. */ int width; /** * The frame height. * * - encoding: unused * - decoding: Set/Unset by user. */ int height; /** * The frame format. * * - encoding: unused * - decoding: Set/Unset by user. */ int format; /** * The pixel format for output image buffers. * * - encoding: unused * - decoding: Set/Unset by user. */ OSType cv_pix_fmt_type; /** * The current bitstream buffer. * * - encoding: unused * - decoding: Set/Unset by libavcodec. */ uint8_t *priv_bitstream; /** * The current size of the bitstream. * * - encoding: unused * - decoding: Set/Unset by libavcodec. */ int priv_bitstream_size; /** * The reference size used for fast reallocation. * * - encoding: unused * - decoding: Set/Unset by libavcodec. */ int priv_allocated_size; }; /** Create the video decoder. */ int ff_vda_create_decoder(struct vda_context *vda_ctx, uint8_t *extradata, int extradata_size); /** Destroy the video decoder. */ int ff_vda_destroy_decoder(struct vda_context *vda_ctx); #if FF_API_VDA_ASYNC /** * Return the top frame of the queue. * * @deprecated Use synchronous decoding mode. */ vda_frame *ff_vda_queue_pop(struct vda_context *vda_ctx); /** * Release the given frame. * * @deprecated Use synchronous decoding mode. */ void ff_vda_release_vda_frame(vda_frame *frame); #endif /** * @} */ #endif /* AVCODEC_VDA_H */
5,154
21.709251
79
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/code/ndn-dash/libdash/libav/include/libavcodec/avcodec.h
/* * copyright (c) 2001 Fabrice Bellard * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef AVCODEC_AVCODEC_H #define AVCODEC_AVCODEC_H /** * @file * external API header */ #include <errno.h> #include "libavutil/samplefmt.h" #include "libavutil/avutil.h" #include "libavutil/cpu.h" #include "libavutil/dict.h" #include "libavutil/log.h" #include "libavutil/pixfmt.h" #include "libavutil/rational.h" #include "libavutil/audioconvert.h" #include "libavcodec/version.h" /** * @defgroup libavc Encoding/Decoding Library * @{ * * @defgroup lavc_decoding Decoding * @{ * @} * * @defgroup lavc_encoding Encoding * @{ * @} * * @defgroup lavc_codec Codecs * @{ * @defgroup lavc_codec_native Native Codecs * @{ * @} * @defgroup lavc_codec_wrappers External library wrappers * @{ * @} * @defgroup lavc_codec_hwaccel Hardware Accelerators bridge * @{ * @} * @} * @defgroup lavc_internal Internal * @{ * @} * @} * */ /** * @defgroup lavc_core Core functions/structures. * @ingroup libavc * * Basic definitions, functions for querying libavcodec capabilities, * allocating core structures, etc. * @{ */ /** * Identify the syntax and semantics of the bitstream. * The principle is roughly: * Two decoders with the same ID can decode the same streams. * Two encoders with the same ID can encode compatible streams. * There may be slight deviations from the principle due to implementation * details. * * If you add a codec ID to this list, add it so that * 1. no value of a existing codec ID changes (that would break ABI), * 2. Give it a value which when taken as ASCII is recognized uniquely by a human as this specific codec. * This ensures that 2 forks can independently add AVCodecIDs without producing conflicts. * * After adding new codec IDs, do not forget to add an entry to the codec * descriptor list and bump libavcodec minor version. */ enum AVCodecID { AV_CODEC_ID_NONE, /* video codecs */ AV_CODEC_ID_MPEG1VIDEO, AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding AV_CODEC_ID_MPEG2VIDEO_XVMC, AV_CODEC_ID_H261, AV_CODEC_ID_H263, AV_CODEC_ID_RV10, AV_CODEC_ID_RV20, AV_CODEC_ID_MJPEG, AV_CODEC_ID_MJPEGB, AV_CODEC_ID_LJPEG, AV_CODEC_ID_SP5X, AV_CODEC_ID_JPEGLS, AV_CODEC_ID_MPEG4, AV_CODEC_ID_RAWVIDEO, AV_CODEC_ID_MSMPEG4V1, AV_CODEC_ID_MSMPEG4V2, AV_CODEC_ID_MSMPEG4V3, AV_CODEC_ID_WMV1, AV_CODEC_ID_WMV2, AV_CODEC_ID_H263P, AV_CODEC_ID_H263I, AV_CODEC_ID_FLV1, AV_CODEC_ID_SVQ1, AV_CODEC_ID_SVQ3, AV_CODEC_ID_DVVIDEO, AV_CODEC_ID_HUFFYUV, AV_CODEC_ID_CYUV, AV_CODEC_ID_H264, AV_CODEC_ID_INDEO3, AV_CODEC_ID_VP3, AV_CODEC_ID_THEORA, AV_CODEC_ID_ASV1, AV_CODEC_ID_ASV2, AV_CODEC_ID_FFV1, AV_CODEC_ID_4XM, AV_CODEC_ID_VCR1, AV_CODEC_ID_CLJR, AV_CODEC_ID_MDEC, AV_CODEC_ID_ROQ, AV_CODEC_ID_INTERPLAY_VIDEO, AV_CODEC_ID_XAN_WC3, AV_CODEC_ID_XAN_WC4, AV_CODEC_ID_RPZA, AV_CODEC_ID_CINEPAK, AV_CODEC_ID_WS_VQA, AV_CODEC_ID_MSRLE, AV_CODEC_ID_MSVIDEO1, AV_CODEC_ID_IDCIN, AV_CODEC_ID_8BPS, AV_CODEC_ID_SMC, AV_CODEC_ID_FLIC, AV_CODEC_ID_TRUEMOTION1, AV_CODEC_ID_VMDVIDEO, AV_CODEC_ID_MSZH, AV_CODEC_ID_ZLIB, AV_CODEC_ID_QTRLE, AV_CODEC_ID_SNOW, AV_CODEC_ID_TSCC, AV_CODEC_ID_ULTI, AV_CODEC_ID_QDRAW, AV_CODEC_ID_VIXL, AV_CODEC_ID_QPEG, AV_CODEC_ID_PNG, AV_CODEC_ID_PPM, AV_CODEC_ID_PBM, AV_CODEC_ID_PGM, AV_CODEC_ID_PGMYUV, AV_CODEC_ID_PAM, AV_CODEC_ID_FFVHUFF, AV_CODEC_ID_RV30, AV_CODEC_ID_RV40, AV_CODEC_ID_VC1, AV_CODEC_ID_WMV3, AV_CODEC_ID_LOCO, AV_CODEC_ID_WNV1, AV_CODEC_ID_AASC, AV_CODEC_ID_INDEO2, AV_CODEC_ID_FRAPS, AV_CODEC_ID_TRUEMOTION2, AV_CODEC_ID_BMP, AV_CODEC_ID_CSCD, AV_CODEC_ID_MMVIDEO, AV_CODEC_ID_ZMBV, AV_CODEC_ID_AVS, AV_CODEC_ID_SMACKVIDEO, AV_CODEC_ID_NUV, AV_CODEC_ID_KMVC, AV_CODEC_ID_FLASHSV, AV_CODEC_ID_CAVS, AV_CODEC_ID_JPEG2000, AV_CODEC_ID_VMNC, AV_CODEC_ID_VP5, AV_CODEC_ID_VP6, AV_CODEC_ID_VP6F, AV_CODEC_ID_TARGA, AV_CODEC_ID_DSICINVIDEO, AV_CODEC_ID_TIERTEXSEQVIDEO, AV_CODEC_ID_TIFF, AV_CODEC_ID_GIF, AV_CODEC_ID_DXA, AV_CODEC_ID_DNXHD, AV_CODEC_ID_THP, AV_CODEC_ID_SGI, AV_CODEC_ID_C93, AV_CODEC_ID_BETHSOFTVID, AV_CODEC_ID_PTX, AV_CODEC_ID_TXD, AV_CODEC_ID_VP6A, AV_CODEC_ID_AMV, AV_CODEC_ID_VB, AV_CODEC_ID_PCX, AV_CODEC_ID_SUNRAST, AV_CODEC_ID_INDEO4, AV_CODEC_ID_INDEO5, AV_CODEC_ID_MIMIC, AV_CODEC_ID_RL2, AV_CODEC_ID_ESCAPE124, AV_CODEC_ID_DIRAC, AV_CODEC_ID_BFI, AV_CODEC_ID_CMV, AV_CODEC_ID_MOTIONPIXELS, AV_CODEC_ID_TGV, AV_CODEC_ID_TGQ, AV_CODEC_ID_TQI, AV_CODEC_ID_AURA, AV_CODEC_ID_AURA2, AV_CODEC_ID_V210X, AV_CODEC_ID_TMV, AV_CODEC_ID_V210, AV_CODEC_ID_DPX, AV_CODEC_ID_MAD, AV_CODEC_ID_FRWU, AV_CODEC_ID_FLASHSV2, AV_CODEC_ID_CDGRAPHICS, AV_CODEC_ID_R210, AV_CODEC_ID_ANM, AV_CODEC_ID_BINKVIDEO, AV_CODEC_ID_IFF_ILBM, AV_CODEC_ID_IFF_BYTERUN1, AV_CODEC_ID_KGV1, AV_CODEC_ID_YOP, AV_CODEC_ID_VP8, AV_CODEC_ID_PICTOR, AV_CODEC_ID_ANSI, AV_CODEC_ID_A64_MULTI, AV_CODEC_ID_A64_MULTI5, AV_CODEC_ID_R10K, AV_CODEC_ID_MXPEG, AV_CODEC_ID_LAGARITH, AV_CODEC_ID_PRORES, AV_CODEC_ID_JV, AV_CODEC_ID_DFA, AV_CODEC_ID_WMV3IMAGE, AV_CODEC_ID_VC1IMAGE, AV_CODEC_ID_UTVIDEO, AV_CODEC_ID_BMV_VIDEO, AV_CODEC_ID_VBLE, AV_CODEC_ID_DXTORY, AV_CODEC_ID_V410, AV_CODEC_ID_XWD, AV_CODEC_ID_CDXL, AV_CODEC_ID_XBM, AV_CODEC_ID_ZEROCODEC, AV_CODEC_ID_MSS1, AV_CODEC_ID_MSA1, AV_CODEC_ID_TSCC2, AV_CODEC_ID_MTS2, AV_CODEC_ID_CLLC, AV_CODEC_ID_MSS2, AV_CODEC_ID_Y41P = MKBETAG('Y','4','1','P'), AV_CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'), AV_CODEC_ID_EXR = MKBETAG('0','E','X','R'), AV_CODEC_ID_AVRP = MKBETAG('A','V','R','P'), AV_CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'), AV_CODEC_ID_AVUI = MKBETAG('A','V','U','I'), AV_CODEC_ID_AYUV = MKBETAG('A','Y','U','V'), AV_CODEC_ID_V308 = MKBETAG('V','3','0','8'), AV_CODEC_ID_V408 = MKBETAG('V','4','0','8'), AV_CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'), AV_CODEC_ID_SANM = MKBETAG('S','A','N','M'), AV_CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'), AV_CODEC_ID_AVRN = MKBETAG('A','V','R','n'), AV_CODEC_ID_CPIA = MKBETAG('C','P','I','A'), /* various PCM "codecs" */ AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs AV_CODEC_ID_PCM_S16LE = 0x10000, AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_U16LE, AV_CODEC_ID_PCM_U16BE, AV_CODEC_ID_PCM_S8, AV_CODEC_ID_PCM_U8, AV_CODEC_ID_PCM_MULAW, AV_CODEC_ID_PCM_ALAW, AV_CODEC_ID_PCM_S32LE, AV_CODEC_ID_PCM_S32BE, AV_CODEC_ID_PCM_U32LE, AV_CODEC_ID_PCM_U32BE, AV_CODEC_ID_PCM_S24LE, AV_CODEC_ID_PCM_S24BE, AV_CODEC_ID_PCM_U24LE, AV_CODEC_ID_PCM_U24BE, AV_CODEC_ID_PCM_S24DAUD, AV_CODEC_ID_PCM_ZORK, AV_CODEC_ID_PCM_S16LE_PLANAR, AV_CODEC_ID_PCM_DVD, AV_CODEC_ID_PCM_F32BE, AV_CODEC_ID_PCM_F32LE, AV_CODEC_ID_PCM_F64BE, AV_CODEC_ID_PCM_F64LE, AV_CODEC_ID_PCM_BLURAY, AV_CODEC_ID_PCM_LXF, AV_CODEC_ID_S302M, AV_CODEC_ID_PCM_S8_PLANAR, /* various ADPCM codecs */ AV_CODEC_ID_ADPCM_IMA_QT = 0x11000, AV_CODEC_ID_ADPCM_IMA_WAV, AV_CODEC_ID_ADPCM_IMA_DK3, AV_CODEC_ID_ADPCM_IMA_DK4, AV_CODEC_ID_ADPCM_IMA_WS, AV_CODEC_ID_ADPCM_IMA_SMJPEG, AV_CODEC_ID_ADPCM_MS, AV_CODEC_ID_ADPCM_4XM, AV_CODEC_ID_ADPCM_XA, AV_CODEC_ID_ADPCM_ADX, AV_CODEC_ID_ADPCM_EA, AV_CODEC_ID_ADPCM_G726, AV_CODEC_ID_ADPCM_CT, AV_CODEC_ID_ADPCM_SWF, AV_CODEC_ID_ADPCM_YAMAHA, AV_CODEC_ID_ADPCM_SBPRO_4, AV_CODEC_ID_ADPCM_SBPRO_3, AV_CODEC_ID_ADPCM_SBPRO_2, AV_CODEC_ID_ADPCM_THP, AV_CODEC_ID_ADPCM_IMA_AMV, AV_CODEC_ID_ADPCM_EA_R1, AV_CODEC_ID_ADPCM_EA_R3, AV_CODEC_ID_ADPCM_EA_R2, AV_CODEC_ID_ADPCM_IMA_EA_SEAD, AV_CODEC_ID_ADPCM_IMA_EA_EACS, AV_CODEC_ID_ADPCM_EA_XAS, AV_CODEC_ID_ADPCM_EA_MAXIS_XA, AV_CODEC_ID_ADPCM_IMA_ISS, AV_CODEC_ID_ADPCM_G722, AV_CODEC_ID_ADPCM_IMA_APC, AV_CODEC_ID_VIMA = MKBETAG('V','I','M','A'), /* AMR */ AV_CODEC_ID_AMR_NB = 0x12000, AV_CODEC_ID_AMR_WB, /* RealAudio codecs*/ AV_CODEC_ID_RA_144 = 0x13000, AV_CODEC_ID_RA_288, /* various DPCM codecs */ AV_CODEC_ID_ROQ_DPCM = 0x14000, AV_CODEC_ID_INTERPLAY_DPCM, AV_CODEC_ID_XAN_DPCM, AV_CODEC_ID_SOL_DPCM, /* audio codecs */ AV_CODEC_ID_MP2 = 0x15000, AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 AV_CODEC_ID_AAC, AV_CODEC_ID_AC3, AV_CODEC_ID_DTS, AV_CODEC_ID_VORBIS, AV_CODEC_ID_DVAUDIO, AV_CODEC_ID_WMAV1, AV_CODEC_ID_WMAV2, AV_CODEC_ID_MACE3, AV_CODEC_ID_MACE6, AV_CODEC_ID_VMDAUDIO, AV_CODEC_ID_FLAC, AV_CODEC_ID_MP3ADU, AV_CODEC_ID_MP3ON4, AV_CODEC_ID_SHORTEN, AV_CODEC_ID_ALAC, AV_CODEC_ID_WESTWOOD_SND1, AV_CODEC_ID_GSM, ///< as in Berlin toast format AV_CODEC_ID_QDM2, AV_CODEC_ID_COOK, AV_CODEC_ID_TRUESPEECH, AV_CODEC_ID_TTA, AV_CODEC_ID_SMACKAUDIO, AV_CODEC_ID_QCELP, AV_CODEC_ID_WAVPACK, AV_CODEC_ID_DSICINAUDIO, AV_CODEC_ID_IMC, AV_CODEC_ID_MUSEPACK7, AV_CODEC_ID_MLP, AV_CODEC_ID_GSM_MS, /* as found in WAV */ AV_CODEC_ID_ATRAC3, AV_CODEC_ID_VOXWARE, AV_CODEC_ID_APE, AV_CODEC_ID_NELLYMOSER, AV_CODEC_ID_MUSEPACK8, AV_CODEC_ID_SPEEX, AV_CODEC_ID_WMAVOICE, AV_CODEC_ID_WMAPRO, AV_CODEC_ID_WMALOSSLESS, AV_CODEC_ID_ATRAC3P, AV_CODEC_ID_EAC3, AV_CODEC_ID_SIPR, AV_CODEC_ID_MP1, AV_CODEC_ID_TWINVQ, AV_CODEC_ID_TRUEHD, AV_CODEC_ID_MP4ALS, AV_CODEC_ID_ATRAC1, AV_CODEC_ID_BINKAUDIO_RDFT, AV_CODEC_ID_BINKAUDIO_DCT, AV_CODEC_ID_AAC_LATM, AV_CODEC_ID_QDMC, AV_CODEC_ID_CELT, AV_CODEC_ID_G723_1, AV_CODEC_ID_G729, AV_CODEC_ID_8SVX_EXP, AV_CODEC_ID_8SVX_FIB, AV_CODEC_ID_BMV_AUDIO, AV_CODEC_ID_RALF, AV_CODEC_ID_IAC, AV_CODEC_ID_ILBC, AV_CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'), AV_CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'), AV_CODEC_ID_SONIC = MKBETAG('S','O','N','C'), AV_CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'), AV_CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'), AV_CODEC_ID_OPUS = MKBETAG('O','P','U','S'), /* subtitle codecs */ AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. AV_CODEC_ID_DVD_SUBTITLE = 0x17000, AV_CODEC_ID_DVB_SUBTITLE, AV_CODEC_ID_TEXT, ///< raw UTF-8 text AV_CODEC_ID_XSUB, AV_CODEC_ID_SSA, AV_CODEC_ID_MOV_TEXT, AV_CODEC_ID_HDMV_PGS_SUBTITLE, AV_CODEC_ID_DVB_TELETEXT, AV_CODEC_ID_SRT, AV_CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'), AV_CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'), AV_CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'), AV_CODEC_ID_SAMI = MKBETAG('S','A','M','I'), AV_CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'), AV_CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'), AV_CODEC_ID_SUBRIP = MKBETAG('S','R','i','p'), /* other specific kind of codecs (generally used for attachments) */ AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. AV_CODEC_ID_TTF = 0x18000, AV_CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'), AV_CODEC_ID_XBIN = MKBETAG('X','B','I','N'), AV_CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'), AV_CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it AV_CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS * stream (only used by libavformat) */ AV_CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems * stream (only used by libavformat) */ AV_CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information. #if FF_API_CODEC_ID #include "old_codec_ids.h" #endif }; #if FF_API_CODEC_ID #define CodecID AVCodecID #endif /** * This struct describes the properties of a single codec described by an * AVCodecID. * @see avcodec_get_descriptor() */ typedef struct AVCodecDescriptor { enum AVCodecID id; enum AVMediaType type; /** * Name of the codec described by this descriptor. It is non-empty and * unique for each codec descriptor. It should contain alphanumeric * characters and '_' only. */ const char *name; /** * A more descriptive name for this codec. May be NULL. */ const char *long_name; /** * Codec properties, a combination of AV_CODEC_PROP_* flags. */ int props; } AVCodecDescriptor; /** * Codec uses only intra compression. * Video codecs only. */ #define AV_CODEC_PROP_INTRA_ONLY (1 << 0) /** * Codec supports lossy compression. Audio and video codecs only. * @note a codec may support both lossy and lossless * compression modes */ #define AV_CODEC_PROP_LOSSY (1 << 1) /** * Codec supports lossless compression. Audio and video codecs only. */ #define AV_CODEC_PROP_LOSSLESS (1 << 2) #if FF_API_OLD_DECODE_AUDIO /* in bytes */ #define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio #endif /** * @ingroup lavc_decoding * Required number of additionally allocated bytes at the end of the input bitstream for decoding. * This is mainly needed because some optimized bitstream readers read * 32 or 64 bit at once and could read over the end.<br> * Note: If the first 23 bits of the additional bytes are not 0, then damaged * MPEG bitstreams could cause overread and segfault. */ #define FF_INPUT_BUFFER_PADDING_SIZE 16 /** * @ingroup lavc_encoding * minimum encoding buffer size * Used to avoid some checks during header writing. */ #define FF_MIN_BUFFER_SIZE 16384 /** * @ingroup lavc_encoding * motion estimation type. */ enum Motion_Est_ID { ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed ME_FULL, ME_LOG, ME_PHODS, ME_EPZS, ///< enhanced predictive zonal search ME_X1, ///< reserved for experiments ME_HEX, ///< hexagon based search ME_UMH, ///< uneven multi-hexagon search ME_ITER, ///< iterative search ME_TESA, ///< transformed exhaustive search algorithm }; /** * @ingroup lavc_decoding */ enum AVDiscard{ /* We leave some space between them for extensions (drop some * keyframes for intra-only or drop just some bidir frames). */ AVDISCARD_NONE =-16, ///< discard nothing AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi AVDISCARD_NONREF = 8, ///< discard all non reference AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes AVDISCARD_ALL = 48, ///< discard all }; enum AVColorPrimaries{ AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B AVCOL_PRI_UNSPECIFIED = 2, AVCOL_PRI_BT470M = 4, AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above AVCOL_PRI_FILM = 8, AVCOL_PRI_NB , ///< Not part of ABI }; enum AVColorTransferCharacteristic{ AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 AVCOL_TRC_UNSPECIFIED = 2, AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG AVCOL_TRC_SMPTE240M = 7, AVCOL_TRC_NB , ///< Not part of ABI }; enum AVColorSpace{ AVCOL_SPC_RGB = 0, AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B AVCOL_SPC_UNSPECIFIED = 2, AVCOL_SPC_FCC = 4, AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above AVCOL_SPC_SMPTE240M = 7, AVCOL_SPC_YCOCG = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 AVCOL_SPC_NB , ///< Not part of ABI }; #define AVCOL_SPC_YCGCO AVCOL_SPC_YCOCG enum AVColorRange{ AVCOL_RANGE_UNSPECIFIED = 0, AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges AVCOL_RANGE_NB , ///< Not part of ABI }; /** * X X 3 4 X X are luma samples, * 1 2 1-6 are possible chroma positions * X X 5 6 X 0 is undefined/unknown position */ enum AVChromaLocation{ AVCHROMA_LOC_UNSPECIFIED = 0, AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 AVCHROMA_LOC_TOPLEFT = 3, ///< DV AVCHROMA_LOC_TOP = 4, AVCHROMA_LOC_BOTTOMLEFT = 5, AVCHROMA_LOC_BOTTOM = 6, AVCHROMA_LOC_NB , ///< Not part of ABI }; enum AVAudioServiceType { AV_AUDIO_SERVICE_TYPE_MAIN = 0, AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, AV_AUDIO_SERVICE_TYPE_NB , ///< Not part of ABI }; /** * @ingroup lavc_encoding */ typedef struct RcOverride{ int start_frame; int end_frame; int qscale; // If this is 0 then quality_factor will be used instead. float quality_factor; } RcOverride; #define FF_MAX_B_FRAMES 16 /* encoding support These flags can be passed in AVCodecContext.flags before initialization. Note: Not everything is supported yet. */ #define CODEC_FLAG_QSCALE 0x0002 ///< Use fixed qscale. #define CODEC_FLAG_4MV 0x0004 ///< 4 MV per MB allowed / advanced prediction for H.263. #define CODEC_FLAG_QPEL 0x0010 ///< Use qpel MC. #define CODEC_FLAG_GMC 0x0020 ///< Use GMC. #define CODEC_FLAG_MV0 0x0040 ///< Always try a MB with MV=<0,0>. /** * The parent program guarantees that the input for B-frames containing * streams is not written to for at least s->max_b_frames+1 frames, if * this is not set the input will be copied. */ #define CODEC_FLAG_INPUT_PRESERVED 0x0100 #define CODEC_FLAG_PASS1 0x0200 ///< Use internal 2pass ratecontrol in first pass mode. #define CODEC_FLAG_PASS2 0x0400 ///< Use internal 2pass ratecontrol in second pass mode. #define CODEC_FLAG_GRAY 0x2000 ///< Only decode/encode grayscale. #define CODEC_FLAG_EMU_EDGE 0x4000 ///< Don't draw edges. #define CODEC_FLAG_PSNR 0x8000 ///< error[?] variables will be set during encoding. #define CODEC_FLAG_TRUNCATED 0x00010000 /** Input bitstream might be truncated at a random location instead of only at frame boundaries. */ #define CODEC_FLAG_NORMALIZE_AQP 0x00020000 ///< Normalize adaptive quantization. #define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT. #define CODEC_FLAG_LOW_DELAY 0x00080000 ///< Force low delay. #define CODEC_FLAG_GLOBAL_HEADER 0x00400000 ///< Place global headers in extradata instead of every keyframe. #define CODEC_FLAG_BITEXACT 0x00800000 ///< Use only bitexact stuff (except (I)DCT). /* Fx : Flag for h263+ extra options */ #define CODEC_FLAG_AC_PRED 0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction #define CODEC_FLAG_LOOP_FILTER 0x00000800 ///< loop filter #define CODEC_FLAG_INTERLACED_ME 0x20000000 ///< interlaced motion estimation #define CODEC_FLAG_CLOSED_GOP 0x80000000 #define CODEC_FLAG2_FAST 0x00000001 ///< Allow non spec compliant speedup tricks. #define CODEC_FLAG2_NO_OUTPUT 0x00000004 ///< Skip bitstream encoding. #define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< Place global headers at every keyframe instead of in extradata. #define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format. DEPRECATED!!!! #if FF_API_MPV_GLOBAL_OPTS #define CODEC_FLAG_CBP_RD 0x04000000 ///< Use rate distortion optimization for cbp. #define CODEC_FLAG_QP_RD 0x08000000 ///< Use rate distortion optimization for qp selectioon. #define CODEC_FLAG2_STRICT_GOP 0x00000002 ///< Strictly enforce GOP size. #define CODEC_FLAG2_SKIP_RD 0x00004000 ///< RD optimal MB level residual skipping #endif #define CODEC_FLAG2_CHUNKS 0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. #define CODEC_FLAG2_SHOW_ALL 0x00400000 ///< Show all frames before the first keyframe /* Unsupported options : * Syntax Arithmetic coding (SAC) * Reference Picture Selection * Independent Segment Decoding */ /* /Fx */ /* codec capabilities */ #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< Decoder can use draw_horiz_band callback. /** * Codec uses get_buffer() for allocating buffers and supports custom allocators. * If not set, it might not use get_buffer() at all or use operations that * assume the buffer was allocated by avcodec_default_get_buffer. */ #define CODEC_CAP_DR1 0x0002 #define CODEC_CAP_TRUNCATED 0x0008 /* Codec can export data for HW decoding (XvMC). */ #define CODEC_CAP_HWACCEL 0x0010 /** * Encoder or decoder requires flushing with NULL input at the end in order to * give the complete and correct output. * * NOTE: If this flag is not set, the codec is guaranteed to never be fed with * with NULL data. The user can still send NULL data to the public encode * or decode function, but libavcodec will not pass it along to the codec * unless this flag is set. * * Decoders: * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, * avpkt->size=0 at the end to get the delayed data until the decoder no longer * returns frames. * * Encoders: * The encoder needs to be fed with NULL data at the end of encoding until the * encoder no longer returns data. * * NOTE: For encoders implementing the AVCodec.encode2() function, setting this * flag also means that the encoder must set the pts and duration for * each output packet. If this flag is not set, the pts and duration will * be determined by libavcodec from the input frame. */ #define CODEC_CAP_DELAY 0x0020 /** * Codec can be fed a final frame with a smaller size. * This can be used to prevent truncation of the last audio samples. */ #define CODEC_CAP_SMALL_LAST_FRAME 0x0040 /** * Codec can export data for HW decoding (VDPAU). */ #define CODEC_CAP_HWACCEL_VDPAU 0x0080 /** * Codec can output multiple frames per AVPacket * Normally demuxers return one frame at a time, demuxers which do not do * are connected to a parser to split what they return into proper frames. * This flag is reserved to the very rare category of codecs which have a * bitstream that cannot be split into frames without timeconsuming * operations like full decoding. Demuxers carring such bitstreams thus * may return multiple frames in a packet. This has many disadvantages like * prohibiting stream copy in many cases thus it should only be considered * as a last resort. */ #define CODEC_CAP_SUBFRAMES 0x0100 /** * Codec is experimental and is thus avoided in favor of non experimental * encoders */ #define CODEC_CAP_EXPERIMENTAL 0x0200 /** * Codec should fill in channel configuration and samplerate instead of container */ #define CODEC_CAP_CHANNEL_CONF 0x0400 /** * Codec is able to deal with negative linesizes */ #define CODEC_CAP_NEG_LINESIZES 0x0800 /** * Codec supports frame-level multithreading. */ #define CODEC_CAP_FRAME_THREADS 0x1000 /** * Codec supports slice-based (or partition-based) multithreading. */ #define CODEC_CAP_SLICE_THREADS 0x2000 /** * Codec supports changed parameters at any point. */ #define CODEC_CAP_PARAM_CHANGE 0x4000 /** * Codec supports avctx->thread_count == 0 (auto). */ #define CODEC_CAP_AUTO_THREADS 0x8000 /** * Audio encoder supports receiving a different number of samples in each call. */ #define CODEC_CAP_VARIABLE_FRAME_SIZE 0x10000 /** * Codec is intra only. */ #define CODEC_CAP_INTRA_ONLY 0x40000000 /** * Codec is lossless. */ #define CODEC_CAP_LOSSLESS 0x80000000 //The following defines may change, don't expect compatibility if you use them. #define MB_TYPE_INTRA4x4 0x0001 #define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific #define MB_TYPE_INTRA_PCM 0x0004 //FIXME H.264-specific #define MB_TYPE_16x16 0x0008 #define MB_TYPE_16x8 0x0010 #define MB_TYPE_8x16 0x0020 #define MB_TYPE_8x8 0x0040 #define MB_TYPE_INTERLACED 0x0080 #define MB_TYPE_DIRECT2 0x0100 //FIXME #define MB_TYPE_ACPRED 0x0200 #define MB_TYPE_GMC 0x0400 #define MB_TYPE_SKIP 0x0800 #define MB_TYPE_P0L0 0x1000 #define MB_TYPE_P1L0 0x2000 #define MB_TYPE_P0L1 0x4000 #define MB_TYPE_P1L1 0x8000 #define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0) #define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1) #define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1) #define MB_TYPE_QUANT 0x00010000 #define MB_TYPE_CBP 0x00020000 //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) /** * Pan Scan area. * This specifies the area which should be displayed. * Note there may be multiple such areas for one frame. */ typedef struct AVPanScan{ /** * id * - encoding: Set by user. * - decoding: Set by libavcodec. */ int id; /** * width and height in 1/16 pel * - encoding: Set by user. * - decoding: Set by libavcodec. */ int width; int height; /** * position of the top left corner in 1/16 pel for up to 3 fields/frames * - encoding: Set by user. * - decoding: Set by libavcodec. */ int16_t position[3][2]; }AVPanScan; #define FF_QSCALE_TYPE_MPEG1 0 #define FF_QSCALE_TYPE_MPEG2 1 #define FF_QSCALE_TYPE_H264 2 #define FF_QSCALE_TYPE_VP56 3 #define FF_BUFFER_TYPE_INTERNAL 1 #define FF_BUFFER_TYPE_USER 2 ///< direct rendering buffers (image is (de)allocated by user) #define FF_BUFFER_TYPE_SHARED 4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared. #define FF_BUFFER_TYPE_COPY 8 ///< Just a (modified) copy of some other buffer, don't deallocate anything. #define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore). #define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer. #define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content. #define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update). /** * @defgroup lavc_packet AVPacket * * Types and functions for working with AVPacket. * @{ */ enum AVPacketSideDataType { AV_PKT_DATA_PALETTE, AV_PKT_DATA_NEW_EXTRADATA, /** * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: * @code * u32le param_flags * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) * s32le channel_count * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) * u64le channel_layout * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) * s32le sample_rate * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) * s32le width * s32le height * @endcode */ AV_PKT_DATA_PARAM_CHANGE, /** * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of * structures with info about macroblocks relevant to splitting the * packet into smaller packets on macroblock edges (e.g. as for RFC 2190). * That is, it does not necessarily contain info about all macroblocks, * as long as the distance between macroblocks in the info is smaller * than the target payload size. * Each MB info structure is 12 bytes, and is laid out as follows: * @code * u32le bit offset from the start of the packet * u8 current quantizer at the start of the macroblock * u8 GOB number * u16le macroblock address within the GOB * u8 horizontal MV predictor * u8 vertical MV predictor * u8 horizontal MV predictor for block number 3 * u8 vertical MV predictor for block number 3 * @endcode */ AV_PKT_DATA_H263_MB_INFO, /** * Recommmends skipping the specified number of samples * @code * u32le number of samples to skip from start of this packet * u32le number of samples to skip from end of this packet * u8 reason for start skip * u8 reason for end skip (0=padding silence, 1=convergence) * @endcode */ AV_PKT_DATA_SKIP_SAMPLES=70, }; typedef struct AVPacket { /** * Presentation timestamp in AVStream->time_base units; the time at which * the decompressed packet will be presented to the user. * Can be AV_NOPTS_VALUE if it is not stored in the file. * pts MUST be larger or equal to dts as presentation cannot happen before * decompression, unless one wants to view hex dumps. Some formats misuse * the terms dts and pts/cts to mean something different. Such timestamps * must be converted to true pts/dts before they are stored in AVPacket. */ int64_t pts; /** * Decompression timestamp in AVStream->time_base units; the time at which * the packet is decompressed. * Can be AV_NOPTS_VALUE if it is not stored in the file. */ int64_t dts; uint8_t *data; int size; int stream_index; /** * A combination of AV_PKT_FLAG values */ int flags; /** * Additional packet data that can be provided by the container. * Packet can contain several types of side information. */ struct { uint8_t *data; int size; enum AVPacketSideDataType type; } *side_data; int side_data_elems; /** * Duration of this packet in AVStream->time_base units, 0 if unknown. * Equals next_pts - this_pts in presentation order. */ int duration; void (*destruct)(struct AVPacket *); void *priv; int64_t pos; ///< byte position in stream, -1 if unknown /** * Time difference in AVStream->time_base units from the pts of this * packet to the point at which the output from the decoder has converged * independent from the availability of previous frames. That is, the * frames are virtually identical no matter if decoding started from * the very first frame or from this keyframe. * Is AV_NOPTS_VALUE if unknown. * This field is not the display duration of the current packet. * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY * set. * * The purpose of this field is to allow seeking in streams that have no * keyframes in the conventional sense. It corresponds to the * recovery point SEI in H.264 and match_time_delta in NUT. It is also * essential for some types of subtitle streams to ensure that all * subtitles are correctly displayed after seeking. */ int64_t convergence_duration; } AVPacket; #define AV_PKT_FLAG_KEY 0x0001 ///< The packet contains a keyframe #define AV_PKT_FLAG_CORRUPT 0x0002 ///< The packet content is corrupted enum AVSideDataParamChangeFlags { AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001, AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002, AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004, AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008, }; /** * @} */ /** * Audio Video Frame. * New fields can be added to the end of AVFRAME with minor version * bumps. Similarly fields that are marked as to be only accessed by * av_opt_ptr() can be reordered. This allows 2 forks to add fields * without breaking compatibility with each other. * Removal, reordering and changes in the remaining cases require * a major version bump. * sizeof(AVFrame) must not be used outside libavcodec. */ typedef struct AVFrame { #define AV_NUM_DATA_POINTERS 8 /** * pointer to the picture/channel planes. * This might be different from the first allocated byte * - encoding: Set by user * - decoding: set by AVCodecContext.get_buffer() */ uint8_t *data[AV_NUM_DATA_POINTERS]; /** * Size, in bytes, of the data for each picture/channel plane. * * For audio, only linesize[0] may be set. For planar audio, each channel * plane must be the same size. * * - encoding: Set by user * - decoding: set by AVCodecContext.get_buffer() */ int linesize[AV_NUM_DATA_POINTERS]; /** * pointers to the data planes/channels. * * For video, this should simply point to data[]. * * For planar audio, each channel has a separate data pointer, and * linesize[0] contains the size of each channel buffer. * For packed audio, there is just one data pointer, and linesize[0] * contains the total size of the buffer for all channels. * * Note: Both data and extended_data will always be set by get_buffer(), * but for planar audio with more channels that can fit in data, * extended_data must be used by the decoder in order to access all * channels. * * encoding: unused * decoding: set by AVCodecContext.get_buffer() */ uint8_t **extended_data; /** * width and height of the video frame * - encoding: unused * - decoding: Read by user. */ int width, height; /** * number of audio samples (per channel) described by this frame * - encoding: Set by user * - decoding: Set by libavcodec */ int nb_samples; /** * format of the frame, -1 if unknown or unset * Values correspond to enum PixelFormat for video frames, * enum AVSampleFormat for audio) * - encoding: unused * - decoding: Read by user. */ int format; /** * 1 -> keyframe, 0-> not * - encoding: Set by libavcodec. * - decoding: Set by libavcodec. */ int key_frame; /** * Picture type of the frame, see ?_TYPE below. * - encoding: Set by libavcodec. for coded_picture (and set by user for input). * - decoding: Set by libavcodec. */ enum AVPictureType pict_type; /** * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. * This isn't used by libavcodec unless the default get/release_buffer() is used. * - encoding: * - decoding: */ uint8_t *base[AV_NUM_DATA_POINTERS]; /** * sample aspect ratio for the video frame, 0/1 if unknown/unspecified * - encoding: unused * - decoding: Read by user. */ AVRational sample_aspect_ratio; /** * presentation timestamp in time_base units (time when frame should be shown to user) * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. * - encoding: MUST be set by user. * - decoding: Set by libavcodec. */ int64_t pts; /** * reordered pts from the last AVPacket that has been input into the decoder * - encoding: unused * - decoding: Read by user. */ int64_t pkt_pts; /** * dts from the last AVPacket that has been input into the decoder * - encoding: unused * - decoding: Read by user. */ int64_t pkt_dts; /** * picture number in bitstream order * - encoding: set by * - decoding: Set by libavcodec. */ int coded_picture_number; /** * picture number in display order * - encoding: set by * - decoding: Set by libavcodec. */ int display_picture_number; /** * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) * - encoding: Set by libavcodec. for coded_picture (and set by user for input). * - decoding: Set by libavcodec. */ int quality; /** * is this picture used as reference * The values for this are the same as the MpegEncContext.picture_structure * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. * Set to 4 for delayed, non-reference frames. * - encoding: unused * - decoding: Set by libavcodec. (before get_buffer() call)). */ int reference; /** * QP table * - encoding: unused * - decoding: Set by libavcodec. */ int8_t *qscale_table; /** * QP store stride * - encoding: unused * - decoding: Set by libavcodec. */ int qstride; /** * */ int qscale_type; /** * mbskip_table[mb]>=1 if MB didn't change * stride= mb_width = (width+15)>>4 * - encoding: unused * - decoding: Set by libavcodec. */ uint8_t *mbskip_table; /** * motion vector table * @code * example: * int mv_sample_log2= 4 - motion_subsample_log2; * int mb_width= (width+15)>>4; * int mv_stride= (mb_width << mv_sample_log2) + 1; * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; * @endcode * - encoding: Set by user. * - decoding: Set by libavcodec. */ int16_t (*motion_val[2])[2]; /** * macroblock type table * mb_type_base + mb_width + 2 * - encoding: Set by user. * - decoding: Set by libavcodec. */ uint32_t *mb_type; /** * DCT coefficients * - encoding: unused * - decoding: Set by libavcodec. */ short *dct_coeff; /** * motion reference frame index * the order in which these are stored can depend on the codec. * - encoding: Set by user. * - decoding: Set by libavcodec. */ int8_t *ref_index[2]; /** * for some private data of the user * - encoding: unused * - decoding: Set by user. */ void *opaque; /** * error * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. * - decoding: unused */ uint64_t error[AV_NUM_DATA_POINTERS]; /** * type of the buffer (to keep track of who has to deallocate data[*]) * - encoding: Set by the one who allocates it. * - decoding: Set by the one who allocates it. * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. */ int type; /** * When decoding, this signals how much the picture must be delayed. * extra_delay = repeat_pict / (2*fps) * - encoding: unused * - decoding: Set by libavcodec. */ int repeat_pict; /** * The content of the picture is interlaced. * - encoding: Set by user. * - decoding: Set by libavcodec. (default 0) */ int interlaced_frame; /** * If the content is interlaced, is top field displayed first. * - encoding: Set by user. * - decoding: Set by libavcodec. */ int top_field_first; /** * Tell user application that palette has changed from previous frame. * - encoding: ??? (no palette-enabled encoder yet) * - decoding: Set by libavcodec. (default 0). */ int palette_has_changed; /** * codec suggestion on buffer type if != 0 * - encoding: unused * - decoding: Set by libavcodec. (before get_buffer() call)). */ int buffer_hints; /** * Pan scan. * - encoding: Set by user. * - decoding: Set by libavcodec. */ AVPanScan *pan_scan; /** * reordered opaque 64bit (generally an integer or a double precision float * PTS but can be anything). * The user sets AVCodecContext.reordered_opaque to represent the input at * that time, * the decoder reorders values as needed and sets AVFrame.reordered_opaque * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque * @deprecated in favor of pkt_pts * - encoding: unused * - decoding: Read by user. */ int64_t reordered_opaque; /** * hardware accelerator private data (FFmpeg-allocated) * - encoding: unused * - decoding: Set by libavcodec */ void *hwaccel_picture_private; /** * the AVCodecContext which ff_thread_get_buffer() was last called on * - encoding: Set by libavcodec. * - decoding: Set by libavcodec. */ struct AVCodecContext *owner; /** * used by multithreading to store frame-specific info * - encoding: Set by libavcodec. * - decoding: Set by libavcodec. */ void *thread_opaque; /** * log2 of the size of the block which a single vector in motion_val represents: * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) * - encoding: unused * - decoding: Set by libavcodec. */ uint8_t motion_subsample_log2; /** * Sample rate of the audio data. * * - encoding: unused * - decoding: read by user */ int sample_rate; /** * Channel layout of the audio data. * * - encoding: unused * - decoding: read by user. */ uint64_t channel_layout; /** * frame timestamp estimated using various heuristics, in stream time base * Code outside libavcodec should access this field using: * av_frame_get_best_effort_timestamp(frame) * - encoding: unused * - decoding: set by libavcodec, read by user. */ int64_t best_effort_timestamp; /** * reordered pos from the last AVPacket that has been input into the decoder * Code outside libavcodec should access this field using: * av_frame_get_pkt_pos(frame) * - encoding: unused * - decoding: Read by user. */ int64_t pkt_pos; /** * duration of the corresponding packet, expressed in * AVStream->time_base units, 0 if unknown. * Code outside libavcodec should access this field using: * av_frame_get_pkt_duration(frame) * - encoding: unused * - decoding: Read by user. */ int64_t pkt_duration; /** * metadata. * Code outside libavcodec should access this field using: * av_frame_get_metadata(frame) * - encoding: Set by user. * - decoding: Set by libavcodec. */ AVDictionary *metadata; /** * decode error flags of the frame, set to a combination of * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there * were errors during the decoding. * Code outside libavcodec should access this field using: * av_frame_get_decode_error_flags(frame) * - encoding: unused * - decoding: set by libavcodec, read by user. */ int decode_error_flags; #define FF_DECODE_ERROR_INVALID_BITSTREAM 1 #define FF_DECODE_ERROR_MISSING_REFERENCE 2 /** * number of audio channels, only used for audio. * Code outside libavcodec should access this field using: * av_frame_get_channels(frame) * - encoding: unused * - decoding: Read by user. */ int64_t channels; } AVFrame; /** * Accessors for some AVFrame fields. * The position of these field in the structure is not part of the ABI, * they should not be accessed directly outside libavcodec. */ int64_t av_frame_get_best_effort_timestamp(const AVFrame *frame); void av_frame_set_best_effort_timestamp(AVFrame *frame, int64_t val); int64_t av_frame_get_pkt_duration (const AVFrame *frame); void av_frame_set_pkt_duration (AVFrame *frame, int64_t val); int64_t av_frame_get_pkt_pos (const AVFrame *frame); void av_frame_set_pkt_pos (AVFrame *frame, int64_t val); int64_t av_frame_get_channel_layout (const AVFrame *frame); void av_frame_set_channel_layout (AVFrame *frame, int64_t val); int av_frame_get_channels (const AVFrame *frame); void av_frame_set_channels (AVFrame *frame, int val); int av_frame_get_sample_rate (const AVFrame *frame); void av_frame_set_sample_rate (AVFrame *frame, int val); AVDictionary *av_frame_get_metadata (const AVFrame *frame); void av_frame_set_metadata (AVFrame *frame, AVDictionary *val); int av_frame_get_decode_error_flags (const AVFrame *frame); void av_frame_set_decode_error_flags (AVFrame *frame, int val); struct AVCodecInternal; enum AVFieldOrder { AV_FIELD_UNKNOWN, AV_FIELD_PROGRESSIVE, AV_FIELD_TT, //< Top coded_first, top displayed first AV_FIELD_BB, //< Bottom coded first, bottom displayed first AV_FIELD_TB, //< Top coded first, bottom displayed first AV_FIELD_BT, //< Bottom coded first, top displayed first }; /** * main external API structure. * New fields can be added to the end with minor version bumps. * Removal, reordering and changes to existing fields require a major * version bump. * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user * applications. * sizeof(AVCodecContext) must not be used outside libav*. */ typedef struct AVCodecContext { /** * information on struct for av_log * - set by avcodec_alloc_context3 */ const AVClass *av_class; int log_level_offset; enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */ const struct AVCodec *codec; char codec_name[32]; enum AVCodecID codec_id; /* see AV_CODEC_ID_xxx */ /** * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). * This is used to work around some encoder bugs. * A demuxer should set this to what is stored in the field used to identify the codec. * If there are multiple such fields in a container then the demuxer should choose the one * which maximizes the information about the used codec. * If the codec tag field in a container is larger than 32 bits then the demuxer should * remap the longer ID to 32 bits with a table or other structure. Alternatively a new * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated * first. * - encoding: Set by user, if not then the default based on codec_id will be used. * - decoding: Set by user, will be converted to uppercase by libavcodec during init. */ unsigned int codec_tag; /** * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). * This is used to work around some encoder bugs. * - encoding: unused * - decoding: Set by user, will be converted to uppercase by libavcodec during init. */ unsigned int stream_codec_tag; #if FF_API_SUB_ID /** * @deprecated this field is unused */ attribute_deprecated int sub_id; #endif void *priv_data; /** * Private context used for internal data. * * Unlike priv_data, this is not codec-specific. It is used in general * libavcodec functions. */ struct AVCodecInternal *internal; /** * Private data of the user, can be used to carry app specific stuff. * - encoding: Set by user. * - decoding: Set by user. */ void *opaque; /** * the average bitrate * - encoding: Set by user; unused for constant quantizer encoding. * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. */ int bit_rate; /** * number of bits the bitstream is allowed to diverge from the reference. * the reference can be CBR (for CBR pass1) or VBR (for pass2) * - encoding: Set by user; unused for constant quantizer encoding. * - decoding: unused */ int bit_rate_tolerance; /** * Global quality for codecs which cannot change it per frame. * This should be proportional to MPEG-1/2/4 qscale. * - encoding: Set by user. * - decoding: unused */ int global_quality; /** * - encoding: Set by user. * - decoding: unused */ int compression_level; #define FF_COMPRESSION_DEFAULT -1 /** * CODEC_FLAG_*. * - encoding: Set by user. * - decoding: Set by user. */ int flags; /** * CODEC_FLAG2_* * - encoding: Set by user. * - decoding: Set by user. */ int flags2; /** * some codecs need / can use extradata like Huffman tables. * mjpeg: Huffman tables * rv10: additional flags * mpeg4: global headers (they can be in the bitstream or here) * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger * than extradata_size to avoid prolems if it is read with the bitstream reader. * The bytewise contents of extradata must not depend on the architecture or CPU endianness. * - encoding: Set/allocated/freed by libavcodec. * - decoding: Set/allocated/freed by user. */ uint8_t *extradata; int extradata_size; /** * This is the fundamental unit of time (in seconds) in terms * of which frame timestamps are represented. For fixed-fps content, * timebase should be 1/framerate and timestamp increments should be * identically 1. * - encoding: MUST be set by user. * - decoding: Set by libavcodec. */ AVRational time_base; /** * For some codecs, the time base is closer to the field rate than the frame rate. * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration * if no telecine is used ... * * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. */ int ticks_per_frame; /** * Encoding: Number of frames delay there will be from the encoder input to * the decoder output. (we assume the decoder matches the spec) * Decoding: Number of frames delay in addition to what a standard decoder * as specified in the spec would produce. * * Video: * Number of frames the decoded output will be delayed relative to the * encoded input. * * Audio: * Number of "priming" samples added to the beginning of the stream * during encoding. The decoded output will be delayed by this many * samples relative to the input to the encoder. Note that this field is * purely informational and does not directly affect the pts output by * the encoder, which should always be based on the actual presentation * time, including any delay. * * - encoding: Set by libavcodec. * - decoding: Set by libavcodec. */ int delay; /* video only */ /** * picture width / height. * - encoding: MUST be set by user. * - decoding: Set by libavcodec. * Note: For compatibility it is possible to set this instead of * coded_width/height before decoding. */ int width, height; /** * Bitstream width / height, may be different from width/height if lowres enabled. * - encoding: unused * - decoding: Set by user before init if known. Codec should override / dynamically change if needed. */ int coded_width, coded_height; #define FF_ASPECT_EXTENDED 15 /** * the number of pictures in a group of pictures, or 0 for intra_only * - encoding: Set by user. * - decoding: unused */ int gop_size; /** * Pixel format, see PIX_FMT_xxx. * May be set by the demuxer if known from headers. * May be overridden by the decoder if it knows better. * - encoding: Set by user. * - decoding: Set by user if known, overridden by libavcodec if known */ enum PixelFormat pix_fmt; /** * Motion estimation algorithm used for video coding. * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex), * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific] * - encoding: MUST be set by user. * - decoding: unused */ int me_method; /** * If non NULL, 'draw_horiz_band' is called by the libavcodec * decoder to draw a horizontal band. It improves cache usage. Not * all codecs can do that. You must check the codec capabilities * beforehand. * When multithreading is used, it may be called from multiple threads * at the same time; threads might draw different parts of the same AVFrame, * or multiple AVFrames, and there is no guarantee that slices will be drawn * in order. * The function is also used by hardware acceleration APIs. * It is called at least once during frame decoding to pass * the data needed for hardware render. * In that mode instead of pixel data, AVFrame points to * a structure specific to the acceleration API. The application * reads the structure and can change some fields to indicate progress * or mark state. * - encoding: unused * - decoding: Set by user. * @param height the height of the slice * @param y the y position of the slice * @param type 1->top field, 2->bottom field, 3->frame * @param offset offset into the AVFrame.data from which the slice should be read */ void (*draw_horiz_band)(struct AVCodecContext *s, const AVFrame *src, int offset[AV_NUM_DATA_POINTERS], int y, int type, int height); /** * callback to negotiate the pixelFormat * @param fmt is the list of formats which are supported by the codec, * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. * The first is always the native one. * @return the chosen format * - encoding: unused * - decoding: Set by user, if not set the native format will be chosen. */ enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt); /** * maximum number of B-frames between non-B-frames * Note: The output will be delayed by max_b_frames+1 relative to the input. * - encoding: Set by user. * - decoding: unused */ int max_b_frames; /** * qscale factor between IP and B-frames * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). * - encoding: Set by user. * - decoding: unused */ float b_quant_factor; /** obsolete FIXME remove */ int rc_strategy; #define FF_RC_STRATEGY_XVID 1 int b_frame_strategy; #if FF_API_MPV_GLOBAL_OPTS /** * luma single coefficient elimination threshold * - encoding: Set by user. * - decoding: unused */ attribute_deprecated int luma_elim_threshold; /** * chroma single coeff elimination threshold * - encoding: Set by user. * - decoding: unused */ attribute_deprecated int chroma_elim_threshold; #endif /** * qscale offset between IP and B-frames * - encoding: Set by user. * - decoding: unused */ float b_quant_offset; /** * Size of the frame reordering buffer in the decoder. * For MPEG-2 it is 1 IPB or 0 low delay IP. * - encoding: Set by libavcodec. * - decoding: Set by libavcodec. */ int has_b_frames; /** * 0-> h263 quant 1-> mpeg quant * - encoding: Set by user. * - decoding: unused */ int mpeg_quant; /** * qscale factor between P and I-frames * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). * - encoding: Set by user. * - decoding: unused */ float i_quant_factor; /** * qscale offset between P and I-frames * - encoding: Set by user. * - decoding: unused */ float i_quant_offset; /** * luminance masking (0-> disabled) * - encoding: Set by user. * - decoding: unused */ float lumi_masking; /** * temporary complexity masking (0-> disabled) * - encoding: Set by user. * - decoding: unused */ float temporal_cplx_masking; /** * spatial complexity masking (0-> disabled) * - encoding: Set by user. * - decoding: unused */ float spatial_cplx_masking; /** * p block masking (0-> disabled) * - encoding: Set by user. * - decoding: unused */ float p_masking; /** * darkness masking (0-> disabled) * - encoding: Set by user. * - decoding: unused */ float dark_masking; /** * slice count * - encoding: Set by libavcodec. * - decoding: Set by user (or 0). */ int slice_count; /** * prediction method (needed for huffyuv) * - encoding: Set by user. * - decoding: unused */ int prediction_method; #define FF_PRED_LEFT 0 #define FF_PRED_PLANE 1 #define FF_PRED_MEDIAN 2 /** * slice offsets in the frame in bytes * - encoding: Set/allocated by libavcodec. * - decoding: Set/allocated by user (or NULL). */ int *slice_offset; /** * sample aspect ratio (0 if unknown) * That is the width of a pixel divided by the height of the pixel. * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. * - encoding: Set by user. * - decoding: Set by libavcodec. */ AVRational sample_aspect_ratio; /** * motion estimation comparison function * - encoding: Set by user. * - decoding: unused */ int me_cmp; /** * subpixel motion estimation comparison function * - encoding: Set by user. * - decoding: unused */ int me_sub_cmp; /** * macroblock comparison function (not supported yet) * - encoding: Set by user. * - decoding: unused */ int mb_cmp; /** * interlaced DCT comparison function * - encoding: Set by user. * - decoding: unused */ int ildct_cmp; #define FF_CMP_SAD 0 #define FF_CMP_SSE 1 #define FF_CMP_SATD 2 #define FF_CMP_DCT 3 #define FF_CMP_PSNR 4 #define FF_CMP_BIT 5 #define FF_CMP_RD 6 #define FF_CMP_ZERO 7 #define FF_CMP_VSAD 8 #define FF_CMP_VSSE 9 #define FF_CMP_NSSE 10 #define FF_CMP_W53 11 #define FF_CMP_W97 12 #define FF_CMP_DCTMAX 13 #define FF_CMP_DCT264 14 #define FF_CMP_CHROMA 256 /** * ME diamond size & shape * - encoding: Set by user. * - decoding: unused */ int dia_size; /** * amount of previous MV predictors (2a+1 x 2a+1 square) * - encoding: Set by user. * - decoding: unused */ int last_predictor_count; /** * prepass for motion estimation * - encoding: Set by user. * - decoding: unused */ int pre_me; /** * motion estimation prepass comparison function * - encoding: Set by user. * - decoding: unused */ int me_pre_cmp; /** * ME prepass diamond size & shape * - encoding: Set by user. * - decoding: unused */ int pre_dia_size; /** * subpel ME quality * - encoding: Set by user. * - decoding: unused */ int me_subpel_quality; /** * DTG active format information (additional aspect ratio * information only used in DVB MPEG-2 transport streams) * 0 if not set. * * - encoding: unused * - decoding: Set by decoder. */ int dtg_active_format; #define FF_DTG_AFD_SAME 8 #define FF_DTG_AFD_4_3 9 #define FF_DTG_AFD_16_9 10 #define FF_DTG_AFD_14_9 11 #define FF_DTG_AFD_4_3_SP_14_9 13 #define FF_DTG_AFD_16_9_SP_14_9 14 #define FF_DTG_AFD_SP_4_3 15 /** * maximum motion estimation search range in subpel units * If 0 then no limit. * * - encoding: Set by user. * - decoding: unused */ int me_range; /** * intra quantizer bias * - encoding: Set by user. * - decoding: unused */ int intra_quant_bias; #define FF_DEFAULT_QUANT_BIAS 999999 /** * inter quantizer bias * - encoding: Set by user. * - decoding: unused */ int inter_quant_bias; #if FF_API_COLOR_TABLE_ID /** * color table ID * - encoding: unused * - decoding: Which clrtable should be used for 8bit RGB images. * Tables have to be stored somewhere. FIXME */ attribute_deprecated int color_table_id; #endif /** * slice flags * - encoding: unused * - decoding: Set by user. */ int slice_flags; #define SLICE_FLAG_CODED_ORDER 0x0001 ///< draw_horiz_band() is called in coded order instead of display #define SLICE_FLAG_ALLOW_FIELD 0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics) #define SLICE_FLAG_ALLOW_PLANE 0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1) /** * XVideo Motion Acceleration * - encoding: forbidden * - decoding: set by decoder */ int xvmc_acceleration; /** * macroblock decision mode * - encoding: Set by user. * - decoding: unused */ int mb_decision; #define FF_MB_DECISION_SIMPLE 0 ///< uses mb_cmp #define FF_MB_DECISION_BITS 1 ///< chooses the one which needs the fewest bits #define FF_MB_DECISION_RD 2 ///< rate distortion /** * custom intra quantization matrix * - encoding: Set by user, can be NULL. * - decoding: Set by libavcodec. */ uint16_t *intra_matrix; /** * custom inter quantization matrix * - encoding: Set by user, can be NULL. * - decoding: Set by libavcodec. */ uint16_t *inter_matrix; /** * scene change detection threshold * 0 is default, larger means fewer detected scene changes. * - encoding: Set by user. * - decoding: unused */ int scenechange_threshold; /** * noise reduction strength * - encoding: Set by user. * - decoding: unused */ int noise_reduction; #if FF_API_INTER_THRESHOLD /** * @deprecated this field is unused */ attribute_deprecated int inter_threshold; #endif #if FF_API_MPV_GLOBAL_OPTS /** * @deprecated use mpegvideo private options instead */ attribute_deprecated int quantizer_noise_shaping; #endif /** * Motion estimation threshold below which no motion estimation is * performed, but instead the user specified motion vectors are used. * * - encoding: Set by user. * - decoding: unused */ int me_threshold; /** * Macroblock threshold below which the user specified macroblock types will be used. * - encoding: Set by user. * - decoding: unused */ int mb_threshold; /** * precision of the intra DC coefficient - 8 * - encoding: Set by user. * - decoding: unused */ int intra_dc_precision; /** * Number of macroblock rows at the top which are skipped. * - encoding: unused * - decoding: Set by user. */ int skip_top; /** * Number of macroblock rows at the bottom which are skipped. * - encoding: unused * - decoding: Set by user. */ int skip_bottom; /** * Border processing masking, raises the quantizer for mbs on the borders * of the picture. * - encoding: Set by user. * - decoding: unused */ float border_masking; /** * minimum MB lagrange multipler * - encoding: Set by user. * - decoding: unused */ int mb_lmin; /** * maximum MB lagrange multipler * - encoding: Set by user. * - decoding: unused */ int mb_lmax; /** * * - encoding: Set by user. * - decoding: unused */ int me_penalty_compensation; /** * * - encoding: Set by user. * - decoding: unused */ int bidir_refine; /** * * - encoding: Set by user. * - decoding: unused */ int brd_scale; /** * minimum GOP size * - encoding: Set by user. * - decoding: unused */ int keyint_min; /** * number of reference frames * - encoding: Set by user. * - decoding: Set by lavc. */ int refs; /** * chroma qp offset from luma * - encoding: Set by user. * - decoding: unused */ int chromaoffset; /** * Multiplied by qscale for each frame and added to scene_change_score. * - encoding: Set by user. * - decoding: unused */ int scenechange_factor; /** * * Note: Value depends upon the compare function used for fullpel ME. * - encoding: Set by user. * - decoding: unused */ int mv0_threshold; /** * Adjust sensitivity of b_frame_strategy 1. * - encoding: Set by user. * - decoding: unused */ int b_sensitivity; /** * Chromaticity coordinates of the source primaries. * - encoding: Set by user * - decoding: Set by libavcodec */ enum AVColorPrimaries color_primaries; /** * Color Transfer Characteristic. * - encoding: Set by user * - decoding: Set by libavcodec */ enum AVColorTransferCharacteristic color_trc; /** * YUV colorspace type. * - encoding: Set by user * - decoding: Set by libavcodec */ enum AVColorSpace colorspace; /** * MPEG vs JPEG YUV range. * - encoding: Set by user * - decoding: Set by libavcodec */ enum AVColorRange color_range; /** * This defines the location of chroma samples. * - encoding: Set by user * - decoding: Set by libavcodec */ enum AVChromaLocation chroma_sample_location; /** * Number of slices. * Indicates number of picture subdivisions. Used for parallelized * decoding. * - encoding: Set by user * - decoding: unused */ int slices; /** Field order * - encoding: set by libavcodec * - decoding: Set by libavcodec */ enum AVFieldOrder field_order; /* audio only */ int sample_rate; ///< samples per second int channels; ///< number of audio channels /** * audio sample format * - encoding: Set by user. * - decoding: Set by libavcodec. */ enum AVSampleFormat sample_fmt; ///< sample format /* The following data should not be initialized. */ /** * Samples per packet, initialized when calling 'init'. */ int frame_size; /** * Frame counter, set by libavcodec. * * - decoding: total number of frames returned from the decoder so far. * - encoding: total number of frames passed to the encoder so far. * * @note the counter is not incremented if encoding/decoding resulted in * an error. */ int frame_number; /** * number of bytes per packet if constant and known or 0 * Used by some WAV based audio codecs. */ int block_align; /** * Audio cutoff bandwidth (0 means "automatic") * - encoding: Set by user. * - decoding: unused */ int cutoff; #if FF_API_REQUEST_CHANNELS /** * Decoder should decode to this many channels if it can (0 for default) * - encoding: unused * - decoding: Set by user. * @deprecated Deprecated in favor of request_channel_layout. */ int request_channels; #endif /** * Audio channel layout. * - encoding: set by user. * - decoding: set by user, may be overwritten by libavcodec. */ uint64_t channel_layout; /** * Request decoder to use this channel layout if it can (0 for default) * - encoding: unused * - decoding: Set by user. */ uint64_t request_channel_layout; /** * Type of service that the audio stream conveys. * - encoding: Set by user. * - decoding: Set by libavcodec. */ enum AVAudioServiceType audio_service_type; /** * desired sample format * - encoding: Not used. * - decoding: Set by user. * Decoder will decode to this format if it can. */ enum AVSampleFormat request_sample_fmt; /** * Called at the beginning of each frame to get a buffer for it. * * The function will set AVFrame.data[], AVFrame.linesize[]. * AVFrame.extended_data[] must also be set, but it should be the same as * AVFrame.data[] except for planar audio with more channels than can fit * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as * many data pointers as it can hold. * * if CODEC_CAP_DR1 is not set then get_buffer() must call * avcodec_default_get_buffer() instead of providing buffers allocated by * some other means. * * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't * need it. avcodec_default_get_buffer() aligns the output buffer properly, * but if get_buffer() is overridden then alignment considerations should * be taken into account. * * @see avcodec_default_get_buffer() * * Video: * * If pic.reference is set then the frame will be read later by libavcodec. * avcodec_align_dimensions2() should be used to find the required width and * height, as they normally need to be rounded up to the next multiple of 16. * * If frame multithreading is used and thread_safe_callbacks is set, * it may be called from a different thread, but not from more than one at * once. Does not need to be reentrant. * * @see release_buffer(), reget_buffer() * @see avcodec_align_dimensions2() * * Audio: * * Decoders request a buffer of a particular size by setting * AVFrame.nb_samples prior to calling get_buffer(). The decoder may, * however, utilize only part of the buffer by setting AVFrame.nb_samples * to a smaller value in the output frame. * * Decoders cannot use the buffer after returning from * avcodec_decode_audio4(), so they will not call release_buffer(), as it * is assumed to be released immediately upon return. * * As a convenience, av_samples_get_buffer_size() and * av_samples_fill_arrays() in libavutil may be used by custom get_buffer() * functions to find the required data size and to fill data pointers and * linesize. In AVFrame.linesize, only linesize[0] may be set for audio * since all planes must be the same size. * * @see av_samples_get_buffer_size(), av_samples_fill_arrays() * * - encoding: unused * - decoding: Set by libavcodec, user can override. */ int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic); /** * Called to release buffers which were allocated with get_buffer. * A released buffer can be reused in get_buffer(). * pic.data[*] must be set to NULL. * May be called from a different thread if frame multithreading is used, * but not by more than one thread at once, so does not need to be reentrant. * - encoding: unused * - decoding: Set by libavcodec, user can override. */ void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic); /** * Called at the beginning of a frame to get cr buffer for it. * Buffer type (size, hints) must be the same. libavcodec won't check it. * libavcodec will pass previous buffer in pic, function should return * same buffer or new buffer with old frame "painted" into it. * If pic.data[0] == NULL must behave like get_buffer(). * if CODEC_CAP_DR1 is not set then reget_buffer() must call * avcodec_default_reget_buffer() instead of providing buffers allocated by * some other means. * - encoding: unused * - decoding: Set by libavcodec, user can override. */ int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic); /* - encoding parameters */ float qcompress; ///< amount of qscale change between easy & hard scenes (0.0-1.0) float qblur; ///< amount of qscale smoothing over time (0.0-1.0) /** * minimum quantizer * - encoding: Set by user. * - decoding: unused */ int qmin; /** * maximum quantizer * - encoding: Set by user. * - decoding: unused */ int qmax; /** * maximum quantizer difference between frames * - encoding: Set by user. * - decoding: unused */ int max_qdiff; /** * ratecontrol qmin qmax limiting method * 0-> clipping, 1-> use a nice continuous function to limit qscale wthin qmin/qmax. * - encoding: Set by user. * - decoding: unused */ float rc_qsquish; float rc_qmod_amp; int rc_qmod_freq; /** * decoder bitstream buffer size * - encoding: Set by user. * - decoding: unused */ int rc_buffer_size; /** * ratecontrol override, see RcOverride * - encoding: Allocated/set/freed by user. * - decoding: unused */ int rc_override_count; RcOverride *rc_override; /** * rate control equation * - encoding: Set by user * - decoding: unused */ const char *rc_eq; /** * maximum bitrate * - encoding: Set by user. * - decoding: unused */ int rc_max_rate; /** * minimum bitrate * - encoding: Set by user. * - decoding: unused */ int rc_min_rate; float rc_buffer_aggressivity; /** * initial complexity for pass1 ratecontrol * - encoding: Set by user. * - decoding: unused */ float rc_initial_cplx; /** * Ratecontrol attempt to use, at maximum, <value> of what can be used without an underflow. * - encoding: Set by user. * - decoding: unused. */ float rc_max_available_vbv_use; /** * Ratecontrol attempt to use, at least, <value> times the amount needed to prevent a vbv overflow. * - encoding: Set by user. * - decoding: unused. */ float rc_min_vbv_overflow_use; /** * Number of bits which should be loaded into the rc buffer before decoding starts. * - encoding: Set by user. * - decoding: unused */ int rc_initial_buffer_occupancy; #define FF_CODER_TYPE_VLC 0 #define FF_CODER_TYPE_AC 1 #define FF_CODER_TYPE_RAW 2 #define FF_CODER_TYPE_RLE 3 #define FF_CODER_TYPE_DEFLATE 4 /** * coder type * - encoding: Set by user. * - decoding: unused */ int coder_type; /** * context model * - encoding: Set by user. * - decoding: unused */ int context_model; /** * minimum Lagrange multipler * - encoding: Set by user. * - decoding: unused */ int lmin; /** * maximum Lagrange multipler * - encoding: Set by user. * - decoding: unused */ int lmax; /** * frame skip threshold * - encoding: Set by user. * - decoding: unused */ int frame_skip_threshold; /** * frame skip factor * - encoding: Set by user. * - decoding: unused */ int frame_skip_factor; /** * frame skip exponent * - encoding: Set by user. * - decoding: unused */ int frame_skip_exp; /** * frame skip comparison function * - encoding: Set by user. * - decoding: unused */ int frame_skip_cmp; /** * trellis RD quantization * - encoding: Set by user. * - decoding: unused */ int trellis; /** * - encoding: Set by user. * - decoding: unused */ int min_prediction_order; /** * - encoding: Set by user. * - decoding: unused */ int max_prediction_order; /** * GOP timecode frame start number * - encoding: Set by user, in non drop frame format * - decoding: Set by libavcodec (timecode in the 25 bits format, -1 if unset) */ int64_t timecode_frame_start; /* The RTP callback: This function is called */ /* every time the encoder has a packet to send. */ /* It depends on the encoder if the data starts */ /* with a Start Code (it should). H.263 does. */ /* mb_nb contains the number of macroblocks */ /* encoded in the RTP payload. */ void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb); int rtp_payload_size; /* The size of the RTP payload: the coder will */ /* do its best to deliver a chunk with size */ /* below rtp_payload_size, the chunk will start */ /* with a start code on some codecs like H.263. */ /* This doesn't take account of any particular */ /* headers inside the transmitted RTP payload. */ /* statistics, used for 2-pass encoding */ int mv_bits; int header_bits; int i_tex_bits; int p_tex_bits; int i_count; int p_count; int skip_count; int misc_bits; /** * number of bits used for the previously encoded frame * - encoding: Set by libavcodec. * - decoding: unused */ int frame_bits; /** * pass1 encoding statistics output buffer * - encoding: Set by libavcodec. * - decoding: unused */ char *stats_out; /** * pass2 encoding statistics input buffer * Concatenated stuff from stats_out of pass1 should be placed here. * - encoding: Allocated/set/freed by user. * - decoding: unused */ char *stats_in; /** * Work around bugs in encoders which sometimes cannot be detected automatically. * - encoding: Set by user * - decoding: Set by user */ int workaround_bugs; #define FF_BUG_AUTODETECT 1 ///< autodetection #define FF_BUG_OLD_MSMPEG4 2 #define FF_BUG_XVID_ILACE 4 #define FF_BUG_UMP4 8 #define FF_BUG_NO_PADDING 16 #define FF_BUG_AMV 32 #define FF_BUG_AC_VLC 0 ///< Will be removed, libavcodec can now handle these non-compliant files by default. #define FF_BUG_QPEL_CHROMA 64 #define FF_BUG_STD_QPEL 128 #define FF_BUG_QPEL_CHROMA2 256 #define FF_BUG_DIRECT_BLOCKSIZE 512 #define FF_BUG_EDGE 1024 #define FF_BUG_HPEL_CHROMA 2048 #define FF_BUG_DC_CLIP 4096 #define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft's broken decoders. #define FF_BUG_TRUNCATED 16384 /** * strictly follow the standard (MPEG4, ...). * - encoding: Set by user. * - decoding: Set by user. * Setting this to STRICT or higher means the encoder and decoder will * generally do stupid things, whereas setting it to unofficial or lower * will mean the encoder might produce output that is not supported by all * spec-compliant decoders. Decoders don't differentiate between normal, * unofficial and experimental (that is, they always try to decode things * when they can) unless they are explicitly asked to behave stupidly * (=strictly conform to the specs) */ int strict_std_compliance; #define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to an older more strict version of the spec or reference software. #define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences. #define FF_COMPLIANCE_NORMAL 0 #define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions #define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things. /** * error concealment flags * - encoding: unused * - decoding: Set by user. */ int error_concealment; #define FF_EC_GUESS_MVS 1 #define FF_EC_DEBLOCK 2 /** * debug * - encoding: Set by user. * - decoding: Set by user. */ int debug; #define FF_DEBUG_PICT_INFO 1 #define FF_DEBUG_RC 2 #define FF_DEBUG_BITSTREAM 4 #define FF_DEBUG_MB_TYPE 8 #define FF_DEBUG_QP 16 #define FF_DEBUG_MV 32 #define FF_DEBUG_DCT_COEFF 0x00000040 #define FF_DEBUG_SKIP 0x00000080 #define FF_DEBUG_STARTCODE 0x00000100 #define FF_DEBUG_PTS 0x00000200 #define FF_DEBUG_ER 0x00000400 #define FF_DEBUG_MMCO 0x00000800 #define FF_DEBUG_BUGS 0x00001000 #define FF_DEBUG_VIS_QP 0x00002000 #define FF_DEBUG_VIS_MB_TYPE 0x00004000 #define FF_DEBUG_BUFFERS 0x00008000 #define FF_DEBUG_THREADS 0x00010000 /** * debug * - encoding: Set by user. * - decoding: Set by user. */ int debug_mv; #define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames #define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames /** * Error recognition; may misdetect some more or less valid parts as errors. * - encoding: unused * - decoding: Set by user. */ int err_recognition; #define AV_EF_CRCCHECK (1<<0) #define AV_EF_BITSTREAM (1<<1) #define AV_EF_BUFFER (1<<2) #define AV_EF_EXPLODE (1<<3) #define AV_EF_CAREFUL (1<<16) #define AV_EF_COMPLIANT (1<<17) #define AV_EF_AGGRESSIVE (1<<18) /** * opaque 64bit number (generally a PTS) that will be reordered and * output in AVFrame.reordered_opaque * @deprecated in favor of pkt_pts * - encoding: unused * - decoding: Set by user. */ int64_t reordered_opaque; /** * Hardware accelerator in use * - encoding: unused. * - decoding: Set by libavcodec */ struct AVHWAccel *hwaccel; /** * Hardware accelerator context. * For some hardware accelerators, a global context needs to be * provided by the user. In that case, this holds display-dependent * data FFmpeg cannot instantiate itself. Please refer to the * FFmpeg HW accelerator documentation to know how to fill this * is. e.g. for VA API, this is a struct vaapi_context. * - encoding: unused * - decoding: Set by user */ void *hwaccel_context; /** * error * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR. * - decoding: unused */ uint64_t error[AV_NUM_DATA_POINTERS]; /** * DCT algorithm, see FF_DCT_* below * - encoding: Set by user. * - decoding: unused */ int dct_algo; #define FF_DCT_AUTO 0 #define FF_DCT_FASTINT 1 #define FF_DCT_INT 2 #define FF_DCT_MMX 3 #define FF_DCT_ALTIVEC 5 #define FF_DCT_FAAN 6 /** * IDCT algorithm, see FF_IDCT_* below. * - encoding: Set by user. * - decoding: Set by user. */ int idct_algo; #define FF_IDCT_AUTO 0 #define FF_IDCT_INT 1 #define FF_IDCT_SIMPLE 2 #define FF_IDCT_SIMPLEMMX 3 #define FF_IDCT_LIBMPEG2MMX 4 #define FF_IDCT_MMI 5 #define FF_IDCT_ARM 7 #define FF_IDCT_ALTIVEC 8 #define FF_IDCT_SH4 9 #define FF_IDCT_SIMPLEARM 10 #define FF_IDCT_H264 11 #define FF_IDCT_VP3 12 #define FF_IDCT_IPP 13 #define FF_IDCT_XVIDMMX 14 #define FF_IDCT_CAVS 15 #define FF_IDCT_SIMPLEARMV5TE 16 #define FF_IDCT_SIMPLEARMV6 17 #define FF_IDCT_SIMPLEVIS 18 #define FF_IDCT_WMV2 19 #define FF_IDCT_FAAN 20 #define FF_IDCT_EA 21 #define FF_IDCT_SIMPLENEON 22 #define FF_IDCT_SIMPLEALPHA 23 #define FF_IDCT_BINK 24 #if FF_API_DSP_MASK /** * Unused. * @deprecated use av_set_cpu_flags_mask() instead. */ attribute_deprecated unsigned dsp_mask; #endif /** * bits per sample/pixel from the demuxer (needed for huffyuv). * - encoding: Set by libavcodec. * - decoding: Set by user. */ int bits_per_coded_sample; /** * Bits per sample/pixel of internal libavcodec pixel/sample format. * - encoding: set by user. * - decoding: set by libavcodec. */ int bits_per_raw_sample; /** * low resolution decoding, 1-> 1/2 size, 2->1/4 size * - encoding: unused * - decoding: Set by user. */ int lowres; /** * the picture in the bitstream * - encoding: Set by libavcodec. * - decoding: Set by libavcodec. */ AVFrame *coded_frame; /** * thread count * is used to decide how many independent tasks should be passed to execute() * - encoding: Set by user. * - decoding: Set by user. */ int thread_count; /** * Which multithreading methods to use. * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, * so clients which cannot provide future frames should not use it. * * - encoding: Set by user, otherwise the default is used. * - decoding: Set by user, otherwise the default is used. */ int thread_type; #define FF_THREAD_FRAME 1 ///< Decode more than one frame at once #define FF_THREAD_SLICE 2 ///< Decode more than one part of a single frame at once /** * Which multithreading methods are in use by the codec. * - encoding: Set by libavcodec. * - decoding: Set by libavcodec. */ int active_thread_type; /** * Set by the client if its custom get_buffer() callback can be called * synchronously from another thread, which allows faster multithreaded decoding. * draw_horiz_band() will be called from other threads regardless of this setting. * Ignored if the default get_buffer() is used. * - encoding: Set by user. * - decoding: Set by user. */ int thread_safe_callbacks; /** * The codec may call this to execute several independent things. * It will return only after finishing all tasks. * The user may replace this with some multithreaded implementation, * the default implementation will execute the parts serially. * @param count the number of things to execute * - encoding: Set by libavcodec, user can override. * - decoding: Set by libavcodec, user can override. */ int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size); /** * The codec may call this to execute several independent things. * It will return only after finishing all tasks. * The user may replace this with some multithreaded implementation, * the default implementation will execute the parts serially. * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. * @param c context passed also to func * @param count the number of things to execute * @param arg2 argument passed unchanged to func * @param ret return values of executed functions, must have space for "count" values. May be NULL. * @param func function that will be called count times, with jobnr from 0 to count-1. * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no * two instances of func executing at the same time will have the same threadnr. * @return always 0 currently, but code should handle a future improvement where when any call to func * returns < 0 no further calls to func may be done and < 0 is returned. * - encoding: Set by libavcodec, user can override. * - decoding: Set by libavcodec, user can override. */ int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count); /** * thread opaque * Can be used by execute() to store some per AVCodecContext stuff. * - encoding: set by execute() * - decoding: set by execute() */ void *thread_opaque; /** * noise vs. sse weight for the nsse comparsion function * - encoding: Set by user. * - decoding: unused */ int nsse_weight; /** * profile * - encoding: Set by user. * - decoding: Set by libavcodec. */ int profile; #define FF_PROFILE_UNKNOWN -99 #define FF_PROFILE_RESERVED -100 #define FF_PROFILE_AAC_MAIN 0 #define FF_PROFILE_AAC_LOW 1 #define FF_PROFILE_AAC_SSR 2 #define FF_PROFILE_AAC_LTP 3 #define FF_PROFILE_AAC_HE 4 #define FF_PROFILE_AAC_HE_V2 28 #define FF_PROFILE_AAC_LD 22 #define FF_PROFILE_AAC_ELD 38 #define FF_PROFILE_DTS 20 #define FF_PROFILE_DTS_ES 30 #define FF_PROFILE_DTS_96_24 40 #define FF_PROFILE_DTS_HD_HRA 50 #define FF_PROFILE_DTS_HD_MA 60 #define FF_PROFILE_MPEG2_422 0 #define FF_PROFILE_MPEG2_HIGH 1 #define FF_PROFILE_MPEG2_SS 2 #define FF_PROFILE_MPEG2_SNR_SCALABLE 3 #define FF_PROFILE_MPEG2_MAIN 4 #define FF_PROFILE_MPEG2_SIMPLE 5 #define FF_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag #define FF_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag #define FF_PROFILE_H264_BASELINE 66 #define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED) #define FF_PROFILE_H264_MAIN 77 #define FF_PROFILE_H264_EXTENDED 88 #define FF_PROFILE_H264_HIGH 100 #define FF_PROFILE_H264_HIGH_10 110 #define FF_PROFILE_H264_HIGH_10_INTRA (110|FF_PROFILE_H264_INTRA) #define FF_PROFILE_H264_HIGH_422 122 #define FF_PROFILE_H264_HIGH_422_INTRA (122|FF_PROFILE_H264_INTRA) #define FF_PROFILE_H264_HIGH_444 144 #define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244 #define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA) #define FF_PROFILE_H264_CAVLC_444 44 #define FF_PROFILE_VC1_SIMPLE 0 #define FF_PROFILE_VC1_MAIN 1 #define FF_PROFILE_VC1_COMPLEX 2 #define FF_PROFILE_VC1_ADVANCED 3 #define FF_PROFILE_MPEG4_SIMPLE 0 #define FF_PROFILE_MPEG4_SIMPLE_SCALABLE 1 #define FF_PROFILE_MPEG4_CORE 2 #define FF_PROFILE_MPEG4_MAIN 3 #define FF_PROFILE_MPEG4_N_BIT 4 #define FF_PROFILE_MPEG4_SCALABLE_TEXTURE 5 #define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6 #define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7 #define FF_PROFILE_MPEG4_HYBRID 8 #define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME 9 #define FF_PROFILE_MPEG4_CORE_SCALABLE 10 #define FF_PROFILE_MPEG4_ADVANCED_CODING 11 #define FF_PROFILE_MPEG4_ADVANCED_CORE 12 #define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13 #define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14 #define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15 /** * level * - encoding: Set by user. * - decoding: Set by libavcodec. */ int level; #define FF_LEVEL_UNKNOWN -99 /** * * - encoding: unused * - decoding: Set by user. */ enum AVDiscard skip_loop_filter; /** * * - encoding: unused * - decoding: Set by user. */ enum AVDiscard skip_idct; /** * * - encoding: unused * - decoding: Set by user. */ enum AVDiscard skip_frame; /** * Header containing style information for text subtitles. * For SUBTITLE_ASS subtitle type, it should contain the whole ASS * [Script Info] and [V4+ Styles] section, plus the [Events] line and * the Format line following. It shouldn't include any Dialogue line. * - encoding: Set/allocated/freed by user (before avcodec_open2()) * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) */ uint8_t *subtitle_header; int subtitle_header_size; /** * Simulates errors in the bitstream to test error concealment. * - encoding: Set by user. * - decoding: unused */ int error_rate; /** * Current packet as passed into the decoder, to avoid having * to pass the packet into every function. Currently only valid * inside lavc and get/release_buffer callbacks. * - decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts * - encoding: unused */ AVPacket *pkt; /** * VBV delay coded in the last frame (in periods of a 27 MHz clock). * Used for compliant TS muxing. * - encoding: Set by libavcodec. * - decoding: unused. */ uint64_t vbv_delay; /** * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. * Code outside libavcodec should access this field using: * avcodec_set_pkt_timebase(avctx) * - encoding unused. * - decodimg set by user */ AVRational pkt_timebase; /** * AVCodecDescriptor * Code outside libavcodec should access this field using: * avcodec_get_codec_descriptior(avctx) * - encoding: unused. * - decoding: set by libavcodec. */ const AVCodecDescriptor *codec_descriptor; /** * Current statistics for PTS correction. * - decoding: maintained and used by libavcodec, not intended to be used by user apps * - encoding: unused */ int64_t pts_correction_num_faulty_pts; /// Number of incorrect PTS values so far int64_t pts_correction_num_faulty_dts; /// Number of incorrect DTS values so far int64_t pts_correction_last_pts; /// PTS of the last frame int64_t pts_correction_last_dts; /// DTS of the last frame } AVCodecContext; AVRational av_codec_get_pkt_timebase (const AVCodecContext *avctx); void av_codec_set_pkt_timebase (AVCodecContext *avctx, AVRational val); const AVCodecDescriptor *av_codec_get_codec_descriptor(const AVCodecContext *avctx); void av_codec_set_codec_descriptor(AVCodecContext *avctx, const AVCodecDescriptor *desc); /** * AVProfile. */ typedef struct AVProfile { int profile; const char *name; ///< short name for the profile } AVProfile; typedef struct AVCodecDefault AVCodecDefault; /** * AVCodec. */ typedef struct AVCodec { /** * Name of the codec implementation. * The name is globally unique among encoders and among decoders (but an * encoder and a decoder can share the same name). * This is the primary way to find a codec from the user perspective. */ const char *name; /** * Descriptive name for the codec, meant to be more human readable than name. * You should use the NULL_IF_CONFIG_SMALL() macro to define it. */ const char *long_name; enum AVMediaType type; enum AVCodecID id; /** * Codec capabilities. * see CODEC_CAP_* */ int capabilities; const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} const enum PixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 uint8_t max_lowres; ///< maximum value for lowres supported by the decoder const AVClass *priv_class; ///< AVClass for the private context const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} /***************************************************************** * No fields below this line are part of the public API. They * may not be used outside of libavcodec and can be changed and * removed at will. * New public fields should be added right above. ***************************************************************** */ int priv_data_size; struct AVCodec *next; /** * @name Frame-level threading support functions * @{ */ /** * If defined, called on thread contexts when they are created. * If the codec allocates writable tables in init(), re-allocate them here. * priv_data will be set to a copy of the original. */ int (*init_thread_copy)(AVCodecContext *); /** * Copy necessary context variables from a previous thread context to the current one. * If not defined, the next thread will start automatically; otherwise, the codec * must call ff_thread_finish_setup(). * * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. */ int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src); /** @} */ /** * Private codec-specific defaults. */ const AVCodecDefault *defaults; /** * Initialize codec static data, called from avcodec_register(). */ void (*init_static_data)(struct AVCodec *codec); int (*init)(AVCodecContext *); int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data); /** * Encode data to an AVPacket. * * @param avctx codec context * @param avpkt output AVPacket (may contain a user-provided buffer) * @param[in] frame AVFrame containing the raw data to be encoded * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a * non-empty packet was returned in avpkt. * @return 0 on success, negative error code on failure */ int (*encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr); int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt); int (*close)(AVCodecContext *); /** * Flush buffers. * Will be called when seeking */ void (*flush)(AVCodecContext *); } AVCodec; /** * AVHWAccel. */ typedef struct AVHWAccel { /** * Name of the hardware accelerated codec. * The name is globally unique among encoders and among decoders (but an * encoder and a decoder can share the same name). */ const char *name; /** * Type of codec implemented by the hardware accelerator. * * See AVMEDIA_TYPE_xxx */ enum AVMediaType type; /** * Codec implemented by the hardware accelerator. * * See AV_CODEC_ID_xxx */ enum AVCodecID id; /** * Supported pixel format. * * Only hardware accelerated formats are supported here. */ enum PixelFormat pix_fmt; /** * Hardware accelerated codec capabilities. * see FF_HWACCEL_CODEC_CAP_* */ int capabilities; struct AVHWAccel *next; /** * Called at the beginning of each frame or field picture. * * Meaningful frame information (codec specific) is guaranteed to * be parsed at this point. This function is mandatory. * * Note that buf can be NULL along with buf_size set to 0. * Otherwise, this means the whole frame is available at this point. * * @param avctx the codec context * @param buf the frame data buffer base * @param buf_size the size of the frame in bytes * @return zero if successful, a negative value otherwise */ int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); /** * Callback for each slice. * * Meaningful slice information (codec specific) is guaranteed to * be parsed at this point. This function is mandatory. * * @param avctx the codec context * @param buf the slice data buffer base * @param buf_size the size of the slice in bytes * @return zero if successful, a negative value otherwise */ int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); /** * Called at the end of each frame or field picture. * * The whole picture is parsed at this point and can now be sent * to the hardware accelerator. This function is mandatory. * * @param avctx the codec context * @return zero if successful, a negative value otherwise */ int (*end_frame)(AVCodecContext *avctx); /** * Size of HW accelerator private data. * * Private data is allocated with av_mallocz() before * AVCodecContext.get_buffer() and deallocated after * AVCodecContext.release_buffer(). */ int priv_data_size; } AVHWAccel; /** * @defgroup lavc_picture AVPicture * * Functions for working with AVPicture * @{ */ /** * four components are given, that's all. * the last component is alpha */ typedef struct AVPicture { uint8_t *data[AV_NUM_DATA_POINTERS]; int linesize[AV_NUM_DATA_POINTERS]; ///< number of bytes per line } AVPicture; /** * @} */ enum AVSubtitleType { SUBTITLE_NONE, SUBTITLE_BITMAP, ///< A bitmap, pict will be set /** * Plain text, the text field must be set by the decoder and is * authoritative. ass and pict fields may contain approximations. */ SUBTITLE_TEXT, /** * Formatted text, the ass field must be set by the decoder and is * authoritative. pict and text fields may contain approximations. */ SUBTITLE_ASS, }; typedef struct AVSubtitleRect { int x; ///< top left corner of pict, undefined when pict is not set int y; ///< top left corner of pict, undefined when pict is not set int w; ///< width of pict, undefined when pict is not set int h; ///< height of pict, undefined when pict is not set int nb_colors; ///< number of colors in pict, undefined when pict is not set /** * data+linesize for the bitmap of this subtitle. * can be set for text/ass as well once they where rendered */ AVPicture pict; enum AVSubtitleType type; char *text; ///< 0 terminated plain UTF-8 text /** * 0 terminated ASS/SSA compatible event line. * The presentation of this is unaffected by the other values in this * struct. */ char *ass; /** * 1 indicates this subtitle is a forced subtitle. * A forced subtitle should be displayed even when subtitles are hidden. */ int forced; } AVSubtitleRect; typedef struct AVSubtitle { uint16_t format; /* 0 = graphics */ uint32_t start_display_time; /* relative to packet pts, in ms */ uint32_t end_display_time; /* relative to packet pts, in ms */ unsigned num_rects; AVSubtitleRect **rects; int64_t pts; ///< Same as packet pts, in AV_TIME_BASE } AVSubtitle; /** * If c is NULL, returns the first registered codec, * if c is non-NULL, returns the next registered codec after c, * or NULL if c is the last one. */ AVCodec *av_codec_next(const AVCodec *c); /** * Return the LIBAVCODEC_VERSION_INT constant. */ unsigned avcodec_version(void); /** * Return the libavcodec build-time configuration. */ const char *avcodec_configuration(void); /** * Return the libavcodec license. */ const char *avcodec_license(void); /** * Register the codec codec and initialize libavcodec. * * @warning either this function or avcodec_register_all() must be called * before any other libavcodec functions. * * @see avcodec_register_all() */ void avcodec_register(AVCodec *codec); /** * Register all the codecs, parsers and bitstream filters which were enabled at * configuration time. If you do not call this function you can select exactly * which formats you want to support, by using the individual registration * functions. * * @see avcodec_register * @see av_register_codec_parser * @see av_register_bitstream_filter */ void avcodec_register_all(void); #if FF_API_ALLOC_CONTEXT /** * Allocate an AVCodecContext and set its fields to default values. The * resulting struct can be deallocated by simply calling av_free(). * * @return An AVCodecContext filled with default values or NULL on failure. * @see avcodec_get_context_defaults * * @deprecated use avcodec_alloc_context3() */ attribute_deprecated AVCodecContext *avcodec_alloc_context(void); /** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! * we WILL change its arguments and name a few times! */ attribute_deprecated AVCodecContext *avcodec_alloc_context2(enum AVMediaType); /** * Set the fields of the given AVCodecContext to default values. * * @param s The AVCodecContext of which the fields should be set to default values. * @deprecated use avcodec_get_context_defaults3 */ attribute_deprecated void avcodec_get_context_defaults(AVCodecContext *s); /** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! * we WILL change its arguments and name a few times! */ attribute_deprecated void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType); #endif /** * Allocate an AVCodecContext and set its fields to default values. The * resulting struct can be deallocated by calling avcodec_close() on it followed * by av_free(). * * @param codec if non-NULL, allocate private data and initialize defaults * for the given codec. It is illegal to then call avcodec_open2() * with a different codec. * If NULL, then the codec-specific defaults won't be initialized, * which may result in suboptimal default settings (this is * important mainly for encoders, e.g. libx264). * * @return An AVCodecContext filled with default values or NULL on failure. * @see avcodec_get_context_defaults */ AVCodecContext *avcodec_alloc_context3(const AVCodec *codec); /** * Set the fields of the given AVCodecContext to default values corresponding * to the given codec (defaults may be codec-dependent). * * Do not call this function if a non-NULL codec has been passed * to avcodec_alloc_context3() that allocated this AVCodecContext. * If codec is non-NULL, it is illegal to call avcodec_open2() with a * different codec on this AVCodecContext. */ int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec); /** * Get the AVClass for AVCodecContext. It can be used in combination with * AV_OPT_SEARCH_FAKE_OBJ for examining options. * * @see av_opt_find(). */ const AVClass *avcodec_get_class(void); /** * Get the AVClass for AVFrame. It can be used in combination with * AV_OPT_SEARCH_FAKE_OBJ for examining options. * * @see av_opt_find(). */ const AVClass *avcodec_get_frame_class(void); /** * Get the AVClass for AVSubtitleRect. It can be used in combination with * AV_OPT_SEARCH_FAKE_OBJ for examining options. * * @see av_opt_find(). */ const AVClass *avcodec_get_subtitle_rect_class(void); /** * Copy the settings of the source AVCodecContext into the destination * AVCodecContext. The resulting destination codec context will be * unopened, i.e. you are required to call avcodec_open2() before you * can use this AVCodecContext to decode/encode video/audio data. * * @param dest target codec context, should be initialized with * avcodec_alloc_context3(), but otherwise uninitialized * @param src source codec context * @return AVERROR() on error (e.g. memory allocation error), 0 on success */ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src); /** * Allocate an AVFrame and set its fields to default values. The resulting * struct can be deallocated by simply calling av_free(). * * @return An AVFrame filled with default values or NULL on failure. * @see avcodec_get_frame_defaults */ AVFrame *avcodec_alloc_frame(void); /** * Set the fields of the given AVFrame to default values. * * @param pic The AVFrame of which the fields should be set to default values. */ void avcodec_get_frame_defaults(AVFrame *pic); #if FF_API_AVCODEC_OPEN /** * Initialize the AVCodecContext to use the given AVCodec. Prior to using this * function the context has to be allocated. * * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for * retrieving a codec. * * @warning This function is not thread safe! * * @code * avcodec_register_all(); * codec = avcodec_find_decoder(AV_CODEC_ID_H264); * if (!codec) * exit(1); * * context = avcodec_alloc_context3(codec); * * if (avcodec_open(context, codec) < 0) * exit(1); * @endcode * * @param avctx The context which will be set up to use the given codec. * @param codec The codec to use within the context. * @return zero on success, a negative value on error * @see avcodec_alloc_context3, avcodec_find_decoder, avcodec_find_encoder, avcodec_close * * @deprecated use avcodec_open2 */ attribute_deprecated int avcodec_open(AVCodecContext *avctx, AVCodec *codec); #endif /** * Initialize the AVCodecContext to use the given AVCodec. Prior to using this * function the context has to be allocated with avcodec_alloc_context3(). * * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for * retrieving a codec. * * @warning This function is not thread safe! * * @code * avcodec_register_all(); * av_dict_set(&opts, "b", "2.5M", 0); * codec = avcodec_find_decoder(AV_CODEC_ID_H264); * if (!codec) * exit(1); * * context = avcodec_alloc_context3(codec); * * if (avcodec_open2(context, codec, opts) < 0) * exit(1); * @endcode * * @param avctx The context to initialize. * @param codec The codec to open this context for. If a non-NULL codec has been * previously passed to avcodec_alloc_context3() or * avcodec_get_context_defaults3() for this context, then this * parameter MUST be either NULL or equal to the previously passed * codec. * @param options A dictionary filled with AVCodecContext and codec-private options. * On return this object will be filled with options that were not found. * * @return zero on success, a negative value on error * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), * av_dict_set(), av_opt_find(). */ int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options); /** * Close a given AVCodecContext and free all the data associated with it * (but not the AVCodecContext itself). * * Calling this function on an AVCodecContext that hasn't been opened will free * the codec-specific data allocated in avcodec_alloc_context3() / * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will * do nothing. */ int avcodec_close(AVCodecContext *avctx); /** * Free all allocated data in the given subtitle struct. * * @param sub AVSubtitle to free. */ void avsubtitle_free(AVSubtitle *sub); /** * @} */ /** * @addtogroup lavc_packet * @{ */ /** * @deprecated use NULL instead */ attribute_deprecated void av_destruct_packet_nofree(AVPacket *pkt); /** * Default packet destructor. */ void av_destruct_packet(AVPacket *pkt); /** * Initialize optional fields of a packet with default values. * * Note, this does not touch the data and size members, which have to be * initialized separately. * * @param pkt packet */ void av_init_packet(AVPacket *pkt); /** * Allocate the payload of a packet and initialize its fields with * default values. * * @param pkt packet * @param size wanted payload size * @return 0 if OK, AVERROR_xxx otherwise */ int av_new_packet(AVPacket *pkt, int size); /** * Reduce packet size, correctly zeroing padding * * @param pkt packet * @param size new size */ void av_shrink_packet(AVPacket *pkt, int size); /** * Increase packet size, correctly zeroing padding * * @param pkt packet * @param grow_by number of bytes by which to increase the size of the packet */ int av_grow_packet(AVPacket *pkt, int grow_by); /** * @warning This is a hack - the packet memory allocation stuff is broken. The * packet is allocated if it was not really allocated. */ int av_dup_packet(AVPacket *pkt); /** * Free a packet. * * @param pkt packet to free */ void av_free_packet(AVPacket *pkt); /** * Allocate new information of a packet. * * @param pkt packet * @param type side information type * @param size side information size * @return pointer to fresh allocated data or NULL otherwise */ uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size); /** * Shrink the already allocated side data buffer * * @param pkt packet * @param type side information type * @param size new side information size * @return 0 on success, < 0 on failure */ int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size); /** * Get side information from packet. * * @param pkt packet * @param type desired side information type * @param size pointer for side information size to store (optional) * @return pointer to data if present or NULL otherwise */ uint8_t* av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int *size); int av_packet_merge_side_data(AVPacket *pkt); int av_packet_split_side_data(AVPacket *pkt); /** * @} */ /** * @addtogroup lavc_decoding * @{ */ /** * Find a registered decoder with a matching codec ID. * * @param id AVCodecID of the requested decoder * @return A decoder if one was found, NULL otherwise. */ AVCodec *avcodec_find_decoder(enum AVCodecID id); /** * Find a registered decoder with the specified name. * * @param name name of the requested decoder * @return A decoder if one was found, NULL otherwise. */ AVCodec *avcodec_find_decoder_by_name(const char *name); int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic); void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic); int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic); /** * Return the amount of padding in pixels which the get_buffer callback must * provide around the edge of the image for codecs which do not have the * CODEC_FLAG_EMU_EDGE flag. * * @return Required padding in pixels. */ unsigned avcodec_get_edge_width(void); /** * Modify width and height values so that they will result in a memory * buffer that is acceptable for the codec if you do not use any horizontal * padding. * * May only be used if a codec with CODEC_CAP_DR1 has been opened. * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased * according to avcodec_get_edge_width() before. */ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height); /** * Modify width and height values so that they will result in a memory * buffer that is acceptable for the codec if you also ensure that all * line sizes are a multiple of the respective linesize_align[i]. * * May only be used if a codec with CODEC_CAP_DR1 has been opened. * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased * according to avcodec_get_edge_width() before. */ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int linesize_align[AV_NUM_DATA_POINTERS]); #if FF_API_OLD_DECODE_AUDIO /** * Wrapper function which calls avcodec_decode_audio4. * * @deprecated Use avcodec_decode_audio4 instead. * * Decode the audio frame of size avpkt->size from avpkt->data into samples. * Some decoders may support multiple frames in a single AVPacket, such * decoders would then just decode the first frame. In this case, * avcodec_decode_audio3 has to be called again with an AVPacket that contains * the remaining data in order to decode the second frame etc. * If no frame * could be outputted, frame_size_ptr is zero. Otherwise, it is the * decompressed frame size in bytes. * * @warning You must set frame_size_ptr to the allocated size of the * output buffer before calling avcodec_decode_audio3(). * * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than * the actual read bytes because some optimized bitstream readers read 32 or 64 * bits at once and could read over the end. * * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that * no overreading happens for damaged MPEG streams. * * @warning You must not provide a custom get_buffer() when using * avcodec_decode_audio3(). Doing so will override it with * avcodec_default_get_buffer. Use avcodec_decode_audio4() instead, * which does allow the application to provide a custom get_buffer(). * * @note You might have to align the input buffer avpkt->data and output buffer * samples. The alignment requirements depend on the CPU: On some CPUs it isn't * necessary at all, on others it won't work at all if not aligned and on others * it will work but it will have an impact on performance. * * In practice, avpkt->data should have 4 byte alignment at minimum and * samples should be 16 byte aligned unless the CPU doesn't need it * (AltiVec and SSE do). * * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay * between input and output, these need to be fed with avpkt->data=NULL, * avpkt->size=0 at the end to return the remaining frames. * * @param avctx the codec context * @param[out] samples the output buffer, sample type in avctx->sample_fmt * If the sample format is planar, each channel plane will * be the same size, with no padding between channels. * @param[in,out] frame_size_ptr the output buffer size in bytes * @param[in] avpkt The input AVPacket containing the input buffer. * You can create such packet with av_init_packet() and by then setting * data and size, some decoders might in addition need other fields. * All decoders are designed to use the least fields possible though. * @return On error a negative value is returned, otherwise the number of bytes * used or zero if no frame data was decompressed (used) from the input AVPacket. */ attribute_deprecated int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, AVPacket *avpkt); #endif /** * Decode the audio frame of size avpkt->size from avpkt->data into frame. * * Some decoders may support multiple frames in a single AVPacket. Such * decoders would then just decode the first frame. In this case, * avcodec_decode_audio4 has to be called again with an AVPacket containing * the remaining data in order to decode the second frame, etc... * Even if no frames are returned, the packet needs to be fed to the decoder * with remaining data until it is completely consumed or an error occurs. * * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE * larger than the actual read bytes because some optimized bitstream * readers read 32 or 64 bits at once and could read over the end. * * @note You might have to align the input buffer. The alignment requirements * depend on the CPU and the decoder. * * @param avctx the codec context * @param[out] frame The AVFrame in which to store decoded audio samples. * Decoders request a buffer of a particular size by setting * AVFrame.nb_samples prior to calling get_buffer(). The * decoder may, however, only utilize part of the buffer by * setting AVFrame.nb_samples to a smaller value in the * output frame. * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is * non-zero. * @param[in] avpkt The input AVPacket containing the input buffer. * At least avpkt->data and avpkt->size should be set. Some * decoders might also require additional fields to be set. * @return A negative error code is returned if an error occurred during * decoding, otherwise the number of bytes consumed from the input * AVPacket is returned. */ int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, const AVPacket *avpkt); /** * Decode the video frame of size avpkt->size from avpkt->data into picture. * Some decoders may support multiple frames in a single AVPacket, such * decoders would then just decode the first frame. * * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than * the actual read bytes because some optimized bitstream readers read 32 or 64 * bits at once and could read over the end. * * @warning The end of the input buffer buf should be set to 0 to ensure that * no overreading happens for damaged MPEG streams. * * @note You might have to align the input buffer avpkt->data. * The alignment requirements depend on the CPU: on some CPUs it isn't * necessary at all, on others it won't work at all if not aligned and on others * it will work but it will have an impact on performance. * * In practice, avpkt->data should have 4 byte alignment at minimum. * * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay * between input and output, these need to be fed with avpkt->data=NULL, * avpkt->size=0 at the end to return the remaining frames. * * @param avctx the codec context * @param[out] picture The AVFrame in which the decoded video frame will be stored. * Use avcodec_alloc_frame to get an AVFrame, the codec will * allocate memory for the actual bitmap. * with default get/release_buffer(), the decoder frees/reuses the bitmap as it sees fit. * with overridden get/release_buffer() (needs CODEC_CAP_DR1) the user decides into what buffer the decoder * decodes and the decoder tells the user once it does not need the data anymore, * the user app can at this point free/reuse/keep the memory as it sees fit. * * @param[in] avpkt The input AVpacket containing the input buffer. * You can create such packet with av_init_packet() and by then setting * data and size, some decoders might in addition need other fields like * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least * fields possible. * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. * @return On error a negative value is returned, otherwise the number of bytes * used or zero if no frame could be decompressed. */ int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, const AVPacket *avpkt); /** * Decode a subtitle message. * Return a negative value on error, otherwise return the number of bytes used. * If no subtitle could be decompressed, got_sub_ptr is zero. * Otherwise, the subtitle is stored in *sub. * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for * simplicity, because the performance difference is expect to be negligible * and reusing a get_buffer written for video codecs would probably perform badly * due to a potentially very different allocation pattern. * * @param avctx the codec context * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be freed with avsubtitle_free if *got_sub_ptr is set. * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. * @param[in] avpkt The input AVPacket containing the input buffer. */ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt); /** * @defgroup lavc_parsing Frame parsing * @{ */ typedef struct AVCodecParserContext { void *priv_data; struct AVCodecParser *parser; int64_t frame_offset; /* offset of the current frame */ int64_t cur_offset; /* current offset (incremented by each av_parser_parse()) */ int64_t next_frame_offset; /* offset of the next frame */ /* video info */ int pict_type; /* XXX: Put it back in AVCodecContext. */ /** * This field is used for proper frame duration computation in lavf. * It signals, how much longer the frame duration of the current frame * is compared to normal frame duration. * * frame_duration = (1 + repeat_pict) * time_base * * It is used by codecs like H.264 to display telecined material. */ int repeat_pict; /* XXX: Put it back in AVCodecContext. */ int64_t pts; /* pts of the current frame */ int64_t dts; /* dts of the current frame */ /* private data */ int64_t last_pts; int64_t last_dts; int fetch_timestamp; #define AV_PARSER_PTS_NB 4 int cur_frame_start_index; int64_t cur_frame_offset[AV_PARSER_PTS_NB]; int64_t cur_frame_pts[AV_PARSER_PTS_NB]; int64_t cur_frame_dts[AV_PARSER_PTS_NB]; int flags; #define PARSER_FLAG_COMPLETE_FRAMES 0x0001 #define PARSER_FLAG_ONCE 0x0002 /// Set if the parser has a valid file offset #define PARSER_FLAG_FETCHED_OFFSET 0x0004 #define PARSER_FLAG_USE_CODEC_TS 0x1000 int64_t offset; ///< byte offset from starting packet start int64_t cur_frame_end[AV_PARSER_PTS_NB]; /** * Set by parser to 1 for key frames and 0 for non-key frames. * It is initialized to -1, so if the parser doesn't set this flag, * old-style fallback using AV_PICTURE_TYPE_I picture type as key frames * will be used. */ int key_frame; /** * Time difference in stream time base units from the pts of this * packet to the point at which the output from the decoder has converged * independent from the availability of previous frames. That is, the * frames are virtually identical no matter if decoding started from * the very first frame or from this keyframe. * Is AV_NOPTS_VALUE if unknown. * This field is not the display duration of the current frame. * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY * set. * * The purpose of this field is to allow seeking in streams that have no * keyframes in the conventional sense. It corresponds to the * recovery point SEI in H.264 and match_time_delta in NUT. It is also * essential for some types of subtitle streams to ensure that all * subtitles are correctly displayed after seeking. */ int64_t convergence_duration; // Timestamp generation support: /** * Synchronization point for start of timestamp generation. * * Set to >0 for sync point, 0 for no sync point and <0 for undefined * (default). * * For example, this corresponds to presence of H.264 buffering period * SEI message. */ int dts_sync_point; /** * Offset of the current timestamp against last timestamp sync point in * units of AVCodecContext.time_base. * * Set to INT_MIN when dts_sync_point unused. Otherwise, it must * contain a valid timestamp offset. * * Note that the timestamp of sync point has usually a nonzero * dts_ref_dts_delta, which refers to the previous sync point. Offset of * the next frame after timestamp sync point will be usually 1. * * For example, this corresponds to H.264 cpb_removal_delay. */ int dts_ref_dts_delta; /** * Presentation delay of current frame in units of AVCodecContext.time_base. * * Set to INT_MIN when dts_sync_point unused. Otherwise, it must * contain valid non-negative timestamp delta (presentation time of a frame * must not lie in the past). * * This delay represents the difference between decoding and presentation * time of the frame. * * For example, this corresponds to H.264 dpb_output_delay. */ int pts_dts_delta; /** * Position of the packet in file. * * Analogous to cur_frame_pts/dts */ int64_t cur_frame_pos[AV_PARSER_PTS_NB]; /** * Byte position of currently parsed frame in stream. */ int64_t pos; /** * Previous frame byte position. */ int64_t last_pos; /** * Duration of the current frame. * For audio, this is in units of 1 / AVCodecContext.sample_rate. * For all other types, this is in units of AVCodecContext.time_base. */ int duration; } AVCodecParserContext; typedef struct AVCodecParser { int codec_ids[5]; /* several codec IDs are permitted */ int priv_data_size; int (*parser_init)(AVCodecParserContext *s); int (*parser_parse)(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size); void (*parser_close)(AVCodecParserContext *s); int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size); struct AVCodecParser *next; } AVCodecParser; AVCodecParser *av_parser_next(AVCodecParser *c); void av_register_codec_parser(AVCodecParser *parser); AVCodecParserContext *av_parser_init(int codec_id); /** * Parse a packet. * * @param s parser context. * @param avctx codec context. * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. * @param buf input buffer. * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). * @param pts input presentation timestamp. * @param dts input decoding timestamp. * @param pos input byte position in stream. * @return the number of bytes of the input bitstream used. * * Example: * @code * while(in_len){ * len = av_parser_parse2(myparser, AVCodecContext, &data, &size, * in_data, in_len, * pts, dts, pos); * in_data += len; * in_len -= len; * * if(size) * decode_frame(data, size); * } * @endcode */ int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int64_t pts, int64_t dts, int64_t pos); int av_parser_change(AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe); void av_parser_close(AVCodecParserContext *s); /** * @} * @} */ /** * @addtogroup lavc_encoding * @{ */ /** * Find a registered encoder with a matching codec ID. * * @param id AVCodecID of the requested encoder * @return An encoder if one was found, NULL otherwise. */ AVCodec *avcodec_find_encoder(enum AVCodecID id); /** * Find a registered encoder with the specified name. * * @param name name of the requested encoder * @return An encoder if one was found, NULL otherwise. */ AVCodec *avcodec_find_encoder_by_name(const char *name); #if FF_API_OLD_ENCODE_AUDIO /** * Encode an audio frame from samples into buf. * * @deprecated Use avcodec_encode_audio2 instead. * * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large. * However, for codecs with avctx->frame_size equal to 0 (e.g. PCM) the user * will know how much space is needed because it depends on the value passed * in buf_size as described below. In that case a lower value can be used. * * @param avctx the codec context * @param[out] buf the output buffer * @param[in] buf_size the output buffer size * @param[in] samples the input buffer containing the samples * The number of samples read from this buffer is frame_size*channels, * both of which are defined in avctx. * For codecs which have avctx->frame_size equal to 0 (e.g. PCM) the number of * samples read from samples is equal to: * buf_size * 8 / (avctx->channels * av_get_bits_per_sample(avctx->codec_id)) * This also implies that av_get_bits_per_sample() must not return 0 for these * codecs. * @return On error a negative value is returned, on success zero or the number * of bytes used to encode the data read from the input buffer. */ int attribute_deprecated avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples); #endif /** * Encode a frame of audio. * * Takes input samples from frame and writes the next output packet, if * available, to avpkt. The output packet does not necessarily contain data for * the most recent frame, as encoders can delay, split, and combine input frames * internally as needed. * * @param avctx codec context * @param avpkt output AVPacket. * The user can supply an output buffer by setting * avpkt->data and avpkt->size prior to calling the * function, but if the size of the user-provided data is not * large enough, encoding will fail. If avpkt->data and * avpkt->size are set, avpkt->destruct must also be set. All * other AVPacket fields will be reset by the encoder using * av_init_packet(). If avpkt->data is NULL, the encoder will * allocate it. The encoder will set avpkt->size to the size * of the output packet. * * If this function fails or produces no output, avpkt will be * freed using av_free_packet() (i.e. avpkt->destruct will be * called to free the user supplied buffer). * @param[in] frame AVFrame containing the raw audio data to be encoded. * May be NULL when flushing an encoder that has the * CODEC_CAP_DELAY capability set. * If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame * can have any number of samples. * If it is not set, frame->nb_samples must be equal to * avctx->frame_size for all frames except the last. * The final frame may be smaller than avctx->frame_size. * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the * output packet is non-empty, and to 0 if it is * empty. If the function returns an error, the * packet can be assumed to be invalid, and the * value of got_packet_ptr is undefined and should * not be used. * @return 0 on success, negative error code on failure */ int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr); #if FF_API_OLD_ENCODE_VIDEO /** * @deprecated use avcodec_encode_video2() instead. * * Encode a video frame from pict into buf. * The input picture should be * stored using a specific format, namely avctx.pix_fmt. * * @param avctx the codec context * @param[out] buf the output buffer for the bitstream of encoded frame * @param[in] buf_size the size of the output buffer in bytes * @param[in] pict the input picture to encode * @return On error a negative value is returned, on success zero or the number * of bytes used from the output buffer. */ attribute_deprecated int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size, const AVFrame *pict); #endif /** * Encode a frame of video. * * Takes input raw video data from frame and writes the next output packet, if * available, to avpkt. The output packet does not necessarily contain data for * the most recent frame, as encoders can delay and reorder input frames * internally as needed. * * @param avctx codec context * @param avpkt output AVPacket. * The user can supply an output buffer by setting * avpkt->data and avpkt->size prior to calling the * function, but if the size of the user-provided data is not * large enough, encoding will fail. All other AVPacket fields * will be reset by the encoder using av_init_packet(). If * avpkt->data is NULL, the encoder will allocate it. * The encoder will set avpkt->size to the size of the * output packet. The returned data (if any) belongs to the * caller, he is responsible for freeing it. * * If this function fails or produces no output, avpkt will be * freed using av_free_packet() (i.e. avpkt->destruct will be * called to free the user supplied buffer). * @param[in] frame AVFrame containing the raw video data to be encoded. * May be NULL when flushing an encoder that has the * CODEC_CAP_DELAY capability set. * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the * output packet is non-empty, and to 0 if it is * empty. If the function returns an error, the * packet can be assumed to be invalid, and the * value of got_packet_ptr is undefined and should * not be used. * @return 0 on success, negative error code on failure */ int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr); int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size, const AVSubtitle *sub); /** * @} */ /** * @defgroup lavc_resample Audio resampling * @ingroup libavc * * @{ */ struct ReSampleContext; struct AVResampleContext; typedef struct ReSampleContext ReSampleContext; /** * Initialize audio resampling context. * * @param output_channels number of output channels * @param input_channels number of input channels * @param output_rate output sample rate * @param input_rate input sample rate * @param sample_fmt_out requested output sample format * @param sample_fmt_in input sample format * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency * @param log2_phase_count log2 of the number of entries in the polyphase filterbank * @param linear if 1 then the used FIR filter will be linearly interpolated between the 2 closest, if 0 the closest will be used * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate * @return allocated ReSampleContext, NULL if error occurred */ ReSampleContext *av_audio_resample_init(int output_channels, int input_channels, int output_rate, int input_rate, enum AVSampleFormat sample_fmt_out, enum AVSampleFormat sample_fmt_in, int filter_length, int log2_phase_count, int linear, double cutoff); int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples); /** * Free resample context. * * @param s a non-NULL pointer to a resample context previously * created with av_audio_resample_init() */ void audio_resample_close(ReSampleContext *s); /** * Initialize an audio resampler. * Note, if either rate is not an integer then simply scale both rates up so they are. * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq * @param log2_phase_count log2 of the number of entries in the polyphase filterbank * @param linear If 1 then the used FIR filter will be linearly interpolated between the 2 closest, if 0 the closest will be used * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate */ struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff); /** * Resample an array of samples using a previously configured context. * @param src an array of unconsumed samples * @param consumed the number of samples of src which have been consumed are returned here * @param src_size the number of unconsumed samples available * @param dst_size the amount of space in samples available in dst * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. * @return the number of samples written in dst or -1 if an error occurred */ int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx); /** * Compensate samplerate/timestamp drift. The compensation is done by changing * the resampler parameters, so no audible clicks or similar distortions occur * @param compensation_distance distance in output samples over which the compensation should be performed * @param sample_delta number of output samples which should be output less * * example: av_resample_compensate(c, 10, 500) * here instead of 510 samples only 500 samples would be output * * note, due to rounding the actual compensation might be slightly different, * especially if the compensation_distance is large and the in_rate used during init is small */ void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance); void av_resample_close(struct AVResampleContext *c); /** * @} */ /** * @addtogroup lavc_picture * @{ */ /** * Allocate memory for a picture. Call avpicture_free() to free it. * * @see avpicture_fill() * * @param picture the picture to be filled in * @param pix_fmt the format of the picture * @param width the width of the picture * @param height the height of the picture * @return zero if successful, a negative value if not */ int avpicture_alloc(AVPicture *picture, enum PixelFormat pix_fmt, int width, int height); /** * Free a picture previously allocated by avpicture_alloc(). * The data buffer used by the AVPicture is freed, but the AVPicture structure * itself is not. * * @param picture the AVPicture to be freed */ void avpicture_free(AVPicture *picture); /** * Fill in the AVPicture fields, always assume a linesize alignment of * 1. * * @see av_image_fill_arrays() */ int avpicture_fill(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt, int width, int height); /** * Copy pixel data from an AVPicture into a buffer, always assume a * linesize alignment of 1. * * @see av_image_copy_to_buffer() */ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int height, unsigned char *dest, int dest_size); /** * Calculate the size in bytes that a picture of the given width and height * would occupy if stored in the given picture format. * Always assume a linesize alignment of 1. * * @see av_image_get_buffer_size(). */ int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height); /** * deinterlace - if not supported return -1 */ int avpicture_deinterlace(AVPicture *dst, const AVPicture *src, enum PixelFormat pix_fmt, int width, int height); /** * Copy image src to dst. Wraps av_image_copy(). */ void av_picture_copy(AVPicture *dst, const AVPicture *src, enum PixelFormat pix_fmt, int width, int height); /** * Crop image top and left side. */ int av_picture_crop(AVPicture *dst, const AVPicture *src, enum PixelFormat pix_fmt, int top_band, int left_band); /** * Pad image. */ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum PixelFormat pix_fmt, int padtop, int padbottom, int padleft, int padright, int *color); /** * @} */ /** * @defgroup lavc_misc Utility functions * @ingroup libavc * * Miscellaneous utility functions related to both encoding and decoding * (or neither). * @{ */ /** * @defgroup lavc_misc_pixfmt Pixel formats * * Functions for working with pixel formats. * @{ */ void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift); /** * Return a value representing the fourCC code associated to the * pixel format pix_fmt, or 0 if no associated fourCC code can be * found. */ unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat pix_fmt); #define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */ #define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */ #define FF_LOSS_COLORSPACE 0x0004 /**< loss due to color space conversion */ #define FF_LOSS_ALPHA 0x0008 /**< loss of alpha bits */ #define FF_LOSS_COLORQUANT 0x0010 /**< loss due to color quantization */ #define FF_LOSS_CHROMA 0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */ /** * Compute what kind of losses will occur when converting from one specific * pixel format to another. * When converting from one pixel format to another, information loss may occur. * For example, when converting from RGB24 to GRAY, the color information will * be lost. Similarly, other losses occur when converting from some formats to * other formats. These losses can involve loss of chroma, but also loss of * resolution, loss of color depth, loss due to the color space conversion, loss * of the alpha bits or loss due to color quantization. * avcodec_get_fix_fmt_loss() informs you about the various types of losses * which will occur when converting from one pixel format to another. * * @param[in] dst_pix_fmt destination pixel format * @param[in] src_pix_fmt source pixel format * @param[in] has_alpha Whether the source pixel format alpha channel is used. * @return Combination of flags informing you what kind of losses will occur * (maximum loss for an invalid dst_pix_fmt). */ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt, int has_alpha); #if FF_API_FIND_BEST_PIX_FMT /** * @deprecated use avcodec_find_best_pix_fmt_of_2() instead. * * Find the best pixel format to convert to given a certain source pixel * format. When converting from one pixel format to another, information loss * may occur. For example, when converting from RGB24 to GRAY, the color * information will be lost. Similarly, other losses occur when converting from * some formats to other formats. avcodec_find_best_pix_fmt() searches which of * the given pixel formats should be used to suffer the least amount of loss. * The pixel formats from which it chooses one, are determined by the * pix_fmt_mask parameter. * * Note, only the first 64 pixel formats will fit in pix_fmt_mask. * * @code * src_pix_fmt = PIX_FMT_YUV420P; * pix_fmt_mask = (1 << PIX_FMT_YUV422P) | (1 << PIX_FMT_RGB24); * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss); * @endcode * * @param[in] pix_fmt_mask bitmask determining which pixel format to choose from * @param[in] src_pix_fmt source pixel format * @param[in] has_alpha Whether the source pixel format alpha channel is used. * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. * @return The best pixel format to convert to or -1 if none was found. */ attribute_deprecated enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); #endif /* FF_API_FIND_BEST_PIX_FMT */ /** * Find the best pixel format to convert to given a certain source pixel * format. When converting from one pixel format to another, information loss * may occur. For example, when converting from RGB24 to GRAY, the color * information will be lost. Similarly, other losses occur when converting from * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of * the given pixel formats should be used to suffer the least amount of loss. * The pixel formats from which it chooses one, are determined by the * pix_fmt_list parameter. * * * @param[in] pix_fmt_list PIX_FMT_NONE terminated array of pixel formats to choose from * @param[in] src_pix_fmt source pixel format * @param[in] has_alpha Whether the source pixel format alpha channel is used. * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. * @return The best pixel format to convert to or -1 if none was found. */ enum PixelFormat avcodec_find_best_pix_fmt_of_list(enum PixelFormat *pix_fmt_list, enum PixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); /** * Find the best pixel format to convert to given a certain source pixel * format and a selection of two destination pixel formats. When converting from * one pixel format to another, information loss may occur. For example, when converting * from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when * converting from some formats to other formats. avcodec_find_best_pix_fmt_of_2() selects which of * the given pixel formats should be used to suffer the least amount of loss. * * If one of the destination formats is PIX_FMT_NONE the other pixel format (if valid) will be * returned. * * @code * src_pix_fmt = PIX_FMT_YUV420P; * dst_pix_fmt1= PIX_FMT_RGB24; * dst_pix_fmt2= PIX_FMT_GRAY8; * dst_pix_fmt3= PIX_FMT_RGB8; * loss= FF_LOSS_CHROMA; // don't care about chroma loss, so chroma loss will be ignored. * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1, dst_pix_fmt2, src_pix_fmt, alpha, &loss); * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt, dst_pix_fmt3, src_pix_fmt, alpha, &loss); * @endcode * * @param[in] dst_pix_fmt1 One of the two destination pixel formats to choose from * @param[in] dst_pix_fmt2 The other of the two destination pixel formats to choose from * @param[in] src_pix_fmt Source pixel format * @param[in] has_alpha Whether the source pixel format alpha channel is used. * @param[in, out] loss_ptr Combination of loss flags. In: selects which of the losses to ignore, i.e. * NULL or value of zero means we care about all losses. Out: the loss * that occurs when converting from src to selected dst pixel format. * @return The best pixel format to convert to or -1 if none was found. */ enum PixelFormat avcodec_find_best_pix_fmt_of_2(enum PixelFormat dst_pix_fmt1, enum PixelFormat dst_pix_fmt2, enum PixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); attribute_deprecated #if AV_HAVE_INCOMPATIBLE_FORK_ABI enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat *pix_fmt_list, enum PixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); #else enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat dst_pix_fmt1, enum PixelFormat dst_pix_fmt2, enum PixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); #endif enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt); /** * @} */ void avcodec_set_dimensions(AVCodecContext *s, int width, int height); /** * Put a string representing the codec tag codec_tag in buf. * * @param buf_size size in bytes of buf * @return the length of the string that would have been generated if * enough space had been available, excluding the trailing null */ size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag); void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode); /** * Return a name for the specified profile, if available. * * @param codec the codec that is searched for the given profile * @param profile the profile value for which a name is requested * @return A name for the profile if found, NULL otherwise. */ const char *av_get_profile_name(const AVCodec *codec, int profile); int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size); int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count); //FIXME func typedef /** * Fill audio frame data and linesize. * AVFrame extended_data channel pointers are allocated if necessary for * planar audio. * * @param frame the AVFrame * frame->nb_samples must be set prior to calling the * function. This function fills in frame->data, * frame->extended_data, frame->linesize[0]. * @param nb_channels channel count * @param sample_fmt sample format * @param buf buffer to use for frame data * @param buf_size size of buffer * @param align plane size sample alignment (0 = default) * @return 0 on success, negative error code on failure */ int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels, enum AVSampleFormat sample_fmt, const uint8_t *buf, int buf_size, int align); /** * Flush buffers, should be called when seeking or when switching to a different stream. */ void avcodec_flush_buffers(AVCodecContext *avctx); void avcodec_default_free_buffers(AVCodecContext *s); /** * Return codec bits per sample. * * @param[in] codec_id the codec * @return Number of bits per sample or zero if unknown for the given codec. */ int av_get_bits_per_sample(enum AVCodecID codec_id); /** * Return the PCM codec associated with a sample format. * @param be endianness, 0 for little, 1 for big, * -1 (or anything else) for native * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE */ enum AVCodecID av_get_pcm_codec(enum AVSampleFormat fmt, int be); /** * Return codec bits per sample. * Only return non-zero if the bits per sample is exactly correct, not an * approximation. * * @param[in] codec_id the codec * @return Number of bits per sample or zero if unknown for the given codec. */ int av_get_exact_bits_per_sample(enum AVCodecID codec_id); /** * Return audio frame duration. * * @param avctx codec context * @param frame_bytes size of the frame, or 0 if unknown * @return frame duration, in samples, if known. 0 if not able to * determine. */ int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes); typedef struct AVBitStreamFilterContext { void *priv_data; struct AVBitStreamFilter *filter; AVCodecParserContext *parser; struct AVBitStreamFilterContext *next; } AVBitStreamFilterContext; typedef struct AVBitStreamFilter { const char *name; int priv_data_size; int (*filter)(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe); void (*close)(AVBitStreamFilterContext *bsfc); struct AVBitStreamFilter *next; } AVBitStreamFilter; void av_register_bitstream_filter(AVBitStreamFilter *bsf); AVBitStreamFilterContext *av_bitstream_filter_init(const char *name); int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe); void av_bitstream_filter_close(AVBitStreamFilterContext *bsf); AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f); /* memory */ /** * Reallocate the given block if it is not large enough, otherwise do nothing. * * @see av_realloc */ void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size); /** * Allocate a buffer, reusing the given one if large enough. * * Contrary to av_fast_realloc the current buffer contents might not be * preserved and on error the old buffer is freed, thus no special * handling to avoid memleaks is necessary. * * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer * @param size size of the buffer *ptr points to * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and * *size 0 if an error occurred. */ void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size); /** * Same behaviour av_fast_malloc but the buffer has additional * FF_INPUT_PADDING_SIZE at the end which will will always be 0. * * In addition the whole buffer will initially and after resizes * be 0-initialized so that no uninitialized data will ever appear. */ void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size); /** * Same behaviour av_fast_padded_malloc except that buffer will always * be 0-initialized after call. */ void av_fast_padded_mallocz(void *ptr, unsigned int *size, size_t min_size); /** * Encode extradata length to a buffer. Used by xiph codecs. * * @param s buffer to write to; must be at least (v/255+1) bytes long * @param v size of extradata in bytes * @return number of bytes written to the buffer. */ unsigned int av_xiphlacing(unsigned char *s, unsigned int v); /** * Log a generic warning message about a missing feature. This function is * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) * only, and would normally not be used by applications. * @param[in] avc a pointer to an arbitrary struct of which the first field is * a pointer to an AVClass struct * @param[in] feature string containing the name of the missing feature * @param[in] want_sample indicates if samples are wanted which exhibit this feature. * If want_sample is non-zero, additional verbage will be added to the log * message which tells the user how to report samples to the development * mailing list. */ void av_log_missing_feature(void *avc, const char *feature, int want_sample); /** * Log a generic warning message asking for a sample. This function is * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) * only, and would normally not be used by applications. * @param[in] avc a pointer to an arbitrary struct of which the first field is * a pointer to an AVClass struct * @param[in] msg string containing an optional message, or NULL if no message */ void av_log_ask_for_sample(void *avc, const char *msg, ...) av_printf_format(2, 3); /** * Register the hardware accelerator hwaccel. */ void av_register_hwaccel(AVHWAccel *hwaccel); /** * If hwaccel is NULL, returns the first registered hardware accelerator, * if hwaccel is non-NULL, returns the next registered hardware accelerator * after hwaccel, or NULL if hwaccel is the last one. */ AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel); /** * Lock operation used by lockmgr */ enum AVLockOp { AV_LOCK_CREATE, ///< Create a mutex AV_LOCK_OBTAIN, ///< Lock the mutex AV_LOCK_RELEASE, ///< Unlock the mutex AV_LOCK_DESTROY, ///< Free mutex resources }; /** * Register a user provided lock manager supporting the operations * specified by AVLockOp. mutex points to a (void *) where the * lockmgr should store/get a pointer to a user allocated mutex. It's * NULL upon AV_LOCK_CREATE and != NULL for all other ops. * * @param cb User defined callback. Note: FFmpeg may invoke calls to this * callback during the call to av_lockmgr_register(). * Thus, the application must be prepared to handle that. * If cb is set to NULL the lockmgr will be unregistered. * Also note that during unregistration the previously registered * lockmgr callback may also be invoked. */ int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op)); /** * Get the type of the given codec. */ enum AVMediaType avcodec_get_type(enum AVCodecID codec_id); /** * Get the name of a codec. * @return a static string identifying the codec; never NULL */ const char *avcodec_get_name(enum AVCodecID id); /** * @return a positive value if s is open (i.e. avcodec_open2() was called on it * with no corresponding avcodec_close()), 0 otherwise. */ int avcodec_is_open(AVCodecContext *s); /** * @return a non-zero number if codec is an encoder, zero otherwise */ int av_codec_is_encoder(const AVCodec *codec); /** * @return a non-zero number if codec is a decoder, zero otherwise */ int av_codec_is_decoder(const AVCodec *codec); /** * @return descriptor for given codec ID or NULL if no descriptor exists. */ const AVCodecDescriptor *avcodec_descriptor_get(enum AVCodecID id); /** * Iterate over all codec descriptors known to libavcodec. * * @param prev previous descriptor. NULL to get the first descriptor. * * @return next descriptor or NULL after the last descriptor */ const AVCodecDescriptor *avcodec_descriptor_next(const AVCodecDescriptor *prev); /** * @return codec descriptor with the given name or NULL if no such descriptor * exists. */ const AVCodecDescriptor *avcodec_descriptor_get_by_name(const char *name); /** * @} */ #endif /* AVCODEC_AVCODEC_H */
164,452
32.589257
155
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/code/ndn-dash/libdash/libav/include/libavcodec/xvmc.h
/* * Copyright (C) 2003 Ivan Kalvachev * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef AVCODEC_XVMC_H #define AVCODEC_XVMC_H /** * @file * @ingroup lavc_codec_hwaccel_xvmc * Public libavcodec XvMC header. */ #include <X11/extensions/XvMC.h> #include "avcodec.h" /** * @defgroup lavc_codec_hwaccel_xvmc XvMC * @ingroup lavc_codec_hwaccel * * @{ */ #define AV_XVMC_ID 0x1DC711C0 /**< special value to ensure that regular pixel routines haven't corrupted the struct the number is 1337 speak for the letters IDCT MCo (motion compensation) */ struct xvmc_pix_fmt { /** The field contains the special constant value AV_XVMC_ID. It is used as a test that the application correctly uses the API, and that there is no corruption caused by pixel routines. - application - set during initialization - libavcodec - unchanged */ int xvmc_id; /** Pointer to the block array allocated by XvMCCreateBlocks(). The array has to be freed by XvMCDestroyBlocks(). Each group of 64 values represents one data block of differential pixel information (in MoCo mode) or coefficients for IDCT. - application - set the pointer during initialization - libavcodec - fills coefficients/pixel data into the array */ short* data_blocks; /** Pointer to the macroblock description array allocated by XvMCCreateMacroBlocks() and freed by XvMCDestroyMacroBlocks(). - application - set the pointer during initialization - libavcodec - fills description data into the array */ XvMCMacroBlock* mv_blocks; /** Number of macroblock descriptions that can be stored in the mv_blocks array. - application - set during initialization - libavcodec - unchanged */ int allocated_mv_blocks; /** Number of blocks that can be stored at once in the data_blocks array. - application - set during initialization - libavcodec - unchanged */ int allocated_data_blocks; /** Indicate that the hardware would interpret data_blocks as IDCT coefficients and perform IDCT on them. - application - set during initialization - libavcodec - unchanged */ int idct; /** In MoCo mode it indicates that intra macroblocks are assumed to be in unsigned format; same as the XVMC_INTRA_UNSIGNED flag. - application - set during initialization - libavcodec - unchanged */ int unsigned_intra; /** Pointer to the surface allocated by XvMCCreateSurface(). It has to be freed by XvMCDestroySurface() on application exit. It identifies the frame and its state on the video hardware. - application - set during initialization - libavcodec - unchanged */ XvMCSurface* p_surface; /** Set by the decoder before calling ff_draw_horiz_band(), needed by the XvMCRenderSurface function. */ //@{ /** Pointer to the surface used as past reference - application - unchanged - libavcodec - set */ XvMCSurface* p_past_surface; /** Pointer to the surface used as future reference - application - unchanged - libavcodec - set */ XvMCSurface* p_future_surface; /** top/bottom field or frame - application - unchanged - libavcodec - set */ unsigned int picture_structure; /** XVMC_SECOND_FIELD - 1st or 2nd field in the sequence - application - unchanged - libavcodec - set */ unsigned int flags; //}@ /** Number of macroblock descriptions in the mv_blocks array that have already been passed to the hardware. - application - zeroes it on get_buffer(). A successful ff_draw_horiz_band() may increment it with filled_mb_block_num or zero both. - libavcodec - unchanged */ int start_mv_blocks_num; /** Number of new macroblock descriptions in the mv_blocks array (after start_mv_blocks_num) that are filled by libavcodec and have to be passed to the hardware. - application - zeroes it on get_buffer() or after successful ff_draw_horiz_band(). - libavcodec - increment with one of each stored MB */ int filled_mv_blocks_num; /** Number of the next free data block; one data block consists of 64 short values in the data_blocks array. All blocks before this one have already been claimed by placing their position into the corresponding block description structure field, that are part of the mv_blocks array. - application - zeroes it on get_buffer(). A successful ff_draw_horiz_band() may zero it together with start_mb_blocks_num. - libavcodec - each decoded macroblock increases it by the number of coded blocks it contains. */ int next_free_data_block_num; }; /** * @} */ #endif /* AVCODEC_XVMC_H */
5,986
34.426036
135
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/code/ndn-dash/libdash/libav/include/libavcodec/old_codec_ids.h
/* * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef AVCODEC_OLD_CODEC_IDS_H #define AVCODEC_OLD_CODEC_IDS_H #include "libavutil/common.h" /* * This header exists to prevent new codec IDs from being accidentally added to * the deprecated list. * Do not include it directly. It will be removed on next major bump * * Do not add new items to this list. Use the AVCodecID enum instead. */ CODEC_ID_NONE = AV_CODEC_ID_NONE, /* video codecs */ CODEC_ID_MPEG1VIDEO, CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding CODEC_ID_MPEG2VIDEO_XVMC, CODEC_ID_H261, CODEC_ID_H263, CODEC_ID_RV10, CODEC_ID_RV20, CODEC_ID_MJPEG, CODEC_ID_MJPEGB, CODEC_ID_LJPEG, CODEC_ID_SP5X, CODEC_ID_JPEGLS, CODEC_ID_MPEG4, CODEC_ID_RAWVIDEO, CODEC_ID_MSMPEG4V1, CODEC_ID_MSMPEG4V2, CODEC_ID_MSMPEG4V3, CODEC_ID_WMV1, CODEC_ID_WMV2, CODEC_ID_H263P, CODEC_ID_H263I, CODEC_ID_FLV1, CODEC_ID_SVQ1, CODEC_ID_SVQ3, CODEC_ID_DVVIDEO, CODEC_ID_HUFFYUV, CODEC_ID_CYUV, CODEC_ID_H264, CODEC_ID_INDEO3, CODEC_ID_VP3, CODEC_ID_THEORA, CODEC_ID_ASV1, CODEC_ID_ASV2, CODEC_ID_FFV1, CODEC_ID_4XM, CODEC_ID_VCR1, CODEC_ID_CLJR, CODEC_ID_MDEC, CODEC_ID_ROQ, CODEC_ID_INTERPLAY_VIDEO, CODEC_ID_XAN_WC3, CODEC_ID_XAN_WC4, CODEC_ID_RPZA, CODEC_ID_CINEPAK, CODEC_ID_WS_VQA, CODEC_ID_MSRLE, CODEC_ID_MSVIDEO1, CODEC_ID_IDCIN, CODEC_ID_8BPS, CODEC_ID_SMC, CODEC_ID_FLIC, CODEC_ID_TRUEMOTION1, CODEC_ID_VMDVIDEO, CODEC_ID_MSZH, CODEC_ID_ZLIB, CODEC_ID_QTRLE, CODEC_ID_SNOW, CODEC_ID_TSCC, CODEC_ID_ULTI, CODEC_ID_QDRAW, CODEC_ID_VIXL, CODEC_ID_QPEG, CODEC_ID_PNG, CODEC_ID_PPM, CODEC_ID_PBM, CODEC_ID_PGM, CODEC_ID_PGMYUV, CODEC_ID_PAM, CODEC_ID_FFVHUFF, CODEC_ID_RV30, CODEC_ID_RV40, CODEC_ID_VC1, CODEC_ID_WMV3, CODEC_ID_LOCO, CODEC_ID_WNV1, CODEC_ID_AASC, CODEC_ID_INDEO2, CODEC_ID_FRAPS, CODEC_ID_TRUEMOTION2, CODEC_ID_BMP, CODEC_ID_CSCD, CODEC_ID_MMVIDEO, CODEC_ID_ZMBV, CODEC_ID_AVS, CODEC_ID_SMACKVIDEO, CODEC_ID_NUV, CODEC_ID_KMVC, CODEC_ID_FLASHSV, CODEC_ID_CAVS, CODEC_ID_JPEG2000, CODEC_ID_VMNC, CODEC_ID_VP5, CODEC_ID_VP6, CODEC_ID_VP6F, CODEC_ID_TARGA, CODEC_ID_DSICINVIDEO, CODEC_ID_TIERTEXSEQVIDEO, CODEC_ID_TIFF, CODEC_ID_GIF, CODEC_ID_DXA, CODEC_ID_DNXHD, CODEC_ID_THP, CODEC_ID_SGI, CODEC_ID_C93, CODEC_ID_BETHSOFTVID, CODEC_ID_PTX, CODEC_ID_TXD, CODEC_ID_VP6A, CODEC_ID_AMV, CODEC_ID_VB, CODEC_ID_PCX, CODEC_ID_SUNRAST, CODEC_ID_INDEO4, CODEC_ID_INDEO5, CODEC_ID_MIMIC, CODEC_ID_RL2, CODEC_ID_ESCAPE124, CODEC_ID_DIRAC, CODEC_ID_BFI, CODEC_ID_CMV, CODEC_ID_MOTIONPIXELS, CODEC_ID_TGV, CODEC_ID_TGQ, CODEC_ID_TQI, CODEC_ID_AURA, CODEC_ID_AURA2, CODEC_ID_V210X, CODEC_ID_TMV, CODEC_ID_V210, CODEC_ID_DPX, CODEC_ID_MAD, CODEC_ID_FRWU, CODEC_ID_FLASHSV2, CODEC_ID_CDGRAPHICS, CODEC_ID_R210, CODEC_ID_ANM, CODEC_ID_BINKVIDEO, CODEC_ID_IFF_ILBM, CODEC_ID_IFF_BYTERUN1, CODEC_ID_KGV1, CODEC_ID_YOP, CODEC_ID_VP8, CODEC_ID_PICTOR, CODEC_ID_ANSI, CODEC_ID_A64_MULTI, CODEC_ID_A64_MULTI5, CODEC_ID_R10K, CODEC_ID_MXPEG, CODEC_ID_LAGARITH, CODEC_ID_PRORES, CODEC_ID_JV, CODEC_ID_DFA, CODEC_ID_WMV3IMAGE, CODEC_ID_VC1IMAGE, CODEC_ID_UTVIDEO, CODEC_ID_BMV_VIDEO, CODEC_ID_VBLE, CODEC_ID_DXTORY, CODEC_ID_V410, CODEC_ID_XWD, CODEC_ID_CDXL, CODEC_ID_XBM, CODEC_ID_ZEROCODEC, CODEC_ID_MSS1, CODEC_ID_MSA1, CODEC_ID_TSCC2, CODEC_ID_MTS2, CODEC_ID_CLLC, CODEC_ID_Y41P = MKBETAG('Y','4','1','P'), CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'), CODEC_ID_EXR = MKBETAG('0','E','X','R'), CODEC_ID_AVRP = MKBETAG('A','V','R','P'), CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'), CODEC_ID_AVUI = MKBETAG('A','V','U','I'), CODEC_ID_AYUV = MKBETAG('A','Y','U','V'), CODEC_ID_V308 = MKBETAG('V','3','0','8'), CODEC_ID_V408 = MKBETAG('V','4','0','8'), CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'), CODEC_ID_SANM = MKBETAG('S','A','N','M'), CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'), /* various PCM "codecs" */ CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs CODEC_ID_PCM_S16LE = 0x10000, CODEC_ID_PCM_S16BE, CODEC_ID_PCM_U16LE, CODEC_ID_PCM_U16BE, CODEC_ID_PCM_S8, CODEC_ID_PCM_U8, CODEC_ID_PCM_MULAW, CODEC_ID_PCM_ALAW, CODEC_ID_PCM_S32LE, CODEC_ID_PCM_S32BE, CODEC_ID_PCM_U32LE, CODEC_ID_PCM_U32BE, CODEC_ID_PCM_S24LE, CODEC_ID_PCM_S24BE, CODEC_ID_PCM_U24LE, CODEC_ID_PCM_U24BE, CODEC_ID_PCM_S24DAUD, CODEC_ID_PCM_ZORK, CODEC_ID_PCM_S16LE_PLANAR, CODEC_ID_PCM_DVD, CODEC_ID_PCM_F32BE, CODEC_ID_PCM_F32LE, CODEC_ID_PCM_F64BE, CODEC_ID_PCM_F64LE, CODEC_ID_PCM_BLURAY, CODEC_ID_PCM_LXF, CODEC_ID_S302M, CODEC_ID_PCM_S8_PLANAR, /* various ADPCM codecs */ CODEC_ID_ADPCM_IMA_QT = 0x11000, CODEC_ID_ADPCM_IMA_WAV, CODEC_ID_ADPCM_IMA_DK3, CODEC_ID_ADPCM_IMA_DK4, CODEC_ID_ADPCM_IMA_WS, CODEC_ID_ADPCM_IMA_SMJPEG, CODEC_ID_ADPCM_MS, CODEC_ID_ADPCM_4XM, CODEC_ID_ADPCM_XA, CODEC_ID_ADPCM_ADX, CODEC_ID_ADPCM_EA, CODEC_ID_ADPCM_G726, CODEC_ID_ADPCM_CT, CODEC_ID_ADPCM_SWF, CODEC_ID_ADPCM_YAMAHA, CODEC_ID_ADPCM_SBPRO_4, CODEC_ID_ADPCM_SBPRO_3, CODEC_ID_ADPCM_SBPRO_2, CODEC_ID_ADPCM_THP, CODEC_ID_ADPCM_IMA_AMV, CODEC_ID_ADPCM_EA_R1, CODEC_ID_ADPCM_EA_R3, CODEC_ID_ADPCM_EA_R2, CODEC_ID_ADPCM_IMA_EA_SEAD, CODEC_ID_ADPCM_IMA_EA_EACS, CODEC_ID_ADPCM_EA_XAS, CODEC_ID_ADPCM_EA_MAXIS_XA, CODEC_ID_ADPCM_IMA_ISS, CODEC_ID_ADPCM_G722, CODEC_ID_ADPCM_IMA_APC, CODEC_ID_VIMA = MKBETAG('V','I','M','A'), /* AMR */ CODEC_ID_AMR_NB = 0x12000, CODEC_ID_AMR_WB, /* RealAudio codecs*/ CODEC_ID_RA_144 = 0x13000, CODEC_ID_RA_288, /* various DPCM codecs */ CODEC_ID_ROQ_DPCM = 0x14000, CODEC_ID_INTERPLAY_DPCM, CODEC_ID_XAN_DPCM, CODEC_ID_SOL_DPCM, /* audio codecs */ CODEC_ID_MP2 = 0x15000, CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 CODEC_ID_AAC, CODEC_ID_AC3, CODEC_ID_DTS, CODEC_ID_VORBIS, CODEC_ID_DVAUDIO, CODEC_ID_WMAV1, CODEC_ID_WMAV2, CODEC_ID_MACE3, CODEC_ID_MACE6, CODEC_ID_VMDAUDIO, CODEC_ID_FLAC, CODEC_ID_MP3ADU, CODEC_ID_MP3ON4, CODEC_ID_SHORTEN, CODEC_ID_ALAC, CODEC_ID_WESTWOOD_SND1, CODEC_ID_GSM, ///< as in Berlin toast format CODEC_ID_QDM2, CODEC_ID_COOK, CODEC_ID_TRUESPEECH, CODEC_ID_TTA, CODEC_ID_SMACKAUDIO, CODEC_ID_QCELP, CODEC_ID_WAVPACK, CODEC_ID_DSICINAUDIO, CODEC_ID_IMC, CODEC_ID_MUSEPACK7, CODEC_ID_MLP, CODEC_ID_GSM_MS, /* as found in WAV */ CODEC_ID_ATRAC3, CODEC_ID_VOXWARE, CODEC_ID_APE, CODEC_ID_NELLYMOSER, CODEC_ID_MUSEPACK8, CODEC_ID_SPEEX, CODEC_ID_WMAVOICE, CODEC_ID_WMAPRO, CODEC_ID_WMALOSSLESS, CODEC_ID_ATRAC3P, CODEC_ID_EAC3, CODEC_ID_SIPR, CODEC_ID_MP1, CODEC_ID_TWINVQ, CODEC_ID_TRUEHD, CODEC_ID_MP4ALS, CODEC_ID_ATRAC1, CODEC_ID_BINKAUDIO_RDFT, CODEC_ID_BINKAUDIO_DCT, CODEC_ID_AAC_LATM, CODEC_ID_QDMC, CODEC_ID_CELT, CODEC_ID_G723_1, CODEC_ID_G729, CODEC_ID_8SVX_EXP, CODEC_ID_8SVX_FIB, CODEC_ID_BMV_AUDIO, CODEC_ID_RALF, CODEC_ID_IAC, CODEC_ID_ILBC, CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'), CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'), CODEC_ID_SONIC = MKBETAG('S','O','N','C'), CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'), CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'), CODEC_ID_OPUS = MKBETAG('O','P','U','S'), /* subtitle codecs */ CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. CODEC_ID_DVD_SUBTITLE = 0x17000, CODEC_ID_DVB_SUBTITLE, CODEC_ID_TEXT, ///< raw UTF-8 text CODEC_ID_XSUB, CODEC_ID_SSA, CODEC_ID_MOV_TEXT, CODEC_ID_HDMV_PGS_SUBTITLE, CODEC_ID_DVB_TELETEXT, CODEC_ID_SRT, CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'), CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'), CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'), CODEC_ID_SAMI = MKBETAG('S','A','M','I'), CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'), CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'), /* other specific kind of codecs (generally used for attachments) */ CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. CODEC_ID_TTF = 0x18000, CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'), CODEC_ID_XBIN = MKBETAG('X','B','I','N'), CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'), CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS * stream (only used by libavformat) */ CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems * stream (only used by libavformat) */ CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information. #endif /* AVCODEC_OLD_CODEC_IDS_H */
10,607
25.653266
116
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/code/ndn-dash/libdash/libav/include/libavcodec/avfft.h
/* * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef AVCODEC_AVFFT_H #define AVCODEC_AVFFT_H /** * @file * @ingroup lavc_fft * FFT functions */ /** * @defgroup lavc_fft FFT functions * @ingroup lavc_misc * * @{ */ typedef float FFTSample; typedef struct FFTComplex { FFTSample re, im; } FFTComplex; typedef struct FFTContext FFTContext; /** * Set up a complex FFT. * @param nbits log2 of the length of the input array * @param inverse if 0 perform the forward transform, if 1 perform the inverse */ FFTContext *av_fft_init(int nbits, int inverse); /** * Do the permutation needed BEFORE calling ff_fft_calc(). */ void av_fft_permute(FFTContext *s, FFTComplex *z); /** * Do a complex FFT with the parameters defined in av_fft_init(). The * input data must be permuted before. No 1.0/sqrt(n) normalization is done. */ void av_fft_calc(FFTContext *s, FFTComplex *z); void av_fft_end(FFTContext *s); FFTContext *av_mdct_init(int nbits, int inverse, double scale); void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input); void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); void av_mdct_end(FFTContext *s); /* Real Discrete Fourier Transform */ enum RDFTransformType { DFT_R2C, IDFT_C2R, IDFT_R2C, DFT_C2R, }; typedef struct RDFTContext RDFTContext; /** * Set up a real FFT. * @param nbits log2 of the length of the input array * @param trans the type of transform */ RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans); void av_rdft_calc(RDFTContext *s, FFTSample *data); void av_rdft_end(RDFTContext *s); /* Discrete Cosine Transform */ typedef struct DCTContext DCTContext; enum DCTTransformType { DCT_II = 0, DCT_III, DCT_I, DST_I, }; /** * Set up DCT. * @param nbits size of the input array: * (1 << nbits) for DCT-II, DCT-III and DST-I * (1 << nbits) + 1 for DCT-I * * @note the first element of the input of DST-I is ignored */ DCTContext *av_dct_init(int nbits, enum DCTTransformType type); void av_dct_calc(DCTContext *s, FFTSample *data); void av_dct_end (DCTContext *s); /** * @} */ #endif /* AVCODEC_AVFFT_H */
3,060
25.162393
86
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/code/ndn-dash/libdash/libav/include/libavcodec/vaapi.h
/* * Video Acceleration API (shared data between FFmpeg and the video player) * HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1 * * Copyright (C) 2008-2009 Splitted-Desktop Systems * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef AVCODEC_VAAPI_H #define AVCODEC_VAAPI_H /** * @file * @ingroup lavc_codec_hwaccel_vaapi * Public libavcodec VA API header. */ #include <stdint.h> /** * @defgroup lavc_codec_hwaccel_vaapi VA API Decoding * @ingroup lavc_codec_hwaccel * @{ */ /** * This structure is used to share data between the FFmpeg library and * the client video application. * This shall be zero-allocated and available as * AVCodecContext.hwaccel_context. All user members can be set once * during initialization or through each AVCodecContext.get_buffer() * function call. In any case, they must be valid prior to calling * decoding functions. */ struct vaapi_context { /** * Window system dependent data * * - encoding: unused * - decoding: Set by user */ void *display; /** * Configuration ID * * - encoding: unused * - decoding: Set by user */ uint32_t config_id; /** * Context ID (video decode pipeline) * * - encoding: unused * - decoding: Set by user */ uint32_t context_id; /** * VAPictureParameterBuffer ID * * - encoding: unused * - decoding: Set by libavcodec */ uint32_t pic_param_buf_id; /** * VAIQMatrixBuffer ID * * - encoding: unused * - decoding: Set by libavcodec */ uint32_t iq_matrix_buf_id; /** * VABitPlaneBuffer ID (for VC-1 decoding) * * - encoding: unused * - decoding: Set by libavcodec */ uint32_t bitplane_buf_id; /** * Slice parameter/data buffer IDs * * - encoding: unused * - decoding: Set by libavcodec */ uint32_t *slice_buf_ids; /** * Number of effective slice buffer IDs to send to the HW * * - encoding: unused * - decoding: Set by libavcodec */ unsigned int n_slice_buf_ids; /** * Size of pre-allocated slice_buf_ids * * - encoding: unused * - decoding: Set by libavcodec */ unsigned int slice_buf_ids_alloc; /** * Pointer to VASliceParameterBuffers * * - encoding: unused * - decoding: Set by libavcodec */ void *slice_params; /** * Size of a VASliceParameterBuffer element * * - encoding: unused * - decoding: Set by libavcodec */ unsigned int slice_param_size; /** * Size of pre-allocated slice_params * * - encoding: unused * - decoding: Set by libavcodec */ unsigned int slice_params_alloc; /** * Number of slices currently filled in * * - encoding: unused * - decoding: Set by libavcodec */ unsigned int slice_count; /** * Pointer to slice data buffer base * - encoding: unused * - decoding: Set by libavcodec */ const uint8_t *slice_data; /** * Current size of slice data * * - encoding: unused * - decoding: Set by libavcodec */ uint32_t slice_data_size; }; /* @} */ #endif /* AVCODEC_VAAPI_H */
4,007
22.034483
79
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/code/ndn-dash/libdash/libav/include/libavcodec/version.h
/* * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef AVCODEC_VERSION_H #define AVCODEC_VERSION_H /** * @file * @ingroup libavc * Libavcodec version macros. */ #define LIBAVCODEC_VERSION_MAJOR 54 #define LIBAVCODEC_VERSION_MINOR 55 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ LIBAVCODEC_VERSION_MICRO) #define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ LIBAVCODEC_VERSION_MICRO) #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT #define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION) /** * FF_API_* defines may be placed below to indicate public API that will be * dropped at a future version bump. The defines themselves are not part of * the public API and may change, break or disappear at any time. */ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55) #endif #ifndef FF_API_ALLOC_CONTEXT #define FF_API_ALLOC_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 55) #endif #ifndef FF_API_AVCODEC_OPEN #define FF_API_AVCODEC_OPEN (LIBAVCODEC_VERSION_MAJOR < 55) #endif #ifndef FF_API_OLD_DECODE_AUDIO #define FF_API_OLD_DECODE_AUDIO (LIBAVCODEC_VERSION_MAJOR < 55) #endif #ifndef FF_API_OLD_TIMECODE #define FF_API_OLD_TIMECODE (LIBAVCODEC_VERSION_MAJOR < 55) #endif #ifndef FF_API_OLD_ENCODE_AUDIO #define FF_API_OLD_ENCODE_AUDIO (LIBAVCODEC_VERSION_MAJOR < 55) #endif #ifndef FF_API_OLD_ENCODE_VIDEO #define FF_API_OLD_ENCODE_VIDEO (LIBAVCODEC_VERSION_MAJOR < 55) #endif #ifndef FF_API_MPV_GLOBAL_OPTS #define FF_API_MPV_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 55) #endif #ifndef FF_API_COLOR_TABLE_ID #define FF_API_COLOR_TABLE_ID (LIBAVCODEC_VERSION_MAJOR < 55) #endif #ifndef FF_API_INTER_THRESHOLD #define FF_API_INTER_THRESHOLD (LIBAVCODEC_VERSION_MAJOR < 55) #endif #ifndef FF_API_SUB_ID #define FF_API_SUB_ID (LIBAVCODEC_VERSION_MAJOR < 55) #endif #ifndef FF_API_DSP_MASK #define FF_API_DSP_MASK (LIBAVCODEC_VERSION_MAJOR < 55) #endif #ifndef FF_API_FIND_BEST_PIX_FMT #define FF_API_FIND_BEST_PIX_FMT (LIBAVCODEC_VERSION_MAJOR < 55) #endif #ifndef FF_API_CODEC_ID #define FF_API_CODEC_ID (LIBAVCODEC_VERSION_MAJOR < 55) #endif #ifndef FF_API_VDA_ASYNC #define FF_API_VDA_ASYNC (LIBAVCODEC_VERSION_MAJOR < 55) #endif #endif /* AVCODEC_VERSION_H */
3,323
33.268041
79
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/code/ndn-dash/libdash/libav/include/libavcodec/dxva2.h
/* * DXVA2 HW acceleration * * copyright (c) 2009 Laurent Aimar * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef AVCODEC_DXVA_H #define AVCODEC_DXVA_H /** * @file * @ingroup lavc_codec_hwaccel_dxva2 * Public libavcodec DXVA2 header. */ #include <stdint.h> #include <d3d9.h> #include <dxva2api.h> /** * @defgroup lavc_codec_hwaccel_dxva2 DXVA2 * @ingroup lavc_codec_hwaccel * * @{ */ #define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards /** * This structure is used to provides the necessary configurations and data * to the DXVA2 FFmpeg HWAccel implementation. * * The application must make it available as AVCodecContext.hwaccel_context. */ struct dxva_context { /** * DXVA2 decoder object */ IDirectXVideoDecoder *decoder; /** * DXVA2 configuration used to create the decoder */ const DXVA2_ConfigPictureDecode *cfg; /** * The number of surface in the surface array */ unsigned surface_count; /** * The array of Direct3D surfaces used to create the decoder */ LPDIRECT3DSURFACE9 *surface; /** * A bit field configuring the workarounds needed for using the decoder */ uint64_t workaround; /** * Private to the FFmpeg AVHWAccel implementation */ unsigned report_id; }; /** * @} */ #endif /* AVCODEC_DXVA_H */
2,129
22.932584
109
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/code/ndn-dash/libdash/libav/include/libswresample/swresample.h
/* * Copyright (C) 2011-2012 Michael Niedermayer ([email protected]) * * This file is part of libswresample * * libswresample is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * libswresample is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with libswresample; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** * @file * libswresample public header */ #ifndef SWR_H #define SWR_H #include <inttypes.h> #include "libavutil/samplefmt.h" #define LIBSWRESAMPLE_VERSION_MAJOR 0 #define LIBSWRESAMPLE_VERSION_MINOR 15 #define LIBSWRESAMPLE_VERSION_MICRO 100 #define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ LIBSWRESAMPLE_VERSION_MINOR, \ LIBSWRESAMPLE_VERSION_MICRO) #if LIBSWRESAMPLE_VERSION_MAJOR < 1 #define SWR_CH_MAX 32 ///< Maximum number of channels #endif #define SWR_FLAG_RESAMPLE 1 ///< Force resampling even if equal sample rate //TODO use int resample ? //long term TODO can we enable this dynamically? enum SwrDitherType { SWR_DITHER_NONE = 0, SWR_DITHER_RECTANGULAR, SWR_DITHER_TRIANGULAR, SWR_DITHER_TRIANGULAR_HIGHPASS, SWR_DITHER_NB, ///< not part of API/ABI }; /** Resampling Filter Types */ enum SwrFilterType { SWR_FILTER_TYPE_CUBIC, /**< Cubic */ SWR_FILTER_TYPE_BLACKMAN_NUTTALL, /**< Blackman Nuttall Windowed Sinc */ SWR_FILTER_TYPE_KAISER, /**< Kaiser Windowed Sinc */ }; typedef struct SwrContext SwrContext; /** * Get the AVClass for swrContext. It can be used in combination with * AV_OPT_SEARCH_FAKE_OBJ for examining options. * * @see av_opt_find(). */ const AVClass *swr_get_class(void); /** * Allocate SwrContext. * * If you use this function you will need to set the parameters (manually or * with swr_alloc_set_opts()) before calling swr_init(). * * @see swr_alloc_set_opts(), swr_init(), swr_free() * @return NULL on error, allocated context otherwise */ struct SwrContext *swr_alloc(void); /** * Initialize context after user parameters have been set. * * @return AVERROR error code in case of failure. */ int swr_init(struct SwrContext *s); /** * Allocate SwrContext if needed and set/reset common parameters. * * This function does not require s to be allocated with swr_alloc(). On the * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters * on the allocated context. * * @param s Swr context, can be NULL * @param out_ch_layout output channel layout (AV_CH_LAYOUT_*) * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_*). * @param out_sample_rate output sample rate (frequency in Hz) * @param in_ch_layout input channel layout (AV_CH_LAYOUT_*) * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_*). * @param in_sample_rate input sample rate (frequency in Hz) * @param log_offset logging level offset * @param log_ctx parent logging context, can be NULL * * @see swr_init(), swr_free() * @return NULL on error, allocated context otherwise */ struct SwrContext *swr_alloc_set_opts(struct SwrContext *s, int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, int log_offset, void *log_ctx); /** * Free the given SwrContext and set the pointer to NULL. */ void swr_free(struct SwrContext **s); /** * Convert audio. * * in and in_count can be set to 0 to flush the last few samples out at the * end. * * If more input is provided than output space then the input will be buffered. * You can avoid this buffering by providing more output space than input. * Convertion will run directly without copying whenever possible. * * @param s allocated Swr context, with parameters set * @param out output buffers, only the first one need be set in case of packed audio * @param out_count amount of space available for output in samples per channel * @param in input buffers, only the first one need to be set in case of packed audio * @param in_count number of input samples available in one channel * * @return number of samples output per channel, negative value on error */ int swr_convert(struct SwrContext *s, uint8_t **out, int out_count, const uint8_t **in , int in_count); /** * Convert the next timestamp from input to output * timestampe are in 1/(in_sample_rate * out_sample_rate) units. * * @note There are 2 slightly differently behaving modes. * First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX) * in this case timestamps will be passed through with delays compensated * Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX) * in this case the output timestamps will match output sample numbers * * @param pts timstamp for the next input sample, INT64_MIN if unknown * @returns the output timestamp for the next output sample */ int64_t swr_next_pts(struct SwrContext *s, int64_t pts); /** * Activate resampling compensation. */ int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance); /** * Set a customized input channel mapping. * * @param s allocated Swr context, not yet initialized * @param channel_map customized input channel mapping (array of channel * indexes, -1 for a muted channel) * @return AVERROR error code in case of failure. */ int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map); /** * Set a customized remix matrix. * * @param s allocated Swr context, not yet initialized * @param matrix remix coefficients; matrix[i + stride * o] is * the weight of input channel i in output channel o * @param stride offset between lines of the matrix * @return AVERROR error code in case of failure. */ int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride); /** * Drops the specified number of output samples. */ int swr_drop_output(struct SwrContext *s, int count); /** * Injects the specified number of silence samples. */ int swr_inject_silence(struct SwrContext *s, int count); /** * Gets the delay the next input sample will experience relative to the next output sample. * * Swresample can buffer data if more input has been provided than available * output space, also converting between sample rates needs a delay. * This function returns the sum of all such delays. * * @param s swr context * @param base timebase in which the returned delay will be * if its set to 1 the returned delay is in seconds * if its set to 1000 the returned delay is in milli seconds * if its set to the input sample rate then the returned delay is in input samples * if its set to the output sample rate then the returned delay is in output samples * an exact rounding free delay can be found by using LCM(in_sample_rate, out_sample_rate) * @returns the delay in 1/base units. */ int64_t swr_get_delay(struct SwrContext *s, int64_t base); /** * Return the LIBSWRESAMPLE_VERSION_INT constant. */ unsigned swresample_version(void); /** * Return the swr build-time configuration. */ const char *swresample_configuration(void); /** * Return the swr license. */ const char *swresample_license(void); #endif
8,194
35.101322
117
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/code/ndn-dash/libdash/libav/include/libpostproc/postprocess.h
/* * Copyright (C) 2001-2003 Michael Niedermayer ([email protected]) * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef POSTPROC_POSTPROCESS_H #define POSTPROC_POSTPROCESS_H /** * @file * @brief * external postprocessing API */ #include "libavutil/avutil.h" #ifndef LIBPOSTPROC_VERSION_MAJOR #define LIBPOSTPROC_VERSION_MAJOR 52 #define LIBPOSTPROC_VERSION_MINOR 0 #define LIBPOSTPROC_VERSION_MICRO 100 #endif #define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \ LIBPOSTPROC_VERSION_MINOR, \ LIBPOSTPROC_VERSION_MICRO) #define LIBPOSTPROC_VERSION AV_VERSION(LIBPOSTPROC_VERSION_MAJOR, \ LIBPOSTPROC_VERSION_MINOR, \ LIBPOSTPROC_VERSION_MICRO) #define LIBPOSTPROC_BUILD LIBPOSTPROC_VERSION_INT #define LIBPOSTPROC_IDENT "postproc" AV_STRINGIFY(LIBPOSTPROC_VERSION) /** * Return the LIBPOSTPROC_VERSION_INT constant. */ unsigned postproc_version(void); /** * Return the libpostproc build-time configuration. */ const char *postproc_configuration(void); /** * Return the libpostproc license. */ const char *postproc_license(void); #define PP_QUALITY_MAX 6 #define QP_STORE_T int8_t #include <inttypes.h> typedef void pp_context; typedef void pp_mode; #if LIBPOSTPROC_VERSION_INT < (52<<16) typedef pp_context pp_context_t; typedef pp_mode pp_mode_t; extern const char *const pp_help; ///< a simple help text #else extern const char pp_help[]; ///< a simple help text #endif void pp_postprocess(const uint8_t * src[3], const int srcStride[3], uint8_t * dst[3], const int dstStride[3], int horizontalSize, int verticalSize, const QP_STORE_T *QP_store, int QP_stride, pp_mode *mode, pp_context *ppContext, int pict_type); /** * Return a pp_mode or NULL if an error occurred. * * @param name the string after "-pp" on the command line * @param quality a number from 0 to PP_QUALITY_MAX */ pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality); void pp_free_mode(pp_mode *mode); pp_context *pp_get_context(int width, int height, int flags); void pp_free_context(pp_context *ppContext); #define PP_CPU_CAPS_MMX 0x80000000 #define PP_CPU_CAPS_MMX2 0x20000000 #define PP_CPU_CAPS_3DNOW 0x40000000 #define PP_CPU_CAPS_ALTIVEC 0x10000000 #define PP_FORMAT 0x00000008 #define PP_FORMAT_420 (0x00000011|PP_FORMAT) #define PP_FORMAT_422 (0x00000001|PP_FORMAT) #define PP_FORMAT_411 (0x00000002|PP_FORMAT) #define PP_FORMAT_444 (0x00000000|PP_FORMAT) #define PP_PICT_TYPE_QP2 0x00000010 ///< MPEG2 style QScale #endif /* POSTPROC_POSTPROCESS_H */
3,519
30.150442
79
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/code/ndn-dash/sdk/index.html
<!DOCTYPE html> <!-- * * Copyright (C) 2015, bitmovin GmbH, All Rights Reserved * * Created on: 2015-06-25 14:00:00 * Author: bitmovin GmbH <[email protected]> * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. * --> <html lang="en"> <head> <title>libdash SDK</title> <meta charset="UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" type="text/css" href="style/demo.css"/> <link rel="stylesheet" type="text/css" href="style/style.css"/> <link href='http://fonts.googleapis.com/css?family=Dosis' rel='stylesheet' type='text/css'/> </head> <body> <div class="container"> <h1>The libdash SDK<span>The page contains links to the documentation, demonstrations and How To guides in context of libdash.</span></h1> <div class="content"> <ul class="ca-menu"> <li style="height: 150px;"> <a href="https://www.bitmovin.com/libdash_OpenSource/libdash_2_1_doxygen/index.html" target="_blank"> <span class="ca-icon">&#xf0c6;</span> <div class="ca-content"> <h2 class="ca-main">Documentation</h2> <h3 class="ca-sub">Beneath a getting started guide, we provide detailed documentation on how to use and configure the player, our rich API, as well as other relevant information for using libdash.</h3> </div> </a> </li> <li style="height: 150px;"> <a href="howto/index.html"> <span class="ca-icon">&#xf121;</span> <div class="ca-content"> <h2 class="ca-main">How To Guide</h2> <h3 class="ca-sub">Within the How To guide, we show different usage scenarios and player configurations together with a detailed description and source code examples.</h3> </div> </a> </li> <li style="height: 150px;"> <a href="https://github.com/bitmovin/libdash" target="_blank"> <span class="ca-icon">&#xf03e;</span> <div class="ca-content"> <h2 class="ca-main">GitHub Repository</h2> <h3 class="ca-sub">Find more information and sources in our GitHub Repositora at https://github.com/bitmovin/libdash</h3> </div> </a> </li> <li style="height: 75px; background-color: rgba(49,197,199,0.5);"> <a href="https://lists.aau.at/mailman/listinfo/dash" target="_blank"> <span class="ca-icon" style="color: #ffffff; margin-top: -7px;">&#xf008;</span> <div class="ca-content"> <h2 class="ca-main" style="color: #ffffff;">Mailing List</h2> </div> </a> </li> <li style="height: 75px; background-color: rgba(44,62,80,0.5);"> <a href="http://www.bitmovin.com" target="_blank"> <span class="ca-icon" style="color: #ffffff; margin-top: -7px;">&#xf007;</span> <div class="ca-content"> <h2 class="ca-main" style="color: #ffffff">www.bitmovin.com</h2> </div> </a> </li> </ul> </div> <!-- content --> </div> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> <script type="text/javascript" src="howto/libdash/settings.js"></script> </body> </html>
3,370
42.217949
213
html
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/code/ndn-dash/sdk/howto/dvr.html
<!DOCTYPE html> <!-- * * Copyright (C) 2015, bitmovin GmbH, All Rights Reserved * * Created on: 2015-06-12 14:00:00 * Author: bitmovin GmbH <[email protected]> * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. * --> <html lang="en"> <head> <title>libdash SDK</title> <meta charset="UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" type="text/css" href="../style/demo.css"/> <link rel="stylesheet" type="text/css" href="../style/style.css"/> <link href='http://fonts.googleapis.com/css?family=Dosis' rel='stylesheet' type='text/css'/> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> <script type="text/javascript" src="libdash/settings.js"></script> <!-- player --> <script type="text/javascript" src="https://bitmovin-a.akamaihd.net/bitdash/latest/bitdash.min.js"></script> <style type="text/css" media="screen"> #version { color: red; text-decoration: underline; padding-left: 10px; } </style> </head> <body> <a href="index.html"><button id="back-button">Back to the Menu</button></a> <div class="container"> <h1>Live Stream DVR <span>Time Shift built-in</span></h1> <div class="content"> <div class="player-wrapper"> <div id="player"></div> </div> <div class="description"> <h2 class="ca-main">DVR in MPEG-DASH and HLS</h2> <p>Using DVR is easy: simply pause the player, take a break, and resume the live stream. If you were distracted and missed the last field goal, just go back a few minutes or seconds.</p> <p>The scrub bar (progress slider) can be used to go back in time, to have an immediate feedback about whether the player is playing at the live edge or not. And of course, jumping back to the live edge is supported as well.</p> <p>The player also offers an API for developers to control DVR (currently HTML5 player only), as shown in the following examples:</p> <pre><code class="language-javascript"> bitdash('player').getMaxTimeShift(); // Returns the size of the DVR window in seconds bitdash('player').timeShift(-120); // Sets the playback offset in seconds within the DVR window from the live edge bitdash('player').getTimeShift(); // Returns the current playback offset to the live edge </code></pre> <p></p> </div> </div> </div> <script type="text/javascript" src="js/ErrorMsgHelper.js"></script> <script type="text/javascript"> (function() { var createPlayer = function () { var conf = { key: window.libdashSettings.credentials.key, source: { dash: 'http://bitlivedemo-a.akamaihd.net/mpds/stream-exo-liveedge.php?streamkey=bitcodin&inputType=dash', hls: 'http://bitlivedemo-a.akamaihd.net/m3u8s/bitcodin.m3u8', poster: 'http://bitdash-a.akamaihd.net/webpages/dash-player/images/poster.png' }, style: { width: '100%' }, events: { onError: function (data) { console.error("error: " + data.code + ": " + data.message); }, onReady: function (data) { console.log(this.getVersion() + ' onReady: ', data); } } }; var player = bitdash('player'); player.setup(conf); }; createPlayer(); }()); </script> </body> </html>
3,558
37.268817
234
html
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/code/ndn-dash/sdk/howto/startupQuality.html
<!DOCTYPE html> <!-- * * Copyright (C) 2015, bitmovin GmbH, All Rights Reserved * * Created on: 2015-06-12 14:00:00 * Author: bitmovin GmbH <[email protected]> * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. * --> <html lang="en"> <head> <title>libdash SDK</title> <meta charset="UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" type="text/css" href="../style/demo.css"/> <link rel="stylesheet" type="text/css" href="../style/style.css"/> <link href='http://fonts.googleapis.com/css?family=Dosis' rel='stylesheet' type='text/css'/> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> <script type="text/javascript" src="js/PreferredStartupQuality.js"></script> <script type="text/javascript" src="libdash/settings.js"></script> <!-- player --> <script type="text/javascript" src="https://bitmovin-a.akamaihd.net/bitdash/latest/bitdash.min.js"></script> </head> <body> <a href="index.html"> <button id="back-button">Back to the Menu</button> </a> <div class="container"> <h1>Custom Adaptation Logic<span>Set a preferred startup quality</span></h1> <div class="content"> <div class="player-wrapper"> <div id="player"></div> </div> <div class="description"> <h2 class="ca-main">Getting Started with Custom Adaptation</h2> <p>The player provides two new events: <strong>onVideoAdaptation</strong> and <strong>onAudioAdaptation</strong>. It can be used to "overwrite" a suggested representation with any other. This can be used to create a custom adaptation logic.</p> <p>A sample implementation is available in <a href="js/PreferredStartupQuality.js">/howto/js/PreferredStartupQuality.js</a> adaptation folder of this package. It uses a preferred startup quality and searches for the representation equal to or lower than the startup quality. It uses this or a higher quality (if suggested by the player's internal logic) for a specified amount of time. It can be used as follows:</p> <pre><code class="language-javascript"> var player = bitdash('myVideoDiv'); player.setup(conf); var startupQuality = new PreferredStartupQuality(player, 1000000, 10); </code></pre> <p>The first parameter is the player object. The second is the preferred quality in bits per seconds and is optional. It defaults to 1mbps. The third, also optional, specifies how long the startup phase lasts, in seconds.</p> <p>In addition, it's recommended to set a higher startup threshold than using the default adaptation logic. This is the number of seconds of data which has to be buffered on the client before playback begins. For the PreferredStartupQuality provided, e.g. 5 seconds works for better but also for poorer bandwidth quite good:</p> <pre><code class="language-javascript"> var config = { ... tweaks: { startup_threshold: 5 } }</code></pre> </div> </div> </div> <script type="text/javascript"> (function() { var conf = { key: window.libdashSettings.credentials.key, source: { dash: 'https://bitdash-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd' }, style: { width: '50vw', aspectratio: '16/9' }, tweaks: { startup_threshold: 5 } }; var player = bitdash('player'); player.setup(conf); var startupQuality = new PreferredStartupQuality(player, 1000000, 10); })(); </script> </body> </html>
3,730
41.885057
422
html
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/code/ndn-dash/sdk/howto/technologySelection.html
<!DOCTYPE html> <!-- * * Copyright (C) 2015, bitmovin GmbH, All Rights Reserved * * Created on: 2015-06-12 14:00:00 * Author: bitmovin GmbH <[email protected]> * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. * --> <html lang="en"> <head> <title>libdash SDK</title> <meta charset="UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" type="text/css" href="../style/demo.css"/> <link rel="stylesheet" type="text/css" href="../style/style.css"/> <link href='http://fonts.googleapis.com/css?family=Dosis' rel='stylesheet' type='text/css'/> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> <script type="text/javascript" src="libdash/settings.js"></script> <!-- player --> <script type="text/javascript" src="https://bitmovin-a.akamaihd.net/bitdash/latest/bitdash.min.js"></script> <style type="text/css" media="screen"> #version { color: red; text-decoration: underline; padding-left: 10px; } </style> </head> <body> <a href="index.html"><button id="back-button">Back to the Menu</button></a> <div class="container"> <h1>Platform Independent Playout <span>Automatic Technology Selection</span></h1> <div class="content"> <div class="player-wrapper"> <div id="player"></div> </div> <div class="description"> <h2 class="ca-main">The player finds a Playback Option for Every Platform</h2> <p>It chooses between three different streaming technologies, namely: <ul class="demo-description"> <li>MPEG-DASH</li> <li>HLS</li> <li>Progressive</li> </ul> As well as three different player options: <ul class="demo-description"> <li>HTML5/MSE based</li> <li>Flash based</li> <li>Native Support</li> </ul> </p> <p>Open this page in different browser with or without Flash and see how the underlying technology changes:</p> <p>Version:<span id="version">unkown version</span></p> </div> <div class="description"> <h2 class="ca-main">How to Achieve the Optimal Platform Coverage</h2> <p>To achieve the optimal platform coverage, simple add different streaming technologies to the configuration. The player will automatically choose what's best for the underlying platform. The source section of the config option for this demo looks like the following:</p> <pre><code class="language-javascript"> source: { dash : "http://bitdash-a.akamaihd.net/content/sintel/sintel.mpd", hls : "http://bitdash-a.akamaihd.net/content/sintel/hls/sintel.m3u8", progressive : [ "http://bitdash-a.akamaihd.net/content/sintel/Sintel.mp4", "http://bitdash-a.akamaihd.net/content/sintel/Sintel.webm" ], poster : "http://bitdash-a.akamaihd.net/content/sintel/poster.png" } </code></pre> <p>A detailed overview of supported technologies can be found in our <a href="http://developer.dash-player.com/supported-formats-devices" target="_blank">device coverage documentation</a>.</p> <p>For more information about the configuration using different streaming technologies, please have a look at the <a href="http://developer.dash-player.com/player-configuration" target="_blank">related document</a>.</p> </div> </div> </div> <script type="text/javascript" src="js/ErrorMsgHelper.js"></script> <script type="text/javascript"> (function() { var createPlayer = function () { var conf = { key: window.libdashSettings.credentials.key, source: { dash: 'http://bitdash-a.akamaihd.net/content/sintel/sintel.mpd', hls: 'http://bitdash-a.akamaihd.net/content/sintel/hls/sintel.m3u8', progressive: [ 'http://bitdash-a.akamaihd.net/content/sintel/Sintel.mp4', 'http://bitdash-a.akamaihd.net/content/sintel/Sintel.webm' ], poster: 'http://bitdash-a.akamaihd.net/content/sintel/poster.png' }, style: { width: '100%' }, events: { onError: function (data) { console.error("error: " + data.code + ": " + data.message); }, onReady: function (data) { console.log(this.getVersion() + ' onReady: ', data); document.getElementById('version').innerHTML = this.getVersion(true); } } }; var player = bitdash('player'); player.setup(conf); }; createPlayer(); }()); </script> </body> </html>
4,876
38.650407
198
html
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/code/ndn-dash/sdk/howto/simpleConfiguration.html
<!DOCTYPE html> <!-- * * Copyright (C) 2015, bitmovin GmbH, All Rights Reserved * * Created on: 2015-06-12 14:00:00 * Author: bitmovin GmbH <[email protected]> * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. * --> <html lang="en"> <head> <title>libdash SDK</title> <meta charset="UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" type="text/css" href="../style/demo.css"/> <link rel="stylesheet" type="text/css" href="../style/style.css"/> <link href='http://fonts.googleapis.com/css?family=Dosis' rel='stylesheet' type='text/css'/> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> <script type="text/javascript" src="libdash/settings.js"></script> <!-- player --> <script type="text/javascript" src="https://bitmovin-a.akamaihd.net/bitdash/latest/bitdash.min.js"></script> </head> <body> <a href="index.html"><button id="back-button">Back to the Menu</button></a> <div class="container"> <h1>A simple configuration <span>Getting Startedd</span></h1> <div class="content"> <div class="player-wrapper"> <div id="player"></div> </div> <div class="description"> <h2 class="ca-main">Getting Started with the Most Simple Configuration</h2> <pre><code class="language-javascript"> &lt;script src="<span id="cdnPath"></span>"&gt; &lt;/script&gt; </code></pre> <p>And tell the player what to do, using a config object, which might look as follows:</p> <pre><code class="language-javascript"> var config = { key : '<span id="playerKey"></span>', source: { dash: 'https://bitdash-a.akamaihd.net/.../f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd' } }</code></pre> <p>All entries within the config object are case sensitive. The config object can have further (optional) properties. While key is a string, all others are objects. The next step is to add and setup a player. Just pass the unique id of an HTML container element (like div):</p> <pre><code class="language-javascript"> var player = bitdash('player'); player.setup(conf); </code></pre> <p>It's as simple as that! For more information about the player configuration, please have a look at the <a href="http://developer.dash-player.com/player-configuration" target="_blank">related document</a>.</p> </div> </div> </div> <script type="text/javascript" src="js/ErrorMsgHelper.js"></script> <script type="text/javascript"> (function() { document.getElementById('playerKey').innerHTML = window.libdashSettings.credentials.key; document.getElementById('cdnPath').innerHTML = window.libdashSettings.cdnPath; var createPlayer = function () { var conf = { key: window.libdashSettings.credentials.key, source: { dash: 'https://bitdash-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd' }, style: { width: '50vw', aspectratio: '16/9' } }; var player = bitdash('player'); player.setup(conf); }; createPlayer(); }()); </script> </body> </html>
3,410
37.325843
217
html
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/code/ndn-dash/sdk/howto/keyboard.html
<!DOCTYPE html> <!-- * * Copyright (C) 2015, bitmovin GmbH, All Rights Reserved * * Created on: 2015-06-12 14:00:00 * Author: bitmovin GmbH <[email protected]> * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. * --> <html lang="en"> <head> <title>libdash SDK</title> <meta charset="UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" type="text/css" href="../style/demo.css"/> <link rel="stylesheet" type="text/css" href="../style/style.css"/> <link href='http://fonts.googleapis.com/css?family=Dosis' rel='stylesheet' type='text/css'/> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> <script type="text/javascript" src="libdash/settings.js"></script> <!-- player --> <script type="text/javascript" src="https://bitmovin-a.akamaihd.net/bitdash/latest/bitdash.min.js"></script> <script> function goBack() { window.history.back(); } </script> </head> <body> <button id="back-button" onclick="goBack()">Back to the Menu</button> <div class="container"> <h1>Keyboard Controls</span></h1> <div class="content"> <div class="player-wrapper"> <div id="player"></div> </div> <div class="description"> <h2 class="ca-main">Keyboard Controls</h2> <p>We have implemented several different commands for playback control via keyboard shortcuts:</p> <table> <tr> <td> <ul class="demo-description"> <li>Play/Pause</li> <li>Mute/Unmute</li> <li>Enter Fullscreen</li> <li>Exit Fullscreen</li> <li>Seek + 5 seconds</li> <li>Seek + 10 seconds</li> <li>Seek - 5 seconds</li> <li>Seek - 10 seconds</li> <li>Volume + 5%</li> <li>Volume + 10%</li> <li>Volume - 5%</li> <li>Volume - 10%</li> </ul> </td> <td style="padding-left:20px;"> <ul> <li><span>Space</span></li> <li><span>M</span></li> <li><span>F</span></li> <li><span>Esc</span></li> <li><span>right</span></li> <li><span>CTRL + right</span></li> <li><span>left</span></li> <li><span>CTRL + left</span></li> <li><span>up</span></li> <li><span>CTRL + up</span></li> <li><span>down</span></li> <li><span>CTRL + down</span></li> </ul> </td> </tr> </table> <p>Our implementation is open for additional keyboard shortcuts.</p> </div> </div> </div> <script type="text/javascript" src="js/ErrorMsgHelper.js"></script> <script type="text/javascript"> (function() { var createPlayer = function () { var conf = { key: window.libdashSettings.credentials.key, source: { dash: 'https://bitdash-a.akamaihd.net/content/MI201309180161/mpds/37340d42-5d62-49f5-a832-3615fac80a89.mpd', hls: 'https://bitdash-a.akamaihd.net/content/MI201309180161/m3u8s/37340d42-5d62-49f5-a832-3615fac80a89.m3u8', poster: 'https://bitdash-a.akamaihd.net/content/MI201309180161/poster-image.jpg' }, style: { width: '100%' }, events: { onError: function (data) { console.error("error: " + data.code + ": " + data.message); }, onReady: function (data) { console.log(this.getVersion() + ' onReady: ', data); } } }; var player = bitdash('player'); player.setup(conf); }; createPlayer(); }()); </script> </body> </html>
3,921
31.683333
119
html
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/code/ndn-dash/sdk/howto/subtitles.html
<!DOCTYPE html> <!-- * * Copyright (C) 2015, bitmovin GmbH, All Rights Reserved * * Created on: 2015-06-12 14:00:00 * Author: bitmovin GmbH <[email protected]> * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. * --> <html lang="en"> <head> <title>libdash SDK</title> <meta charset="UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" type="text/css" href="../style/demo.css"/> <link rel="stylesheet" type="text/css" href="../style/style.css"/> <link href='http://fonts.googleapis.com/css?family=Dosis' rel='stylesheet' type='text/css'/> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> <script type="text/javascript" src="libdash/settings.js"></script> <!-- player --> <script type="text/javascript" src="https://bitmovin-a.akamaihd.net/bitdash/latest/bitdash.min.js"></script> </head> <body> <a href="index.html"><button id="back-button">Back to the Menu</button></a> <div class="container"> <h1>Subtitles & Closed Captions <span>Displaying text for additional or interpretive information</span></h1> <div class="content"> <div class="player-wrapper"> <div id="player"></div> </div> <div class="description"> <h2 class="ca-main">Subtitles or Closed Captions specified in the Manifest</h2> <p>The player supports multiple audio/language tracks, without the need of duplication or repackaging the video. Publishers can easily provide multiple language tracks for video assets, where our players support multi-bitrate audio tracks also in multi-language scenarios. It further includes functionalities that allows viewers to instantaneously switch to an alternate audio track either before or during playback.</p> <p>Text Tracks can be specified within the MPD or M3u8, as it can be seen in our <a href="http://bitdash-a.akamaihd.net/content/sintel/sintel.mpd" target="_blank">DASH (mpd)</a> and <a href="http://bitdash-a.akamaihd.net/content/sintel/hls/sintel.m3u8" target="_blank">HLS (m3u8) test streams</a>.</p> </div> </div> </div> <script type="text/javascript" src="js/ErrorMsgHelper.js"></script> <script type="text/javascript"> (function() { var createPlayer = function () { var conf = { key: window.libdashSettings.credentials.key, source: { dash: 'http://bitdash-a.akamaihd.net/content/sintel/sintel.mpd', hls: 'http://bitdash-a.akamaihd.net/content/sintel/hls/sintel.m3u8', progressive: [ 'http://bitdash-a.akamaihd.net/content/sintel/Sintel.mp4', 'http://bitdash-a.akamaihd.net/content/sintel/Sintel.webm' ], poster: 'http://bitdash-a.akamaihd.net/content/sintel/poster.png' }, style: { width: '50vw', aspectratio: '16/9' }, events: { onError: function (data) { console.error("error: " + data.code + ": " + data.message); }, onReady: function (data) { console.log(this.getVersion() + ' onReady: ', data); } } }; var player = bitdash('player'); player.setup(conf); }; createPlayer(); }()); </script> </body> </html>
3,460
37.455556
127
html
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/code/ndn-dash/sdk/howto/index.html
<!DOCTYPE html> <!-- * * Copyright (C) 2015, bitmovin GmbH, All Rights Reserved * * Created on: 2015-06-12 14:00:00 * Author: bitmovin GmbH <[email protected]> * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. * --> <html lang="en"> <head> <title>libdash SDK</title> <meta charset="UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" type="text/css" href="../style/demo.css"/> <link rel="stylesheet" type="text/css" href="../style/style.css"/> <link href='http://fonts.googleapis.com/css?family=Dosis' rel='stylesheet' type='text/css'/> </head> <body> <div id="dimmed-fullscreen-container" onclick="hideErrorMessage()"> <div class="error-container" onclick="hideErrorMessage()"> <span class="ca-icon">&#xf00d;</span> <div class="ca-content"> <h2 class="ca-main" style="color:white;">Feature not supported</h2> <h3 id="error-message" style="color:white;">The player does not support this feature in this version.</h3> </div> </div> </div> <a href="../index.html"><button id="back-button">Back to the Menu</button></a> <div class="container"> <h1>libdash SDK</h1> <div class="content"> <ul class="ca-menu"> <li id="webserver-warning" style="height: 150px; background-color: rgba(255,0,0,0.6); display: none;"> <span class="ca-icon">&#xf00d;</span> <div class="ca-content"> <h2 class="ca-main" style="color:white;">Unsupported Protocol</h2> <h3 style="color:white;">This file has been loaded using the unsupported "file" protocol. Please use a web server and open this page using http or https.</h3> </div> </li> <li style="height: 150px;"> <a href="simpleConfiguration.html"> <span class="ca-icon">&#xf008;</span> <div class="ca-content"> <h2 class="ca-main">A Simple Configuration <span>simpleConfiguration.html</span></h2> <h3 class="ca-sub">This demonstrations shows a simple and lightweight player configuration and how to embed it into your website using HTML.</h3> </div> </a> </li> <li style="height: 250px;"> <a href="technologySelection.html"> <span class="ca-icon">&#xf085;</span> <div class="ca-content"> <h2 class="ca-main">Smart Choices<br><span>technologySelection.html</span></h2> <h3 class="ca-sub">The player chooses from different streaming technologies, ranging from MPEG-DASH and HLS to progressive streaming based on browser capabilities, to provided the best platform independent streaming experience. Furthermore different quality representations of the video and audio streams are selected automatically, based on bitmovin’s advanced and US-patented adaptation & streaming algorithms.</h3> </div> </a> </li> <li style="height: 200px;"> <a href="dvr.html"> <span class="ca-icon">&#xf017;</span> <div class="ca-content"> <h2 class="ca-main">Live DVR<br><span>dvr.html</span></h2> <h3 class="ca-sub">The player supports DVR in live streams of both, HLS and MPEG-DASH. The available DVR window depends on the Manifest file.</h3> </div> </a> </li> <li style="height: 180px;"> <a href="startupQuality.html"> <span class="ca-icon">&#xf012;</span> <div class="ca-content"> <h2 class="ca-main">Custom Quality Adaptation<br><span>startupQuality.html</span></h2> <h3 class="ca-sub">The player provides you the ability to freely decide which quality to use for every single segment! Although it gives you a suggestion, you can adapt the quality based on your own metrics and experience.</h3> </div> </a> </li> <li style="height: 200px;"> <a href="keyboard.html"> <span class="ca-icon">&#xf11c;</span> <div class="ca-content"> <h2 class="ca-main">Using Keyboard Shortcuts<br><span>keyboard.html</span></h2> <h3 class="ca-sub">We all know how handy it can be to press space to pause a video, or increasing the volume by using the up-key. This are only two examples of keys which can be used for control.</h3> </div> </a> </li> <li style="height: 150px;"> <a href="subtitles.html"> <span class="ca-icon">&#xf27b;</span> <div class="ca-content"> <h2 class="ca-main">Subtitles and Closed Captions <span>subtitles.html</span></h2> <h3 class="ca-sub">Using the player, one can use different kinds of subtitles or closed captions, either specified in the Manifest or set via an API Command.</h3> </div> </a> </li> <li style="height: 200px;"> <a href="javascriptAPI.html"> <span class="ca-icon">&#xf121;</span> <div class="ca-content"> <h2 class="ca-main">Developing <span>javascriptAPI.html</span></h2> <h3 class="ca-sub">The player can be controlled using a JavaScript API. Furthermore, several callback functions for different types of events can be added. The demo shows the usage of such events and API call to get playback information about the player and user interaction, which can for instance be used for analytic purposes.</h3> </div> </a> </li> </ul> </div> <!-- content --> </div> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> <script type="text/javascript" src="libdash/settings.js"></script> </body> </html>
5,833
48.02521
212
html
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/code/ndn-dash/sdk/howto/javascriptAPI.html
<!DOCTYPE html> <!-- * * Copyright (C) 2015, bitmovin GmbH, All Rights Reserved * * Created on: 2015-06-12 14:00:00 * Author: bitmovin GmbH <[email protected]> * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. * --> <html lang="en"> <head> <title>libdash SDK</title> <meta charset="UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" type="text/css" href="../style/demo.css"/> <link rel="stylesheet" type="text/css" href="../style/style.css"/> <link href='http://fonts.googleapis.com/css?family=Dosis' rel='stylesheet' type='text/css'/> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> <script type="text/javascript" src="libdash/settings.js"></script> <!-- player --> <script type="text/javascript" src="https://bitmovin-a.akamaihd.net/bitdash/latest/bitdash.min.js"></script> <!-- chart library --> <script type="text/javascript" src="js/smoothie.js"></script> <style type="text/css" media="screen"> div#debugData h1 { font: 16px/26px 'PT Sans', sans-serif; font-weight: bold; } p#version { text-align: center; } div#videoData { width: 7em; margin-right: 20px; float: right; } div#videoDataLabels { width: 12em; float: left; } div#debugData { font: 16px/26px 'PT Sans', sans-serif; float: left; margin-bottom: 20px; } </style> </head> <body> <a href="index.html"><button id="back-button">Back to the Menu</button></a> <div class="container"> <h1>Player interaction<span>Using the JavaScript API and Event Callbacks</span></h1> <div class="content"> <div class="player-wrapper"> <div id="player"></div> </div> <div class="description"> <h2 class="ca-main">Video Bitrate Graph</h2> <div id="graphWrapper"> <canvas id="graph"></canvas> </div> </div> <div class="description"> <h2 class="ca-main">Data Monitoring</h2> <div id="debugData"> <p id="version">unkown version</p> <div id="videoData"> <p> <br> <span id='audioBuffer'>0.0</span> [sec]<br> <span id='videoBuffer'>0.0</span> [sec]<br> <br> <br> <span id='dlVideoBitrate'>0.0</span> [kbps]<br> <span id='dlResolution'>000 x 000</span><br> </p> </div> <div id="videoDataLabels"> <p> <strong>Playback Data</strong><br> Audio Buffer Length:<br> Video Buffer Length:<br> <br> <strong>Download Data</strong><br> Video Bitrate:<br> Resolution:<br> </p> </div> </div> <p style="clear:both;">For more information about how to interact with the player, please have a look at the <a href="http://developer.dash-player.com/javascript-api" target="_blank">related document</a>.</p> </div> </div> </div> <script type="text/javascript" src="js/ErrorMsgHelper.js"></script> <script type="text/javascript"> (function() { var createPlayer = function () { window.graphTimeSeries = new TimeSeries(); var conf = { key: window.libdashSettings.credentials.key, source: { dash: 'https://bitdash-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd', hls: 'https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8', poster: 'https://bitdash-a.akamaihd.net/content/MI201109210084_1/poster.jpg' }, style: { width: '50vw', aspectratio: '16/9' }, events: { onError: function (data) { console.error("error: " + data.code + ": " + data.message); }, onReady: function (data) { console.log(this.getVersion() + ' onReady: ', data); document.getElementById('version').innerHTML = this.getVersion(); startGraph(); } } }; var player = bitdash('player'); player.setup(conf); setInterval(function () { var downloadedVideoData = player.getDownloadedVideoData(); var videoBitrateKbps = Math.round(downloadedVideoData.bitrate / 10.24) / 100; document.getElementById('audioBuffer').innerHTML = player.getAudioBufferLength(); document.getElementById('videoBuffer').innerHTML = player.getVideoBufferLength(); document.getElementById('dlResolution').innerHTML = downloadedVideoData.width + ' x ' + downloadedVideoData.height; document.getElementById('dlVideoBitrate').innerHTML = videoBitrateKbps; window.graphTimeSeries.append(new Date().getTime(), videoBitrateKbps); }, 500); var startGraph = function () { var graph = document.getElementById('graph'); graph.width = graph.parentNode.offsetWidth; if (graph.width < 300) { graph.width = 300; } graph.height = 306; var smoothie = new SmoothieChart({ interpolation: 'step', labels: { precision: 0, fillStyle: '#000' }, maxValue: 6400, minValue: 0, millisPerPixel: 100, grid: { millisPerLine: 10000, borderVisible: false, fillStyle: 'transparent' } }); smoothie.streamTo(graph, 500); smoothie.addTimeSeries(window.graphTimeSeries, { strokeStyle: 'rgb(0, 0, 0)', lineWidth: 3 }); }; }; createPlayer(); }()); </script> </body> </html>
5,967
31.259459
214
html
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/random/randomkit.h
/* Random kit 1.3 */ /* * Copyright (c) 2003-2005, Jean-Sebastien Roy ([email protected]) * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* @(#) $Jeannot: randomkit.h,v 1.24 2005/07/21 22:14:09 js Exp $ */ /* * Typical use: * * { * rk_state state; * unsigned long seed = 1, random_value; * * rk_seed(seed, &state); // Initialize the RNG * ... * random_value = rk_random(&state); // Generate random values in [0..RK_MAX] * } * * Instead of rk_seed, you can use rk_randomseed which will get a random seed * from /dev/urandom (or the clock, if /dev/urandom is unavailable): * * { * rk_state state; * unsigned long random_value; * * rk_randomseed(&state); // Initialize the RNG with a random seed * ... * random_value = rk_random(&state); // Generate random values in [0..RK_MAX] * } */ /* * Useful macro: * RK_DEV_RANDOM: the device used for random seeding. * defaults to "/dev/urandom" */ #ifndef _RANDOMKIT_ #define _RANDOMKIT_ #include <stddef.h> #include <numpy/npy_common.h> #define RK_STATE_LEN 624 typedef struct rk_state_ { unsigned long key[RK_STATE_LEN]; int pos; int has_gauss; /* !=0: gauss contains a gaussian deviate */ double gauss; /* The rk_state structure has been extended to store the following * information for the binomial generator. If the input values of n or p * are different than nsave and psave, then the other parameters will be * recomputed. RTK 2005-09-02 */ int has_binomial; /* !=0: following parameters initialized for binomial */ double psave; long nsave; double r; double q; double fm; long m; double p1; double xm; double xl; double xr; double c; double laml; double lamr; double p2; double p3; double p4; } rk_state; typedef enum { RK_NOERR = 0, /* no error */ RK_ENODEV = 1, /* no RK_DEV_RANDOM device */ RK_ERR_MAX = 2 } rk_error; /* error strings */ extern char *rk_strerror[RK_ERR_MAX]; /* Maximum generated random value */ #define RK_MAX 0xFFFFFFFFUL #ifdef __cplusplus extern "C" { #endif /* * Initialize the RNG state using the given seed. */ extern void rk_seed(unsigned long seed, rk_state *state); /* * Initialize the RNG state using a random seed. * Uses /dev/random or, when unavailable, the clock (see randomkit.c). * Returns RK_NOERR when no errors occurs. * Returns RK_ENODEV when the use of RK_DEV_RANDOM failed (for example because * there is no such device). In this case, the RNG was initialized using the * clock. */ extern rk_error rk_randomseed(rk_state *state); /* * Returns a random unsigned long between 0 and RK_MAX inclusive */ extern unsigned long rk_random(rk_state *state); /* * Returns a random long between 0 and LONG_MAX inclusive */ extern long rk_long(rk_state *state); /* * Returns a random unsigned long between 0 and ULONG_MAX inclusive */ extern unsigned long rk_ulong(rk_state *state); /* * Returns a random unsigned long between 0 and max inclusive. */ extern unsigned long rk_interval(unsigned long max, rk_state *state); /* * Fills an array with cnt random npy_uint64 between off and off + rng * inclusive. The numbers wrap if rng is sufficiently large. */ extern void rk_random_uint64(npy_uint64 off, npy_uint64 rng, npy_intp cnt, npy_uint64 *out, rk_state *state); /* * Fills an array with cnt random npy_uint32 between off and off + rng * inclusive. The numbers wrap if rng is sufficiently large. */ extern void rk_random_uint32(npy_uint32 off, npy_uint32 rng, npy_intp cnt, npy_uint32 *out, rk_state *state); /* * Fills an array with cnt random npy_uint16 between off and off + rng * inclusive. The numbers wrap if rng is sufficiently large. */ extern void rk_random_uint16(npy_uint16 off, npy_uint16 rng, npy_intp cnt, npy_uint16 *out, rk_state *state); /* * Fills an array with cnt random npy_uint8 between off and off + rng * inclusive. The numbers wrap if rng is sufficiently large. */ extern void rk_random_uint8(npy_uint8 off, npy_uint8 rng, npy_intp cnt, npy_uint8 *out, rk_state *state); /* * Fills an array with cnt random npy_bool between off and off + rng * inclusive. It is assumed tha npy_bool as the same size as npy_uint8. */ extern void rk_random_bool(npy_bool off, npy_bool rng, npy_intp cnt, npy_bool *out, rk_state *state); /* * Returns a random double between 0.0 and 1.0, 1.0 excluded. */ extern double rk_double(rk_state *state); /* * fill the buffer with size random bytes */ extern void rk_fill(void *buffer, size_t size, rk_state *state); /* * fill the buffer with randombytes from the random device * Returns RK_ENODEV if the device is unavailable, or RK_NOERR if it is * On Unix, if strong is defined, RK_DEV_RANDOM is used. If not, RK_DEV_URANDOM * is used instead. This parameter has no effect on Windows. * Warning: on most unixes RK_DEV_RANDOM will wait for enough entropy to answer * which can take a very long time on quiet systems. */ extern rk_error rk_devfill(void *buffer, size_t size, int strong); /* * fill the buffer using rk_devfill if the random device is available and using * rk_fill if is is not * parameters have the same meaning as rk_fill and rk_devfill * Returns RK_ENODEV if the device is unavailable, or RK_NOERR if it is */ extern rk_error rk_altfill(void *buffer, size_t size, int strong, rk_state *state); /* * return a random gaussian deviate with variance unity and zero mean. */ extern double rk_gauss(rk_state *state); #ifdef __cplusplus } #endif #endif /* _RANDOMKIT_ */
6,799
28.955947
79
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/ufuncobject.h
#ifndef Py_UFUNCOBJECT_H #define Py_UFUNCOBJECT_H #include <numpy/npy_math.h> #include <numpy/npy_common.h> #ifdef __cplusplus extern "C" { #endif /* * The legacy generic inner loop for a standard element-wise or * generalized ufunc. */ typedef void (*PyUFuncGenericFunction) (char **args, npy_intp *dimensions, npy_intp *strides, void *innerloopdata); /* * The most generic one-dimensional inner loop for * a masked standard element-wise ufunc. "Masked" here means that it skips * doing calculations on any items for which the maskptr array has a true * value. */ typedef void (PyUFunc_MaskedStridedInnerLoopFunc)( char **dataptrs, npy_intp *strides, char *maskptr, npy_intp mask_stride, npy_intp count, NpyAuxData *innerloopdata); /* Forward declaration for the type resolver and loop selector typedefs */ struct _tagPyUFuncObject; /* * Given the operands for calling a ufunc, should determine the * calculation input and output data types and return an inner loop function. * This function should validate that the casting rule is being followed, * and fail if it is not. * * For backwards compatibility, the regular type resolution function does not * support auxiliary data with object semantics. The type resolution call * which returns a masked generic function returns a standard NpyAuxData * object, for which the NPY_AUXDATA_FREE and NPY_AUXDATA_CLONE macros * work. * * ufunc: The ufunc object. * casting: The 'casting' parameter provided to the ufunc. * operands: An array of length (ufunc->nin + ufunc->nout), * with the output parameters possibly NULL. * type_tup: Either NULL, or the type_tup passed to the ufunc. * out_dtypes: An array which should be populated with new * references to (ufunc->nin + ufunc->nout) new * dtypes, one for each input and output. These * dtypes should all be in native-endian format. * * Should return 0 on success, -1 on failure (with exception set), * or -2 if Py_NotImplemented should be returned. */ typedef int (PyUFunc_TypeResolutionFunc)( struct _tagPyUFuncObject *ufunc, NPY_CASTING casting, PyArrayObject **operands, PyObject *type_tup, PyArray_Descr **out_dtypes); /* * Given an array of DTypes as returned by the PyUFunc_TypeResolutionFunc, * and an array of fixed strides (the array will contain NPY_MAX_INTP for * strides which are not necessarily fixed), returns an inner loop * with associated auxiliary data. * * For backwards compatibility, there is a variant of the inner loop * selection which returns an inner loop irrespective of the strides, * and with a void* static auxiliary data instead of an NpyAuxData * * dynamically allocatable auxiliary data. * * ufunc: The ufunc object. * dtypes: An array which has been populated with dtypes, * in most cases by the type resolution function * for the same ufunc. * fixed_strides: For each input/output, either the stride that * will be used every time the function is called * or NPY_MAX_INTP if the stride might change or * is not known ahead of time. The loop selection * function may use this stride to pick inner loops * which are optimized for contiguous or 0-stride * cases. * out_innerloop: Should be populated with the correct ufunc inner * loop for the given type. * out_innerloopdata: Should be populated with the void* data to * be passed into the out_innerloop function. * out_needs_api: If the inner loop needs to use the Python API, * should set the to 1, otherwise should leave * this untouched. */ typedef int (PyUFunc_LegacyInnerLoopSelectionFunc)( struct _tagPyUFuncObject *ufunc, PyArray_Descr **dtypes, PyUFuncGenericFunction *out_innerloop, void **out_innerloopdata, int *out_needs_api); typedef int (PyUFunc_MaskedInnerLoopSelectionFunc)( struct _tagPyUFuncObject *ufunc, PyArray_Descr **dtypes, PyArray_Descr *mask_dtype, npy_intp *fixed_strides, npy_intp fixed_mask_stride, PyUFunc_MaskedStridedInnerLoopFunc **out_innerloop, NpyAuxData **out_innerloopdata, int *out_needs_api); typedef struct _tagPyUFuncObject { PyObject_HEAD /* * nin: Number of inputs * nout: Number of outputs * nargs: Always nin + nout (Why is it stored?) */ int nin, nout, nargs; /* Identity for reduction, either PyUFunc_One or PyUFunc_Zero */ int identity; /* Array of one-dimensional core loops */ PyUFuncGenericFunction *functions; /* Array of funcdata that gets passed into the functions */ void **data; /* The number of elements in 'functions' and 'data' */ int ntypes; /* Used to be unused field 'check_return' */ int reserved1; /* The name of the ufunc */ const char *name; /* Array of type numbers, of size ('nargs' * 'ntypes') */ char *types; /* Documentation string */ const char *doc; void *ptr; PyObject *obj; PyObject *userloops; /* generalized ufunc parameters */ /* 0 for scalar ufunc; 1 for generalized ufunc */ int core_enabled; /* number of distinct dimension names in signature */ int core_num_dim_ix; /* * dimension indices of input/output argument k are stored in * core_dim_ixs[core_offsets[k]..core_offsets[k]+core_num_dims[k]-1] */ /* numbers of core dimensions of each argument */ int *core_num_dims; /* * dimension indices in a flatted form; indices * are in the range of [0,core_num_dim_ix) */ int *core_dim_ixs; /* * positions of 1st core dimensions of each * argument in core_dim_ixs */ int *core_offsets; /* signature string for printing purpose */ char *core_signature; /* * A function which resolves the types and fills an array * with the dtypes for the inputs and outputs. */ PyUFunc_TypeResolutionFunc *type_resolver; /* * A function which returns an inner loop written for * NumPy 1.6 and earlier ufuncs. This is for backwards * compatibility, and may be NULL if inner_loop_selector * is specified. */ PyUFunc_LegacyInnerLoopSelectionFunc *legacy_inner_loop_selector; /* * This was blocked off to be the "new" inner loop selector in 1.7, * but this was never implemented. (This is also why the above * selector is called the "legacy" selector.) */ void *reserved2; /* * A function which returns a masked inner loop for the ufunc. */ PyUFunc_MaskedInnerLoopSelectionFunc *masked_inner_loop_selector; /* * List of flags for each operand when ufunc is called by nditer object. * These flags will be used in addition to the default flags for each * operand set by nditer object. */ npy_uint32 *op_flags; /* * List of global flags used when ufunc is called by nditer object. * These flags will be used in addition to the default global flags * set by nditer object. */ npy_uint32 iter_flags; } PyUFuncObject; #include "arrayobject.h" #define UFUNC_ERR_IGNORE 0 #define UFUNC_ERR_WARN 1 #define UFUNC_ERR_RAISE 2 #define UFUNC_ERR_CALL 3 #define UFUNC_ERR_PRINT 4 #define UFUNC_ERR_LOG 5 /* Python side integer mask */ #define UFUNC_MASK_DIVIDEBYZERO 0x07 #define UFUNC_MASK_OVERFLOW 0x3f #define UFUNC_MASK_UNDERFLOW 0x1ff #define UFUNC_MASK_INVALID 0xfff #define UFUNC_SHIFT_DIVIDEBYZERO 0 #define UFUNC_SHIFT_OVERFLOW 3 #define UFUNC_SHIFT_UNDERFLOW 6 #define UFUNC_SHIFT_INVALID 9 #define UFUNC_OBJ_ISOBJECT 1 #define UFUNC_OBJ_NEEDS_API 2 /* Default user error mode */ #define UFUNC_ERR_DEFAULT \ (UFUNC_ERR_WARN << UFUNC_SHIFT_DIVIDEBYZERO) + \ (UFUNC_ERR_WARN << UFUNC_SHIFT_OVERFLOW) + \ (UFUNC_ERR_WARN << UFUNC_SHIFT_INVALID) #if NPY_ALLOW_THREADS #define NPY_LOOP_BEGIN_THREADS do {if (!(loop->obj & UFUNC_OBJ_NEEDS_API)) _save = PyEval_SaveThread();} while (0); #define NPY_LOOP_END_THREADS do {if (!(loop->obj & UFUNC_OBJ_NEEDS_API)) PyEval_RestoreThread(_save);} while (0); #else #define NPY_LOOP_BEGIN_THREADS #define NPY_LOOP_END_THREADS #endif /* * UFunc has unit of 0, and the order of operations can be reordered * This case allows reduction with multiple axes at once. */ #define PyUFunc_Zero 0 /* * UFunc has unit of 1, and the order of operations can be reordered * This case allows reduction with multiple axes at once. */ #define PyUFunc_One 1 /* * UFunc has unit of -1, and the order of operations can be reordered * This case allows reduction with multiple axes at once. Intended for * bitwise_and reduction. */ #define PyUFunc_MinusOne 2 /* * UFunc has no unit, and the order of operations cannot be reordered. * This case does not allow reduction with multiple axes at once. */ #define PyUFunc_None -1 /* * UFunc has no unit, and the order of operations can be reordered * This case allows reduction with multiple axes at once. */ #define PyUFunc_ReorderableNone -2 #define UFUNC_REDUCE 0 #define UFUNC_ACCUMULATE 1 #define UFUNC_REDUCEAT 2 #define UFUNC_OUTER 3 typedef struct { int nin; int nout; PyObject *callable; } PyUFunc_PyFuncData; /* A linked-list of function information for user-defined 1-d loops. */ typedef struct _loop1d_info { PyUFuncGenericFunction func; void *data; int *arg_types; struct _loop1d_info *next; int nargs; PyArray_Descr **arg_dtypes; } PyUFunc_Loop1d; #include "__ufunc_api.h" #define UFUNC_PYVALS_NAME "UFUNC_PYVALS" #define UFUNC_CHECK_ERROR(arg) \ do {if ((((arg)->obj & UFUNC_OBJ_NEEDS_API) && PyErr_Occurred()) || \ ((arg)->errormask && \ PyUFunc_checkfperr((arg)->errormask, \ (arg)->errobj, \ &(arg)->first))) \ goto fail;} while (0) /* keep in sync with ieee754.c.src */ #if defined(sun) || defined(__BSD__) || defined(__OpenBSD__) || \ (defined(__FreeBSD__) && (__FreeBSD_version < 502114)) || \ defined(__NetBSD__) || \ defined(__GLIBC__) || defined(__APPLE__) || \ defined(__CYGWIN__) || defined(__MINGW32__) || \ (defined(__FreeBSD__) && (__FreeBSD_version >= 502114)) || \ defined(_AIX) || \ defined(_MSC_VER) || \ defined(__osf__) && defined(__alpha) #else #define NO_FLOATING_POINT_SUPPORT #endif /* * THESE MACROS ARE DEPRECATED. * Use npy_set_floatstatus_* in the npymath library. */ #define UFUNC_FPE_DIVIDEBYZERO NPY_FPE_DIVIDEBYZERO #define UFUNC_FPE_OVERFLOW NPY_FPE_OVERFLOW #define UFUNC_FPE_UNDERFLOW NPY_FPE_UNDERFLOW #define UFUNC_FPE_INVALID NPY_FPE_INVALID #define UFUNC_CHECK_STATUS(ret) \ { \ ret = npy_clear_floatstatus(); \ } #define generate_divbyzero_error() npy_set_floatstatus_divbyzero() #define generate_overflow_error() npy_set_floatstatus_overflow() /* Make sure it gets defined if it isn't already */ #ifndef UFUNC_NOFPE /* Clear the floating point exception default of Borland C++ */ #if defined(__BORLANDC__) #define UFUNC_NOFPE _control87(MCW_EM, MCW_EM); #else #define UFUNC_NOFPE #endif #endif #ifdef __cplusplus } #endif #endif /* !Py_UFUNCOBJECT_H */
12,524
33.409341
115
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/noprefix.h
#ifndef NPY_NOPREFIX_H #define NPY_NOPREFIX_H /* * You can directly include noprefix.h as a backward * compatibility measure */ #ifndef NPY_NO_PREFIX #include "ndarrayobject.h" #include "npy_interrupt.h" #endif #define SIGSETJMP NPY_SIGSETJMP #define SIGLONGJMP NPY_SIGLONGJMP #define SIGJMP_BUF NPY_SIGJMP_BUF #define MAX_DIMS NPY_MAXDIMS #define longlong npy_longlong #define ulonglong npy_ulonglong #define Bool npy_bool #define longdouble npy_longdouble #define byte npy_byte #ifndef _BSD_SOURCE #define ushort npy_ushort #define uint npy_uint #define ulong npy_ulong #endif #define ubyte npy_ubyte #define ushort npy_ushort #define uint npy_uint #define ulong npy_ulong #define cfloat npy_cfloat #define cdouble npy_cdouble #define clongdouble npy_clongdouble #define Int8 npy_int8 #define UInt8 npy_uint8 #define Int16 npy_int16 #define UInt16 npy_uint16 #define Int32 npy_int32 #define UInt32 npy_uint32 #define Int64 npy_int64 #define UInt64 npy_uint64 #define Int128 npy_int128 #define UInt128 npy_uint128 #define Int256 npy_int256 #define UInt256 npy_uint256 #define Float16 npy_float16 #define Complex32 npy_complex32 #define Float32 npy_float32 #define Complex64 npy_complex64 #define Float64 npy_float64 #define Complex128 npy_complex128 #define Float80 npy_float80 #define Complex160 npy_complex160 #define Float96 npy_float96 #define Complex192 npy_complex192 #define Float128 npy_float128 #define Complex256 npy_complex256 #define intp npy_intp #define uintp npy_uintp #define datetime npy_datetime #define timedelta npy_timedelta #define SIZEOF_LONGLONG NPY_SIZEOF_LONGLONG #define SIZEOF_INTP NPY_SIZEOF_INTP #define SIZEOF_UINTP NPY_SIZEOF_UINTP #define SIZEOF_HALF NPY_SIZEOF_HALF #define SIZEOF_LONGDOUBLE NPY_SIZEOF_LONGDOUBLE #define SIZEOF_DATETIME NPY_SIZEOF_DATETIME #define SIZEOF_TIMEDELTA NPY_SIZEOF_TIMEDELTA #define LONGLONG_FMT NPY_LONGLONG_FMT #define ULONGLONG_FMT NPY_ULONGLONG_FMT #define LONGLONG_SUFFIX NPY_LONGLONG_SUFFIX #define ULONGLONG_SUFFIX NPY_ULONGLONG_SUFFIX #define MAX_INT8 127 #define MIN_INT8 -128 #define MAX_UINT8 255 #define MAX_INT16 32767 #define MIN_INT16 -32768 #define MAX_UINT16 65535 #define MAX_INT32 2147483647 #define MIN_INT32 (-MAX_INT32 - 1) #define MAX_UINT32 4294967295U #define MAX_INT64 LONGLONG_SUFFIX(9223372036854775807) #define MIN_INT64 (-MAX_INT64 - LONGLONG_SUFFIX(1)) #define MAX_UINT64 ULONGLONG_SUFFIX(18446744073709551615) #define MAX_INT128 LONGLONG_SUFFIX(85070591730234615865843651857942052864) #define MIN_INT128 (-MAX_INT128 - LONGLONG_SUFFIX(1)) #define MAX_UINT128 ULONGLONG_SUFFIX(170141183460469231731687303715884105728) #define MAX_INT256 LONGLONG_SUFFIX(57896044618658097711785492504343953926634992332820282019728792003956564819967) #define MIN_INT256 (-MAX_INT256 - LONGLONG_SUFFIX(1)) #define MAX_UINT256 ULONGLONG_SUFFIX(115792089237316195423570985008687907853269984665640564039457584007913129639935) #define MAX_BYTE NPY_MAX_BYTE #define MIN_BYTE NPY_MIN_BYTE #define MAX_UBYTE NPY_MAX_UBYTE #define MAX_SHORT NPY_MAX_SHORT #define MIN_SHORT NPY_MIN_SHORT #define MAX_USHORT NPY_MAX_USHORT #define MAX_INT NPY_MAX_INT #define MIN_INT NPY_MIN_INT #define MAX_UINT NPY_MAX_UINT #define MAX_LONG NPY_MAX_LONG #define MIN_LONG NPY_MIN_LONG #define MAX_ULONG NPY_MAX_ULONG #define MAX_LONGLONG NPY_MAX_LONGLONG #define MIN_LONGLONG NPY_MIN_LONGLONG #define MAX_ULONGLONG NPY_MAX_ULONGLONG #define MIN_DATETIME NPY_MIN_DATETIME #define MAX_DATETIME NPY_MAX_DATETIME #define MIN_TIMEDELTA NPY_MIN_TIMEDELTA #define MAX_TIMEDELTA NPY_MAX_TIMEDELTA #define BITSOF_BOOL NPY_BITSOF_BOOL #define BITSOF_CHAR NPY_BITSOF_CHAR #define BITSOF_SHORT NPY_BITSOF_SHORT #define BITSOF_INT NPY_BITSOF_INT #define BITSOF_LONG NPY_BITSOF_LONG #define BITSOF_LONGLONG NPY_BITSOF_LONGLONG #define BITSOF_HALF NPY_BITSOF_HALF #define BITSOF_FLOAT NPY_BITSOF_FLOAT #define BITSOF_DOUBLE NPY_BITSOF_DOUBLE #define BITSOF_LONGDOUBLE NPY_BITSOF_LONGDOUBLE #define BITSOF_DATETIME NPY_BITSOF_DATETIME #define BITSOF_TIMEDELTA NPY_BITSOF_TIMEDELTA #define _pya_malloc PyArray_malloc #define _pya_free PyArray_free #define _pya_realloc PyArray_realloc #define BEGIN_THREADS_DEF NPY_BEGIN_THREADS_DEF #define BEGIN_THREADS NPY_BEGIN_THREADS #define END_THREADS NPY_END_THREADS #define ALLOW_C_API_DEF NPY_ALLOW_C_API_DEF #define ALLOW_C_API NPY_ALLOW_C_API #define DISABLE_C_API NPY_DISABLE_C_API #define PY_FAIL NPY_FAIL #define PY_SUCCEED NPY_SUCCEED #ifndef TRUE #define TRUE NPY_TRUE #endif #ifndef FALSE #define FALSE NPY_FALSE #endif #define LONGDOUBLE_FMT NPY_LONGDOUBLE_FMT #define CONTIGUOUS NPY_CONTIGUOUS #define C_CONTIGUOUS NPY_C_CONTIGUOUS #define FORTRAN NPY_FORTRAN #define F_CONTIGUOUS NPY_F_CONTIGUOUS #define OWNDATA NPY_OWNDATA #define FORCECAST NPY_FORCECAST #define ENSURECOPY NPY_ENSURECOPY #define ENSUREARRAY NPY_ENSUREARRAY #define ELEMENTSTRIDES NPY_ELEMENTSTRIDES #define ALIGNED NPY_ALIGNED #define NOTSWAPPED NPY_NOTSWAPPED #define WRITEABLE NPY_WRITEABLE #define UPDATEIFCOPY NPY_UPDATEIFCOPY #define WRITEBACKIFCOPY NPY_ARRAY_WRITEBACKIFCOPY #define ARR_HAS_DESCR NPY_ARR_HAS_DESCR #define BEHAVED NPY_BEHAVED #define BEHAVED_NS NPY_BEHAVED_NS #define CARRAY NPY_CARRAY #define CARRAY_RO NPY_CARRAY_RO #define FARRAY NPY_FARRAY #define FARRAY_RO NPY_FARRAY_RO #define DEFAULT NPY_DEFAULT #define IN_ARRAY NPY_IN_ARRAY #define OUT_ARRAY NPY_OUT_ARRAY #define INOUT_ARRAY NPY_INOUT_ARRAY #define IN_FARRAY NPY_IN_FARRAY #define OUT_FARRAY NPY_OUT_FARRAY #define INOUT_FARRAY NPY_INOUT_FARRAY #define UPDATE_ALL NPY_UPDATE_ALL #define OWN_DATA NPY_OWNDATA #define BEHAVED_FLAGS NPY_BEHAVED #define BEHAVED_FLAGS_NS NPY_BEHAVED_NS #define CARRAY_FLAGS_RO NPY_CARRAY_RO #define CARRAY_FLAGS NPY_CARRAY #define FARRAY_FLAGS NPY_FARRAY #define FARRAY_FLAGS_RO NPY_FARRAY_RO #define DEFAULT_FLAGS NPY_DEFAULT #define UPDATE_ALL_FLAGS NPY_UPDATE_ALL_FLAGS #ifndef MIN #define MIN PyArray_MIN #endif #ifndef MAX #define MAX PyArray_MAX #endif #define MAX_INTP NPY_MAX_INTP #define MIN_INTP NPY_MIN_INTP #define MAX_UINTP NPY_MAX_UINTP #define INTP_FMT NPY_INTP_FMT #ifndef PYPY_VERSION #define REFCOUNT PyArray_REFCOUNT #define MAX_ELSIZE NPY_MAX_ELSIZE #endif #endif
6,786
30.86385
116
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/npy_os.h
#ifndef _NPY_OS_H_ #define _NPY_OS_H_ #if defined(linux) || defined(__linux) || defined(__linux__) #define NPY_OS_LINUX #elif defined(__FreeBSD__) || defined(__NetBSD__) || \ defined(__OpenBSD__) || defined(__DragonFly__) #define NPY_OS_BSD #ifdef __FreeBSD__ #define NPY_OS_FREEBSD #elif defined(__NetBSD__) #define NPY_OS_NETBSD #elif defined(__OpenBSD__) #define NPY_OS_OPENBSD #elif defined(__DragonFly__) #define NPY_OS_DRAGONFLY #endif #elif defined(sun) || defined(__sun) #define NPY_OS_SOLARIS #elif defined(__CYGWIN__) #define NPY_OS_CYGWIN #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) #define NPY_OS_WIN32 #elif defined(__APPLE__) #define NPY_OS_DARWIN #else #define NPY_OS_UNKNOWN #endif #endif
817
25.387097
61
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h
#ifndef _NPY_1_7_DEPRECATED_API_H #define _NPY_1_7_DEPRECATED_API_H #ifndef NPY_DEPRECATED_INCLUDES #error "Should never include npy_*_*_deprecated_api directly." #endif #if defined(_WIN32) #define _WARN___STR2__(x) #x #define _WARN___STR1__(x) _WARN___STR2__(x) #define _WARN___LOC__ __FILE__ "(" _WARN___STR1__(__LINE__) ") : Warning Msg: " #pragma message(_WARN___LOC__"Using deprecated NumPy API, disable it by " \ "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION") #elif defined(__GNUC__) #warning "Using deprecated NumPy API, disable it by " \ "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" #endif /* TODO: How to do this warning message for other compilers? */ /* * This header exists to collect all dangerous/deprecated NumPy API * as of NumPy 1.7. * * This is an attempt to remove bad API, the proliferation of macros, * and namespace pollution currently produced by the NumPy headers. */ /* These array flags are deprecated as of NumPy 1.7 */ #define NPY_CONTIGUOUS NPY_ARRAY_C_CONTIGUOUS #define NPY_FORTRAN NPY_ARRAY_F_CONTIGUOUS /* * The consistent NPY_ARRAY_* names which don't pollute the NPY_* * namespace were added in NumPy 1.7. * * These versions of the carray flags are deprecated, but * probably should only be removed after two releases instead of one. */ #define NPY_C_CONTIGUOUS NPY_ARRAY_C_CONTIGUOUS #define NPY_F_CONTIGUOUS NPY_ARRAY_F_CONTIGUOUS #define NPY_OWNDATA NPY_ARRAY_OWNDATA #define NPY_FORCECAST NPY_ARRAY_FORCECAST #define NPY_ENSURECOPY NPY_ARRAY_ENSURECOPY #define NPY_ENSUREARRAY NPY_ARRAY_ENSUREARRAY #define NPY_ELEMENTSTRIDES NPY_ARRAY_ELEMENTSTRIDES #define NPY_ALIGNED NPY_ARRAY_ALIGNED #define NPY_NOTSWAPPED NPY_ARRAY_NOTSWAPPED #define NPY_WRITEABLE NPY_ARRAY_WRITEABLE #define NPY_UPDATEIFCOPY NPY_ARRAY_UPDATEIFCOPY #define NPY_BEHAVED NPY_ARRAY_BEHAVED #define NPY_BEHAVED_NS NPY_ARRAY_BEHAVED_NS #define NPY_CARRAY NPY_ARRAY_CARRAY #define NPY_CARRAY_RO NPY_ARRAY_CARRAY_RO #define NPY_FARRAY NPY_ARRAY_FARRAY #define NPY_FARRAY_RO NPY_ARRAY_FARRAY_RO #define NPY_DEFAULT NPY_ARRAY_DEFAULT #define NPY_IN_ARRAY NPY_ARRAY_IN_ARRAY #define NPY_OUT_ARRAY NPY_ARRAY_OUT_ARRAY #define NPY_INOUT_ARRAY NPY_ARRAY_INOUT_ARRAY #define NPY_IN_FARRAY NPY_ARRAY_IN_FARRAY #define NPY_OUT_FARRAY NPY_ARRAY_OUT_FARRAY #define NPY_INOUT_FARRAY NPY_ARRAY_INOUT_FARRAY #define NPY_UPDATE_ALL NPY_ARRAY_UPDATE_ALL /* This way of accessing the default type is deprecated as of NumPy 1.7 */ #define PyArray_DEFAULT NPY_DEFAULT_TYPE /* These DATETIME bits aren't used internally */ #if PY_VERSION_HEX >= 0x03000000 #define PyDataType_GetDatetimeMetaData(descr) \ ((descr->metadata == NULL) ? NULL : \ ((PyArray_DatetimeMetaData *)(PyCapsule_GetPointer( \ PyDict_GetItemString( \ descr->metadata, NPY_METADATA_DTSTR), NULL)))) #else #define PyDataType_GetDatetimeMetaData(descr) \ ((descr->metadata == NULL) ? NULL : \ ((PyArray_DatetimeMetaData *)(PyCObject_AsVoidPtr( \ PyDict_GetItemString(descr->metadata, NPY_METADATA_DTSTR))))) #endif /* * Deprecated as of NumPy 1.7, this kind of shortcut doesn't * belong in the public API. */ #define NPY_AO PyArrayObject /* * Deprecated as of NumPy 1.7, an all-lowercase macro doesn't * belong in the public API. */ #define fortran fortran_ /* * Deprecated as of NumPy 1.7, as it is a namespace-polluting * macro. */ #define FORTRAN_IF PyArray_FORTRAN_IF /* Deprecated as of NumPy 1.7, datetime64 uses c_metadata instead */ #define NPY_METADATA_DTSTR "__timeunit__" /* * Deprecated as of NumPy 1.7. * The reasoning: * - These are for datetime, but there's no datetime "namespace". * - They just turn NPY_STR_<x> into "<x>", which is just * making something simple be indirected. */ #define NPY_STR_Y "Y" #define NPY_STR_M "M" #define NPY_STR_W "W" #define NPY_STR_D "D" #define NPY_STR_h "h" #define NPY_STR_m "m" #define NPY_STR_s "s" #define NPY_STR_ms "ms" #define NPY_STR_us "us" #define NPY_STR_ns "ns" #define NPY_STR_ps "ps" #define NPY_STR_fs "fs" #define NPY_STR_as "as" /* * The macros in old_defines.h are Deprecated as of NumPy 1.7 and will be * removed in the next major release. */ #include "old_defines.h" #endif
4,604
34.152672
79
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/npy_cpu.h
/* * This set (target) cpu specific macros: * - Possible values: * NPY_CPU_X86 * NPY_CPU_AMD64 * NPY_CPU_PPC * NPY_CPU_PPC64 * NPY_CPU_PPC64LE * NPY_CPU_SPARC * NPY_CPU_S390 * NPY_CPU_IA64 * NPY_CPU_HPPA * NPY_CPU_ALPHA * NPY_CPU_ARMEL * NPY_CPU_ARMEB * NPY_CPU_SH_LE * NPY_CPU_SH_BE * NPY_CPU_ARCEL * NPY_CPU_ARCEB */ #ifndef _NPY_CPUARCH_H_ #define _NPY_CPUARCH_H_ #include "numpyconfig.h" #include <string.h> /* for memcpy */ #if defined( __i386__ ) || defined(i386) || defined(_M_IX86) /* * __i386__ is defined by gcc and Intel compiler on Linux, * _M_IX86 by VS compiler, * i386 by Sun compilers on opensolaris at least */ #define NPY_CPU_X86 #elif defined(__x86_64__) || defined(__amd64__) || defined(__x86_64) || defined(_M_AMD64) /* * both __x86_64__ and __amd64__ are defined by gcc * __x86_64 defined by sun compiler on opensolaris at least * _M_AMD64 defined by MS compiler */ #define NPY_CPU_AMD64 #elif defined(__ppc__) || defined(__powerpc__) || defined(_ARCH_PPC) /* * __ppc__ is defined by gcc, I remember having seen __powerpc__ once, * but can't find it ATM * _ARCH_PPC is used by at least gcc on AIX */ #define NPY_CPU_PPC #elif defined(__ppc64le__) #define NPY_CPU_PPC64LE #elif defined(__ppc64__) #define NPY_CPU_PPC64 #elif defined(__sparc__) || defined(__sparc) /* __sparc__ is defined by gcc and Forte (e.g. Sun) compilers */ #define NPY_CPU_SPARC #elif defined(__s390__) #define NPY_CPU_S390 #elif defined(__ia64) #define NPY_CPU_IA64 #elif defined(__hppa) #define NPY_CPU_HPPA #elif defined(__alpha__) #define NPY_CPU_ALPHA #elif defined(__arm__) && defined(__ARMEL__) #define NPY_CPU_ARMEL #elif defined(__arm__) && defined(__ARMEB__) #define NPY_CPU_ARMEB #elif defined(__sh__) && defined(__LITTLE_ENDIAN__) #define NPY_CPU_SH_LE #elif defined(__sh__) && defined(__BIG_ENDIAN__) #define NPY_CPU_SH_BE #elif defined(__MIPSEL__) #define NPY_CPU_MIPSEL #elif defined(__MIPSEB__) #define NPY_CPU_MIPSEB #elif defined(__or1k__) #define NPY_CPU_OR1K #elif defined(__aarch64__) #define NPY_CPU_AARCH64 #elif defined(__mc68000__) #define NPY_CPU_M68K #elif defined(__arc__) && defined(__LITTLE_ENDIAN__) #define NPY_CPU_ARCEL #elif defined(__arc__) && defined(__BIG_ENDIAN__) #define NPY_CPU_ARCEB #else #error Unknown CPU, please report this to numpy maintainers with \ information about your platform (OS, CPU and compiler) #endif #define NPY_COPY_PYOBJECT_PTR(dst, src) memcpy(dst, src, sizeof(PyObject *)) #if (defined(NPY_CPU_X86) || defined(NPY_CPU_AMD64)) #define NPY_CPU_HAVE_UNALIGNED_ACCESS 1 #else #define NPY_CPU_HAVE_UNALIGNED_ACCESS 0 #endif #endif
2,988
29.191919
89
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/arrayscalars.h
#ifndef _NPY_ARRAYSCALARS_H_ #define _NPY_ARRAYSCALARS_H_ #ifndef _MULTIARRAYMODULE typedef struct { PyObject_HEAD npy_bool obval; } PyBoolScalarObject; #endif typedef struct { PyObject_HEAD signed char obval; } PyByteScalarObject; typedef struct { PyObject_HEAD short obval; } PyShortScalarObject; typedef struct { PyObject_HEAD int obval; } PyIntScalarObject; typedef struct { PyObject_HEAD long obval; } PyLongScalarObject; typedef struct { PyObject_HEAD npy_longlong obval; } PyLongLongScalarObject; typedef struct { PyObject_HEAD unsigned char obval; } PyUByteScalarObject; typedef struct { PyObject_HEAD unsigned short obval; } PyUShortScalarObject; typedef struct { PyObject_HEAD unsigned int obval; } PyUIntScalarObject; typedef struct { PyObject_HEAD unsigned long obval; } PyULongScalarObject; typedef struct { PyObject_HEAD npy_ulonglong obval; } PyULongLongScalarObject; typedef struct { PyObject_HEAD npy_half obval; } PyHalfScalarObject; typedef struct { PyObject_HEAD float obval; } PyFloatScalarObject; typedef struct { PyObject_HEAD double obval; } PyDoubleScalarObject; typedef struct { PyObject_HEAD npy_longdouble obval; } PyLongDoubleScalarObject; typedef struct { PyObject_HEAD npy_cfloat obval; } PyCFloatScalarObject; typedef struct { PyObject_HEAD npy_cdouble obval; } PyCDoubleScalarObject; typedef struct { PyObject_HEAD npy_clongdouble obval; } PyCLongDoubleScalarObject; typedef struct { PyObject_HEAD PyObject * obval; } PyObjectScalarObject; typedef struct { PyObject_HEAD npy_datetime obval; PyArray_DatetimeMetaData obmeta; } PyDatetimeScalarObject; typedef struct { PyObject_HEAD npy_timedelta obval; PyArray_DatetimeMetaData obmeta; } PyTimedeltaScalarObject; typedef struct { PyObject_HEAD char obval; } PyScalarObject; #define PyStringScalarObject PyStringObject #define PyUnicodeScalarObject PyUnicodeObject typedef struct { PyObject_VAR_HEAD char *obval; PyArray_Descr *descr; int flags; PyObject *base; } PyVoidScalarObject; /* Macros Py<Cls><bitsize>ScalarObject Py<Cls><bitsize>ArrType_Type are defined in ndarrayobject.h */ #define PyArrayScalar_False ((PyObject *)(&(_PyArrayScalar_BoolValues[0]))) #define PyArrayScalar_True ((PyObject *)(&(_PyArrayScalar_BoolValues[1]))) #define PyArrayScalar_FromLong(i) \ ((PyObject *)(&(_PyArrayScalar_BoolValues[((i)!=0)]))) #define PyArrayScalar_RETURN_BOOL_FROM_LONG(i) \ return Py_INCREF(PyArrayScalar_FromLong(i)), \ PyArrayScalar_FromLong(i) #define PyArrayScalar_RETURN_FALSE \ return Py_INCREF(PyArrayScalar_False), \ PyArrayScalar_False #define PyArrayScalar_RETURN_TRUE \ return Py_INCREF(PyArrayScalar_True), \ PyArrayScalar_True #define PyArrayScalar_New(cls) \ Py##cls##ArrType_Type.tp_alloc(&Py##cls##ArrType_Type, 0) #define PyArrayScalar_VAL(obj, cls) \ ((Py##cls##ScalarObject *)obj)->obval #define PyArrayScalar_ASSIGN(obj, cls, val) \ PyArrayScalar_VAL(obj, cls) = val #endif
3,509
18.943182
75
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h
/* * DON'T INCLUDE THIS DIRECTLY. */ #ifndef NPY_NDARRAYOBJECT_H #define NPY_NDARRAYOBJECT_H #ifdef __cplusplus #define CONFUSE_EMACS { #define CONFUSE_EMACS2 } extern "C" CONFUSE_EMACS #undef CONFUSE_EMACS #undef CONFUSE_EMACS2 /* ... otherwise a semi-smart identer (like emacs) tries to indent everything when you're typing */ #endif #include <Python.h> #include "ndarraytypes.h" /* Includes the "function" C-API -- these are all stored in a list of pointers --- one for each file The two lists are concatenated into one in multiarray. They are available as import_array() */ #include "__multiarray_api.h" /* C-API that requires previous API to be defined */ #define PyArray_DescrCheck(op) (((PyObject*)(op))->ob_type==&PyArrayDescr_Type) #define PyArray_Check(op) PyObject_TypeCheck(op, &PyArray_Type) #define PyArray_CheckExact(op) (((PyObject*)(op))->ob_type == &PyArray_Type) #define PyArray_HasArrayInterfaceType(op, type, context, out) \ ((((out)=PyArray_FromStructInterface(op)) != Py_NotImplemented) || \ (((out)=PyArray_FromInterface(op)) != Py_NotImplemented) || \ (((out)=PyArray_FromArrayAttr(op, type, context)) != \ Py_NotImplemented)) #define PyArray_HasArrayInterface(op, out) \ PyArray_HasArrayInterfaceType(op, NULL, NULL, out) #define PyArray_IsZeroDim(op) (PyArray_Check(op) && \ (PyArray_NDIM((PyArrayObject *)op) == 0)) #define PyArray_IsScalar(obj, cls) \ (PyObject_TypeCheck(obj, &Py##cls##ArrType_Type)) #define PyArray_CheckScalar(m) (PyArray_IsScalar(m, Generic) || \ PyArray_IsZeroDim(m)) #if PY_MAJOR_VERSION >= 3 #define PyArray_IsPythonNumber(obj) \ (PyFloat_Check(obj) || PyComplex_Check(obj) || \ PyLong_Check(obj) || PyBool_Check(obj)) #define PyArray_IsIntegerScalar(obj) (PyLong_Check(obj) \ || PyArray_IsScalar((obj), Integer)) #define PyArray_IsPythonScalar(obj) \ (PyArray_IsPythonNumber(obj) || PyBytes_Check(obj) || \ PyUnicode_Check(obj)) #else #define PyArray_IsPythonNumber(obj) \ (PyInt_Check(obj) || PyFloat_Check(obj) || PyComplex_Check(obj) || \ PyLong_Check(obj) || PyBool_Check(obj)) #define PyArray_IsIntegerScalar(obj) (PyInt_Check(obj) \ || PyLong_Check(obj) \ || PyArray_IsScalar((obj), Integer)) #define PyArray_IsPythonScalar(obj) \ (PyArray_IsPythonNumber(obj) || PyString_Check(obj) || \ PyUnicode_Check(obj)) #endif #define PyArray_IsAnyScalar(obj) \ (PyArray_IsScalar(obj, Generic) || PyArray_IsPythonScalar(obj)) #define PyArray_CheckAnyScalar(obj) (PyArray_IsPythonScalar(obj) || \ PyArray_CheckScalar(obj)) #define PyArray_GETCONTIGUOUS(m) (PyArray_ISCONTIGUOUS(m) ? \ Py_INCREF(m), (m) : \ (PyArrayObject *)(PyArray_Copy(m))) #define PyArray_SAMESHAPE(a1,a2) ((PyArray_NDIM(a1) == PyArray_NDIM(a2)) && \ PyArray_CompareLists(PyArray_DIMS(a1), \ PyArray_DIMS(a2), \ PyArray_NDIM(a1))) #define PyArray_SIZE(m) PyArray_MultiplyList(PyArray_DIMS(m), PyArray_NDIM(m)) #define PyArray_NBYTES(m) (PyArray_ITEMSIZE(m) * PyArray_SIZE(m)) #define PyArray_FROM_O(m) PyArray_FromAny(m, NULL, 0, 0, 0, NULL) #define PyArray_FROM_OF(m,flags) PyArray_CheckFromAny(m, NULL, 0, 0, flags, \ NULL) #define PyArray_FROM_OT(m,type) PyArray_FromAny(m, \ PyArray_DescrFromType(type), 0, 0, 0, NULL) #define PyArray_FROM_OTF(m, type, flags) \ PyArray_FromAny(m, PyArray_DescrFromType(type), 0, 0, \ (((flags) & NPY_ARRAY_ENSURECOPY) ? \ ((flags) | NPY_ARRAY_DEFAULT) : (flags)), NULL) #define PyArray_FROMANY(m, type, min, max, flags) \ PyArray_FromAny(m, PyArray_DescrFromType(type), min, max, \ (((flags) & NPY_ARRAY_ENSURECOPY) ? \ (flags) | NPY_ARRAY_DEFAULT : (flags)), NULL) #define PyArray_ZEROS(m, dims, type, is_f_order) \ PyArray_Zeros(m, dims, PyArray_DescrFromType(type), is_f_order) #define PyArray_EMPTY(m, dims, type, is_f_order) \ PyArray_Empty(m, dims, PyArray_DescrFromType(type), is_f_order) #define PyArray_FILLWBYTE(obj, val) memset(PyArray_DATA(obj), val, \ PyArray_NBYTES(obj)) #ifndef PYPY_VERSION #define PyArray_REFCOUNT(obj) (((PyObject *)(obj))->ob_refcnt) #define NPY_REFCOUNT PyArray_REFCOUNT #endif #define NPY_MAX_ELSIZE (2 * NPY_SIZEOF_LONGDOUBLE) #define PyArray_ContiguousFromAny(op, type, min_depth, max_depth) \ PyArray_FromAny(op, PyArray_DescrFromType(type), min_depth, \ max_depth, NPY_ARRAY_DEFAULT, NULL) #define PyArray_EquivArrTypes(a1, a2) \ PyArray_EquivTypes(PyArray_DESCR(a1), PyArray_DESCR(a2)) #define PyArray_EquivByteorders(b1, b2) \ (((b1) == (b2)) || (PyArray_ISNBO(b1) == PyArray_ISNBO(b2))) #define PyArray_SimpleNew(nd, dims, typenum) \ PyArray_New(&PyArray_Type, nd, dims, typenum, NULL, NULL, 0, 0, NULL) #define PyArray_SimpleNewFromData(nd, dims, typenum, data) \ PyArray_New(&PyArray_Type, nd, dims, typenum, NULL, \ data, 0, NPY_ARRAY_CARRAY, NULL) #define PyArray_SimpleNewFromDescr(nd, dims, descr) \ PyArray_NewFromDescr(&PyArray_Type, descr, nd, dims, \ NULL, NULL, 0, NULL) #define PyArray_ToScalar(data, arr) \ PyArray_Scalar(data, PyArray_DESCR(arr), (PyObject *)arr) /* These might be faster without the dereferencing of obj going on inside -- of course an optimizing compiler should inline the constants inside a for loop making it a moot point */ #define PyArray_GETPTR1(obj, i) ((void *)(PyArray_BYTES(obj) + \ (i)*PyArray_STRIDES(obj)[0])) #define PyArray_GETPTR2(obj, i, j) ((void *)(PyArray_BYTES(obj) + \ (i)*PyArray_STRIDES(obj)[0] + \ (j)*PyArray_STRIDES(obj)[1])) #define PyArray_GETPTR3(obj, i, j, k) ((void *)(PyArray_BYTES(obj) + \ (i)*PyArray_STRIDES(obj)[0] + \ (j)*PyArray_STRIDES(obj)[1] + \ (k)*PyArray_STRIDES(obj)[2])) #define PyArray_GETPTR4(obj, i, j, k, l) ((void *)(PyArray_BYTES(obj) + \ (i)*PyArray_STRIDES(obj)[0] + \ (j)*PyArray_STRIDES(obj)[1] + \ (k)*PyArray_STRIDES(obj)[2] + \ (l)*PyArray_STRIDES(obj)[3])) /* Move to arrayobject.c once PyArray_XDECREF_ERR is removed */ static NPY_INLINE void PyArray_DiscardWritebackIfCopy(PyArrayObject *arr) { PyArrayObject_fields *fa = (PyArrayObject_fields *)arr; if (fa && fa->base) { if ((fa->flags & NPY_ARRAY_UPDATEIFCOPY) || (fa->flags & NPY_ARRAY_WRITEBACKIFCOPY)) { PyArray_ENABLEFLAGS((PyArrayObject*)fa->base, NPY_ARRAY_WRITEABLE); Py_DECREF(fa->base); fa->base = NULL; PyArray_CLEARFLAGS(arr, NPY_ARRAY_WRITEBACKIFCOPY); PyArray_CLEARFLAGS(arr, NPY_ARRAY_UPDATEIFCOPY); } } } #define PyArray_DESCR_REPLACE(descr) do { \ PyArray_Descr *_new_; \ _new_ = PyArray_DescrNew(descr); \ Py_XDECREF(descr); \ descr = _new_; \ } while(0) /* Copy should always return contiguous array */ #define PyArray_Copy(obj) PyArray_NewCopy(obj, NPY_CORDER) #define PyArray_FromObject(op, type, min_depth, max_depth) \ PyArray_FromAny(op, PyArray_DescrFromType(type), min_depth, \ max_depth, NPY_ARRAY_BEHAVED | \ NPY_ARRAY_ENSUREARRAY, NULL) #define PyArray_ContiguousFromObject(op, type, min_depth, max_depth) \ PyArray_FromAny(op, PyArray_DescrFromType(type), min_depth, \ max_depth, NPY_ARRAY_DEFAULT | \ NPY_ARRAY_ENSUREARRAY, NULL) #define PyArray_CopyFromObject(op, type, min_depth, max_depth) \ PyArray_FromAny(op, PyArray_DescrFromType(type), min_depth, \ max_depth, NPY_ARRAY_ENSURECOPY | \ NPY_ARRAY_DEFAULT | \ NPY_ARRAY_ENSUREARRAY, NULL) #define PyArray_Cast(mp, type_num) \ PyArray_CastToType(mp, PyArray_DescrFromType(type_num), 0) #define PyArray_Take(ap, items, axis) \ PyArray_TakeFrom(ap, items, axis, NULL, NPY_RAISE) #define PyArray_Put(ap, items, values) \ PyArray_PutTo(ap, items, values, NPY_RAISE) /* Compatibility with old Numeric stuff -- don't use in new code */ #define PyArray_FromDimsAndData(nd, d, type, data) \ PyArray_FromDimsAndDataAndDescr(nd, d, PyArray_DescrFromType(type), \ data) /* Check to see if this key in the dictionary is the "title" entry of the tuple (i.e. a duplicate dictionary entry in the fields dict. */ static NPY_INLINE int NPY_TITLE_KEY_check(PyObject *key, PyObject *value) { PyObject *title; if (PyTuple_GET_SIZE(value) != 3) { return 0; } title = PyTuple_GET_ITEM(value, 2); if (key == title) { return 1; } #ifdef PYPY_VERSION /* * On PyPy, dictionary keys do not always preserve object identity. * Fall back to comparison by value. */ if (PyUnicode_Check(title) && PyUnicode_Check(key)) { return PyUnicode_Compare(title, key) == 0 ? 1 : 0; } #if PY_VERSION_HEX < 0x03000000 if (PyString_Check(title) && PyString_Check(key)) { return PyObject_Compare(title, key) == 0 ? 1 : 0; } #endif #endif return 0; } /* Macro, for backward compat with "if NPY_TITLE_KEY(key, value) { ..." */ #define NPY_TITLE_KEY(key, value) (NPY_TITLE_KEY_check((key), (value))) #define DEPRECATE(msg) PyErr_WarnEx(PyExc_DeprecationWarning,msg,1) #define DEPRECATE_FUTUREWARNING(msg) PyErr_WarnEx(PyExc_FutureWarning,msg,1) #if !defined(NPY_NO_DEPRECATED_API) || \ (NPY_NO_DEPRECATED_API < NPY_1_14_API_VERSION) static NPY_INLINE void PyArray_XDECREF_ERR(PyArrayObject *arr) { /* 2017-Nov-10 1.14 */ DEPRECATE("PyArray_XDECREF_ERR is deprecated, call " "PyArray_DiscardWritebackIfCopy then Py_XDECREF instead"); PyArray_DiscardWritebackIfCopy(arr); Py_XDECREF(arr); } #endif #ifdef __cplusplus } #endif #endif /* NPY_NDARRAYOBJECT_H */
11,718
39.133562
79
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h
#ifndef NDARRAYTYPES_H #define NDARRAYTYPES_H #include "npy_common.h" #include "npy_endian.h" #include "npy_cpu.h" #include "utils.h" #define NPY_NO_EXPORT NPY_VISIBILITY_HIDDEN /* Only use thread if configured in config and python supports it */ #if defined WITH_THREAD && !NPY_NO_SMP #define NPY_ALLOW_THREADS 1 #else #define NPY_ALLOW_THREADS 0 #endif #ifndef __has_extension #define __has_extension(x) 0 #endif #if !defined(_NPY_NO_DEPRECATIONS) && \ ((defined(__GNUC__)&& __GNUC__ >= 6) || \ __has_extension(attribute_deprecated_with_message)) #define NPY_ATTR_DEPRECATE(text) __attribute__ ((deprecated (text))) #else #define NPY_ATTR_DEPRECATE(text) #endif /* * There are several places in the code where an array of dimensions * is allocated statically. This is the size of that static * allocation. * * The array creation itself could have arbitrary dimensions but all * the places where static allocation is used would need to be changed * to dynamic (including inside of several structures) */ #define NPY_MAXDIMS 32 #define NPY_MAXARGS 32 /* Used for Converter Functions "O&" code in ParseTuple */ #define NPY_FAIL 0 #define NPY_SUCCEED 1 /* * Binary compatibility version number. This number is increased * whenever the C-API is changed such that binary compatibility is * broken, i.e. whenever a recompile of extension modules is needed. */ #define NPY_VERSION NPY_ABI_VERSION /* * Minor API version. This number is increased whenever a change is * made to the C-API -- whether it breaks binary compatibility or not. * Some changes, such as adding a function pointer to the end of the * function table, can be made without breaking binary compatibility. * In this case, only the NPY_FEATURE_VERSION (*not* NPY_VERSION) * would be increased. Whenever binary compatibility is broken, both * NPY_VERSION and NPY_FEATURE_VERSION should be increased. */ #define NPY_FEATURE_VERSION NPY_API_VERSION enum NPY_TYPES { NPY_BOOL=0, NPY_BYTE, NPY_UBYTE, NPY_SHORT, NPY_USHORT, NPY_INT, NPY_UINT, NPY_LONG, NPY_ULONG, NPY_LONGLONG, NPY_ULONGLONG, NPY_FLOAT, NPY_DOUBLE, NPY_LONGDOUBLE, NPY_CFLOAT, NPY_CDOUBLE, NPY_CLONGDOUBLE, NPY_OBJECT=17, NPY_STRING, NPY_UNICODE, NPY_VOID, /* * New 1.6 types appended, may be integrated * into the above in 2.0. */ NPY_DATETIME, NPY_TIMEDELTA, NPY_HALF, NPY_NTYPES, NPY_NOTYPE, NPY_CHAR NPY_ATTR_DEPRECATE("Use NPY_STRING"), NPY_USERDEF=256, /* leave room for characters */ /* The number of types not including the new 1.6 types */ NPY_NTYPES_ABI_COMPATIBLE=21 }; #ifdef _MSC_VER #pragma deprecated(NPY_CHAR) #endif /* basetype array priority */ #define NPY_PRIORITY 0.0 /* default subtype priority */ #define NPY_SUBTYPE_PRIORITY 1.0 /* default scalar priority */ #define NPY_SCALAR_PRIORITY -1000000.0 /* How many floating point types are there (excluding half) */ #define NPY_NUM_FLOATTYPE 3 /* * These characters correspond to the array type and the struct * module */ enum NPY_TYPECHAR { NPY_BOOLLTR = '?', NPY_BYTELTR = 'b', NPY_UBYTELTR = 'B', NPY_SHORTLTR = 'h', NPY_USHORTLTR = 'H', NPY_INTLTR = 'i', NPY_UINTLTR = 'I', NPY_LONGLTR = 'l', NPY_ULONGLTR = 'L', NPY_LONGLONGLTR = 'q', NPY_ULONGLONGLTR = 'Q', NPY_HALFLTR = 'e', NPY_FLOATLTR = 'f', NPY_DOUBLELTR = 'd', NPY_LONGDOUBLELTR = 'g', NPY_CFLOATLTR = 'F', NPY_CDOUBLELTR = 'D', NPY_CLONGDOUBLELTR = 'G', NPY_OBJECTLTR = 'O', NPY_STRINGLTR = 'S', NPY_STRINGLTR2 = 'a', NPY_UNICODELTR = 'U', NPY_VOIDLTR = 'V', NPY_DATETIMELTR = 'M', NPY_TIMEDELTALTR = 'm', NPY_CHARLTR = 'c', /* * No Descriptor, just a define -- this let's * Python users specify an array of integers * large enough to hold a pointer on the * platform */ NPY_INTPLTR = 'p', NPY_UINTPLTR = 'P', /* * These are for dtype 'kinds', not dtype 'typecodes' * as the above are for. */ NPY_GENBOOLLTR ='b', NPY_SIGNEDLTR = 'i', NPY_UNSIGNEDLTR = 'u', NPY_FLOATINGLTR = 'f', NPY_COMPLEXLTR = 'c' }; typedef enum { NPY_QUICKSORT=0, NPY_HEAPSORT=1, NPY_MERGESORT=2 } NPY_SORTKIND; #define NPY_NSORTS (NPY_MERGESORT + 1) typedef enum { NPY_INTROSELECT=0 } NPY_SELECTKIND; #define NPY_NSELECTS (NPY_INTROSELECT + 1) typedef enum { NPY_SEARCHLEFT=0, NPY_SEARCHRIGHT=1 } NPY_SEARCHSIDE; #define NPY_NSEARCHSIDES (NPY_SEARCHRIGHT + 1) typedef enum { NPY_NOSCALAR=-1, NPY_BOOL_SCALAR, NPY_INTPOS_SCALAR, NPY_INTNEG_SCALAR, NPY_FLOAT_SCALAR, NPY_COMPLEX_SCALAR, NPY_OBJECT_SCALAR } NPY_SCALARKIND; #define NPY_NSCALARKINDS (NPY_OBJECT_SCALAR + 1) /* For specifying array memory layout or iteration order */ typedef enum { /* Fortran order if inputs are all Fortran, C otherwise */ NPY_ANYORDER=-1, /* C order */ NPY_CORDER=0, /* Fortran order */ NPY_FORTRANORDER=1, /* An order as close to the inputs as possible */ NPY_KEEPORDER=2 } NPY_ORDER; /* For specifying allowed casting in operations which support it */ typedef enum { /* Only allow identical types */ NPY_NO_CASTING=0, /* Allow identical and byte swapped types */ NPY_EQUIV_CASTING=1, /* Only allow safe casts */ NPY_SAFE_CASTING=2, /* Allow safe casts or casts within the same kind */ NPY_SAME_KIND_CASTING=3, /* Allow any casts */ NPY_UNSAFE_CASTING=4 } NPY_CASTING; typedef enum { NPY_CLIP=0, NPY_WRAP=1, NPY_RAISE=2 } NPY_CLIPMODE; /* The special not-a-time (NaT) value */ #define NPY_DATETIME_NAT NPY_MIN_INT64 /* * Upper bound on the length of a DATETIME ISO 8601 string * YEAR: 21 (64-bit year) * MONTH: 3 * DAY: 3 * HOURS: 3 * MINUTES: 3 * SECONDS: 3 * ATTOSECONDS: 1 + 3*6 * TIMEZONE: 5 * NULL TERMINATOR: 1 */ #define NPY_DATETIME_MAX_ISO8601_STRLEN (21+3*5+1+3*6+6+1) typedef enum { NPY_FR_Y = 0, /* Years */ NPY_FR_M = 1, /* Months */ NPY_FR_W = 2, /* Weeks */ /* Gap where 1.6 NPY_FR_B (value 3) was */ NPY_FR_D = 4, /* Days */ NPY_FR_h = 5, /* hours */ NPY_FR_m = 6, /* minutes */ NPY_FR_s = 7, /* seconds */ NPY_FR_ms = 8, /* milliseconds */ NPY_FR_us = 9, /* microseconds */ NPY_FR_ns = 10,/* nanoseconds */ NPY_FR_ps = 11,/* picoseconds */ NPY_FR_fs = 12,/* femtoseconds */ NPY_FR_as = 13,/* attoseconds */ NPY_FR_GENERIC = 14 /* Generic, unbound units, can convert to anything */ } NPY_DATETIMEUNIT; /* * NOTE: With the NPY_FR_B gap for 1.6 ABI compatibility, NPY_DATETIME_NUMUNITS * is technically one more than the actual number of units. */ #define NPY_DATETIME_NUMUNITS (NPY_FR_GENERIC + 1) #define NPY_DATETIME_DEFAULTUNIT NPY_FR_GENERIC /* * Business day conventions for mapping invalid business * days to valid business days. */ typedef enum { /* Go forward in time to the following business day. */ NPY_BUSDAY_FORWARD, NPY_BUSDAY_FOLLOWING = NPY_BUSDAY_FORWARD, /* Go backward in time to the preceding business day. */ NPY_BUSDAY_BACKWARD, NPY_BUSDAY_PRECEDING = NPY_BUSDAY_BACKWARD, /* * Go forward in time to the following business day, unless it * crosses a month boundary, in which case go backward */ NPY_BUSDAY_MODIFIEDFOLLOWING, /* * Go backward in time to the preceding business day, unless it * crosses a month boundary, in which case go forward. */ NPY_BUSDAY_MODIFIEDPRECEDING, /* Produce a NaT for non-business days. */ NPY_BUSDAY_NAT, /* Raise an exception for non-business days. */ NPY_BUSDAY_RAISE } NPY_BUSDAY_ROLL; /************************************************************ * NumPy Auxiliary Data for inner loops, sort functions, etc. ************************************************************/ /* * When creating an auxiliary data struct, this should always appear * as the first member, like this: * * typedef struct { * NpyAuxData base; * double constant; * } constant_multiplier_aux_data; */ typedef struct NpyAuxData_tag NpyAuxData; /* Function pointers for freeing or cloning auxiliary data */ typedef void (NpyAuxData_FreeFunc) (NpyAuxData *); typedef NpyAuxData *(NpyAuxData_CloneFunc) (NpyAuxData *); struct NpyAuxData_tag { NpyAuxData_FreeFunc *free; NpyAuxData_CloneFunc *clone; /* To allow for a bit of expansion without breaking the ABI */ void *reserved[2]; }; /* Macros to use for freeing and cloning auxiliary data */ #define NPY_AUXDATA_FREE(auxdata) \ do { \ if ((auxdata) != NULL) { \ (auxdata)->free(auxdata); \ } \ } while(0) #define NPY_AUXDATA_CLONE(auxdata) \ ((auxdata)->clone(auxdata)) #define NPY_ERR(str) fprintf(stderr, #str); fflush(stderr); #define NPY_ERR2(str) fprintf(stderr, str); fflush(stderr); #define NPY_STRINGIFY(x) #x #define NPY_TOSTRING(x) NPY_STRINGIFY(x) /* * Macros to define how array, and dimension/strides data is * allocated. */ /* Data buffer - PyDataMem_NEW/FREE/RENEW are in multiarraymodule.c */ #define NPY_USE_PYMEM 1 #if NPY_USE_PYMEM == 1 /* numpy sometimes calls PyArray_malloc() with the GIL released. On Python 3.3 and older, it was safe to call PyMem_Malloc() with the GIL released. On Python 3.4 and newer, it's better to use PyMem_RawMalloc() to be able to use tracemalloc. On Python 3.6, calling PyMem_Malloc() with the GIL released is now a fatal error in debug mode. */ # if PY_VERSION_HEX >= 0x03040000 # define PyArray_malloc PyMem_RawMalloc # define PyArray_free PyMem_RawFree # define PyArray_realloc PyMem_RawRealloc # else # define PyArray_malloc PyMem_Malloc # define PyArray_free PyMem_Free # define PyArray_realloc PyMem_Realloc # endif #else #define PyArray_malloc malloc #define PyArray_free free #define PyArray_realloc realloc #endif /* Dimensions and strides */ #define PyDimMem_NEW(size) \ ((npy_intp *)PyArray_malloc(size*sizeof(npy_intp))) #define PyDimMem_FREE(ptr) PyArray_free(ptr) #define PyDimMem_RENEW(ptr,size) \ ((npy_intp *)PyArray_realloc(ptr,size*sizeof(npy_intp))) /* forward declaration */ struct _PyArray_Descr; /* These must deal with unaligned and swapped data if necessary */ typedef PyObject * (PyArray_GetItemFunc) (void *, void *); typedef int (PyArray_SetItemFunc)(PyObject *, void *, void *); typedef void (PyArray_CopySwapNFunc)(void *, npy_intp, void *, npy_intp, npy_intp, int, void *); typedef void (PyArray_CopySwapFunc)(void *, void *, int, void *); typedef npy_bool (PyArray_NonzeroFunc)(void *, void *); /* * These assume aligned and notswapped data -- a buffer will be used * before or contiguous data will be obtained */ typedef int (PyArray_CompareFunc)(const void *, const void *, void *); typedef int (PyArray_ArgFunc)(void*, npy_intp, npy_intp*, void *); typedef void (PyArray_DotFunc)(void *, npy_intp, void *, npy_intp, void *, npy_intp, void *); typedef void (PyArray_VectorUnaryFunc)(void *, void *, npy_intp, void *, void *); /* * XXX the ignore argument should be removed next time the API version * is bumped. It used to be the separator. */ typedef int (PyArray_ScanFunc)(FILE *fp, void *dptr, char *ignore, struct _PyArray_Descr *); typedef int (PyArray_FromStrFunc)(char *s, void *dptr, char **endptr, struct _PyArray_Descr *); typedef int (PyArray_FillFunc)(void *, npy_intp, void *); typedef int (PyArray_SortFunc)(void *, npy_intp, void *); typedef int (PyArray_ArgSortFunc)(void *, npy_intp *, npy_intp, void *); typedef int (PyArray_PartitionFunc)(void *, npy_intp, npy_intp, npy_intp *, npy_intp *, void *); typedef int (PyArray_ArgPartitionFunc)(void *, npy_intp *, npy_intp, npy_intp, npy_intp *, npy_intp *, void *); typedef int (PyArray_FillWithScalarFunc)(void *, npy_intp, void *, void *); typedef int (PyArray_ScalarKindFunc)(void *); typedef void (PyArray_FastClipFunc)(void *in, npy_intp n_in, void *min, void *max, void *out); typedef void (PyArray_FastPutmaskFunc)(void *in, void *mask, npy_intp n_in, void *values, npy_intp nv); typedef int (PyArray_FastTakeFunc)(void *dest, void *src, npy_intp *indarray, npy_intp nindarray, npy_intp n_outer, npy_intp m_middle, npy_intp nelem, NPY_CLIPMODE clipmode); typedef struct { npy_intp *ptr; int len; } PyArray_Dims; typedef struct { /* * Functions to cast to most other standard types * Can have some NULL entries. The types * DATETIME, TIMEDELTA, and HALF go into the castdict * even though they are built-in. */ PyArray_VectorUnaryFunc *cast[NPY_NTYPES_ABI_COMPATIBLE]; /* The next four functions *cannot* be NULL */ /* * Functions to get and set items with standard Python types * -- not array scalars */ PyArray_GetItemFunc *getitem; PyArray_SetItemFunc *setitem; /* * Copy and/or swap data. Memory areas may not overlap * Use memmove first if they might */ PyArray_CopySwapNFunc *copyswapn; PyArray_CopySwapFunc *copyswap; /* * Function to compare items * Can be NULL */ PyArray_CompareFunc *compare; /* * Function to select largest * Can be NULL */ PyArray_ArgFunc *argmax; /* * Function to compute dot product * Can be NULL */ PyArray_DotFunc *dotfunc; /* * Function to scan an ASCII file and * place a single value plus possible separator * Can be NULL */ PyArray_ScanFunc *scanfunc; /* * Function to read a single value from a string * and adjust the pointer; Can be NULL */ PyArray_FromStrFunc *fromstr; /* * Function to determine if data is zero or not * If NULL a default version is * used at Registration time. */ PyArray_NonzeroFunc *nonzero; /* * Used for arange. * Can be NULL. */ PyArray_FillFunc *fill; /* * Function to fill arrays with scalar values * Can be NULL */ PyArray_FillWithScalarFunc *fillwithscalar; /* * Sorting functions * Can be NULL */ PyArray_SortFunc *sort[NPY_NSORTS]; PyArray_ArgSortFunc *argsort[NPY_NSORTS]; /* * Dictionary of additional casting functions * PyArray_VectorUnaryFuncs * which can be populated to support casting * to other registered types. Can be NULL */ PyObject *castdict; /* * Functions useful for generalizing * the casting rules. * Can be NULL; */ PyArray_ScalarKindFunc *scalarkind; int **cancastscalarkindto; int *cancastto; PyArray_FastClipFunc *fastclip; PyArray_FastPutmaskFunc *fastputmask; PyArray_FastTakeFunc *fasttake; /* * Function to select smallest * Can be NULL */ PyArray_ArgFunc *argmin; } PyArray_ArrFuncs; /* The item must be reference counted when it is inserted or extracted. */ #define NPY_ITEM_REFCOUNT 0x01 /* Same as needing REFCOUNT */ #define NPY_ITEM_HASOBJECT 0x01 /* Convert to list for pickling */ #define NPY_LIST_PICKLE 0x02 /* The item is a POINTER */ #define NPY_ITEM_IS_POINTER 0x04 /* memory needs to be initialized for this data-type */ #define NPY_NEEDS_INIT 0x08 /* operations need Python C-API so don't give-up thread. */ #define NPY_NEEDS_PYAPI 0x10 /* Use f.getitem when extracting elements of this data-type */ #define NPY_USE_GETITEM 0x20 /* Use f.setitem when setting creating 0-d array from this data-type.*/ #define NPY_USE_SETITEM 0x40 /* A sticky flag specifically for structured arrays */ #define NPY_ALIGNED_STRUCT 0x80 /* *These are inherited for global data-type if any data-types in the * field have them */ #define NPY_FROM_FIELDS (NPY_NEEDS_INIT | NPY_LIST_PICKLE | \ NPY_ITEM_REFCOUNT | NPY_NEEDS_PYAPI) #define NPY_OBJECT_DTYPE_FLAGS (NPY_LIST_PICKLE | NPY_USE_GETITEM | \ NPY_ITEM_IS_POINTER | NPY_ITEM_REFCOUNT | \ NPY_NEEDS_INIT | NPY_NEEDS_PYAPI) #define PyDataType_FLAGCHK(dtype, flag) \ (((dtype)->flags & (flag)) == (flag)) #define PyDataType_REFCHK(dtype) \ PyDataType_FLAGCHK(dtype, NPY_ITEM_REFCOUNT) typedef struct _PyArray_Descr { PyObject_HEAD /* * the type object representing an * instance of this type -- should not * be two type_numbers with the same type * object. */ PyTypeObject *typeobj; /* kind for this type */ char kind; /* unique-character representing this type */ char type; /* * '>' (big), '<' (little), '|' * (not-applicable), or '=' (native). */ char byteorder; /* flags describing data type */ char flags; /* number representing this type */ int type_num; /* element size (itemsize) for this type */ int elsize; /* alignment needed for this type */ int alignment; /* * Non-NULL if this type is * is an array (C-contiguous) * of some other type */ struct _arr_descr *subarray; /* * The fields dictionary for this type * For statically defined descr this * is always Py_None */ PyObject *fields; /* * An ordered tuple of field names or NULL * if no fields are defined */ PyObject *names; /* * a table of functions specific for each * basic data descriptor */ PyArray_ArrFuncs *f; /* Metadata about this dtype */ PyObject *metadata; /* * Metadata specific to the C implementation * of the particular dtype. This was added * for NumPy 1.7.0. */ NpyAuxData *c_metadata; /* Cached hash value (-1 if not yet computed). * This was added for NumPy 2.0.0. */ npy_hash_t hash; } PyArray_Descr; typedef struct _arr_descr { PyArray_Descr *base; PyObject *shape; /* a tuple */ } PyArray_ArrayDescr; /* * The main array object structure. * * It has been recommended to use the inline functions defined below * (PyArray_DATA and friends) to access fields here for a number of * releases. Direct access to the members themselves is deprecated. * To ensure that your code does not use deprecated access, * #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION * (or NPY_1_8_API_VERSION or higher as required). */ /* This struct will be moved to a private header in a future release */ typedef struct tagPyArrayObject_fields { PyObject_HEAD /* Pointer to the raw data buffer */ char *data; /* The number of dimensions, also called 'ndim' */ int nd; /* The size in each dimension, also called 'shape' */ npy_intp *dimensions; /* * Number of bytes to jump to get to the * next element in each dimension */ npy_intp *strides; /* * This object is decref'd upon * deletion of array. Except in the * case of WRITEBACKIFCOPY which has * special handling. * * For views it points to the original * array, collapsed so no chains of * views occur. * * For creation from buffer object it * points to an object that should be * decref'd on deletion * * For WRITEBACKIFCOPY flag this is an * array to-be-updated upon calling * PyArray_ResolveWritebackIfCopy */ PyObject *base; /* Pointer to type structure */ PyArray_Descr *descr; /* Flags describing array -- see below */ int flags; /* For weak references */ PyObject *weakreflist; } PyArrayObject_fields; /* * To hide the implementation details, we only expose * the Python struct HEAD. */ #if !defined(NPY_NO_DEPRECATED_API) || \ (NPY_NO_DEPRECATED_API < NPY_1_7_API_VERSION) /* * Can't put this in npy_deprecated_api.h like the others. * PyArrayObject field access is deprecated as of NumPy 1.7. */ typedef PyArrayObject_fields PyArrayObject; #else typedef struct tagPyArrayObject { PyObject_HEAD } PyArrayObject; #endif #define NPY_SIZEOF_PYARRAYOBJECT (sizeof(PyArrayObject_fields)) /* Array Flags Object */ typedef struct PyArrayFlagsObject { PyObject_HEAD PyObject *arr; int flags; } PyArrayFlagsObject; /* Mirrors buffer object to ptr */ typedef struct { PyObject_HEAD PyObject *base; void *ptr; npy_intp len; int flags; } PyArray_Chunk; typedef struct { NPY_DATETIMEUNIT base; int num; } PyArray_DatetimeMetaData; typedef struct { NpyAuxData base; PyArray_DatetimeMetaData meta; } PyArray_DatetimeDTypeMetaData; /* * This structure contains an exploded view of a date-time value. * NaT is represented by year == NPY_DATETIME_NAT. */ typedef struct { npy_int64 year; npy_int32 month, day, hour, min, sec, us, ps, as; } npy_datetimestruct; /* This is not used internally. */ typedef struct { npy_int64 day; npy_int32 sec, us, ps, as; } npy_timedeltastruct; typedef int (PyArray_FinalizeFunc)(PyArrayObject *, PyObject *); /* * Means c-style contiguous (last index varies the fastest). The data * elements right after each other. * * This flag may be requested in constructor functions. * This flag may be tested for in PyArray_FLAGS(arr). */ #define NPY_ARRAY_C_CONTIGUOUS 0x0001 /* * Set if array is a contiguous Fortran array: the first index varies * the fastest in memory (strides array is reverse of C-contiguous * array) * * This flag may be requested in constructor functions. * This flag may be tested for in PyArray_FLAGS(arr). */ #define NPY_ARRAY_F_CONTIGUOUS 0x0002 /* * Note: all 0-d arrays are C_CONTIGUOUS and F_CONTIGUOUS. If a * 1-d array is C_CONTIGUOUS it is also F_CONTIGUOUS. Arrays with * more then one dimension can be C_CONTIGUOUS and F_CONTIGUOUS * at the same time if they have either zero or one element. * If NPY_RELAXED_STRIDES_CHECKING is set, a higher dimensional * array is always C_CONTIGUOUS and F_CONTIGUOUS if it has zero elements * and the array is contiguous if ndarray.squeeze() is contiguous. * I.e. dimensions for which `ndarray.shape[dimension] == 1` are * ignored. */ /* * If set, the array owns the data: it will be free'd when the array * is deleted. * * This flag may be tested for in PyArray_FLAGS(arr). */ #define NPY_ARRAY_OWNDATA 0x0004 /* * An array never has the next four set; they're only used as parameter * flags to the various FromAny functions * * This flag may be requested in constructor functions. */ /* Cause a cast to occur regardless of whether or not it is safe. */ #define NPY_ARRAY_FORCECAST 0x0010 /* * Always copy the array. Returned arrays are always CONTIGUOUS, * ALIGNED, and WRITEABLE. * * This flag may be requested in constructor functions. */ #define NPY_ARRAY_ENSURECOPY 0x0020 /* * Make sure the returned array is a base-class ndarray * * This flag may be requested in constructor functions. */ #define NPY_ARRAY_ENSUREARRAY 0x0040 /* * Make sure that the strides are in units of the element size Needed * for some operations with record-arrays. * * This flag may be requested in constructor functions. */ #define NPY_ARRAY_ELEMENTSTRIDES 0x0080 /* * Array data is aligned on the appropriate memory address for the type * stored according to how the compiler would align things (e.g., an * array of integers (4 bytes each) starts on a memory address that's * a multiple of 4) * * This flag may be requested in constructor functions. * This flag may be tested for in PyArray_FLAGS(arr). */ #define NPY_ARRAY_ALIGNED 0x0100 /* * Array data has the native endianness * * This flag may be requested in constructor functions. */ #define NPY_ARRAY_NOTSWAPPED 0x0200 /* * Array data is writeable * * This flag may be requested in constructor functions. * This flag may be tested for in PyArray_FLAGS(arr). */ #define NPY_ARRAY_WRITEABLE 0x0400 /* * If this flag is set, then base contains a pointer to an array of * the same size that should be updated with the current contents of * this array when PyArray_ResolveWritebackIfCopy is called. * * This flag may be requested in constructor functions. * This flag may be tested for in PyArray_FLAGS(arr). */ #define NPY_ARRAY_UPDATEIFCOPY 0x1000 /* Deprecated in 1.14 */ #define NPY_ARRAY_WRITEBACKIFCOPY 0x2000 /* * NOTE: there are also internal flags defined in multiarray/arrayobject.h, * which start at bit 31 and work down. */ #define NPY_ARRAY_BEHAVED (NPY_ARRAY_ALIGNED | \ NPY_ARRAY_WRITEABLE) #define NPY_ARRAY_BEHAVED_NS (NPY_ARRAY_ALIGNED | \ NPY_ARRAY_WRITEABLE | \ NPY_ARRAY_NOTSWAPPED) #define NPY_ARRAY_CARRAY (NPY_ARRAY_C_CONTIGUOUS | \ NPY_ARRAY_BEHAVED) #define NPY_ARRAY_CARRAY_RO (NPY_ARRAY_C_CONTIGUOUS | \ NPY_ARRAY_ALIGNED) #define NPY_ARRAY_FARRAY (NPY_ARRAY_F_CONTIGUOUS | \ NPY_ARRAY_BEHAVED) #define NPY_ARRAY_FARRAY_RO (NPY_ARRAY_F_CONTIGUOUS | \ NPY_ARRAY_ALIGNED) #define NPY_ARRAY_DEFAULT (NPY_ARRAY_CARRAY) #define NPY_ARRAY_IN_ARRAY (NPY_ARRAY_CARRAY_RO) #define NPY_ARRAY_OUT_ARRAY (NPY_ARRAY_CARRAY) #define NPY_ARRAY_INOUT_ARRAY (NPY_ARRAY_CARRAY | \ NPY_ARRAY_UPDATEIFCOPY) #define NPY_ARRAY_INOUT_ARRAY2 (NPY_ARRAY_CARRAY | \ NPY_ARRAY_WRITEBACKIFCOPY) #define NPY_ARRAY_IN_FARRAY (NPY_ARRAY_FARRAY_RO) #define NPY_ARRAY_OUT_FARRAY (NPY_ARRAY_FARRAY) #define NPY_ARRAY_INOUT_FARRAY (NPY_ARRAY_FARRAY | \ NPY_ARRAY_UPDATEIFCOPY) #define NPY_ARRAY_INOUT_FARRAY2 (NPY_ARRAY_FARRAY | \ NPY_ARRAY_WRITEBACKIFCOPY) #define NPY_ARRAY_UPDATE_ALL (NPY_ARRAY_C_CONTIGUOUS | \ NPY_ARRAY_F_CONTIGUOUS | \ NPY_ARRAY_ALIGNED) /* This flag is for the array interface, not PyArrayObject */ #define NPY_ARR_HAS_DESCR 0x0800 /* * Size of internal buffers used for alignment Make BUFSIZE a multiple * of sizeof(npy_cdouble) -- usually 16 so that ufunc buffers are aligned */ #define NPY_MIN_BUFSIZE ((int)sizeof(npy_cdouble)) #define NPY_MAX_BUFSIZE (((int)sizeof(npy_cdouble))*1000000) #define NPY_BUFSIZE 8192 /* buffer stress test size: */ /*#define NPY_BUFSIZE 17*/ #define PyArray_MAX(a,b) (((a)>(b))?(a):(b)) #define PyArray_MIN(a,b) (((a)<(b))?(a):(b)) #define PyArray_CLT(p,q) ((((p).real==(q).real) ? ((p).imag < (q).imag) : \ ((p).real < (q).real))) #define PyArray_CGT(p,q) ((((p).real==(q).real) ? ((p).imag > (q).imag) : \ ((p).real > (q).real))) #define PyArray_CLE(p,q) ((((p).real==(q).real) ? ((p).imag <= (q).imag) : \ ((p).real <= (q).real))) #define PyArray_CGE(p,q) ((((p).real==(q).real) ? ((p).imag >= (q).imag) : \ ((p).real >= (q).real))) #define PyArray_CEQ(p,q) (((p).real==(q).real) && ((p).imag == (q).imag)) #define PyArray_CNE(p,q) (((p).real!=(q).real) || ((p).imag != (q).imag)) /* * C API: consists of Macros and functions. The MACROS are defined * here. */ #define PyArray_ISCONTIGUOUS(m) PyArray_CHKFLAGS(m, NPY_ARRAY_C_CONTIGUOUS) #define PyArray_ISWRITEABLE(m) PyArray_CHKFLAGS(m, NPY_ARRAY_WRITEABLE) #define PyArray_ISALIGNED(m) PyArray_CHKFLAGS(m, NPY_ARRAY_ALIGNED) #define PyArray_IS_C_CONTIGUOUS(m) PyArray_CHKFLAGS(m, NPY_ARRAY_C_CONTIGUOUS) #define PyArray_IS_F_CONTIGUOUS(m) PyArray_CHKFLAGS(m, NPY_ARRAY_F_CONTIGUOUS) /* the variable is used in some places, so always define it */ #define NPY_BEGIN_THREADS_DEF PyThreadState *_save=NULL; #if NPY_ALLOW_THREADS #define NPY_BEGIN_ALLOW_THREADS Py_BEGIN_ALLOW_THREADS #define NPY_END_ALLOW_THREADS Py_END_ALLOW_THREADS #define NPY_BEGIN_THREADS do {_save = PyEval_SaveThread();} while (0); #define NPY_END_THREADS do { if (_save) \ { PyEval_RestoreThread(_save); _save = NULL;} } while (0); #define NPY_BEGIN_THREADS_THRESHOLDED(loop_size) do { if (loop_size > 500) \ { _save = PyEval_SaveThread();} } while (0); #define NPY_BEGIN_THREADS_DESCR(dtype) \ do {if (!(PyDataType_FLAGCHK(dtype, NPY_NEEDS_PYAPI))) \ NPY_BEGIN_THREADS;} while (0); #define NPY_END_THREADS_DESCR(dtype) \ do {if (!(PyDataType_FLAGCHK(dtype, NPY_NEEDS_PYAPI))) \ NPY_END_THREADS; } while (0); #define NPY_ALLOW_C_API_DEF PyGILState_STATE __save__; #define NPY_ALLOW_C_API do {__save__ = PyGILState_Ensure();} while (0); #define NPY_DISABLE_C_API do {PyGILState_Release(__save__);} while (0); #else #define NPY_BEGIN_ALLOW_THREADS #define NPY_END_ALLOW_THREADS #define NPY_BEGIN_THREADS #define NPY_END_THREADS #define NPY_BEGIN_THREADS_THRESHOLDED(loop_size) #define NPY_BEGIN_THREADS_DESCR(dtype) #define NPY_END_THREADS_DESCR(dtype) #define NPY_ALLOW_C_API_DEF #define NPY_ALLOW_C_API #define NPY_DISABLE_C_API #endif /********************************** * The nditer object, added in 1.6 **********************************/ /* The actual structure of the iterator is an internal detail */ typedef struct NpyIter_InternalOnly NpyIter; /* Iterator function pointers that may be specialized */ typedef int (NpyIter_IterNextFunc)(NpyIter *iter); typedef void (NpyIter_GetMultiIndexFunc)(NpyIter *iter, npy_intp *outcoords); /*** Global flags that may be passed to the iterator constructors ***/ /* Track an index representing C order */ #define NPY_ITER_C_INDEX 0x00000001 /* Track an index representing Fortran order */ #define NPY_ITER_F_INDEX 0x00000002 /* Track a multi-index */ #define NPY_ITER_MULTI_INDEX 0x00000004 /* User code external to the iterator does the 1-dimensional innermost loop */ #define NPY_ITER_EXTERNAL_LOOP 0x00000008 /* Convert all the operands to a common data type */ #define NPY_ITER_COMMON_DTYPE 0x00000010 /* Operands may hold references, requiring API access during iteration */ #define NPY_ITER_REFS_OK 0x00000020 /* Zero-sized operands should be permitted, iteration checks IterSize for 0 */ #define NPY_ITER_ZEROSIZE_OK 0x00000040 /* Permits reductions (size-0 stride with dimension size > 1) */ #define NPY_ITER_REDUCE_OK 0x00000080 /* Enables sub-range iteration */ #define NPY_ITER_RANGED 0x00000100 /* Enables buffering */ #define NPY_ITER_BUFFERED 0x00000200 /* When buffering is enabled, grows the inner loop if possible */ #define NPY_ITER_GROWINNER 0x00000400 /* Delay allocation of buffers until first Reset* call */ #define NPY_ITER_DELAY_BUFALLOC 0x00000800 /* When NPY_KEEPORDER is specified, disable reversing negative-stride axes */ #define NPY_ITER_DONT_NEGATE_STRIDES 0x00001000 /* * If output operands overlap with other operands (based on heuristics that * has false positives but no false negatives), make temporary copies to * eliminate overlap. */ #define NPY_ITER_COPY_IF_OVERLAP 0x00002000 /*** Per-operand flags that may be passed to the iterator constructors ***/ /* The operand will be read from and written to */ #define NPY_ITER_READWRITE 0x00010000 /* The operand will only be read from */ #define NPY_ITER_READONLY 0x00020000 /* The operand will only be written to */ #define NPY_ITER_WRITEONLY 0x00040000 /* The operand's data must be in native byte order */ #define NPY_ITER_NBO 0x00080000 /* The operand's data must be aligned */ #define NPY_ITER_ALIGNED 0x00100000 /* The operand's data must be contiguous (within the inner loop) */ #define NPY_ITER_CONTIG 0x00200000 /* The operand may be copied to satisfy requirements */ #define NPY_ITER_COPY 0x00400000 /* The operand may be copied with WRITEBACKIFCOPY to satisfy requirements */ #define NPY_ITER_UPDATEIFCOPY 0x00800000 /* Allocate the operand if it is NULL */ #define NPY_ITER_ALLOCATE 0x01000000 /* If an operand is allocated, don't use any subtype */ #define NPY_ITER_NO_SUBTYPE 0x02000000 /* This is a virtual array slot, operand is NULL but temporary data is there */ #define NPY_ITER_VIRTUAL 0x04000000 /* Require that the dimension match the iterator dimensions exactly */ #define NPY_ITER_NO_BROADCAST 0x08000000 /* A mask is being used on this array, affects buffer -> array copy */ #define NPY_ITER_WRITEMASKED 0x10000000 /* This array is the mask for all WRITEMASKED operands */ #define NPY_ITER_ARRAYMASK 0x20000000 /* Assume iterator order data access for COPY_IF_OVERLAP */ #define NPY_ITER_OVERLAP_ASSUME_ELEMENTWISE 0x40000000 #define NPY_ITER_GLOBAL_FLAGS 0x0000ffff #define NPY_ITER_PER_OP_FLAGS 0xffff0000 /***************************** * Basic iterator object *****************************/ /* FWD declaration */ typedef struct PyArrayIterObject_tag PyArrayIterObject; /* * type of the function which translates a set of coordinates to a * pointer to the data */ typedef char* (*npy_iter_get_dataptr_t)(PyArrayIterObject* iter, npy_intp*); struct PyArrayIterObject_tag { PyObject_HEAD int nd_m1; /* number of dimensions - 1 */ npy_intp index, size; npy_intp coordinates[NPY_MAXDIMS];/* N-dimensional loop */ npy_intp dims_m1[NPY_MAXDIMS]; /* ao->dimensions - 1 */ npy_intp strides[NPY_MAXDIMS]; /* ao->strides or fake */ npy_intp backstrides[NPY_MAXDIMS];/* how far to jump back */ npy_intp factors[NPY_MAXDIMS]; /* shape factors */ PyArrayObject *ao; char *dataptr; /* pointer to current item*/ npy_bool contiguous; npy_intp bounds[NPY_MAXDIMS][2]; npy_intp limits[NPY_MAXDIMS][2]; npy_intp limits_sizes[NPY_MAXDIMS]; npy_iter_get_dataptr_t translate; } ; /* Iterator API */ #define PyArrayIter_Check(op) PyObject_TypeCheck(op, &PyArrayIter_Type) #define _PyAIT(it) ((PyArrayIterObject *)(it)) #define PyArray_ITER_RESET(it) do { \ _PyAIT(it)->index = 0; \ _PyAIT(it)->dataptr = PyArray_BYTES(_PyAIT(it)->ao); \ memset(_PyAIT(it)->coordinates, 0, \ (_PyAIT(it)->nd_m1+1)*sizeof(npy_intp)); \ } while (0) #define _PyArray_ITER_NEXT1(it) do { \ (it)->dataptr += _PyAIT(it)->strides[0]; \ (it)->coordinates[0]++; \ } while (0) #define _PyArray_ITER_NEXT2(it) do { \ if ((it)->coordinates[1] < (it)->dims_m1[1]) { \ (it)->coordinates[1]++; \ (it)->dataptr += (it)->strides[1]; \ } \ else { \ (it)->coordinates[1] = 0; \ (it)->coordinates[0]++; \ (it)->dataptr += (it)->strides[0] - \ (it)->backstrides[1]; \ } \ } while (0) #define PyArray_ITER_NEXT(it) do { \ _PyAIT(it)->index++; \ if (_PyAIT(it)->nd_m1 == 0) { \ _PyArray_ITER_NEXT1(_PyAIT(it)); \ } \ else if (_PyAIT(it)->contiguous) \ _PyAIT(it)->dataptr += PyArray_DESCR(_PyAIT(it)->ao)->elsize; \ else if (_PyAIT(it)->nd_m1 == 1) { \ _PyArray_ITER_NEXT2(_PyAIT(it)); \ } \ else { \ int __npy_i; \ for (__npy_i=_PyAIT(it)->nd_m1; __npy_i >= 0; __npy_i--) { \ if (_PyAIT(it)->coordinates[__npy_i] < \ _PyAIT(it)->dims_m1[__npy_i]) { \ _PyAIT(it)->coordinates[__npy_i]++; \ _PyAIT(it)->dataptr += \ _PyAIT(it)->strides[__npy_i]; \ break; \ } \ else { \ _PyAIT(it)->coordinates[__npy_i] = 0; \ _PyAIT(it)->dataptr -= \ _PyAIT(it)->backstrides[__npy_i]; \ } \ } \ } \ } while (0) #define PyArray_ITER_GOTO(it, destination) do { \ int __npy_i; \ _PyAIT(it)->index = 0; \ _PyAIT(it)->dataptr = PyArray_BYTES(_PyAIT(it)->ao); \ for (__npy_i = _PyAIT(it)->nd_m1; __npy_i>=0; __npy_i--) { \ if (destination[__npy_i] < 0) { \ destination[__npy_i] += \ _PyAIT(it)->dims_m1[__npy_i]+1; \ } \ _PyAIT(it)->dataptr += destination[__npy_i] * \ _PyAIT(it)->strides[__npy_i]; \ _PyAIT(it)->coordinates[__npy_i] = \ destination[__npy_i]; \ _PyAIT(it)->index += destination[__npy_i] * \ ( __npy_i==_PyAIT(it)->nd_m1 ? 1 : \ _PyAIT(it)->dims_m1[__npy_i+1]+1) ; \ } \ } while (0) #define PyArray_ITER_GOTO1D(it, ind) do { \ int __npy_i; \ npy_intp __npy_ind = (npy_intp) (ind); \ if (__npy_ind < 0) __npy_ind += _PyAIT(it)->size; \ _PyAIT(it)->index = __npy_ind; \ if (_PyAIT(it)->nd_m1 == 0) { \ _PyAIT(it)->dataptr = PyArray_BYTES(_PyAIT(it)->ao) + \ __npy_ind * _PyAIT(it)->strides[0]; \ } \ else if (_PyAIT(it)->contiguous) \ _PyAIT(it)->dataptr = PyArray_BYTES(_PyAIT(it)->ao) + \ __npy_ind * PyArray_DESCR(_PyAIT(it)->ao)->elsize; \ else { \ _PyAIT(it)->dataptr = PyArray_BYTES(_PyAIT(it)->ao); \ for (__npy_i = 0; __npy_i<=_PyAIT(it)->nd_m1; \ __npy_i++) { \ _PyAIT(it)->dataptr += \ (__npy_ind / _PyAIT(it)->factors[__npy_i]) \ * _PyAIT(it)->strides[__npy_i]; \ __npy_ind %= _PyAIT(it)->factors[__npy_i]; \ } \ } \ } while (0) #define PyArray_ITER_DATA(it) ((void *)(_PyAIT(it)->dataptr)) #define PyArray_ITER_NOTDONE(it) (_PyAIT(it)->index < _PyAIT(it)->size) /* * Any object passed to PyArray_Broadcast must be binary compatible * with this structure. */ typedef struct { PyObject_HEAD int numiter; /* number of iters */ npy_intp size; /* broadcasted size */ npy_intp index; /* current index */ int nd; /* number of dims */ npy_intp dimensions[NPY_MAXDIMS]; /* dimensions */ PyArrayIterObject *iters[NPY_MAXARGS]; /* iterators */ } PyArrayMultiIterObject; #define _PyMIT(m) ((PyArrayMultiIterObject *)(m)) #define PyArray_MultiIter_RESET(multi) do { \ int __npy_mi; \ _PyMIT(multi)->index = 0; \ for (__npy_mi=0; __npy_mi < _PyMIT(multi)->numiter; __npy_mi++) { \ PyArray_ITER_RESET(_PyMIT(multi)->iters[__npy_mi]); \ } \ } while (0) #define PyArray_MultiIter_NEXT(multi) do { \ int __npy_mi; \ _PyMIT(multi)->index++; \ for (__npy_mi=0; __npy_mi < _PyMIT(multi)->numiter; __npy_mi++) { \ PyArray_ITER_NEXT(_PyMIT(multi)->iters[__npy_mi]); \ } \ } while (0) #define PyArray_MultiIter_GOTO(multi, dest) do { \ int __npy_mi; \ for (__npy_mi=0; __npy_mi < _PyMIT(multi)->numiter; __npy_mi++) { \ PyArray_ITER_GOTO(_PyMIT(multi)->iters[__npy_mi], dest); \ } \ _PyMIT(multi)->index = _PyMIT(multi)->iters[0]->index; \ } while (0) #define PyArray_MultiIter_GOTO1D(multi, ind) do { \ int __npy_mi; \ for (__npy_mi=0; __npy_mi < _PyMIT(multi)->numiter; __npy_mi++) { \ PyArray_ITER_GOTO1D(_PyMIT(multi)->iters[__npy_mi], ind); \ } \ _PyMIT(multi)->index = _PyMIT(multi)->iters[0]->index; \ } while (0) #define PyArray_MultiIter_DATA(multi, i) \ ((void *)(_PyMIT(multi)->iters[i]->dataptr)) #define PyArray_MultiIter_NEXTi(multi, i) \ PyArray_ITER_NEXT(_PyMIT(multi)->iters[i]) #define PyArray_MultiIter_NOTDONE(multi) \ (_PyMIT(multi)->index < _PyMIT(multi)->size) /* * Store the information needed for fancy-indexing over an array. The * fields are slightly unordered to keep consec, dataptr and subspace * where they were originally. */ typedef struct { PyObject_HEAD /* * Multi-iterator portion --- needs to be present in this * order to work with PyArray_Broadcast */ int numiter; /* number of index-array iterators */ npy_intp size; /* size of broadcasted result */ npy_intp index; /* current index */ int nd; /* number of dims */ npy_intp dimensions[NPY_MAXDIMS]; /* dimensions */ NpyIter *outer; /* index objects iterator */ void *unused[NPY_MAXDIMS - 2]; PyArrayObject *array; /* Flat iterator for the indexed array. For compatibility solely. */ PyArrayIterObject *ait; /* * Subspace array. For binary compatibility (was an iterator, * but only the check for NULL should be used). */ PyArrayObject *subspace; /* * if subspace iteration, then this is the array of axes in * the underlying array represented by the index objects */ int iteraxes[NPY_MAXDIMS]; npy_intp fancy_strides[NPY_MAXDIMS]; /* pointer when all fancy indices are 0 */ char *baseoffset; /* * after binding consec denotes at which axis the fancy axes * are inserted. */ int consec; char *dataptr; int nd_fancy; npy_intp fancy_dims[NPY_MAXDIMS]; /* Whether the iterator (any of the iterators) requires API */ int needs_api; /* * Extra op information. */ PyArrayObject *extra_op; PyArray_Descr *extra_op_dtype; /* desired dtype */ npy_uint32 *extra_op_flags; /* Iterator flags */ NpyIter *extra_op_iter; NpyIter_IterNextFunc *extra_op_next; char **extra_op_ptrs; /* * Information about the iteration state. */ NpyIter_IterNextFunc *outer_next; char **outer_ptrs; npy_intp *outer_strides; /* * Information about the subspace iterator. */ NpyIter *subspace_iter; NpyIter_IterNextFunc *subspace_next; char **subspace_ptrs; npy_intp *subspace_strides; /* Count for the external loop (which ever it is) for API iteration */ npy_intp iter_count; } PyArrayMapIterObject; enum { NPY_NEIGHBORHOOD_ITER_ZERO_PADDING, NPY_NEIGHBORHOOD_ITER_ONE_PADDING, NPY_NEIGHBORHOOD_ITER_CONSTANT_PADDING, NPY_NEIGHBORHOOD_ITER_CIRCULAR_PADDING, NPY_NEIGHBORHOOD_ITER_MIRROR_PADDING }; typedef struct { PyObject_HEAD /* * PyArrayIterObject part: keep this in this exact order */ int nd_m1; /* number of dimensions - 1 */ npy_intp index, size; npy_intp coordinates[NPY_MAXDIMS];/* N-dimensional loop */ npy_intp dims_m1[NPY_MAXDIMS]; /* ao->dimensions - 1 */ npy_intp strides[NPY_MAXDIMS]; /* ao->strides or fake */ npy_intp backstrides[NPY_MAXDIMS];/* how far to jump back */ npy_intp factors[NPY_MAXDIMS]; /* shape factors */ PyArrayObject *ao; char *dataptr; /* pointer to current item*/ npy_bool contiguous; npy_intp bounds[NPY_MAXDIMS][2]; npy_intp limits[NPY_MAXDIMS][2]; npy_intp limits_sizes[NPY_MAXDIMS]; npy_iter_get_dataptr_t translate; /* * New members */ npy_intp nd; /* Dimensions is the dimension of the array */ npy_intp dimensions[NPY_MAXDIMS]; /* * Neighborhood points coordinates are computed relatively to the * point pointed by _internal_iter */ PyArrayIterObject* _internal_iter; /* * To keep a reference to the representation of the constant value * for constant padding */ char* constant; int mode; } PyArrayNeighborhoodIterObject; /* * Neighborhood iterator API */ /* General: those work for any mode */ static NPY_INLINE int PyArrayNeighborhoodIter_Reset(PyArrayNeighborhoodIterObject* iter); static NPY_INLINE int PyArrayNeighborhoodIter_Next(PyArrayNeighborhoodIterObject* iter); #if 0 static NPY_INLINE int PyArrayNeighborhoodIter_Next2D(PyArrayNeighborhoodIterObject* iter); #endif /* * Include inline implementations - functions defined there are not * considered public API */ #define _NPY_INCLUDE_NEIGHBORHOOD_IMP #include "_neighborhood_iterator_imp.h" #undef _NPY_INCLUDE_NEIGHBORHOOD_IMP /* The default array type */ #define NPY_DEFAULT_TYPE NPY_DOUBLE /* * All sorts of useful ways to look into a PyArrayObject. It is recommended * to use PyArrayObject * objects instead of always casting from PyObject *, * for improved type checking. * * In many cases here the macro versions of the accessors are deprecated, * but can't be immediately changed to inline functions because the * preexisting macros accept PyObject * and do automatic casts. Inline * functions accepting PyArrayObject * provides for some compile-time * checking of correctness when working with these objects in C. */ #define PyArray_ISONESEGMENT(m) (PyArray_NDIM(m) == 0 || \ PyArray_CHKFLAGS(m, NPY_ARRAY_C_CONTIGUOUS) || \ PyArray_CHKFLAGS(m, NPY_ARRAY_F_CONTIGUOUS)) #define PyArray_ISFORTRAN(m) (PyArray_CHKFLAGS(m, NPY_ARRAY_F_CONTIGUOUS) && \ (!PyArray_CHKFLAGS(m, NPY_ARRAY_C_CONTIGUOUS))) #define PyArray_FORTRAN_IF(m) ((PyArray_CHKFLAGS(m, NPY_ARRAY_F_CONTIGUOUS) ? \ NPY_ARRAY_F_CONTIGUOUS : 0)) #if (defined(NPY_NO_DEPRECATED_API) && (NPY_1_7_API_VERSION <= NPY_NO_DEPRECATED_API)) /* * Changing access macros into functions, to allow for future hiding * of the internal memory layout. This later hiding will allow the 2.x series * to change the internal representation of arrays without affecting * ABI compatibility. */ static NPY_INLINE int PyArray_NDIM(const PyArrayObject *arr) { return ((PyArrayObject_fields *)arr)->nd; } static NPY_INLINE void * PyArray_DATA(PyArrayObject *arr) { return ((PyArrayObject_fields *)arr)->data; } static NPY_INLINE char * PyArray_BYTES(PyArrayObject *arr) { return ((PyArrayObject_fields *)arr)->data; } static NPY_INLINE npy_intp * PyArray_DIMS(PyArrayObject *arr) { return ((PyArrayObject_fields *)arr)->dimensions; } static NPY_INLINE npy_intp * PyArray_STRIDES(PyArrayObject *arr) { return ((PyArrayObject_fields *)arr)->strides; } static NPY_INLINE npy_intp PyArray_DIM(const PyArrayObject *arr, int idim) { return ((PyArrayObject_fields *)arr)->dimensions[idim]; } static NPY_INLINE npy_intp PyArray_STRIDE(const PyArrayObject *arr, int istride) { return ((PyArrayObject_fields *)arr)->strides[istride]; } static NPY_INLINE NPY_RETURNS_BORROWED_REF PyObject * PyArray_BASE(PyArrayObject *arr) { return ((PyArrayObject_fields *)arr)->base; } static NPY_INLINE NPY_RETURNS_BORROWED_REF PyArray_Descr * PyArray_DESCR(PyArrayObject *arr) { return ((PyArrayObject_fields *)arr)->descr; } static NPY_INLINE int PyArray_FLAGS(const PyArrayObject *arr) { return ((PyArrayObject_fields *)arr)->flags; } static NPY_INLINE npy_intp PyArray_ITEMSIZE(const PyArrayObject *arr) { return ((PyArrayObject_fields *)arr)->descr->elsize; } static NPY_INLINE int PyArray_TYPE(const PyArrayObject *arr) { return ((PyArrayObject_fields *)arr)->descr->type_num; } static NPY_INLINE int PyArray_CHKFLAGS(const PyArrayObject *arr, int flags) { return (PyArray_FLAGS(arr) & flags) == flags; } static NPY_INLINE PyObject * PyArray_GETITEM(const PyArrayObject *arr, const char *itemptr) { return ((PyArrayObject_fields *)arr)->descr->f->getitem( (void *)itemptr, (PyArrayObject *)arr); } static NPY_INLINE int PyArray_SETITEM(PyArrayObject *arr, char *itemptr, PyObject *v) { return ((PyArrayObject_fields *)arr)->descr->f->setitem( v, itemptr, arr); } #else /* These macros are deprecated as of NumPy 1.7. */ #define PyArray_NDIM(obj) (((PyArrayObject_fields *)(obj))->nd) #define PyArray_BYTES(obj) (((PyArrayObject_fields *)(obj))->data) #define PyArray_DATA(obj) ((void *)((PyArrayObject_fields *)(obj))->data) #define PyArray_DIMS(obj) (((PyArrayObject_fields *)(obj))->dimensions) #define PyArray_STRIDES(obj) (((PyArrayObject_fields *)(obj))->strides) #define PyArray_DIM(obj,n) (PyArray_DIMS(obj)[n]) #define PyArray_STRIDE(obj,n) (PyArray_STRIDES(obj)[n]) #define PyArray_BASE(obj) (((PyArrayObject_fields *)(obj))->base) #define PyArray_DESCR(obj) (((PyArrayObject_fields *)(obj))->descr) #define PyArray_FLAGS(obj) (((PyArrayObject_fields *)(obj))->flags) #define PyArray_CHKFLAGS(m, FLAGS) \ ((((PyArrayObject_fields *)(m))->flags & (FLAGS)) == (FLAGS)) #define PyArray_ITEMSIZE(obj) \ (((PyArrayObject_fields *)(obj))->descr->elsize) #define PyArray_TYPE(obj) \ (((PyArrayObject_fields *)(obj))->descr->type_num) #define PyArray_GETITEM(obj,itemptr) \ PyArray_DESCR(obj)->f->getitem((char *)(itemptr), \ (PyArrayObject *)(obj)) #define PyArray_SETITEM(obj,itemptr,v) \ PyArray_DESCR(obj)->f->setitem((PyObject *)(v), \ (char *)(itemptr), \ (PyArrayObject *)(obj)) #endif static NPY_INLINE PyArray_Descr * PyArray_DTYPE(PyArrayObject *arr) { return ((PyArrayObject_fields *)arr)->descr; } static NPY_INLINE npy_intp * PyArray_SHAPE(PyArrayObject *arr) { return ((PyArrayObject_fields *)arr)->dimensions; } /* * Enables the specified array flags. Does no checking, * assumes you know what you're doing. */ static NPY_INLINE void PyArray_ENABLEFLAGS(PyArrayObject *arr, int flags) { ((PyArrayObject_fields *)arr)->flags |= flags; } /* * Clears the specified array flags. Does no checking, * assumes you know what you're doing. */ static NPY_INLINE void PyArray_CLEARFLAGS(PyArrayObject *arr, int flags) { ((PyArrayObject_fields *)arr)->flags &= ~flags; } #define PyTypeNum_ISBOOL(type) ((type) == NPY_BOOL) #define PyTypeNum_ISUNSIGNED(type) (((type) == NPY_UBYTE) || \ ((type) == NPY_USHORT) || \ ((type) == NPY_UINT) || \ ((type) == NPY_ULONG) || \ ((type) == NPY_ULONGLONG)) #define PyTypeNum_ISSIGNED(type) (((type) == NPY_BYTE) || \ ((type) == NPY_SHORT) || \ ((type) == NPY_INT) || \ ((type) == NPY_LONG) || \ ((type) == NPY_LONGLONG)) #define PyTypeNum_ISINTEGER(type) (((type) >= NPY_BYTE) && \ ((type) <= NPY_ULONGLONG)) #define PyTypeNum_ISFLOAT(type) ((((type) >= NPY_FLOAT) && \ ((type) <= NPY_LONGDOUBLE)) || \ ((type) == NPY_HALF)) #define PyTypeNum_ISNUMBER(type) (((type) <= NPY_CLONGDOUBLE) || \ ((type) == NPY_HALF)) #define PyTypeNum_ISSTRING(type) (((type) == NPY_STRING) || \ ((type) == NPY_UNICODE)) #define PyTypeNum_ISCOMPLEX(type) (((type) >= NPY_CFLOAT) && \ ((type) <= NPY_CLONGDOUBLE)) #define PyTypeNum_ISPYTHON(type) (((type) == NPY_LONG) || \ ((type) == NPY_DOUBLE) || \ ((type) == NPY_CDOUBLE) || \ ((type) == NPY_BOOL) || \ ((type) == NPY_OBJECT )) #define PyTypeNum_ISFLEXIBLE(type) (((type) >=NPY_STRING) && \ ((type) <=NPY_VOID)) #define PyTypeNum_ISDATETIME(type) (((type) >=NPY_DATETIME) && \ ((type) <=NPY_TIMEDELTA)) #define PyTypeNum_ISUSERDEF(type) (((type) >= NPY_USERDEF) && \ ((type) < NPY_USERDEF+ \ NPY_NUMUSERTYPES)) #define PyTypeNum_ISEXTENDED(type) (PyTypeNum_ISFLEXIBLE(type) || \ PyTypeNum_ISUSERDEF(type)) #define PyTypeNum_ISOBJECT(type) ((type) == NPY_OBJECT) #define PyDataType_ISBOOL(obj) PyTypeNum_ISBOOL(_PyADt(obj)) #define PyDataType_ISUNSIGNED(obj) PyTypeNum_ISUNSIGNED(((PyArray_Descr*)(obj))->type_num) #define PyDataType_ISSIGNED(obj) PyTypeNum_ISSIGNED(((PyArray_Descr*)(obj))->type_num) #define PyDataType_ISINTEGER(obj) PyTypeNum_ISINTEGER(((PyArray_Descr*)(obj))->type_num ) #define PyDataType_ISFLOAT(obj) PyTypeNum_ISFLOAT(((PyArray_Descr*)(obj))->type_num) #define PyDataType_ISNUMBER(obj) PyTypeNum_ISNUMBER(((PyArray_Descr*)(obj))->type_num) #define PyDataType_ISSTRING(obj) PyTypeNum_ISSTRING(((PyArray_Descr*)(obj))->type_num) #define PyDataType_ISCOMPLEX(obj) PyTypeNum_ISCOMPLEX(((PyArray_Descr*)(obj))->type_num) #define PyDataType_ISPYTHON(obj) PyTypeNum_ISPYTHON(((PyArray_Descr*)(obj))->type_num) #define PyDataType_ISFLEXIBLE(obj) PyTypeNum_ISFLEXIBLE(((PyArray_Descr*)(obj))->type_num) #define PyDataType_ISDATETIME(obj) PyTypeNum_ISDATETIME(((PyArray_Descr*)(obj))->type_num) #define PyDataType_ISUSERDEF(obj) PyTypeNum_ISUSERDEF(((PyArray_Descr*)(obj))->type_num) #define PyDataType_ISEXTENDED(obj) PyTypeNum_ISEXTENDED(((PyArray_Descr*)(obj))->type_num) #define PyDataType_ISOBJECT(obj) PyTypeNum_ISOBJECT(((PyArray_Descr*)(obj))->type_num) #define PyDataType_HASFIELDS(obj) (((PyArray_Descr *)(obj))->names != NULL) #define PyDataType_HASSUBARRAY(dtype) ((dtype)->subarray != NULL) #define PyDataType_ISUNSIZED(dtype) ((dtype)->elsize == 0) #define PyDataType_MAKEUNSIZED(dtype) ((dtype)->elsize = 0) #define PyArray_ISBOOL(obj) PyTypeNum_ISBOOL(PyArray_TYPE(obj)) #define PyArray_ISUNSIGNED(obj) PyTypeNum_ISUNSIGNED(PyArray_TYPE(obj)) #define PyArray_ISSIGNED(obj) PyTypeNum_ISSIGNED(PyArray_TYPE(obj)) #define PyArray_ISINTEGER(obj) PyTypeNum_ISINTEGER(PyArray_TYPE(obj)) #define PyArray_ISFLOAT(obj) PyTypeNum_ISFLOAT(PyArray_TYPE(obj)) #define PyArray_ISNUMBER(obj) PyTypeNum_ISNUMBER(PyArray_TYPE(obj)) #define PyArray_ISSTRING(obj) PyTypeNum_ISSTRING(PyArray_TYPE(obj)) #define PyArray_ISCOMPLEX(obj) PyTypeNum_ISCOMPLEX(PyArray_TYPE(obj)) #define PyArray_ISPYTHON(obj) PyTypeNum_ISPYTHON(PyArray_TYPE(obj)) #define PyArray_ISFLEXIBLE(obj) PyTypeNum_ISFLEXIBLE(PyArray_TYPE(obj)) #define PyArray_ISDATETIME(obj) PyTypeNum_ISDATETIME(PyArray_TYPE(obj)) #define PyArray_ISUSERDEF(obj) PyTypeNum_ISUSERDEF(PyArray_TYPE(obj)) #define PyArray_ISEXTENDED(obj) PyTypeNum_ISEXTENDED(PyArray_TYPE(obj)) #define PyArray_ISOBJECT(obj) PyTypeNum_ISOBJECT(PyArray_TYPE(obj)) #define PyArray_HASFIELDS(obj) PyDataType_HASFIELDS(PyArray_DESCR(obj)) /* * FIXME: This should check for a flag on the data-type that * states whether or not it is variable length. Because the * ISFLEXIBLE check is hard-coded to the built-in data-types. */ #define PyArray_ISVARIABLE(obj) PyTypeNum_ISFLEXIBLE(PyArray_TYPE(obj)) #define PyArray_SAFEALIGNEDCOPY(obj) (PyArray_ISALIGNED(obj) && !PyArray_ISVARIABLE(obj)) #define NPY_LITTLE '<' #define NPY_BIG '>' #define NPY_NATIVE '=' #define NPY_SWAP 's' #define NPY_IGNORE '|' #if NPY_BYTE_ORDER == NPY_BIG_ENDIAN #define NPY_NATBYTE NPY_BIG #define NPY_OPPBYTE NPY_LITTLE #else #define NPY_NATBYTE NPY_LITTLE #define NPY_OPPBYTE NPY_BIG #endif #define PyArray_ISNBO(arg) ((arg) != NPY_OPPBYTE) #define PyArray_IsNativeByteOrder PyArray_ISNBO #define PyArray_ISNOTSWAPPED(m) PyArray_ISNBO(PyArray_DESCR(m)->byteorder) #define PyArray_ISBYTESWAPPED(m) (!PyArray_ISNOTSWAPPED(m)) #define PyArray_FLAGSWAP(m, flags) (PyArray_CHKFLAGS(m, flags) && \ PyArray_ISNOTSWAPPED(m)) #define PyArray_ISCARRAY(m) PyArray_FLAGSWAP(m, NPY_ARRAY_CARRAY) #define PyArray_ISCARRAY_RO(m) PyArray_FLAGSWAP(m, NPY_ARRAY_CARRAY_RO) #define PyArray_ISFARRAY(m) PyArray_FLAGSWAP(m, NPY_ARRAY_FARRAY) #define PyArray_ISFARRAY_RO(m) PyArray_FLAGSWAP(m, NPY_ARRAY_FARRAY_RO) #define PyArray_ISBEHAVED(m) PyArray_FLAGSWAP(m, NPY_ARRAY_BEHAVED) #define PyArray_ISBEHAVED_RO(m) PyArray_FLAGSWAP(m, NPY_ARRAY_ALIGNED) #define PyDataType_ISNOTSWAPPED(d) PyArray_ISNBO(((PyArray_Descr *)(d))->byteorder) #define PyDataType_ISBYTESWAPPED(d) (!PyDataType_ISNOTSWAPPED(d)) /************************************************************ * A struct used by PyArray_CreateSortedStridePerm, new in 1.7. ************************************************************/ typedef struct { npy_intp perm, stride; } npy_stride_sort_item; /************************************************************ * This is the form of the struct that's returned pointed by the * PyCObject attribute of an array __array_struct__. See * http://docs.scipy.org/doc/numpy/reference/arrays.interface.html for the full * documentation. ************************************************************/ typedef struct { int two; /* * contains the integer 2 as a sanity * check */ int nd; /* number of dimensions */ char typekind; /* * kind in array --- character code of * typestr */ int itemsize; /* size of each element */ int flags; /* * how should be data interpreted. Valid * flags are CONTIGUOUS (1), F_CONTIGUOUS (2), * ALIGNED (0x100), NOTSWAPPED (0x200), and * WRITEABLE (0x400). ARR_HAS_DESCR (0x800) * states that arrdescr field is present in * structure */ npy_intp *shape; /* * A length-nd array of shape * information */ npy_intp *strides; /* A length-nd array of stride information */ void *data; /* A pointer to the first element of the array */ PyObject *descr; /* * A list of fields or NULL (ignored if flags * does not have ARR_HAS_DESCR flag set) */ } PyArrayInterface; /* * This is a function for hooking into the PyDataMem_NEW/FREE/RENEW functions. * See the documentation for PyDataMem_SetEventHook. */ typedef void (PyDataMem_EventHookFunc)(void *inp, void *outp, size_t size, void *user_data); /* * Use the keyword NPY_DEPRECATED_INCLUDES to ensure that the header files * npy_*_*_deprecated_api.h are only included from here and nowhere else. */ #ifdef NPY_DEPRECATED_INCLUDES #error "Do not use the reserved keyword NPY_DEPRECATED_INCLUDES." #endif #define NPY_DEPRECATED_INCLUDES #if !defined(NPY_NO_DEPRECATED_API) || \ (NPY_NO_DEPRECATED_API < NPY_1_7_API_VERSION) #include "npy_1_7_deprecated_api.h" #endif /* * There is no file npy_1_8_deprecated_api.h since there are no additional * deprecated API features in NumPy 1.8. * * Note to maintainers: insert code like the following in future NumPy * versions. * * #if !defined(NPY_NO_DEPRECATED_API) || \ * (NPY_NO_DEPRECATED_API < NPY_1_9_API_VERSION) * #include "npy_1_9_deprecated_api.h" * #endif */ #undef NPY_DEPRECATED_INCLUDES #endif /* NPY_ARRAYTYPES_H */
64,303
34.081288
90
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/npy_endian.h
#ifndef _NPY_ENDIAN_H_ #define _NPY_ENDIAN_H_ /* * NPY_BYTE_ORDER is set to the same value as BYTE_ORDER set by glibc in * endian.h */ #if defined(NPY_HAVE_ENDIAN_H) || defined(NPY_HAVE_SYS_ENDIAN_H) /* Use endian.h if available */ #if defined(NPY_HAVE_ENDIAN_H) #include <endian.h> #elif defined(NPY_HAVE_SYS_ENDIAN_H) #include <sys/endian.h> #endif #if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && defined(LITTLE_ENDIAN) #define NPY_BYTE_ORDER BYTE_ORDER #define NPY_LITTLE_ENDIAN LITTLE_ENDIAN #define NPY_BIG_ENDIAN BIG_ENDIAN #elif defined(_BYTE_ORDER) && defined(_BIG_ENDIAN) && defined(_LITTLE_ENDIAN) #define NPY_BYTE_ORDER _BYTE_ORDER #define NPY_LITTLE_ENDIAN _LITTLE_ENDIAN #define NPY_BIG_ENDIAN _BIG_ENDIAN #elif defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN) #define NPY_BYTE_ORDER __BYTE_ORDER #define NPY_LITTLE_ENDIAN __LITTLE_ENDIAN #define NPY_BIG_ENDIAN __BIG_ENDIAN #endif #endif #ifndef NPY_BYTE_ORDER /* Set endianness info using target CPU */ #include "npy_cpu.h" #define NPY_LITTLE_ENDIAN 1234 #define NPY_BIG_ENDIAN 4321 #if defined(NPY_CPU_X86) \ || defined(NPY_CPU_AMD64) \ || defined(NPY_CPU_IA64) \ || defined(NPY_CPU_ALPHA) \ || defined(NPY_CPU_ARMEL) \ || defined(NPY_CPU_AARCH64) \ || defined(NPY_CPU_SH_LE) \ || defined(NPY_CPU_MIPSEL) \ || defined(NPY_CPU_PPC64LE) \ || defined(NPY_CPU_ARCEL) #define NPY_BYTE_ORDER NPY_LITTLE_ENDIAN #elif defined(NPY_CPU_PPC) \ || defined(NPY_CPU_SPARC) \ || defined(NPY_CPU_S390) \ || defined(NPY_CPU_HPPA) \ || defined(NPY_CPU_PPC64) \ || defined(NPY_CPU_ARMEB) \ || defined(NPY_CPU_SH_BE) \ || defined(NPY_CPU_MIPSEB) \ || defined(NPY_CPU_OR1K) \ || defined(NPY_CPU_M68K) \ || defined(NPY_CPU_ARCEB) #define NPY_BYTE_ORDER NPY_BIG_ENDIAN #else #error Unknown CPU: can not set endianness #endif #endif #endif
2,288
32.173913
84
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/npy_math.h
#ifndef __NPY_MATH_C99_H_ #define __NPY_MATH_C99_H_ #ifdef __cplusplus extern "C" { #endif #include <math.h> #ifdef __SUNPRO_CC #include <sunmath.h> #endif #ifdef HAVE_NPY_CONFIG_H #include <npy_config.h> #endif #include <numpy/npy_common.h> /* By adding static inline specifiers to npy_math function definitions when appropriate, compiler is given the opportunity to optimize */ #if NPY_INLINE_MATH #define NPY_INPLACE NPY_INLINE static #else #define NPY_INPLACE #endif /* * NAN and INFINITY like macros (same behavior as glibc for NAN, same as C99 * for INFINITY) * * XXX: I should test whether INFINITY and NAN are available on the platform */ NPY_INLINE static float __npy_inff(void) { const union { npy_uint32 __i; float __f;} __bint = {0x7f800000UL}; return __bint.__f; } NPY_INLINE static float __npy_nanf(void) { const union { npy_uint32 __i; float __f;} __bint = {0x7fc00000UL}; return __bint.__f; } NPY_INLINE static float __npy_pzerof(void) { const union { npy_uint32 __i; float __f;} __bint = {0x00000000UL}; return __bint.__f; } NPY_INLINE static float __npy_nzerof(void) { const union { npy_uint32 __i; float __f;} __bint = {0x80000000UL}; return __bint.__f; } #define NPY_INFINITYF __npy_inff() #define NPY_NANF __npy_nanf() #define NPY_PZEROF __npy_pzerof() #define NPY_NZEROF __npy_nzerof() #define NPY_INFINITY ((npy_double)NPY_INFINITYF) #define NPY_NAN ((npy_double)NPY_NANF) #define NPY_PZERO ((npy_double)NPY_PZEROF) #define NPY_NZERO ((npy_double)NPY_NZEROF) #define NPY_INFINITYL ((npy_longdouble)NPY_INFINITYF) #define NPY_NANL ((npy_longdouble)NPY_NANF) #define NPY_PZEROL ((npy_longdouble)NPY_PZEROF) #define NPY_NZEROL ((npy_longdouble)NPY_NZEROF) /* * Useful constants */ #define NPY_E 2.718281828459045235360287471352662498 /* e */ #define NPY_LOG2E 1.442695040888963407359924681001892137 /* log_2 e */ #define NPY_LOG10E 0.434294481903251827651128918916605082 /* log_10 e */ #define NPY_LOGE2 0.693147180559945309417232121458176568 /* log_e 2 */ #define NPY_LOGE10 2.302585092994045684017991454684364208 /* log_e 10 */ #define NPY_PI 3.141592653589793238462643383279502884 /* pi */ #define NPY_PI_2 1.570796326794896619231321691639751442 /* pi/2 */ #define NPY_PI_4 0.785398163397448309615660845819875721 /* pi/4 */ #define NPY_1_PI 0.318309886183790671537767526745028724 /* 1/pi */ #define NPY_2_PI 0.636619772367581343075535053490057448 /* 2/pi */ #define NPY_EULER 0.577215664901532860606512090082402431 /* Euler constant */ #define NPY_SQRT2 1.414213562373095048801688724209698079 /* sqrt(2) */ #define NPY_SQRT1_2 0.707106781186547524400844362104849039 /* 1/sqrt(2) */ #define NPY_Ef 2.718281828459045235360287471352662498F /* e */ #define NPY_LOG2Ef 1.442695040888963407359924681001892137F /* log_2 e */ #define NPY_LOG10Ef 0.434294481903251827651128918916605082F /* log_10 e */ #define NPY_LOGE2f 0.693147180559945309417232121458176568F /* log_e 2 */ #define NPY_LOGE10f 2.302585092994045684017991454684364208F /* log_e 10 */ #define NPY_PIf 3.141592653589793238462643383279502884F /* pi */ #define NPY_PI_2f 1.570796326794896619231321691639751442F /* pi/2 */ #define NPY_PI_4f 0.785398163397448309615660845819875721F /* pi/4 */ #define NPY_1_PIf 0.318309886183790671537767526745028724F /* 1/pi */ #define NPY_2_PIf 0.636619772367581343075535053490057448F /* 2/pi */ #define NPY_EULERf 0.577215664901532860606512090082402431F /* Euler constant */ #define NPY_SQRT2f 1.414213562373095048801688724209698079F /* sqrt(2) */ #define NPY_SQRT1_2f 0.707106781186547524400844362104849039F /* 1/sqrt(2) */ #define NPY_El 2.718281828459045235360287471352662498L /* e */ #define NPY_LOG2El 1.442695040888963407359924681001892137L /* log_2 e */ #define NPY_LOG10El 0.434294481903251827651128918916605082L /* log_10 e */ #define NPY_LOGE2l 0.693147180559945309417232121458176568L /* log_e 2 */ #define NPY_LOGE10l 2.302585092994045684017991454684364208L /* log_e 10 */ #define NPY_PIl 3.141592653589793238462643383279502884L /* pi */ #define NPY_PI_2l 1.570796326794896619231321691639751442L /* pi/2 */ #define NPY_PI_4l 0.785398163397448309615660845819875721L /* pi/4 */ #define NPY_1_PIl 0.318309886183790671537767526745028724L /* 1/pi */ #define NPY_2_PIl 0.636619772367581343075535053490057448L /* 2/pi */ #define NPY_EULERl 0.577215664901532860606512090082402431L /* Euler constant */ #define NPY_SQRT2l 1.414213562373095048801688724209698079L /* sqrt(2) */ #define NPY_SQRT1_2l 0.707106781186547524400844362104849039L /* 1/sqrt(2) */ /* * C99 double math funcs */ NPY_INPLACE double npy_sin(double x); NPY_INPLACE double npy_cos(double x); NPY_INPLACE double npy_tan(double x); NPY_INPLACE double npy_sinh(double x); NPY_INPLACE double npy_cosh(double x); NPY_INPLACE double npy_tanh(double x); NPY_INPLACE double npy_asin(double x); NPY_INPLACE double npy_acos(double x); NPY_INPLACE double npy_atan(double x); NPY_INPLACE double npy_log(double x); NPY_INPLACE double npy_log10(double x); NPY_INPLACE double npy_exp(double x); NPY_INPLACE double npy_sqrt(double x); NPY_INPLACE double npy_cbrt(double x); NPY_INPLACE double npy_fabs(double x); NPY_INPLACE double npy_ceil(double x); NPY_INPLACE double npy_fmod(double x, double y); NPY_INPLACE double npy_floor(double x); NPY_INPLACE double npy_expm1(double x); NPY_INPLACE double npy_log1p(double x); NPY_INPLACE double npy_hypot(double x, double y); NPY_INPLACE double npy_acosh(double x); NPY_INPLACE double npy_asinh(double xx); NPY_INPLACE double npy_atanh(double x); NPY_INPLACE double npy_rint(double x); NPY_INPLACE double npy_trunc(double x); NPY_INPLACE double npy_exp2(double x); NPY_INPLACE double npy_log2(double x); NPY_INPLACE double npy_atan2(double x, double y); NPY_INPLACE double npy_pow(double x, double y); NPY_INPLACE double npy_modf(double x, double* y); NPY_INPLACE double npy_frexp(double x, int* y); NPY_INPLACE double npy_ldexp(double n, int y); NPY_INPLACE double npy_copysign(double x, double y); double npy_nextafter(double x, double y); double npy_spacing(double x); /* * IEEE 754 fpu handling. Those are guaranteed to be macros */ /* use builtins to avoid function calls in tight loops * only available if npy_config.h is available (= numpys own build) */ #if HAVE___BUILTIN_ISNAN #define npy_isnan(x) __builtin_isnan(x) #else #ifndef NPY_HAVE_DECL_ISNAN #define npy_isnan(x) ((x) != (x)) #else #if defined(_MSC_VER) && (_MSC_VER < 1900) #define npy_isnan(x) _isnan((x)) #else #define npy_isnan(x) isnan(x) #endif #endif #endif /* only available if npy_config.h is available (= numpys own build) */ #if HAVE___BUILTIN_ISFINITE #define npy_isfinite(x) __builtin_isfinite(x) #else #ifndef NPY_HAVE_DECL_ISFINITE #ifdef _MSC_VER #define npy_isfinite(x) _finite((x)) #else #define npy_isfinite(x) !npy_isnan((x) + (-x)) #endif #else #define npy_isfinite(x) isfinite((x)) #endif #endif /* only available if npy_config.h is available (= numpys own build) */ #if HAVE___BUILTIN_ISINF #define npy_isinf(x) __builtin_isinf(x) #else #ifndef NPY_HAVE_DECL_ISINF #define npy_isinf(x) (!npy_isfinite(x) && !npy_isnan(x)) #else #if defined(_MSC_VER) && (_MSC_VER < 1900) #define npy_isinf(x) (!_finite((x)) && !_isnan((x))) #else #define npy_isinf(x) isinf((x)) #endif #endif #endif #ifndef NPY_HAVE_DECL_SIGNBIT int _npy_signbit_f(float x); int _npy_signbit_d(double x); int _npy_signbit_ld(long double x); #define npy_signbit(x) \ (sizeof (x) == sizeof (long double) ? _npy_signbit_ld (x) \ : sizeof (x) == sizeof (double) ? _npy_signbit_d (x) \ : _npy_signbit_f (x)) #else #define npy_signbit(x) signbit((x)) #endif /* * float C99 math functions */ NPY_INPLACE float npy_sinf(float x); NPY_INPLACE float npy_cosf(float x); NPY_INPLACE float npy_tanf(float x); NPY_INPLACE float npy_sinhf(float x); NPY_INPLACE float npy_coshf(float x); NPY_INPLACE float npy_tanhf(float x); NPY_INPLACE float npy_fabsf(float x); NPY_INPLACE float npy_floorf(float x); NPY_INPLACE float npy_ceilf(float x); NPY_INPLACE float npy_rintf(float x); NPY_INPLACE float npy_truncf(float x); NPY_INPLACE float npy_sqrtf(float x); NPY_INPLACE float npy_cbrtf(float x); NPY_INPLACE float npy_log10f(float x); NPY_INPLACE float npy_logf(float x); NPY_INPLACE float npy_expf(float x); NPY_INPLACE float npy_expm1f(float x); NPY_INPLACE float npy_asinf(float x); NPY_INPLACE float npy_acosf(float x); NPY_INPLACE float npy_atanf(float x); NPY_INPLACE float npy_asinhf(float x); NPY_INPLACE float npy_acoshf(float x); NPY_INPLACE float npy_atanhf(float x); NPY_INPLACE float npy_log1pf(float x); NPY_INPLACE float npy_exp2f(float x); NPY_INPLACE float npy_log2f(float x); NPY_INPLACE float npy_atan2f(float x, float y); NPY_INPLACE float npy_hypotf(float x, float y); NPY_INPLACE float npy_powf(float x, float y); NPY_INPLACE float npy_fmodf(float x, float y); NPY_INPLACE float npy_modff(float x, float* y); NPY_INPLACE float npy_frexpf(float x, int* y); NPY_INPLACE float npy_ldexpf(float x, int y); NPY_INPLACE float npy_copysignf(float x, float y); float npy_nextafterf(float x, float y); float npy_spacingf(float x); /* * long double C99 math functions */ NPY_INPLACE npy_longdouble npy_sinl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_cosl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_tanl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_sinhl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_coshl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_tanhl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_fabsl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_floorl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_ceill(npy_longdouble x); NPY_INPLACE npy_longdouble npy_rintl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_truncl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_sqrtl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_cbrtl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_log10l(npy_longdouble x); NPY_INPLACE npy_longdouble npy_logl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_expl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_expm1l(npy_longdouble x); NPY_INPLACE npy_longdouble npy_asinl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_acosl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_atanl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_asinhl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_acoshl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_atanhl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_log1pl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_exp2l(npy_longdouble x); NPY_INPLACE npy_longdouble npy_log2l(npy_longdouble x); NPY_INPLACE npy_longdouble npy_atan2l(npy_longdouble x, npy_longdouble y); NPY_INPLACE npy_longdouble npy_hypotl(npy_longdouble x, npy_longdouble y); NPY_INPLACE npy_longdouble npy_powl(npy_longdouble x, npy_longdouble y); NPY_INPLACE npy_longdouble npy_fmodl(npy_longdouble x, npy_longdouble y); NPY_INPLACE npy_longdouble npy_modfl(npy_longdouble x, npy_longdouble* y); NPY_INPLACE npy_longdouble npy_frexpl(npy_longdouble x, int* y); NPY_INPLACE npy_longdouble npy_ldexpl(npy_longdouble x, int y); NPY_INPLACE npy_longdouble npy_copysignl(npy_longdouble x, npy_longdouble y); npy_longdouble npy_nextafterl(npy_longdouble x, npy_longdouble y); npy_longdouble npy_spacingl(npy_longdouble x); /* * Non standard functions */ NPY_INPLACE double npy_deg2rad(double x); NPY_INPLACE double npy_rad2deg(double x); NPY_INPLACE double npy_logaddexp(double x, double y); NPY_INPLACE double npy_logaddexp2(double x, double y); NPY_INPLACE double npy_divmod(double x, double y, double *modulus); NPY_INPLACE double npy_heaviside(double x, double h0); NPY_INPLACE float npy_deg2radf(float x); NPY_INPLACE float npy_rad2degf(float x); NPY_INPLACE float npy_logaddexpf(float x, float y); NPY_INPLACE float npy_logaddexp2f(float x, float y); NPY_INPLACE float npy_divmodf(float x, float y, float *modulus); NPY_INPLACE float npy_heavisidef(float x, float h0); NPY_INPLACE npy_longdouble npy_deg2radl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_rad2degl(npy_longdouble x); NPY_INPLACE npy_longdouble npy_logaddexpl(npy_longdouble x, npy_longdouble y); NPY_INPLACE npy_longdouble npy_logaddexp2l(npy_longdouble x, npy_longdouble y); NPY_INPLACE npy_longdouble npy_divmodl(npy_longdouble x, npy_longdouble y, npy_longdouble *modulus); NPY_INPLACE npy_longdouble npy_heavisidel(npy_longdouble x, npy_longdouble h0); #define npy_degrees npy_rad2deg #define npy_degreesf npy_rad2degf #define npy_degreesl npy_rad2degl #define npy_radians npy_deg2rad #define npy_radiansf npy_deg2radf #define npy_radiansl npy_deg2radl /* * Complex declarations */ /* * C99 specifies that complex numbers have the same representation as * an array of two elements, where the first element is the real part * and the second element is the imaginary part. */ #define __NPY_CPACK_IMP(x, y, type, ctype) \ union { \ ctype z; \ type a[2]; \ } z1;; \ \ z1.a[0] = (x); \ z1.a[1] = (y); \ \ return z1.z; static NPY_INLINE npy_cdouble npy_cpack(double x, double y) { __NPY_CPACK_IMP(x, y, double, npy_cdouble); } static NPY_INLINE npy_cfloat npy_cpackf(float x, float y) { __NPY_CPACK_IMP(x, y, float, npy_cfloat); } static NPY_INLINE npy_clongdouble npy_cpackl(npy_longdouble x, npy_longdouble y) { __NPY_CPACK_IMP(x, y, npy_longdouble, npy_clongdouble); } #undef __NPY_CPACK_IMP /* * Same remark as above, but in the other direction: extract first/second * member of complex number, assuming a C99-compatible representation * * Those are defineds as static inline, and such as a reasonable compiler would * most likely compile this to one or two instructions (on CISC at least) */ #define __NPY_CEXTRACT_IMP(z, index, type, ctype) \ union { \ ctype z; \ type a[2]; \ } __z_repr; \ __z_repr.z = z; \ \ return __z_repr.a[index]; static NPY_INLINE double npy_creal(npy_cdouble z) { __NPY_CEXTRACT_IMP(z, 0, double, npy_cdouble); } static NPY_INLINE double npy_cimag(npy_cdouble z) { __NPY_CEXTRACT_IMP(z, 1, double, npy_cdouble); } static NPY_INLINE float npy_crealf(npy_cfloat z) { __NPY_CEXTRACT_IMP(z, 0, float, npy_cfloat); } static NPY_INLINE float npy_cimagf(npy_cfloat z) { __NPY_CEXTRACT_IMP(z, 1, float, npy_cfloat); } static NPY_INLINE npy_longdouble npy_creall(npy_clongdouble z) { __NPY_CEXTRACT_IMP(z, 0, npy_longdouble, npy_clongdouble); } static NPY_INLINE npy_longdouble npy_cimagl(npy_clongdouble z) { __NPY_CEXTRACT_IMP(z, 1, npy_longdouble, npy_clongdouble); } #undef __NPY_CEXTRACT_IMP /* * Double precision complex functions */ double npy_cabs(npy_cdouble z); double npy_carg(npy_cdouble z); npy_cdouble npy_cexp(npy_cdouble z); npy_cdouble npy_clog(npy_cdouble z); npy_cdouble npy_cpow(npy_cdouble x, npy_cdouble y); npy_cdouble npy_csqrt(npy_cdouble z); npy_cdouble npy_ccos(npy_cdouble z); npy_cdouble npy_csin(npy_cdouble z); npy_cdouble npy_ctan(npy_cdouble z); npy_cdouble npy_ccosh(npy_cdouble z); npy_cdouble npy_csinh(npy_cdouble z); npy_cdouble npy_ctanh(npy_cdouble z); npy_cdouble npy_cacos(npy_cdouble z); npy_cdouble npy_casin(npy_cdouble z); npy_cdouble npy_catan(npy_cdouble z); npy_cdouble npy_cacosh(npy_cdouble z); npy_cdouble npy_casinh(npy_cdouble z); npy_cdouble npy_catanh(npy_cdouble z); /* * Single precision complex functions */ float npy_cabsf(npy_cfloat z); float npy_cargf(npy_cfloat z); npy_cfloat npy_cexpf(npy_cfloat z); npy_cfloat npy_clogf(npy_cfloat z); npy_cfloat npy_cpowf(npy_cfloat x, npy_cfloat y); npy_cfloat npy_csqrtf(npy_cfloat z); npy_cfloat npy_ccosf(npy_cfloat z); npy_cfloat npy_csinf(npy_cfloat z); npy_cfloat npy_ctanf(npy_cfloat z); npy_cfloat npy_ccoshf(npy_cfloat z); npy_cfloat npy_csinhf(npy_cfloat z); npy_cfloat npy_ctanhf(npy_cfloat z); npy_cfloat npy_cacosf(npy_cfloat z); npy_cfloat npy_casinf(npy_cfloat z); npy_cfloat npy_catanf(npy_cfloat z); npy_cfloat npy_cacoshf(npy_cfloat z); npy_cfloat npy_casinhf(npy_cfloat z); npy_cfloat npy_catanhf(npy_cfloat z); /* * Extended precision complex functions */ npy_longdouble npy_cabsl(npy_clongdouble z); npy_longdouble npy_cargl(npy_clongdouble z); npy_clongdouble npy_cexpl(npy_clongdouble z); npy_clongdouble npy_clogl(npy_clongdouble z); npy_clongdouble npy_cpowl(npy_clongdouble x, npy_clongdouble y); npy_clongdouble npy_csqrtl(npy_clongdouble z); npy_clongdouble npy_ccosl(npy_clongdouble z); npy_clongdouble npy_csinl(npy_clongdouble z); npy_clongdouble npy_ctanl(npy_clongdouble z); npy_clongdouble npy_ccoshl(npy_clongdouble z); npy_clongdouble npy_csinhl(npy_clongdouble z); npy_clongdouble npy_ctanhl(npy_clongdouble z); npy_clongdouble npy_cacosl(npy_clongdouble z); npy_clongdouble npy_casinl(npy_clongdouble z); npy_clongdouble npy_catanl(npy_clongdouble z); npy_clongdouble npy_cacoshl(npy_clongdouble z); npy_clongdouble npy_casinhl(npy_clongdouble z); npy_clongdouble npy_catanhl(npy_clongdouble z); /* * Functions that set the floating point error * status word. */ /* * platform-dependent code translates floating point * status to an integer sum of these values */ #define NPY_FPE_DIVIDEBYZERO 1 #define NPY_FPE_OVERFLOW 2 #define NPY_FPE_UNDERFLOW 4 #define NPY_FPE_INVALID 8 int npy_clear_floatstatus_barrier(char*); int npy_get_floatstatus_barrier(char*); /* * use caution with these - clang and gcc8.1 are known to reorder calls * to this form of the function which can defeat the check */ int npy_clear_floatstatus(void); int npy_get_floatstatus(void); void npy_set_floatstatus_divbyzero(void); void npy_set_floatstatus_overflow(void); void npy_set_floatstatus_underflow(void); void npy_set_floatstatus_invalid(void); #ifdef __cplusplus } #endif #if NPY_INLINE_MATH #include "npy_math_internal.h" #endif #endif
18,740
33.136612
82
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/old_defines.h
/* This header is deprecated as of NumPy 1.7 */ #ifndef OLD_DEFINES_H #define OLD_DEFINES_H #if defined(NPY_NO_DEPRECATED_API) && NPY_NO_DEPRECATED_API >= NPY_1_7_API_VERSION #error The header "old_defines.h" is deprecated as of NumPy 1.7. #endif #define NDARRAY_VERSION NPY_VERSION #define PyArray_MIN_BUFSIZE NPY_MIN_BUFSIZE #define PyArray_MAX_BUFSIZE NPY_MAX_BUFSIZE #define PyArray_BUFSIZE NPY_BUFSIZE #define PyArray_PRIORITY NPY_PRIORITY #define PyArray_SUBTYPE_PRIORITY NPY_PRIORITY #define PyArray_NUM_FLOATTYPE NPY_NUM_FLOATTYPE #define NPY_MAX PyArray_MAX #define NPY_MIN PyArray_MIN #define PyArray_TYPES NPY_TYPES #define PyArray_BOOL NPY_BOOL #define PyArray_BYTE NPY_BYTE #define PyArray_UBYTE NPY_UBYTE #define PyArray_SHORT NPY_SHORT #define PyArray_USHORT NPY_USHORT #define PyArray_INT NPY_INT #define PyArray_UINT NPY_UINT #define PyArray_LONG NPY_LONG #define PyArray_ULONG NPY_ULONG #define PyArray_LONGLONG NPY_LONGLONG #define PyArray_ULONGLONG NPY_ULONGLONG #define PyArray_HALF NPY_HALF #define PyArray_FLOAT NPY_FLOAT #define PyArray_DOUBLE NPY_DOUBLE #define PyArray_LONGDOUBLE NPY_LONGDOUBLE #define PyArray_CFLOAT NPY_CFLOAT #define PyArray_CDOUBLE NPY_CDOUBLE #define PyArray_CLONGDOUBLE NPY_CLONGDOUBLE #define PyArray_OBJECT NPY_OBJECT #define PyArray_STRING NPY_STRING #define PyArray_UNICODE NPY_UNICODE #define PyArray_VOID NPY_VOID #define PyArray_DATETIME NPY_DATETIME #define PyArray_TIMEDELTA NPY_TIMEDELTA #define PyArray_NTYPES NPY_NTYPES #define PyArray_NOTYPE NPY_NOTYPE #define PyArray_CHAR NPY_CHAR #define PyArray_USERDEF NPY_USERDEF #define PyArray_NUMUSERTYPES NPY_NUMUSERTYPES #define PyArray_INTP NPY_INTP #define PyArray_UINTP NPY_UINTP #define PyArray_INT8 NPY_INT8 #define PyArray_UINT8 NPY_UINT8 #define PyArray_INT16 NPY_INT16 #define PyArray_UINT16 NPY_UINT16 #define PyArray_INT32 NPY_INT32 #define PyArray_UINT32 NPY_UINT32 #ifdef NPY_INT64 #define PyArray_INT64 NPY_INT64 #define PyArray_UINT64 NPY_UINT64 #endif #ifdef NPY_INT128 #define PyArray_INT128 NPY_INT128 #define PyArray_UINT128 NPY_UINT128 #endif #ifdef NPY_FLOAT16 #define PyArray_FLOAT16 NPY_FLOAT16 #define PyArray_COMPLEX32 NPY_COMPLEX32 #endif #ifdef NPY_FLOAT80 #define PyArray_FLOAT80 NPY_FLOAT80 #define PyArray_COMPLEX160 NPY_COMPLEX160 #endif #ifdef NPY_FLOAT96 #define PyArray_FLOAT96 NPY_FLOAT96 #define PyArray_COMPLEX192 NPY_COMPLEX192 #endif #ifdef NPY_FLOAT128 #define PyArray_FLOAT128 NPY_FLOAT128 #define PyArray_COMPLEX256 NPY_COMPLEX256 #endif #define PyArray_FLOAT32 NPY_FLOAT32 #define PyArray_COMPLEX64 NPY_COMPLEX64 #define PyArray_FLOAT64 NPY_FLOAT64 #define PyArray_COMPLEX128 NPY_COMPLEX128 #define PyArray_TYPECHAR NPY_TYPECHAR #define PyArray_BOOLLTR NPY_BOOLLTR #define PyArray_BYTELTR NPY_BYTELTR #define PyArray_UBYTELTR NPY_UBYTELTR #define PyArray_SHORTLTR NPY_SHORTLTR #define PyArray_USHORTLTR NPY_USHORTLTR #define PyArray_INTLTR NPY_INTLTR #define PyArray_UINTLTR NPY_UINTLTR #define PyArray_LONGLTR NPY_LONGLTR #define PyArray_ULONGLTR NPY_ULONGLTR #define PyArray_LONGLONGLTR NPY_LONGLONGLTR #define PyArray_ULONGLONGLTR NPY_ULONGLONGLTR #define PyArray_HALFLTR NPY_HALFLTR #define PyArray_FLOATLTR NPY_FLOATLTR #define PyArray_DOUBLELTR NPY_DOUBLELTR #define PyArray_LONGDOUBLELTR NPY_LONGDOUBLELTR #define PyArray_CFLOATLTR NPY_CFLOATLTR #define PyArray_CDOUBLELTR NPY_CDOUBLELTR #define PyArray_CLONGDOUBLELTR NPY_CLONGDOUBLELTR #define PyArray_OBJECTLTR NPY_OBJECTLTR #define PyArray_STRINGLTR NPY_STRINGLTR #define PyArray_STRINGLTR2 NPY_STRINGLTR2 #define PyArray_UNICODELTR NPY_UNICODELTR #define PyArray_VOIDLTR NPY_VOIDLTR #define PyArray_DATETIMELTR NPY_DATETIMELTR #define PyArray_TIMEDELTALTR NPY_TIMEDELTALTR #define PyArray_CHARLTR NPY_CHARLTR #define PyArray_INTPLTR NPY_INTPLTR #define PyArray_UINTPLTR NPY_UINTPLTR #define PyArray_GENBOOLLTR NPY_GENBOOLLTR #define PyArray_SIGNEDLTR NPY_SIGNEDLTR #define PyArray_UNSIGNEDLTR NPY_UNSIGNEDLTR #define PyArray_FLOATINGLTR NPY_FLOATINGLTR #define PyArray_COMPLEXLTR NPY_COMPLEXLTR #define PyArray_QUICKSORT NPY_QUICKSORT #define PyArray_HEAPSORT NPY_HEAPSORT #define PyArray_MERGESORT NPY_MERGESORT #define PyArray_SORTKIND NPY_SORTKIND #define PyArray_NSORTS NPY_NSORTS #define PyArray_NOSCALAR NPY_NOSCALAR #define PyArray_BOOL_SCALAR NPY_BOOL_SCALAR #define PyArray_INTPOS_SCALAR NPY_INTPOS_SCALAR #define PyArray_INTNEG_SCALAR NPY_INTNEG_SCALAR #define PyArray_FLOAT_SCALAR NPY_FLOAT_SCALAR #define PyArray_COMPLEX_SCALAR NPY_COMPLEX_SCALAR #define PyArray_OBJECT_SCALAR NPY_OBJECT_SCALAR #define PyArray_SCALARKIND NPY_SCALARKIND #define PyArray_NSCALARKINDS NPY_NSCALARKINDS #define PyArray_ANYORDER NPY_ANYORDER #define PyArray_CORDER NPY_CORDER #define PyArray_FORTRANORDER NPY_FORTRANORDER #define PyArray_ORDER NPY_ORDER #define PyDescr_ISBOOL PyDataType_ISBOOL #define PyDescr_ISUNSIGNED PyDataType_ISUNSIGNED #define PyDescr_ISSIGNED PyDataType_ISSIGNED #define PyDescr_ISINTEGER PyDataType_ISINTEGER #define PyDescr_ISFLOAT PyDataType_ISFLOAT #define PyDescr_ISNUMBER PyDataType_ISNUMBER #define PyDescr_ISSTRING PyDataType_ISSTRING #define PyDescr_ISCOMPLEX PyDataType_ISCOMPLEX #define PyDescr_ISPYTHON PyDataType_ISPYTHON #define PyDescr_ISFLEXIBLE PyDataType_ISFLEXIBLE #define PyDescr_ISUSERDEF PyDataType_ISUSERDEF #define PyDescr_ISEXTENDED PyDataType_ISEXTENDED #define PyDescr_ISOBJECT PyDataType_ISOBJECT #define PyDescr_HASFIELDS PyDataType_HASFIELDS #define PyArray_LITTLE NPY_LITTLE #define PyArray_BIG NPY_BIG #define PyArray_NATIVE NPY_NATIVE #define PyArray_SWAP NPY_SWAP #define PyArray_IGNORE NPY_IGNORE #define PyArray_NATBYTE NPY_NATBYTE #define PyArray_OPPBYTE NPY_OPPBYTE #define PyArray_MAX_ELSIZE NPY_MAX_ELSIZE #define PyArray_USE_PYMEM NPY_USE_PYMEM #define PyArray_RemoveLargest PyArray_RemoveSmallest #define PyArray_UCS4 npy_ucs4 #endif
6,306
32.547872
82
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/utils.h
#ifndef __NUMPY_UTILS_HEADER__ #define __NUMPY_UTILS_HEADER__ #ifndef __COMP_NPY_UNUSED #if defined(__GNUC__) #define __COMP_NPY_UNUSED __attribute__ ((__unused__)) # elif defined(__ICC) #define __COMP_NPY_UNUSED __attribute__ ((__unused__)) #else #define __COMP_NPY_UNUSED #endif #endif /* Use this to tag a variable as not used. It will remove unused variable * warning on support platforms (see __COM_NPY_UNUSED) and mangle the variable * to avoid accidental use */ #define NPY_UNUSED(x) (__NPY_UNUSED_TAGGED ## x) __COMP_NPY_UNUSED #endif
628
30.45
78
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/npy_no_deprecated_api.h
/* * This include file is provided for inclusion in Cython *.pyd files where * one would like to define the NPY_NO_DEPRECATED_API macro. It can be * included by * * cdef extern from "npy_no_deprecated_api.h": pass * */ #ifndef NPY_NO_DEPRECATED_API /* put this check here since there may be multiple includes in C extensions. */ #if defined(NDARRAYTYPES_H) || defined(_NPY_DEPRECATED_API_H) || \ defined(OLD_DEFINES_H) #error "npy_no_deprecated_api.h" must be first among numpy includes. #else #define NPY_NO_DEPRECATED_API NPY_API_VERSION #endif #endif
567
27.4
79
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h
#ifndef Py_ARRAYOBJECT_H #define Py_ARRAYOBJECT_H #include "ndarrayobject.h" #include "npy_interrupt.h" #ifdef NPY_NO_PREFIX #include "noprefix.h" #endif #endif
164
12.75
26
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/npy_3kcompat.h
/* * This is a convenience header file providing compatibility utilities * for supporting Python 2 and Python 3 in the same code base. * * If you want to use this for your own projects, it's recommended to make a * copy of it. Although the stuff below is unlikely to change, we don't provide * strong backwards compatibility guarantees at the moment. */ #ifndef _NPY_3KCOMPAT_H_ #define _NPY_3KCOMPAT_H_ #include <Python.h> #include <stdio.h> #if PY_VERSION_HEX >= 0x03000000 #ifndef NPY_PY3K #define NPY_PY3K 1 #endif #endif #include "numpy/npy_common.h" #include "numpy/ndarrayobject.h" #ifdef __cplusplus extern "C" { #endif /* * PyInt -> PyLong */ #if defined(NPY_PY3K) /* Return True only if the long fits in a C long */ static NPY_INLINE int PyInt_Check(PyObject *op) { int overflow = 0; if (!PyLong_Check(op)) { return 0; } PyLong_AsLongAndOverflow(op, &overflow); return (overflow == 0); } #define PyInt_FromLong PyLong_FromLong #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AsLong #define PyInt_AsSsize_t PyLong_AsSsize_t /* NOTE: * * Since the PyLong type is very different from the fixed-range PyInt, * we don't define PyInt_Type -> PyLong_Type. */ #endif /* NPY_PY3K */ /* Py3 changes PySlice_GetIndicesEx' first argument's type to PyObject* */ #ifdef NPY_PY3K # define NpySlice_GetIndicesEx PySlice_GetIndicesEx #else # define NpySlice_GetIndicesEx(op, nop, start, end, step, slicelength) \ PySlice_GetIndicesEx((PySliceObject *)op, nop, start, end, step, slicelength) #endif /* * PyString -> PyBytes */ #if defined(NPY_PY3K) #define PyString_Type PyBytes_Type #define PyString_Check PyBytes_Check #define PyStringObject PyBytesObject #define PyString_FromString PyBytes_FromString #define PyString_FromStringAndSize PyBytes_FromStringAndSize #define PyString_AS_STRING PyBytes_AS_STRING #define PyString_AsStringAndSize PyBytes_AsStringAndSize #define PyString_FromFormat PyBytes_FromFormat #define PyString_Concat PyBytes_Concat #define PyString_ConcatAndDel PyBytes_ConcatAndDel #define PyString_AsString PyBytes_AsString #define PyString_GET_SIZE PyBytes_GET_SIZE #define PyString_Size PyBytes_Size #define PyUString_Type PyUnicode_Type #define PyUString_Check PyUnicode_Check #define PyUStringObject PyUnicodeObject #define PyUString_FromString PyUnicode_FromString #define PyUString_FromStringAndSize PyUnicode_FromStringAndSize #define PyUString_FromFormat PyUnicode_FromFormat #define PyUString_Concat PyUnicode_Concat2 #define PyUString_ConcatAndDel PyUnicode_ConcatAndDel #define PyUString_GET_SIZE PyUnicode_GET_SIZE #define PyUString_Size PyUnicode_Size #define PyUString_InternFromString PyUnicode_InternFromString #define PyUString_Format PyUnicode_Format #define PyBaseString_Check(obj) (PyUnicode_Check(obj)) #else #define PyBytes_Type PyString_Type #define PyBytes_Check PyString_Check #define PyBytesObject PyStringObject #define PyBytes_FromString PyString_FromString #define PyBytes_FromStringAndSize PyString_FromStringAndSize #define PyBytes_AS_STRING PyString_AS_STRING #define PyBytes_AsStringAndSize PyString_AsStringAndSize #define PyBytes_FromFormat PyString_FromFormat #define PyBytes_Concat PyString_Concat #define PyBytes_ConcatAndDel PyString_ConcatAndDel #define PyBytes_AsString PyString_AsString #define PyBytes_GET_SIZE PyString_GET_SIZE #define PyBytes_Size PyString_Size #define PyUString_Type PyString_Type #define PyUString_Check PyString_Check #define PyUStringObject PyStringObject #define PyUString_FromString PyString_FromString #define PyUString_FromStringAndSize PyString_FromStringAndSize #define PyUString_FromFormat PyString_FromFormat #define PyUString_Concat PyString_Concat #define PyUString_ConcatAndDel PyString_ConcatAndDel #define PyUString_GET_SIZE PyString_GET_SIZE #define PyUString_Size PyString_Size #define PyUString_InternFromString PyString_InternFromString #define PyUString_Format PyString_Format #define PyBaseString_Check(obj) (PyBytes_Check(obj) || PyUnicode_Check(obj)) #endif /* NPY_PY3K */ static NPY_INLINE void PyUnicode_ConcatAndDel(PyObject **left, PyObject *right) { PyObject *newobj; newobj = PyUnicode_Concat(*left, right); Py_DECREF(*left); Py_DECREF(right); *left = newobj; } static NPY_INLINE void PyUnicode_Concat2(PyObject **left, PyObject *right) { PyObject *newobj; newobj = PyUnicode_Concat(*left, right); Py_DECREF(*left); *left = newobj; } /* * PyFile_* compatibility */ /* * Get a FILE* handle to the file represented by the Python object */ static NPY_INLINE FILE* npy_PyFile_Dup2(PyObject *file, char *mode, npy_off_t *orig_pos) { int fd, fd2, unbuf; PyObject *ret, *os, *io, *io_raw; npy_off_t pos; FILE *handle; /* For Python 2 PyFileObject, use PyFile_AsFile */ #if !defined(NPY_PY3K) if (PyFile_Check(file)) { return PyFile_AsFile(file); } #endif /* Flush first to ensure things end up in the file in the correct order */ ret = PyObject_CallMethod(file, "flush", ""); if (ret == NULL) { return NULL; } Py_DECREF(ret); fd = PyObject_AsFileDescriptor(file); if (fd == -1) { return NULL; } /* * The handle needs to be dup'd because we have to call fclose * at the end */ os = PyImport_ImportModule("os"); if (os == NULL) { return NULL; } ret = PyObject_CallMethod(os, "dup", "i", fd); Py_DECREF(os); if (ret == NULL) { return NULL; } fd2 = PyNumber_AsSsize_t(ret, NULL); Py_DECREF(ret); /* Convert to FILE* handle */ #ifdef _WIN32 handle = _fdopen(fd2, mode); #else handle = fdopen(fd2, mode); #endif if (handle == NULL) { PyErr_SetString(PyExc_IOError, "Getting a FILE* from a Python file object failed"); } /* Record the original raw file handle position */ *orig_pos = npy_ftell(handle); if (*orig_pos == -1) { /* The io module is needed to determine if buffering is used */ io = PyImport_ImportModule("io"); if (io == NULL) { fclose(handle); return NULL; } /* File object instances of RawIOBase are unbuffered */ io_raw = PyObject_GetAttrString(io, "RawIOBase"); Py_DECREF(io); if (io_raw == NULL) { fclose(handle); return NULL; } unbuf = PyObject_IsInstance(file, io_raw); Py_DECREF(io_raw); if (unbuf == 1) { /* Succeed if the IO is unbuffered */ return handle; } else { PyErr_SetString(PyExc_IOError, "obtaining file position failed"); fclose(handle); return NULL; } } /* Seek raw handle to the Python-side position */ ret = PyObject_CallMethod(file, "tell", ""); if (ret == NULL) { fclose(handle); return NULL; } pos = PyLong_AsLongLong(ret); Py_DECREF(ret); if (PyErr_Occurred()) { fclose(handle); return NULL; } if (npy_fseek(handle, pos, SEEK_SET) == -1) { PyErr_SetString(PyExc_IOError, "seeking file failed"); fclose(handle); return NULL; } return handle; } /* * Close the dup-ed file handle, and seek the Python one to the current position */ static NPY_INLINE int npy_PyFile_DupClose2(PyObject *file, FILE* handle, npy_off_t orig_pos) { int fd, unbuf; PyObject *ret, *io, *io_raw; npy_off_t position; /* For Python 2 PyFileObject, do nothing */ #if !defined(NPY_PY3K) if (PyFile_Check(file)) { return 0; } #endif position = npy_ftell(handle); /* Close the FILE* handle */ fclose(handle); /* * Restore original file handle position, in order to not confuse * Python-side data structures */ fd = PyObject_AsFileDescriptor(file); if (fd == -1) { return -1; } if (npy_lseek(fd, orig_pos, SEEK_SET) == -1) { /* The io module is needed to determine if buffering is used */ io = PyImport_ImportModule("io"); if (io == NULL) { return -1; } /* File object instances of RawIOBase are unbuffered */ io_raw = PyObject_GetAttrString(io, "RawIOBase"); Py_DECREF(io); if (io_raw == NULL) { return -1; } unbuf = PyObject_IsInstance(file, io_raw); Py_DECREF(io_raw); if (unbuf == 1) { /* Succeed if the IO is unbuffered */ return 0; } else { PyErr_SetString(PyExc_IOError, "seeking file failed"); return -1; } } if (position == -1) { PyErr_SetString(PyExc_IOError, "obtaining file position failed"); return -1; } /* Seek Python-side handle to the FILE* handle position */ ret = PyObject_CallMethod(file, "seek", NPY_OFF_T_PYFMT "i", position, 0); if (ret == NULL) { return -1; } Py_DECREF(ret); return 0; } static NPY_INLINE int npy_PyFile_Check(PyObject *file) { int fd; /* For Python 2, check if it is a PyFileObject */ #if !defined(NPY_PY3K) if (PyFile_Check(file)) { return 1; } #endif fd = PyObject_AsFileDescriptor(file); if (fd == -1) { PyErr_Clear(); return 0; } return 1; } static NPY_INLINE PyObject* npy_PyFile_OpenFile(PyObject *filename, const char *mode) { PyObject *open; open = PyDict_GetItemString(PyEval_GetBuiltins(), "open"); if (open == NULL) { return NULL; } return PyObject_CallFunction(open, "Os", filename, mode); } static NPY_INLINE int npy_PyFile_CloseFile(PyObject *file) { PyObject *ret; ret = PyObject_CallMethod(file, "close", NULL); if (ret == NULL) { return -1; } Py_DECREF(ret); return 0; } /* * PyObject_Cmp */ #if defined(NPY_PY3K) static NPY_INLINE int PyObject_Cmp(PyObject *i1, PyObject *i2, int *cmp) { int v; v = PyObject_RichCompareBool(i1, i2, Py_LT); if (v == 1) { *cmp = -1; return 1; } else if (v == -1) { return -1; } v = PyObject_RichCompareBool(i1, i2, Py_GT); if (v == 1) { *cmp = 1; return 1; } else if (v == -1) { return -1; } v = PyObject_RichCompareBool(i1, i2, Py_EQ); if (v == 1) { *cmp = 0; return 1; } else { *cmp = 0; return -1; } } #endif /* * PyCObject functions adapted to PyCapsules. * * The main job here is to get rid of the improved error handling * of PyCapsules. It's a shame... */ #if PY_VERSION_HEX >= 0x03000000 static NPY_INLINE PyObject * NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *)) { PyObject *ret = PyCapsule_New(ptr, NULL, dtor); if (ret == NULL) { PyErr_Clear(); } return ret; } static NPY_INLINE PyObject * NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(PyObject *)) { PyObject *ret = NpyCapsule_FromVoidPtr(ptr, dtor); if (ret != NULL && PyCapsule_SetContext(ret, context) != 0) { PyErr_Clear(); Py_DECREF(ret); ret = NULL; } return ret; } static NPY_INLINE void * NpyCapsule_AsVoidPtr(PyObject *obj) { void *ret = PyCapsule_GetPointer(obj, NULL); if (ret == NULL) { PyErr_Clear(); } return ret; } static NPY_INLINE void * NpyCapsule_GetDesc(PyObject *obj) { return PyCapsule_GetContext(obj); } static NPY_INLINE int NpyCapsule_Check(PyObject *ptr) { return PyCapsule_CheckExact(ptr); } #else static NPY_INLINE PyObject * NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(void *)) { return PyCObject_FromVoidPtr(ptr, dtor); } static NPY_INLINE PyObject * NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(void *, void *)) { return PyCObject_FromVoidPtrAndDesc(ptr, context, dtor); } static NPY_INLINE void * NpyCapsule_AsVoidPtr(PyObject *ptr) { return PyCObject_AsVoidPtr(ptr); } static NPY_INLINE void * NpyCapsule_GetDesc(PyObject *obj) { return PyCObject_GetDesc(obj); } static NPY_INLINE int NpyCapsule_Check(PyObject *ptr) { return PyCObject_Check(ptr); } #endif #ifdef __cplusplus } #endif #endif /* _NPY_3KCOMPAT_H_ */
12,315
23.485089
81
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/_numpyconfig.h
#define NPY_SIZEOF_SHORT SIZEOF_SHORT #define NPY_SIZEOF_INT SIZEOF_INT #define NPY_SIZEOF_LONG SIZEOF_LONG #define NPY_SIZEOF_FLOAT 4 #define NPY_SIZEOF_COMPLEX_FLOAT 8 #define NPY_SIZEOF_DOUBLE 8 #define NPY_SIZEOF_COMPLEX_DOUBLE 16 #define NPY_SIZEOF_LONGDOUBLE 16 #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 #define NPY_SIZEOF_PY_INTPTR_T 8 #define NPY_SIZEOF_OFF_T 8 #define NPY_SIZEOF_PY_LONG_LONG 8 #define NPY_SIZEOF_LONGLONG 8 #define NPY_NO_SMP 0 #define NPY_HAVE_DECL_ISNAN #define NPY_HAVE_DECL_ISINF #define NPY_HAVE_DECL_ISFINITE #define NPY_HAVE_DECL_SIGNBIT #define NPY_USE_C99_COMPLEX 1 #define NPY_HAVE_COMPLEX_DOUBLE 1 #define NPY_HAVE_COMPLEX_FLOAT 1 #define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 #define NPY_RELAXED_STRIDES_CHECKING 1 #define NPY_USE_C99_FORMATS 1 #define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) #define NPY_ABI_VERSION 0x01000009 #define NPY_API_VERSION 0x0000000C #ifndef __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS 1 #endif
982
29.71875
67
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/npy_interrupt.h
/* Signal handling: This header file defines macros that allow your code to handle interrupts received during processing. Interrupts that could reasonably be handled: SIGINT, SIGABRT, SIGALRM, SIGSEGV ****Warning*************** Do not allow code that creates temporary memory or increases reference counts of Python objects to be interrupted unless you handle it differently. ************************** The mechanism for handling interrupts is conceptually simple: - replace the signal handler with our own home-grown version and store the old one. - run the code to be interrupted -- if an interrupt occurs the handler should basically just cause a return to the calling function for finish work. - restore the old signal handler Of course, every code that allows interrupts must account for returning via the interrupt and handle clean-up correctly. But, even still, the simple paradigm is complicated by at least three factors. 1) platform portability (i.e. Microsoft says not to use longjmp to return from signal handling. They have a __try and __except extension to C instead but what about mingw?). 2) how to handle threads: apparently whether signals are delivered to every thread of the process or the "invoking" thread is platform dependent. --- we don't handle threads for now. 3) do we need to worry about re-entrance. For now, assume the code will not call-back into itself. Ideas: 1) Start by implementing an approach that works on platforms that can use setjmp and longjmp functionality and does nothing on other platforms. 2) Ignore threads --- i.e. do not mix interrupt handling and threads 3) Add a default signal_handler function to the C-API but have the rest use macros. Simple Interface: In your C-extension: around a block of code you want to be interruptable with a SIGINT NPY_SIGINT_ON [code] NPY_SIGINT_OFF In order for this to work correctly, the [code] block must not allocate any memory or alter the reference count of any Python objects. In other words [code] must be interruptible so that continuation after NPY_SIGINT_OFF will only be "missing some computations" Interrupt handling does not work well with threads. */ /* Add signal handling macros Make the global variable and signal handler part of the C-API */ #ifndef NPY_INTERRUPT_H #define NPY_INTERRUPT_H #ifndef NPY_NO_SIGNAL #include <setjmp.h> #include <signal.h> #ifndef sigsetjmp #define NPY_SIGSETJMP(arg1, arg2) setjmp(arg1) #define NPY_SIGLONGJMP(arg1, arg2) longjmp(arg1, arg2) #define NPY_SIGJMP_BUF jmp_buf #else #define NPY_SIGSETJMP(arg1, arg2) sigsetjmp(arg1, arg2) #define NPY_SIGLONGJMP(arg1, arg2) siglongjmp(arg1, arg2) #define NPY_SIGJMP_BUF sigjmp_buf #endif # define NPY_SIGINT_ON { \ PyOS_sighandler_t _npy_sig_save; \ _npy_sig_save = PyOS_setsig(SIGINT, _PyArray_SigintHandler); \ if (NPY_SIGSETJMP(*((NPY_SIGJMP_BUF *)_PyArray_GetSigintBuf()), \ 1) == 0) { \ # define NPY_SIGINT_OFF } \ PyOS_setsig(SIGINT, _npy_sig_save); \ } #else /* NPY_NO_SIGNAL */ #define NPY_SIGINT_ON #define NPY_SIGINT_OFF #endif /* HAVE_SIGSETJMP */ #endif /* NPY_INTERRUPT_H */
3,439
28.152542
84
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/npy_common.h
#ifndef _NPY_COMMON_H_ #define _NPY_COMMON_H_ /* numpconfig.h is auto-generated */ #include "numpyconfig.h" #ifdef HAVE_NPY_CONFIG_H #include <npy_config.h> #endif /* need Python.h for npy_intp, npy_uintp */ #include <Python.h> /* * using static inline modifiers when defining npy_math functions * allows the compiler to make optimizations when possible */ #if NPY_INTERNAL_BUILD #ifndef NPY_INLINE_MATH #define NPY_INLINE_MATH 1 #endif #endif /* * gcc does not unroll even with -O3 * use with care, unrolling on modern cpus rarely speeds things up */ #ifdef HAVE_ATTRIBUTE_OPTIMIZE_UNROLL_LOOPS #define NPY_GCC_UNROLL_LOOPS \ __attribute__((optimize("unroll-loops"))) #else #define NPY_GCC_UNROLL_LOOPS #endif /* highest gcc optimization level, enabled autovectorizer */ #ifdef HAVE_ATTRIBUTE_OPTIMIZE_OPT_3 #define NPY_GCC_OPT_3 __attribute__((optimize("O3"))) #else #define NPY_GCC_OPT_3 #endif /* compile target attributes */ #if defined HAVE_ATTRIBUTE_TARGET_AVX && defined HAVE_LINK_AVX #define NPY_GCC_TARGET_AVX __attribute__((target("avx"))) #else #define NPY_GCC_TARGET_AVX #endif #if defined HAVE_ATTRIBUTE_TARGET_AVX2 && defined HAVE_LINK_AVX2 #define NPY_GCC_TARGET_AVX2 __attribute__((target("avx2"))) #else #define NPY_GCC_TARGET_AVX2 #endif /* * mark an argument (starting from 1) that must not be NULL and is not checked * DO NOT USE IF FUNCTION CHECKS FOR NULL!! the compiler will remove the check */ #ifdef HAVE_ATTRIBUTE_NONNULL #define NPY_GCC_NONNULL(n) __attribute__((nonnull(n))) #else #define NPY_GCC_NONNULL(n) #endif #if defined HAVE_XMMINTRIN_H && defined HAVE__MM_LOAD_PS #define NPY_HAVE_SSE_INTRINSICS #endif #if defined HAVE_EMMINTRIN_H && defined HAVE__MM_LOAD_PD #define NPY_HAVE_SSE2_INTRINSICS #endif /* * give a hint to the compiler which branch is more likely or unlikely * to occur, e.g. rare error cases: * * if (NPY_UNLIKELY(failure == 0)) * return NULL; * * the double !! is to cast the expression (e.g. NULL) to a boolean required by * the intrinsic */ #ifdef HAVE___BUILTIN_EXPECT #define NPY_LIKELY(x) __builtin_expect(!!(x), 1) #define NPY_UNLIKELY(x) __builtin_expect(!!(x), 0) #else #define NPY_LIKELY(x) (x) #define NPY_UNLIKELY(x) (x) #endif #ifdef HAVE___BUILTIN_PREFETCH /* unlike _mm_prefetch also works on non-x86 */ #define NPY_PREFETCH(x, rw, loc) __builtin_prefetch((x), (rw), (loc)) #else #ifdef HAVE__MM_PREFETCH /* _MM_HINT_ET[01] (rw = 1) unsupported, only available in gcc >= 4.9 */ #define NPY_PREFETCH(x, rw, loc) _mm_prefetch((x), loc == 0 ? _MM_HINT_NTA : \ (loc == 1 ? _MM_HINT_T2 : \ (loc == 2 ? _MM_HINT_T1 : \ (loc == 3 ? _MM_HINT_T0 : -1)))) #else #define NPY_PREFETCH(x, rw,loc) #endif #endif #ifdef HAVE___BUILTIN_CPU_SUPPORTS #ifdef HAVE_ATTRIBUTE_TARGET_AVX2 #define NPY_CPU_SUPPORTS_AVX2 __builtin_cpu_supports("avx2") #else #define NPY_CPU_SUPPORTS_AVX2 0 #endif #ifdef HAVE_ATTRIBUTE_TARGET_AVX #define NPY_CPU_SUPPORTS_AVX __builtin_cpu_supports("avx") #else #define NPY_CPU_SUPPORTS_AVX 0 #endif #else #define NPY_CPU_SUPPORTS_AVX 0 #define NPY_CPU_SUPPORTS_AVX2 0 #endif #if defined(_MSC_VER) #define NPY_INLINE __inline #elif defined(__GNUC__) #if defined(__STRICT_ANSI__) #define NPY_INLINE __inline__ #else #define NPY_INLINE inline #endif #else #define NPY_INLINE #endif #ifdef HAVE___THREAD #define NPY_TLS __thread #else #ifdef HAVE___DECLSPEC_THREAD_ #define NPY_TLS __declspec(thread) #else #define NPY_TLS #endif #endif #ifdef WITH_CPYCHECKER_RETURNS_BORROWED_REF_ATTRIBUTE #define NPY_RETURNS_BORROWED_REF \ __attribute__((cpychecker_returns_borrowed_ref)) #else #define NPY_RETURNS_BORROWED_REF #endif #ifdef WITH_CPYCHECKER_STEALS_REFERENCE_TO_ARG_ATTRIBUTE #define NPY_STEALS_REF_TO_ARG(n) \ __attribute__((cpychecker_steals_reference_to_arg(n))) #else #define NPY_STEALS_REF_TO_ARG(n) #endif /* 64 bit file position support, also on win-amd64. Ticket #1660 */ #if defined(_MSC_VER) && defined(_WIN64) && (_MSC_VER > 1400) || \ defined(__MINGW32__) || defined(__MINGW64__) #include <io.h> /* mingw based on 3.4.5 has lseek but not ftell/fseek */ #if defined(__MINGW32__) || defined(__MINGW64__) extern int __cdecl _fseeki64(FILE *, long long, int); extern long long __cdecl _ftelli64(FILE *); #endif #define npy_fseek _fseeki64 #define npy_ftell _ftelli64 #define npy_lseek _lseeki64 #define npy_off_t npy_int64 #if NPY_SIZEOF_INT == 8 #define NPY_OFF_T_PYFMT "i" #elif NPY_SIZEOF_LONG == 8 #define NPY_OFF_T_PYFMT "l" #elif NPY_SIZEOF_LONGLONG == 8 #define NPY_OFF_T_PYFMT "L" #else #error Unsupported size for type off_t #endif #else #ifdef HAVE_FSEEKO #define npy_fseek fseeko #else #define npy_fseek fseek #endif #ifdef HAVE_FTELLO #define npy_ftell ftello #else #define npy_ftell ftell #endif #include <sys/types.h> #define npy_lseek lseek #define npy_off_t off_t #if NPY_SIZEOF_OFF_T == NPY_SIZEOF_SHORT #define NPY_OFF_T_PYFMT "h" #elif NPY_SIZEOF_OFF_T == NPY_SIZEOF_INT #define NPY_OFF_T_PYFMT "i" #elif NPY_SIZEOF_OFF_T == NPY_SIZEOF_LONG #define NPY_OFF_T_PYFMT "l" #elif NPY_SIZEOF_OFF_T == NPY_SIZEOF_LONGLONG #define NPY_OFF_T_PYFMT "L" #else #error Unsupported size for type off_t #endif #endif /* enums for detected endianness */ enum { NPY_CPU_UNKNOWN_ENDIAN, NPY_CPU_LITTLE, NPY_CPU_BIG }; /* * This is to typedef npy_intp to the appropriate pointer size for this * platform. Py_intptr_t, Py_uintptr_t are defined in pyport.h. */ typedef Py_intptr_t npy_intp; typedef Py_uintptr_t npy_uintp; /* * Define sizes that were not defined in numpyconfig.h. */ #define NPY_SIZEOF_CHAR 1 #define NPY_SIZEOF_BYTE 1 #define NPY_SIZEOF_DATETIME 8 #define NPY_SIZEOF_TIMEDELTA 8 #define NPY_SIZEOF_INTP NPY_SIZEOF_PY_INTPTR_T #define NPY_SIZEOF_UINTP NPY_SIZEOF_PY_INTPTR_T #define NPY_SIZEOF_HALF 2 #define NPY_SIZEOF_CFLOAT NPY_SIZEOF_COMPLEX_FLOAT #define NPY_SIZEOF_CDOUBLE NPY_SIZEOF_COMPLEX_DOUBLE #define NPY_SIZEOF_CLONGDOUBLE NPY_SIZEOF_COMPLEX_LONGDOUBLE #ifdef constchar #undef constchar #endif #define NPY_SSIZE_T_PYFMT "n" #define constchar char /* NPY_INTP_FMT Note: * Unlike the other NPY_*_FMT macros which are used with * PyOS_snprintf, NPY_INTP_FMT is used with PyErr_Format and * PyString_Format. These functions use different formatting * codes which are portably specified according to the Python * documentation. See ticket #1795. */ #if NPY_SIZEOF_PY_INTPTR_T == NPY_SIZEOF_INT #define NPY_INTP NPY_INT #define NPY_UINTP NPY_UINT #define PyIntpArrType_Type PyIntArrType_Type #define PyUIntpArrType_Type PyUIntArrType_Type #define NPY_MAX_INTP NPY_MAX_INT #define NPY_MIN_INTP NPY_MIN_INT #define NPY_MAX_UINTP NPY_MAX_UINT #define NPY_INTP_FMT "d" #elif NPY_SIZEOF_PY_INTPTR_T == NPY_SIZEOF_LONG #define NPY_INTP NPY_LONG #define NPY_UINTP NPY_ULONG #define PyIntpArrType_Type PyLongArrType_Type #define PyUIntpArrType_Type PyULongArrType_Type #define NPY_MAX_INTP NPY_MAX_LONG #define NPY_MIN_INTP NPY_MIN_LONG #define NPY_MAX_UINTP NPY_MAX_ULONG #define NPY_INTP_FMT "ld" #elif defined(PY_LONG_LONG) && (NPY_SIZEOF_PY_INTPTR_T == NPY_SIZEOF_LONGLONG) #define NPY_INTP NPY_LONGLONG #define NPY_UINTP NPY_ULONGLONG #define PyIntpArrType_Type PyLongLongArrType_Type #define PyUIntpArrType_Type PyULongLongArrType_Type #define NPY_MAX_INTP NPY_MAX_LONGLONG #define NPY_MIN_INTP NPY_MIN_LONGLONG #define NPY_MAX_UINTP NPY_MAX_ULONGLONG #define NPY_INTP_FMT "lld" #endif /* * We can only use C99 formats for npy_int_p if it is the same as * intp_t, hence the condition on HAVE_UNITPTR_T */ #if (NPY_USE_C99_FORMATS) == 1 \ && (defined HAVE_UINTPTR_T) \ && (defined HAVE_INTTYPES_H) #include <inttypes.h> #undef NPY_INTP_FMT #define NPY_INTP_FMT PRIdPTR #endif /* * Some platforms don't define bool, long long, or long double. * Handle that here. */ #define NPY_BYTE_FMT "hhd" #define NPY_UBYTE_FMT "hhu" #define NPY_SHORT_FMT "hd" #define NPY_USHORT_FMT "hu" #define NPY_INT_FMT "d" #define NPY_UINT_FMT "u" #define NPY_LONG_FMT "ld" #define NPY_ULONG_FMT "lu" #define NPY_HALF_FMT "g" #define NPY_FLOAT_FMT "g" #define NPY_DOUBLE_FMT "g" #ifdef PY_LONG_LONG typedef PY_LONG_LONG npy_longlong; typedef unsigned PY_LONG_LONG npy_ulonglong; # ifdef _MSC_VER # define NPY_LONGLONG_FMT "I64d" # define NPY_ULONGLONG_FMT "I64u" # else # define NPY_LONGLONG_FMT "lld" # define NPY_ULONGLONG_FMT "llu" # endif # ifdef _MSC_VER # define NPY_LONGLONG_SUFFIX(x) (x##i64) # define NPY_ULONGLONG_SUFFIX(x) (x##Ui64) # else # define NPY_LONGLONG_SUFFIX(x) (x##LL) # define NPY_ULONGLONG_SUFFIX(x) (x##ULL) # endif #else typedef long npy_longlong; typedef unsigned long npy_ulonglong; # define NPY_LONGLONG_SUFFIX(x) (x##L) # define NPY_ULONGLONG_SUFFIX(x) (x##UL) #endif typedef unsigned char npy_bool; #define NPY_FALSE 0 #define NPY_TRUE 1 #if NPY_SIZEOF_LONGDOUBLE == NPY_SIZEOF_DOUBLE typedef double npy_longdouble; #define NPY_LONGDOUBLE_FMT "g" #else typedef long double npy_longdouble; #define NPY_LONGDOUBLE_FMT "Lg" #endif #ifndef Py_USING_UNICODE #error Must use Python with unicode enabled. #endif typedef signed char npy_byte; typedef unsigned char npy_ubyte; typedef unsigned short npy_ushort; typedef unsigned int npy_uint; typedef unsigned long npy_ulong; /* These are for completeness */ typedef char npy_char; typedef short npy_short; typedef int npy_int; typedef long npy_long; typedef float npy_float; typedef double npy_double; /* * Hash value compatibility. * As of Python 3.2 hash values are of type Py_hash_t. * Previous versions use C long. */ #if PY_VERSION_HEX < 0x03020000 typedef long npy_hash_t; #define NPY_SIZEOF_HASH_T NPY_SIZEOF_LONG #else typedef Py_hash_t npy_hash_t; #define NPY_SIZEOF_HASH_T NPY_SIZEOF_INTP #endif /* * Disabling C99 complex usage: a lot of C code in numpy/scipy rely on being * able to do .real/.imag. Will have to convert code first. */ #if 0 #if defined(NPY_USE_C99_COMPLEX) && defined(NPY_HAVE_COMPLEX_DOUBLE) typedef complex npy_cdouble; #else typedef struct { double real, imag; } npy_cdouble; #endif #if defined(NPY_USE_C99_COMPLEX) && defined(NPY_HAVE_COMPLEX_FLOAT) typedef complex float npy_cfloat; #else typedef struct { float real, imag; } npy_cfloat; #endif #if defined(NPY_USE_C99_COMPLEX) && defined(NPY_HAVE_COMPLEX_LONG_DOUBLE) typedef complex long double npy_clongdouble; #else typedef struct {npy_longdouble real, imag;} npy_clongdouble; #endif #endif #if NPY_SIZEOF_COMPLEX_DOUBLE != 2 * NPY_SIZEOF_DOUBLE #error npy_cdouble definition is not compatible with C99 complex definition ! \ Please contact NumPy maintainers and give detailed information about your \ compiler and platform #endif typedef struct { double real, imag; } npy_cdouble; #if NPY_SIZEOF_COMPLEX_FLOAT != 2 * NPY_SIZEOF_FLOAT #error npy_cfloat definition is not compatible with C99 complex definition ! \ Please contact NumPy maintainers and give detailed information about your \ compiler and platform #endif typedef struct { float real, imag; } npy_cfloat; #if NPY_SIZEOF_COMPLEX_LONGDOUBLE != 2 * NPY_SIZEOF_LONGDOUBLE #error npy_clongdouble definition is not compatible with C99 complex definition ! \ Please contact NumPy maintainers and give detailed information about your \ compiler and platform #endif typedef struct { npy_longdouble real, imag; } npy_clongdouble; /* * numarray-style bit-width typedefs */ #define NPY_MAX_INT8 127 #define NPY_MIN_INT8 -128 #define NPY_MAX_UINT8 255 #define NPY_MAX_INT16 32767 #define NPY_MIN_INT16 -32768 #define NPY_MAX_UINT16 65535 #define NPY_MAX_INT32 2147483647 #define NPY_MIN_INT32 (-NPY_MAX_INT32 - 1) #define NPY_MAX_UINT32 4294967295U #define NPY_MAX_INT64 NPY_LONGLONG_SUFFIX(9223372036854775807) #define NPY_MIN_INT64 (-NPY_MAX_INT64 - NPY_LONGLONG_SUFFIX(1)) #define NPY_MAX_UINT64 NPY_ULONGLONG_SUFFIX(18446744073709551615) #define NPY_MAX_INT128 NPY_LONGLONG_SUFFIX(85070591730234615865843651857942052864) #define NPY_MIN_INT128 (-NPY_MAX_INT128 - NPY_LONGLONG_SUFFIX(1)) #define NPY_MAX_UINT128 NPY_ULONGLONG_SUFFIX(170141183460469231731687303715884105728) #define NPY_MAX_INT256 NPY_LONGLONG_SUFFIX(57896044618658097711785492504343953926634992332820282019728792003956564819967) #define NPY_MIN_INT256 (-NPY_MAX_INT256 - NPY_LONGLONG_SUFFIX(1)) #define NPY_MAX_UINT256 NPY_ULONGLONG_SUFFIX(115792089237316195423570985008687907853269984665640564039457584007913129639935) #define NPY_MIN_DATETIME NPY_MIN_INT64 #define NPY_MAX_DATETIME NPY_MAX_INT64 #define NPY_MIN_TIMEDELTA NPY_MIN_INT64 #define NPY_MAX_TIMEDELTA NPY_MAX_INT64 /* Need to find the number of bits for each type and make definitions accordingly. C states that sizeof(char) == 1 by definition So, just using the sizeof keyword won't help. It also looks like Python itself uses sizeof(char) quite a bit, which by definition should be 1 all the time. Idea: Make Use of CHAR_BIT which should tell us how many BITS per CHARACTER */ /* Include platform definitions -- These are in the C89/90 standard */ #include <limits.h> #define NPY_MAX_BYTE SCHAR_MAX #define NPY_MIN_BYTE SCHAR_MIN #define NPY_MAX_UBYTE UCHAR_MAX #define NPY_MAX_SHORT SHRT_MAX #define NPY_MIN_SHORT SHRT_MIN #define NPY_MAX_USHORT USHRT_MAX #define NPY_MAX_INT INT_MAX #ifndef INT_MIN #define INT_MIN (-INT_MAX - 1) #endif #define NPY_MIN_INT INT_MIN #define NPY_MAX_UINT UINT_MAX #define NPY_MAX_LONG LONG_MAX #define NPY_MIN_LONG LONG_MIN #define NPY_MAX_ULONG ULONG_MAX #define NPY_BITSOF_BOOL (sizeof(npy_bool) * CHAR_BIT) #define NPY_BITSOF_CHAR CHAR_BIT #define NPY_BITSOF_BYTE (NPY_SIZEOF_BYTE * CHAR_BIT) #define NPY_BITSOF_SHORT (NPY_SIZEOF_SHORT * CHAR_BIT) #define NPY_BITSOF_INT (NPY_SIZEOF_INT * CHAR_BIT) #define NPY_BITSOF_LONG (NPY_SIZEOF_LONG * CHAR_BIT) #define NPY_BITSOF_LONGLONG (NPY_SIZEOF_LONGLONG * CHAR_BIT) #define NPY_BITSOF_INTP (NPY_SIZEOF_INTP * CHAR_BIT) #define NPY_BITSOF_HALF (NPY_SIZEOF_HALF * CHAR_BIT) #define NPY_BITSOF_FLOAT (NPY_SIZEOF_FLOAT * CHAR_BIT) #define NPY_BITSOF_DOUBLE (NPY_SIZEOF_DOUBLE * CHAR_BIT) #define NPY_BITSOF_LONGDOUBLE (NPY_SIZEOF_LONGDOUBLE * CHAR_BIT) #define NPY_BITSOF_CFLOAT (NPY_SIZEOF_CFLOAT * CHAR_BIT) #define NPY_BITSOF_CDOUBLE (NPY_SIZEOF_CDOUBLE * CHAR_BIT) #define NPY_BITSOF_CLONGDOUBLE (NPY_SIZEOF_CLONGDOUBLE * CHAR_BIT) #define NPY_BITSOF_DATETIME (NPY_SIZEOF_DATETIME * CHAR_BIT) #define NPY_BITSOF_TIMEDELTA (NPY_SIZEOF_TIMEDELTA * CHAR_BIT) #if NPY_BITSOF_LONG == 8 #define NPY_INT8 NPY_LONG #define NPY_UINT8 NPY_ULONG typedef long npy_int8; typedef unsigned long npy_uint8; #define PyInt8ScalarObject PyLongScalarObject #define PyInt8ArrType_Type PyLongArrType_Type #define PyUInt8ScalarObject PyULongScalarObject #define PyUInt8ArrType_Type PyULongArrType_Type #define NPY_INT8_FMT NPY_LONG_FMT #define NPY_UINT8_FMT NPY_ULONG_FMT #elif NPY_BITSOF_LONG == 16 #define NPY_INT16 NPY_LONG #define NPY_UINT16 NPY_ULONG typedef long npy_int16; typedef unsigned long npy_uint16; #define PyInt16ScalarObject PyLongScalarObject #define PyInt16ArrType_Type PyLongArrType_Type #define PyUInt16ScalarObject PyULongScalarObject #define PyUInt16ArrType_Type PyULongArrType_Type #define NPY_INT16_FMT NPY_LONG_FMT #define NPY_UINT16_FMT NPY_ULONG_FMT #elif NPY_BITSOF_LONG == 32 #define NPY_INT32 NPY_LONG #define NPY_UINT32 NPY_ULONG typedef long npy_int32; typedef unsigned long npy_uint32; typedef unsigned long npy_ucs4; #define PyInt32ScalarObject PyLongScalarObject #define PyInt32ArrType_Type PyLongArrType_Type #define PyUInt32ScalarObject PyULongScalarObject #define PyUInt32ArrType_Type PyULongArrType_Type #define NPY_INT32_FMT NPY_LONG_FMT #define NPY_UINT32_FMT NPY_ULONG_FMT #elif NPY_BITSOF_LONG == 64 #define NPY_INT64 NPY_LONG #define NPY_UINT64 NPY_ULONG typedef long npy_int64; typedef unsigned long npy_uint64; #define PyInt64ScalarObject PyLongScalarObject #define PyInt64ArrType_Type PyLongArrType_Type #define PyUInt64ScalarObject PyULongScalarObject #define PyUInt64ArrType_Type PyULongArrType_Type #define NPY_INT64_FMT NPY_LONG_FMT #define NPY_UINT64_FMT NPY_ULONG_FMT #define MyPyLong_FromInt64 PyLong_FromLong #define MyPyLong_AsInt64 PyLong_AsLong #elif NPY_BITSOF_LONG == 128 #define NPY_INT128 NPY_LONG #define NPY_UINT128 NPY_ULONG typedef long npy_int128; typedef unsigned long npy_uint128; #define PyInt128ScalarObject PyLongScalarObject #define PyInt128ArrType_Type PyLongArrType_Type #define PyUInt128ScalarObject PyULongScalarObject #define PyUInt128ArrType_Type PyULongArrType_Type #define NPY_INT128_FMT NPY_LONG_FMT #define NPY_UINT128_FMT NPY_ULONG_FMT #endif #if NPY_BITSOF_LONGLONG == 8 # ifndef NPY_INT8 # define NPY_INT8 NPY_LONGLONG # define NPY_UINT8 NPY_ULONGLONG typedef npy_longlong npy_int8; typedef npy_ulonglong npy_uint8; # define PyInt8ScalarObject PyLongLongScalarObject # define PyInt8ArrType_Type PyLongLongArrType_Type # define PyUInt8ScalarObject PyULongLongScalarObject # define PyUInt8ArrType_Type PyULongLongArrType_Type #define NPY_INT8_FMT NPY_LONGLONG_FMT #define NPY_UINT8_FMT NPY_ULONGLONG_FMT # endif # define NPY_MAX_LONGLONG NPY_MAX_INT8 # define NPY_MIN_LONGLONG NPY_MIN_INT8 # define NPY_MAX_ULONGLONG NPY_MAX_UINT8 #elif NPY_BITSOF_LONGLONG == 16 # ifndef NPY_INT16 # define NPY_INT16 NPY_LONGLONG # define NPY_UINT16 NPY_ULONGLONG typedef npy_longlong npy_int16; typedef npy_ulonglong npy_uint16; # define PyInt16ScalarObject PyLongLongScalarObject # define PyInt16ArrType_Type PyLongLongArrType_Type # define PyUInt16ScalarObject PyULongLongScalarObject # define PyUInt16ArrType_Type PyULongLongArrType_Type #define NPY_INT16_FMT NPY_LONGLONG_FMT #define NPY_UINT16_FMT NPY_ULONGLONG_FMT # endif # define NPY_MAX_LONGLONG NPY_MAX_INT16 # define NPY_MIN_LONGLONG NPY_MIN_INT16 # define NPY_MAX_ULONGLONG NPY_MAX_UINT16 #elif NPY_BITSOF_LONGLONG == 32 # ifndef NPY_INT32 # define NPY_INT32 NPY_LONGLONG # define NPY_UINT32 NPY_ULONGLONG typedef npy_longlong npy_int32; typedef npy_ulonglong npy_uint32; typedef npy_ulonglong npy_ucs4; # define PyInt32ScalarObject PyLongLongScalarObject # define PyInt32ArrType_Type PyLongLongArrType_Type # define PyUInt32ScalarObject PyULongLongScalarObject # define PyUInt32ArrType_Type PyULongLongArrType_Type #define NPY_INT32_FMT NPY_LONGLONG_FMT #define NPY_UINT32_FMT NPY_ULONGLONG_FMT # endif # define NPY_MAX_LONGLONG NPY_MAX_INT32 # define NPY_MIN_LONGLONG NPY_MIN_INT32 # define NPY_MAX_ULONGLONG NPY_MAX_UINT32 #elif NPY_BITSOF_LONGLONG == 64 # ifndef NPY_INT64 # define NPY_INT64 NPY_LONGLONG # define NPY_UINT64 NPY_ULONGLONG typedef npy_longlong npy_int64; typedef npy_ulonglong npy_uint64; # define PyInt64ScalarObject PyLongLongScalarObject # define PyInt64ArrType_Type PyLongLongArrType_Type # define PyUInt64ScalarObject PyULongLongScalarObject # define PyUInt64ArrType_Type PyULongLongArrType_Type #define NPY_INT64_FMT NPY_LONGLONG_FMT #define NPY_UINT64_FMT NPY_ULONGLONG_FMT # define MyPyLong_FromInt64 PyLong_FromLongLong # define MyPyLong_AsInt64 PyLong_AsLongLong # endif # define NPY_MAX_LONGLONG NPY_MAX_INT64 # define NPY_MIN_LONGLONG NPY_MIN_INT64 # define NPY_MAX_ULONGLONG NPY_MAX_UINT64 #elif NPY_BITSOF_LONGLONG == 128 # ifndef NPY_INT128 # define NPY_INT128 NPY_LONGLONG # define NPY_UINT128 NPY_ULONGLONG typedef npy_longlong npy_int128; typedef npy_ulonglong npy_uint128; # define PyInt128ScalarObject PyLongLongScalarObject # define PyInt128ArrType_Type PyLongLongArrType_Type # define PyUInt128ScalarObject PyULongLongScalarObject # define PyUInt128ArrType_Type PyULongLongArrType_Type #define NPY_INT128_FMT NPY_LONGLONG_FMT #define NPY_UINT128_FMT NPY_ULONGLONG_FMT # endif # define NPY_MAX_LONGLONG NPY_MAX_INT128 # define NPY_MIN_LONGLONG NPY_MIN_INT128 # define NPY_MAX_ULONGLONG NPY_MAX_UINT128 #elif NPY_BITSOF_LONGLONG == 256 # define NPY_INT256 NPY_LONGLONG # define NPY_UINT256 NPY_ULONGLONG typedef npy_longlong npy_int256; typedef npy_ulonglong npy_uint256; # define PyInt256ScalarObject PyLongLongScalarObject # define PyInt256ArrType_Type PyLongLongArrType_Type # define PyUInt256ScalarObject PyULongLongScalarObject # define PyUInt256ArrType_Type PyULongLongArrType_Type #define NPY_INT256_FMT NPY_LONGLONG_FMT #define NPY_UINT256_FMT NPY_ULONGLONG_FMT # define NPY_MAX_LONGLONG NPY_MAX_INT256 # define NPY_MIN_LONGLONG NPY_MIN_INT256 # define NPY_MAX_ULONGLONG NPY_MAX_UINT256 #endif #if NPY_BITSOF_INT == 8 #ifndef NPY_INT8 #define NPY_INT8 NPY_INT #define NPY_UINT8 NPY_UINT typedef int npy_int8; typedef unsigned int npy_uint8; # define PyInt8ScalarObject PyIntScalarObject # define PyInt8ArrType_Type PyIntArrType_Type # define PyUInt8ScalarObject PyUIntScalarObject # define PyUInt8ArrType_Type PyUIntArrType_Type #define NPY_INT8_FMT NPY_INT_FMT #define NPY_UINT8_FMT NPY_UINT_FMT #endif #elif NPY_BITSOF_INT == 16 #ifndef NPY_INT16 #define NPY_INT16 NPY_INT #define NPY_UINT16 NPY_UINT typedef int npy_int16; typedef unsigned int npy_uint16; # define PyInt16ScalarObject PyIntScalarObject # define PyInt16ArrType_Type PyIntArrType_Type # define PyUInt16ScalarObject PyIntUScalarObject # define PyUInt16ArrType_Type PyIntUArrType_Type #define NPY_INT16_FMT NPY_INT_FMT #define NPY_UINT16_FMT NPY_UINT_FMT #endif #elif NPY_BITSOF_INT == 32 #ifndef NPY_INT32 #define NPY_INT32 NPY_INT #define NPY_UINT32 NPY_UINT typedef int npy_int32; typedef unsigned int npy_uint32; typedef unsigned int npy_ucs4; # define PyInt32ScalarObject PyIntScalarObject # define PyInt32ArrType_Type PyIntArrType_Type # define PyUInt32ScalarObject PyUIntScalarObject # define PyUInt32ArrType_Type PyUIntArrType_Type #define NPY_INT32_FMT NPY_INT_FMT #define NPY_UINT32_FMT NPY_UINT_FMT #endif #elif NPY_BITSOF_INT == 64 #ifndef NPY_INT64 #define NPY_INT64 NPY_INT #define NPY_UINT64 NPY_UINT typedef int npy_int64; typedef unsigned int npy_uint64; # define PyInt64ScalarObject PyIntScalarObject # define PyInt64ArrType_Type PyIntArrType_Type # define PyUInt64ScalarObject PyUIntScalarObject # define PyUInt64ArrType_Type PyUIntArrType_Type #define NPY_INT64_FMT NPY_INT_FMT #define NPY_UINT64_FMT NPY_UINT_FMT # define MyPyLong_FromInt64 PyLong_FromLong # define MyPyLong_AsInt64 PyLong_AsLong #endif #elif NPY_BITSOF_INT == 128 #ifndef NPY_INT128 #define NPY_INT128 NPY_INT #define NPY_UINT128 NPY_UINT typedef int npy_int128; typedef unsigned int npy_uint128; # define PyInt128ScalarObject PyIntScalarObject # define PyInt128ArrType_Type PyIntArrType_Type # define PyUInt128ScalarObject PyUIntScalarObject # define PyUInt128ArrType_Type PyUIntArrType_Type #define NPY_INT128_FMT NPY_INT_FMT #define NPY_UINT128_FMT NPY_UINT_FMT #endif #endif #if NPY_BITSOF_SHORT == 8 #ifndef NPY_INT8 #define NPY_INT8 NPY_SHORT #define NPY_UINT8 NPY_USHORT typedef short npy_int8; typedef unsigned short npy_uint8; # define PyInt8ScalarObject PyShortScalarObject # define PyInt8ArrType_Type PyShortArrType_Type # define PyUInt8ScalarObject PyUShortScalarObject # define PyUInt8ArrType_Type PyUShortArrType_Type #define NPY_INT8_FMT NPY_SHORT_FMT #define NPY_UINT8_FMT NPY_USHORT_FMT #endif #elif NPY_BITSOF_SHORT == 16 #ifndef NPY_INT16 #define NPY_INT16 NPY_SHORT #define NPY_UINT16 NPY_USHORT typedef short npy_int16; typedef unsigned short npy_uint16; # define PyInt16ScalarObject PyShortScalarObject # define PyInt16ArrType_Type PyShortArrType_Type # define PyUInt16ScalarObject PyUShortScalarObject # define PyUInt16ArrType_Type PyUShortArrType_Type #define NPY_INT16_FMT NPY_SHORT_FMT #define NPY_UINT16_FMT NPY_USHORT_FMT #endif #elif NPY_BITSOF_SHORT == 32 #ifndef NPY_INT32 #define NPY_INT32 NPY_SHORT #define NPY_UINT32 NPY_USHORT typedef short npy_int32; typedef unsigned short npy_uint32; typedef unsigned short npy_ucs4; # define PyInt32ScalarObject PyShortScalarObject # define PyInt32ArrType_Type PyShortArrType_Type # define PyUInt32ScalarObject PyUShortScalarObject # define PyUInt32ArrType_Type PyUShortArrType_Type #define NPY_INT32_FMT NPY_SHORT_FMT #define NPY_UINT32_FMT NPY_USHORT_FMT #endif #elif NPY_BITSOF_SHORT == 64 #ifndef NPY_INT64 #define NPY_INT64 NPY_SHORT #define NPY_UINT64 NPY_USHORT typedef short npy_int64; typedef unsigned short npy_uint64; # define PyInt64ScalarObject PyShortScalarObject # define PyInt64ArrType_Type PyShortArrType_Type # define PyUInt64ScalarObject PyUShortScalarObject # define PyUInt64ArrType_Type PyUShortArrType_Type #define NPY_INT64_FMT NPY_SHORT_FMT #define NPY_UINT64_FMT NPY_USHORT_FMT # define MyPyLong_FromInt64 PyLong_FromLong # define MyPyLong_AsInt64 PyLong_AsLong #endif #elif NPY_BITSOF_SHORT == 128 #ifndef NPY_INT128 #define NPY_INT128 NPY_SHORT #define NPY_UINT128 NPY_USHORT typedef short npy_int128; typedef unsigned short npy_uint128; # define PyInt128ScalarObject PyShortScalarObject # define PyInt128ArrType_Type PyShortArrType_Type # define PyUInt128ScalarObject PyUShortScalarObject # define PyUInt128ArrType_Type PyUShortArrType_Type #define NPY_INT128_FMT NPY_SHORT_FMT #define NPY_UINT128_FMT NPY_USHORT_FMT #endif #endif #if NPY_BITSOF_CHAR == 8 #ifndef NPY_INT8 #define NPY_INT8 NPY_BYTE #define NPY_UINT8 NPY_UBYTE typedef signed char npy_int8; typedef unsigned char npy_uint8; # define PyInt8ScalarObject PyByteScalarObject # define PyInt8ArrType_Type PyByteArrType_Type # define PyUInt8ScalarObject PyUByteScalarObject # define PyUInt8ArrType_Type PyUByteArrType_Type #define NPY_INT8_FMT NPY_BYTE_FMT #define NPY_UINT8_FMT NPY_UBYTE_FMT #endif #elif NPY_BITSOF_CHAR == 16 #ifndef NPY_INT16 #define NPY_INT16 NPY_BYTE #define NPY_UINT16 NPY_UBYTE typedef signed char npy_int16; typedef unsigned char npy_uint16; # define PyInt16ScalarObject PyByteScalarObject # define PyInt16ArrType_Type PyByteArrType_Type # define PyUInt16ScalarObject PyUByteScalarObject # define PyUInt16ArrType_Type PyUByteArrType_Type #define NPY_INT16_FMT NPY_BYTE_FMT #define NPY_UINT16_FMT NPY_UBYTE_FMT #endif #elif NPY_BITSOF_CHAR == 32 #ifndef NPY_INT32 #define NPY_INT32 NPY_BYTE #define NPY_UINT32 NPY_UBYTE typedef signed char npy_int32; typedef unsigned char npy_uint32; typedef unsigned char npy_ucs4; # define PyInt32ScalarObject PyByteScalarObject # define PyInt32ArrType_Type PyByteArrType_Type # define PyUInt32ScalarObject PyUByteScalarObject # define PyUInt32ArrType_Type PyUByteArrType_Type #define NPY_INT32_FMT NPY_BYTE_FMT #define NPY_UINT32_FMT NPY_UBYTE_FMT #endif #elif NPY_BITSOF_CHAR == 64 #ifndef NPY_INT64 #define NPY_INT64 NPY_BYTE #define NPY_UINT64 NPY_UBYTE typedef signed char npy_int64; typedef unsigned char npy_uint64; # define PyInt64ScalarObject PyByteScalarObject # define PyInt64ArrType_Type PyByteArrType_Type # define PyUInt64ScalarObject PyUByteScalarObject # define PyUInt64ArrType_Type PyUByteArrType_Type #define NPY_INT64_FMT NPY_BYTE_FMT #define NPY_UINT64_FMT NPY_UBYTE_FMT # define MyPyLong_FromInt64 PyLong_FromLong # define MyPyLong_AsInt64 PyLong_AsLong #endif #elif NPY_BITSOF_CHAR == 128 #ifndef NPY_INT128 #define NPY_INT128 NPY_BYTE #define NPY_UINT128 NPY_UBYTE typedef signed char npy_int128; typedef unsigned char npy_uint128; # define PyInt128ScalarObject PyByteScalarObject # define PyInt128ArrType_Type PyByteArrType_Type # define PyUInt128ScalarObject PyUByteScalarObject # define PyUInt128ArrType_Type PyUByteArrType_Type #define NPY_INT128_FMT NPY_BYTE_FMT #define NPY_UINT128_FMT NPY_UBYTE_FMT #endif #endif #if NPY_BITSOF_DOUBLE == 32 #ifndef NPY_FLOAT32 #define NPY_FLOAT32 NPY_DOUBLE #define NPY_COMPLEX64 NPY_CDOUBLE typedef double npy_float32; typedef npy_cdouble npy_complex64; # define PyFloat32ScalarObject PyDoubleScalarObject # define PyComplex64ScalarObject PyCDoubleScalarObject # define PyFloat32ArrType_Type PyDoubleArrType_Type # define PyComplex64ArrType_Type PyCDoubleArrType_Type #define NPY_FLOAT32_FMT NPY_DOUBLE_FMT #define NPY_COMPLEX64_FMT NPY_CDOUBLE_FMT #endif #elif NPY_BITSOF_DOUBLE == 64 #ifndef NPY_FLOAT64 #define NPY_FLOAT64 NPY_DOUBLE #define NPY_COMPLEX128 NPY_CDOUBLE typedef double npy_float64; typedef npy_cdouble npy_complex128; # define PyFloat64ScalarObject PyDoubleScalarObject # define PyComplex128ScalarObject PyCDoubleScalarObject # define PyFloat64ArrType_Type PyDoubleArrType_Type # define PyComplex128ArrType_Type PyCDoubleArrType_Type #define NPY_FLOAT64_FMT NPY_DOUBLE_FMT #define NPY_COMPLEX128_FMT NPY_CDOUBLE_FMT #endif #elif NPY_BITSOF_DOUBLE == 80 #ifndef NPY_FLOAT80 #define NPY_FLOAT80 NPY_DOUBLE #define NPY_COMPLEX160 NPY_CDOUBLE typedef double npy_float80; typedef npy_cdouble npy_complex160; # define PyFloat80ScalarObject PyDoubleScalarObject # define PyComplex160ScalarObject PyCDoubleScalarObject # define PyFloat80ArrType_Type PyDoubleArrType_Type # define PyComplex160ArrType_Type PyCDoubleArrType_Type #define NPY_FLOAT80_FMT NPY_DOUBLE_FMT #define NPY_COMPLEX160_FMT NPY_CDOUBLE_FMT #endif #elif NPY_BITSOF_DOUBLE == 96 #ifndef NPY_FLOAT96 #define NPY_FLOAT96 NPY_DOUBLE #define NPY_COMPLEX192 NPY_CDOUBLE typedef double npy_float96; typedef npy_cdouble npy_complex192; # define PyFloat96ScalarObject PyDoubleScalarObject # define PyComplex192ScalarObject PyCDoubleScalarObject # define PyFloat96ArrType_Type PyDoubleArrType_Type # define PyComplex192ArrType_Type PyCDoubleArrType_Type #define NPY_FLOAT96_FMT NPY_DOUBLE_FMT #define NPY_COMPLEX192_FMT NPY_CDOUBLE_FMT #endif #elif NPY_BITSOF_DOUBLE == 128 #ifndef NPY_FLOAT128 #define NPY_FLOAT128 NPY_DOUBLE #define NPY_COMPLEX256 NPY_CDOUBLE typedef double npy_float128; typedef npy_cdouble npy_complex256; # define PyFloat128ScalarObject PyDoubleScalarObject # define PyComplex256ScalarObject PyCDoubleScalarObject # define PyFloat128ArrType_Type PyDoubleArrType_Type # define PyComplex256ArrType_Type PyCDoubleArrType_Type #define NPY_FLOAT128_FMT NPY_DOUBLE_FMT #define NPY_COMPLEX256_FMT NPY_CDOUBLE_FMT #endif #endif #if NPY_BITSOF_FLOAT == 32 #ifndef NPY_FLOAT32 #define NPY_FLOAT32 NPY_FLOAT #define NPY_COMPLEX64 NPY_CFLOAT typedef float npy_float32; typedef npy_cfloat npy_complex64; # define PyFloat32ScalarObject PyFloatScalarObject # define PyComplex64ScalarObject PyCFloatScalarObject # define PyFloat32ArrType_Type PyFloatArrType_Type # define PyComplex64ArrType_Type PyCFloatArrType_Type #define NPY_FLOAT32_FMT NPY_FLOAT_FMT #define NPY_COMPLEX64_FMT NPY_CFLOAT_FMT #endif #elif NPY_BITSOF_FLOAT == 64 #ifndef NPY_FLOAT64 #define NPY_FLOAT64 NPY_FLOAT #define NPY_COMPLEX128 NPY_CFLOAT typedef float npy_float64; typedef npy_cfloat npy_complex128; # define PyFloat64ScalarObject PyFloatScalarObject # define PyComplex128ScalarObject PyCFloatScalarObject # define PyFloat64ArrType_Type PyFloatArrType_Type # define PyComplex128ArrType_Type PyCFloatArrType_Type #define NPY_FLOAT64_FMT NPY_FLOAT_FMT #define NPY_COMPLEX128_FMT NPY_CFLOAT_FMT #endif #elif NPY_BITSOF_FLOAT == 80 #ifndef NPY_FLOAT80 #define NPY_FLOAT80 NPY_FLOAT #define NPY_COMPLEX160 NPY_CFLOAT typedef float npy_float80; typedef npy_cfloat npy_complex160; # define PyFloat80ScalarObject PyFloatScalarObject # define PyComplex160ScalarObject PyCFloatScalarObject # define PyFloat80ArrType_Type PyFloatArrType_Type # define PyComplex160ArrType_Type PyCFloatArrType_Type #define NPY_FLOAT80_FMT NPY_FLOAT_FMT #define NPY_COMPLEX160_FMT NPY_CFLOAT_FMT #endif #elif NPY_BITSOF_FLOAT == 96 #ifndef NPY_FLOAT96 #define NPY_FLOAT96 NPY_FLOAT #define NPY_COMPLEX192 NPY_CFLOAT typedef float npy_float96; typedef npy_cfloat npy_complex192; # define PyFloat96ScalarObject PyFloatScalarObject # define PyComplex192ScalarObject PyCFloatScalarObject # define PyFloat96ArrType_Type PyFloatArrType_Type # define PyComplex192ArrType_Type PyCFloatArrType_Type #define NPY_FLOAT96_FMT NPY_FLOAT_FMT #define NPY_COMPLEX192_FMT NPY_CFLOAT_FMT #endif #elif NPY_BITSOF_FLOAT == 128 #ifndef NPY_FLOAT128 #define NPY_FLOAT128 NPY_FLOAT #define NPY_COMPLEX256 NPY_CFLOAT typedef float npy_float128; typedef npy_cfloat npy_complex256; # define PyFloat128ScalarObject PyFloatScalarObject # define PyComplex256ScalarObject PyCFloatScalarObject # define PyFloat128ArrType_Type PyFloatArrType_Type # define PyComplex256ArrType_Type PyCFloatArrType_Type #define NPY_FLOAT128_FMT NPY_FLOAT_FMT #define NPY_COMPLEX256_FMT NPY_CFLOAT_FMT #endif #endif /* half/float16 isn't a floating-point type in C */ #define NPY_FLOAT16 NPY_HALF typedef npy_uint16 npy_half; typedef npy_half npy_float16; #if NPY_BITSOF_LONGDOUBLE == 32 #ifndef NPY_FLOAT32 #define NPY_FLOAT32 NPY_LONGDOUBLE #define NPY_COMPLEX64 NPY_CLONGDOUBLE typedef npy_longdouble npy_float32; typedef npy_clongdouble npy_complex64; # define PyFloat32ScalarObject PyLongDoubleScalarObject # define PyComplex64ScalarObject PyCLongDoubleScalarObject # define PyFloat32ArrType_Type PyLongDoubleArrType_Type # define PyComplex64ArrType_Type PyCLongDoubleArrType_Type #define NPY_FLOAT32_FMT NPY_LONGDOUBLE_FMT #define NPY_COMPLEX64_FMT NPY_CLONGDOUBLE_FMT #endif #elif NPY_BITSOF_LONGDOUBLE == 64 #ifndef NPY_FLOAT64 #define NPY_FLOAT64 NPY_LONGDOUBLE #define NPY_COMPLEX128 NPY_CLONGDOUBLE typedef npy_longdouble npy_float64; typedef npy_clongdouble npy_complex128; # define PyFloat64ScalarObject PyLongDoubleScalarObject # define PyComplex128ScalarObject PyCLongDoubleScalarObject # define PyFloat64ArrType_Type PyLongDoubleArrType_Type # define PyComplex128ArrType_Type PyCLongDoubleArrType_Type #define NPY_FLOAT64_FMT NPY_LONGDOUBLE_FMT #define NPY_COMPLEX128_FMT NPY_CLONGDOUBLE_FMT #endif #elif NPY_BITSOF_LONGDOUBLE == 80 #ifndef NPY_FLOAT80 #define NPY_FLOAT80 NPY_LONGDOUBLE #define NPY_COMPLEX160 NPY_CLONGDOUBLE typedef npy_longdouble npy_float80; typedef npy_clongdouble npy_complex160; # define PyFloat80ScalarObject PyLongDoubleScalarObject # define PyComplex160ScalarObject PyCLongDoubleScalarObject # define PyFloat80ArrType_Type PyLongDoubleArrType_Type # define PyComplex160ArrType_Type PyCLongDoubleArrType_Type #define NPY_FLOAT80_FMT NPY_LONGDOUBLE_FMT #define NPY_COMPLEX160_FMT NPY_CLONGDOUBLE_FMT #endif #elif NPY_BITSOF_LONGDOUBLE == 96 #ifndef NPY_FLOAT96 #define NPY_FLOAT96 NPY_LONGDOUBLE #define NPY_COMPLEX192 NPY_CLONGDOUBLE typedef npy_longdouble npy_float96; typedef npy_clongdouble npy_complex192; # define PyFloat96ScalarObject PyLongDoubleScalarObject # define PyComplex192ScalarObject PyCLongDoubleScalarObject # define PyFloat96ArrType_Type PyLongDoubleArrType_Type # define PyComplex192ArrType_Type PyCLongDoubleArrType_Type #define NPY_FLOAT96_FMT NPY_LONGDOUBLE_FMT #define NPY_COMPLEX192_FMT NPY_CLONGDOUBLE_FMT #endif #elif NPY_BITSOF_LONGDOUBLE == 128 #ifndef NPY_FLOAT128 #define NPY_FLOAT128 NPY_LONGDOUBLE #define NPY_COMPLEX256 NPY_CLONGDOUBLE typedef npy_longdouble npy_float128; typedef npy_clongdouble npy_complex256; # define PyFloat128ScalarObject PyLongDoubleScalarObject # define PyComplex256ScalarObject PyCLongDoubleScalarObject # define PyFloat128ArrType_Type PyLongDoubleArrType_Type # define PyComplex256ArrType_Type PyCLongDoubleArrType_Type #define NPY_FLOAT128_FMT NPY_LONGDOUBLE_FMT #define NPY_COMPLEX256_FMT NPY_CLONGDOUBLE_FMT #endif #elif NPY_BITSOF_LONGDOUBLE == 256 #define NPY_FLOAT256 NPY_LONGDOUBLE #define NPY_COMPLEX512 NPY_CLONGDOUBLE typedef npy_longdouble npy_float256; typedef npy_clongdouble npy_complex512; # define PyFloat256ScalarObject PyLongDoubleScalarObject # define PyComplex512ScalarObject PyCLongDoubleScalarObject # define PyFloat256ArrType_Type PyLongDoubleArrType_Type # define PyComplex512ArrType_Type PyCLongDoubleArrType_Type #define NPY_FLOAT256_FMT NPY_LONGDOUBLE_FMT #define NPY_COMPLEX512_FMT NPY_CLONGDOUBLE_FMT #endif /* datetime typedefs */ typedef npy_int64 npy_timedelta; typedef npy_int64 npy_datetime; #define NPY_DATETIME_FMT NPY_INT64_FMT #define NPY_TIMEDELTA_FMT NPY_INT64_FMT /* End of typedefs for numarray style bit-width names */ #endif
37,647
33.225455
124
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/halffloat.h
#ifndef __NPY_HALFFLOAT_H__ #define __NPY_HALFFLOAT_H__ #include <Python.h> #include <numpy/npy_math.h> #ifdef __cplusplus extern "C" { #endif /* * Half-precision routines */ /* Conversions */ float npy_half_to_float(npy_half h); double npy_half_to_double(npy_half h); npy_half npy_float_to_half(float f); npy_half npy_double_to_half(double d); /* Comparisons */ int npy_half_eq(npy_half h1, npy_half h2); int npy_half_ne(npy_half h1, npy_half h2); int npy_half_le(npy_half h1, npy_half h2); int npy_half_lt(npy_half h1, npy_half h2); int npy_half_ge(npy_half h1, npy_half h2); int npy_half_gt(npy_half h1, npy_half h2); /* faster *_nonan variants for when you know h1 and h2 are not NaN */ int npy_half_eq_nonan(npy_half h1, npy_half h2); int npy_half_lt_nonan(npy_half h1, npy_half h2); int npy_half_le_nonan(npy_half h1, npy_half h2); /* Miscellaneous functions */ int npy_half_iszero(npy_half h); int npy_half_isnan(npy_half h); int npy_half_isinf(npy_half h); int npy_half_isfinite(npy_half h); int npy_half_signbit(npy_half h); npy_half npy_half_copysign(npy_half x, npy_half y); npy_half npy_half_spacing(npy_half h); npy_half npy_half_nextafter(npy_half x, npy_half y); npy_half npy_half_divmod(npy_half x, npy_half y, npy_half *modulus); /* * Half-precision constants */ #define NPY_HALF_ZERO (0x0000u) #define NPY_HALF_PZERO (0x0000u) #define NPY_HALF_NZERO (0x8000u) #define NPY_HALF_ONE (0x3c00u) #define NPY_HALF_NEGONE (0xbc00u) #define NPY_HALF_PINF (0x7c00u) #define NPY_HALF_NINF (0xfc00u) #define NPY_HALF_NAN (0x7e00u) #define NPY_MAX_HALF (0x7bffu) /* * Bit-level conversions */ npy_uint16 npy_floatbits_to_halfbits(npy_uint32 f); npy_uint16 npy_doublebits_to_halfbits(npy_uint64 d); npy_uint32 npy_halfbits_to_floatbits(npy_uint16 h); npy_uint64 npy_halfbits_to_doublebits(npy_uint16 h); #ifdef __cplusplus } #endif #endif
1,878
25.464789
69
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/oldnumeric.h
#include "arrayobject.h" #ifndef PYPY_VERSION #ifndef REFCOUNT # define REFCOUNT NPY_REFCOUNT # define MAX_ELSIZE 16 #endif #endif #define PyArray_UNSIGNED_TYPES #define PyArray_SBYTE NPY_BYTE #define PyArray_CopyArray PyArray_CopyInto #define _PyArray_multiply_list PyArray_MultiplyIntList #define PyArray_ISSPACESAVER(m) NPY_FALSE #define PyScalarArray_Check PyArray_CheckScalar #define CONTIGUOUS NPY_CONTIGUOUS #define OWN_DIMENSIONS 0 #define OWN_STRIDES 0 #define OWN_DATA NPY_OWNDATA #define SAVESPACE 0 #define SAVESPACEBIT 0 #undef import_array #define import_array() { if (_import_array() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); } }
708
26.269231
147
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/_neighborhood_iterator_imp.h
#ifndef _NPY_INCLUDE_NEIGHBORHOOD_IMP #error You should not include this header directly #endif /* * Private API (here for inline) */ static NPY_INLINE int _PyArrayNeighborhoodIter_IncrCoord(PyArrayNeighborhoodIterObject* iter); /* * Update to next item of the iterator * * Note: this simply increment the coordinates vector, last dimension * incremented first , i.e, for dimension 3 * ... * -1, -1, -1 * -1, -1, 0 * -1, -1, 1 * .... * -1, 0, -1 * -1, 0, 0 * .... * 0, -1, -1 * 0, -1, 0 * .... */ #define _UPDATE_COORD_ITER(c) \ wb = iter->coordinates[c] < iter->bounds[c][1]; \ if (wb) { \ iter->coordinates[c] += 1; \ return 0; \ } \ else { \ iter->coordinates[c] = iter->bounds[c][0]; \ } static NPY_INLINE int _PyArrayNeighborhoodIter_IncrCoord(PyArrayNeighborhoodIterObject* iter) { npy_intp i, wb; for (i = iter->nd - 1; i >= 0; --i) { _UPDATE_COORD_ITER(i) } return 0; } /* * Version optimized for 2d arrays, manual loop unrolling */ static NPY_INLINE int _PyArrayNeighborhoodIter_IncrCoord2D(PyArrayNeighborhoodIterObject* iter) { npy_intp wb; _UPDATE_COORD_ITER(1) _UPDATE_COORD_ITER(0) return 0; } #undef _UPDATE_COORD_ITER /* * Advance to the next neighbour */ static NPY_INLINE int PyArrayNeighborhoodIter_Next(PyArrayNeighborhoodIterObject* iter) { _PyArrayNeighborhoodIter_IncrCoord (iter); iter->dataptr = iter->translate((PyArrayIterObject*)iter, iter->coordinates); return 0; } /* * Reset functions */ static NPY_INLINE int PyArrayNeighborhoodIter_Reset(PyArrayNeighborhoodIterObject* iter) { npy_intp i; for (i = 0; i < iter->nd; ++i) { iter->coordinates[i] = iter->bounds[i][0]; } iter->dataptr = iter->translate((PyArrayIterObject*)iter, iter->coordinates); return 0; }
1,861
19.461538
81
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/numpyconfig.h
#ifndef _NPY_NUMPYCONFIG_H_ #define _NPY_NUMPYCONFIG_H_ #include "_numpyconfig.h" /* * On Mac OS X, because there is only one configuration stage for all the archs * in universal builds, any macro which depends on the arch needs to be * hardcoded */ #ifdef __APPLE__ #undef NPY_SIZEOF_LONG #undef NPY_SIZEOF_PY_INTPTR_T #ifdef __LP64__ #define NPY_SIZEOF_LONG 8 #define NPY_SIZEOF_PY_INTPTR_T 8 #else #define NPY_SIZEOF_LONG 4 #define NPY_SIZEOF_PY_INTPTR_T 4 #endif #endif /** * To help with the NPY_NO_DEPRECATED_API macro, we include API version * numbers for specific versions of NumPy. To exclude all API that was * deprecated as of 1.7, add the following before #including any NumPy * headers: * #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION */ #define NPY_1_7_API_VERSION 0x00000007 #define NPY_1_8_API_VERSION 0x00000008 #define NPY_1_9_API_VERSION 0x00000008 #define NPY_1_10_API_VERSION 0x00000008 #define NPY_1_11_API_VERSION 0x00000008 #define NPY_1_12_API_VERSION 0x00000008 #define NPY_1_13_API_VERSION 0x00000008 #define NPY_1_14_API_VERSION 0x00000008 #endif
1,167
27.487805
79
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/__multiarray_api.h
#if defined(_MULTIARRAYMODULE) || defined(WITH_CPYCHECKER_STEALS_REFERENCE_TO_ARG_ATTRIBUTE) typedef struct { PyObject_HEAD npy_bool obval; } PyBoolScalarObject; extern NPY_NO_EXPORT PyTypeObject PyArrayMapIter_Type; extern NPY_NO_EXPORT PyTypeObject PyArrayNeighborhoodIter_Type; extern NPY_NO_EXPORT PyBoolScalarObject _PyArrayScalar_BoolValues[2]; NPY_NO_EXPORT unsigned int PyArray_GetNDArrayCVersion \ (void); extern NPY_NO_EXPORT PyTypeObject PyBigArray_Type; extern NPY_NO_EXPORT PyTypeObject PyArray_Type; extern NPY_NO_EXPORT PyTypeObject PyArrayDescr_Type; extern NPY_NO_EXPORT PyTypeObject PyArrayFlags_Type; extern NPY_NO_EXPORT PyTypeObject PyArrayIter_Type; extern NPY_NO_EXPORT PyTypeObject PyArrayMultiIter_Type; extern NPY_NO_EXPORT int NPY_NUMUSERTYPES; extern NPY_NO_EXPORT PyTypeObject PyBoolArrType_Type; extern NPY_NO_EXPORT PyBoolScalarObject _PyArrayScalar_BoolValues[2]; extern NPY_NO_EXPORT PyTypeObject PyGenericArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyNumberArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyIntegerArrType_Type; extern NPY_NO_EXPORT PyTypeObject PySignedIntegerArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyUnsignedIntegerArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyInexactArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyFloatingArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyComplexFloatingArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyFlexibleArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyCharacterArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyByteArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyShortArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyIntArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyLongArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyLongLongArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyUByteArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyUShortArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyUIntArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyULongArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyULongLongArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyFloatArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyDoubleArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyLongDoubleArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyCFloatArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyCDoubleArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyCLongDoubleArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyObjectArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyStringArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyUnicodeArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyVoidArrType_Type; NPY_NO_EXPORT int PyArray_SetNumericOps \ (PyObject *); NPY_NO_EXPORT PyObject * PyArray_GetNumericOps \ (void); NPY_NO_EXPORT int PyArray_INCREF \ (PyArrayObject *); NPY_NO_EXPORT int PyArray_XDECREF \ (PyArrayObject *); NPY_NO_EXPORT void PyArray_SetStringFunction \ (PyObject *, int); NPY_NO_EXPORT PyArray_Descr * PyArray_DescrFromType \ (int); NPY_NO_EXPORT PyObject * PyArray_TypeObjectFromType \ (int); NPY_NO_EXPORT char * PyArray_Zero \ (PyArrayObject *); NPY_NO_EXPORT char * PyArray_One \ (PyArrayObject *); NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) NPY_GCC_NONNULL(2) PyObject * PyArray_CastToType \ (PyArrayObject *, PyArray_Descr *, int); NPY_NO_EXPORT int PyArray_CastTo \ (PyArrayObject *, PyArrayObject *); NPY_NO_EXPORT int PyArray_CastAnyTo \ (PyArrayObject *, PyArrayObject *); NPY_NO_EXPORT int PyArray_CanCastSafely \ (int, int); NPY_NO_EXPORT npy_bool PyArray_CanCastTo \ (PyArray_Descr *, PyArray_Descr *); NPY_NO_EXPORT int PyArray_ObjectType \ (PyObject *, int); NPY_NO_EXPORT PyArray_Descr * PyArray_DescrFromObject \ (PyObject *, PyArray_Descr *); NPY_NO_EXPORT PyArrayObject ** PyArray_ConvertToCommonType \ (PyObject *, int *); NPY_NO_EXPORT PyArray_Descr * PyArray_DescrFromScalar \ (PyObject *); NPY_NO_EXPORT PyArray_Descr * PyArray_DescrFromTypeObject \ (PyObject *); NPY_NO_EXPORT npy_intp PyArray_Size \ (PyObject *); NPY_NO_EXPORT PyObject * PyArray_Scalar \ (void *, PyArray_Descr *, PyObject *); NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) PyObject * PyArray_FromScalar \ (PyObject *, PyArray_Descr *); NPY_NO_EXPORT void PyArray_ScalarAsCtype \ (PyObject *, void *); NPY_NO_EXPORT int PyArray_CastScalarToCtype \ (PyObject *, void *, PyArray_Descr *); NPY_NO_EXPORT int PyArray_CastScalarDirect \ (PyObject *, PyArray_Descr *, void *, int); NPY_NO_EXPORT PyObject * PyArray_ScalarFromObject \ (PyObject *); NPY_NO_EXPORT PyArray_VectorUnaryFunc * PyArray_GetCastFunc \ (PyArray_Descr *, int); NPY_NO_EXPORT PyObject * PyArray_FromDims \ (int, int *, int); NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(3) PyObject * PyArray_FromDimsAndDataAndDescr \ (int, int *, PyArray_Descr *, char *); NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) PyObject * PyArray_FromAny \ (PyObject *, PyArray_Descr *, int, int, int, PyObject *); NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(1) PyObject * PyArray_EnsureArray \ (PyObject *); NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(1) PyObject * PyArray_EnsureAnyArray \ (PyObject *); NPY_NO_EXPORT PyObject * PyArray_FromFile \ (FILE *, PyArray_Descr *, npy_intp, char *); NPY_NO_EXPORT PyObject * PyArray_FromString \ (char *, npy_intp, PyArray_Descr *, npy_intp, char *); NPY_NO_EXPORT PyObject * PyArray_FromBuffer \ (PyObject *, PyArray_Descr *, npy_intp, npy_intp); NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) PyObject * PyArray_FromIter \ (PyObject *, PyArray_Descr *, npy_intp); NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(1) PyObject * PyArray_Return \ (PyArrayObject *); NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) NPY_GCC_NONNULL(2) PyObject * PyArray_GetField \ (PyArrayObject *, PyArray_Descr *, int); NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) NPY_GCC_NONNULL(2) int PyArray_SetField \ (PyArrayObject *, PyArray_Descr *, int, PyObject *); NPY_NO_EXPORT PyObject * PyArray_Byteswap \ (PyArrayObject *, npy_bool); NPY_NO_EXPORT PyObject * PyArray_Resize \ (PyArrayObject *, PyArray_Dims *, int, NPY_ORDER); NPY_NO_EXPORT int PyArray_MoveInto \ (PyArrayObject *, PyArrayObject *); NPY_NO_EXPORT int PyArray_CopyInto \ (PyArrayObject *, PyArrayObject *); NPY_NO_EXPORT int PyArray_CopyAnyInto \ (PyArrayObject *, PyArrayObject *); NPY_NO_EXPORT int PyArray_CopyObject \ (PyArrayObject *, PyObject *); NPY_NO_EXPORT NPY_GCC_NONNULL(1) PyObject * PyArray_NewCopy \ (PyArrayObject *, NPY_ORDER); NPY_NO_EXPORT PyObject * PyArray_ToList \ (PyArrayObject *); NPY_NO_EXPORT PyObject * PyArray_ToString \ (PyArrayObject *, NPY_ORDER); NPY_NO_EXPORT int PyArray_ToFile \ (PyArrayObject *, FILE *, char *, char *); NPY_NO_EXPORT int PyArray_Dump \ (PyObject *, PyObject *, int); NPY_NO_EXPORT PyObject * PyArray_Dumps \ (PyObject *, int); NPY_NO_EXPORT int PyArray_ValidType \ (int); NPY_NO_EXPORT void PyArray_UpdateFlags \ (PyArrayObject *, int); NPY_NO_EXPORT NPY_GCC_NONNULL(1) PyObject * PyArray_New \ (PyTypeObject *, int, npy_intp *, int, npy_intp *, void *, int, int, PyObject *); NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) NPY_GCC_NONNULL(1) NPY_GCC_NONNULL(2) PyObject * PyArray_NewFromDescr \ (PyTypeObject *, PyArray_Descr *, int, npy_intp *, npy_intp *, void *, int, PyObject *); NPY_NO_EXPORT PyArray_Descr * PyArray_DescrNew \ (PyArray_Descr *); NPY_NO_EXPORT PyArray_Descr * PyArray_DescrNewFromType \ (int); NPY_NO_EXPORT double PyArray_GetPriority \ (PyObject *, double); NPY_NO_EXPORT PyObject * PyArray_IterNew \ (PyObject *); NPY_NO_EXPORT PyObject * PyArray_MultiIterNew \ (int, ...); NPY_NO_EXPORT int PyArray_PyIntAsInt \ (PyObject *); NPY_NO_EXPORT npy_intp PyArray_PyIntAsIntp \ (PyObject *); NPY_NO_EXPORT int PyArray_Broadcast \ (PyArrayMultiIterObject *); NPY_NO_EXPORT void PyArray_FillObjectArray \ (PyArrayObject *, PyObject *); NPY_NO_EXPORT int PyArray_FillWithScalar \ (PyArrayObject *, PyObject *); NPY_NO_EXPORT npy_bool PyArray_CheckStrides \ (int, int, npy_intp, npy_intp, npy_intp *, npy_intp *); NPY_NO_EXPORT PyArray_Descr * PyArray_DescrNewByteorder \ (PyArray_Descr *, char); NPY_NO_EXPORT PyObject * PyArray_IterAllButAxis \ (PyObject *, int *); NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) PyObject * PyArray_CheckFromAny \ (PyObject *, PyArray_Descr *, int, int, int, PyObject *); NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) PyObject * PyArray_FromArray \ (PyArrayObject *, PyArray_Descr *, int); NPY_NO_EXPORT PyObject * PyArray_FromInterface \ (PyObject *); NPY_NO_EXPORT PyObject * PyArray_FromStructInterface \ (PyObject *); NPY_NO_EXPORT PyObject * PyArray_FromArrayAttr \ (PyObject *, PyArray_Descr *, PyObject *); NPY_NO_EXPORT NPY_SCALARKIND PyArray_ScalarKind \ (int, PyArrayObject **); NPY_NO_EXPORT int PyArray_CanCoerceScalar \ (int, int, NPY_SCALARKIND); NPY_NO_EXPORT PyObject * PyArray_NewFlagsObject \ (PyObject *); NPY_NO_EXPORT npy_bool PyArray_CanCastScalar \ (PyTypeObject *, PyTypeObject *); NPY_NO_EXPORT int PyArray_CompareUCS4 \ (npy_ucs4 *, npy_ucs4 *, size_t); NPY_NO_EXPORT int PyArray_RemoveSmallest \ (PyArrayMultiIterObject *); NPY_NO_EXPORT int PyArray_ElementStrides \ (PyObject *); NPY_NO_EXPORT void PyArray_Item_INCREF \ (char *, PyArray_Descr *); NPY_NO_EXPORT void PyArray_Item_XDECREF \ (char *, PyArray_Descr *); NPY_NO_EXPORT PyObject * PyArray_FieldNames \ (PyObject *); NPY_NO_EXPORT PyObject * PyArray_Transpose \ (PyArrayObject *, PyArray_Dims *); NPY_NO_EXPORT PyObject * PyArray_TakeFrom \ (PyArrayObject *, PyObject *, int, PyArrayObject *, NPY_CLIPMODE); NPY_NO_EXPORT PyObject * PyArray_PutTo \ (PyArrayObject *, PyObject*, PyObject *, NPY_CLIPMODE); NPY_NO_EXPORT PyObject * PyArray_PutMask \ (PyArrayObject *, PyObject*, PyObject*); NPY_NO_EXPORT PyObject * PyArray_Repeat \ (PyArrayObject *, PyObject *, int); NPY_NO_EXPORT PyObject * PyArray_Choose \ (PyArrayObject *, PyObject *, PyArrayObject *, NPY_CLIPMODE); NPY_NO_EXPORT int PyArray_Sort \ (PyArrayObject *, int, NPY_SORTKIND); NPY_NO_EXPORT PyObject * PyArray_ArgSort \ (PyArrayObject *, int, NPY_SORTKIND); NPY_NO_EXPORT PyObject * PyArray_SearchSorted \ (PyArrayObject *, PyObject *, NPY_SEARCHSIDE, PyObject *); NPY_NO_EXPORT PyObject * PyArray_ArgMax \ (PyArrayObject *, int, PyArrayObject *); NPY_NO_EXPORT PyObject * PyArray_ArgMin \ (PyArrayObject *, int, PyArrayObject *); NPY_NO_EXPORT PyObject * PyArray_Reshape \ (PyArrayObject *, PyObject *); NPY_NO_EXPORT PyObject * PyArray_Newshape \ (PyArrayObject *, PyArray_Dims *, NPY_ORDER); NPY_NO_EXPORT PyObject * PyArray_Squeeze \ (PyArrayObject *); NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) PyObject * PyArray_View \ (PyArrayObject *, PyArray_Descr *, PyTypeObject *); NPY_NO_EXPORT PyObject * PyArray_SwapAxes \ (PyArrayObject *, int, int); NPY_NO_EXPORT PyObject * PyArray_Max \ (PyArrayObject *, int, PyArrayObject *); NPY_NO_EXPORT PyObject * PyArray_Min \ (PyArrayObject *, int, PyArrayObject *); NPY_NO_EXPORT PyObject * PyArray_Ptp \ (PyArrayObject *, int, PyArrayObject *); NPY_NO_EXPORT PyObject * PyArray_Mean \ (PyArrayObject *, int, int, PyArrayObject *); NPY_NO_EXPORT PyObject * PyArray_Trace \ (PyArrayObject *, int, int, int, int, PyArrayObject *); NPY_NO_EXPORT PyObject * PyArray_Diagonal \ (PyArrayObject *, int, int, int); NPY_NO_EXPORT PyObject * PyArray_Clip \ (PyArrayObject *, PyObject *, PyObject *, PyArrayObject *); NPY_NO_EXPORT PyObject * PyArray_Conjugate \ (PyArrayObject *, PyArrayObject *); NPY_NO_EXPORT PyObject * PyArray_Nonzero \ (PyArrayObject *); NPY_NO_EXPORT PyObject * PyArray_Std \ (PyArrayObject *, int, int, PyArrayObject *, int); NPY_NO_EXPORT PyObject * PyArray_Sum \ (PyArrayObject *, int, int, PyArrayObject *); NPY_NO_EXPORT PyObject * PyArray_CumSum \ (PyArrayObject *, int, int, PyArrayObject *); NPY_NO_EXPORT PyObject * PyArray_Prod \ (PyArrayObject *, int, int, PyArrayObject *); NPY_NO_EXPORT PyObject * PyArray_CumProd \ (PyArrayObject *, int, int, PyArrayObject *); NPY_NO_EXPORT PyObject * PyArray_All \ (PyArrayObject *, int, PyArrayObject *); NPY_NO_EXPORT PyObject * PyArray_Any \ (PyArrayObject *, int, PyArrayObject *); NPY_NO_EXPORT PyObject * PyArray_Compress \ (PyArrayObject *, PyObject *, int, PyArrayObject *); NPY_NO_EXPORT PyObject * PyArray_Flatten \ (PyArrayObject *, NPY_ORDER); NPY_NO_EXPORT PyObject * PyArray_Ravel \ (PyArrayObject *, NPY_ORDER); NPY_NO_EXPORT npy_intp PyArray_MultiplyList \ (npy_intp *, int); NPY_NO_EXPORT int PyArray_MultiplyIntList \ (int *, int); NPY_NO_EXPORT void * PyArray_GetPtr \ (PyArrayObject *, npy_intp*); NPY_NO_EXPORT int PyArray_CompareLists \ (npy_intp *, npy_intp *, int); NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(5) int PyArray_AsCArray \ (PyObject **, void *, npy_intp *, int, PyArray_Descr*); NPY_NO_EXPORT int PyArray_As1D \ (PyObject **, char **, int *, int); NPY_NO_EXPORT int PyArray_As2D \ (PyObject **, char ***, int *, int *, int); NPY_NO_EXPORT int PyArray_Free \ (PyObject *, void *); NPY_NO_EXPORT int PyArray_Converter \ (PyObject *, PyObject **); NPY_NO_EXPORT int PyArray_IntpFromSequence \ (PyObject *, npy_intp *, int); NPY_NO_EXPORT PyObject * PyArray_Concatenate \ (PyObject *, int); NPY_NO_EXPORT PyObject * PyArray_InnerProduct \ (PyObject *, PyObject *); NPY_NO_EXPORT PyObject * PyArray_MatrixProduct \ (PyObject *, PyObject *); NPY_NO_EXPORT PyObject * PyArray_CopyAndTranspose \ (PyObject *); NPY_NO_EXPORT PyObject * PyArray_Correlate \ (PyObject *, PyObject *, int); NPY_NO_EXPORT int PyArray_TypestrConvert \ (int, int); NPY_NO_EXPORT int PyArray_DescrConverter \ (PyObject *, PyArray_Descr **); NPY_NO_EXPORT int PyArray_DescrConverter2 \ (PyObject *, PyArray_Descr **); NPY_NO_EXPORT int PyArray_IntpConverter \ (PyObject *, PyArray_Dims *); NPY_NO_EXPORT int PyArray_BufferConverter \ (PyObject *, PyArray_Chunk *); NPY_NO_EXPORT int PyArray_AxisConverter \ (PyObject *, int *); NPY_NO_EXPORT int PyArray_BoolConverter \ (PyObject *, npy_bool *); NPY_NO_EXPORT int PyArray_ByteorderConverter \ (PyObject *, char *); NPY_NO_EXPORT int PyArray_OrderConverter \ (PyObject *, NPY_ORDER *); NPY_NO_EXPORT unsigned char PyArray_EquivTypes \ (PyArray_Descr *, PyArray_Descr *); NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(3) PyObject * PyArray_Zeros \ (int, npy_intp *, PyArray_Descr *, int); NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(3) PyObject * PyArray_Empty \ (int, npy_intp *, PyArray_Descr *, int); NPY_NO_EXPORT PyObject * PyArray_Where \ (PyObject *, PyObject *, PyObject *); NPY_NO_EXPORT PyObject * PyArray_Arange \ (double, double, double, int); NPY_NO_EXPORT PyObject * PyArray_ArangeObj \ (PyObject *, PyObject *, PyObject *, PyArray_Descr *); NPY_NO_EXPORT int PyArray_SortkindConverter \ (PyObject *, NPY_SORTKIND *); NPY_NO_EXPORT PyObject * PyArray_LexSort \ (PyObject *, int); NPY_NO_EXPORT PyObject * PyArray_Round \ (PyArrayObject *, int, PyArrayObject *); NPY_NO_EXPORT unsigned char PyArray_EquivTypenums \ (int, int); NPY_NO_EXPORT int PyArray_RegisterDataType \ (PyArray_Descr *); NPY_NO_EXPORT int PyArray_RegisterCastFunc \ (PyArray_Descr *, int, PyArray_VectorUnaryFunc *); NPY_NO_EXPORT int PyArray_RegisterCanCast \ (PyArray_Descr *, int, NPY_SCALARKIND); NPY_NO_EXPORT void PyArray_InitArrFuncs \ (PyArray_ArrFuncs *); NPY_NO_EXPORT PyObject * PyArray_IntTupleFromIntp \ (int, npy_intp *); NPY_NO_EXPORT int PyArray_TypeNumFromName \ (char *); NPY_NO_EXPORT int PyArray_ClipmodeConverter \ (PyObject *, NPY_CLIPMODE *); NPY_NO_EXPORT int PyArray_OutputConverter \ (PyObject *, PyArrayObject **); NPY_NO_EXPORT PyObject * PyArray_BroadcastToShape \ (PyObject *, npy_intp *, int); NPY_NO_EXPORT void _PyArray_SigintHandler \ (int); NPY_NO_EXPORT void* _PyArray_GetSigintBuf \ (void); NPY_NO_EXPORT int PyArray_DescrAlignConverter \ (PyObject *, PyArray_Descr **); NPY_NO_EXPORT int PyArray_DescrAlignConverter2 \ (PyObject *, PyArray_Descr **); NPY_NO_EXPORT int PyArray_SearchsideConverter \ (PyObject *, void *); NPY_NO_EXPORT PyObject * PyArray_CheckAxis \ (PyArrayObject *, int *, int); NPY_NO_EXPORT npy_intp PyArray_OverflowMultiplyList \ (npy_intp *, int); NPY_NO_EXPORT int PyArray_CompareString \ (char *, char *, size_t); NPY_NO_EXPORT PyObject * PyArray_MultiIterFromObjects \ (PyObject **, int, int, ...); NPY_NO_EXPORT int PyArray_GetEndianness \ (void); NPY_NO_EXPORT unsigned int PyArray_GetNDArrayCFeatureVersion \ (void); NPY_NO_EXPORT PyObject * PyArray_Correlate2 \ (PyObject *, PyObject *, int); NPY_NO_EXPORT PyObject* PyArray_NeighborhoodIterNew \ (PyArrayIterObject *, npy_intp *, int, PyArrayObject*); extern NPY_NO_EXPORT PyTypeObject PyTimeIntegerArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyDatetimeArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyTimedeltaArrType_Type; extern NPY_NO_EXPORT PyTypeObject PyHalfArrType_Type; extern NPY_NO_EXPORT PyTypeObject NpyIter_Type; NPY_NO_EXPORT void PyArray_SetDatetimeParseFunction \ (PyObject *); NPY_NO_EXPORT void PyArray_DatetimeToDatetimeStruct \ (npy_datetime, NPY_DATETIMEUNIT, npy_datetimestruct *); NPY_NO_EXPORT void PyArray_TimedeltaToTimedeltaStruct \ (npy_timedelta, NPY_DATETIMEUNIT, npy_timedeltastruct *); NPY_NO_EXPORT npy_datetime PyArray_DatetimeStructToDatetime \ (NPY_DATETIMEUNIT, npy_datetimestruct *); NPY_NO_EXPORT npy_datetime PyArray_TimedeltaStructToTimedelta \ (NPY_DATETIMEUNIT, npy_timedeltastruct *); NPY_NO_EXPORT NpyIter * NpyIter_New \ (PyArrayObject *, npy_uint32, NPY_ORDER, NPY_CASTING, PyArray_Descr*); NPY_NO_EXPORT NpyIter * NpyIter_MultiNew \ (int, PyArrayObject **, npy_uint32, NPY_ORDER, NPY_CASTING, npy_uint32 *, PyArray_Descr **); NPY_NO_EXPORT NpyIter * NpyIter_AdvancedNew \ (int, PyArrayObject **, npy_uint32, NPY_ORDER, NPY_CASTING, npy_uint32 *, PyArray_Descr **, int, int **, npy_intp *, npy_intp); NPY_NO_EXPORT NpyIter * NpyIter_Copy \ (NpyIter *); NPY_NO_EXPORT int NpyIter_Deallocate \ (NpyIter *); NPY_NO_EXPORT npy_bool NpyIter_HasDelayedBufAlloc \ (NpyIter *); NPY_NO_EXPORT npy_bool NpyIter_HasExternalLoop \ (NpyIter *); NPY_NO_EXPORT int NpyIter_EnableExternalLoop \ (NpyIter *); NPY_NO_EXPORT npy_intp * NpyIter_GetInnerStrideArray \ (NpyIter *); NPY_NO_EXPORT npy_intp * NpyIter_GetInnerLoopSizePtr \ (NpyIter *); NPY_NO_EXPORT int NpyIter_Reset \ (NpyIter *, char **); NPY_NO_EXPORT int NpyIter_ResetBasePointers \ (NpyIter *, char **, char **); NPY_NO_EXPORT int NpyIter_ResetToIterIndexRange \ (NpyIter *, npy_intp, npy_intp, char **); NPY_NO_EXPORT int NpyIter_GetNDim \ (NpyIter *); NPY_NO_EXPORT int NpyIter_GetNOp \ (NpyIter *); NPY_NO_EXPORT NpyIter_IterNextFunc * NpyIter_GetIterNext \ (NpyIter *, char **); NPY_NO_EXPORT npy_intp NpyIter_GetIterSize \ (NpyIter *); NPY_NO_EXPORT void NpyIter_GetIterIndexRange \ (NpyIter *, npy_intp *, npy_intp *); NPY_NO_EXPORT npy_intp NpyIter_GetIterIndex \ (NpyIter *); NPY_NO_EXPORT int NpyIter_GotoIterIndex \ (NpyIter *, npy_intp); NPY_NO_EXPORT npy_bool NpyIter_HasMultiIndex \ (NpyIter *); NPY_NO_EXPORT int NpyIter_GetShape \ (NpyIter *, npy_intp *); NPY_NO_EXPORT NpyIter_GetMultiIndexFunc * NpyIter_GetGetMultiIndex \ (NpyIter *, char **); NPY_NO_EXPORT int NpyIter_GotoMultiIndex \ (NpyIter *, npy_intp *); NPY_NO_EXPORT int NpyIter_RemoveMultiIndex \ (NpyIter *); NPY_NO_EXPORT npy_bool NpyIter_HasIndex \ (NpyIter *); NPY_NO_EXPORT npy_bool NpyIter_IsBuffered \ (NpyIter *); NPY_NO_EXPORT npy_bool NpyIter_IsGrowInner \ (NpyIter *); NPY_NO_EXPORT npy_intp NpyIter_GetBufferSize \ (NpyIter *); NPY_NO_EXPORT npy_intp * NpyIter_GetIndexPtr \ (NpyIter *); NPY_NO_EXPORT int NpyIter_GotoIndex \ (NpyIter *, npy_intp); NPY_NO_EXPORT char ** NpyIter_GetDataPtrArray \ (NpyIter *); NPY_NO_EXPORT PyArray_Descr ** NpyIter_GetDescrArray \ (NpyIter *); NPY_NO_EXPORT PyArrayObject ** NpyIter_GetOperandArray \ (NpyIter *); NPY_NO_EXPORT PyArrayObject * NpyIter_GetIterView \ (NpyIter *, npy_intp); NPY_NO_EXPORT void NpyIter_GetReadFlags \ (NpyIter *, char *); NPY_NO_EXPORT void NpyIter_GetWriteFlags \ (NpyIter *, char *); NPY_NO_EXPORT void NpyIter_DebugPrint \ (NpyIter *); NPY_NO_EXPORT npy_bool NpyIter_IterationNeedsAPI \ (NpyIter *); NPY_NO_EXPORT void NpyIter_GetInnerFixedStrideArray \ (NpyIter *, npy_intp *); NPY_NO_EXPORT int NpyIter_RemoveAxis \ (NpyIter *, int); NPY_NO_EXPORT npy_intp * NpyIter_GetAxisStrideArray \ (NpyIter *, int); NPY_NO_EXPORT npy_bool NpyIter_RequiresBuffering \ (NpyIter *); NPY_NO_EXPORT char ** NpyIter_GetInitialDataPtrArray \ (NpyIter *); NPY_NO_EXPORT int NpyIter_CreateCompatibleStrides \ (NpyIter *, npy_intp, npy_intp *); NPY_NO_EXPORT int PyArray_CastingConverter \ (PyObject *, NPY_CASTING *); NPY_NO_EXPORT npy_intp PyArray_CountNonzero \ (PyArrayObject *); NPY_NO_EXPORT PyArray_Descr * PyArray_PromoteTypes \ (PyArray_Descr *, PyArray_Descr *); NPY_NO_EXPORT PyArray_Descr * PyArray_MinScalarType \ (PyArrayObject *); NPY_NO_EXPORT PyArray_Descr * PyArray_ResultType \ (npy_intp, PyArrayObject **, npy_intp, PyArray_Descr **); NPY_NO_EXPORT npy_bool PyArray_CanCastArrayTo \ (PyArrayObject *, PyArray_Descr *, NPY_CASTING); NPY_NO_EXPORT npy_bool PyArray_CanCastTypeTo \ (PyArray_Descr *, PyArray_Descr *, NPY_CASTING); NPY_NO_EXPORT PyArrayObject * PyArray_EinsteinSum \ (char *, npy_intp, PyArrayObject **, PyArray_Descr *, NPY_ORDER, NPY_CASTING, PyArrayObject *); NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(3) NPY_GCC_NONNULL(1) PyObject * PyArray_NewLikeArray \ (PyArrayObject *, NPY_ORDER, PyArray_Descr *, int); NPY_NO_EXPORT int PyArray_GetArrayParamsFromObject \ (PyObject *, PyArray_Descr *, npy_bool, PyArray_Descr **, int *, npy_intp *, PyArrayObject **, PyObject *); NPY_NO_EXPORT int PyArray_ConvertClipmodeSequence \ (PyObject *, NPY_CLIPMODE *, int); NPY_NO_EXPORT PyObject * PyArray_MatrixProduct2 \ (PyObject *, PyObject *, PyArrayObject*); NPY_NO_EXPORT npy_bool NpyIter_IsFirstVisit \ (NpyIter *, int); NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) int PyArray_SetBaseObject \ (PyArrayObject *, PyObject *); NPY_NO_EXPORT void PyArray_CreateSortedStridePerm \ (int, npy_intp *, npy_stride_sort_item *); NPY_NO_EXPORT void PyArray_RemoveAxesInPlace \ (PyArrayObject *, npy_bool *); NPY_NO_EXPORT void PyArray_DebugPrint \ (PyArrayObject *); NPY_NO_EXPORT int PyArray_FailUnlessWriteable \ (PyArrayObject *, const char *); NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) int PyArray_SetUpdateIfCopyBase \ (PyArrayObject *, PyArrayObject *); NPY_NO_EXPORT void * PyDataMem_NEW \ (size_t); NPY_NO_EXPORT void PyDataMem_FREE \ (void *); NPY_NO_EXPORT void * PyDataMem_RENEW \ (void *, size_t); NPY_NO_EXPORT PyDataMem_EventHookFunc * PyDataMem_SetEventHook \ (PyDataMem_EventHookFunc *, void *, void **); extern NPY_NO_EXPORT NPY_CASTING NPY_DEFAULT_ASSIGN_CASTING; NPY_NO_EXPORT void PyArray_MapIterSwapAxes \ (PyArrayMapIterObject *, PyArrayObject **, int); NPY_NO_EXPORT PyObject * PyArray_MapIterArray \ (PyArrayObject *, PyObject *); NPY_NO_EXPORT void PyArray_MapIterNext \ (PyArrayMapIterObject *); NPY_NO_EXPORT int PyArray_Partition \ (PyArrayObject *, PyArrayObject *, int, NPY_SELECTKIND); NPY_NO_EXPORT PyObject * PyArray_ArgPartition \ (PyArrayObject *, PyArrayObject *, int, NPY_SELECTKIND); NPY_NO_EXPORT int PyArray_SelectkindConverter \ (PyObject *, NPY_SELECTKIND *); NPY_NO_EXPORT void * PyDataMem_NEW_ZEROED \ (size_t, size_t); NPY_NO_EXPORT NPY_GCC_NONNULL(1) int PyArray_CheckAnyScalarExact \ (PyObject *); NPY_NO_EXPORT PyObject * PyArray_MapIterArrayCopyIfOverlap \ (PyArrayObject *, PyObject *, int, PyArrayObject *); NPY_NO_EXPORT int PyArray_ResolveWritebackIfCopy \ (PyArrayObject *); NPY_NO_EXPORT int PyArray_SetWritebackIfCopyBase \ (PyArrayObject *, PyArrayObject *); #else #if defined(PY_ARRAY_UNIQUE_SYMBOL) #define PyArray_API PY_ARRAY_UNIQUE_SYMBOL #endif #if defined(NO_IMPORT) || defined(NO_IMPORT_ARRAY) extern void **PyArray_API; #else #if defined(PY_ARRAY_UNIQUE_SYMBOL) void **PyArray_API; #else static void **PyArray_API=NULL; #endif #endif #define PyArray_GetNDArrayCVersion \ (*(unsigned int (*)(void)) \ PyArray_API[0]) #define PyBigArray_Type (*(PyTypeObject *)PyArray_API[1]) #define PyArray_Type (*(PyTypeObject *)PyArray_API[2]) #define PyArrayDescr_Type (*(PyTypeObject *)PyArray_API[3]) #define PyArrayFlags_Type (*(PyTypeObject *)PyArray_API[4]) #define PyArrayIter_Type (*(PyTypeObject *)PyArray_API[5]) #define PyArrayMultiIter_Type (*(PyTypeObject *)PyArray_API[6]) #define NPY_NUMUSERTYPES (*(int *)PyArray_API[7]) #define PyBoolArrType_Type (*(PyTypeObject *)PyArray_API[8]) #define _PyArrayScalar_BoolValues ((PyBoolScalarObject *)PyArray_API[9]) #define PyGenericArrType_Type (*(PyTypeObject *)PyArray_API[10]) #define PyNumberArrType_Type (*(PyTypeObject *)PyArray_API[11]) #define PyIntegerArrType_Type (*(PyTypeObject *)PyArray_API[12]) #define PySignedIntegerArrType_Type (*(PyTypeObject *)PyArray_API[13]) #define PyUnsignedIntegerArrType_Type (*(PyTypeObject *)PyArray_API[14]) #define PyInexactArrType_Type (*(PyTypeObject *)PyArray_API[15]) #define PyFloatingArrType_Type (*(PyTypeObject *)PyArray_API[16]) #define PyComplexFloatingArrType_Type (*(PyTypeObject *)PyArray_API[17]) #define PyFlexibleArrType_Type (*(PyTypeObject *)PyArray_API[18]) #define PyCharacterArrType_Type (*(PyTypeObject *)PyArray_API[19]) #define PyByteArrType_Type (*(PyTypeObject *)PyArray_API[20]) #define PyShortArrType_Type (*(PyTypeObject *)PyArray_API[21]) #define PyIntArrType_Type (*(PyTypeObject *)PyArray_API[22]) #define PyLongArrType_Type (*(PyTypeObject *)PyArray_API[23]) #define PyLongLongArrType_Type (*(PyTypeObject *)PyArray_API[24]) #define PyUByteArrType_Type (*(PyTypeObject *)PyArray_API[25]) #define PyUShortArrType_Type (*(PyTypeObject *)PyArray_API[26]) #define PyUIntArrType_Type (*(PyTypeObject *)PyArray_API[27]) #define PyULongArrType_Type (*(PyTypeObject *)PyArray_API[28]) #define PyULongLongArrType_Type (*(PyTypeObject *)PyArray_API[29]) #define PyFloatArrType_Type (*(PyTypeObject *)PyArray_API[30]) #define PyDoubleArrType_Type (*(PyTypeObject *)PyArray_API[31]) #define PyLongDoubleArrType_Type (*(PyTypeObject *)PyArray_API[32]) #define PyCFloatArrType_Type (*(PyTypeObject *)PyArray_API[33]) #define PyCDoubleArrType_Type (*(PyTypeObject *)PyArray_API[34]) #define PyCLongDoubleArrType_Type (*(PyTypeObject *)PyArray_API[35]) #define PyObjectArrType_Type (*(PyTypeObject *)PyArray_API[36]) #define PyStringArrType_Type (*(PyTypeObject *)PyArray_API[37]) #define PyUnicodeArrType_Type (*(PyTypeObject *)PyArray_API[38]) #define PyVoidArrType_Type (*(PyTypeObject *)PyArray_API[39]) #define PyArray_SetNumericOps \ (*(int (*)(PyObject *)) \ PyArray_API[40]) #define PyArray_GetNumericOps \ (*(PyObject * (*)(void)) \ PyArray_API[41]) #define PyArray_INCREF \ (*(int (*)(PyArrayObject *)) \ PyArray_API[42]) #define PyArray_XDECREF \ (*(int (*)(PyArrayObject *)) \ PyArray_API[43]) #define PyArray_SetStringFunction \ (*(void (*)(PyObject *, int)) \ PyArray_API[44]) #define PyArray_DescrFromType \ (*(PyArray_Descr * (*)(int)) \ PyArray_API[45]) #define PyArray_TypeObjectFromType \ (*(PyObject * (*)(int)) \ PyArray_API[46]) #define PyArray_Zero \ (*(char * (*)(PyArrayObject *)) \ PyArray_API[47]) #define PyArray_One \ (*(char * (*)(PyArrayObject *)) \ PyArray_API[48]) #define PyArray_CastToType \ (*(PyObject * (*)(PyArrayObject *, PyArray_Descr *, int)) \ PyArray_API[49]) #define PyArray_CastTo \ (*(int (*)(PyArrayObject *, PyArrayObject *)) \ PyArray_API[50]) #define PyArray_CastAnyTo \ (*(int (*)(PyArrayObject *, PyArrayObject *)) \ PyArray_API[51]) #define PyArray_CanCastSafely \ (*(int (*)(int, int)) \ PyArray_API[52]) #define PyArray_CanCastTo \ (*(npy_bool (*)(PyArray_Descr *, PyArray_Descr *)) \ PyArray_API[53]) #define PyArray_ObjectType \ (*(int (*)(PyObject *, int)) \ PyArray_API[54]) #define PyArray_DescrFromObject \ (*(PyArray_Descr * (*)(PyObject *, PyArray_Descr *)) \ PyArray_API[55]) #define PyArray_ConvertToCommonType \ (*(PyArrayObject ** (*)(PyObject *, int *)) \ PyArray_API[56]) #define PyArray_DescrFromScalar \ (*(PyArray_Descr * (*)(PyObject *)) \ PyArray_API[57]) #define PyArray_DescrFromTypeObject \ (*(PyArray_Descr * (*)(PyObject *)) \ PyArray_API[58]) #define PyArray_Size \ (*(npy_intp (*)(PyObject *)) \ PyArray_API[59]) #define PyArray_Scalar \ (*(PyObject * (*)(void *, PyArray_Descr *, PyObject *)) \ PyArray_API[60]) #define PyArray_FromScalar \ (*(PyObject * (*)(PyObject *, PyArray_Descr *)) \ PyArray_API[61]) #define PyArray_ScalarAsCtype \ (*(void (*)(PyObject *, void *)) \ PyArray_API[62]) #define PyArray_CastScalarToCtype \ (*(int (*)(PyObject *, void *, PyArray_Descr *)) \ PyArray_API[63]) #define PyArray_CastScalarDirect \ (*(int (*)(PyObject *, PyArray_Descr *, void *, int)) \ PyArray_API[64]) #define PyArray_ScalarFromObject \ (*(PyObject * (*)(PyObject *)) \ PyArray_API[65]) #define PyArray_GetCastFunc \ (*(PyArray_VectorUnaryFunc * (*)(PyArray_Descr *, int)) \ PyArray_API[66]) #define PyArray_FromDims \ (*(PyObject * (*)(int, int *, int)) \ PyArray_API[67]) #define PyArray_FromDimsAndDataAndDescr \ (*(PyObject * (*)(int, int *, PyArray_Descr *, char *)) \ PyArray_API[68]) #define PyArray_FromAny \ (*(PyObject * (*)(PyObject *, PyArray_Descr *, int, int, int, PyObject *)) \ PyArray_API[69]) #define PyArray_EnsureArray \ (*(PyObject * (*)(PyObject *)) \ PyArray_API[70]) #define PyArray_EnsureAnyArray \ (*(PyObject * (*)(PyObject *)) \ PyArray_API[71]) #define PyArray_FromFile \ (*(PyObject * (*)(FILE *, PyArray_Descr *, npy_intp, char *)) \ PyArray_API[72]) #define PyArray_FromString \ (*(PyObject * (*)(char *, npy_intp, PyArray_Descr *, npy_intp, char *)) \ PyArray_API[73]) #define PyArray_FromBuffer \ (*(PyObject * (*)(PyObject *, PyArray_Descr *, npy_intp, npy_intp)) \ PyArray_API[74]) #define PyArray_FromIter \ (*(PyObject * (*)(PyObject *, PyArray_Descr *, npy_intp)) \ PyArray_API[75]) #define PyArray_Return \ (*(PyObject * (*)(PyArrayObject *)) \ PyArray_API[76]) #define PyArray_GetField \ (*(PyObject * (*)(PyArrayObject *, PyArray_Descr *, int)) \ PyArray_API[77]) #define PyArray_SetField \ (*(int (*)(PyArrayObject *, PyArray_Descr *, int, PyObject *)) \ PyArray_API[78]) #define PyArray_Byteswap \ (*(PyObject * (*)(PyArrayObject *, npy_bool)) \ PyArray_API[79]) #define PyArray_Resize \ (*(PyObject * (*)(PyArrayObject *, PyArray_Dims *, int, NPY_ORDER)) \ PyArray_API[80]) #define PyArray_MoveInto \ (*(int (*)(PyArrayObject *, PyArrayObject *)) \ PyArray_API[81]) #define PyArray_CopyInto \ (*(int (*)(PyArrayObject *, PyArrayObject *)) \ PyArray_API[82]) #define PyArray_CopyAnyInto \ (*(int (*)(PyArrayObject *, PyArrayObject *)) \ PyArray_API[83]) #define PyArray_CopyObject \ (*(int (*)(PyArrayObject *, PyObject *)) \ PyArray_API[84]) #define PyArray_NewCopy \ (*(PyObject * (*)(PyArrayObject *, NPY_ORDER)) \ PyArray_API[85]) #define PyArray_ToList \ (*(PyObject * (*)(PyArrayObject *)) \ PyArray_API[86]) #define PyArray_ToString \ (*(PyObject * (*)(PyArrayObject *, NPY_ORDER)) \ PyArray_API[87]) #define PyArray_ToFile \ (*(int (*)(PyArrayObject *, FILE *, char *, char *)) \ PyArray_API[88]) #define PyArray_Dump \ (*(int (*)(PyObject *, PyObject *, int)) \ PyArray_API[89]) #define PyArray_Dumps \ (*(PyObject * (*)(PyObject *, int)) \ PyArray_API[90]) #define PyArray_ValidType \ (*(int (*)(int)) \ PyArray_API[91]) #define PyArray_UpdateFlags \ (*(void (*)(PyArrayObject *, int)) \ PyArray_API[92]) #define PyArray_New \ (*(PyObject * (*)(PyTypeObject *, int, npy_intp *, int, npy_intp *, void *, int, int, PyObject *)) \ PyArray_API[93]) #define PyArray_NewFromDescr \ (*(PyObject * (*)(PyTypeObject *, PyArray_Descr *, int, npy_intp *, npy_intp *, void *, int, PyObject *)) \ PyArray_API[94]) #define PyArray_DescrNew \ (*(PyArray_Descr * (*)(PyArray_Descr *)) \ PyArray_API[95]) #define PyArray_DescrNewFromType \ (*(PyArray_Descr * (*)(int)) \ PyArray_API[96]) #define PyArray_GetPriority \ (*(double (*)(PyObject *, double)) \ PyArray_API[97]) #define PyArray_IterNew \ (*(PyObject * (*)(PyObject *)) \ PyArray_API[98]) #define PyArray_MultiIterNew \ (*(PyObject * (*)(int, ...)) \ PyArray_API[99]) #define PyArray_PyIntAsInt \ (*(int (*)(PyObject *)) \ PyArray_API[100]) #define PyArray_PyIntAsIntp \ (*(npy_intp (*)(PyObject *)) \ PyArray_API[101]) #define PyArray_Broadcast \ (*(int (*)(PyArrayMultiIterObject *)) \ PyArray_API[102]) #define PyArray_FillObjectArray \ (*(void (*)(PyArrayObject *, PyObject *)) \ PyArray_API[103]) #define PyArray_FillWithScalar \ (*(int (*)(PyArrayObject *, PyObject *)) \ PyArray_API[104]) #define PyArray_CheckStrides \ (*(npy_bool (*)(int, int, npy_intp, npy_intp, npy_intp *, npy_intp *)) \ PyArray_API[105]) #define PyArray_DescrNewByteorder \ (*(PyArray_Descr * (*)(PyArray_Descr *, char)) \ PyArray_API[106]) #define PyArray_IterAllButAxis \ (*(PyObject * (*)(PyObject *, int *)) \ PyArray_API[107]) #define PyArray_CheckFromAny \ (*(PyObject * (*)(PyObject *, PyArray_Descr *, int, int, int, PyObject *)) \ PyArray_API[108]) #define PyArray_FromArray \ (*(PyObject * (*)(PyArrayObject *, PyArray_Descr *, int)) \ PyArray_API[109]) #define PyArray_FromInterface \ (*(PyObject * (*)(PyObject *)) \ PyArray_API[110]) #define PyArray_FromStructInterface \ (*(PyObject * (*)(PyObject *)) \ PyArray_API[111]) #define PyArray_FromArrayAttr \ (*(PyObject * (*)(PyObject *, PyArray_Descr *, PyObject *)) \ PyArray_API[112]) #define PyArray_ScalarKind \ (*(NPY_SCALARKIND (*)(int, PyArrayObject **)) \ PyArray_API[113]) #define PyArray_CanCoerceScalar \ (*(int (*)(int, int, NPY_SCALARKIND)) \ PyArray_API[114]) #define PyArray_NewFlagsObject \ (*(PyObject * (*)(PyObject *)) \ PyArray_API[115]) #define PyArray_CanCastScalar \ (*(npy_bool (*)(PyTypeObject *, PyTypeObject *)) \ PyArray_API[116]) #define PyArray_CompareUCS4 \ (*(int (*)(npy_ucs4 *, npy_ucs4 *, size_t)) \ PyArray_API[117]) #define PyArray_RemoveSmallest \ (*(int (*)(PyArrayMultiIterObject *)) \ PyArray_API[118]) #define PyArray_ElementStrides \ (*(int (*)(PyObject *)) \ PyArray_API[119]) #define PyArray_Item_INCREF \ (*(void (*)(char *, PyArray_Descr *)) \ PyArray_API[120]) #define PyArray_Item_XDECREF \ (*(void (*)(char *, PyArray_Descr *)) \ PyArray_API[121]) #define PyArray_FieldNames \ (*(PyObject * (*)(PyObject *)) \ PyArray_API[122]) #define PyArray_Transpose \ (*(PyObject * (*)(PyArrayObject *, PyArray_Dims *)) \ PyArray_API[123]) #define PyArray_TakeFrom \ (*(PyObject * (*)(PyArrayObject *, PyObject *, int, PyArrayObject *, NPY_CLIPMODE)) \ PyArray_API[124]) #define PyArray_PutTo \ (*(PyObject * (*)(PyArrayObject *, PyObject*, PyObject *, NPY_CLIPMODE)) \ PyArray_API[125]) #define PyArray_PutMask \ (*(PyObject * (*)(PyArrayObject *, PyObject*, PyObject*)) \ PyArray_API[126]) #define PyArray_Repeat \ (*(PyObject * (*)(PyArrayObject *, PyObject *, int)) \ PyArray_API[127]) #define PyArray_Choose \ (*(PyObject * (*)(PyArrayObject *, PyObject *, PyArrayObject *, NPY_CLIPMODE)) \ PyArray_API[128]) #define PyArray_Sort \ (*(int (*)(PyArrayObject *, int, NPY_SORTKIND)) \ PyArray_API[129]) #define PyArray_ArgSort \ (*(PyObject * (*)(PyArrayObject *, int, NPY_SORTKIND)) \ PyArray_API[130]) #define PyArray_SearchSorted \ (*(PyObject * (*)(PyArrayObject *, PyObject *, NPY_SEARCHSIDE, PyObject *)) \ PyArray_API[131]) #define PyArray_ArgMax \ (*(PyObject * (*)(PyArrayObject *, int, PyArrayObject *)) \ PyArray_API[132]) #define PyArray_ArgMin \ (*(PyObject * (*)(PyArrayObject *, int, PyArrayObject *)) \ PyArray_API[133]) #define PyArray_Reshape \ (*(PyObject * (*)(PyArrayObject *, PyObject *)) \ PyArray_API[134]) #define PyArray_Newshape \ (*(PyObject * (*)(PyArrayObject *, PyArray_Dims *, NPY_ORDER)) \ PyArray_API[135]) #define PyArray_Squeeze \ (*(PyObject * (*)(PyArrayObject *)) \ PyArray_API[136]) #define PyArray_View \ (*(PyObject * (*)(PyArrayObject *, PyArray_Descr *, PyTypeObject *)) \ PyArray_API[137]) #define PyArray_SwapAxes \ (*(PyObject * (*)(PyArrayObject *, int, int)) \ PyArray_API[138]) #define PyArray_Max \ (*(PyObject * (*)(PyArrayObject *, int, PyArrayObject *)) \ PyArray_API[139]) #define PyArray_Min \ (*(PyObject * (*)(PyArrayObject *, int, PyArrayObject *)) \ PyArray_API[140]) #define PyArray_Ptp \ (*(PyObject * (*)(PyArrayObject *, int, PyArrayObject *)) \ PyArray_API[141]) #define PyArray_Mean \ (*(PyObject * (*)(PyArrayObject *, int, int, PyArrayObject *)) \ PyArray_API[142]) #define PyArray_Trace \ (*(PyObject * (*)(PyArrayObject *, int, int, int, int, PyArrayObject *)) \ PyArray_API[143]) #define PyArray_Diagonal \ (*(PyObject * (*)(PyArrayObject *, int, int, int)) \ PyArray_API[144]) #define PyArray_Clip \ (*(PyObject * (*)(PyArrayObject *, PyObject *, PyObject *, PyArrayObject *)) \ PyArray_API[145]) #define PyArray_Conjugate \ (*(PyObject * (*)(PyArrayObject *, PyArrayObject *)) \ PyArray_API[146]) #define PyArray_Nonzero \ (*(PyObject * (*)(PyArrayObject *)) \ PyArray_API[147]) #define PyArray_Std \ (*(PyObject * (*)(PyArrayObject *, int, int, PyArrayObject *, int)) \ PyArray_API[148]) #define PyArray_Sum \ (*(PyObject * (*)(PyArrayObject *, int, int, PyArrayObject *)) \ PyArray_API[149]) #define PyArray_CumSum \ (*(PyObject * (*)(PyArrayObject *, int, int, PyArrayObject *)) \ PyArray_API[150]) #define PyArray_Prod \ (*(PyObject * (*)(PyArrayObject *, int, int, PyArrayObject *)) \ PyArray_API[151]) #define PyArray_CumProd \ (*(PyObject * (*)(PyArrayObject *, int, int, PyArrayObject *)) \ PyArray_API[152]) #define PyArray_All \ (*(PyObject * (*)(PyArrayObject *, int, PyArrayObject *)) \ PyArray_API[153]) #define PyArray_Any \ (*(PyObject * (*)(PyArrayObject *, int, PyArrayObject *)) \ PyArray_API[154]) #define PyArray_Compress \ (*(PyObject * (*)(PyArrayObject *, PyObject *, int, PyArrayObject *)) \ PyArray_API[155]) #define PyArray_Flatten \ (*(PyObject * (*)(PyArrayObject *, NPY_ORDER)) \ PyArray_API[156]) #define PyArray_Ravel \ (*(PyObject * (*)(PyArrayObject *, NPY_ORDER)) \ PyArray_API[157]) #define PyArray_MultiplyList \ (*(npy_intp (*)(npy_intp *, int)) \ PyArray_API[158]) #define PyArray_MultiplyIntList \ (*(int (*)(int *, int)) \ PyArray_API[159]) #define PyArray_GetPtr \ (*(void * (*)(PyArrayObject *, npy_intp*)) \ PyArray_API[160]) #define PyArray_CompareLists \ (*(int (*)(npy_intp *, npy_intp *, int)) \ PyArray_API[161]) #define PyArray_AsCArray \ (*(int (*)(PyObject **, void *, npy_intp *, int, PyArray_Descr*)) \ PyArray_API[162]) #define PyArray_As1D \ (*(int (*)(PyObject **, char **, int *, int)) \ PyArray_API[163]) #define PyArray_As2D \ (*(int (*)(PyObject **, char ***, int *, int *, int)) \ PyArray_API[164]) #define PyArray_Free \ (*(int (*)(PyObject *, void *)) \ PyArray_API[165]) #define PyArray_Converter \ (*(int (*)(PyObject *, PyObject **)) \ PyArray_API[166]) #define PyArray_IntpFromSequence \ (*(int (*)(PyObject *, npy_intp *, int)) \ PyArray_API[167]) #define PyArray_Concatenate \ (*(PyObject * (*)(PyObject *, int)) \ PyArray_API[168]) #define PyArray_InnerProduct \ (*(PyObject * (*)(PyObject *, PyObject *)) \ PyArray_API[169]) #define PyArray_MatrixProduct \ (*(PyObject * (*)(PyObject *, PyObject *)) \ PyArray_API[170]) #define PyArray_CopyAndTranspose \ (*(PyObject * (*)(PyObject *)) \ PyArray_API[171]) #define PyArray_Correlate \ (*(PyObject * (*)(PyObject *, PyObject *, int)) \ PyArray_API[172]) #define PyArray_TypestrConvert \ (*(int (*)(int, int)) \ PyArray_API[173]) #define PyArray_DescrConverter \ (*(int (*)(PyObject *, PyArray_Descr **)) \ PyArray_API[174]) #define PyArray_DescrConverter2 \ (*(int (*)(PyObject *, PyArray_Descr **)) \ PyArray_API[175]) #define PyArray_IntpConverter \ (*(int (*)(PyObject *, PyArray_Dims *)) \ PyArray_API[176]) #define PyArray_BufferConverter \ (*(int (*)(PyObject *, PyArray_Chunk *)) \ PyArray_API[177]) #define PyArray_AxisConverter \ (*(int (*)(PyObject *, int *)) \ PyArray_API[178]) #define PyArray_BoolConverter \ (*(int (*)(PyObject *, npy_bool *)) \ PyArray_API[179]) #define PyArray_ByteorderConverter \ (*(int (*)(PyObject *, char *)) \ PyArray_API[180]) #define PyArray_OrderConverter \ (*(int (*)(PyObject *, NPY_ORDER *)) \ PyArray_API[181]) #define PyArray_EquivTypes \ (*(unsigned char (*)(PyArray_Descr *, PyArray_Descr *)) \ PyArray_API[182]) #define PyArray_Zeros \ (*(PyObject * (*)(int, npy_intp *, PyArray_Descr *, int)) \ PyArray_API[183]) #define PyArray_Empty \ (*(PyObject * (*)(int, npy_intp *, PyArray_Descr *, int)) \ PyArray_API[184]) #define PyArray_Where \ (*(PyObject * (*)(PyObject *, PyObject *, PyObject *)) \ PyArray_API[185]) #define PyArray_Arange \ (*(PyObject * (*)(double, double, double, int)) \ PyArray_API[186]) #define PyArray_ArangeObj \ (*(PyObject * (*)(PyObject *, PyObject *, PyObject *, PyArray_Descr *)) \ PyArray_API[187]) #define PyArray_SortkindConverter \ (*(int (*)(PyObject *, NPY_SORTKIND *)) \ PyArray_API[188]) #define PyArray_LexSort \ (*(PyObject * (*)(PyObject *, int)) \ PyArray_API[189]) #define PyArray_Round \ (*(PyObject * (*)(PyArrayObject *, int, PyArrayObject *)) \ PyArray_API[190]) #define PyArray_EquivTypenums \ (*(unsigned char (*)(int, int)) \ PyArray_API[191]) #define PyArray_RegisterDataType \ (*(int (*)(PyArray_Descr *)) \ PyArray_API[192]) #define PyArray_RegisterCastFunc \ (*(int (*)(PyArray_Descr *, int, PyArray_VectorUnaryFunc *)) \ PyArray_API[193]) #define PyArray_RegisterCanCast \ (*(int (*)(PyArray_Descr *, int, NPY_SCALARKIND)) \ PyArray_API[194]) #define PyArray_InitArrFuncs \ (*(void (*)(PyArray_ArrFuncs *)) \ PyArray_API[195]) #define PyArray_IntTupleFromIntp \ (*(PyObject * (*)(int, npy_intp *)) \ PyArray_API[196]) #define PyArray_TypeNumFromName \ (*(int (*)(char *)) \ PyArray_API[197]) #define PyArray_ClipmodeConverter \ (*(int (*)(PyObject *, NPY_CLIPMODE *)) \ PyArray_API[198]) #define PyArray_OutputConverter \ (*(int (*)(PyObject *, PyArrayObject **)) \ PyArray_API[199]) #define PyArray_BroadcastToShape \ (*(PyObject * (*)(PyObject *, npy_intp *, int)) \ PyArray_API[200]) #define _PyArray_SigintHandler \ (*(void (*)(int)) \ PyArray_API[201]) #define _PyArray_GetSigintBuf \ (*(void* (*)(void)) \ PyArray_API[202]) #define PyArray_DescrAlignConverter \ (*(int (*)(PyObject *, PyArray_Descr **)) \ PyArray_API[203]) #define PyArray_DescrAlignConverter2 \ (*(int (*)(PyObject *, PyArray_Descr **)) \ PyArray_API[204]) #define PyArray_SearchsideConverter \ (*(int (*)(PyObject *, void *)) \ PyArray_API[205]) #define PyArray_CheckAxis \ (*(PyObject * (*)(PyArrayObject *, int *, int)) \ PyArray_API[206]) #define PyArray_OverflowMultiplyList \ (*(npy_intp (*)(npy_intp *, int)) \ PyArray_API[207]) #define PyArray_CompareString \ (*(int (*)(char *, char *, size_t)) \ PyArray_API[208]) #define PyArray_MultiIterFromObjects \ (*(PyObject * (*)(PyObject **, int, int, ...)) \ PyArray_API[209]) #define PyArray_GetEndianness \ (*(int (*)(void)) \ PyArray_API[210]) #define PyArray_GetNDArrayCFeatureVersion \ (*(unsigned int (*)(void)) \ PyArray_API[211]) #define PyArray_Correlate2 \ (*(PyObject * (*)(PyObject *, PyObject *, int)) \ PyArray_API[212]) #define PyArray_NeighborhoodIterNew \ (*(PyObject* (*)(PyArrayIterObject *, npy_intp *, int, PyArrayObject*)) \ PyArray_API[213]) #define PyTimeIntegerArrType_Type (*(PyTypeObject *)PyArray_API[214]) #define PyDatetimeArrType_Type (*(PyTypeObject *)PyArray_API[215]) #define PyTimedeltaArrType_Type (*(PyTypeObject *)PyArray_API[216]) #define PyHalfArrType_Type (*(PyTypeObject *)PyArray_API[217]) #define NpyIter_Type (*(PyTypeObject *)PyArray_API[218]) #define PyArray_SetDatetimeParseFunction \ (*(void (*)(PyObject *)) \ PyArray_API[219]) #define PyArray_DatetimeToDatetimeStruct \ (*(void (*)(npy_datetime, NPY_DATETIMEUNIT, npy_datetimestruct *)) \ PyArray_API[220]) #define PyArray_TimedeltaToTimedeltaStruct \ (*(void (*)(npy_timedelta, NPY_DATETIMEUNIT, npy_timedeltastruct *)) \ PyArray_API[221]) #define PyArray_DatetimeStructToDatetime \ (*(npy_datetime (*)(NPY_DATETIMEUNIT, npy_datetimestruct *)) \ PyArray_API[222]) #define PyArray_TimedeltaStructToTimedelta \ (*(npy_datetime (*)(NPY_DATETIMEUNIT, npy_timedeltastruct *)) \ PyArray_API[223]) #define NpyIter_New \ (*(NpyIter * (*)(PyArrayObject *, npy_uint32, NPY_ORDER, NPY_CASTING, PyArray_Descr*)) \ PyArray_API[224]) #define NpyIter_MultiNew \ (*(NpyIter * (*)(int, PyArrayObject **, npy_uint32, NPY_ORDER, NPY_CASTING, npy_uint32 *, PyArray_Descr **)) \ PyArray_API[225]) #define NpyIter_AdvancedNew \ (*(NpyIter * (*)(int, PyArrayObject **, npy_uint32, NPY_ORDER, NPY_CASTING, npy_uint32 *, PyArray_Descr **, int, int **, npy_intp *, npy_intp)) \ PyArray_API[226]) #define NpyIter_Copy \ (*(NpyIter * (*)(NpyIter *)) \ PyArray_API[227]) #define NpyIter_Deallocate \ (*(int (*)(NpyIter *)) \ PyArray_API[228]) #define NpyIter_HasDelayedBufAlloc \ (*(npy_bool (*)(NpyIter *)) \ PyArray_API[229]) #define NpyIter_HasExternalLoop \ (*(npy_bool (*)(NpyIter *)) \ PyArray_API[230]) #define NpyIter_EnableExternalLoop \ (*(int (*)(NpyIter *)) \ PyArray_API[231]) #define NpyIter_GetInnerStrideArray \ (*(npy_intp * (*)(NpyIter *)) \ PyArray_API[232]) #define NpyIter_GetInnerLoopSizePtr \ (*(npy_intp * (*)(NpyIter *)) \ PyArray_API[233]) #define NpyIter_Reset \ (*(int (*)(NpyIter *, char **)) \ PyArray_API[234]) #define NpyIter_ResetBasePointers \ (*(int (*)(NpyIter *, char **, char **)) \ PyArray_API[235]) #define NpyIter_ResetToIterIndexRange \ (*(int (*)(NpyIter *, npy_intp, npy_intp, char **)) \ PyArray_API[236]) #define NpyIter_GetNDim \ (*(int (*)(NpyIter *)) \ PyArray_API[237]) #define NpyIter_GetNOp \ (*(int (*)(NpyIter *)) \ PyArray_API[238]) #define NpyIter_GetIterNext \ (*(NpyIter_IterNextFunc * (*)(NpyIter *, char **)) \ PyArray_API[239]) #define NpyIter_GetIterSize \ (*(npy_intp (*)(NpyIter *)) \ PyArray_API[240]) #define NpyIter_GetIterIndexRange \ (*(void (*)(NpyIter *, npy_intp *, npy_intp *)) \ PyArray_API[241]) #define NpyIter_GetIterIndex \ (*(npy_intp (*)(NpyIter *)) \ PyArray_API[242]) #define NpyIter_GotoIterIndex \ (*(int (*)(NpyIter *, npy_intp)) \ PyArray_API[243]) #define NpyIter_HasMultiIndex \ (*(npy_bool (*)(NpyIter *)) \ PyArray_API[244]) #define NpyIter_GetShape \ (*(int (*)(NpyIter *, npy_intp *)) \ PyArray_API[245]) #define NpyIter_GetGetMultiIndex \ (*(NpyIter_GetMultiIndexFunc * (*)(NpyIter *, char **)) \ PyArray_API[246]) #define NpyIter_GotoMultiIndex \ (*(int (*)(NpyIter *, npy_intp *)) \ PyArray_API[247]) #define NpyIter_RemoveMultiIndex \ (*(int (*)(NpyIter *)) \ PyArray_API[248]) #define NpyIter_HasIndex \ (*(npy_bool (*)(NpyIter *)) \ PyArray_API[249]) #define NpyIter_IsBuffered \ (*(npy_bool (*)(NpyIter *)) \ PyArray_API[250]) #define NpyIter_IsGrowInner \ (*(npy_bool (*)(NpyIter *)) \ PyArray_API[251]) #define NpyIter_GetBufferSize \ (*(npy_intp (*)(NpyIter *)) \ PyArray_API[252]) #define NpyIter_GetIndexPtr \ (*(npy_intp * (*)(NpyIter *)) \ PyArray_API[253]) #define NpyIter_GotoIndex \ (*(int (*)(NpyIter *, npy_intp)) \ PyArray_API[254]) #define NpyIter_GetDataPtrArray \ (*(char ** (*)(NpyIter *)) \ PyArray_API[255]) #define NpyIter_GetDescrArray \ (*(PyArray_Descr ** (*)(NpyIter *)) \ PyArray_API[256]) #define NpyIter_GetOperandArray \ (*(PyArrayObject ** (*)(NpyIter *)) \ PyArray_API[257]) #define NpyIter_GetIterView \ (*(PyArrayObject * (*)(NpyIter *, npy_intp)) \ PyArray_API[258]) #define NpyIter_GetReadFlags \ (*(void (*)(NpyIter *, char *)) \ PyArray_API[259]) #define NpyIter_GetWriteFlags \ (*(void (*)(NpyIter *, char *)) \ PyArray_API[260]) #define NpyIter_DebugPrint \ (*(void (*)(NpyIter *)) \ PyArray_API[261]) #define NpyIter_IterationNeedsAPI \ (*(npy_bool (*)(NpyIter *)) \ PyArray_API[262]) #define NpyIter_GetInnerFixedStrideArray \ (*(void (*)(NpyIter *, npy_intp *)) \ PyArray_API[263]) #define NpyIter_RemoveAxis \ (*(int (*)(NpyIter *, int)) \ PyArray_API[264]) #define NpyIter_GetAxisStrideArray \ (*(npy_intp * (*)(NpyIter *, int)) \ PyArray_API[265]) #define NpyIter_RequiresBuffering \ (*(npy_bool (*)(NpyIter *)) \ PyArray_API[266]) #define NpyIter_GetInitialDataPtrArray \ (*(char ** (*)(NpyIter *)) \ PyArray_API[267]) #define NpyIter_CreateCompatibleStrides \ (*(int (*)(NpyIter *, npy_intp, npy_intp *)) \ PyArray_API[268]) #define PyArray_CastingConverter \ (*(int (*)(PyObject *, NPY_CASTING *)) \ PyArray_API[269]) #define PyArray_CountNonzero \ (*(npy_intp (*)(PyArrayObject *)) \ PyArray_API[270]) #define PyArray_PromoteTypes \ (*(PyArray_Descr * (*)(PyArray_Descr *, PyArray_Descr *)) \ PyArray_API[271]) #define PyArray_MinScalarType \ (*(PyArray_Descr * (*)(PyArrayObject *)) \ PyArray_API[272]) #define PyArray_ResultType \ (*(PyArray_Descr * (*)(npy_intp, PyArrayObject **, npy_intp, PyArray_Descr **)) \ PyArray_API[273]) #define PyArray_CanCastArrayTo \ (*(npy_bool (*)(PyArrayObject *, PyArray_Descr *, NPY_CASTING)) \ PyArray_API[274]) #define PyArray_CanCastTypeTo \ (*(npy_bool (*)(PyArray_Descr *, PyArray_Descr *, NPY_CASTING)) \ PyArray_API[275]) #define PyArray_EinsteinSum \ (*(PyArrayObject * (*)(char *, npy_intp, PyArrayObject **, PyArray_Descr *, NPY_ORDER, NPY_CASTING, PyArrayObject *)) \ PyArray_API[276]) #define PyArray_NewLikeArray \ (*(PyObject * (*)(PyArrayObject *, NPY_ORDER, PyArray_Descr *, int)) \ PyArray_API[277]) #define PyArray_GetArrayParamsFromObject \ (*(int (*)(PyObject *, PyArray_Descr *, npy_bool, PyArray_Descr **, int *, npy_intp *, PyArrayObject **, PyObject *)) \ PyArray_API[278]) #define PyArray_ConvertClipmodeSequence \ (*(int (*)(PyObject *, NPY_CLIPMODE *, int)) \ PyArray_API[279]) #define PyArray_MatrixProduct2 \ (*(PyObject * (*)(PyObject *, PyObject *, PyArrayObject*)) \ PyArray_API[280]) #define NpyIter_IsFirstVisit \ (*(npy_bool (*)(NpyIter *, int)) \ PyArray_API[281]) #define PyArray_SetBaseObject \ (*(int (*)(PyArrayObject *, PyObject *)) \ PyArray_API[282]) #define PyArray_CreateSortedStridePerm \ (*(void (*)(int, npy_intp *, npy_stride_sort_item *)) \ PyArray_API[283]) #define PyArray_RemoveAxesInPlace \ (*(void (*)(PyArrayObject *, npy_bool *)) \ PyArray_API[284]) #define PyArray_DebugPrint \ (*(void (*)(PyArrayObject *)) \ PyArray_API[285]) #define PyArray_FailUnlessWriteable \ (*(int (*)(PyArrayObject *, const char *)) \ PyArray_API[286]) #define PyArray_SetUpdateIfCopyBase \ (*(int (*)(PyArrayObject *, PyArrayObject *)) \ PyArray_API[287]) #define PyDataMem_NEW \ (*(void * (*)(size_t)) \ PyArray_API[288]) #define PyDataMem_FREE \ (*(void (*)(void *)) \ PyArray_API[289]) #define PyDataMem_RENEW \ (*(void * (*)(void *, size_t)) \ PyArray_API[290]) #define PyDataMem_SetEventHook \ (*(PyDataMem_EventHookFunc * (*)(PyDataMem_EventHookFunc *, void *, void **)) \ PyArray_API[291]) #define NPY_DEFAULT_ASSIGN_CASTING (*(NPY_CASTING *)PyArray_API[292]) #define PyArray_MapIterSwapAxes \ (*(void (*)(PyArrayMapIterObject *, PyArrayObject **, int)) \ PyArray_API[293]) #define PyArray_MapIterArray \ (*(PyObject * (*)(PyArrayObject *, PyObject *)) \ PyArray_API[294]) #define PyArray_MapIterNext \ (*(void (*)(PyArrayMapIterObject *)) \ PyArray_API[295]) #define PyArray_Partition \ (*(int (*)(PyArrayObject *, PyArrayObject *, int, NPY_SELECTKIND)) \ PyArray_API[296]) #define PyArray_ArgPartition \ (*(PyObject * (*)(PyArrayObject *, PyArrayObject *, int, NPY_SELECTKIND)) \ PyArray_API[297]) #define PyArray_SelectkindConverter \ (*(int (*)(PyObject *, NPY_SELECTKIND *)) \ PyArray_API[298]) #define PyDataMem_NEW_ZEROED \ (*(void * (*)(size_t, size_t)) \ PyArray_API[299]) #define PyArray_CheckAnyScalarExact \ (*(int (*)(PyObject *)) \ PyArray_API[300]) #define PyArray_MapIterArrayCopyIfOverlap \ (*(PyObject * (*)(PyArrayObject *, PyObject *, int, PyArrayObject *)) \ PyArray_API[301]) #define PyArray_ResolveWritebackIfCopy \ (*(int (*)(PyArrayObject *)) \ PyArray_API[302]) #define PyArray_SetWritebackIfCopyBase \ (*(int (*)(PyArrayObject *, PyArrayObject *)) \ PyArray_API[303]) #if !defined(NO_IMPORT_ARRAY) && !defined(NO_IMPORT) static int _import_array(void) { int st; PyObject *numpy = PyImport_ImportModule("numpy.core.multiarray"); PyObject *c_api = NULL; if (numpy == NULL) { PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); return -1; } c_api = PyObject_GetAttrString(numpy, "_ARRAY_API"); Py_DECREF(numpy); if (c_api == NULL) { PyErr_SetString(PyExc_AttributeError, "_ARRAY_API not found"); return -1; } #if PY_VERSION_HEX >= 0x03000000 if (!PyCapsule_CheckExact(c_api)) { PyErr_SetString(PyExc_RuntimeError, "_ARRAY_API is not PyCapsule object"); Py_DECREF(c_api); return -1; } PyArray_API = (void **)PyCapsule_GetPointer(c_api, NULL); #else if (!PyCObject_Check(c_api)) { PyErr_SetString(PyExc_RuntimeError, "_ARRAY_API is not PyCObject object"); Py_DECREF(c_api); return -1; } PyArray_API = (void **)PyCObject_AsVoidPtr(c_api); #endif Py_DECREF(c_api); if (PyArray_API == NULL) { PyErr_SetString(PyExc_RuntimeError, "_ARRAY_API is NULL pointer"); return -1; } /* Perform runtime check of C API version */ if (NPY_VERSION != PyArray_GetNDArrayCVersion()) { PyErr_Format(PyExc_RuntimeError, "module compiled against "\ "ABI version 0x%x but this version of numpy is 0x%x", \ (int) NPY_VERSION, (int) PyArray_GetNDArrayCVersion()); return -1; } if (NPY_FEATURE_VERSION > PyArray_GetNDArrayCFeatureVersion()) { PyErr_Format(PyExc_RuntimeError, "module compiled against "\ "API version 0x%x but this version of numpy is 0x%x", \ (int) NPY_FEATURE_VERSION, (int) PyArray_GetNDArrayCFeatureVersion()); return -1; } /* * Perform runtime check of endianness and check it matches the one set by * the headers (npy_endian.h) as a safeguard */ st = PyArray_GetEndianness(); if (st == NPY_CPU_UNKNOWN_ENDIAN) { PyErr_Format(PyExc_RuntimeError, "FATAL: module compiled as unknown endian"); return -1; } #if NPY_BYTE_ORDER == NPY_BIG_ENDIAN if (st != NPY_CPU_BIG) { PyErr_Format(PyExc_RuntimeError, "FATAL: module compiled as "\ "big endian, but detected different endianness at runtime"); return -1; } #elif NPY_BYTE_ORDER == NPY_LITTLE_ENDIAN if (st != NPY_CPU_LITTLE) { PyErr_Format(PyExc_RuntimeError, "FATAL: module compiled as "\ "little endian, but detected different endianness at runtime"); return -1; } #endif return 0; } #if PY_VERSION_HEX >= 0x03000000 #define NUMPY_IMPORT_ARRAY_RETVAL NULL #else #define NUMPY_IMPORT_ARRAY_RETVAL #endif #define import_array() {if (_import_array() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); return NUMPY_IMPORT_ARRAY_RETVAL; } } #define import_array1(ret) {if (_import_array() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); return ret; } } #define import_array2(msg, ret) {if (_import_array() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, msg); return ret; } } #endif #endif
61,035
38.226221
180
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/core/include/numpy/__ufunc_api.h
#ifdef _UMATHMODULE extern NPY_NO_EXPORT PyTypeObject PyUFunc_Type; extern NPY_NO_EXPORT PyTypeObject PyUFunc_Type; NPY_NO_EXPORT PyObject * PyUFunc_FromFuncAndData \ (PyUFuncGenericFunction *, void **, char *, int, int, int, int, const char *, const char *, int); NPY_NO_EXPORT int PyUFunc_RegisterLoopForType \ (PyUFuncObject *, int, PyUFuncGenericFunction, int *, void *); NPY_NO_EXPORT int PyUFunc_GenericFunction \ (PyUFuncObject *, PyObject *, PyObject *, PyArrayObject **); NPY_NO_EXPORT void PyUFunc_f_f_As_d_d \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_d_d \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_f_f \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_g_g \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_F_F_As_D_D \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_F_F \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_D_D \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_G_G \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_O_O \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_ff_f_As_dd_d \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_ff_f \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_dd_d \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_gg_g \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_FF_F_As_DD_D \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_DD_D \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_FF_F \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_GG_G \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_OO_O \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_O_O_method \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_OO_O_method \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_On_Om \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT int PyUFunc_GetPyValues \ (char *, int *, int *, PyObject **); NPY_NO_EXPORT int PyUFunc_checkfperr \ (int, PyObject *, int *); NPY_NO_EXPORT void PyUFunc_clearfperr \ (void); NPY_NO_EXPORT int PyUFunc_getfperr \ (void); NPY_NO_EXPORT int PyUFunc_handlefperr \ (int, PyObject *, int, int *); NPY_NO_EXPORT int PyUFunc_ReplaceLoopBySignature \ (PyUFuncObject *, PyUFuncGenericFunction, int *, PyUFuncGenericFunction *); NPY_NO_EXPORT PyObject * PyUFunc_FromFuncAndDataAndSignature \ (PyUFuncGenericFunction *, void **, char *, int, int, int, int, const char *, const char *, int, const char *); NPY_NO_EXPORT int PyUFunc_SetUsesArraysAsData \ (void **, size_t); NPY_NO_EXPORT void PyUFunc_e_e \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_e_e_As_f_f \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_e_e_As_d_d \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_ee_e \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_ee_e_As_ff_f \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT void PyUFunc_ee_e_As_dd_d \ (char **, npy_intp *, npy_intp *, void *); NPY_NO_EXPORT int PyUFunc_DefaultTypeResolver \ (PyUFuncObject *, NPY_CASTING, PyArrayObject **, PyObject *, PyArray_Descr **); NPY_NO_EXPORT int PyUFunc_ValidateCasting \ (PyUFuncObject *, NPY_CASTING, PyArrayObject **, PyArray_Descr **); NPY_NO_EXPORT int PyUFunc_RegisterLoopForDescr \ (PyUFuncObject *, PyArray_Descr *, PyUFuncGenericFunction, PyArray_Descr **, void *); #else #if defined(PY_UFUNC_UNIQUE_SYMBOL) #define PyUFunc_API PY_UFUNC_UNIQUE_SYMBOL #endif #if defined(NO_IMPORT) || defined(NO_IMPORT_UFUNC) extern void **PyUFunc_API; #else #if defined(PY_UFUNC_UNIQUE_SYMBOL) void **PyUFunc_API; #else static void **PyUFunc_API=NULL; #endif #endif #define PyUFunc_Type (*(PyTypeObject *)PyUFunc_API[0]) #define PyUFunc_FromFuncAndData \ (*(PyObject * (*)(PyUFuncGenericFunction *, void **, char *, int, int, int, int, const char *, const char *, int)) \ PyUFunc_API[1]) #define PyUFunc_RegisterLoopForType \ (*(int (*)(PyUFuncObject *, int, PyUFuncGenericFunction, int *, void *)) \ PyUFunc_API[2]) #define PyUFunc_GenericFunction \ (*(int (*)(PyUFuncObject *, PyObject *, PyObject *, PyArrayObject **)) \ PyUFunc_API[3]) #define PyUFunc_f_f_As_d_d \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[4]) #define PyUFunc_d_d \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[5]) #define PyUFunc_f_f \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[6]) #define PyUFunc_g_g \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[7]) #define PyUFunc_F_F_As_D_D \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[8]) #define PyUFunc_F_F \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[9]) #define PyUFunc_D_D \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[10]) #define PyUFunc_G_G \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[11]) #define PyUFunc_O_O \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[12]) #define PyUFunc_ff_f_As_dd_d \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[13]) #define PyUFunc_ff_f \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[14]) #define PyUFunc_dd_d \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[15]) #define PyUFunc_gg_g \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[16]) #define PyUFunc_FF_F_As_DD_D \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[17]) #define PyUFunc_DD_D \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[18]) #define PyUFunc_FF_F \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[19]) #define PyUFunc_GG_G \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[20]) #define PyUFunc_OO_O \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[21]) #define PyUFunc_O_O_method \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[22]) #define PyUFunc_OO_O_method \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[23]) #define PyUFunc_On_Om \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[24]) #define PyUFunc_GetPyValues \ (*(int (*)(char *, int *, int *, PyObject **)) \ PyUFunc_API[25]) #define PyUFunc_checkfperr \ (*(int (*)(int, PyObject *, int *)) \ PyUFunc_API[26]) #define PyUFunc_clearfperr \ (*(void (*)(void)) \ PyUFunc_API[27]) #define PyUFunc_getfperr \ (*(int (*)(void)) \ PyUFunc_API[28]) #define PyUFunc_handlefperr \ (*(int (*)(int, PyObject *, int, int *)) \ PyUFunc_API[29]) #define PyUFunc_ReplaceLoopBySignature \ (*(int (*)(PyUFuncObject *, PyUFuncGenericFunction, int *, PyUFuncGenericFunction *)) \ PyUFunc_API[30]) #define PyUFunc_FromFuncAndDataAndSignature \ (*(PyObject * (*)(PyUFuncGenericFunction *, void **, char *, int, int, int, int, const char *, const char *, int, const char *)) \ PyUFunc_API[31]) #define PyUFunc_SetUsesArraysAsData \ (*(int (*)(void **, size_t)) \ PyUFunc_API[32]) #define PyUFunc_e_e \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[33]) #define PyUFunc_e_e_As_f_f \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[34]) #define PyUFunc_e_e_As_d_d \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[35]) #define PyUFunc_ee_e \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[36]) #define PyUFunc_ee_e_As_ff_f \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[37]) #define PyUFunc_ee_e_As_dd_d \ (*(void (*)(char **, npy_intp *, npy_intp *, void *)) \ PyUFunc_API[38]) #define PyUFunc_DefaultTypeResolver \ (*(int (*)(PyUFuncObject *, NPY_CASTING, PyArrayObject **, PyObject *, PyArray_Descr **)) \ PyUFunc_API[39]) #define PyUFunc_ValidateCasting \ (*(int (*)(PyUFuncObject *, NPY_CASTING, PyArrayObject **, PyArray_Descr **)) \ PyUFunc_API[40]) #define PyUFunc_RegisterLoopForDescr \ (*(int (*)(PyUFuncObject *, PyArray_Descr *, PyUFuncGenericFunction, PyArray_Descr **, void *)) \ PyUFunc_API[41]) static NPY_INLINE int _import_umath(void) { PyObject *numpy = PyImport_ImportModule("numpy.core.umath"); PyObject *c_api = NULL; if (numpy == NULL) { PyErr_SetString(PyExc_ImportError, "numpy.core.umath failed to import"); return -1; } c_api = PyObject_GetAttrString(numpy, "_UFUNC_API"); Py_DECREF(numpy); if (c_api == NULL) { PyErr_SetString(PyExc_AttributeError, "_UFUNC_API not found"); return -1; } #if PY_VERSION_HEX >= 0x03000000 if (!PyCapsule_CheckExact(c_api)) { PyErr_SetString(PyExc_RuntimeError, "_UFUNC_API is not PyCapsule object"); Py_DECREF(c_api); return -1; } PyUFunc_API = (void **)PyCapsule_GetPointer(c_api, NULL); #else if (!PyCObject_Check(c_api)) { PyErr_SetString(PyExc_RuntimeError, "_UFUNC_API is not PyCObject object"); Py_DECREF(c_api); return -1; } PyUFunc_API = (void **)PyCObject_AsVoidPtr(c_api); #endif Py_DECREF(c_api); if (PyUFunc_API == NULL) { PyErr_SetString(PyExc_RuntimeError, "_UFUNC_API is NULL pointer"); return -1; } return 0; } #if PY_VERSION_HEX >= 0x03000000 #define NUMPY_IMPORT_UMATH_RETVAL NULL #else #define NUMPY_IMPORT_UMATH_RETVAL #endif #define import_umath() \ do {\ UFUNC_NOFPE\ if (_import_umath() < 0) {\ PyErr_Print();\ PyErr_SetString(PyExc_ImportError,\ "numpy.core.umath failed to import");\ return NUMPY_IMPORT_UMATH_RETVAL;\ }\ } while(0) #define import_umath1(ret) \ do {\ UFUNC_NOFPE\ if (_import_umath() < 0) {\ PyErr_Print();\ PyErr_SetString(PyExc_ImportError,\ "numpy.core.umath failed to import");\ return ret;\ }\ } while(0) #define import_umath2(ret, msg) \ do {\ UFUNC_NOFPE\ if (_import_umath() < 0) {\ PyErr_Print();\ PyErr_SetString(PyExc_ImportError, msg);\ return ret;\ }\ } while(0) #define import_ufunc() \ do {\ UFUNC_NOFPE\ if (_import_umath() < 0) {\ PyErr_Print();\ PyErr_SetString(PyExc_ImportError,\ "numpy.core.umath failed to import");\ }\ } while(0) #endif
11,657
35.317757
138
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/numpy/f2py/src/fortranobject.h
#ifndef Py_FORTRANOBJECT_H #define Py_FORTRANOBJECT_H #ifdef __cplusplus extern "C" { #endif #include "Python.h" #ifdef FORTRANOBJECT_C #define NO_IMPORT_ARRAY #endif #define PY_ARRAY_UNIQUE_SYMBOL _npy_f2py_ARRAY_API #include "numpy/arrayobject.h" /* * Python 3 support macros */ #if PY_VERSION_HEX >= 0x03000000 #define PyString_Check PyBytes_Check #define PyString_GET_SIZE PyBytes_GET_SIZE #define PyString_AS_STRING PyBytes_AS_STRING #define PyString_FromString PyBytes_FromString #define PyUString_FromStringAndSize PyUnicode_FromStringAndSize #define PyString_ConcatAndDel PyBytes_ConcatAndDel #define PyString_AsString PyBytes_AsString #define PyInt_Check PyLong_Check #define PyInt_FromLong PyLong_FromLong #define PyInt_AS_LONG PyLong_AsLong #define PyInt_AsLong PyLong_AsLong #define PyNumber_Int PyNumber_Long #else #define PyUString_FromStringAndSize PyString_FromStringAndSize #endif #ifdef F2PY_REPORT_ATEXIT #include <sys/timeb.h> extern void f2py_start_clock(void); extern void f2py_stop_clock(void); extern void f2py_start_call_clock(void); extern void f2py_stop_call_clock(void); extern void f2py_cb_start_clock(void); extern void f2py_cb_stop_clock(void); extern void f2py_cb_start_call_clock(void); extern void f2py_cb_stop_call_clock(void); extern void f2py_report_on_exit(int,void*); #endif #ifdef DMALLOC #include "dmalloc.h" #endif /* Fortran object interface */ /* 123456789-123456789-123456789-123456789-123456789-123456789-123456789-12 PyFortranObject represents various Fortran objects: Fortran (module) routines, COMMON blocks, module data. Author: Pearu Peterson <[email protected]> */ #define F2PY_MAX_DIMS 40 typedef void (*f2py_set_data_func)(char*,npy_intp*); typedef void (*f2py_void_func)(void); typedef void (*f2py_init_func)(int*,npy_intp*,f2py_set_data_func,int*); /*typedef void* (*f2py_c_func)(void*,...);*/ typedef void *(*f2pycfunc)(void); typedef struct { char *name; /* attribute (array||routine) name */ int rank; /* array rank, 0 for scalar, max is F2PY_MAX_DIMS, || rank=-1 for Fortran routine */ struct {npy_intp d[F2PY_MAX_DIMS];} dims; /* dimensions of the array, || not used */ int type; /* PyArray_<type> || not used */ char *data; /* pointer to array || Fortran routine */ f2py_init_func func; /* initialization function for allocatable arrays: func(&rank,dims,set_ptr_func,name,len(name)) || C/API wrapper for Fortran routine */ char *doc; /* documentation string; only recommended for routines. */ } FortranDataDef; typedef struct { PyObject_HEAD int len; /* Number of attributes */ FortranDataDef *defs; /* An array of FortranDataDef's */ PyObject *dict; /* Fortran object attribute dictionary */ } PyFortranObject; #define PyFortran_Check(op) (Py_TYPE(op) == &PyFortran_Type) #define PyFortran_Check1(op) (0==strcmp(Py_TYPE(op)->tp_name,"fortran")) extern PyTypeObject PyFortran_Type; extern int F2PyDict_SetItemString(PyObject* dict, char *name, PyObject *obj); extern PyObject * PyFortranObject_New(FortranDataDef* defs, f2py_void_func init); extern PyObject * PyFortranObject_NewAsAttr(FortranDataDef* defs); #if PY_VERSION_HEX >= 0x03000000 PyObject * F2PyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *)); void * F2PyCapsule_AsVoidPtr(PyObject *obj); int F2PyCapsule_Check(PyObject *ptr); #else PyObject * F2PyCapsule_FromVoidPtr(void *ptr, void (*dtor)(void *)); void * F2PyCapsule_AsVoidPtr(PyObject *ptr); int F2PyCapsule_Check(PyObject *ptr); #endif #define ISCONTIGUOUS(m) (PyArray_FLAGS(m) & NPY_ARRAY_C_CONTIGUOUS) #define F2PY_INTENT_IN 1 #define F2PY_INTENT_INOUT 2 #define F2PY_INTENT_OUT 4 #define F2PY_INTENT_HIDE 8 #define F2PY_INTENT_CACHE 16 #define F2PY_INTENT_COPY 32 #define F2PY_INTENT_C 64 #define F2PY_OPTIONAL 128 #define F2PY_INTENT_INPLACE 256 #define F2PY_INTENT_ALIGNED4 512 #define F2PY_INTENT_ALIGNED8 1024 #define F2PY_INTENT_ALIGNED16 2048 #define ARRAY_ISALIGNED(ARR, SIZE) ((size_t)(PyArray_DATA(ARR)) % (SIZE) == 0) #define F2PY_ALIGN4(intent) (intent & F2PY_INTENT_ALIGNED4) #define F2PY_ALIGN8(intent) (intent & F2PY_INTENT_ALIGNED8) #define F2PY_ALIGN16(intent) (intent & F2PY_INTENT_ALIGNED16) #define F2PY_GET_ALIGNMENT(intent) \ (F2PY_ALIGN4(intent) ? 4 : \ (F2PY_ALIGN8(intent) ? 8 : \ (F2PY_ALIGN16(intent) ? 16 : 1) )) #define F2PY_CHECK_ALIGNMENT(arr, intent) ARRAY_ISALIGNED(arr, F2PY_GET_ALIGNMENT(intent)) extern PyArrayObject* array_from_pyobj(const int type_num, npy_intp *dims, const int rank, const int intent, PyObject *obj); extern int copy_ND_array(const PyArrayObject *in, PyArrayObject *out); #ifdef DEBUG_COPY_ND_ARRAY extern void dump_attrs(const PyArrayObject* arr); #endif #ifdef __cplusplus } #endif #endif /* !Py_FORTRANOBJECT_H */
4,931
29.257669
90
h
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/matplotlib/backends/web_backend/ipython_inline_figure.html
<!-- Within the kernel, we don't know the address of the matplotlib websocket server, so we have to get in client-side and fetch our resources that way. --> <script> // We can't proceed until these Javascript files are fetched, so // we fetch them synchronously $.ajaxSetup({async: false}); $.getScript("http://" + window.location.hostname + ":{{ port }}{{prefix}}/_static/js/mpl_tornado.js"); $.getScript("http://" + window.location.hostname + ":{{ port }}{{prefix}}/js/mpl.js"); $.ajaxSetup({async: true}); function init_figure{{ fig_id }}(e) { $('div.output').off('resize'); var output_div = $(e.target).find('div.output_subarea'); var websocket_type = mpl.get_websocket_type(); var websocket = new websocket_type( "ws://" + window.location.hostname + ":{{ port }}{{ prefix}}/" + {{ repr(str(fig_id)) }} + "/ws"); var fig = new mpl.figure( {{repr(str(fig_id))}}, websocket, mpl_ondownload, output_div); // Fetch the first image fig.context.drawImage(fig.imageObj, 0, 0); fig.focus_on_mouseover = true; } // We can't initialize the figure contents until our content // has been added to the DOM. This is a bit of hack to get an // event for that. $('div.output').resize(init_figure{{ fig_id }}); </script>
1,305
36.314286
104
html
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/matplotlib/backends/web_backend/single_figure.html
<html> <head> <link rel="stylesheet" href="{{ prefix }}/_static/css/page.css" type="text/css"> <link rel="stylesheet" href="{{ prefix }}/_static/css/boilerplate.css" type="text/css" /> <link rel="stylesheet" href="{{ prefix }}/_static/css/fbm.css" type="text/css" /> <link rel="stylesheet" href="{{ prefix }}/_static/jquery/css/themes/base/jquery-ui.min.css" > <script src="{{ prefix }}/_static/jquery/js/jquery-1.11.3.min.js"></script> <script src="{{ prefix }}/_static/jquery/js/jquery-ui.min.js"></script> <script src="{{ prefix }}/_static/js/mpl_tornado.js"></script> <script src="{{ prefix }}/js/mpl.js"></script> <script> $(document).ready( function() { var websocket_type = mpl.get_websocket_type(); var websocket = new websocket_type( "{{ ws_uri }}" + {{ repr(str(fig_id)) }} + "/ws"); var fig = new mpl.figure( {{repr(str(fig_id))}}, websocket, mpl_ondownload, $('div#figure')); } ); </script> <title>matplotlib</title> </head> <body> <div id="mpl-warnings" class="mpl-warnings"></div> <div id="figure" style="margin: 10px 10px;"></div> </body> </html>
1,203
37.83871
97
html
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_headless-player/bandits/venv/lib/python3.6/site-packages/matplotlib/backends/web_backend/all_figures.html
<html> <head> <link rel="stylesheet" href="{{ prefix }}/_static/css/page.css" type="text/css"> <link rel="stylesheet" href="{{ prefix }}/_static/css/boilerplate.css" type="text/css" /> <link rel="stylesheet" href="{{ prefix }}/_static/css/fbm.css" type="text/css" /> <link rel="stylesheet" href="{{ prefix }}/_static/jquery/css/themes/base/jquery-ui.min.css" > <script src="{{ prefix }}/_static/jquery/js/jquery-1.11.3.min.js"></script> <script src="{{ prefix }}/_static/jquery/js/jquery-ui.min.js"></script> <script src="{{ prefix }}/_static/js/mpl_tornado.js"></script> <script src="{{ prefix }}/js/mpl.js"></script> <script> {% for (fig_id, fig_manager) in figures %} $(document).ready( function() { var main_div = $('div#figures'); var figure_div = $('<div id="figure-div"/>') main_div.append(figure_div); var websocket_type = mpl.get_websocket_type(); var websocket = new websocket_type( "{{ ws_uri }}" + "{{ fig_id }}" + "/ws"); var fig = new mpl.figure( "{{ fig_id }}", websocket, mpl_ondownload, figure_div); fig.focus_on_mouseover = true; $(fig.canvas).attr('tabindex', {{ fig_id }}); } ); {% end %} </script> <title>MPL | WebAgg current figures</title> </head> <body> <div id="mpl-warnings" class="mpl-warnings"></div> <div id="figures" style="margin: 10px 10px;"></div> </body> </html>
1,512
33.386364
97
html
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_repo/copy_files_to_ndnfs.sh
#!/bin/bash # location of ndnfs directory="/ndnfs-port/build" mkdir /tmp/ndnfs mkdir /tmp/dir nohup $directory/ndnfs /tmp/dir /tmp/ndnfs -o nonempty -o log=$NDNFS_LOG -o db=/tmp/ndnfs.db > $NDNFS_LOG 2> $NDNFS_LOG < /dev/null & #I don't know why i need to pass "-o nonempty" :-/ nohup $directory/ndnfs-server -p /ndn/broadcast/ndnfs -l $NDNFS_SERVER_LOG -f /tmp/ndnfs -d /tmp/ndnfs.db > $NDNFS_SERVER_LOG 2> $NDNFS_SERVER_LOG < /dev/null & sleep 5 echo "Uploading files ..." cp -avr --no-preserve=mode,ownership $VIDEOS_FOLDER /tmp/ndnfs echo "done."
560
28.526316
161
sh
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_repo/ndn-entrypoint.sh
#!/bin/bash while getopts ":s:v:r:t:c:" opt; do case ${opt} in s ) SEGMENTS=$OPTARG ;; t ) TYPE=$OPTARG ;; v ) VIDEOS_FOLDER=$OPTARG ;; r ) REPO_NG_OPTIONS=$OPTARG ;; c ) CACHESIZE=$OPTARG ;; \? ) echo "Invalid option: $OPTARG" 1>&2 ;; : ) echo "Invalid option: $OPTARG requires an argument" 1>&2 ;; esac done shift $((OPTIND -1)) export NFD_LOG="/var/log/nfd.out" export NFD_ERROR_LOG="/var/log/nfd-error.out" export NDN_COPY_LOG="/var/log/copy-repo.log" export NDN_COPY_ERROR="/var/log/copy-repo-error.log" export NDNFS_LOG="/var/log/ndnfs.log" export NDNFS_SERVER_LOG="/var/log/ndnfs-server.log" export REPO_NG_LOG="/var/log/repong.log" export REPONG_ERROR_LOG="/var/log/repong-error.log" SEGMENTS="${SEGMENTS:-300}" VIDEOS_FOLDER="${VIDEOS_FOLDER:-"/videos"}" REPO_NG_OPTIONS="${REPO_NG_OPTIONS:-" -v -D -u "}" CACHESIZE="${CACHESIZE:-"30000"}" export SEGMENTS=$SEGMENTS export VIDEOS_FOLDER=$VIDEOS_FOLDER export REPO_NG_OPTIONS=$REPO_NG_OPTIONS #Setting cache size sed -i "s/cs_max_packets 1000/cs_max_packets ${CACHESIZE}/" /usr/local/etc/ndn/nfd.conf echo $SEGMENTS $VIDEOS_FOLDER $REPO_NG_OPTIONS $CACHESIZE pkill nfd pkill ndn-repo-ng rm ${NFD_LOG} ${NFD_ERROR_LOG} ${NDN_COPY_LOG} ${NDN_COPY_ERROR} ${NDNFS_LOG} ${NDNFS_ERROR_LOG} ${REPO_NG_LOG} ${REPONG_ERROR_LOG} echo "Starting NFD - Named Data Networking Forwarding Daemon" echo "Copying NFD config" #cp ./nfd.conf /usr/local/etc/ndn/nfd.conf setcap cap_net_raw=eip /usr/local/bin/nfd setcap cap_net_raw,cap_net_admin=eip /usr/local/bin/nfd nohup nfd-start > ${NFD_LOG} 2> ${NFD_ERROR_LOG} < /dev/null & echo "Waiting for NFD to Start" sleep 5 if [ "$TYPE" == "ndnfs" ] then echo "Copy Files to NDNFS" nohup ./copy_files_to_ndnfs.sh > ${NDN_COPY_LOG} 2> ${NDN_COPY_ERROR} < /dev/null & tail -f ${NFD_LOG} ${NFD_ERROR_LOG} ${NDN_COPY_LOG} ${NDNFS_LOG} ${NDNFS_SERVER_LOG} fi if [ "$TYPE" == "repong-bbb" ] then echo "Copy Files to Repo-NG with BBB Dataset" nohup ./copy_bbb_repong.sh > ${NDN_COPY_LOG} 2> ${NDN_COPY_ERROR} < /dev/null & tail -f ${NFD_LOG} ${NFD_ERROR_LOG} ${NDN_COPY_LOG} ${REPO_NG_LOG} ${REPONG_ERROR_LOG} fi if [ "$TYPE" == "repong" ] then echo "Copy Files to Repo-NG" nohup ./copy_files_to_repong.sh > ${NDN_COPY_LOG} 2> ${NDN_COPY_ERROR} < /dev/null & tail -f ${NFD_LOG} ${NFD_ERROR_LOG} ${NDN_COPY_LOG} ${REPO_NG_LOG} ${REPONG_ERROR_LOG} fi trap "pkill nfd; pkill ndn-repo-ng; exit" SIGHUP SIGINT SIGTERM
2,547
25.821053
131
sh
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_repo/init_container.sh
#!/bin/bash VIDEO_URL="http://www-itec.uni-klu.ac.at/ftp/datasets/DASHDataset2014/BigBuckBunny/2sec/bunny_2133691bps/" FOLDER_NDN_NAME="bbb-rates-ndn/" FOLDER_TCP_NAME="videos/" RATES="bunny_2500kbit bunny_3000kbit/ bunny_3500kbit/ bunny_4000kbit/ bunny_4500kbit/ bunny_5000kbit/" #SERVER="pirl-ndn-5.cisco.com" SERVER="10.60.17.171" #RATES="bunny_3840360bps/" #################################################### # ADD LOCAL NDN REPOSITORY # # UPDATE ARCHIVE AND INSTALL REQUIRED NDN SOFTWARE # #################################################### install_software() { # While loops are due to failures when creating the base container. echo "deb http://$SERVER/dists trusty/" > /etc/apt/sources.list.d/icn-repo.list echo "# deb-src http://$SERVER/dists trusty/" >> /etc/apt/sources.list.d/icn-repo.list apt-add-repository -y ppa:ubuntu-sdk-team/ppa apt-add-repository -y ppa:canonical-qt5-edgers/qt5-proper apt-get --force-yes -y update && \ apt-get --force-yes -y install build-essential apache2 git libpcap-dev openssh-client openssh-server ifstat sysstat nano psmisc \ ndn-cxx ndn-cxx-dev nfd iperf ndndump ndn-dissect ndnpeek ndnping ndn-tools nfd-autoreg ndn-tlv-ping ndn-pib \ ndn-dissect-wireshark ndn-autoconfig-server cmake iperf3 ndn-virtual-repo ndn-icp-download libndn-icp \ repo-ng vlc-plugin-ndn qtmultimedia5-dev qtbase5-dev libqt5widgets5 libqt5core5a libqt5gui5 libqt5multimedia5 \ libqt5multimediawidgets5 libqt5opengl5 libav-tools libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev \ libavutil-dev libpostproc-dev libswscale-dev libavresample-dev libxml2-dev libcurl4-openssl-dev apt-get clean } ################################################################# # ASYNCHRONOUS DOWNLOAD OF THE VIDEO CHUNKS DURING INSTALLATION # ################################################################# chunk_download() { pushd /tmp wget $SERVER/ndn-dash/bbb-rates-ndn.tar && tar -xf bbb-rates-ndn.tar wget $SERVER/ndn-dash/bbb-rates-tcp.tar && tar -xf bbb-rates-tcp.tar popd } ################################################## # SET PASSWORD AUTHENTICATION FOR SSH CONNECTION # ################################################## set_ssh_password_auth() { sed -i "s/PasswordAuthentication no/PasswordAuthentication yes/" /etc/ssh/sshd_config while [ $? != "0" ] do sed -i "s/PasswordAuthentication no/PasswordAuthentication yes/" /etc/ssh/sshd_config done } ################### # SET DNS SERVERS # ################### set_dns_servers() { echo "nameserver 144.254.71.184" >> /etc/resolvconf/resolv.conf.d/head echo "search cisco.com" >> /etc/resolvconf/resolv.conf.d/head } ############################################## # FILL NDN REPOSITORY WITH DASH VIDEO CHUNKS # ############################################## fill_ndn_repo() { mv /tmp/$FOLDER_TCP_NAME /var/www/html/ pushd /tmp/$FOLDER_NDN_NAME #wget http://$SERVER/ndn-dash/mpd.mpd #wget http://$SERVER/ndn-dash/bbb.mpd #sed -i '0,/prefix .*/ s/prefix .*$/prefix "ndn:\/n"/' /etc/ndn/repo-ng.conf #sed -i 's/max-packets 100000/max-packets 9999999999/' /etc/ndn/repo-ng.conf #service repo-ng stop #service repo-ng start #sleep 20 #ndnputfile -c 1400 -D -u ndn:/localhost/repo-ng ndn:/n/mpd mpd.mpd #ndnputfile -c 1400 -D -u ndn:/localhost/repo-ng ndn:/n/mpd2 bbb.mpd #rm mpd.mpd #rm mpd2.mpd ndn_rate=8 ndn_rates_char=(a b c d e f k l m n o p q) ndnputfile -v -x 3600000 ndn:/localhost/repo-ng ndn:/n/mpd $VIDEOS_FOLDER/bbb/mpd for rate in $RATES do cd $FOLDER_NDN_NAME$rate rm -f robots.txt chunk_number=1 if [ "$ndn_rate" -gt 5 ] then echo "ndnputfile -c 1400 -u -D ndn:/localhost/repo-ng ndn:/n/${ndn_rates_char[$ndn_rate]}/init binit.mp4" ndnputfile -c 1400 -u -D ndn:/localhost/repo-ng ndn:/n/${ndn_rates_char[$ndn_rate]}/init binit.mp4 for chunk in b{1..1270}.m4s do echo "ndnputfile -c 1400 -u -D ndn:/localhost/repo-ng ndn:/n/${ndn_rates_char[$ndn_rate]}/$chunk_number $chunk" ndnputfile -c 1400 -u -D ndn:/localhost/repo-ng ndn:/n/${ndn_rates_char[$ndn_rate]}/$chunk_number $chunk ((chunk_number++)) done else echo "ndnputfile -c 1400 -u -D ndn:/localhost/repo-ng ndn:/n/${ndn_rates_char[$ndn_rate]}/init BigBuckBunny_2s_init.mp4" ndnputfile -c 1400 -u -D ndn:/localhost/repo-ng ndn:/n/${ndn_rates_char[$ndn_rate]}/init BigBuckBunny_2s_init.mp4 echo "ndnputfile -c 1400 -u -D ndn:/localhost/repo-ng ndn:/n/${ndn_rates_char[$ndn_rate]}/noseg BigBuckBunny_2snonSeg.mp4" ndnputfile -c 1400 -u -D ndn:/localhost/repo-ng ndn:/n/${ndn_rates_char[$ndn_rate]}/noseg BigBuckBunny_2snonSeg.mp4 for chunk in BigBuckBunny_2s{1..299}.m4s do echo "ndnputfile -c 1400 -u -D ndn:/localhost/repo-ng ndn:/n/${ndn_rates_char[$ndn_rate]}/$chunk_number $chunk" ndnputfile -c 1400 -u -D ndn:/localhost/repo-ng ndn:/n/${ndn_rates_char[$ndn_rate]}/$chunk_number $chunk ((chunk_number++)) done fi ((ndn_rate++)) done popd } ###################################### # INSTALL LIBDASH AND QTSAMPLEPLAYER # ###################################### install_libdash() { cd /home/ubuntu wget http://$SERVER/ndn-dash/ndn-dash.tar tar -xf ndn-dash.tar && rm ndn-dash.tar cd ndn-dash/libdash && mkdir -p build && cd build/ cmake .. && make cd ../qtsampleplayer/ && mkdir build && cd build/ cmake .. && make cd /home/ubuntu chown -R ubuntu:ubuntu ndn-dash } sleep 5 #chunk_download #install_software #set_ssh_password_auth #set_dns_servers fill_ndn_repo #install_libdash exit 0
5,873
32.758621
133
sh
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_repo/maxinet_installer.sh
#!/bin/bash echo "MaxiNet 1.2 installer" echo "" echo "This program installs MaxiNet 1.2 and all requirements to the home directory of your user" if [ "$1" == "--help" ] || [ "$1" == "-h" ] then echo "" echo "Invoke without any parameter to interactively install MaxiNet and its dependencies." echo "Use the -a parameter for complete and unguided installation." exit 0 fi if [ "$1" == "-a" ] then mininet="y" metis="y" pyro="y" else read -n1 -r -p "Do you want to install MaxiNet with Docker container support? (y/[n])" containernet if [ "$containernet" == "y" ] || [ "$containernet" == "Y" ] then containernet="y" echo "" echo "You choose to install container support. Warning: This will overwrite any existing Mininet installation." else containernet="n" echo "" read -n1 -r -p "Do you want to install Mininet 2.2.1rc1? ([y]/n)" mininet if [ "$mininet" == "" ] || [ "$mininet" == "y" ] || [ "$mininet" == "Y" ] then mininet="y" echo "" echo "You choose to install Mininet. Warning: This will automatically remove existing directories ~/mininet, ~/loxigen, and ~/openflow" else mininet="n" fi echo "" fi read -n1 -r -p "Do you want to install Metis 5.1? ([y]/n)" metis if [ "$metis" == "" ] || [ "$metis" == "y" ] || [ "$metis" == "Y" ] then metis="y" else metis="n" fi echo "" read -n1 -r -p "Do you want to install Pyro 4? ([y]/n)" pyro if [ "$pyro" == "" ] || [ "$pyro" == "y" ] || [ "$pyro" == "Y" ] then pyro="y" else pyro="n" fi echo "" echo "----------------" echo "" echo "MaxiNet installer will now install: " if [ "$mininet" == "y" ]; then echo " -Mininet 2.2.1rc1"; fi if [ "$containernet" == "y" ]; then echo " -Containernet 2.2.1"; fi if [ "$metis" == "y" ]; then echo " -Metis 5.1"; fi if [ "$pyro" == "y" ]; then echo " -Pyro 4"; fi echo " -MaxiNet 1.2" echo "" read -n1 -r -p "Is this OK? Press ANY key to continue or CTRL+C to abort." abort fi echo "installing required dependencies." sudo apt-get install git autoconf screen cmake build-essential sysstat python-matplotlib uuid-runtime if [ "$mininet" == "y" ] then cd ~ sudo rm -rf openflow &> /dev/null sudo rm -rf loxigen &> /dev/null sudo rm -rf pox &> /dev/null sudo rm -rf oftest &> /dev/null sudo rm -rf oflops &> /dev/null sudo rm -rf ryu &> /dev/null sudo rm -rf mininet &> /dev/null git clone git://github.com/mininet/mininet cd mininet git checkout -b 2.2.1rc1 2.2.1rc1 cd util/ ./install.sh # the mininet installer sometimes crashes with a zipimport.ZipImportError. # In that case, we retry installation. if [ "$?" != "0" ] then ./install.sh fi elif [ "$containernet" == "y" ] then sudo apt-get install ansible aptitude # Patch config file if necessary grep "localhost ansible_connection=local" /etc/ansible/hosts >/dev/null if [ $? -ne 0 ]; then echo "localhost ansible_connection=local" | sudo tee -a /etc/ansible/hosts fi cd ~ sudo rm -rf containernet &> /dev/null sudo rm -rf oflops &> /dev/null sudo rm -rf oftest &> /dev/null sudo rm -rf openflow &> /dev/null sudo rm -rf pox &> /dev/null git clone https://github.com/containernet/containernet cd containernet/ansible sudo ansible-playbook install.yml fi if [ "$metis" == "y" ] then cd ~ wget http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz tar -xzf metis-5.1.0.tar.gz rm metis-5.1.0.tar.gz cd metis-5.1.0 make config make sudo make install cd ~ rm -rf metis-5.1.0 fi if [ "$pyro" == "y" ] then sudo apt-get install python-pip sudo pip install Pyro4 fi cd ~ sudo rm -rf MaxiNet &> /dev/null git clone git://github.com/MaxiNet/MaxiNet.git cd MaxiNet git checkout v1.2 sudo make install
3,901
24.337662
145
sh
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_repo/copy_files_to_repong.sh
#!/bin/bash cd $VIDEOS_FOLDER echo "Pushing files to repo_ng" DB="ndn_repo.db" REPONG_DB_PATH="/var/db/ndn-repo-ng/" FILE=${VIDEOS_FOLDER}${DB} rm $FILE echo "Starting Repo-ng" ndn-repo-ng & #redirecting repong output does not work #> ${NDN_REPO_LOG} 2> ${NDN_REPO_ERROR} < /dev/null & echo "Waiting to init DB" sleep 3 # # " Write a file into a repo.\n" # " -u: unversioned: do not add a version component\n" # " -s: single: do not add version or segment component, implies -u\n" # " -D: use DigestSha256 signing method instead of SignatureSha256WithRsa\n" # " -i: specify identity used for signing Data\n" # " -I: specify identity used for signing commands\n" # " -x: FreshnessPeriod in milliseconds\n" # " -l: InterestLifetime in milliseconds for each command\n" # " -w: timeout in milliseconds for whole process (default unlimited)\n" # " -v: be verbose\n" # " repo-prefix: repo command prefix\n" # " ndn-name: NDN Name prefix for written Data\n" # " filename: local file name; \"-\" reads from stdin\n" # ); for fil in $(find . -type f ); do echo ${fil:2} ndnputfile -v -x 3600000 /example/repo/1 /ndn/broadcast/ndnfs/videos/${fil:2}/ /videos/${fil:2} done echo "done."
1,332
36.027778
100
sh
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_repo/clean_all_docker.sh
#/bin/bash docker stop $(docker ps -a -q) docker rm -f $(docker ps -a -q)
73
23.666667
31
sh
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_repo/repo-ng.sh
#!/bin/bash PYTHONIOENCODING="utf-8" echo "Waiting 5 seconds" sleep 5 echo "Starting repo-ng" ndn-repo-ng 2>&1
110
17.5
24
sh
cba-pipeline-public
cba-pipeline-public-master/containernet/ndn-containers/ndn_repo/copy_bbb_repong.sh
#!/bin/bash cd $VIDEOS_FOLDER pkill ndn-repo-ng echo "Pushing files to repo_ng" DB="ndn_repo.db" REPONG_DB_PATH="/var/db/ndn-repo-ng/" FILE=${VIDEOS_FOLDER}${DB} rm $FILE echo "Starting Repo-ng" ndn-repo-ng & #redirecting repong output does not work #> ${NDN_REPO_LOG} 2> ${NDN_REPO_ERROR} < /dev/null & echo "Waiting to init DB" sleep 3 # # " Write a file into a repo.\n" # " -u: unversioned: do not add a version component\n" # " -s: single: do not add version or segment component, implies -u\n" # " -D: use DigestSha256 signing method instead of SignatureSha256WithRsa\n" # " -i: specify identity used for signing Data\n" # " -I: specify identity used for signing commands\n" # " -x: FreshnessPeriod in milliseconds\n" # " -l: InterestLifetime in milliseconds for each command\n" # " -w: timeout in milliseconds for whole process (default unlimited)\n" # " -v: be verbose\n" # " repo-prefix: repo command prefix\n" # " ndn-name: NDN Name prefix for written Data\n" # " filename: local file name; \"-\" reads from stdin\n" # ); RATES="quality1032682bps quality1546902bps quality2133691bps quality3078587bps quality3526922bps" ndn_rate=0 ndn_rates_char=(a b c d e) SEGMENTS="${SEGMENTS:-300}" ndnputfile ${REPO_NG_OPTIONS} ndn:/localhost/repo-ng ndn:/n/mpd $VIDEOS_FOLDER/bbb/mpd #TODO check if -D and -u options are needed (error is can not parse mpd when using it with player) #Allow to set options when starting container for rate in $RATES do #rm -f robots.txt chunk_number=1 echo "${REPO_NG_OPTIONS} ndn:/localhost/repo-ng ndn:/n/${ndn_rates_char[$ndn_rate]}/init $VIDEOS_FOLDER/bbb/$rate/init.mp4" ndnputfile ${REPO_NG_OPTIONS} ndn:/localhost/repo-ng ndn:/n/${ndn_rates_char[$ndn_rate]}/init $VIDEOS_FOLDER/bbb/$rate/init.mp4 for chunk in $(seq -f "seg-%1g.m4s" $SEGMENTS) do sem -j+10 ndnputfile ${REPO_NG_OPTIONS} ndn:/localhost/repo-ng ndn:/n/${ndn_rates_char[$ndn_rate]}/$chunk_number $VIDEOS_FOLDER/bbb/$rate/$chunk #echo "ndnputfile ${REPO_NG_OPTIONS} ndn:/localhost/repo-ng ndn:/n/${ndn_rates_char[$ndn_rate]}/$chunk_number $VIDEOS_FOLDER/bbb/$rate/$chunk" ((chunk_number++)) done sem --wait ((ndn_rate++)) done touch /INITDONE
2,347
40.192982
146
sh