diff --git a/libavformat/riff.c b/libavformat/riff.c
index 3b8c73688954c804ff563a48840dbeeed1e0a0e8..f2c7c112a5ec0dc279318b85c521ce3dd4b90379 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -215,49 +215,6 @@ const AVCodecTag codec_wav_tags[] = {
     { 0, 0 },
 };
 
-unsigned int codec_get_tag(const AVCodecTag *tags, int id)
-{
-    while (tags->id != CODEC_ID_NONE) {
-        if (tags->id == id)
-            return tags->tag;
-        tags++;
-    }
-    return 0;
-}
-
-enum CodecID codec_get_id(const AVCodecTag *tags, unsigned int tag)
-{
-    while (tags->id != CODEC_ID_NONE) {
-        if(   toupper((tag >> 0)&0xFF) == toupper((tags->tag >> 0)&0xFF)
-           && toupper((tag >> 8)&0xFF) == toupper((tags->tag >> 8)&0xFF)
-           && toupper((tag >>16)&0xFF) == toupper((tags->tag >>16)&0xFF)
-           && toupper((tag >>24)&0xFF) == toupper((tags->tag >>24)&0xFF))
-            return tags->id;
-        tags++;
-    }
-    return CODEC_ID_NONE;
-}
-
-unsigned int av_codec_get_tag(const AVCodecTag *tags[4], enum CodecID id)
-{
-    int i;
-    for(i=0; tags && tags[i]; i++){
-        int tag= codec_get_tag(tags[i], id);
-        if(tag) return tag;
-    }
-    return 0;
-}
-
-enum CodecID av_codec_get_id(const AVCodecTag *tags[4], unsigned int tag)
-{
-    int i;
-    for(i=0; tags && tags[i]; i++){
-        enum CodecID id= codec_get_id(tags[i], tag);
-        if(id!=CODEC_ID_NONE) return id;
-    }
-    return CODEC_ID_NONE;
-}
-
 #ifdef CONFIG_MUXERS
 offset_t start_tag(ByteIOContext *pb, const char *tag)
 {
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 63a3b692ba14e412fd403f3d602927d99399fce7..453ff7f3f18bee664958b868e0d5f9ced8bb6643 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -22,6 +22,7 @@
 #include "allformats.h"
 #include "opt.h"
 #include "avstring.h"
+#include "riff.h"
 
 #undef NDEBUG
 #include <assert.h>
@@ -1656,6 +1657,49 @@ static int set_codec_from_probe_data(AVStream *st, AVProbeData *pd, int score)
     return !!fmt;
 }
 
+unsigned int codec_get_tag(const AVCodecTag *tags, int id)
+{
+    while (tags->id != CODEC_ID_NONE) {
+        if (tags->id == id)
+            return tags->tag;
+        tags++;
+    }
+    return 0;
+}
+
+enum CodecID codec_get_id(const AVCodecTag *tags, unsigned int tag)
+{
+    while (tags->id != CODEC_ID_NONE) {
+        if(   toupper((tag >> 0)&0xFF) == toupper((tags->tag >> 0)&0xFF)
+           && toupper((tag >> 8)&0xFF) == toupper((tags->tag >> 8)&0xFF)
+           && toupper((tag >>16)&0xFF) == toupper((tags->tag >>16)&0xFF)
+           && toupper((tag >>24)&0xFF) == toupper((tags->tag >>24)&0xFF))
+            return tags->id;
+        tags++;
+    }
+    return CODEC_ID_NONE;
+}
+
+unsigned int av_codec_get_tag(const AVCodecTag *tags[4], enum CodecID id)
+{
+    int i;
+    for(i=0; tags && tags[i]; i++){
+        int tag= codec_get_tag(tags[i], id);
+        if(tag) return tag;
+    }
+    return 0;
+}
+
+enum CodecID av_codec_get_id(const AVCodecTag *tags[4], unsigned int tag)
+{
+    int i;
+    for(i=0; tags && tags[i]; i++){
+        enum CodecID id= codec_get_id(tags[i], tag);
+        if(id!=CODEC_ID_NONE) return id;
+    }
+    return CODEC_ID_NONE;
+}
+
 /* absolute maximum size we read until we abort */
 #define MAX_READ_SIZE        5000000