You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/escape124: Simplify unpack_codebook()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -97,15 +97,12 @@ static CodeBook unpack_codebook(GetBitContext* gb, unsigned depth,
|
|||||||
cb.size = size;
|
cb.size = size;
|
||||||
for (i = 0; i < size; i++) {
|
for (i = 0; i < size; i++) {
|
||||||
unsigned mask_bits = get_bits(gb, 4);
|
unsigned mask_bits = get_bits(gb, 4);
|
||||||
unsigned color0 = get_bits(gb, 15);
|
unsigned color[2];
|
||||||
unsigned color1 = get_bits(gb, 15);
|
color[0] = get_bits(gb, 15);
|
||||||
|
color[1] = get_bits(gb, 15);
|
||||||
|
|
||||||
for (j = 0; j < 4; j++) {
|
for (j = 0; j < 4; j++)
|
||||||
if (mask_bits & (1 << j))
|
cb.blocks[i].pixels[j] = color[(mask_bits>>j) & 1];
|
||||||
cb.blocks[i].pixels[j] = color1;
|
|
||||||
else
|
|
||||||
cb.blocks[i].pixels[j] = color0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return cb;
|
return cb;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user