]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ffv1enc.c
Merge commit '90c784cc13f6bf21a8eb69f3b88b50c7a70f6c59'
[ffmpeg] / libavcodec / ffv1enc.c
index b3879fc83ce92ddcb95153db9535277baa3d5feb..031db061fee61fda225ae6641cbe092d9b3b1db3 100644 (file)
@@ -872,7 +872,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
     }
 
     if (s->version > 1) {
-        for (s->num_v_slices = 2; s->num_v_slices < 9; s->num_v_slices++) {
+        s->num_v_slices = (avctx->width > 352 || avctx->height > 288 || !avctx->slices) ? 2 : 1;
+        for (; s->num_v_slices < 9; s->num_v_slices++) {
             for (s->num_h_slices = s->num_v_slices; s->num_h_slices < 2*s->num_v_slices; s->num_h_slices++) {
                 if (avctx->slices == s->num_h_slices * s->num_v_slices && avctx->slices <= 64 || !avctx->slices)
                     goto slices_ok;