1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-07-06 06:27:36 +02:00

avcodec/ffv1: Fix remap ordering

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2025-03-19 21:17:10 +01:00
parent cbbc927a67
commit 62c7d08947
3 changed files with 10 additions and 10 deletions

View File

@ -186,9 +186,9 @@ static int RENAME(decode_rgb_frame)(FFV1Context *f, FFV1SliceContext *sc,
r += g; r += g;
} }
if (sc->remap) { if (sc->remap) {
r = sc->fltmap[0][r & 0xFFFF]; g = sc->fltmap[0][g & 0xFFFF];
g = sc->fltmap[1][g & 0xFFFF]; b = sc->fltmap[1][b & 0xFFFF];
b = sc->fltmap[2][b & 0xFFFF]; r = sc->fltmap[2][r & 0xFFFF];
if (transparency) if (transparency)
a = sc->fltmap[3][a & 0xFFFF]; a = sc->fltmap[3][a & 0xFFFF];
} }

View File

@ -432,7 +432,7 @@ static void set_micro_version(FFV1Context *f)
if (f->version == 3) { if (f->version == 3) {
f->micro_version = 4; f->micro_version = 4;
} else if (f->version == 4) { } else if (f->version == 4) {
f->micro_version = 5; f->micro_version = 6;
} else } else
av_assert0(0); av_assert0(0);

View File

@ -152,9 +152,9 @@ static void RENAME(load_rgb_frame)(FFV1Context *f, FFV1SliceContext *sc,
r = *((const uint16_t *)(src[2] + x*2 + stride[2]*y)); r = *((const uint16_t *)(src[2] + x*2 + stride[2]*y));
} }
sc->fltmap[0][r] = 1; sc->fltmap[0][g] = 1;
sc->fltmap[1][g] = 1; sc->fltmap[1][b] = 1;
sc->fltmap[2][b] = 1; sc->fltmap[2][r] = 1;
if (transparency) if (transparency)
sc->fltmap[3][a] = 1; sc->fltmap[3][a] = 1;
} }
@ -214,9 +214,9 @@ static int RENAME(encode_rgb_frame)(FFV1Context *f, FFV1SliceContext *sc,
} }
if (sc->remap) { if (sc->remap) {
r = sc->fltmap[0][r]; g = sc->fltmap[0][g];
g = sc->fltmap[1][g]; b = sc->fltmap[1][b];
b = sc->fltmap[2][b]; r = sc->fltmap[2][r];
if (transparency) if (transparency)
a = sc->fltmap[3][a]; a = sc->fltmap[3][a];
} }