LiVES  3.2.0
resample.h
Go to the documentation of this file.
1 // resample.h
2 // LiVES
3 // (c) G. Finch 2004 - 2016 <salsaman@gmail.com>
4 // released under the GNU GPL 3 or later
5 // see file ../COPYING or www.gnu.org for licensing details
6 
7 
8 // functions/structs for reordering, resampling video and audio
9 
10 #ifndef HAS_LIVES_RESAMPLE_H
11 #define HAS_LIVES_RESAMPLE_H
12 
13 #define RESIZE_ALL_NEEDS_CONVERT 0
14 #define LETTERBOX_NEEDS_COMPOSITE 1
15 #define LETTERBOX_NEEDS_CONVERT 1
16 
18 typedef struct __resaudw {
19  LiVESWidget *dialog;
20  LiVESWidget *entry_arate;
21  LiVESWidget *entry_achans;
22  LiVESWidget *entry_asamps;
23  LiVESWidget *rb_signed;
24  LiVESWidget *rb_unsigned;
25  LiVESWidget *rb_bigend;
26  LiVESWidget *rb_littleend;
27  LiVESWidget *unlim_radiobutton;
28  LiVESWidget *hour_spinbutton;
29  LiVESWidget *minute_spinbutton;
30  LiVESWidget *second_spinbutton;
31  LiVESWidget *fps_spinbutton;
32  LiVESWidget *aud_checkbutton;
33  LiVESWidget *aud_hbox;
34  LiVESWidget *vbox;
35 } _resaudw;
36 
37 
39 
40 ticks_t q_gint64(ticks_t in, double fps);
41 ticks_t q_gint64_floor(ticks_t in, double fps);
42 ticks_t q_dbl(double in, double fps);
43 
44 void reorder_leave_back_set(boolean val);
45 
46 size_t quant_asamps(double seek, int arate);
47 double quant_aseek(double seek, int arate);
48 off_t quant_abytes(double seek, int arate, int achans, int asampsize);
49 
50 #define SKJUMP_THRESH_RATIO 1.025
51 #define SKJUMP_THRESH_SECS 0.25
52 
53 weed_plant_t *quantise_events(weed_plant_t *in_list, double new_fps,
54  boolean allow_gap) WARN_UNUSED;
55 
57 int count_resampled_frames(int in_frames, double orig_fps, double resampled_fps);
58 
60 
61 // GUI functions
62 
67 _resaudw *create_resaudw(short type, render_details *, LiVESWidget *top_vbox);
68 
69 void on_change_speed_activate(LiVESMenuItem *, livespointer);
70 void on_change_speed_ok_clicked(LiVESButton *, livespointer);
71 
72 boolean auto_resample_resize(int width, int height, double fps, int fps_num,
73  int fps_denom, int arate, int asigned, boolean swap_endian);
74 int reorder_frames(int rwidth, int rheight);
75 int deorder_frames(int old_framecount, boolean leave_bak);
76 
77 boolean resample_clipboard(double new_fps);
78 
79 #endif
render_details
Definition: events.h:215
q_gint64
ticks_t q_gint64(ticks_t in, double fps)
Definition: resample.c:25
resaudw
_resaudw * resaudw
Definition: resample.h:38
auto_resample_resize
boolean auto_resample_resize(int width, int height, double fps, int fps_num, int fps_denom, int arate, int asigned, boolean swap_endian)
Definition: resample.c:80
on_change_speed_ok_clicked
void on_change_speed_ok_clicked(LiVESButton *, livespointer)
Definition: resample.c:2025
_resaudw::rb_unsigned
LiVESWidget * rb_unsigned
Definition: resample.h:24
q_gint64_floor
ticks_t q_gint64_floor(ticks_t in, double fps)
Definition: resample.c:35
_resaudw::vbox
LiVESWidget * vbox
Definition: resample.h:34
_resaudw::entry_arate
LiVESWidget * entry_arate
Definition: resample.h:20
_resaudw::entry_asamps
LiVESWidget * entry_asamps
Definition: resample.h:22
_resaudw::fps_spinbutton
LiVESWidget * fps_spinbutton
Definition: resample.h:31
quantise_events
weed_plant_t * quantise_events(weed_plant_t *in_list, double new_fps, boolean allow_gap) WARN_UNUSED
quantise frame events for a single clip
Definition: resample.c:456
ticks_t
int64_t ticks_t
Definition: main.h:97
_resaudw::dialog
LiVESWidget * dialog
Definition: resample.h:19
_resaudw::rb_littleend
LiVESWidget * rb_littleend
Definition: resample.h:26
quant_asamps
size_t quant_asamps(double seek, int arate)
convert seek time to an integer number of samples
Definition: resample.c:52
_resaudw::aud_checkbutton
LiVESWidget * aud_checkbutton
Definition: resample.h:32
on_change_speed_activate
void on_change_speed_activate(LiVESMenuItem *, livespointer)
Definition: resample.c:2017
_resaudw
resample audio window
Definition: resample.h:18
_resaudw::aud_hbox
LiVESWidget * aud_hbox
Definition: resample.h:33
quant_abytes
off_t quant_abytes(double seek, int arate, int achans, int asampsize)
Definition: resample.c:66
reorder_frames
int reorder_frames(int rwidth, int rheight)
Definition: resample.c:2106
_resaudw::rb_bigend
LiVESWidget * rb_bigend
Definition: resample.h:25
WARN_UNUSED
#define WARN_UNUSED
Definition: main.h:77
quant_aseek
double quant_aseek(double seek, int arate)
convert seek time (secs) to an (almost) integer number of samples
Definition: resample.c:58
_resaudw::rb_signed
LiVESWidget * rb_signed
Definition: resample.h:23
_resaudw::second_spinbutton
LiVESWidget * second_spinbutton
Definition: resample.h:30
_resaudw::entry_achans
LiVESWidget * entry_achans
Definition: resample.h:21
_resaudw::hour_spinbutton
LiVESWidget * hour_spinbutton
Definition: resample.h:28
resample_clipboard
boolean resample_clipboard(double new_fps)
call this to resample clipboard video
Definition: resample.c:2250
q_dbl
ticks_t q_dbl(double in, double fps)
Definition: resample.c:41
count_resampled_frames
int count_resampled_frames(int in_frames, double orig_fps, double resampled_fps)
Definition: resample.c:72
_resaudw::unlim_radiobutton
LiVESWidget * unlim_radiobutton
Definition: resample.h:27
create_resaudw
_resaudw * create_resaudw(short type, render_details *, LiVESWidget *top_vbox)
resample audio window
Definition: resample.c:1521
reorder_leave_back_set
void reorder_leave_back_set(boolean val)
Definition: resample.c:21
deorder_frames
int deorder_frames(int old_framecount, boolean leave_bak)
leave_bak is a special mode for the clipboard
Definition: resample.c:2208
_resaudw::minute_spinbutton
LiVESWidget * minute_spinbutton
Definition: resample.h:29