Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
f6b0cce8
Commit
f6b0cce8
authored
Mar 31, 2007
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also use the V plane for motion detection. Remove unused code.
parent
da065dee
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
39 deletions
+11
-39
modules/video_filter/motiondetect.c
modules/video_filter/motiondetect.c
+11
-39
No files found.
modules/video_filter/motiondetect.c
View file @
f6b0cce8
...
...
@@ -161,19 +161,12 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_inpic )
}
p_outpix
=
p_outpic
->
p
[
Y_PLANE
].
p_pixels
;
#if 0
p_filter->p_libvlc->pf_memset( p_outpic->p[U_PLANE].p_pixels, 0x80,
p_inpic->p[U_PLANE].i_pitch * p_inpic->p[U_PLANE].i_visible_lines );
p_filter->p_libvlc->pf_memset( p_outpic->p[V_PLANE].p_pixels, 0x80,
p_inpic->p[V_PLANE].i_pitch * p_inpic->p[V_PLANE].i_visible_lines );
#else
p_filter
->
p_libvlc
->
pf_memcpy
(
p_outpic
->
p
[
U_PLANE
].
p_pixels
,
p_inpic
->
p
[
U_PLANE
].
p_pixels
,
p_inpic
->
p
[
U_PLANE
].
i_pitch
*
p_inpic
->
p
[
U_PLANE
].
i_visible_lines
);
p_filter
->
p_libvlc
->
pf_memcpy
(
p_outpic
->
p
[
V_PLANE
].
p_pixels
,
p_inpic
->
p
[
V_PLANE
].
p_pixels
,
p_inpic
->
p
[
V_PLANE
].
i_pitch
*
p_inpic
->
p
[
V_PLANE
].
i_visible_lines
);
#endif
if
(
!
p_sys
->
p_oldpix
||
!
p_sys
->
p_buf
)
{
...
...
@@ -247,6 +240,14 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_inpic )
{
diff
=
p_oldpix_u
[
i
]
-
p_inpix_u
[
i
];
}
if
(
p_inpix_v
[
i
]
>
p_oldpix_v
[
i
]
)
{
diff
+=
p_inpix_v
[
i
]
-
p_oldpix_v
[
i
];
}
else
{
diff
+=
p_oldpix_v
[
i
]
-
p_inpix_v
[
i
];
}
switch
(
format
)
{
case
1
:
...
...
@@ -268,32 +269,15 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_inpic )
/**
* Apply some smoothing to remove noise
*/
#if 1
GaussianConvolution
(
p_buf2
,
p_buf
,
i_src_pitch
,
i_num_lines
,
i_src_visible
);
#else
uint32_t
*
pouet
=
p_buf2
;
p_buf2
=
p_buf
;
p_buf
=
pouet
;
#endif
/**
* Copy luminance plane
*/
for
(
i
=
0
;
i
<
i_src_pitch
*
i_num_lines
;
i
++
)
{
/*if( p_buf[i] > 25 )
{
//p_outpix[i] = 255;
}
else// if( p_buf[i] > 15 )*/
{
p_outpix
[
i
]
=
p_inpix
[
i
];
}
/*else
{
p_outpix[i] = 0;
}*/
}
/**
* Label the shapes ans build the labels dependencies list
...
...
@@ -372,7 +356,6 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_inpic )
{
while
(
colors
[
p_buf
[
i
]]
!=
p_buf
[
i
]
)
p_buf
[
i
]
=
colors
[
p_buf
[
i
]];
//p_outpix[i] = /*(p_buf[i]%2) */ 0xff;
if
(
color_x_min
[
p_buf
[
i
]]
==
-
1
)
{
color_x_min
[
p_buf
[
i
]]
=
...
...
@@ -432,7 +415,6 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_inpic )
if
(
(
color_y_max
[
i
]
-
color_y_min
[
i
]
)
*
(
color_x_max
[
i
]
-
color_x_min
[
i
]
)
<
16
)
continue
;
j
++
;
int
x
,
y
;
#if 1
y
=
color_y_min
[
i
];
for
(
x
=
color_x_min
[
i
];
x
<=
color_x_max
[
i
];
x
++
)
{
...
...
@@ -453,22 +435,12 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_inpic )
{
p_outpix
[
y
*
i_src_pitch
+
x
]
=
0xff
;
}
#else
for
(
x
=
color_x_min
[
i
];
x
<=
color_x_max
[
i
];
x
++
)
{
for
(
y
=
color_y_min
[
i
];
y
<=
color_y_max
[
i
];
y
++
)
{
p_outpix
[
y
*
i_src_pitch
+
x
]
=
0x0
;
//p_inpix[y*i_src_pitch+x];
}
}
#endif
}
}
printf
(
"counted %d moving shapes
\n
"
,
j
);
msg_Dbg
(
p_filter
,
"Counted %d moving shapes.
"
,
j
);
/**
* We're done. Lets keep a copy of the
Y plan
e
* We're done. Lets keep a copy of the
pictur
e
*/
p_filter
->
p_libvlc
->
pf_memcpy
(
p_oldpix
,
p_inpix
,
i_src_pitch
*
i_num_lines
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment