]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/libm.h
avutil: Add av_get_default_channel_layout()
[ffmpeg] / libavutil / libm.h
index db014a9066d89ce7c7505a364f7aa210969f8410..783f3cdfab68cb4021e799ce8cabb960599a16c8 100644 (file)
@@ -1,18 +1,18 @@
 /*
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #define llrint(x) ((long long)rint(x))
 #endif /* HAVE_LLRINT */
 
+#if !HAVE_LLRINTF
+#undef llrintf
+#define llrintf(x) ((long long)rint(x))
+#endif /* HAVE_LLRINT */
+
 #if !HAVE_LOG2
 #undef log2
 #define log2(x) (log(x) * 1.44269504088896340736)
@@ -81,6 +86,13 @@ static av_always_inline av_const float roundf(float x)
 }
 #endif /* HAVE_ROUNDF */
 
+#if !HAVE_TRUNC
+static av_always_inline av_const double trunc(double x)
+{
+    return (x > 0) ? floor(x) : ceil(x);
+}
+#endif /* HAVE_TRUNC */
+
 #if !HAVE_TRUNCF
 static av_always_inline av_const float truncf(float x)
 {