[PATCH] Mark GRAY8 format as pseudo-paletted.
This fixes that the GIF encoder crashes with it because it has no palette. And the arguments for the pseudopalette apply to gray8 as much as to RGB8 etc. In addition the changes required in lavfi should be needed anyway when adding support for RGB8 etc. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de> --- libavfilter/drawutils.c | 2 +- libavfilter/vf_pad.c | 2 +- libavutil/pixdesc.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c index 9b24cf7..954c075 100644 --- a/libavfilter/drawutils.c +++ b/libavfilter/drawutils.c @@ -134,7 +134,7 @@ int ff_draw_init(FFDrawContext *draw, enum PixelFormat format, unsigned flags) if (!desc->name) return AVERROR(EINVAL); - if (desc->flags & ~(PIX_FMT_PLANAR | PIX_FMT_RGB)) + if (desc->flags & ~(PIX_FMT_PLANAR | PIX_FMT_RGB | PIX_FMT_PSEUDOPAL)) return AVERROR(ENOSYS); for (i = 0; i < desc->nb_components; i++) { c = &desc->comp[i]; diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c index 9fc4b39..2a3c17e 100644 --- a/libavfilter/vf_pad.c +++ b/libavfilter/vf_pad.c @@ -262,7 +262,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0); int plane; - for (plane = 0; plane < 4 && outpicref->data[plane]; plane++) { + for (plane = 0; plane < 4 && outpicref->data[plane] && pad->draw.pixelstep[plane]; plane++) { int hsub = pad->draw.hsub[plane]; int vsub = pad->draw.vsub[plane]; diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index 233b217..8572719 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -220,6 +220,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { .comp = { { 0, 0, 1, 0, 7 }, /* Y */ }, + .flags = PIX_FMT_PSEUDOPAL, }, [PIX_FMT_MONOWHITE] = { .name = "monow", -- 1.7.9.5
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de> --- tests/lavf-regression.sh | 13 +++++++++++++ tests/ref/lavf/gif | 21 +++++++++++++++++++++ tests/ref/lavf/xbm | 3 +++ 3 files changed, 37 insertions(+) create mode 100644 tests/ref/lavf/xbm diff --git a/tests/lavf-regression.sh b/tests/lavf-regression.sh index fcb8794..97fdd3f 100755 --- a/tests/lavf-regression.sh +++ b/tests/lavf-regression.sh @@ -169,9 +169,18 @@ do_streamed_images ppm fi if [ -n "$do_gif" ] ; then +# this tests the gif muxer file=${outfile}lavf.gif do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10 -pix_fmt rgb24 do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt rgb24 +# and this the gif encoder +do_image_formats gif +do_image_formats gif "-pix_fmt rgb4_byte" +do_image_formats gif "-pix_fmt bgr4_byte" +do_image_formats gif "-pix_fmt rgb8" +do_image_formats gif "-pix_fmt bgr8" +do_image_formats gif "-pix_fmt gray" +do_image_formats gif "-pix_fmt pal8" fi if [ -n "$do_yuv4mpeg" ] ; then @@ -196,6 +205,10 @@ do_image_formats png "-pix_fmt gray16be" do_image_formats png "-pix_fmt rgb48be" fi +if [ -n "$do_xbm" ] ; then +do_image_formats xbm +fi + if [ -n "$do_bmp" ] ; then do_image_formats bmp fi diff --git a/tests/ref/lavf/gif b/tests/ref/lavf/gif index 4a4ebfb..e8639ac 100644 --- a/tests/ref/lavf/gif +++ b/tests/ref/lavf/gif @@ -1,3 +1,24 @@ e6089fd4ef3b9df44090ab3650bdd810 *./tests/data/lavf/lavf.gif 2906401 ./tests/data/lavf/lavf.gif ./tests/data/lavf/lavf.gif CRC=0xe5605ff6 +fc4792ac40319344dc7027668a403fc3 *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0xf217a95e +81538 ./tests/data/images/gif/02.gif +759522b3025fcf8ed6aae582a18c5a14 *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0x879a13f3 +38715 ./tests/data/images/gif/02.gif +21e802ae7a2239bdbea6f915da1134b9 *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0xe578993d +38715 ./tests/data/images/gif/02.gif +fc4792ac40319344dc7027668a403fc3 *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0xf217a95e +81538 ./tests/data/images/gif/02.gif +022dc66b5068404e88c618ce79d9eb5f *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0x526cd97f +81538 ./tests/data/images/gif/02.gif +e3392f49c55aa794d3dc49189f52f257 *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0x46618ac3 +63144 ./tests/data/images/gif/02.gif +022dc66b5068404e88c618ce79d9eb5f *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0x526cd97f +81538 ./tests/data/images/gif/02.gif diff --git a/tests/ref/lavf/xbm b/tests/ref/lavf/xbm new file mode 100644 index 0000000..4cc4be6 --- /dev/null +++ b/tests/ref/lavf/xbm @@ -0,0 +1,3 @@ +99c20fff5d17b698b4a25282aebc3c51 *./tests/data/images/xbm/02.xbm +./tests/data/images/xbm/%02d.xbm CRC=0x0f5aa5cb +76411 ./tests/data/images/xbm/02.xbm -- 1.7.9.5
On Sun, Apr 08, 2012 at 04:24:11PM +0200, Reimar Döffinger wrote:
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de> --- tests/lavf-regression.sh | 13 +++++++++++++ tests/ref/lavf/gif | 21 +++++++++++++++++++++ tests/ref/lavf/xbm | 3 +++ 3 files changed, 37 insertions(+) create mode 100644 tests/ref/lavf/xbm
diff --git a/tests/lavf-regression.sh b/tests/lavf-regression.sh index fcb8794..97fdd3f 100755 --- a/tests/lavf-regression.sh +++ b/tests/lavf-regression.sh @@ -169,9 +169,18 @@ do_streamed_images ppm fi
if [ -n "$do_gif" ] ; then +# this tests the gif muxer file=${outfile}lavf.gif do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10 -pix_fmt rgb24 do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt rgb24 +# and this the gif encoder +do_image_formats gif +do_image_formats gif "-pix_fmt rgb4_byte" +do_image_formats gif "-pix_fmt bgr4_byte" +do_image_formats gif "-pix_fmt rgb8" +do_image_formats gif "-pix_fmt bgr8" +do_image_formats gif "-pix_fmt gray" +do_image_formats gif "-pix_fmt pal8" fi
if [ -n "$do_yuv4mpeg" ] ; then @@ -196,6 +205,10 @@ do_image_formats png "-pix_fmt gray16be" do_image_formats png "-pix_fmt rgb48be" fi
+if [ -n "$do_xbm" ] ; then +do_image_formats xbm +fi + if [ -n "$do_bmp" ] ; then do_image_formats bmp fi diff --git a/tests/ref/lavf/gif b/tests/ref/lavf/gif index 4a4ebfb..e8639ac 100644 --- a/tests/ref/lavf/gif +++ b/tests/ref/lavf/gif @@ -1,3 +1,24 @@ e6089fd4ef3b9df44090ab3650bdd810 *./tests/data/lavf/lavf.gif 2906401 ./tests/data/lavf/lavf.gif ./tests/data/lavf/lavf.gif CRC=0xe5605ff6 +fc4792ac40319344dc7027668a403fc3 *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0xf217a95e +81538 ./tests/data/images/gif/02.gif +759522b3025fcf8ed6aae582a18c5a14 *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0x879a13f3 +38715 ./tests/data/images/gif/02.gif +21e802ae7a2239bdbea6f915da1134b9 *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0xe578993d +38715 ./tests/data/images/gif/02.gif +fc4792ac40319344dc7027668a403fc3 *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0xf217a95e +81538 ./tests/data/images/gif/02.gif +022dc66b5068404e88c618ce79d9eb5f *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0x526cd97f +81538 ./tests/data/images/gif/02.gif +e3392f49c55aa794d3dc49189f52f257 *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0x46618ac3 +63144 ./tests/data/images/gif/02.gif +022dc66b5068404e88c618ce79d9eb5f *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0x526cd97f +81538 ./tests/data/images/gif/02.gif
this looks a bit terse, somehow getting PSNR values would be much more usefull than checksums in terms of spoting issues when they change [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Many that live deserve death. And some that die deserve life. Can you give it to them? Then do not be too eager to deal out death in judgement. For even the very wise cannot see all ends. -- Gandalf
On Sun, Apr 08, 2012 at 05:14:03PM +0200, Michael Niedermayer wrote:
On Sun, Apr 08, 2012 at 04:24:11PM +0200, Reimar Döffinger wrote:
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de> --- tests/lavf-regression.sh | 13 +++++++++++++ tests/ref/lavf/gif | 21 +++++++++++++++++++++ tests/ref/lavf/xbm | 3 +++ 3 files changed, 37 insertions(+) create mode 100644 tests/ref/lavf/xbm
diff --git a/tests/lavf-regression.sh b/tests/lavf-regression.sh index fcb8794..97fdd3f 100755 --- a/tests/lavf-regression.sh +++ b/tests/lavf-regression.sh @@ -169,9 +169,18 @@ do_streamed_images ppm fi
if [ -n "$do_gif" ] ; then +# this tests the gif muxer file=${outfile}lavf.gif do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10 -pix_fmt rgb24 do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt rgb24 +# and this the gif encoder +do_image_formats gif +do_image_formats gif "-pix_fmt rgb4_byte" +do_image_formats gif "-pix_fmt bgr4_byte" +do_image_formats gif "-pix_fmt rgb8" +do_image_formats gif "-pix_fmt bgr8" +do_image_formats gif "-pix_fmt gray" +do_image_formats gif "-pix_fmt pal8" fi
if [ -n "$do_yuv4mpeg" ] ; then @@ -196,6 +205,10 @@ do_image_formats png "-pix_fmt gray16be" do_image_formats png "-pix_fmt rgb48be" fi
+if [ -n "$do_xbm" ] ; then +do_image_formats xbm +fi + if [ -n "$do_bmp" ] ; then do_image_formats bmp fi diff --git a/tests/ref/lavf/gif b/tests/ref/lavf/gif index 4a4ebfb..e8639ac 100644 --- a/tests/ref/lavf/gif +++ b/tests/ref/lavf/gif @@ -1,3 +1,24 @@ e6089fd4ef3b9df44090ab3650bdd810 *./tests/data/lavf/lavf.gif 2906401 ./tests/data/lavf/lavf.gif ./tests/data/lavf/lavf.gif CRC=0xe5605ff6 +fc4792ac40319344dc7027668a403fc3 *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0xf217a95e +81538 ./tests/data/images/gif/02.gif +759522b3025fcf8ed6aae582a18c5a14 *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0x879a13f3 +38715 ./tests/data/images/gif/02.gif +21e802ae7a2239bdbea6f915da1134b9 *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0xe578993d +38715 ./tests/data/images/gif/02.gif +fc4792ac40319344dc7027668a403fc3 *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0xf217a95e +81538 ./tests/data/images/gif/02.gif +022dc66b5068404e88c618ce79d9eb5f *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0x526cd97f +81538 ./tests/data/images/gif/02.gif +e3392f49c55aa794d3dc49189f52f257 *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0x46618ac3 +63144 ./tests/data/images/gif/02.gif +022dc66b5068404e88c618ce79d9eb5f *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0x526cd97f +81538 ./tests/data/images/gif/02.gif
this looks a bit terse, somehow getting PSNR values would be much more usefull than checksums in terms of spoting issues when they change
This applies to all image format tests. For some reason they are all implemented as lavf tests which don't do that kind of thing, I have no idea why. This was just a quick way to get some results so at least stuff like crashes and stuff completely not working are detected.
On Sun, Apr 08, 2012 at 05:44:58PM +0200, Reimar Döffinger wrote:
On Sun, Apr 08, 2012 at 05:14:03PM +0200, Michael Niedermayer wrote:
On Sun, Apr 08, 2012 at 04:24:11PM +0200, Reimar Döffinger wrote:
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de> --- tests/lavf-regression.sh | 13 +++++++++++++ tests/ref/lavf/gif | 21 +++++++++++++++++++++ tests/ref/lavf/xbm | 3 +++ 3 files changed, 37 insertions(+) create mode 100644 tests/ref/lavf/xbm
diff --git a/tests/lavf-regression.sh b/tests/lavf-regression.sh index fcb8794..97fdd3f 100755 --- a/tests/lavf-regression.sh +++ b/tests/lavf-regression.sh @@ -169,9 +169,18 @@ do_streamed_images ppm fi
if [ -n "$do_gif" ] ; then +# this tests the gif muxer file=${outfile}lavf.gif do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10 -pix_fmt rgb24 do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt rgb24 +# and this the gif encoder +do_image_formats gif +do_image_formats gif "-pix_fmt rgb4_byte" +do_image_formats gif "-pix_fmt bgr4_byte" +do_image_formats gif "-pix_fmt rgb8" +do_image_formats gif "-pix_fmt bgr8" +do_image_formats gif "-pix_fmt gray" +do_image_formats gif "-pix_fmt pal8" fi
if [ -n "$do_yuv4mpeg" ] ; then @@ -196,6 +205,10 @@ do_image_formats png "-pix_fmt gray16be" do_image_formats png "-pix_fmt rgb48be" fi
+if [ -n "$do_xbm" ] ; then +do_image_formats xbm +fi + if [ -n "$do_bmp" ] ; then do_image_formats bmp fi diff --git a/tests/ref/lavf/gif b/tests/ref/lavf/gif index 4a4ebfb..e8639ac 100644 --- a/tests/ref/lavf/gif +++ b/tests/ref/lavf/gif @@ -1,3 +1,24 @@ e6089fd4ef3b9df44090ab3650bdd810 *./tests/data/lavf/lavf.gif 2906401 ./tests/data/lavf/lavf.gif ./tests/data/lavf/lavf.gif CRC=0xe5605ff6 +fc4792ac40319344dc7027668a403fc3 *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0xf217a95e +81538 ./tests/data/images/gif/02.gif +759522b3025fcf8ed6aae582a18c5a14 *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0x879a13f3 +38715 ./tests/data/images/gif/02.gif +21e802ae7a2239bdbea6f915da1134b9 *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0xe578993d +38715 ./tests/data/images/gif/02.gif +fc4792ac40319344dc7027668a403fc3 *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0xf217a95e +81538 ./tests/data/images/gif/02.gif +022dc66b5068404e88c618ce79d9eb5f *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0x526cd97f +81538 ./tests/data/images/gif/02.gif +e3392f49c55aa794d3dc49189f52f257 *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0x46618ac3 +63144 ./tests/data/images/gif/02.gif +022dc66b5068404e88c618ce79d9eb5f *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0x526cd97f +81538 ./tests/data/images/gif/02.gif
this looks a bit terse, somehow getting PSNR values would be much more usefull than checksums in terms of spoting issues when they change
This applies to all image format tests. For some reason they are all implemented as lavf tests which don't do that kind of thing, I have no idea why. This was just a quick way to get some results so at least stuff like crashes and stuff completely not working are detected.
well, i ve no objection to the patch, i just wanted to point it out in case someone wants to fix it ... [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The real ebay dictionary, page 2 "100% positive feedback" - "All either got their money back or didnt complain" "Best seller ever, very honest" - "Seller refunded buyer after failed scam"
On Sun, Apr 08, 2012 at 06:16:59PM +0200, Michael Niedermayer wrote:
On Sun, Apr 08, 2012 at 05:44:58PM +0200, Reimar Döffinger wrote:
On Sun, Apr 08, 2012 at 05:14:03PM +0200, Michael Niedermayer wrote:
+022dc66b5068404e88c618ce79d9eb5f *./tests/data/images/gif/02.gif +./tests/data/images/gif/%02d.gif CRC=0x526cd97f +81538 ./tests/data/images/gif/02.gif
this looks a bit terse, somehow getting PSNR values would be much more usefull than checksums in terms of spoting issues when they change
This applies to all image format tests. For some reason they are all implemented as lavf tests which don't do that kind of thing, I have no idea why. This was just a quick way to get some results so at least stuff like crashes and stuff completely not working are detected.
well, i ve no objection to the patch, i just wanted to point it out in case someone wants to fix it ...
Yes, I too would appreciate that, agreed. My focus though for now is on getting coverage on things that currently have none at all for no good reason.
On Sun, Apr 08, 2012 at 04:14:45PM +0200, Reimar Döffinger wrote:
This fixes that the GIF encoder crashes with it because it has no palette. And the arguments for the pseudopalette apply to gray8 as much as to RGB8 etc. In addition the changes required in lavfi should be needed anyway when adding support for RGB8 etc.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
the patch should be ok [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No great genius has ever existed without some touch of madness. -- Aristotle
participants (2)
-
Michael Niedermayer -
Reimar Döffinger