Ardour  9.0-pre0-582-g084a23a80d
decoder.h
Go to the documentation of this file.
1 /*
2  libltc - en+decode linear timecode
3 
4  Copyright (C) 2006-2012 Robin Gareus <robin@gareus.org>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as
8  published by the Free Software Foundation, either version 3 of the
9  License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with this library.
18  If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #include "ltc/ltc.h"
22 #ifndef SAMPLE_CENTER // also defined in encoder.h
23 #define SAMPLE_CENTER 128 // unsigned 8 bit.
24 #endif
25 
26 struct LTCDecoder {
28  int queue_len;
31 
32  unsigned char biphase_state;
33  unsigned char biphase_prev;
34  unsigned char snd_to_biphase_state;
38 
41 
42  unsigned short decoder_sync_word;
44  int bit_cnt;
45 
48 
51 };
52 
53 
54 void decode_ltc(LTCDecoder *d, ltcsnd_sample_t *sound, size_t size, ltc_off_t posinfo);
void decode_ltc(LTCDecoder *d, ltcsnd_sample_t *sound, size_t size, ltc_off_t posinfo)
libltc - en+decode linear timecode
unsigned char ltcsnd_sample_t
Definition: ltc.h:82
long long int ltc_off_t
Definition: ltc.h:87
#define LTC_FRAME_BIT_COUNT
Definition: ltc.h:89
int queue_read_off
Definition: decoder.h:29
ltcsnd_sample_t snd_to_biphase_max
Definition: decoder.h:40
ltcsnd_sample_t snd_to_biphase_min
Definition: decoder.h:39
double snd_to_biphase_period
track length of a period - used to set snd_to_biphase_lmt
Definition: decoder.h:37
ltc_off_t frame_start_off
Definition: decoder.h:46
int snd_to_biphase_lmt
specifies when a state-change is considered biphase-clock or 2*biphase-clock
Definition: decoder.h:36
unsigned char biphase_state
Definition: decoder.h:32
unsigned char biphase_prev
Definition: decoder.h:33
ltc_off_t frame_start_prev
Definition: decoder.h:47
int bit_cnt
Definition: decoder.h:44
float biphase_tics[LTC_FRAME_BIT_COUNT]
Definition: decoder.h:49
LTCFrame ltc_frame
Definition: decoder.h:43
unsigned short decoder_sync_word
Definition: decoder.h:42
int snd_to_biphase_cnt
counts the samples in the current period
Definition: decoder.h:35
unsigned char snd_to_biphase_state
Definition: decoder.h:34
LTCFrameExt * queue
Definition: decoder.h:27
int queue_write_off
Definition: decoder.h:30
int queue_len
Definition: decoder.h:28
int biphase_tic
Definition: decoder.h:50
Definition: ltc.h:218