On 01/10/2024 22:31, Michael Niedermayer wrote:
Fixes: Ticket5548

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
---
  libavcodec/ffv1.c    | 7 +++++++
  libavcodec/ffv1.h    | 1 +
  libavcodec/ffv1enc.c | 4 ++++
  3 files changed, 12 insertions(+)

diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c
index 56a36e479fc..2b8564c2f56 100644
--- a/libavcodec/ffv1.c
+++ b/libavcodec/ffv1.c
@@ -119,6 +119,13 @@ av_cold int ff_ffv1_init_slices_state(FFV1Context *f)
      return 0;
  }
+int ff_need_new_slices(int width, int num_h_slices, int chroma_shift) {

Wrong coding style.

+    int mpw = 1<<chroma_shift;

Same, leave a space.

+    int i = width * (int64_t)(num_h_slices - 1) / num_h_slices;
+
+    return width % mpw && (width - i) % mpw == 0;

Would a check (if height < (subsampling ? 3 : 1)) would have been enough? This isn't really readable nor understandable.

Furthermore, this function is called with both width and height, yet all variables are named with the assumption that only width is used.

Attachment: OpenPGP_0xA2FEA5F03F034464.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to