[FFmpeg-devel] [PATCH]Add more 32bit RGB colourspaces to kerndeint
Carl Eugen Hoyos
cehoyos at ag.or.at
Sat Jan 5 13:39:59 CET 2013
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
-------------- next part --------------
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) {
hi = 255;
lo = 0;
} else if (inlink->format == AV_PIX_FMT_YUYV422) {
diff --git a/tests/ref/lavfi/kerndeint b/tests/ref/lavfi/kerndeint
index d7ace93..b03f977 100644
--- a/tests/ref/lavfi/kerndeint
+++ b/tests/ref/lavfi/kerndeint
@@ -1,3 +1,10 @@
-argb 484893f83e13c937328f13a7c84d2f50
+0bgr 58fb0bda60562ce17e75f1c3459d0504
+0rgb d29f6a7b63ade359ec81f5856633ec06
+abgr 71071045b8ec66a6d0a38bb3fed1ca51
+argb 93ba0daa1e945ad1a6f8c0c1cd2e1858
+bgr0 364b8bcd1c7a384902077bc7190c5ea3
+bgra 81ac8315a4c66e363bc6fa3e99d9cd2b
+rgb0 ae0c2afbc266345c1372276755595105
+rgba 42a6cc9b815ca0ee69c29db3616ce25e
yuv420p a935cce07c5287b92c6d5220361866ed
yuyv422 f549c98059ba9ce50e28204256d13b5d
More information about the ffmpeg-devel
mailing list