refactor!!: complete sphinxbase removal

This commit is contained in:
David Huggins-Daines
2022-09-13 15:35:25 -04:00
parent d8fc767c27
commit cf021b87d4
41 changed files with 96 additions and 174 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
configure_file(config.h.in config.h)
configure_file(sphinx_config.h.in include/sphinxbase/sphinx_config.h)
configure_file(sphinx_config.h.in include/pocketsphinx/sphinx_config.h)
add_definitions(-DHAVE_CONFIG_H)
if(SKBUILD)
+1 -23
View File
@@ -424,28 +424,6 @@ ps_config_t *ps_get_config(ps_decoder_t *ps);
POCKETSPHINX_EXPORT
logmath_t *ps_get_logmath(ps_decoder_t *ps);
/**
* Get the feature extraction object for this decoder.
*
* @return The feature extraction object for this decoder. The
* decoder owns this pointer, so you should not attempt to
* free it manually. Use fe_retain() if you wish to reuse it
* elsewhere.
*/
POCKETSPHINX_EXPORT
fe_t *ps_get_fe(ps_decoder_t *ps);
/**
* Get the dynamic feature computation object for this decoder.
*
* @return The dynamic feature computation object for this decoder.
* The decoder owns this pointer, so you should not attempt to
* free it manually. Use feat_retain() if you wish to reuse
* it elsewhere.
*/
POCKETSPHINX_EXPORT
feat_t *ps_get_feat(ps_decoder_t *ps);
/**
* Adapt current acoustic model using a linear transform.
*
@@ -633,7 +611,7 @@ int ps_process_raw(ps_decoder_t *ps,
*/
POCKETSPHINX_EXPORT
int ps_process_cep(ps_decoder_t *ps,
mfcc_t **data,
float **data,
int n_frames,
int no_search,
int full_utt);
+2 -3
View File
@@ -36,7 +36,7 @@
#define __PS_ENDPOINTER_H__
#include <sphinxbase/prim_type.h>
#include <pocketsphinx/prim_type.h>
#include <pocketsphinx/export.h>
#ifdef __cplusplus
@@ -46,9 +46,8 @@ extern "C" {
}
#endif
#include <sphinxbase/prim_type.h>
#include <pocketsphinx/prim_type.h>
#include <pocketsphinx/export.h>
#include <pocketsphinx/vad.h>
/**
+8 -6
View File
@@ -43,6 +43,8 @@
#include <stdlib.h>
#include <errno.h>
#include <pocketsphinx/export.h>
/**
* @file err.h
* @brief Implementation of logging routines.
@@ -138,14 +140,14 @@ typedef enum err_e {
ERR_MAX
} err_lvl_t;
POCKETSPHINX_EXPORT void
err_msg(err_lvl_t lvl, const char *path, long ln, const char *fmt, ...);
POCKETSPHINX_EXPORT
void err_msg(err_lvl_t lvl, const char *path, long ln, const char *fmt, ...);
POCKETSPHINX_EXPORT void
err_msg_system(err_lvl_t lvl, const char *path, long ln, const char *fmt, ...);
POCKETSPHINX_EXPORT
void err_msg_system(err_lvl_t lvl, const char *path, long ln, const char *fmt, ...);
POCKETSPHINX_EXPORT void
err_logfp_cb(void * user_data, err_lvl_t level, const char *fmt, ...);
POCKETSPHINX_EXPORT
void err_logfp_cb(void * user_data, err_lvl_t level, const char *fmt, ...);
typedef void (*err_cb_f)(void* user_data, err_lvl_t, const char *, ...);
+1 -4
View File
@@ -43,10 +43,7 @@
#ifndef __PS_LATTICE_H__
#define __PS_LATTICE_H__
/* SphinxBase headers. */
#include <sphinxbase/prim_type.h>
/* PocketSphinx headers. */
#include <pocketsphinx/prim_type.h>
#include <pocketsphinx/export.h>
#ifdef __cplusplus
+1 -4
View File
@@ -43,10 +43,7 @@
#ifndef __PS_MLLR_H__
#define __PS_MLLR_H__
/* SphinxBase headers. */
#include <sphinxbase/prim_type.h>
/* PocketSphinx headers. */
#include <pocketsphinx/prim_type.h>
#include <pocketsphinx/export.h>
#ifdef __cplusplus
+4 -3
View File
@@ -72,8 +72,6 @@
#ifndef __PS_SEARCH_H__
#define __PS_SEARCH_H__
#include <sphinxbase/fsg_model.h>
#ifdef __cplusplus
extern "C" {
#endif
@@ -86,6 +84,8 @@ extern "C" {
*/
typedef struct ps_search_iter_s ps_search_iter_t;
/* Forward-declare this because header files are an atrocity. */
typedef struct ps_decoder_s ps_decoder_t;
/**
* Actives search with the provided name.
@@ -164,8 +164,9 @@ POCKETSPHINX_EXPORT
const char* ps_search_iter_val(ps_search_iter_t *itor);
/* Forward declare this (not public API) */
/* Forward declare these (not public API) */
typedef struct ngram_model_s ngram_model_t;
typedef struct fsg_model_s fsg_model_t;
/**
* Get the language model set object for this decoder.
+1 -1
View File
@@ -36,7 +36,7 @@
#define __PS_VAD_H__
#include <sphinxbase/prim_type.h>
#include <pocketsphinx/prim_type.h>
#include <pocketsphinx/export.h>
#ifdef __cplusplus
+6 -10
View File
@@ -35,20 +35,16 @@
*
*/
/* System headers. */
#include <stdio.h>
/* SphinxBase headers. */
#include <sphinxbase/pio.h>
#include <sphinxbase/err.h>
#include <sphinxbase/strfuncs.h>
#include <sphinxbase/filename.h>
#include <sphinxbase/byteorder.h>
/* PocketSphinx headers. */
#include <pocketsphinx.h>
/* S3kr3t headerz. */
#include "util/ckd_alloc.h"
#include "util/strfuncs.h"
#include "util/filename.h"
#include "util/byteorder.h"
#include "util/pio.h"
#include "lm/fsg_model.h"
#include "cmdln_macro.h"
#include "pocketsphinx_internal.h"
+5 -6
View File
@@ -37,12 +37,11 @@
#include <string.h>
#include <sphinxbase/hash_table.h>
#include <sphinxbase/fsg_model.h>
#include <sphinxbase/jsgf.h>
#include <sphinxbase/err.h>
#include <sphinxbase/strfuncs.h>
#include "util/ckd_alloc.h"
#include "util/hash_table.h"
#include "util/strfuncs.h"
#include "lm/fsg_model.h"
#include "lm/jsgf.h"
#include "pocketsphinx_internal.h"
static const arg_t defn[] = {
+7 -8
View File
@@ -38,15 +38,14 @@
* \file sphinx_lm_convert.c
* Language model conversion tool.
*/
#include <sphinxbase/logmath.h>
#include <sphinxbase/ngram_model.h>
#include <sphinxbase/cmd_ln.h>
#include <sphinxbase/ckd_alloc.h>
#include <sphinxbase/err.h>
#include <sphinxbase/pio.h>
#include <sphinxbase/strfuncs.h>
#include <pocketsphinx.h>
#include "pocketsphinx_internal.h"
#include "lm/ngram_model.h"
#include "util/ckd_alloc.h"
#include "util/cmd_ln.h"
#include "util/ckd_alloc.h"
#include "util/pio.h"
#include "util/strfuncs.h"
#include <stdio.h>
#include <string.h>
+7 -7
View File
@@ -38,14 +38,14 @@
* \file sphinx_lm_eval.c
* Language model evaluation tool.
*/
#include <sphinxbase/logmath.h>
#include <sphinxbase/ngram_model.h>
#include <sphinxbase/cmd_ln.h>
#include <sphinxbase/ckd_alloc.h>
#include <sphinxbase/err.h>
#include <sphinxbase/pio.h>
#include <sphinxbase/strfuncs.h>
#include <pocketsphinx.h>
#include "lm/ngram_model.h"
#include "util/ckd_alloc.h"
#include "util/cmd_ln.h"
#include "util/ckd_alloc.h"
#include "util/pio.h"
#include "util/strfuncs.h"
#include "pocketsphinx_internal.h"
#include <stdio.h>
+1
View File
@@ -46,6 +46,7 @@
#include <pocketsphinx.h>
#include "util/ckd_alloc.h"
#include "pocketsphinx_internal.h"
static int global_done = 0;
+1
View File
@@ -45,6 +45,7 @@
#include <pocketsphinx.h>
#include "util/ckd_alloc.h"
#include "bin_mdef.h"
int
+8 -7
View File
@@ -42,13 +42,14 @@
#include <stdio.h>
#include <string.h>
#include <sphinxbase/cmd_ln.h>
#include <sphinxbase/yin.h>
#include <sphinxbase/ckd_alloc.h>
#include <sphinxbase/byteorder.h>
#include <sphinxbase/strfuncs.h>
#include <sphinxbase/err.h>
#include <sphinxbase/pio.h>
#include <pocketsphinx.h>
#include "util/cmd_ln.h"
#include "util/ckd_alloc.h"
#include "util/byteorder.h"
#include "util/strfuncs.h"
#include "util/pio.h"
#include "fe/yin.h"
#include "pocketsphinx_internal.h"
+2 -2
View File
@@ -100,12 +100,12 @@ util/pio.c
util/genrand.c
)
target_include_directories(
pocketsphinx PRIVATE ${CMAKE_BINARY_DIR} # config.h
pocketsphinx PRIVATE ${CMAKE_SOURCE_DIR}/include/pocketsphinx
pocketsphinx PRIVATE ${CMAKE_BINARY_DIR}
pocketsphinx PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
pocketsphinx PUBLIC ${CMAKE_SOURCE_DIR}/include
pocketsphinx PUBLIC ${CMAKE_BINARY_DIR}/include
pocketsphinx INTERFACE ${CMAKE_SOURCE_DIR}/include
pocketsphinx INTERFACE ${CMAKE_BINARY_DIR}/include
)
if(APPLE)
# Things we might need are here
@@ -19,7 +19,7 @@
#include <string.h>
#include <sphinxbase/sphinx_config.h>
#include <pocketsphinx/sphinx_config.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#else
@@ -16,7 +16,7 @@
#include "rtc_base/compile_assert_c.h"
#include <sphinxbase/sphinx_config.h>
#include <pocketsphinx/sphinx_config.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#else
@@ -16,7 +16,7 @@
#ifndef COMMON_AUDIO_SIGNAL_PROCESSING_RESAMPLE_BY_2_INTERNAL_H_
#define COMMON_AUDIO_SIGNAL_PROCESSING_RESAMPLE_BY_2_INTERNAL_H_
#include <sphinxbase/sphinx_config.h>
#include <pocketsphinx/sphinx_config.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#else
+1 -1
View File
@@ -18,7 +18,7 @@
#include <stddef.h>
#include <sphinxbase/sphinx_config.h>
#include <pocketsphinx/sphinx_config.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#else
+1 -1
View File
@@ -13,7 +13,7 @@
#ifndef COMMON_AUDIO_VAD_VAD_GMM_H_
#define COMMON_AUDIO_VAD_VAD_GMM_H_
#include <sphinxbase/sphinx_config.h>
#include <pocketsphinx/sphinx_config.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#else
+1
View File
@@ -38,6 +38,7 @@
#include <string.h>
#include "util/pio.h"
#include "util/ckd_alloc.h"
#include "util/strfuncs.h"
#include "dict.h"
+3
View File
@@ -37,6 +37,9 @@
#include <string.h>
#include "util/ckd_alloc.h"
#include "util/bitvec.h"
#include "s3types.h"
#include "dict2pid.h"
#include "hmm.h"
-18
View File
@@ -273,7 +273,6 @@ enum fe_error_e {
* cmd_ln_init() in friends to create argument structures for
* fe_init_auto_r().
*/
SPHINXBASE_EXPORT
arg_t const *fe_get_args(void);
/**
@@ -284,7 +283,6 @@ arg_t const *fe_get_args(void);
* fe_t, so you may free this if you no longer need it.
* @return Newly created front-end object.
*/
SPHINXBASE_EXPORT
fe_t *fe_init_auto_r(cmd_ln_t *config);
/**
@@ -294,14 +292,12 @@ fe_t *fe_init_auto_r(cmd_ln_t *config);
* owned by the fe_t, so you should not attempt to free it
* manually.
*/
SPHINXBASE_EXPORT
cmd_ln_t *fe_get_config(fe_t *fe);
/**
* Start processing an utterance.
* @return 0 for success, <0 for error (see enum fe_error_e)
*/
SPHINXBASE_EXPORT
int fe_start_utt(fe_t *fe);
/**
@@ -317,7 +313,6 @@ int fe_start_utt(fe_t *fe);
* @param fe Front-end object
* @return Dimensionality of front-end output.
*/
SPHINXBASE_EXPORT
int fe_get_output_size(fe_t *fe);
/**
@@ -333,7 +328,6 @@ int fe_get_output_size(fe_t *fe);
* @param out_frame_shift Output: Number of samples between each frame start.
* @param out_frame_size Output: Number of samples in each frame.
*/
SPHINXBASE_EXPORT
void fe_get_input_size(fe_t *fe, int *out_frame_shift,
int *out_frame_size);
@@ -351,7 +345,6 @@ void fe_get_input_size(fe_t *fe, int *out_frame_shift,
* (either 0 or 1).
* @return 0 for success, <0 for error (see enum fe_error_e)
*/
SPHINXBASE_EXPORT
int fe_end_utt(fe_t *fe, mfcc_t *out_cepvector, int32 *out_nframes);
/**
@@ -359,7 +352,6 @@ int fe_end_utt(fe_t *fe, mfcc_t *out_cepvector, int32 *out_nframes);
*
* @return pointer to the retained front end.
*/
SPHINXBASE_EXPORT
fe_t *fe_retain(fe_t *fe);
/**
@@ -369,7 +361,6 @@ fe_t *fe_retain(fe_t *fe);
*
* @return new reference count (0 if freed completely)
*/
SPHINXBASE_EXPORT
int fe_free(fe_t *fe);
/**
@@ -380,7 +371,6 @@ int fe_free(fe_t *fe);
* @param buf_cep Buffer which will receive one frame of features.
* @return 0 for success, <0 for error (see enum fe_error_e)
*/
SPHINXBASE_EXPORT
int fe_process_frame(fe_t *fe, int16 const *spch,
int32 nsamps, mfcc_t *out_cep);
@@ -431,7 +421,6 @@ int fe_process_frame(fe_t *fe, int16 const *spch,
* Output: Number of frames actually generated.
* @return 0 for success, <0 for failure (see enum fe_error_e)
*/
SPHINXBASE_EXPORT
int fe_process_frames(fe_t *fe,
int16 const **inout_spch,
size_t *inout_nsamps,
@@ -453,7 +442,6 @@ int fe_process_frames(fe_t *fe,
*
* @return 0 for success, <0 for failure (see enum fe_error_e)
*/
SPHINXBASE_EXPORT
int fe_process_utt(fe_t *fe, /**< A front end object */
int16 const *spch, /**< The speech samples */
size_t nsamps, /**< number of samples*/
@@ -464,13 +452,11 @@ int fe_process_utt(fe_t *fe, /**< A front end object */
/**
* Free the output pointer returned by fe_process_utt().
**/
SPHINXBASE_EXPORT
void fe_free_2d(void *arr);
/**
* Convert a block of mfcc_t to float32 (can be done in-place)
**/
SPHINXBASE_EXPORT
int fe_mfcc_to_float(fe_t *fe,
mfcc_t **input,
float32 **output,
@@ -479,7 +465,6 @@ int fe_mfcc_to_float(fe_t *fe,
/**
* Convert a block of float32 to mfcc_t (can be done in-place)
**/
SPHINXBASE_EXPORT
int fe_float_to_mfcc(fe_t *fe,
float32 **input,
mfcc_t **output,
@@ -508,7 +493,6 @@ int fe_float_to_mfcc(fe_t *fe,
*
* Also, it normalizes by 1/nfilt rather than 2/nfilt, for some reason.
**/
SPHINXBASE_EXPORT
int fe_logspec_to_mfcc(fe_t *fe, /**< A fe structure */
const mfcc_t *fr_spec, /**< One frame of spectrum */
mfcc_t *fr_cep /**< One frame of cepstrum */
@@ -522,7 +506,6 @@ int fe_logspec_to_mfcc(fe_t *fe, /**< A fe structure */
* cos(0) basis vector (i.e. the one corresponding to the DC
* coefficient in the output).
**/
SPHINXBASE_EXPORT
int fe_logspec_dct2(fe_t *fe, /**< A fe structure */
const mfcc_t *fr_spec, /**< One frame of spectrum */
mfcc_t *fr_cep /**< One frame of cepstrum */
@@ -536,7 +519,6 @@ int fe_logspec_dct2(fe_t *fe, /**< A fe structure */
* cos(0) basis vector (i.e. the one corresponding to the DC
* coefficient in the input).
**/
SPHINXBASE_EXPORT
int fe_mfcc_dct3(fe_t *fe, /**< A fe structure */
const mfcc_t *fr_cep, /**< One frame of cepstrum */
mfcc_t *fr_spec /**< One frame of spectrum */
-8
View File
@@ -111,11 +111,9 @@ typedef enum cmn_type_e {
} cmn_type_t;
/** String representations of cmn_type_t values. */
SPHINXBASE_EXPORT
extern const char *cmn_type_str[];
/** Convert string representation (from command-line) to cmn_type_t */
SPHINXBASE_EXPORT
cmn_type_t cmn_type_from_str(const char *str);
/** \struct cmn_t
@@ -132,13 +130,11 @@ typedef struct {
int refcount;
} cmn_t;
SPHINXBASE_EXPORT
cmn_t* cmn_init(int32 veclen);
/**
* CMN for the whole sentence
*/
SPHINXBASE_EXPORT
void cmn (cmn_t *cmn, /**< In/Out: cmn normalization, which contains the cmn_mean and cmn_var) */
mfcc_t **mfc, /**< In/Out: mfc[f] = mfc vector in frame f */
int32 varnorm,/**< In: if not FALSE, variance normalize the input vectors
@@ -153,7 +149,6 @@ void cmn (cmn_t *cmn, /**< In/Out: cmn normalization, which contains the cmn_m
/**
* CMN for one block of data, using live mean
*/
SPHINXBASE_EXPORT
void cmn_live(cmn_t *cmn, /**< In/Out: cmn normalization, which contains
the cmn_mean and cmn_var) */
mfcc_t **incep, /**< In/Out: mfc[f] = mfc vector in frame f*/
@@ -164,7 +159,6 @@ void cmn_live(cmn_t *cmn, /**< In/Out: cmn normalization, which contains
/**
* Update live mean based on observed data
*/
SPHINXBASE_EXPORT
void cmn_live_update(cmn_t *cmn);
/**
@@ -185,7 +179,6 @@ const char *cmn_update_repr(cmn_t *cmn);
/**
* Set the live mean from a string.
*/
SPHINXBASE_EXPORT
int cmn_set_repr(cmn_t *cmn, char const *repr);
/**
@@ -196,7 +189,6 @@ cmn_t *cmn_retain(cmn_t *cmn);
/**
* Release a CMN, possibly freeing it.
*/
SPHINXBASE_EXPORT
int cmn_free (cmn_t *cmn);
#ifdef __cplusplus
-16
View File
@@ -223,13 +223,11 @@ typedef struct feat_s {
* NULL; and each subvec[0]..subvec[N-1] is -1 terminated vector of
* feature dims.
*/
SPHINXBASE_EXPORT
int32 **parse_subvecs(char const *str);
/**
* Free array of subvector specs.
*/
SPHINXBASE_EXPORT
void subvecs_free(int32 **subvecs);
@@ -245,7 +243,6 @@ void subvecs_free(int32 **subvecs);
* NOTE: For I/O convenience, the entire data area is allocated as one contiguous block.
* @return pointer to the allocated space if successful, NULL if any error.
*/
SPHINXBASE_EXPORT
mfcc_t ***feat_array_alloc(feat_t *fcb, /**< In: Descriptor from feat_init(), used
to obtain number of streams and stream sizes */
int32 nfr /**< In: Number of frames for which to allocate */
@@ -254,7 +251,6 @@ mfcc_t ***feat_array_alloc(feat_t *fcb, /**< In: Descriptor from feat_init(), us
/**
* Realloate the array of features. Requires us to know the old size
*/
SPHINXBASE_EXPORT
mfcc_t ***feat_array_realloc(feat_t *fcb, /**< In: Descriptor from feat_init(), used
to obtain number of streams and stream sizes */
mfcc_t ***old_feat, /**< Feature array. Freed */
@@ -265,7 +261,6 @@ mfcc_t ***feat_array_realloc(feat_t *fcb, /**< In: Descriptor from feat_init(),
/**
* Free a buffer allocated with feat_array_alloc()
*/
SPHINXBASE_EXPORT
void feat_array_free(mfcc_t ***feat);
@@ -284,7 +279,6 @@ void feat_array_free(mfcc_t ***feat);
* @return (feat_t *) descriptor if successful, NULL if error. Caller
* must not directly modify the contents of the returned value.
*/
SPHINXBASE_EXPORT
feat_t *feat_init(char const *type,/**< In: Type of feature stream */
cmn_type_t cmn, /**< In: Type of cepstram mean normalization to
be done before feature computation; can be
@@ -304,7 +298,6 @@ feat_t *feat_init(char const *type,/**< In: Type of feature stream */
* Add an LDA transformation to the feature module from a file.
* @return 0 for success or -1 if reading the LDA file failed.
**/
SPHINXBASE_EXPORT
int32 feat_read_lda(feat_t *feat, /**< In: Descriptor from feat_init() */
const char *ldafile, /**< In: File to read the LDA matrix from. */
int32 dim /**< In: Dimensionality of LDA output. */
@@ -313,7 +306,6 @@ int32 feat_read_lda(feat_t *feat, /**< In: Descriptor from feat_init() */
/**
* Transform a block of features using the feature module's LDA transform.
**/
SPHINXBASE_EXPORT
void feat_lda_transform(feat_t *fcb, /**< In: Descriptor from feat_init() */
mfcc_t ***inout_feat, /**< Feature block to transform. */
uint32 nfr /**< In: Number of frames in inout_feat. */
@@ -337,13 +329,11 @@ void feat_lda_transform(feat_t *fcb, /**< In: Descriptor from feat_init() */
* @return 0 for success or -1 if the subvector specification was
* invalid.
*/
SPHINXBASE_EXPORT
int feat_set_subvecs(feat_t *fcb, int32 **subvecs);
/**
* Print the given block of feature vectors to the given FILE.
*/
SPHINXBASE_EXPORT
void feat_print(feat_t *fcb, /**< In: Descriptor from feat_init() */
mfcc_t ***feat, /**< In: Feature data to be printed */
int32 nfr, /**< In: Number of frames of feature data above */
@@ -367,7 +357,6 @@ void feat_print(feat_t *fcb, /**< In: Descriptor from feat_init() */
* already specifies extension or absolute path, then these are not
* applied. The default extension is defined by the application.
*/
SPHINXBASE_EXPORT
int32 feat_s2mfc2feat(feat_t *fcb, /**< In: Descriptor from feat_init() */
const char *file, /**< In: File to be read */
const char *dir, /**< In: Directory prefix for file,
@@ -416,7 +405,6 @@ int32 feat_s2mfc2feat(feat_t *fcb, /**< In: Descriptor from feat_init() */
*
* @return The number of output frames actually computed.
**/
SPHINXBASE_EXPORT
int32 feat_s2mfc2feat_live(feat_t *fcb, /**< In: Descriptor from feat_init() */
mfcc_t **uttcep, /**< In: Incoming cepstral buffer */
int32 *inout_ncep,/**< In: Size of incoming buffer.
@@ -433,7 +421,6 @@ int32 feat_s2mfc2feat_live(feat_t *fcb, /**< In: Descriptor from feat_init(
* Update the normalization stats, possibly in the end of utterance
*
*/
SPHINXBASE_EXPORT
void feat_update_stats(feat_t *fcb);
@@ -442,7 +429,6 @@ void feat_update_stats(feat_t *fcb);
*
* @return pointer to retained feat_t.
*/
SPHINXBASE_EXPORT
feat_t *feat_retain(feat_t *f);
/**
@@ -450,14 +436,12 @@ feat_t *feat_retain(feat_t *f);
*
* @return new reference count (0 if freed)
*/
SPHINXBASE_EXPORT
int feat_free(feat_t *f /**< In: feat_t */
);
/**
* Report the feat_t data structure
*/
SPHINXBASE_EXPORT
void feat_report(feat_t *f /**< In: feat_t */
);
#ifdef __cplusplus
+1 -1
View File
@@ -78,7 +78,7 @@
#include <pocketsphinx.h>
#include "lm/fsg_model.h"
#include "blkarray_list.h"
#include "util/blkarray_list.h"
#include "fsg_lextree.h"
#include "dict.h"
+2 -1
View File
@@ -44,8 +44,9 @@
#include <string.h>
#include <limits.h>
#include <pocketsphinx/err.h>
#include "util/ckd_alloc.h"
#include "util/err.h"
#include "hmm.h"
hmm_context_t *
-6
View File
@@ -90,7 +90,6 @@ typedef struct bitarr_address_s {
* @param mask of read value
* @return uint64 value that was read
*/
SPHINXBASE_EXPORT
uint64 bitarr_read_int57(bitarr_address_t address, uint8 length, uint64 mask);
/**
@@ -101,7 +100,6 @@ uint64 bitarr_read_int57(bitarr_address_t address, uint8 length, uint64 mask);
* @param length amount of active bytes in value to write
* @param value integer to write
*/
SPHINXBASE_EXPORT
void bitarr_write_int57(bitarr_address_t address, uint8 length, uint64 value);
/**
@@ -112,7 +110,6 @@ void bitarr_write_int57(bitarr_address_t address, uint8 length, uint64 value);
* @param mask of read value
* @return uint32 value that was read
*/
SPHINXBASE_EXPORT
uint32 bitarr_read_int25(bitarr_address_t address, uint8 length, uint32 mask);
/**
@@ -123,7 +120,6 @@ uint32 bitarr_read_int25(bitarr_address_t address, uint8 length, uint32 mask);
* @param length amount of active bytes in value to write
* @param value integer to write
*/
SPHINXBASE_EXPORT
void bitarr_write_int25(bitarr_address_t address, uint8 length, uint32 value);
/**
@@ -131,7 +127,6 @@ void bitarr_write_int25(bitarr_address_t address, uint8 length, uint32 value);
* @param bit_mask mask that is filled
* @param max_value bigest integer that is going to be stored using this mask
*/
SPHINXBASE_EXPORT
void bitarr_mask_from_max(bitarr_mask_t *bit_mask, uint32 max_value);
/**
@@ -139,7 +134,6 @@ void bitarr_mask_from_max(bitarr_mask_t *bit_mask, uint32 max_value);
* @param max_value bigest integer that going to be stored using this amount of bits
* @return amount of bits required to store integers from range with maximum provided
*/
SPHINXBASE_EXPORT
uint8 bitarr_required_bits(uint32 max_value);
#ifdef __cplusplus
+4 -5
View File
@@ -45,10 +45,10 @@
#include "util/hash_table.h"
#include "util/filename.h"
#include "fe/jsgf.h"
#include "fe/jsgf_internal.h"
#include "fe/jsgf_parser.h"
#include "fe/jsgf_scanner.h"
#include "lm/jsgf.h"
#include "lm/jsgf_internal.h"
#include "lm/jsgf_parser.h"
#include "lm/jsgf_scanner.h"
extern int yyparse(void *scanner, jsgf_t * jsgf);
@@ -872,7 +872,6 @@ jsgf_set_search_path(jsgf_t * jsgf, const char *filename)
#if !defined(_WIN32_WCE)
if ((jsgf_path = getenv("JSGF_PATH")) != NULL) {
char *word, *c;
/* FIXME: This should be a function in libsphinxbase. */
word = jsgf_path = ckd_salloc(jsgf_path);
while ((c = strchr(word, ':'))) {
*c = '\0';
+2 -1
View File
@@ -44,9 +44,10 @@
#include <stdio.h>
#include <pocketsphinx/logmath.h>
#include "util/hash_table.h"
#include "util/glist.h"
#include "util/logmath.h"
#include "util/strfuncs.h"
#include "lm/fsg_model.h"
+3 -4
View File
@@ -39,10 +39,9 @@
#define __LM_TRIE_H__
#include "util/pio.h"
#include "util/bitarr.h"
#include "ngram_model_internal.h"
#include "lm_trie_quant.h"
#include "lm/bitarr.h"
#include "lm/ngram_model_internal.h"
#include "lm/lm_trie_quant.h"
typedef struct unigram_s {
float prob;
+1 -1
View File
@@ -37,7 +37,7 @@
#ifndef __LM_TRIE_QUANT_H__
#define __LM_TRIE_QUANT_H__
#include "util/bitarr.h"
#include "lm/bitarr.h"
#include "lm/ngrams_raw.h"
#ifdef HAVE_CONFIG_H
+2
View File
@@ -87,6 +87,8 @@
#include <stdlib.h>
#include <assert.h>
#include <pocketsphinx/err.h>
#include "util/ckd_alloc.h"
#include "mdef.h"
+1 -1
View File
@@ -37,7 +37,7 @@ RTC_NORETURN void rtc_FatalMessage(const char* file, int line, const char* msg);
#ifdef __cplusplus
} // extern "C"
#endif */
#include <sphinxbase/err.h>
#include <pocketsphinx/err.h>
#define rtc_FatalMessage(file, line, msg) E_FATAL(msg)
#ifdef RTC_DISABLE_CHECK_MSG
+2 -1
View File
@@ -41,9 +41,10 @@
#include "util/ckd_alloc.h"
#include "util/bio.h"
#include "util/vector.h"
#include "tmat.h"
#include "hmm.h"
#include "vector.h"
#define TMAT_PARAM_VERSION "1.0"
+2 -1
View File
@@ -68,8 +68,9 @@
#pragma warning (disable: 4996)
#endif
#include <pocketsphinx/err.h>
#include "util/bio.h"
#include "util/err.h"
#include "util/ckd_alloc.h"
+1 -1
View File
@@ -2,7 +2,7 @@
NOTE: This is generated code. Look in README.python for information on
remaking this file.
*/
#include "sphinxbase/f2c.h"
#include "util/f2c.h"
#ifdef HAVE_CONFIG
#include "config.h"
+3 -12
View File
@@ -61,7 +61,7 @@
#include <stdio.h>
#include <stdarg.h>
#include <pocketsphinx/prim_type.h>
#include <pocketsphinx.h>
#include "util/hash_table.h"
@@ -81,17 +81,6 @@ extern "C" {
}
#endif
/**
* @struct arg_t
* Argument definition structure.
*/
typedef struct arg_s {
char const *name; /**< Name of the command line switch */
int type; /**< Type of the argument in question */
char const *deflt; /**< Default value (as a character string), or NULL if none */
char const *doc; /**< Documentation/description string */
} arg_t;
/**
* @struct cmd_ln_val_t
* Configuration parameter structure.
@@ -420,6 +409,8 @@ void cmd_ln_log_help_r (cmd_ln_t *cmdln, const arg_t *defn);
*/
void cmd_ln_log_values_r (cmd_ln_t *cmdln, const arg_t *defn);
cmd_ln_val_t * cmd_ln_val_init(int t, const char *name, const char *str);
void cmd_ln_val_free(cmd_ln_val_t *val);
#ifdef __cplusplus
}
+2 -1
View File
@@ -38,7 +38,8 @@
#include <stdio.h>
#include <stdlib.h>
#include "util/err.h"
#include <pocketsphinx/err.h>
#include "util/ckd_alloc.h"
#include "util/listelem_alloc.h"
#include "util/glist.h"
+5 -6
View File
@@ -74,7 +74,7 @@ extern "C" {
* @param d2 dimension
* @param d3 dimension
**/
SPHINXBASE_EXPORT void norm_3d(float32 ***arr, uint32 d1, uint32 d2, uint32 d3);
void norm_3d(float32 ***arr, uint32 d1, uint32 d2, uint32 d3);
/**
* Floor 3-d array
@@ -84,15 +84,14 @@ SPHINXBASE_EXPORT void norm_3d(float32 ***arr, uint32 d1, uint32 d2, uint32 d3);
* @param d2 dimension
* @param d3 dimension
**/
SPHINXBASE_EXPORT void
accum_3d(float32 ***out, float32 ***in, uint32 d1, uint32 d2, uint32 d3);
void accum_3d(float32 ***out, float32 ***in, uint32 d1, uint32 d2, uint32 d3);
/** Ensures that non-zero values x such that -band < x < band, band > 0 are set to -band if x < 0 and band if x > 0.
* @param v array
* @param d1 array size
* @param band band value
*/
SPHINXBASE_EXPORT void band_nz_1d(float32 *v, uint32 d1, float32 band);
void band_nz_1d(float32 *v, uint32 d1, float32 band);
/**
* Floor 3-d array
@@ -102,7 +101,7 @@ SPHINXBASE_EXPORT void band_nz_1d(float32 *v, uint32 d1, float32 band);
* @param d3 dimension
* @param floor floor value
**/
SPHINXBASE_EXPORT void floor_nz_3d(float32 ***m, uint32 d1, uint32 d2, uint32 d3, float32 floor);
void floor_nz_3d(float32 ***m, uint32 d1, uint32 d2, uint32 d3, float32 floor);
/**
* Floor 1-d array
@@ -110,7 +109,7 @@ SPHINXBASE_EXPORT void floor_nz_3d(float32 ***m, uint32 d1, uint32 d2, uint32 d3
* @param d1 dimension
* @param floor floor value
**/
SPHINXBASE_EXPORT void floor_nz_1d(float32 *v, uint32 d1, float32 floor);
void floor_nz_1d(float32 *v, uint32 d1, float32 floor);
/**
* Calculate the determinant of a positive definite matrix.