libcm is a C development framework with an emphasis on audio signal processing applications.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cmFrameFile.h 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. //| Copyright: (C) 2009-2020 Kevin Larke <contact AT larke DOT org>
  2. //| License: GNU GPL version 3.0 or above. See the accompanying LICENSE file.
  3. #ifndef cmFrameFile_h
  4. #define cmFrameFile_h
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. //( { file_desc:"File reader and writer for time series data as used by cmFeatFile" kw:[file audio]}
  9. //
  10. // file -> cmFfFile_t frame*
  11. // frame -> cmFfFrame_t mtx*
  12. // mtx -> cmFfMtx_t data*
  13. //
  14. enum
  15. {
  16. kInvalidFrameTId = 0,
  17. kInvalidStreamId = 0,
  18. kTocFrameTId = -3,
  19. kTocStreamId = -3,
  20. kFileFfTId = 'FrmF',
  21. };
  22. enum
  23. {
  24. kOkFfRC = 0, // 0
  25. kFileOpenFailFfRC, // 1
  26. kFileReadFailFfRC, // 2
  27. kFileWriteFailFfRC, // 3
  28. kFileSeekFailFfRC, // 4
  29. kFileCloseFailFfRC, // 5
  30. kEofFfRC, // 6
  31. kInvalidHandleFfRC, // 7
  32. kMemAllocErrFfRC, // 8
  33. kNotFrameFileFfRC, // 9
  34. kUnknownErrFfRC, // 10
  35. kNoMatchingFrameFfRC, // 11
  36. kInvalidFileModeFfRC, // 12
  37. kJsonFailFfRC, // 13
  38. kInvalidFrameIdxFfRC, // 14
  39. kDuplicateMtxIdFfRC, // 15
  40. kFileTellFailFfRC, // 16
  41. kLHeapFailFfRC, // 17
  42. kTocFrameRdFailFfRC, // 18
  43. kTocRecdNotFoundFfRC, // 19
  44. kBufTooSmallFfRC // 20
  45. };
  46. // row data formats
  47. enum
  48. {
  49. kInvalidFmtId, // 0
  50. kUCharFmtId, // 1
  51. kCharFmtId, // 2
  52. kUShortFmtId, // 3
  53. kShortFmtId, // 4
  54. kULongFmtId, // 5
  55. kLongFmtId, // 6
  56. kUIntFmtId, // 7
  57. kIntFmtId, // 8
  58. kLLongFmtId, // 9
  59. kULLongFmtId, // 10
  60. kOff_tFmtId, // 11
  61. kFloatFmtId, // 12
  62. kDoubleFmtId, // 13
  63. kStringZFmtId, // 14
  64. kBlobFmtId, // 15
  65. kJsonFmtId // 16
  66. };
  67. enum
  68. {
  69. kInvalidUId , // 0
  70. kNoUnitsUId, // 1
  71. kHzUId, // 2
  72. kRadsUId, // 3 -pi to pi
  73. kAmplUId, // 4 -1.0 to 1.0
  74. kPowUId, // 5 amp^2/2
  75. k10DbUId, // 6 10*log10(v)
  76. k20DbUId, // 7 20*log10(v)
  77. kCntUId, // 8 count of elements
  78. kIdxUId, // 9 element index
  79. kBfccUId, // 10
  80. kMfccUId, // 11
  81. kCepsUId, // 12
  82. kD1UFl = 0x80000000 // this is a 1st difference
  83. };
  84. enum
  85. {
  86. kTocMId = -2,
  87. kInvalidMId = 0,// 0
  88. kAudioMId, // 1
  89. kMagMId, // 2
  90. kPhsMId, // 3
  91. kFrqMId, // 4 measured bin frequecies in Hz
  92. kTrkMId, // 5
  93. kRmsMId, // 6
  94. kBinCntMId, // 7 count of frequency domain bins in frame
  95. kWndSmpCntMId, // 8 actual count of samples in FFT window (this is no (binCnt-1)*2)
  96. kAudSmpCntMId, // 9 count of audio samples in frame
  97. kBfccMId, // 10 vector of BFCC's
  98. kBfccBandCntMId,// 11 count of coeff's BFCC vector in this frame
  99. kMfccMId, // 12 vector of MFCC's
  100. kCepsMId, // 13 vector of cepstral coefficients
  101. kConstqMId, // 14 vector of constant
  102. kDataMId // 15 blob of misc data
  103. };
  104. typedef cmHandle_t cmFrameFileH_t;
  105. typedef unsigned cmFfRC_t;
  106. // mtx desc record
  107. typedef struct
  108. {
  109. unsigned type;
  110. unsigned fmtId;
  111. unsigned unitsId;
  112. unsigned rowCnt;
  113. unsigned colCnt;
  114. } cmFfMtx_t;
  115. // frame desc record
  116. typedef struct
  117. {
  118. unsigned type;
  119. unsigned mtxCnt;
  120. unsigned flags; // used internally to track time format (seconds or samples)
  121. unsigned streamId;
  122. union
  123. {
  124. unsigned sampleIdx;
  125. double seconds;
  126. } tm;
  127. } cmFfFrame_t;
  128. // file desc record
  129. typedef struct
  130. {
  131. cmChar_t* filenameStr;
  132. unsigned version;
  133. unsigned frameCnt; // count of frames in all streams
  134. double srate; // sample rate for all frames
  135. } cmFfFile_t;
  136. extern cmFrameFileH_t cmFrameFileNullHandle;
  137. cmFfRC_t cmFrameFileCreate( cmFrameFileH_t* hPtr, const char* fn, double srate, cmCtx_t* ctx );
  138. // The fileDescPtrPtr is optional. Set to NULL to ignore.
  139. cmFfRC_t cmFrameFileOpen( cmFrameFileH_t* hPtr, const char* fn, cmCtx_t* ctx, const cmFfFile_t** fileDescPtrPtr );
  140. cmFfRC_t cmFrameFileClose( cmFrameFileH_t* hPtr );
  141. bool cmFrameFileIsValid( cmFrameFileH_t h );
  142. const cmFfFile_t* cmFrameFileDesc( cmFrameFileH_t h );
  143. // Return the count of frames in the requested stream.
  144. unsigned cmFrameFileFrameCount( cmFrameFileH_t h, unsigned streamId );
  145. // Create a frame in a file created via cmFrameFileCreate().
  146. // Set 'sampleIdx' to -1 if seconds is being used instead of samples.
  147. cmFfRC_t cmFrameFileFrameCreate( cmFrameFileH_t h, unsigned frameType, unsigned streamId, unsigned sampleIdx, double secs );
  148. // (W) Complete and write a frame created via an earilier call
  149. // to cmFrameFileFrameCreate()
  150. cmFfRC_t cmFrameFileFrameClose( cmFrameFileH_t h );
  151. // (W) Fill a frame with matrix data. The frame must have been created
  152. // via an earlier call to cmFrameFileCreate().
  153. cmFfRC_t cmFrameFileWriteMtxUChar( cmFrameFileH_t h, unsigned mtxType, unsigned unitsId, const unsigned char* p, unsigned rn, unsigned cn );
  154. cmFfRC_t cmFrameFileWriteMtxChar( cmFrameFileH_t h, unsigned mtxType, unsigned unitsId, const char* p, unsigned rn, unsigned cn );
  155. cmFfRC_t cmFrameFileWriteMtxUShort( cmFrameFileH_t h, unsigned mtxType, unsigned unitsId, const unsigned short* p, unsigned rn, unsigned cn );
  156. cmFfRC_t cmFrameFileWriteMtxShort( cmFrameFileH_t h, unsigned mtxType, unsigned unitsId, const short* p, unsigned rn, unsigned cn );
  157. cmFfRC_t cmFrameFileWriteMtxULong( cmFrameFileH_t h, unsigned mtxType, unsigned unitsId, const unsigned long* p, unsigned rn, unsigned cn );
  158. cmFfRC_t cmFrameFileWriteMtxLong( cmFrameFileH_t h, unsigned mtxType, unsigned unitsId, const long* p, unsigned rn, unsigned cn );
  159. cmFfRC_t cmFrameFileWriteMtxUInt( cmFrameFileH_t h, unsigned mtxType, unsigned unitsId, const unsigned* p, unsigned rn, unsigned cn );
  160. cmFfRC_t cmFrameFileWriteMtxInt( cmFrameFileH_t h, unsigned mtxType, unsigned unitsId, const int* p, unsigned rn, unsigned cn );
  161. cmFfRC_t cmFrameFileWriteMtxULLong( cmFrameFileH_t h, unsigned mtxType, unsigned unitsId, const unsigned long long* p, unsigned rn, unsigned cn );
  162. cmFfRC_t cmFrameFileWriteMtxLLong( cmFrameFileH_t h, unsigned mtxType, unsigned unitsId, const long long* p, unsigned rn, unsigned cn );
  163. cmFfRC_t cmFrameFileWriteMtxOff_t( cmFrameFileH_t h, unsigned mtxType, unsigned unitsId, const off_t* p, unsigned rn, unsigned cn );
  164. cmFfRC_t cmFrameFileWriteMtxFloat( cmFrameFileH_t h, unsigned mtxType, unsigned unitsId, const float* p, unsigned rn, unsigned cn );
  165. cmFfRC_t cmFrameFileWriteMtxDouble( cmFrameFileH_t h, unsigned mtxType, unsigned unitsId, const double* p, unsigned rn, unsigned cn );
  166. cmFfRC_t cmFrameFileWriteMtxBlob( cmFrameFileH_t h, unsigned mtxType, unsigned unitsId, const void* p, unsigned rn, unsigned cn );
  167. cmFfRC_t cmFrameFileWriteMtxStringZ( cmFrameFileH_t h, unsigned mtxType, unsigned unitsId, const char* p );
  168. cmFfRC_t cmFrameFileWriteMtxJson( cmFrameFileH_t h, unsigned mtxType, cmJsonH_t jsH, const cmJsonNode_t* nodePtr );
  169. // (R/W) Rewind to the first frame. Must call cmFrameFileFrameNext()
  170. // following successful execution of this function to maintain correct
  171. // alignment.
  172. cmFfRC_t cmFrameFileRewind( cmFrameFileH_t h );
  173. // (R/W) Seek to the frame at index 'frameIdx'. Must call cmFrameFileFrameNext()
  174. // following successful execution of this function to maintain correct
  175. // alignment.
  176. cmFfRC_t cmFrameFileSeek( cmFrameFileH_t h, unsigned streamId, unsigned frameIdx );
  177. // (R/W) Seek to the next frame in stream frameStreamId with type frameTypeId.
  178. // Set frameTypeId to kInvalidFrameTId to return any frame type.
  179. // Set frameStreamId to kInvalidStreamId to return any stream type.
  180. // This function must be followed by a call to cmFrameFileFrameLoad()
  181. // or cmFrameFileSkip().
  182. cmFfRC_t cmFrameFileFrameNext( cmFrameFileH_t h, unsigned frameTypeId, unsigned streamId );
  183. // (R/W) Load the matrix data associated with the current frame.
  184. // This function can only be called after a successful call to
  185. // cmFrameFileFrameNext().
  186. // The frameDescPtrPtr is optional. Set to NULL to ignore.
  187. cmFfRC_t cmFrameFileFrameLoad( cmFrameFileH_t h, const cmFfFrame_t** frameDescPtrPtr );
  188. // (R/W) Skip over the matrix data associated with the current frame.
  189. // This is an alternative to cmFrameFileLoad().
  190. cmFfRC_t cmFrameFileFrameSkip( cmFrameFileH_t h );
  191. // (R/W) Combines cmFrameFileFrameNext() and cmFrameFileFrameLoad()
  192. // into a single call.
  193. cmFfRC_t cmFrameFileFrameLoadNext( cmFrameFileH_t h, unsigned frameTypeId, unsigned streamId, const cmFfFrame_t** frameDescPtrPtr );
  194. // (R/W) Write the current frame back to disk.
  195. cmFfRC_t cmFrameFileFrameUpdate( cmFrameFileH_t h );
  196. // Return the current frame description record.
  197. const cmFfFrame_t* cmFrameFileFrameDesc( cmFrameFileH_t h );
  198. // Currently loaded frame index.
  199. unsigned cmFrameFileFrameLoadedIndex( cmFrameFileH_t h );
  200. // Return the index of the frame with type 'mtxTypeId', units 'unitsId', and format 'fmtId'
  201. // or cmInvalidIdx if the specified frame is not found.
  202. // Set mtxTypeId to kInvalidMId to return any mtx type.
  203. // Set unitsId to kInvalidUId to return a mtx with any units.
  204. // Set fmtId to kInvalidFmtId to return a mtx with any fmt.
  205. unsigned cmFrameFileMtxIndex( cmFrameFileH_t h, unsigned mtxTypeId, unsigned unitsId, unsigned fmtId );
  206. // Return a matrix description record.
  207. const cmFfMtx_t* cmFrameFileMtxDesc( cmFrameFileH_t h, unsigned mtxIdx );
  208. // Access matrix data.
  209. //Set descPtr to NULL if the matrix desc is not needed.
  210. unsigned char* cmFrameFileMtxIndexUChar( cmFrameFileH_t h, unsigned mtxIdx, const cmFfMtx_t** descPtrPtr );
  211. char* cmFrameFileMtxIndexChar( cmFrameFileH_t h, unsigned mtxIdx, const cmFfMtx_t** descPtrPtr );
  212. unsigned short* cmFrameFileMtxIndexUShort( cmFrameFileH_t h, unsigned mtxIdx, const cmFfMtx_t** descPtrPtr );
  213. short* cmFrameFileMtxIndexShort( cmFrameFileH_t h, unsigned mtxIdx, const cmFfMtx_t** descPtrPtr );
  214. unsigned long* cmFrameFileMtxIndexULong( cmFrameFileH_t h, unsigned mtxIdx, const cmFfMtx_t** descPtrPtr );
  215. long* cmFrameFileMtxIndexLong( cmFrameFileH_t h, unsigned mtxIdx, const cmFfMtx_t** descPtrPtr );
  216. unsigned* cmFrameFileMtxIndexUInt( cmFrameFileH_t h, unsigned mtxIdx, const cmFfMtx_t** descPtrPtr );
  217. int* cmFrameFileMtxIndexInt( cmFrameFileH_t h, unsigned mtxIdx, const cmFfMtx_t** descPtrPtr );
  218. unsigned long long* cmFrameFileMtxIndexULLong( cmFrameFileH_t h, unsigned mtxIdx, const cmFfMtx_t** descPtrPtr );
  219. long long* cmFrameFileMtxIndexLLong( cmFrameFileH_t h, unsigned mtxIdx, const cmFfMtx_t** descPtrPtr );
  220. off_t* cmFrameFileMtxIndexOff_t( cmFrameFileH_t h, unsigned mtxIdx, const cmFfMtx_t** descPtrPtr );
  221. float* cmFrameFileMtxIndexFloat( cmFrameFileH_t h, unsigned mtxIdx, const cmFfMtx_t** descPtrPtr );
  222. double* cmFrameFileMtxIndexDouble( cmFrameFileH_t h, unsigned mtxIdx, const cmFfMtx_t** descPtrPtr );
  223. char* cmFrameFileMtxIndexStringZ( cmFrameFileH_t h, unsigned mtxIdx, const cmFfMtx_t** descPtrPtr );
  224. void* cmFrameFileMtxIndexBlob( cmFrameFileH_t h, unsigned mtxIdx, const cmFfMtx_t** descPtrPtr );
  225. // (The caller is responsible for invoking cmJsonFinalize() to finalize the returned json handle.)
  226. cmJsonH_t cmFrameFileMtxIndexJson( cmFrameFileH_t h, unsigned mtxIdx, const cmFfMtx_t** descPtrPtr );
  227. // Return a pointer to the data, and optionally the descPtr, for a matrix with the given
  228. // type,units and format in the current frame.
  229. // The following functions are implmented in terms of
  230. // cmFrameFileMtxIndexXXX() and cmFrameFileMtxIndex().
  231. unsigned char* cmFrameFileMtxUChar( cmFrameFileH_t h, unsigned mtxTypeId, unsigned unitsId, const cmFfMtx_t** descPtrPtr );
  232. char* cmFrameFileMtxChar( cmFrameFileH_t h, unsigned mtxTypeId, unsigned unitsId, const cmFfMtx_t** descPtrPtr );
  233. unsigned short* cmFrameFileMtxUShort( cmFrameFileH_t h, unsigned mtxTypeId, unsigned unitsId, const cmFfMtx_t** descPtrPtr );
  234. short* cmFrameFileMtxShort( cmFrameFileH_t h, unsigned mtxTypeId, unsigned unitsId, const cmFfMtx_t** descPtrPtr );
  235. unsigned long* cmFrameFileMtxULong( cmFrameFileH_t h, unsigned mtxTypeId, unsigned unitsId, const cmFfMtx_t** descPtrPtr );
  236. long* cmFrameFileMtxLong( cmFrameFileH_t h, unsigned mtxTypeId, unsigned unitsId, const cmFfMtx_t** descPtrPtr );
  237. unsigned* cmFrameFileMtxUInt( cmFrameFileH_t h, unsigned mtxTypeId, unsigned unitsId, const cmFfMtx_t** descPtrPtr );
  238. int* cmFrameFileMtxInt( cmFrameFileH_t h, unsigned mtxTypeId, unsigned unitsId, const cmFfMtx_t** descPtrPtr );
  239. unsigned long long* cmFrameFileMtxULLong( cmFrameFileH_t h, unsigned mtxTypeId, unsigned unitsId, const cmFfMtx_t** descPtrPtr );
  240. long long* cmFrameFileMtxLLong( cmFrameFileH_t h, unsigned mtxTypeId, unsigned unitsId, const cmFfMtx_t** descPtrPtr );
  241. off_t* cmFrameFileMtxOff_t( cmFrameFileH_t h, unsigned mtxTypeId, unsigned unitsId, const cmFfMtx_t** descPtrPtr );
  242. float* cmFrameFileMtxFloat( cmFrameFileH_t h, unsigned mtxTypeId, unsigned unitsId, const cmFfMtx_t** descPtrPtr );
  243. double* cmFrameFileMtxDouble( cmFrameFileH_t h, unsigned mtxTypeId, unsigned unitsId, const cmFfMtx_t** descPtrPtr );
  244. char* cmFrameFileMtxStringZ( cmFrameFileH_t h, unsigned mtxTypeId, unsigned unitsId, const cmFfMtx_t** descPtrPtr );
  245. void* cmFrameFileMtxBlob( cmFrameFileH_t h, unsigned mtxTypeId, unsigned unitsId, const cmFfMtx_t** descPtrPtr );
  246. // (The caller is responsible for invoking cmJsonFinalize() to finalize the returned json handle.)
  247. cmJsonH_t cmFrameFileMtxJson( cmFrameFileH_t h, unsigned mtxTypeId, const cmFfMtx_t** descPtrPtr );
  248. // Return the max row cnt, max col count, and total element count
  249. // for all matrices which match the given stream/mtx/units/fmt
  250. // combination. Note that if the returned ele count is less than
  251. // maxRowCnt * maxColCnt * cmFrameFileFrameCount(streamId) then
  252. // some matched matrices contain fewer than maxRowCnt/maxColCnt
  253. // rows/columns.
  254. cmFfRC_t cmFrameFileMtxSize( cmFrameFileH_t h, unsigned streamId, unsigned mtxType, unsigned unitsId, unsigned fmtId, unsigned* frameCntPtr, unsigned* rowCntPtr, unsigned* colCntPtr, unsigned* eleCntPtr );
  255. // Load a buffer with all of the data which matches a given
  256. // stream/mtx/unit/fmt combination in the given range of frames.
  257. // 'frmIdx' specifies the frame index relative to the given stream id as opposed to
  258. // and absolute frame index.
  259. // Set frmCnt to -1 to include all frames following 'frmIdx'.
  260. // *outCntPtr is set to the actual number of elements copied into the buffer
  261. // The data is packed into the return buffer by copying columwise from the source.
  262. // matrices to the buf[]. If all of the matrices are not of a fixed known size
  263. // it may therefore be difficult to distinguish where one frames data ends and
  264. // the next begins.
  265. cmFfRC_t cmFrameFileMtxLoadUChar( cmFrameFileH_t h, unsigned streamId, unsigned mtxTypeId, unsigned unitsId, unsigned frmIdx, unsigned frmCnt, unsigned char* buf, unsigned eleCnt, unsigned* outCntPtr );
  266. cmFfRC_t cmFrameFileMtxLoadChar( cmFrameFileH_t h, unsigned streamId, unsigned mtxTypeId, unsigned unitsId, unsigned frmIdx, unsigned frmCnt, char* buf, unsigned eleCnt, unsigned* outCntPtr );
  267. cmFfRC_t cmFrameFileMtxLoadUShort( cmFrameFileH_t h, unsigned streamId, unsigned mtxTypeId, unsigned unitsId, unsigned frmIdx, unsigned frmCnt, unsigned short* buf, unsigned eleCnt, unsigned* outCntPtr );
  268. cmFfRC_t cmFrameFileMtxLoadShort( cmFrameFileH_t h, unsigned streamId, unsigned mtxTypeId, unsigned unitsId, unsigned frmIdx, unsigned frmCnt, short* buf, unsigned eleCnt, unsigned* outCntPtr );
  269. cmFfRC_t cmFrameFileMtxLoadULong( cmFrameFileH_t h, unsigned streamId, unsigned mtxTypeId, unsigned unitsId, unsigned frmIdx, unsigned frmCnt, unsigned long* buf, unsigned eleCnt, unsigned* outCntPtr );
  270. cmFfRC_t cmFrameFileMtxLoadLong( cmFrameFileH_t h, unsigned streamId, unsigned mtxTypeId, unsigned unitsId, unsigned frmIdx, unsigned frmCnt, long* buf, unsigned eleCnt, unsigned* outCntPtr );
  271. cmFfRC_t cmFrameFileMtxLoadUInt( cmFrameFileH_t h, unsigned streamId, unsigned mtxTypeId, unsigned unitsId, unsigned frmIdx, unsigned frmCnt, unsigned int* buf, unsigned eleCnt, unsigned* outCntPtr );
  272. cmFfRC_t cmFrameFileMtxLoadInt( cmFrameFileH_t h, unsigned streamId, unsigned mtxTypeId, unsigned unitsId, unsigned frmIdx, unsigned frmCnt, int* buf, unsigned eleCnt, unsigned* outCntPtr );
  273. cmFfRC_t cmFrameFileMtxLoadULLong( cmFrameFileH_t h, unsigned streamId, unsigned mtxTypeId, unsigned unitsId, unsigned frmIdx, unsigned frmCnt, unsigned long long* buf, unsigned eleCnt, unsigned* outCntPtr );
  274. cmFfRC_t cmFrameFileMtxLoadLLong( cmFrameFileH_t h, unsigned streamId, unsigned mtxTypeId, unsigned unitsId, unsigned frmIdx, unsigned frmCnt, long long* buf, unsigned eleCnt, unsigned* outCntPtr );
  275. cmFfRC_t cmFrameFileMtxLoadOff_t( cmFrameFileH_t h, unsigned streamId, unsigned mtxTypeId, unsigned unitsId, unsigned frmIdx, unsigned frmCnt, off_t* buf, unsigned eleCnt, unsigned* outCntPtr );
  276. cmFfRC_t cmFrameFileMtxLoadFloat( cmFrameFileH_t h, unsigned streamId, unsigned mtxTypeId, unsigned unitsId, unsigned frmIdx, unsigned frmCnt, float* buf, unsigned eleCnt, unsigned* outCntPtr );
  277. cmFfRC_t cmFrameFileMtxLoadDouble( cmFrameFileH_t h, unsigned streamId, unsigned mtxTypeId, unsigned unitsId, unsigned frmIdx, unsigned frmCnt, double* buf, unsigned eleCnt, unsigned* outCntPtr );
  278. cmFfRC_t cmFrameFileMtxLoadStringZ( cmFrameFileH_t h, unsigned streamId, unsigned mtxTypeId, unsigned unitsId, unsigned frmIdx, unsigned frmCnt, char* buf, unsigned eleCnt, unsigned* outCntPtr );
  279. cmFfRC_t cmFrameFileMtxLoadBlob( cmFrameFileH_t h, unsigned streamId, unsigned mtxTypeId, unsigned unitsId, unsigned frmIdx, unsigned frmCnt, void* buf, unsigned eleCnt, unsigned* outCntPtr );
  280. cmFfRC_t cmFrameFileReport( cmFrameFileH_t h, bool summOnlyFl, cmRpt_t* rpt );
  281. cmFfRC_t cmFrameFileNameReport( const char* fn, bool summOnlyFl, cmCtx_t* ctx );
  282. cmFfRC_t cmFrameFileTest( const char* fn, cmCtx_t* ctx );
  283. #if CM_FLOAT_SMP == 1
  284. #define cmFrameFileMtxLoadSample cmFrameFileMtxLoadFloat
  285. #define cmFrameFileWriteMtxSample cmFrameFileWriteMtxFloat
  286. #define cmFrameFileMtxIndexSample cmFrameFileMtxIndexFloat
  287. #define cmFrameFileMtxSample cmFrameFileMtxFloat
  288. #define kSampleFmtId kFloatFmtId
  289. #else
  290. #define cmFrameFileMtxLoadSample cmFrameFileMtxLoadDouble
  291. #define cmFrameFileWriteMtxSample cmFrameFileWriteMtxDouble
  292. #define cmFrameFileMtxIndexSample cmFrameFileMtxIndexDouble
  293. #define cmFrameFileMtxSample cmFrameFileMtxDouble
  294. #define kSampleFmtId kDoubleFmtId
  295. #endif
  296. #if CM_FLOAT_REAL == 1
  297. #define cmFrameFileMtxLoadReal cmFrameFileMtxLoadFloat
  298. #define cmFrameFileWriteMtxReal cmFrameFileWriteMtxFloat
  299. #define cmFrameFileMtxIndexReal cmFrameFileMtxIndexFloat
  300. #define cmFrameFileMtxReal cmFrameFileMtxFloat
  301. #define kRealFmtId kFloatFmtId
  302. #else
  303. #define cmFrameFileMtxLoadReal cmFrameFileMtxLoadDouble
  304. #define cmFrameFileWriteMtxReal cmFrameFileWriteMtxDouble
  305. #define cmFrameFileMtxIndexReal cmFrameFileMtxIndexDouble
  306. #define cmFrameFileMtxReal cmFrameFileMtxDouble
  307. #define kRealFmtId kDoubleFmtId
  308. #endif
  309. //)
  310. #ifdef __cplusplus
  311. }
  312. #endif
  313. #endif