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

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