[FFmpeg-devel] [PATCH]Increase dynamics for more palettes

Michael Niedermayer michaelni at gmx.at
Sun Nov 13 04:45:08 CET 2011


On Sun, Nov 13, 2011 at 03:24:47AM +0100, Carl Eugen Hoyos wrote:
> Hi!
> 
> I found some more palettes that could need more dynamics.
> 
> Please review, Carl Eugen

>  bethsoftvideo.c |    1 +
>  bintext.c       |    2 +-
>  flicvideo.c     |    2 ++
>  pictordec.c     |    2 +-
>  vmdav.c         |    1 +
>  vqavideo.c      |    1 +
>  6 files changed, 7 insertions(+), 2 deletions(-)
> d9eff989c6d2385fe72164c27be9c3dac2e7e605  patchpalette2.diff
> diff --git a/libavcodec/bethsoftvideo.c b/libavcodec/bethsoftvideo.c
> index b316535..1a19c19 100644
> --- a/libavcodec/bethsoftvideo.c
> +++ b/libavcodec/bethsoftvideo.c
> @@ -53,6 +53,7 @@ static void set_palette(AVFrame * frame, const uint8_t * palette_buffer)
>      int a;
>      for(a = 0; a < 256; a++){
>          palette[a] = 0xFF << 24 | AV_RB24(&palette_buffer[a * 3]) * 4;
> +        palette[a] |= palette[a] >> 6 & 0x30303;
>      }
>      frame->palette_has_changed = 1;
>  }
> diff --git a/libavcodec/bintext.c b/libavcodec/bintext.c
> index 947be39..94d1f9c 100644

> --- a/libavcodec/bintext.c
> +++ b/libavcodec/bintext.c
> @@ -61,7 +61,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
>  
>      if ((s->flags & BINTEXT_PALETTE)) {
>          for (i = 0; i < 16; i++) {
> -            s->palette[i] = 0xFF000000 | (AV_RB24(p) << 2);
> +            s->palette[i] = 0xFF000000 | (AV_RB24(p) << 2) | (AV_RB24(p) >> 6) & 0x30303;

this looks a bit odd, naively id say it should be >>4

the others LGTM

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111113/8a612c05/attachment.asc>


More information about the ffmpeg-devel mailing list