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
df4da384
Commit
df4da384
authored
Aug 22, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use standard abs() function where appropriate
parent
a62b01ec
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
19 deletions
+13
-19
modules/control/dbus/dbus.c
modules/control/dbus/dbus.c
+1
-1
modules/control/dbus/dbus.h
modules/control/dbus/dbus.h
+0
-1
modules/demux/avi/avi.c
modules/demux/avi/avi.c
+3
-5
modules/video_filter/deinterlace/common.h
modules/video_filter/deinterlace/common.h
+0
-1
modules/video_filter/deinterlace/yadif.h
modules/video_filter/deinterlace/yadif.h
+8
-8
modules/video_filter/hqdn3d.h
modules/video_filter/hqdn3d.h
+1
-3
No files found.
modules/control/dbus/dbus.c
View file @
df4da384
...
...
@@ -931,7 +931,7 @@ static int InputIntfEventCallback( intf_thread_t *p_intf,
p_intf
->
p_sys
->
i_last_input_pos_event
=
i_now
;
p_intf
->
p_sys
->
i_last_input_pos
=
i_pos
;
if
(
ABS
(
i_pos
-
i_projected_pos
)
<
SEEK_THRESHOLD
)
if
(
llabs
(
i_pos
-
i_projected_pos
)
<
SEEK_THRESHOLD
)
break
;
p_info
->
signal
=
SIGNAL_SEEK
;
...
...
modules/control/dbus/dbus.h
View file @
df4da384
...
...
@@ -38,7 +38,6 @@ static const DBusObjectPathVTable dbus_mpris_vtable = {
NULL
,
NULL
,
NULL
,
NULL
};
#define ABS(x) ( ( x ) > 0 ? ( x ) : ( -1 * ( x ) ) )
#define SEEK_THRESHOLD 1000
/* µsec */
#endif //dbus.h
modules/demux/avi/avi.c
View file @
df4da384
...
...
@@ -91,8 +91,6 @@ static int Seek ( demux_t *, mtime_t, int );
static
int
Demux_Seekable
(
demux_t
*
);
static
int
Demux_UnSeekable
(
demux_t
*
);
#define __ABS( x ) ( (x) < 0 ? (-(x)) : (x) )
static
char
*
FromACP
(
const
char
*
str
)
{
return
FromCharset
(
vlc_pgettext
(
"GetACP"
,
"CP1252"
),
str
,
strlen
(
str
));
...
...
@@ -893,11 +891,11 @@ static int Demux_Seekable( demux_t *p_demux )
if
(
tk
->
i_samplesize
)
{
toread
[
i_track
].
i_toread
=
AVI_PTSToByte
(
tk
,
__ABS
(
i_dpts
)
);
toread
[
i_track
].
i_toread
=
AVI_PTSToByte
(
tk
,
llabs
(
i_dpts
)
);
}
else
{
toread
[
i_track
].
i_toread
=
AVI_PTSToChunk
(
tk
,
__ABS
(
i_dpts
)
);
toread
[
i_track
].
i_toread
=
AVI_PTSToChunk
(
tk
,
llabs
(
i_dpts
)
);
}
if
(
i_dpts
<
0
)
...
...
@@ -1248,7 +1246,7 @@ static int Demux_UnSeekable( demux_t *p_demux )
else
{
/* check for time */
if
(
__ABS
(
AVI_GetPTS
(
p_stream
)
-
if
(
llabs
(
AVI_GetPTS
(
p_stream
)
-
AVI_GetPTS
(
p_stream_master
)
)
<
600
*
1000
)
{
/* load it and send to decoder */
...
...
modules/video_filter/deinterlace/common.h
View file @
df4da384
...
...
@@ -30,7 +30,6 @@
*/
/* Needed for Yadif, but also some others. */
#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
#define FFMAX(a,b) __MAX(a,b)
#define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
#define FFMIN(a,b) __MIN(a,b)
...
...
modules/video_filter/deinterlace/yadif.h
View file @
df4da384
...
...
@@ -88,18 +88,18 @@ static void yadif_filter_line_c(uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8
int
c
=
cur
[
mrefs
];
int
d
=
(
prev2
[
0
]
+
next2
[
0
])
>>
1
;
int
e
=
cur
[
prefs
];
int
temporal_diff0
=
FFABS
(
prev2
[
0
]
-
next2
[
0
]);
int
temporal_diff1
=
(
FFABS
(
prev
[
mrefs
]
-
c
)
+
FFABS
(
prev
[
prefs
]
-
e
)
)
>>
1
;
int
temporal_diff2
=
(
FFABS
(
next
[
mrefs
]
-
c
)
+
FFABS
(
next
[
prefs
]
-
e
)
)
>>
1
;
int
temporal_diff0
=
abs
(
prev2
[
0
]
-
next2
[
0
]);
int
temporal_diff1
=
(
abs
(
prev
[
mrefs
]
-
c
)
+
abs
(
prev
[
prefs
]
-
e
)
)
>>
1
;
int
temporal_diff2
=
(
abs
(
next
[
mrefs
]
-
c
)
+
abs
(
next
[
prefs
]
-
e
)
)
>>
1
;
int
diff
=
FFMAX3
(
temporal_diff0
>>
1
,
temporal_diff1
,
temporal_diff2
);
int
spatial_pred
=
(
c
+
e
)
>>
1
;
int
spatial_score
=
FFABS
(
cur
[
mrefs
-
1
]
-
cur
[
prefs
-
1
])
+
FFABS
(
c
-
e
)
+
FFABS
(
cur
[
mrefs
+
1
]
-
cur
[
prefs
+
1
])
-
1
;
int
spatial_score
=
abs
(
cur
[
mrefs
-
1
]
-
cur
[
prefs
-
1
])
+
abs
(
c
-
e
)
+
abs
(
cur
[
mrefs
+
1
]
-
cur
[
prefs
+
1
])
-
1
;
#define CHECK(j)\
{ int score=
FFABS
(cur[mrefs-1+j] - cur[prefs-1-j])\
+
FFABS
(cur[mrefs +j] - cur[prefs -j])\
+
FFABS
(cur[mrefs+1+j] - cur[prefs+1-j]);\
{ int score=
abs
(cur[mrefs-1+j] - cur[prefs-1-j])\
+
abs
(cur[mrefs +j] - cur[prefs -j])\
+
abs
(cur[mrefs+1+j] - cur[prefs+1-j]);\
if(score < spatial_score){\
spatial_score= score;\
spatial_pred= (cur[mrefs +j] + cur[prefs -j])>>1;\
...
...
modules/video_filter/hqdn3d.h
View file @
df4da384
...
...
@@ -182,8 +182,6 @@ static void deNoise(unsigned char *Frame, // mpi->planes[x]
//===========================================================================//
#define ABS(A) ( (A) > 0 ? (A) : -(A) )
static
void
PrecalcCoefs
(
int
*
Ct
,
double
Dist25
)
{
int
i
;
...
...
@@ -193,7 +191,7 @@ static void PrecalcCoefs(int *Ct, double Dist25)
for
(
i
=
-
255
*
16
;
i
<=
255
*
16
;
i
++
)
{
Simil
=
1
.
0
-
ABS
(
i
)
/
(
16
*
255
.
0
);
Simil
=
1
.
0
-
abs
(
i
)
/
(
16
*
255
.
0
);
C
=
pow
(
Simil
,
Gamma
)
*
65536
.
0
*
(
double
)
i
/
16
.
0
;
Ct
[
16
*
256
+
i
]
=
(
C
<
0
)
?
(
C
-
0
.
5
)
:
(
C
+
0
.
5
);
}
...
...
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