FFmpeg
Loading...
Searching...
No Matches
edge_common.c File Reference
#include "edge_common.h"
#include "edge_template.c"

Go to the source code of this file.

Macros

#define DEPTH   8
 
#define DEPTH   16
 
#define COPY_MAXIMA(ay, ax, by, bx)
 

Functions

static int get_rounded_direction (int gx, int gy)
 
void ff_non_maximum_suppression (int w, int h, uint8_t *dst, int dst_linesize, const int8_t *dir, int dir_linesize, const uint16_t *src, int src_linesize)
 Filters rounded gradients to drop all non-maxima pixels in the magnitude image Expects gradients generated by av_image_sobel() Expects zero's in the destination buffer dst.
 
void ff_double_threshold (int low, int high, int w, int h, uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize)
 Filters all pixels in src to keep all pixels > high, and keep all pixels > low where all surrounding pixels > high.
 

Macro Definition Documentation

◆ DEPTH [1/2]

#define DEPTH   8

Definition at line 50 of file edge_common.c.

◆ DEPTH [2/2]

#define DEPTH   16

Definition at line 50 of file edge_common.c.

◆ COPY_MAXIMA

#define COPY_MAXIMA ( ay,
ax,
by,
bx )
Value:
do { \
if (src[i] > src[(ay)*src_linesize + i+(ax)] && \
src[i] > src[(by)*src_linesize + i+(bx)]) \
} while (0)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define av_clip_uint8
Definition common.h:106
#define src
Definition vp8dsp.c:248

Referenced by ff_non_maximum_suppression().

Function Documentation

◆ get_rounded_direction()

static int get_rounded_direction ( int gx,
int gy )
static

Definition at line 22 of file edge_common.c.

Referenced by sobel().

◆ ff_non_maximum_suppression()

void ff_non_maximum_suppression ( int w,
int h,
uint8_t * dst,
int dst_linesize,
const int8_t * dir,
int dir_linesize,
const uint16_t * src,
int src_linesize )

Filters rounded gradients to drop all non-maxima pixels in the magnitude image Expects gradients generated by av_image_sobel() Expects zero's in the destination buffer dst.

Parameters
wthe width of the image in pixels
hthe height of the image in pixels
dstdata pointers to magnitude image
dst_linesizelinesizes for the magnitude image
dirdata pointers to direction image
dir_linesizelinesizes for the direction image
srcdata pointers to source image
src_linesizelinesizes for the source image

Definition at line 60 of file edge_common.c.

Referenced by blurdetect_filter_frame(), filter_frame(), and filter_frame().

◆ ff_double_threshold()

void ff_double_threshold ( int low,
int high,
int w,
int h,
uint8_t * dst,
int dst_linesize,
const uint8_t * src,
int src_linesize )

Filters all pixels in src to keep all pixels > high, and keep all pixels > low where all surrounding pixels > high.

Parameters
lowthe low threshold value
highthe hegh threshold value
wthe width of the image in pixels
hthe height of the image in pixels
dstdata pointers to destination image
dst_linesizelinesizes for the destination image
srcdata pointers to source image
src_linesizelinesizes for the source image

Definition at line 89 of file edge_common.c.

Referenced by blurdetect_filter_frame(), filter_frame(), and filter_frame().