packetizer: a52: separate AC3 bitstream parsing
[vlc.git] / src / clock / clock_internal.h
blob21da59c075c915d36e5b51c56155a7d9aa5f7439
1 /*****************************************************************************
2 * clock_internal.h: Clock internal functions
3 *****************************************************************************
4 * Copyright (C) 2018 VLC authors and VideoLAN
6 * Authors: Christophe Massiot <massiot@via.ecp.fr>
7 * Laurent Aimar < fenrir _AT_ videolan _DOT_ org >
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #include <vlc_common.h>
26 /*****************************************************************************
27 * Structures
28 *****************************************************************************/
30 /**
31 * This structure holds long term average
33 typedef struct
35 vlc_tick_t i_value;
36 int i_residue;
38 int i_count;
39 int i_divider;
40 } average_t;
42 void AvgInit( average_t *, int i_divider );
43 void AvgClean( average_t * );
45 void AvgReset( average_t * );
46 void AvgUpdate( average_t *, vlc_tick_t i_value );
47 vlc_tick_t AvgGet( average_t * );
48 void AvgRescale( average_t *, int i_divider );
50 /* */
51 typedef struct
53 vlc_tick_t i_stream;
54 vlc_tick_t i_system;
55 } clock_point_t;
57 static inline clock_point_t clock_point_Create( vlc_tick_t i_stream, vlc_tick_t i_system )
59 clock_point_t p = { .i_stream = i_stream, .i_system = i_system };
60 return p;