[FFmpeg-devel] [PATCH] set bits_per_raw_sample when transcoding into wide colorspace

Michael Niedermayer michaelni
Sat Sep 5 05:24:35 CEST 2009


On Fri, Sep 04, 2009 at 10:37:20PM +0200, Lars T?uber wrote:
> On Fri, 4 Sep 2009 21:20:36 +0200 Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Fri, Sep 04, 2009 at 03:22:54PM +0200, Lars T?uber wrote:
> > > $subject
> > > 
> > > Lars
> > 
> > >  ffmpeg.c |   14 ++++++++++++++
> > >  1 file changed, 14 insertions(+)
> > > 84909e388d819a1c59f18c4d7ee229c144134d81  16bps.diff
> > > Index: ffmpeg.c
> > > ===================================================================
> > > --- ffmpeg.c	(revision 19746)
> > > +++ ffmpeg.c	(working copy)
> > > @@ -985,6 +985,20 @@
> > >          }
> > >          sws_scale(ost->img_resample_ctx, formatted_picture->data, formatted_picture->linesize,
> > >                0, ost->resample_height, resampling_dst->data, resampling_dst->linesize);
> > > +
> > > +        switch (ost->st->codec->pix_fmt) {
> > > +        case PIX_FMT_GRAY16BE:
> > > +        case PIX_FMT_GRAY16LE:
> > > +        case PIX_FMT_RGB48BE:
> > > +        case PIX_FMT_RGB48LE:
> > > +        case PIX_FMT_YUV420PBE:
> > > +        case PIX_FMT_YUV422PBE:
> > > +        case PIX_FMT_YUV444PBE:
> > > +        case PIX_FMT_YUV420PLE:
> > > +        case PIX_FMT_YUV422PLE:
> > > +        case PIX_FMT_YUV444PLE:
> > > +            ost->st->codec->bits_per_raw_sample = 16;
> > > +        }
> > 
> > doing it like that is a sure recipe for forgetting to add a format
> > in the future.
> > the pix_fmt_info table might be a better way to check
> 
> Ok, what about this?

as you add a public function (av prefix & in public header) this would
need some justification why such public function makes sense, also it
would need to be better documented though some doxy should be there
either way ff_ or av_ ...
(the doxy also should say a word about rgb16 that have different depth
 for r/g/b)


> 
> BTW isn't this pix_fmt_... stuff not better belonging into libavutil/pixfmt.[ch] ?

there was some discussion about this on the ML, short awnser is no, for the
long awnser iam too tired at the moment to even remember it fully

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

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- 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/20090905/3a568283/attachment.pgp>



More information about the ffmpeg-devel mailing list