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

Lars Täuber lars.taeuber
Fri Sep 4 22:37:20 CEST 2009


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?

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

Lars
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 16bps.diff
Type: text/x-diff
Size: 1519 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090904/8ac82902/attachment.diff>



More information about the ffmpeg-devel mailing list