Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
luzpaz
gstreamer
Commits
7319b52a
Commit
7319b52a
authored
Nov 30, 2011
by
Vincent Penquerc'h
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gstutils: add a 64 bit version of GCD calculation
https://bugzilla.gnome.org/show_bug.cgi?id=665294
parent
b6abb979
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
gst/gstutils.c
gst/gstutils.c
+26
-0
gst/gstutils.h
gst/gstutils.h
+1
-0
No files found.
gst/gstutils.c
View file @
7319b52a
...
...
@@ -3521,6 +3521,32 @@ gst_util_greatest_common_divisor (gint a, gint b)
return
ABS
(
a
);
}
/**
* gst_util_greatest_common_divisor_int64:
* @a: First value as #gint64
* @b: Second value as #gint64
*
* Calculates the greatest common divisor of @a
* and @b.
*
* Returns: Greatest common divisor of @a and @b
*
* Since: 0.11.0
*/
gint64
gst_util_greatest_common_divisor_int64
(
gint64
a
,
gint64
b
)
{
while
(
b
!=
0
)
{
gint64
temp
=
a
;
a
=
b
;
b
=
temp
%
b
;
}
return
ABS
(
a
);
}
/**
* gst_util_fraction_to_double:
* @src_n: Fraction numerator as #gint
...
...
gst/gstutils.h
View file @
7319b52a
...
...
@@ -957,6 +957,7 @@ gpointer gst_util_array_binary_search (gpointer array, guint num_eleme
/* fraction operations */
gint
gst_util_greatest_common_divisor
(
gint
a
,
gint
b
);
gint64
gst_util_greatest_common_divisor_int64
(
gint64
a
,
gint64
b
);
void
gst_util_fraction_to_double
(
gint
src_n
,
gint
src_d
,
gdouble
*
dest
);
void
gst_util_double_to_fraction
(
gdouble
src
,
gint
*
dest_n
,
gint
*
dest_d
);
...
...
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