/* See LICENSE file for copyright and license details. */ #ifndef DIFF_H #define DIFF_H #include #include #include /* * 64-bit perceptual hash (8x8 average hash). * Two frames with hamming distance <= threshold are * considered duplicates. */ uint64_t diff_phash(AVFrame *frame, struct SwsContext *sws, int src_w, int src_h); int diff_hamming(uint64_t a, uint64_t b); /* * Save an RGB frame to disk as PNG or JPEG. * fmt: "png" or "jpg" */ int diff_save_frame(AVFrame *frame, struct SwsContext *sws_rgb, int src_w, int src_h, const char *path, const char *fmt); #endif /* DIFF_H */