diff --git a/avconv.h b/avconv.h
index 56876ec066167679b11b036ee9dccd481007f9b6..eb7e37f8750f08ea726a4e4013076886caeccc63 100644
--- a/avconv.h
+++ b/avconv.h
@@ -356,8 +356,6 @@ extern const OptionDef options[];
 void reset_options(OptionsContext *o);
 void show_usage(void);
 
-int opt_cpuflags(void *optctx, const char *opt, const char *arg);
-
 void opt_output_file(void *optctx, const char *filename);
 
 void assert_avoptions(AVDictionary *m);
diff --git a/avconv_opt.c b/avconv_opt.c
index bd8e7e5a79b8f2191a69d196e4e3fb40b75194f3..70cbd719cd7b263e859749d35613cee7348733ae 100644
--- a/avconv_opt.c
+++ b/avconv_opt.c
@@ -1876,17 +1876,6 @@ static int opt_vsync(void *optctx, const char *opt, const char *arg)
     return 0;
 }
 
-int opt_cpuflags(void *optctx, const char *opt, const char *arg)
-{
-    int flags = av_parse_cpu_flags(arg);
-
-    if (flags < 0)
-        return flags;
-
-    av_set_cpu_flags_mask(flags);
-    return 0;
-}
-
 static int opt_channel_layout(void *optctx, const char *opt, const char *arg)
 {
     OptionsContext *o = optctx;
@@ -2231,8 +2220,6 @@ const OptionDef options[] = {
     { "dump_attachment", HAS_ARG | OPT_STRING | OPT_SPEC |
                          OPT_EXPERT | OPT_INPUT,                     { .off = OFFSET(dump_attachment) },
         "extract an attachment into a file", "filename" },
-    { "cpuflags",       HAS_ARG | OPT_EXPERT,                        { .func_arg = opt_cpuflags },
-        "set CPU flags mask", "mask" },
 
     /* video options */
     { "vframes",      OPT_VIDEO | HAS_ARG  | OPT_PERFILE | OPT_OUTPUT,           { .func_arg = opt_video_frames },
diff --git a/cmdutils.c b/cmdutils.c
index 062d7ec2f850790da095a6449ecdf6e0552ff518..d6eb981205b0650be4d9317e9b5b2a2e0d67e516 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -43,6 +43,7 @@
 #include "libavutil/eval.h"
 #include "libavutil/dict.h"
 #include "libavutil/opt.h"
+#include "libavutil/cpu.h"
 #include "cmdutils.h"
 #include "version.h"
 #if CONFIG_NETWORK
@@ -694,6 +695,17 @@ do {                                                                           \
     return 0;
 }
 
+int opt_cpuflags(void *optctx, const char *opt, const char *arg)
+{
+    int flags = av_parse_cpu_flags(arg);
+
+    if (flags < 0)
+        return flags;
+
+    av_set_cpu_flags_mask(flags);
+    return 0;
+}
+
 int opt_loglevel(void *optctx, const char *opt, const char *arg)
 {
     const struct { const char *name; int level; } log_levels[] = {
diff --git a/cmdutils.h b/cmdutils.h
index 997ba1c75042e5c6918f51ef5a8ec781dab28dc4..f1b69f95b759e49e84712c13309ed46ca9643f8b 100644
--- a/cmdutils.h
+++ b/cmdutils.h
@@ -71,6 +71,11 @@ void uninit_opts(void);
  */
 void log_callback_help(void* ptr, int level, const char* fmt, va_list vl);
 
+/**
+ * Override the cpuflags mask.
+ */
+int opt_cpuflags(void *optctx, const char *opt, const char *arg);
+
 /**
  * Fallback for options that are not explicitly handled, these will be
  * parsed through AVOptions.
diff --git a/cmdutils_common_opts.h b/cmdutils_common_opts.h
index 619cd896ce81aed83d652d1ab8cf1be8614c686d..8693f59c561ee2bf3cd5b25a421c0b9a5e5f55e3 100644
--- a/cmdutils_common_opts.h
+++ b/cmdutils_common_opts.h
@@ -15,3 +15,4 @@
     { "sample_fmts", OPT_EXIT, {.func_arg = show_sample_fmts }, "show available audio sample formats" },
     { "loglevel"   , HAS_ARG,  {.func_arg = opt_loglevel},      "set libav* logging level", "loglevel" },
     { "v",           HAS_ARG,  {.func_arg = opt_loglevel},      "set libav* logging level", "loglevel" },
+    { "cpuflags",    HAS_ARG | OPT_EXPERT, { .func_arg = opt_cpuflags },  "set CPU flags mask", "mask" },
diff --git a/doc/avconv.texi b/doc/avconv.texi
index d137fe2738bedc9879d3e97580f30642b807ca41..714b0e7ab32974ed67aa4c195b44c5eb0b732d06 100644
--- a/doc/avconv.texi
+++ b/doc/avconv.texi
@@ -788,10 +788,6 @@ avconv -i file.mov -an -vn -bsf:s mov2textsub -c:s copy -f rawvideo sub.txt
 @item -tag[:@var{stream_specifier}] @var{codec_tag} (@emph{output,per-stream})
 Force a tag/fourcc for matching streams.
 
-@item -cpuflags mask (@emph{global})
-Set a mask that's applied to autodetected CPU flags.  This option is intended
-for testing. Do not use it unless you know what you're doing.
-
 @item -filter_complex @var{filtergraph} (@emph{global})
 Define a complex filter graph, i.e. one with arbitrary number of inputs and/or
 outputs. For simple graphs -- those with one input and one output of the same
diff --git a/doc/avtools-common-opts.texi b/doc/avtools-common-opts.texi
index 4be54125ded1e9824753f6c7b89befb3045e3ef6..156319ec4a99fbfbe47937dd90bacd212531b298 100644
--- a/doc/avtools-common-opts.texi
+++ b/doc/avtools-common-opts.texi
@@ -143,6 +143,10 @@ the environment variable @env{AV_LOG_FORCE_COLOR}.
 The use of the environment variable @env{NO_COLOR} is deprecated and
 will be dropped in a following Libav version.
 
+@item -cpuflags mask (@emph{global})
+Set a mask that's applied to autodetected CPU flags. This option is intended
+for testing. Do not use it unless you know what you're doing.
+
 @end table
 
 @section AVOptions