OSDN Git Service

libvpx: Do not set vp8 only parameters when encoding in vp9
authorLuca Barbato <lu_zero@gentoo.org>
Tue, 16 Jun 2015 01:48:00 +0000 (03:48 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Sat, 20 Jun 2015 09:18:01 +0000 (12:18 +0300)
libavcodec/libvpxenc.c

index 4164769..0f4bd61 100644 (file)
@@ -346,8 +346,11 @@ static av_cold int vpx_init(AVCodecContext *avctx,
         codecctl_int(avctx, VP8E_SET_ARNR_STRENGTH,    ctx->arnr_strength);
     if (ctx->arnr_type >= 0)
         codecctl_int(avctx, VP8E_SET_ARNR_TYPE,        ctx->arnr_type);
-    codecctl_int(avctx, VP8E_SET_NOISE_SENSITIVITY, avctx->noise_reduction);
-    codecctl_int(avctx, VP8E_SET_TOKEN_PARTITIONS,  av_log2(avctx->slices));
+
+    if (CONFIG_LIBVPX_VP8_ENCODER && iface == &vpx_codec_vp8_cx_algo) {
+        codecctl_int(avctx, VP8E_SET_NOISE_SENSITIVITY, avctx->noise_reduction);
+        codecctl_int(avctx, VP8E_SET_TOKEN_PARTITIONS,  av_log2(avctx->slices));
+    }
 #if FF_API_MPV_OPT
     FF_DISABLE_DEPRECATION_WARNINGS
     if (avctx->mb_threshold) {