diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-02-01 08:20:48 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-02-01 08:20:48 +0100 |
commit | 279db4fbc92aab6eb3d1c3e6a31ca23aea7d4ba6 (patch) | |
tree | b2f8debc20ca90c4755e193f483303a05cfb241f /src/cuttime.c | |
parent | 2957803c5da9aab1cecac3dcdfaf7fcd9c5e49fd (diff) | |
download | advtime-279db4fbc92aab6eb3d1c3e6a31ca23aea7d4ba6.tar.gz advtime-279db4fbc92aab6eb3d1c3e6a31ca23aea7d4ba6.tar.bz2 advtime-279db4fbc92aab6eb3d1c3e6a31ca23aea7d4ba6.zip |
Put frame_diff and pswap into util
Diffstat (limited to 'src/cuttime.c')
-rw-r--r-- | src/cuttime.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/cuttime.c b/src/cuttime.c index 8fd8a7a..422e4be 100644 --- a/src/cuttime.c +++ b/src/cuttime.c @@ -7,16 +7,6 @@ #include "video_decode.h" #include "util.h" -static inline void -pswap(void **p1, void **p2) -{ - void *tmp; - - tmp = *p1; - *p1 = *p2; - *p2 = tmp; -} - static void start_new_szene(int64_t prev_szene_end, int64_t start) { @@ -29,28 +19,6 @@ start_new_szene(int64_t prev_szene_end, int64_t start) } static double -frame_diff(struct video_frame *frame_a, struct video_frame *frame_b) -{ - double average = 0; - uint8_t *row_a = frame_a->data, *col_a = NULL; - uint8_t *row_b = frame_b->data, *col_b = NULL; - - for (int y = 0; y < frame_a->height; ++y) { - col_a = row_a; - col_b = row_b; - for (int x = 0; x < frame_a->width; ++x) { - average += abs(*col_a - *col_b); - col_a++; - col_b++; - } - row_a += frame_a->stride; - row_b += frame_b->stride; - } - - return average / (frame_a->width * frame_a->height); -} - -static double frame_average(struct video_frame *frame) { double average = 0; |