Am Di., 23. Feb. 2021 um 18:32 Uhr schrieb Paul B Mahol <[email protected]>:
> +static int decode_palette(GetByteContext *gb, uint32_t *pal)
> +{
> + GetBitContext gbit;
> +
> + if (bytestream2_get_bytes_left(gb) < 18)
> + return AVERROR_INVALIDDATA;
> +
> + memset(pal, 0, 16 * sizeof(*pal));
> + init_get_bits8(&gbit, gb->buffer, 18);
> +
> + for (int RGBIndex = 0; RGBIndex < 3; RGBIndex++) {
> + for (int index = 0; index < 16; index++) {
> + unsigned color = get_bits1(&gbit) << RGBIndex;
> + pal[15 - index] |= color << (5 + 16);
> + }
> + }
> +
> + for (int RGBIndex = 0; RGBIndex < 3; RGBIndex++) {
> + for (int index = 0; index < 16; index++) {
> + unsigned color = get_bits1(&gbit) << RGBIndex;
> + pal[15 - index] |= color << (5 + 8);
> + }
> + }
> +
> + for (int RGBIndex = 0; RGBIndex < 3; RGBIndex++) {
> + for (int index = 0; index < 16; index++) {
> + unsigned color = get_bits1(&gbit) << RGBIndex;
> + pal[15 - index] |= color << (5 + 0);
> + }
> + }
This will not allow white to look white on the screen,
you have to add color more often to pal.
Carl Eugen
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".