[vlc-commits] Avcodec: set the Dsp flags for the encoders too

Jean-Baptiste Kempf git at videolan.org
Tue Oct 9 15:20:57 CEST 2012


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Oct  9 15:19:33 2012 +0200| [314fd50539823143ba6646d43ad9f77af44561a0] | committer: Jean-Baptiste Kempf

Avcodec: set the Dsp flags for the encoders too

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=314fd50539823143ba6646d43ad9f77af44561a0
---

 modules/codec/avcodec/encoder.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index 09a456e..22a3697 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -316,7 +316,13 @@ int OpenEncoder( vlc_object_t *p_this )
     p_sys->p_context->codec_id = p_sys->p_codec->id;
     p_context->debug = var_InheritInteger( p_enc, "avcodec-debug" );
     p_context->opaque = (void *)p_this;
-    p_context->dsp_mask = GetVlcDspMask(); /* set CPU capabilities */
+
+    /* set CPU capabilities */
+#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( 51, 25, 0 )
+    av_set_cpu_flags_mask( INT_MAX & ~GetVlcDspMask() );
+#else
+    p_context->dsp_mask = GetVlcDspMask();
+#endif
 
     p_sys->i_key_int = var_GetInteger( p_enc, ENC_CFG_PREFIX "keyint" );
     p_sys->i_b_frames = var_GetInteger( p_enc, ENC_CFG_PREFIX "bframes" );



More information about the vlc-commits mailing list