~ubuntu-branches/ubuntu/trusty/libdv/trusty

« back to all changes in this revision

Viewing changes to libdv/enc_audio_input.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2004-07-19 12:19:44 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040719121944-17vuryc01yeyx8hf
Tags: 0.103-2
* debian/rules: Provide separate doc directory for libdv4-dev.
* debian/libdv4-dev.links: No longer symlink doc dir to the one
  from libdv4.
* debian/NEWS: Only install into libdv4-dev. Closes: #259694

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 *  codec.
8
8
 *
9
9
 *  libdv is free software; you can redistribute it and/or modify it
10
 
 *  under the terms of the GNU General Public License as published by
11
 
 *  the Free Software Foundation; either version 2, or (at your
 
10
 *  under the terms of the GNU Lesser Public License as published by
 
11
 *  the Free Software Foundation; either version 2.1, or (at your
12
12
 *  option) any later version.
13
13
 *   
14
14
 *  libdv is distributed in the hope that it will be useful, but
15
15
 *  WITHOUT ANY WARRANTY; without even the implied warranty of
16
16
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17
 
 *  General Public License for more details.
 
17
 *  Lesser Public License for more details.
18
18
 *   
19
 
 *  You should have received a copy of the GNU General Public License
20
 
 *  along with GNU Make; see the file COPYING.  If not, write to
 
19
 *  You should have received a copy of the GNU Lesser Public License
 
20
 *  along with libdv; see the file COPYING.  If not, write to
21
21
 *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
22
22
 *
23
23
 *  The libdv homepage is http://libdv.sourceforge.net/.  
24
24
 */
25
25
 
 
26
#if HAVE_CONFIG_H
 
27
# include <config.h>
 
28
#endif
 
29
 
26
30
#include <stdio.h>
27
31
#include <stdlib.h>
28
32
#include <signal.h>
107
111
}
108
112
 
109
113
 
110
 
unsigned long read_long(FILE* in_wav)
 
114
static unsigned long read_long(FILE* in_wav)
111
115
{
112
116
        unsigned char buf[4];
113
117
 
119
123
        return buf[0] + (buf[1] << 8) + (buf[2] << 16) + (buf[3] << 24);
120
124
}
121
125
 
122
 
unsigned long read_short(FILE* in_wav)
 
126
static unsigned long read_short(FILE* in_wav)
123
127
{
124
128
        unsigned char buf[2];
125
129
        if (fread(buf, 1, 2, in_wav) != 2) {
130
134
        return buf[0] + (buf[1] << 8);
131
135
}
132
136
 
133
 
void read_header(FILE* in_wav, char* header)
 
137
static void read_header(FILE* in_wav, char* header)
134
138
{
135
139
        unsigned char buf[4];
136
140
 
145
149
        }
146
150
}
147
151
 
148
 
int parse_wave_header(FILE* in_wav, dv_enc_audio_info_t * res)
 
152
static int parse_wave_header(FILE* in_wav, dv_enc_audio_info_t * res)
149
153
{
150
154
        unsigned char fmt_header_junk[1024];
151
155
        int header_len;
224
228
 
225
229
static FILE* audio_fp = NULL;
226
230
 
227
 
int wav_init(const char* filename, dv_enc_audio_info_t * audio_info)
 
231
static int wav_init(const char* filename, dv_enc_audio_info_t * audio_info)
228
232
{
229
233
        audio_fp = fopen(filename, "r");
230
234
 
242
246
        return(0);
243
247
}
244
248
 
245
 
void wav_finish()
 
249
static void wav_finish()
246
250
{
247
251
        fclose(audio_fp);
248
252
}
249
253
 
250
 
int wav_load(dv_enc_audio_info_t * audio_info, int isPAL)
 
254
static int wav_load(dv_enc_audio_info_t * audio_info, int isPAL)
251
255
{
252
256
        int rval;
253
 
        unsigned char data[1920 * 2 * 2];
 
257
        unsigned char data[DV_AUDIO_MAX_SAMPLES * 2 * 2];
254
258
 
255
259
        bytesperframe(audio_info, isPAL);
256
260
 
352
356
static int dsp_load(dv_enc_audio_info_t * audio_info, int isPAL)
353
357
{
354
358
        int rval;
355
 
        unsigned char data[1920 * 2 * 2];
 
359
        unsigned char data[DV_AUDIO_MAX_SAMPLES * 2 * 2];
356
360
        int wanted = audio_info->bytesperframe * dsp_bytes_per_sample / 4;
357
361
 
358
362
        bytesperframe(audio_info, isPAL);
384
388
        p->filter_name = NULL;
385
389
}
386
390
 
387
 
int get_dv_enc_audio_input_filters(dv_enc_audio_input_filter_t ** filters_,
 
391
int dv_enc_get_audio_input_filters(dv_enc_audio_input_filter_t ** filters_,
388
392
                                   int * count)
389
393
{
390
394
        dv_enc_audio_input_filter_t * p = filters;