avcodec/ffv1: simplify version checks with combined_version

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2025-01-18 01:49:38 +01:00
parent c0769e9213
commit 0c237d6e8a
4 changed files with 10 additions and 4 deletions

View File

@@ -130,7 +130,7 @@ int ff_slice_coord(const FFV1Context *f, int width, int sx, int num_h_slices, in
int mpw = 1<<chroma_shift;
int awidth = FFALIGN(width, mpw);
if (f->version < 4 || f->version == 4 && f->micro_version < 3)
if (f->combined_version <= 0x40002)
return width * sx / num_h_slices;
sx = (2LL * awidth * sx + num_h_slices * mpw) / (2 * num_h_slices * mpw) * mpw;