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 e6d6cdaa4fcfe7724da28132d8d09c4fad4425a5..19a75b89a56f91523e0d6e068d092436eb11f9b8 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 9ea0dffbb202b252bf605be7c78e7e75d8a38575..252afc48f58417ff517bb06e22550003a393136e 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 e4d0ecabf1ec6c4f7e6244f032b89b289229ac54..656f961bdade2d465c6d7d2251592fde20ba2797 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);