avcodec/ffv1enc: avoid slices larger than 360x288 if no value is specified

This improves speed by providing more independent things for more CPUs

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2025-04-03 11:55:46 +02:00
parent 1b04fb385c
commit 175cd4ced0
2 changed files with 13 additions and 9 deletions
+5 -1
View File
@@ -581,7 +581,11 @@ int ff_ffv1_encode_determine_slices(AVCodecContext *avctx)
if ( ff_need_new_slices(avctx->width , s->num_h_slices, s->chroma_h_shift)
||ff_need_new_slices(avctx->height, s->num_v_slices, s->chroma_v_shift))
continue;
if (avctx->slices == s->num_h_slices * s->num_v_slices && avctx->slices <= MAX_SLICES || !avctx->slices)
if (avctx->slices == s->num_h_slices * s->num_v_slices && avctx->slices <= MAX_SLICES)
return 0;
if (maxw*maxh > 360*288)
continue;
if (!avctx->slices)
return 0;
}
}