[FFmpeg-devel] [PATCH] Define endian variant for PIX_FMT_RGB/BGR_5X5

Michael Niedermayer michaelni
Sat Mar 21 01:44:06 CET 2009


On Sat, Mar 21, 2009 at 12:11:26AM +0100, Stefano Sabatini wrote:
> On date Wednesday 2009-03-18 22:30:26 +0100, Michael Niedermayer encoded:
> > On Tue, Mar 17, 2009 at 09:14:32PM +0100, Stefano Sabatini wrote:
> [...]
> > > Index: ffmpeg/libavcodec/pixdesc.c
> > > ===================================================================
> > > --- ffmpeg.orig/libavcodec/pixdesc.c	2009-03-17 20:16:28.000000000 +0100
> > > +++ ffmpeg/libavcodec/pixdesc.c	2009-03-17 21:01:34.000000000 +0100
> > > @@ -147,9 +147,9 @@
> > >          .log2_chroma_w= 0,
> > >          .log2_chroma_h= 0,
> > >          .comp = {
> > > -            {0,1,1,0,4},
> > > -            {0,1,1,5,5},
> > > -            {0,1,2,3,4},
> > > +            {0,1,2,3,4},        /* R */
> > > +            {0,1,1,5,5},        /* G */
> > > +            {0,1,1,0,4},        /* B */
> > >          },
> > >      },
> > >      [PIX_FMT_RGB565BE] = {
> > > @@ -157,9 +157,9 @@
> > >          .log2_chroma_w= 0,
> > >          .log2_chroma_h= 0,
> > >          .comp = {
> > > -            {0,1,1, 0,4},
> > > -            {0,1,1, 5,5},
> > > -            {0,1,0, 3,4},
> > > +            {0,1,0,3,4},       /* R */
> > > +            {0,1,1,5,5},       /* G */
> > > +            {0,1,1,0,4},       /* B */
> > >          },
> > >          .flags = PIX_FMT_BE,
> > >      },
> > 
> > ok if tested
> > 
> > 
> > > Index: ffmpeg/libavcodec/pixdesc.c
> > > ===================================================================
> > > --- ffmpeg.orig/libavcodec/pixdesc.c	2009-03-17 20:16:33.000000000 +0100
> > > +++ ffmpeg/libavcodec/pixdesc.c	2009-03-17 21:01:02.000000000 +0100
> > > @@ -163,6 +163,27 @@
> > >          },
> > >          .flags = PIX_FMT_BE,
> > >      },
> > > +    [PIX_FMT_RGB555LE] = {
> > > +        .nb_channels  = 3,
> > > +        .log2_chroma_w= 0,
> > > +        .log2_chroma_h= 0,
> > > +        .comp = {
> > > +            {0,1,2,2,4},        /* R */
> > > +            {0,1,1,5,4},        /* G */
> > > +            {0,1,1,0,4},        /* B */
> > > +        },
> > > +    },
> > > +    [PIX_FMT_RGB555BE] = {
> > > +        .nb_channels  = 3,
> > > +        .log2_chroma_w= 0,
> > > +        .log2_chroma_h= 0,
> > > +        .comp = {
> > > +            {0,1,0,2,4},       /* R */
> > > +            {0,1,1,5,4},       /* G */
> > > +            {0,1,1,0,4},       /* B */
> > > +        },
> > > +        .flags = PIX_FMT_BE,
> > > +    },
> > >      [PIX_FMT_MONOBLACK] = {
> > >          .nb_channels  = 1,
> > >          .log2_chroma_w= 0,
> > > Index: ffmpeg/libavcodec/pixdesc.c
> > > ===================================================================
> > > --- ffmpeg.orig/libavcodec/pixdesc.c	2009-03-17 20:17:12.000000000 +0100
> > > +++ ffmpeg/libavcodec/pixdesc.c	2009-03-17 20:18:54.000000000 +0100
> > > @@ -184,6 +184,48 @@
> > >          },
> > >          .flags = PIX_FMT_BE,
> > >      },
> > > +    [PIX_FMT_BGR565LE] = {
> > > +        .nb_channels  = 3,
> > > +        .log2_chroma_w= 0,
> > > +        .log2_chroma_h= 0,
> > > +        .comp = {
> > > +            {0,1,2,3,4},        /* B */
> > > +            {0,1,1,5,5},        /* G */
> > > +            {0,1,1,0,4},        /* R */
> > > +        },
> > > +    },
> > > +    [PIX_FMT_BGR565BE] = {
> > > +        .nb_channels  = 3,
> > > +        .log2_chroma_w= 0,
> > > +        .log2_chroma_h= 0,
> > > +        .comp = {
> > > +            {0,1,0,3,4},        /* B */
> > > +            {0,1,1,5,5},        /* G */
> > > +            {0,1,1,0,4},        /* R */
> > > +        },
> > > +        .flags = PIX_FMT_BE,
> > > +    },
> > > +    [PIX_FMT_BGR555LE] = {
> > > +        .nb_channels  = 3,
> > > +        .log2_chroma_w= 0,
> > > +        .log2_chroma_h= 0,
> > > +        .comp = {
> > > +            {0,1,2,2,4},        /* B */
> > > +            {0,1,1,5,4},        /* G */
> > > +            {0,1,1,0,4},        /* R */
> > > +        },
> > > +    },
> > > +    [PIX_FMT_BGR555BE] = {
> > > +        .nb_channels  = 3,
> > > +        .log2_chroma_w= 0,
> > > +        .log2_chroma_h= 0,
> > > +        .comp = {
> > > +            {0,1,0,2,4},       /* B */
> > > +            {0,1,1,5,4},       /* G */
> > > +            {0,1,1,0,4},       /* R */
> > > +        },
> > > +        .flags = PIX_FMT_BE,
> > > +    },
> > >      [PIX_FMT_MONOBLACK] = {
> > >          .nb_channels  = 1,
> > >          .log2_chroma_w= 0,
> > 
> > again, ok if tested
> 
> Michael can you suggest how to test it? My ideas look too lame and
> complicated (also attached patch may help).

you could write a lavfi filter that uses it to convert between 2
pixel formats


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

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090321/4ea8ffd4/attachment.pgp>



More information about the ffmpeg-devel mailing list