[FFmpeg-devel] [PATCH]Add more 32bit RGB colourspaces to kerndeint
Stefano Sabatini
stefasab at gmail.com
Sat Jan 5 14:08:10 CET 2013
On date Saturday 2013-01-05 13:39:59 +0100, Carl Eugen Hoyos encoded:
> On Saturday 05 January 2013 12:19:49 pm Stefano Sabatini wrote:
> > On date Saturday 2013-01-05 12:17:22 +0100, Stefano Sabatini encoded:
> > > On date Saturday 2013-01-05 11:58:35 +0100, Carl Eugen Hoyos encoded:
> > > > Hi!
> > > >
> > > > I did not test with input that contains transparency.
> > > >
> > > > Please review, Carl Eugen
> > > >
> > > > diff --git a/libavfilter/vf_kerndeint.c b/libavfilter/vf_kerndeint.c
> > > > index 3569bfa..337f9ee 100644
> > > > --- a/libavfilter/vf_kerndeint.c
> > > > +++ b/libavfilter/vf_kerndeint.c
> >
> > Also, missing tests/ref/lavfi/kerndeint update.
>
> New patch attached.
>
> Thank you both, Carl Eugen
> diff --git a/libavfilter/vf_kerndeint.c b/libavfilter/vf_kerndeint.c
> index 3569bfa..1b31cee 100644
> --- a/libavfilter/vf_kerndeint.c
> +++ b/libavfilter/vf_kerndeint.c
> @@ -82,7 +82,10 @@ static int query_formats(AVFilterContext *ctx)
> static const enum PixelFormat pix_fmts[] = {
> AV_PIX_FMT_YUV420P,
> AV_PIX_FMT_YUYV422,
> - AV_PIX_FMT_ARGB,
> + AV_PIX_FMT_ARGB, AV_PIX_FMT_0RGB,
> + AV_PIX_FMT_ABGR, AV_PIX_FMT_0BGR,
> + AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB0,
> + AV_PIX_FMT_BGRA, AV_PIX_FMT_BGR0,
> AV_PIX_FMT_NONE
> };
>
> @@ -203,7 +206,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *inpic)
> if (map) {
> g = x & ~3;
>
> - if (inlink->format == AV_PIX_FMT_RGBA) {
> + if (av_pix_fmt_desc_get(inlink->format)->flags & PIX_FMT_RGB) {
> AV_WB32(dstp + g, 0xffffffff);
> x = g + 3;
> } else if (inlink->format == AV_PIX_FMT_YUYV422) {
> @@ -214,7 +217,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *inpic)
> dstp[x] = plane == 0 ? 235 : 128;
> }
> } else {
> - if (inlink->format == AV_PIX_FMT_RGBA) {
> + if (av_pix_fmt_desc_get(inlink->format)->flags & PIX_FMT_RGB) {
Introduce an internal variable rgb_packed or whatever and use that, so
you avoid to call a function and repeat this in two distinct places.
[...]
Looks OK otherwise.
--
FFmpeg = Fast & Fabulous Murdering Pacific Evangelical Guru
More information about the ffmpeg-devel
mailing list