~ubuntu-branches/ubuntu/saucy/sphinxtrain/saucy

« back to all changes in this revision

Viewing changes to include/s3/segdmp.h

  • Committer: Package Import Robot
  • Author(s): Samuel Thibault
  • Date: 2013-01-02 04:10:21 UTC
  • Revision ID: package-import@ubuntu.com-20130102041021-ynsizmz33fx02hea
Tags: upstream-1.0.8
ImportĀ upstreamĀ versionĀ 1.0.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ====================================================================
 
2
 * Copyright (c) 1994-2000 Carnegie Mellon University.  All rights 
 
3
 * reserved.
 
4
 *
 
5
 * Redistribution and use in source and binary forms, with or without
 
6
 * modification, are permitted provided that the following conditions
 
7
 * are met:
 
8
 *
 
9
 * 1. Redistributions of source code must retain the above copyright
 
10
 *    notice, this list of conditions and the following disclaimer. 
 
11
 *
 
12
 * 2. Redistributions in binary form must reproduce the above copyright
 
13
 *    notice, this list of conditions and the following disclaimer in
 
14
 *    the documentation and/or other materials provided with the
 
15
 *    distribution.
 
16
 *
 
17
 * This work was supported in part by funding from the Defense Advanced 
 
18
 * Research Projects Agency and the National Science Foundation of the 
 
19
 * United States of America, and the CMU Sphinx Speech Consortium.
 
20
 *
 
21
 * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND 
 
22
 * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
 
23
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 
24
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
 
25
 * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
26
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
 
27
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
 
28
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
 
29
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 
30
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 
31
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
32
 *
 
33
 * ====================================================================
 
34
 *
 
35
 */
 
36
/*********************************************************************
 
37
 *
 
38
 * File: segdmp.h
 
39
 * 
 
40
 * Description: 
 
41
 * 
 
42
 * Author: 
 
43
 *      Eric H. Thayer (eht@cs.cmu.edu)
 
44
 *********************************************************************/
 
45
 
 
46
#ifndef SEGDMP_H
 
47
#define SEGDMP_H
 
48
#ifdef __cplusplus
 
49
extern "C" {
 
50
#endif
 
51
#if 0
 
52
}
 
53
#endif
 
54
 
 
55
#include <sphinxbase/prim_type.h>
 
56
#include <s3/acmod_set.h>
 
57
#include <s3/vector.h>
 
58
 
 
59
typedef enum {
 
60
    SEGDMP_TYPE_VQ,
 
61
    SEGDMP_TYPE_MFCC,
 
62
    SEGDMP_TYPE_FEAT
 
63
} segdmp_type_t;
 
64
 
 
65
/*
 
66
 * Segment dump creation/write
 
67
 */
 
68
int
 
69
segdmp_open_write(const char **dirs,            /* dump directories */
 
70
                  const char *dmp_fn,           /* dump file name */
 
71
                  const char *idx_fn,           /* index file name */
 
72
                  uint32 n_id,          /* # of id's */
 
73
                  uint32 *n_seg,                /* # of segments per id */
 
74
                  uint32 **n_frame,             /* # of frames per segment */
 
75
                  segdmp_type_t data_type,
 
76
                  uint32 n_stream,
 
77
                  uint32 *vecsize,
 
78
                  uint32 blksize
 
79
                  );
 
80
 
 
81
int
 
82
segdmp_close(void);
 
83
 
 
84
int
 
85
segdmp_add_feat(acmod_id_t p,
 
86
                vector_t **feat,
 
87
                uint32 n_frame);
 
88
 
 
89
/*
 
90
 * Segment dump reading
 
91
 */
 
92
int
 
93
segdmp_open_read(const char **dirs,             /* dump directories */
 
94
                 const char *dmp_fn,            /* dump file name */
 
95
                 const char *idx_fn,            /* index file name */
 
96
                 uint32 *n_id,                  /* # of id's */
 
97
                 segdmp_type_t *data_type, 
 
98
                 uint32 n_stream,
 
99
                 uint32 *vecsize,
 
100
                 uint32 blksize);
 
101
 
 
102
int
 
103
segdmp_next_feat(acmod_id_t p,
 
104
                 vector_t ***out_feat,  /* use feat_*() routines to find out other dims */
 
105
                 uint32 *out_n_frame);
 
106
 
 
107
/*
 
108
 * Segment dump state query calls
 
109
 */
 
110
 
 
111
uint32
 
112
segdmp_n_seg(uint32 id);
 
113
 
 
114
/*
 
115
 * Misc
 
116
 */
 
117
void
 
118
segdmp_set_bufsz(uint32 sz_in_meg);
 
119
 
 
120
 
 
121
#ifdef __cplusplus
 
122
}
 
123
#endif
 
124
#endif /* SEGDMP_H */