Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
314aceb7
Commit
314aceb7
authored
Apr 21, 2007
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix i_pitch vs i_visible_pitch bug.
parent
5f247d8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
13 deletions
+11
-13
modules/video_filter/noise.c
modules/video_filter/noise.c
+11
-13
No files found.
modules/video_filter/noise.c
View file @
314aceb7
...
@@ -27,8 +27,6 @@
...
@@ -27,8 +27,6 @@
#include <stdlib.h>
/* malloc(), free() */
#include <stdlib.h>
/* malloc(), free() */
#include <string.h>
#include <string.h>
#include <math.h>
/* sin(), cos() */
#include <vlc/vlc.h>
#include <vlc/vlc.h>
#include <vlc_vout.h>
#include <vlc_vout.h>
...
@@ -140,22 +138,22 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
...
@@ -140,22 +138,22 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
for
(
i_index
=
0
;
i_index
<
p_pic
->
i_planes
;
i_index
++
)
for
(
i_index
=
0
;
i_index
<
p_pic
->
i_planes
;
i_index
++
)
{
{
int
i_line
,
i_num_lines
,
i_col
,
i_num_co
ls
;
uint8_t
*
p_in
=
p_pic
->
p
[
i_index
].
p_pixe
ls
;
uint8_t
*
p_
in
,
*
p_out
;
uint8_t
*
p_
out
=
p_outpic
->
p
[
i_index
].
p_pixels
;
p_in
=
p_pic
->
p
[
i_index
].
p_pixels
;
const
int
i_num_lines
=
p_pic
->
p
[
i_index
].
i_visible_lines
;
p_out
=
p_outpic
->
p
[
i_index
].
p_pixels
;
const
int
i_num_cols
=
p_pic
->
p
[
i_index
].
i_visible_pitch
;
const
int
i_pitch
=
p_pic
->
p
[
i_index
].
i_pitch
;
i_num_lines
=
p_pic
->
p
[
i_index
].
i_visible_lines
;
int
i_line
,
i_col
;
i_num_cols
=
p_pic
->
p
[
i_index
].
i_visible_pitch
;
for
(
i_line
=
0
;
i_line
<
i_num_lines
;
i_line
++
)
for
(
i_line
=
0
;
i_line
<
i_num_lines
;
i_line
++
)
{
{
if
(
rand
()
%
8
)
if
(
rand
()
%
8
)
{
{
/* line isn't noisy */
/* line isn't noisy */
p_filter
->
p_libvlc
->
pf_memcpy
(
p_out
+
i_line
*
i_
num_cols
,
p_filter
->
p_libvlc
->
pf_memcpy
(
p_out
+
i_line
*
i_
pitch
,
p_in
+
i_line
*
i_
num_cols
,
p_in
+
i_line
*
i_
pitch
,
i_num_cols
);
i_num_cols
);
}
}
else
else
...
@@ -166,12 +164,12 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
...
@@ -166,12 +164,12 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
{
{
if
(
rand
()
%
noise_level
)
if
(
rand
()
%
noise_level
)
{
{
p_out
[
i_line
*
i_
num_cols
+
i_col
]
=
p_out
[
i_line
*
i_
pitch
+
i_col
]
=
p_in
[
i_line
*
i_
num_cols
+
i_col
];
p_in
[
i_line
*
i_
pitch
+
i_col
];
}
}
else
else
{
{
p_out
[
i_line
*
i_
num_cols
+
i_col
]
=
(
rand
()
%
3
)
*
0x7f
;
p_out
[
i_line
*
i_
pitch
+
i_col
]
=
(
rand
()
%
3
)
*
0x7f
;
}
}
}
}
}
}
...
...
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