Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
00a30b7b
Commit
00a30b7b
authored
Jan 09, 2003
by
Sam Hocevar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* ./modules/video_filter/*.c: all filters now properly use i_visible_pitch
instead of i_pitch for pixel access (Closes: #30).
parent
b7529857
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
210 additions
and
152 deletions
+210
-152
modules/video_filter/adjust.c
modules/video_filter/adjust.c
+24
-23
modules/video_filter/clone.c
modules/video_filter/clone.c
+20
-12
modules/video_filter/crop.c
modules/video_filter/crop.c
+22
-21
modules/video_filter/distort.c
modules/video_filter/distort.c
+28
-27
modules/video_filter/invert.c
modules/video_filter/invert.c
+34
-25
modules/video_filter/motionblur.c
modules/video_filter/motionblur.c
+59
-31
modules/video_filter/transform.c
modules/video_filter/transform.c
+12
-3
modules/video_filter/wall.c
modules/video_filter/wall.c
+11
-10
No files found.
modules/video_filter/adjust.c
View file @
00a30b7b
...
...
@@ -2,7 +2,7 @@
* adjust.c : Contrast/Hue/Saturation/Brightness video plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: adjust.c,v 1.
7 2003/01/09 16:26:14
sam Exp $
* $Id: adjust.c,v 1.
8 2003/01/09 17:47:05
sam Exp $
*
* Authors: Simon Latapie <garf@via.ecp.fr>, Samuel Hocevar <sam@zoy.org>
*
...
...
@@ -195,8 +195,8 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
int
pi_luma
[
256
];
picture_t
*
p_outpic
;
uint8_t
*
p_in
,
*
p_in_
u
,
*
p_in_
v
,
*
p_in_end
,
*
p_line_end
;
uint8_t
*
p_out
,
*
p_out_
u
,
*
p_out_
v
;
uint8_t
*
p_in
,
*
p_in_v
,
*
p_in_end
,
*
p_line_end
;
uint8_t
*
p_out
,
*
p_out_v
;
double
f_hue
;
int32_t
i_cont
,
i_lum
;
...
...
@@ -263,17 +263,18 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
}
p_in
+=
p_pic
->
p
[
0
].
i_pitch
-
p_pic
->
p
[
0
].
i_visible_pitch
;
p_out
+=
p_outpic
->
p
[
0
].
i_pitch
-
p_outpic
->
p
[
0
].
i_visible_pitch
;
}
/*
* Do the U and V planes
*/
p_in
_u
=
p_pic
->
p
[
1
].
p_pixels
;
p_in
=
p_pic
->
p
[
1
].
p_pixels
;
p_in_v
=
p_pic
->
p
[
2
].
p_pixels
;
p_in_end
=
p_in
_u
+
p_pic
->
p
[
1
].
i_lines
*
p_pic
->
p
[
1
].
i_pitch
-
8
;
p_in_end
=
p_in
+
p_pic
->
p
[
1
].
i_lines
*
p_pic
->
p
[
1
].
i_pitch
-
8
;
p_out
_u
=
p_outpic
->
p
[
1
].
p_pixels
;
p_out
=
p_outpic
->
p
[
1
].
p_pixels
;
p_out_v
=
p_outpic
->
p
[
2
].
p_pixels
;
i_sin
=
sin
(
f_hue
)
*
256
;
...
...
@@ -285,19 +286,19 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
if
(
i_sat
>
256
)
{
#define WRITE_UV_CLIP() \
i_u = *p_in
_u
++ ; i_v = *p_in_v++ ; \
*p_out
_u
++ = clip( (( ((i_u * i_cos + i_v * i_sin - i_x) >> 8) \
i_u = *p_in++ ; i_v = *p_in_v++ ; \
*p_out++ = clip( (( ((i_u * i_cos + i_v * i_sin - i_x) >> 8) \
* i_sat) >> 8) + 128); \
*p_out_v++ = clip( (( ((i_v * i_cos - i_u * i_sin - i_y) >> 8) \
* i_sat) >> 8) + 128)
uint8_t
i_u
,
i_v
;
for
(
;
p_in
_u
<
p_in_end
;
)
for
(
;
p_in
<
p_in_end
;
)
{
p_line_end
=
p_in
_u
+
p_pic
->
p
[
1
].
i_visible_pitch
-
8
;
p_line_end
=
p_in
+
p_pic
->
p
[
1
].
i_visible_pitch
-
8
;
for
(
;
p_in
_u
<
p_line_end
;
)
for
(
;
p_in
<
p_line_end
;
)
{
/* Do 8 pixels at a time */
WRITE_UV_CLIP
();
WRITE_UV_CLIP
();
...
...
@@ -308,33 +309,33 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
p_line_end
+=
8
;
for
(
;
p_in
_u
<
p_line_end
;
)
for
(
;
p_in
<
p_line_end
;
)
{
WRITE_UV_CLIP
();
}
p_in
_u
+=
p_pic
->
p
[
1
].
i_pitch
-
p_pic
->
p
[
1
].
i_visible_pitch
;
p_in
+=
p_pic
->
p
[
1
].
i_pitch
-
p_pic
->
p
[
1
].
i_visible_pitch
;
p_in_v
+=
p_pic
->
p
[
2
].
i_pitch
-
p_pic
->
p
[
2
].
i_visible_pitch
;
p_out
_u
+=
p_pic
->
p
[
1
].
i_pitch
-
p_
pic
->
p
[
1
].
i_visible_pitch
;
p_out_v
+=
p_
pic
->
p
[
2
].
i_pitch
-
p_
pic
->
p
[
2
].
i_visible_pitch
;
p_out
+=
p_outpic
->
p
[
1
].
i_pitch
-
p_out
pic
->
p
[
1
].
i_visible_pitch
;
p_out_v
+=
p_
outpic
->
p
[
2
].
i_pitch
-
p_out
pic
->
p
[
2
].
i_visible_pitch
;
}
}
else
{
#define WRITE_UV() \
i_u = *p_in
_u
++ ; i_v = *p_in_v++ ; \
*p_out
_u
++ = (( ((i_u * i_cos + i_v * i_sin - i_x) >> 8) \
i_u = *p_in++ ; i_v = *p_in_v++ ; \
*p_out++ = (( ((i_u * i_cos + i_v * i_sin - i_x) >> 8) \
* i_sat) >> 8) + 128; \
*p_out_v++ = (( ((i_v * i_cos - i_u * i_sin - i_y) >> 8) \
* i_sat) >> 8) + 128
uint8_t
i_u
,
i_v
;
for
(
;
p_in
_u
<
p_in_end
;
)
for
(
;
p_in
<
p_in_end
;
)
{
p_line_end
=
p_in
+
p_pic
->
p
[
1
].
i_visible_pitch
-
8
;
for
(
;
p_in
_u
<
p_line_end
;
)
for
(
;
p_in
<
p_line_end
;
)
{
/* Do 8 pixels at a time */
WRITE_UV
();
WRITE_UV
();
WRITE_UV
();
WRITE_UV
();
...
...
@@ -343,15 +344,15 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
p_line_end
+=
8
;
for
(
;
p_in
_u
<
p_line_end
;
)
for
(
;
p_in
<
p_line_end
;
)
{
WRITE_UV
();
}
p_in
_u
+=
p_pic
->
p
[
1
].
i_pitch
-
p_pic
->
p
[
1
].
i_visible_pitch
;
p_in
+=
p_pic
->
p
[
1
].
i_pitch
-
p_pic
->
p
[
1
].
i_visible_pitch
;
p_in_v
+=
p_pic
->
p
[
2
].
i_pitch
-
p_pic
->
p
[
2
].
i_visible_pitch
;
p_out
_u
+=
p_pic
->
p
[
1
].
i_pitch
-
p_
pic
->
p
[
1
].
i_visible_pitch
;
p_out_v
+=
p_
pic
->
p
[
2
].
i_pitch
-
p_
pic
->
p
[
2
].
i_visible_pitch
;
p_out
+=
p_outpic
->
p
[
1
].
i_pitch
-
p_out
pic
->
p
[
1
].
i_visible_pitch
;
p_out_v
+=
p_
outpic
->
p
[
2
].
i_pitch
-
p_out
pic
->
p
[
2
].
i_visible_pitch
;
}
}
...
...
modules/video_filter/clone.c
View file @
00a30b7b
...
...
@@ -2,7 +2,7 @@
* clone.c : Clone video plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: clone.c,v 1.
3 2002/11/28 17:35:00
sam Exp $
* $Id: clone.c,v 1.
4 2003/01/09 17:47:05
sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
...
...
@@ -217,24 +217,32 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
for
(
i_plane
=
0
;
i_plane
<
p_pic
->
i_planes
;
i_plane
++
)
{
u
8
*
p_in
,
*
p_in_end
,
*
p_out
;
u
int8_t
*
p_in
,
*
p_in_end
,
*
p_out
;
int
i_in_pitch
=
p_pic
->
p
[
i_plane
].
i_pitch
;
const
int
i_out_pitch
=
p_outpic
->
p
[
i_plane
].
i_pitch
;
const
int
i_copy_pitch
=
p_outpic
->
p
[
i_plane
].
i_visible_pitch
;
p_in
=
p_pic
->
p
[
i_plane
].
p_pixels
;
p_in_end
=
p_in
+
p_outpic
->
p
[
i_plane
].
i_lines
*
p_pic
->
p
[
i_plane
].
i_pitch
;
p_out
=
p_outpic
->
p
[
i_plane
].
p_pixels
;
if
(
i_in_pitch
==
i_copy_pitch
&&
i_out_pitch
==
i_copy_pitch
)
{
p_vout
->
p_vlc
->
pf_memcpy
(
p_out
,
p_in
,
i_in_pitch
*
p_outpic
->
p
[
i_plane
].
i_lines
);
}
else
{
p_in_end
=
p_in
+
i_in_pitch
*
p_outpic
->
p
[
i_plane
].
i_lines
;
while
(
p_in
<
p_in_end
)
{
p_vout
->
p_vlc
->
pf_memcpy
(
p_out
,
p_in
,
i_out
_pitch
);
p_vout
->
p_vlc
->
pf_memcpy
(
p_out
,
p_in
,
i_copy
_pitch
);
p_in
+=
i_in_pitch
;
p_out
+=
i_out_pitch
;
}
}
}
vout_UnlinkPicture
(
p_vout
->
p_sys
->
pp_vout
[
i_vout
],
p_outpic
);
vout_DisplayPicture
(
p_vout
->
p_sys
->
pp_vout
[
i_vout
],
p_outpic
);
...
...
modules/video_filter/crop.c
View file @
00a30b7b
...
...
@@ -2,7 +2,7 @@
* crop.c : Crop video plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: crop.c,v 1.
5 2002/12/06 16:34:07
sam Exp $
* $Id: crop.c,v 1.
6 2003/01/09 17:47:05
sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
...
...
@@ -98,7 +98,7 @@ static int Create( vlc_object_t *p_this )
if
(
p_vout
->
p_sys
==
NULL
)
{
msg_Err
(
p_vout
,
"out of memory"
);
return
1
;
return
VLC_ENOMEM
;
}
p_vout
->
pf_init
=
Init
;
...
...
@@ -107,7 +107,7 @@ static int Create( vlc_object_t *p_this )
p_vout
->
pf_render
=
Render
;
p_vout
->
pf_display
=
NULL
;
return
0
;
return
VLC_SUCCESS
;
}
/*****************************************************************************
...
...
@@ -122,7 +122,7 @@ static int Init( vout_thread_t *p_vout )
I_OUTPUTPICTURES
=
0
;
p_vout
->
p_sys
->
i_lastchange
=
0
;
p_vout
->
p_sys
->
b_changed
=
0
;
p_vout
->
p_sys
->
b_changed
=
VLC_FALSE
;
/* Initialize the output structure */
p_vout
->
output
.
i_chroma
=
p_vout
->
render
.
i_chroma
;
...
...
@@ -238,12 +238,12 @@ static int Init( vout_thread_t *p_vout )
if
(
p_vout
->
p_sys
->
p_vout
==
NULL
)
{
msg_Err
(
p_vout
,
"failed to create vout"
);
return
0
;
return
VLC_EGENERIC
;
}
ALLOCATE_DIRECTBUFFERS
(
VOUT_MAX_PICTURES
);
return
0
;
return
VLC_SUCCESS
;
}
/*****************************************************************************
...
...
@@ -284,7 +284,7 @@ static int Manage( vout_thread_t *p_vout )
{
if
(
!
p_vout
->
p_sys
->
b_changed
)
{
return
0
;
return
VLC_SUCCESS
;
}
vout_Destroy
(
p_vout
->
p_sys
->
p_vout
);
...
...
@@ -295,13 +295,13 @@ static int Manage( vout_thread_t *p_vout )
if
(
p_vout
->
p_sys
->
p_vout
==
NULL
)
{
msg_Err
(
p_vout
,
"failed to create vout"
);
return
1
;
return
VLC_EGENERIC
;
}
p_vout
->
p_sys
->
b_changed
=
0
;
p_vout
->
p_sys
->
b_changed
=
VLC_FALSE
;
p_vout
->
p_sys
->
i_lastchange
=
0
;
return
0
;
return
VLC_SUCCESS
;
}
/*****************************************************************************
...
...
@@ -339,9 +339,10 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
for
(
i_plane
=
0
;
i_plane
<
p_pic
->
i_planes
;
i_plane
++
)
{
u
8
*
p_in
,
*
p_out
,
*
p_out_end
;
u
int8_t
*
p_in
,
*
p_out
,
*
p_out_end
;
int
i_in_pitch
=
p_pic
->
p
[
i_plane
].
i_pitch
;
const
int
i_out_pitch
=
p_outpic
->
p
[
i_plane
].
i_pitch
;
const
int
i_copy_pitch
=
p_outpic
->
p
[
i_plane
].
i_visible_pitch
;
p_in
=
p_pic
->
p
[
i_plane
].
p_pixels
/* Skip the right amount of lines */
...
...
@@ -355,7 +356,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
while
(
p_out
<
p_out_end
)
{
p_vout
->
p_vlc
->
pf_memcpy
(
p_out
,
p_in
,
i_
out
_pitch
);
p_vout
->
p_vlc
->
pf_memcpy
(
p_out
,
p_in
,
i_
copy
_pitch
);
p_in
+=
i_in_pitch
;
p_out
+=
i_out_pitch
;
}
...
...
@@ -365,18 +366,17 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
vout_DisplayPicture
(
p_vout
->
p_sys
->
p_vout
,
p_outpic
);
/* The source image may still be in the cache ... parse it! */
if
(
!
p_vout
->
p_sys
->
b_autocrop
)
if
(
p_vout
->
p_sys
->
b_autocrop
)
{
return
;
}
UpdateStats
(
p_vout
,
p_pic
);
}
}
static
void
UpdateStats
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
)
{
uint8_t
*
p_in
=
p_pic
->
p
[
0
].
p_pixels
;
int
i_pitch
=
p_pic
->
p
[
0
].
i_pitch
;
int
i_visible_pitch
=
p_pic
->
p
[
0
].
i_visible_pitch
;
int
i_lines
=
p_pic
->
p
[
0
].
i_lines
;
int
i_firstwhite
=
-
1
,
i_lastwhite
=
-
1
,
i
;
...
...
@@ -391,8 +391,8 @@ static void UpdateStats( vout_thread_t *p_vout, picture_t *p_pic )
const
int
i_col
=
i
*
i_pitch
/
i_lines
;
if
(
p_in
[
i_col
/
2
]
>
40
&&
p_in
[
i_
pitch
/
2
]
>
40
&&
p_in
[
i_pitch
/
2
+
i_col
/
2
]
>
40
)
&&
p_in
[
i_
visible_pitch
/
2
]
>
40
&&
p_in
[
i_
visible_
pitch
/
2
+
i_col
/
2
]
>
40
)
{
if
(
i_lastwhite
==
-
1
)
{
...
...
@@ -457,5 +457,6 @@ static void UpdateStats( vout_thread_t *p_vout, picture_t *p_pic )
*
p_vout
->
output
.
i_height
/
p_vout
->
p_sys
->
i_height
*
p_vout
->
p_sys
->
i_width
/
p_vout
->
output
.
i_width
;
p_vout
->
p_sys
->
b_changed
=
1
;
p_vout
->
p_sys
->
b_changed
=
VLC_TRUE
;
}
modules/video_filter/distort.c
View file @
00a30b7b
...
...
@@ -2,7 +2,7 @@
* distort.c : Misc video effects plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: distort.c,v 1.
4 2002/11/28 17:35:00
sam Exp $
* $Id: distort.c,v 1.
5 2003/01/09 17:47:05
sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
...
...
@@ -99,7 +99,7 @@ static int Create( vlc_object_t *p_this )
if
(
p_vout
->
p_sys
==
NULL
)
{
msg_Err
(
p_vout
,
"out of memory"
);
return
(
1
)
;
return
VLC_ENOMEM
;
}
p_vout
->
pf_init
=
Init
;
...
...
@@ -113,7 +113,7 @@ static int Create( vlc_object_t *p_this )
if
(
!
(
psz_method
=
psz_method_tmp
=
config_GetPsz
(
p_vout
,
"filter"
))
)
{
msg_Err
(
p_vout
,
"configuration variable %s empty"
,
"filter"
);
return
(
1
)
;
return
VLC_EGENERIC
;
}
while
(
*
psz_method
&&
*
psz_method
!=
':'
)
{
...
...
@@ -150,7 +150,6 @@ static int Create( vlc_object_t *p_this )
{
p_vout
->
p_sys
->
i_mode
=
DISTORT_MODE_RIPPLE
;
}
else
{
msg_Err
(
p_vout
,
"no valid distort mode provided, "
...
...
@@ -161,7 +160,7 @@ static int Create( vlc_object_t *p_this )
}
free
(
psz_method_tmp
);
return
(
0
)
;
return
VLC_SUCCESS
;
}
/*****************************************************************************
...
...
@@ -192,7 +191,7 @@ static int Init( vout_thread_t *p_vout )
{
msg_Err
(
p_vout
,
"cannot open vout, aborting"
);
return
(
0
)
;
return
VLC_EGENERIC
;
}
ALLOCATE_DIRECTBUFFERS
(
VOUT_MAX_PICTURES
);
...
...
@@ -200,7 +199,7 @@ static int Init( vout_thread_t *p_vout )
p_vout
->
p_sys
->
f_angle
=
0
.
0
;
p_vout
->
p_sys
->
last_date
=
0
;
return
(
0
)
;
return
VLC_SUCCESS
;
}
/*****************************************************************************
...
...
@@ -290,8 +289,8 @@ static void DistortWave( vout_thread_t *p_vout, picture_t *p_inpic,
for
(
i_index
=
0
;
i_index
<
p_inpic
->
i_planes
;
i_index
++
)
{
int
i_line
,
i_num_lines
,
i_offset
;
u
8
black_pixel
;
u
8
*
p_in
,
*
p_out
;
u
int8_t
black_pixel
;
u
int8_t
*
p_in
,
*
p_out
;
p_in
=
p_inpic
->
p
[
i_index
].
p_pixels
;
p_out
=
p_outpic
->
p
[
i_index
].
p_pixels
;
...
...
@@ -304,7 +303,7 @@ static void DistortWave( vout_thread_t *p_vout, picture_t *p_inpic,
for
(
i_line
=
0
;
i_line
<
i_num_lines
;
i_line
++
)
{
/* Calculate today's offset, don't go above 1/20th of the screen */
i_offset
=
(
int
)(
(
double
)(
p_inpic
->
p
[
i_index
].
i_pitch
)
i_offset
=
(
int
)(
(
double
)(
p_inpic
->
p
[
i_index
].
i_
visible_
pitch
)
*
sin
(
f_angle
+
10
.
0
*
(
double
)
i_line
/
(
double
)
i_num_lines
)
/
20
.
0
);
...
...
@@ -314,7 +313,7 @@ static void DistortWave( vout_thread_t *p_vout, picture_t *p_inpic,
if
(
i_offset
<
0
)
{
p_vout
->
p_vlc
->
pf_memcpy
(
p_out
,
p_in
-
i_offset
,
p_inpic
->
p
[
i_index
].
i
_pitch
+
i_offset
);
p_inpic
->
p
[
i_index
].
i_visible
_pitch
+
i_offset
);
p_in
+=
p_inpic
->
p
[
i_index
].
i_pitch
;
p_out
+=
p_outpic
->
p
[
i_index
].
i_pitch
;
memset
(
p_out
+
i_offset
,
black_pixel
,
-
i_offset
);
...
...
@@ -322,7 +321,7 @@ static void DistortWave( vout_thread_t *p_vout, picture_t *p_inpic,
else
{
p_vout
->
p_vlc
->
pf_memcpy
(
p_out
+
i_offset
,
p_in
,
p_inpic
->
p
[
i_index
].
i
_pitch
-
i_offset
);
p_inpic
->
p
[
i_index
].
i_visible
_pitch
-
i_offset
);
memset
(
p_out
,
black_pixel
,
i_offset
);
p_in
+=
p_inpic
->
p
[
i_index
].
i_pitch
;
p_out
+=
p_outpic
->
p
[
i_index
].
i_pitch
;
...
...
@@ -331,7 +330,7 @@ static void DistortWave( vout_thread_t *p_vout, picture_t *p_inpic,
else
{
p_vout
->
p_vlc
->
pf_memcpy
(
p_out
,
p_in
,
p_inpic
->
p
[
i_index
].
i_pitch
);
p_inpic
->
p
[
i_index
].
i_
visible_
pitch
);
p_in
+=
p_inpic
->
p
[
i_index
].
i_pitch
;
p_out
+=
p_outpic
->
p
[
i_index
].
i_pitch
;
}
...
...
@@ -357,8 +356,8 @@ static void DistortRipple( vout_thread_t *p_vout, picture_t *p_inpic,
for
(
i_index
=
0
;
i_index
<
p_inpic
->
i_planes
;
i_index
++
)
{
int
i_line
,
i_first_line
,
i_num_lines
,
i_offset
;
u
8
black_pixel
;
u
8
*
p_in
,
*
p_out
;
u
int8_t
black_pixel
;
u
int8_t
*
p_in
,
*
p_out
;
black_pixel
=
(
i_index
==
Y_PLANE
)
?
0x00
:
0x80
;
...
...
@@ -369,11 +368,13 @@ static void DistortRipple( vout_thread_t *p_vout, picture_t *p_inpic,
p_in
=
p_inpic
->
p
[
i_index
].
p_pixels
;
p_out
=
p_outpic
->
p
[
i_index
].
p_pixels
;
for
(
i_line
=
0
;
i_line
<
i_first_line
;
i_line
++
)
{
p_vout
->
p_vlc
->
pf_memcpy
(
p_out
,
p_in
,
i_first_line
*
p_inpic
->
p
[
i_index
].
i
_pitch
);
p_in
+=
i_first_line
*
p_in
pic
->
p
[
i_index
].
i_pitch
;
p_out
+=
i_first_line
*
p_outpic
->
p
[
i_index
].
i_pitch
;
p_inpic
->
p
[
i_index
].
i_visible
_pitch
);
p_in
+=
p_inpic
->
p
[
i_index
].
i_pitch
;
p_out
+=
p_out
pic
->
p
[
i_index
].
i_pitch
;
}
/* Ok, we do 3 times the sin() calculation for each line. So what ? */
for
(
i_line
=
i_first_line
;
i_line
<
i_num_lines
;
i_line
++
)
...
...
@@ -392,7 +393,7 @@ static void DistortRipple( vout_thread_t *p_vout, picture_t *p_inpic,
if
(
i_offset
<
0
)
{
p_vout
->
p_vlc
->
pf_memcpy
(
p_out
,
p_in
-
i_offset
,
p_inpic
->
p
[
i_index
].
i
_pitch
+
i_offset
);
p_inpic
->
p
[
i_index
].
i_visible
_pitch
+
i_offset
);
p_in
-=
p_inpic
->
p
[
i_index
].
i_pitch
;
p_out
+=
p_outpic
->
p
[
i_index
].
i_pitch
;
memset
(
p_out
+
i_offset
,
black_pixel
,
-
i_offset
);
...
...
@@ -400,7 +401,7 @@ static void DistortRipple( vout_thread_t *p_vout, picture_t *p_inpic,
else
{
p_vout
->
p_vlc
->
pf_memcpy
(
p_out
+
i_offset
,
p_in
,
p_inpic
->
p
[
i_index
].
i
_pitch
-
i_offset
);
p_inpic
->
p
[
i_index
].
i_visible
_pitch
-
i_offset
);
memset
(
p_out
,
black_pixel
,
i_offset
);
p_in
-=
p_inpic
->
p
[
i_index
].
i_pitch
;
p_out
+=
p_outpic
->
p
[
i_index
].
i_pitch
;
...
...
@@ -409,7 +410,7 @@ static void DistortRipple( vout_thread_t *p_vout, picture_t *p_inpic,
else
{
p_vout
->
p_vlc
->
pf_memcpy
(
p_out
,
p_in
,
p_inpic
->
p
[
i_index
].
i_pitch
);
p_inpic
->
p
[
i_index
].
i_
visible_
pitch
);
p_in
-=
p_inpic
->
p
[
i_index
].
i_pitch
;
p_out
+=
p_outpic
->
p
[
i_index
].
i_pitch
;
}
...
...
modules/video_filter/invert.c
View file @
00a30b7b
...
...
@@ -2,7 +2,7 @@
* invert.c : Invert video plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: invert.c,v 1.
3 2002/11/28 17:35:00
sam Exp $
* $Id: invert.c,v 1.
4 2003/01/09 17:47:05
sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
...
...
@@ -182,34 +182,43 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
for
(
i_index
=
0
;
i_index
<
p_pic
->
i_planes
;
i_index
++
)
{
u
8
*
p_in
,
*
p_in
_end
,
*
p_out
;
u
int8_t
*
p_in
,
*
p_in_end
,
*
p_line
_end
,
*
p_out
;
p_in
=
p_pic
->
p
[
i_index
].
p_pixels
;
p_in_end
=
p_in
-
64
+
p_pic
->
p
[
i_index
].
i_lines
p_in_end
=
p_in
+
p_pic
->
p
[
i_index
].
i_lines
*
p_pic
->
p
[
i_index
].
i_pitch
;
p_out
=
p_outpic
->
p
[
i_index
].
p_pixels
;
for
(
;
p_in
<
p_in_end
;
)
{
p_line_end
=
p_in
+
p_pic
->
p
[
i_index
].
i_visible_pitch
-
64
;
for
(
;
p_in
<
p_line_end
;
)
{
/* Do 64 pixels at a time */
*
((
u64
*
)
p_out
)
++
=
~
(
*
((
u64
*
)
p_in
)
++
);
*
((
u64
*
)
p_out
)
++
=
~
(
*
((
u64
*
)
p_in
)
++
);
*
((
u64
*
)
p_out
)
++
=
~
(
*
((
u64
*
)
p_in
)
++
);
*
((
u64
*
)
p_out
)
++
=
~
(
*
((
u64
*
)
p_in
)
++
);
*
((
u64
*
)
p_out
)
++
=
~
(
*
((
u64
*
)
p_in
)
++
);
*
((
u64
*
)
p_out
)
++
=
~
(
*
((
u64
*
)
p_in
)
++
);
*
((
u64
*
)
p_out
)
++
=
~
(
*
((
u64
*
)
p_in
)
++
);
*
((
u64
*
)
p_out
)
++
=
~
(
*
((
u64
*
)
p_in
)
++
);
*
((
uint64_t
*
)
p_out
)
++
=
~
(
*
((
uint64_t
*
)
p_in
)
++
);
*
((
uint64_t
*
)
p_out
)
++
=
~
(
*
((
uint64_t
*
)
p_in
)
++
);
*
((
uint64_t
*
)
p_out
)
++
=
~
(
*
((
uint64_t
*
)
p_in
)
++
);
*
((
uint64_t
*
)
p_out
)
++
=
~
(
*
((
uint64_t
*
)
p_in
)
++
);
*
((
uint64_t
*
)
p_out
)
++
=
~
(
*
((
uint64_t
*
)
p_in
)
++
);
*
((
uint64_t
*
)
p_out
)
++
=
~
(
*
((
uint64_t
*
)
p_in
)
++
);
*
((
uint64_t
*
)
p_out
)
++
=
~
(
*
((
uint64_t
*
)
p_in
)
++
);
*
((
uint64_t
*
)
p_out
)
++
=
~
(
*
((
uint64_t
*
)
p_in
)
++
);
}
p_in
_end
+=
64
;
p_line
_end
+=
64
;
for
(
;
p_in
<
p_in
_end
;
)
for
(
;
p_in
<
p_line
_end
;
)
{
/* Do 1 pixel at a time */
*
p_out
++
=
~
(
*
p_in
++
);
}
p_in
+=
p_pic
->
p
[
i_index
].
i_pitch
-
p_pic
->
p
[
i_index
].
i_visible_pitch
;
p_out
+=
p_outpic
->
p
[
i_index
].
i_pitch
-
p_outpic
->
p
[
i_index
].
i_visible_pitch
;
}
}
vout_UnlinkPicture
(
p_vout
->
p_sys
->
p_vout
,
p_outpic
);
...
...
modules/video_filter/motionblur.c
View file @
00a30b7b
...
...
@@ -2,7 +2,7 @@
* motion_blur.c : motion blur filter for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: motionblur.c,v 1.
4 2002/11/28 17:35:00
sam Exp $
* $Id: motionblur.c,v 1.
5 2003/01/09 17:47:05
sam Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
...
...
@@ -91,7 +91,7 @@ static int Create( vlc_object_t *p_this )
if
(
p_vout
->
p_sys
==
NULL
)
{
msg_Err
(
p_vout
,
"out of memory"
);
return
1
;
return
VLC_ENOMEM
;
}
p_vout
->
pf_init
=
Init
;
...
...
@@ -105,7 +105,7 @@ static int Create( vlc_object_t *p_this )
p_vout
->
p_sys
->
last_date
=
0
;
p_vout
->
p_sys
->
p_lastpic
=
NULL
;
return
0
;
return
VLC_SUCCESS
;
}
/*****************************************************************************
...
...
@@ -133,7 +133,7 @@ static int Init( vout_thread_t *p_vout )
break
;
default:
return
0
;
/* unknown chroma */
return
VLC_EGENERIC
;
/* unknown chroma */
break
;
}
...
...
@@ -157,12 +157,12 @@ static int Init( vout_thread_t *p_vout )
{
msg_Err
(
p_vout
,
"cannot open vout, aborting"
);
return
0
;
return
VLC_EGENERIC
;
}
ALLOCATE_DIRECTBUFFERS
(
VOUT_MAX_PICTURES
);
return
0
;
return
VLC_SUCCESS
;
}
/*****************************************************************************
...
...
@@ -252,28 +252,44 @@ static void Render ( vout_thread_t *p_vout, picture_t *p_pic )
}
CopyPicture
(
p_vout
,
p_vout
->
p_sys
->
p_lastpic
,
p_outpic
);
vout_DisplayPicture
(
p_vout
->
p_sys
->
p_vout
,
p_outpic
);
}
static
void
CopyPicture
(
vout_thread_t
*
p_vout
,
picture_t
*
p_dest
,
picture_t
*
p_source
)
/* FIXME: this is a verbatim copy from src/video_output/vout_pictures.c */
/* XXX: the order is fucked up!! */
static
void
CopyPicture
(
vout_thread_t
*
p_vout
,
picture_t
*
p_dest
,
picture_t
*
p_src
)
{
int
i
_plane
;
int
i
;
for
(
i
_plane
=
0
;
i_plane
<
p_dest
->
i_planes
;
i_plane
++
)
for
(
i
=
0
;
i
<
p_src
->
i_planes
;
i
++
)
{
u8
*
p_in
,
*
p_out
;
p_in
=
p_source
->
p
[
i_plane
].
p_pixels
;
if
(
p_src
->
p
[
i
].
i_pitch
==
p_dest
->
p
[
i
].
i_pitch
)
{
/* There are margins, but with the same width : perfect ! */
p_vout
->
p_vlc
->
pf_memcpy
(
p_dest
->
p
[
i
].
p_pixels
,
p_src
->
p
[
i
].
p_pixels
,
p_src
->
p
[
i
].
i_pitch
*
p_src
->
p
[
i
].
i_lines
);
}
else
{
/* We need to proceed line by line */
uint8_t
*
p_in
=
p_src
->
p
[
i
].
p_pixels
;
uint8_t
*
p_out
=
p_dest
->
p
[
i
].
p_pixels
;
int
i_line
;
p_out
=
p_dest
->
p
[
i_plane
].
p_pixels
;
for
(
i_line
=
p_src
->
p
[
i
].
i_lines
;
i_line
--
;
)
{
p_vout
->
p_vlc
->
pf_memcpy
(
p_out
,
p_in
,
p_dest
->
p
[
i_plane
].
i_pitch
*
p_dest
->
p
[
i_plane
].
i_lines
);
p_src
->
p
[
i
].
i_visible_pitch
);
p_in
+=
p_src
->
p
[
i
].
i_pitch
;
p_out
+=
p_dest
->
p
[
i
].
i_pitch
;
}
}
}
}
/*****************************************************************************
* RenderB
ob: renders a bob
picture
* RenderB
lur: renders a blurred
picture
*****************************************************************************/
static
void
RenderBlur
(
vout_thread_t
*
p_vout
,
picture_t
*
p_oldpic
,
picture_t
*
p_newpic
,
picture_t
*
p_outpic
)
...
...
@@ -283,19 +299,31 @@ static void RenderBlur( vout_thread_t *p_vout, picture_t *p_oldpic,
int
i_newfactor
=
128
-
p_vout
->
p_sys
->
i_factor
;
for
(
i_plane
=
0
;
i_plane
<
p_outpic
->
i_planes
;
i_plane
++
)
{
u
8
*
p_old
,
*
p_new
,
*
p_out
,
*
p_out
_end
;
u
int8_t
*
p_old
,
*
p_new
,
*
p_out
,
*
p_out_end
,
*
p_out_line
_end
;
p_out
=
p_outpic
->
p
[
i_plane
].
p_pixels
;
p_new
=
p_newpic
->
p
[
i_plane
].
p_pixels
;
p_old
=
p_oldpic
->
p
[
i_plane
].
p_pixels
;
p_out_end
=
p_out
+
p_outpic
->
p
[
i_plane
].
i_pitch
*
p_outpic
->
p
[
i_plane
].
i_lines
;
while
(
p_out
<
p_out_end
)
{
p_out_line_end
=
p_out
+
p_outpic
->
p
[
i_plane
].
i_visible_pitch
;
while
(
p_out
<
p_out_line_end
)
{
*
p_out
++
=
(((
*
p_old
++
)
*
i_oldfactor
)
+
((
*
p_new
++
)
*
i_newfactor
))
>>
7
;
// *p_out++ = (*p_old++ >> 1) + (*p_new++ >> 1);
}
p_old
+=
p_oldpic
->
p
[
i_plane
].
i_pitch
-
p_oldpic
->
p
[
i_plane
].
i_visible_pitch
;
p_new
+=
p_newpic
->
p
[
i_plane
].
i_pitch
-
p_newpic
->
p
[
i_plane
].
i_visible_pitch
;
p_out
+=
p_outpic
->
p
[
i_plane
].
i_pitch
-
p_outpic
->
p
[
i_plane
].
i_visible_pitch
;
}
}
}
modules/video_filter/transform.c
View file @
00a30b7b
...
...
@@ -2,7 +2,7 @@
* transform.c : transform image plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: transform.c,v 1.
5 2003/01/09 14:00:00
sam Exp $
* $Id: transform.c,v 1.
6 2003/01/09 17:47:05
sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
...
...
@@ -288,7 +288,6 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
break
;
case
TRANSFORM_MODE_180
:
/* FIXME: we should use i_visible_pitch here */
for
(
i_index
=
0
;
i_index
<
p_pic
->
i_planes
;
i_index
++
)
{
uint8_t
*
p_in
=
p_pic
->
p
[
i_index
].
p_pixels
;
...
...
@@ -298,9 +297,19 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
uint8_t
*
p_out
=
p_outpic
->
p
[
i_index
].
p_pixels
;
for
(
;
p_in
<
p_in_end
;
)
{
uint8_t
*
p_line_start
=
p_in
-
p_pic
->
p
[
i_index
].
i_pitch
;
p_in_end
-=
p_pic
->
p
[
i_index
].
i_pitch
-
p_pic
->
p
[
i_index
].
i_visible_pitch
;
for
(
;
p_line_start
<
p_in_end
;
)
{
*
p_out
++
=
*
(
--
p_in_end
);
}
p_out
+=
p_outpic
->
p
[
i_index
].
i_pitch
-
p_outpic
->
p
[
i_index
].
i_visible_pitch
;
}
}
break
;
...
...
modules/video_filter/wall.c
View file @
00a30b7b
...
...
@@ -2,7 +2,7 @@
* wall.c : Wall video plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: wall.c,v 1.
4 2002/11/28 17:35:00
sam Exp $
* $Id: wall.c,v 1.
5 2003/01/09 17:47:05
sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
...
...
@@ -106,7 +106,7 @@ static int Create( vlc_object_t *p_this )
if
(
p_vout
->
p_sys
==
NULL
)
{
msg_Err
(
p_vout
,
"out of memory"
);
return
(
1
)
;
return
VLC_ENOMEM
;
}
p_vout
->
pf_init
=
Init
;
...
...
@@ -132,7 +132,7 @@ static int Create( vlc_object_t *p_this )
{
msg_Err
(
p_vout
,
"out of memory"
);
free
(
p_vout
->
p_sys
);
return
(
1
)
;
return
VLC_ENOMEM
;
}
psz_method_tmp
=
psz_method
=
config_GetPsz
(
p_vout
,
"wall-active"
);
...
...
@@ -185,7 +185,7 @@ static int Create( vlc_object_t *p_this )
free
(
psz_method_tmp
);
return
(
0
)
;
return
VLC_SUCCESS
;
}
/*****************************************************************************
...
...
@@ -258,7 +258,7 @@ static int Init( vout_thread_t *p_vout )
msg_Err
(
p_vout
,
"failed to get %ix%i vout threads"
,
p_vout
->
p_sys
->
i_col
,
p_vout
->
p_sys
->
i_row
);
RemoveAllVout
(
p_vout
);
return
0
;
return
VLC_EGENERIC
;
}
p_vout
->
p_sys
->
i_vout
++
;
...
...
@@ -267,7 +267,7 @@ static int Init( vout_thread_t *p_vout )
ALLOCATE_DIRECTBUFFERS
(
VOUT_MAX_PICTURES
);
return
(
0
)
;
return
VLC_SUCCESS
;
}
/*****************************************************************************
...
...
@@ -363,9 +363,10 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
for
(
i_plane
=
0
;
i_plane
<
p_pic
->
i_planes
;
i_plane
++
)
{
u
8
*
p_in
,
*
p_in_end
,
*
p_out
;
u
int8_t
*
p_in
,
*
p_in_end
,
*
p_out
;
int
i_in_pitch
=
p_pic
->
p
[
i_plane
].
i_pitch
;
int
i_out_pitch
=
p_outpic
->
p
[
i_plane
].
i_pitch
;
int
i_copy_pitch
=
p_outpic
->
p
[
i_plane
].
i_visible_pitch
;
p_in
=
p_pic
->
p
[
i_plane
].
p_pixels
+
pi_top_skip
[
i_plane
]
+
pi_left_skip
[
i_plane
];
...
...
@@ -377,7 +378,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
while
(
p_in
<
p_in_end
)
{
p_vout
->
p_vlc
->
pf_memcpy
(
p_out
,
p_in
,
i_
out
_pitch
);
p_vout
->
p_vlc
->
pf_memcpy
(
p_out
,
p_in
,
i_
copy
_pitch
);
p_in
+=
i_in_pitch
;
p_out
+=
i_out_pitch
;
}
...
...
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