]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/libvpxenc.c
Merge commit '92e0b7342c0490894cbcea4461380321e0569de2'
[ffmpeg] / libavcodec / libvpxenc.c
index 7f7d4aedafcb6451cfe22fd01ba9cff4cce0e76b..176c6b6bfc0f320c3fb97866bd6b0f81799cb41a 100644 (file)
@@ -330,10 +330,15 @@ static av_cold int vpx_init(AVCodecContext *avctx,
         }
     }
 
-    if (avctx->qmin >= 0)
-        enccfg.rc_min_quantizer = avctx->qmin;
-    if (avctx->qmax >= 0)
-        enccfg.rc_max_quantizer = avctx->qmax;
+    if (avctx->codec_id == AV_CODEC_ID_VP9 && ctx->lossless == 1) {
+        enccfg.rc_min_quantizer =
+        enccfg.rc_max_quantizer = 0;
+    } else {
+        if (avctx->qmin >= 0)
+            enccfg.rc_min_quantizer = avctx->qmin;
+        if (avctx->qmax >= 0)
+            enccfg.rc_max_quantizer = avctx->qmax;
+    }
 
     if (enccfg.rc_end_usage == VPX_CQ
 #if CONFIG_LIBVPX_VP9_ENCODER