New macros: GST_ROUND_UP_2() through GST_ROUND_UP_64().
authorTim-Philipp Müller <tim@centricular.net>
Tue, 9 Aug 2005 16:25:45 +0000 (16:25 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Tue, 9 Aug 2005 16:25:45 +0000 (16:25 +0000)
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gstutils.h:
New macros: GST_ROUND_UP_2() through GST_ROUND_UP_64().

ChangeLog
docs/gst/gstreamer-sections.txt
gst/gstutils.h

index e6d6cda..19a75b8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-08-09  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * docs/gst/gstreamer-sections.txt:
+       * gst/gstutils.h:
+         New macros: GST_ROUND_UP_2() through GST_ROUND_UP_64().
+
 2005-08-08  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
 
        * gst/base/gstbasetransform.c: (gst_base_transform_buffer_alloc):
index 9ea0dff..252afc4 100644 (file)
@@ -1519,6 +1519,12 @@ GST_WRITE_UINT32_LE
 GST_WRITE_UINT32_BE
 GST_WRITE_UINT64_LE
 GST_WRITE_UINT64_BE
+GST_ROUND_UP_2
+GST_ROUND_UP_4
+GST_ROUND_UP_8
+GST_ROUND_UP_16
+GST_ROUND_UP_32
+GST_ROUND_UP_64
 <SUBSECTION Private>
 GST_HAVE_UNALIGNED_ACCESS
 </SECTION>
index e4d0eca..656f961 100644 (file)
@@ -224,6 +224,15 @@ type_as_function ## _get_type (void)                                               \
 
 #endif /* GST_HAVE_UNALIGNED_ACCESS */
 
+
+/* Miscellaneous utility macros */
+#define GST_ROUND_UP_2(num)  (((num)+1)&~1)
+#define GST_ROUND_UP_4(num)  (((num)+3)&~3)
+#define GST_ROUND_UP_8(num)  (((num)+7)&~7)
+#define GST_ROUND_UP_16(num) (((num)+15)&~15)
+#define GST_ROUND_UP_32(num) (((num)+31)&~31)
+#define GST_ROUND_UP_64(num) (((num)+63)&~63)
+
 void                   gst_object_default_error        (GstObject * source, 
                                                         GError * error, gchar * debug);