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
b5c2d452
Commit
b5c2d452
authored
Aug 06, 2004
by
Sam Hocevar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Really fixed strict aliasing breakage here and there.
parent
7e6650a1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
29 deletions
+33
-29
modules/audio_filter/converter/float32tos16.c
modules/audio_filter/converter/float32tos16.c
+6
-7
modules/audio_filter/converter/s16tofloat32.c
modules/audio_filter/converter/s16tofloat32.c
+4
-4
modules/gui/skins2/x11/x11_window.cpp
modules/gui/skins2/x11/x11_window.cpp
+7
-4
modules/video_output/x11/xcommon.c
modules/video_output/x11/xcommon.c
+10
-7
modules/visualization/visual/effects.c
modules/visualization/visual/effects.c
+6
-7
No files found.
modules/audio_filter/converter/float32tos16.c
View file @
b5c2d452
...
...
@@ -2,7 +2,7 @@
* float32tos16.c : converter from float32 to signed 16 bits integer
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id
: float32tos16.c,v 1.14 2003/12/04 16:02:54 sam Exp
$
* $Id$
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -92,12 +92,11 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
else *p_out = *p_in * 32768.0;
#else
/* This is walken's trick based on IEEE float format. */
float
f_in
=
*
p_in
+
384
.
0
;
int32_t
i_in
;
i_in
=
*
(
int32_t
*
)(
intptr_t
)
&
f_in
;
if
(
i_in
>
0x43c07fff
)
*
p_out
=
32767
;
else
if
(
i_in
<
0x43bf8000
)
*
p_out
=
-
32768
;
else
*
p_out
=
i_in
-
0x43c00000
;
union
{
float
f
;
int32_t
i
;
}
u
;
u
.
f
=
*
p_in
+
384
.
0
;
if
(
u
.
i
>
0x43c07fff
)
*
p_out
=
32767
;
else
if
(
u
.
i
<
0x43bf8000
)
*
p_out
=
-
32768
;
else
*
p_out
=
u
.
i
-
0x43c00000
;
#endif
p_in
++
;
p_out
++
;
}
...
...
modules/audio_filter/converter/s16tofloat32.c
View file @
b5c2d452
...
...
@@ -2,7 +2,7 @@
* s16tofloat32.c : converter from signed 16 bits integer to float32
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id
: s16tofloat32.c,v 1.7 2003/12/04 16:02:54 sam Exp
$
* $Id$
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
...
...
@@ -95,9 +95,9 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
/* This is walken's trick based on IEEE float format. On my PIII
* this takes 16 seconds to perform one billion conversions, instead
* of 19 seconds for the above division. */
int32_t
i_out
=
*
p_in
+
0x43c00000
;
float
f_out
=
*
(
float
*
)(
intptr_t
)
&
i_out
;
*
p_out
=
f_out
-
384
.
0
;
union
{
float
f
;
int32_t
i
;
}
u
;
u
.
i
=
*
p_in
+
0x43c00000
;
*
p_out
=
u
.
f
-
384
.
0
;
#endif
p_in
--
;
p_out
--
;
...
...
modules/gui/skins2/x11/x11_window.cpp
View file @
b5c2d452
...
...
@@ -176,7 +176,10 @@ void X11Window::toggleOnTop( bool onTop ) const
{
int
i_ret
,
i_format
;
unsigned
long
i
,
i_items
,
i_bytesafter
;
Atom
net_wm_supported
,
net_wm_state
,
net_wm_state_on_top
,
*
p_args
=
NULL
;
Atom
net_wm_supported
,
net_wm_state
,
net_wm_state_on_top
;
union
{
Atom
*
p_atom
;
unsigned
char
*
p_char
;
}
p_args
;
p_args
.
p_atom
=
NULL
;
net_wm_supported
=
XInternAtom
(
XDISPLAY
,
"_NET_SUPPORTED"
,
False
);
...
...
@@ -185,7 +188,7 @@ void X11Window::toggleOnTop( bool onTop ) const
0
,
16384
,
False
,
AnyPropertyType
,
&
net_wm_supported
,
&
i_format
,
&
i_items
,
&
i_bytesafter
,
(
unsigned
char
**
)
(
intptr_t
)
&
p_args
);
(
unsigned
char
**
)
&
p_args
);
if
(
i_ret
!=
Success
||
i_items
==
0
)
return
;
/* Not supported */
...
...
@@ -195,10 +198,10 @@ void X11Window::toggleOnTop( bool onTop ) const
for
(
i
=
0
;
i
<
i_items
;
i
++
)
{
if
(
p_args
[
i
]
==
net_wm_state_on_top
)
break
;
if
(
p_args
.
p_atom
[
i
]
==
net_wm_state_on_top
)
break
;
}
XFree
(
p_args
);
XFree
(
p_args
.
p_atom
);
if
(
i
==
i_items
)
return
;
/* Not supported */
/* Switch "on top" status */
...
...
modules/video_output/x11/xcommon.c
View file @
b5c2d452
...
...
@@ -2187,7 +2187,10 @@ static void TestNetWMSupport( vout_thread_t *p_vout )
{
int
i_ret
,
i_format
;
unsigned
long
i
,
i_items
,
i_bytesafter
;
Atom
net_wm_supported
,
*
p_args
=
NULL
;
Atom
net_wm_supported
;
union
{
Atom
*
p_atom
;
unsigned
char
*
p_char
;
}
p_args
;
p_args
.
p_atom
=
NULL
;
p_vout
->
p_sys
->
b_net_wm_state_fullscreen
=
VLC_FALSE
;
p_vout
->
p_sys
->
b_net_wm_state_above
=
VLC_FALSE
;
...
...
@@ -2203,7 +2206,7 @@ static void TestNetWMSupport( vout_thread_t *p_vout )
0
,
16384
,
False
,
AnyPropertyType
,
&
net_wm_supported
,
&
i_format
,
&
i_items
,
&
i_bytesafter
,
(
unsigned
char
**
)
(
intptr_t
)
&
p_args
);
(
unsigned
char
**
)
&
p_args
);
if
(
i_ret
!=
Success
||
i_items
==
0
)
return
;
...
...
@@ -2224,23 +2227,23 @@ static void TestNetWMSupport( vout_thread_t *p_vout )
for
(
i
=
0
;
i
<
i_items
;
i
++
)
{
if
(
p_args
[
i
]
==
p_vout
->
p_sys
->
net_wm_state_fullscreen
)
if
(
p_args
.
p_atom
[
i
]
==
p_vout
->
p_sys
->
net_wm_state_fullscreen
)
{
msg_Dbg
(
p_vout
,
"Window manager supports _NET_WM_STATE_FULLSCREEN"
);
p_vout
->
p_sys
->
b_net_wm_state_fullscreen
=
VLC_TRUE
;
}
else
if
(
p_args
[
i
]
==
p_vout
->
p_sys
->
net_wm_state_above
)
else
if
(
p_args
.
p_atom
[
i
]
==
p_vout
->
p_sys
->
net_wm_state_above
)
{
msg_Dbg
(
p_vout
,
"Window manager supports _NET_WM_STATE_ABOVE"
);
p_vout
->
p_sys
->
b_net_wm_state_above
=
VLC_TRUE
;
}
else
if
(
p_args
[
i
]
==
p_vout
->
p_sys
->
net_wm_state_below
)
else
if
(
p_args
.
p_atom
[
i
]
==
p_vout
->
p_sys
->
net_wm_state_below
)
{
msg_Dbg
(
p_vout
,
"Window manager supports _NET_WM_STATE_BELOW"
);
p_vout
->
p_sys
->
b_net_wm_state_below
=
VLC_TRUE
;
}
else
if
(
p_args
[
i
]
==
p_vout
->
p_sys
->
net_wm_state_stays_on_top
)
else
if
(
p_args
.
p_atom
[
i
]
==
p_vout
->
p_sys
->
net_wm_state_stays_on_top
)
{
msg_Dbg
(
p_vout
,
"Window manager supports _NET_WM_STATE_STAYS_ON_TOP"
);
...
...
@@ -2248,7 +2251,7 @@ static void TestNetWMSupport( vout_thread_t *p_vout )
}
}
XFree
(
p_args
);
XFree
(
p_args
.
p_atom
);
}
/*****************************************************************************
...
...
modules/visualization/visual/effects.c
View file @
b5c2d452
...
...
@@ -2,7 +2,7 @@
* effects.c : Effects for the visualization system
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id
: effects.c,v 1.10 2003/12/04 16:02:54 sam Exp
$
* $Id$
*
* Authors: Clment Stenac <zorglub@via.ecp.fr>
*
...
...
@@ -146,12 +146,11 @@ int spectrum_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
/* Pasted from float32tos16.c */
for
(
i
=
p_buffer
->
i_nb_samples
*
p_effect
->
i_nb_chans
;
i
--
;
)
{
float
f_in
=
*
p_buffl
+
384
.
0
;
int32_t
i_in
;
i_in
=
*
(
int32_t
*
)(
intptr_t
)
&
f_in
;
if
(
i_in
>
0x43c07fff
)
*
p_buffs
=
32767
;
else
if
(
i_in
<
0x43bf8000
)
*
p_buffs
=
-
32768
;
else
*
p_buffs
=
i_in
-
0x43c00000
;
union
{
float
f
;
int32_t
i
;
}
u
;
u
.
f
=
*
p_buffl
+
384
.
0
;
if
(
u
.
i
>
0x43c07fff
)
*
p_buffs
=
32767
;
else
if
(
u
.
i
<
0x43bf8000
)
*
p_buffs
=
-
32768
;
else
*
p_buffs
=
u
.
i
-
0x43c00000
;
p_buffl
++
;
p_buffs
++
;
}
...
...
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