
Data Structures | |
| struct | filter_sys_t |
| filter_sys_t: chroma method descriptor More... | |
Defines | |
| #define | FILTER_PREFIX "motiondetect-" |
| #define | NUM_COLORS (5000) |
| #define | CHECK(A) |
Functions | |
| static int | Create (vlc_object_t *) |
| static void | Destroy (vlc_object_t *) |
| int | vlc_entry__main (module_t *p_module) |
| const char * | vlc_entry_license__main (void) |
| static picture_t * | Filter (filter_t *, picture_t *) |
| static picture_t * | FilterPacked (filter_t *, picture_t *) |
| static void | GaussianConvolution (uint32_t *, uint32_t *, int, int, int) |
| static int | FindShapes (uint32_t *, uint32_t *, int, int, int, int *, int *, int *, int *, int *) |
| static void | Draw (filter_t *p_filter, uint8_t *p_pix, int i_pix_pitch, int i_pix_size) |
| #define CHECK | ( | A | ) |
Value:
if( p_smooth[A] && p_smooth[A] != p_smooth[i*i_pitch+j] ) \ { \ if( p_smooth[A] < p_smooth[i*i_pitch+j] ) \ colors[p_smooth[i*i_pitch+j]] = p_smooth[A]; \ else \ colors[p_smooth[A]] = p_smooth[i*i_pitch+j]; \ }
Referenced by FindShapes(), and yadif_filter_line_c().
| #define FILTER_PREFIX "motiondetect-" |
| #define NUM_COLORS (5000) |
Referenced by FindShapes().
| static int Create | ( | vlc_object_t * | p_this | ) | [static] |
References filter_sys_t::b_old, CASE_PACKED_YUV_422, CASE_PLANAR_YUV, Filter(), FilterPacked(), filter_t::fmt_in, video_format_t::i_chroma, video_format_t::i_height, video_format_t::i_width, msg_Err, filter_sys_t::p_buf, filter_sys_t::p_buf2, filter_sys_t::p_old, filter_t::p_sys, p_sys, picture_NewFromFormat(), picture_Release(), es_format_t::video, VLC_EGENERIC, VLC_ENOMEM, and VLC_SUCCESS.
| static void Destroy | ( | vlc_object_t * | p_this | ) | [static] |
References filter_sys_t::p_buf, filter_sys_t::p_buf2, filter_sys_t::p_old, filter_t::p_sys, p_sys, and picture_Release().
| static void Draw | ( | filter_t * | p_filter, | |
| uint8_t * | p_pix, | |||
| int | i_pix_pitch, | |||
| int | i_pix_size | |||
| ) | [static] |
References filter_sys_t::color_x_max, filter_sys_t::color_x_min, filter_sys_t::color_y_max, filter_sys_t::color_y_min, filter_sys_t::colors, i, filter_sys_t::i_colors, msg_Dbg, filter_t::p_sys, and p_sys.
Referenced by Filter(), and FilterPacked().
Substract Y planes
Get the areas where movement was detected
Count final number of shapes Draw rectangles (there can be more than 1 moving shape in 1 rectangle)
We're done. Lets keep a copy of the picture TODO we may just picture_Release with a latency of 1 if the filters/vout handle it correctly
References filter_sys_t::b_old, filter_sys_t::color_x_max, filter_sys_t::color_x_min, filter_sys_t::color_y_max, filter_sys_t::color_y_min, filter_sys_t::colors, Draw(), filter_NewPicture(), FindShapes(), filter_t::fmt_in, picture_t::format, i, video_format_t::i_chroma, filter_sys_t::i_colors, video_format_t::i_height, plane_t::i_pitch, video_format_t::i_width, msg_Warn, picture_t::p, filter_sys_t::p_buf, filter_sys_t::p_buf2, filter_sys_t::p_old, plane_t::p_pixels, filter_t::p_sys, p_sys, picture_Copy(), picture_Release(), U_PLANE, V_PLANE, es_format_t::video, VLC_CODEC_I420, VLC_CODEC_I422, VLC_CODEC_J420, VLC_CODEC_J422, VLC_CODEC_YV12, and Y_PLANE.
Get the areas where movement was detected
Count final number of shapes Draw rectangles (there can be more than 1 moving shape in 1 rectangle)
We're done. Lets keep a copy of the picture TODO we may just picture_Release with a latency of 1 if the filters/vout handle it correctly
References filter_sys_t::b_old, filter_sys_t::color_x_max, filter_sys_t::color_x_min, filter_sys_t::color_y_max, filter_sys_t::color_y_min, filter_sys_t::colors, Draw(), filter_NewPicture(), FindShapes(), filter_t::fmt_in, GetPackedYuvOffsets(), i, video_format_t::i_chroma, filter_sys_t::i_colors, video_format_t::i_height, plane_t::i_pitch, video_format_t::i_width, msg_Warn, picture_t::p, filter_sys_t::p_buf, filter_sys_t::p_buf2, filter_sys_t::p_old, plane_t::p_pixels, filter_t::p_sys, p_sys, picture_Copy(), picture_Release(), es_format_t::video, and Y_PLANE.
| static int FindShapes | ( | uint32_t * | p_diff, | |
| uint32_t * | p_smooth, | |||
| int | i_pitch, | |||
| int | i_visible, | |||
| int | i_lines, | |||
| int * | colors, | |||
| int * | color_x_min, | |||
| int * | color_x_max, | |||
| int * | color_y_min, | |||
| int * | color_y_max | |||
| ) | [static] |
Apply some smoothing to remove noise
Label the shapes and build the labels dependencies list
Initialise empty rectangle list
Compute rectangle coordinates
Merge overlaping rectangles
References __MAX, __MIN, CHECK, GaussianConvolution(), i, and NUM_COLORS.
Referenced by Filter(), and FilterPacked().
| static void GaussianConvolution | ( | uint32_t * | p_inpix, | |
| uint32_t * | p_smooth, | |||
| int | i_src_pitch, | |||
| int | i_num_lines, | |||
| int | i_src_visible | |||
| ) | [static] |
| int vlc_entry__main | ( | module_t * | p_module | ) |
| const char* vlc_entry_license__main | ( | void | ) |
1.5.6