[FFmpeg-cvslog] FATE: Add FITS tests
Paras Chadha
git at videolan.org
Wed Aug 30 13:20:32 EEST 2017
ffmpeg | branch: master | Paras Chadha <paraschadha18 at gmail.com> | Tue Aug 29 23:24:42 2017 +0530| [9d99f0afbeedf3e170478c3e8c05789bf2eef48f] | committer: Paul B Mahol
FATE: Add FITS tests
Signed-off-by: Paras Chadha <paraschadha18 at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9d99f0afbeedf3e170478c3e8c05789bf2eef48f
---
tests/Makefile | 1 +
tests/fate/avformat.mak | 1 +
tests/fate/demux.mak | 4 +++
tests/fate/fits.mak | 59 +++++++++++++++++++++++++++++++++
tests/lavf-regression.sh | 9 +++++
tests/ref/fate/fits-demux | 10 ++++++
tests/ref/fate/fitsdec-bitpix-32 | 6 ++++
tests/ref/fate/fitsdec-bitpix-64 | 6 ++++
tests/ref/fate/fitsdec-blank_bitpix32 | 6 ++++
tests/ref/fate/fitsdec-ext_data_min_max | 6 ++++
tests/ref/fate/fitsdec-gbrap16 | 6 ++++
tests/ref/fate/fitsdec-gbrp | 6 ++++
tests/ref/fate/fitsdec-gbrp16 | 6 ++++
tests/ref/fate/fitsdec-gray | 6 ++++
tests/ref/fate/fitsdec-multi | 10 ++++++
tests/ref/fate/fitsenc-gbrap | 10 ++++++
tests/ref/fate/fitsenc-gbrap16be | 10 ++++++
tests/ref/fate/fitsenc-gbrp | 10 ++++++
tests/ref/fate/fitsenc-gbrp16be | 10 ++++++
tests/ref/fate/fitsenc-gray | 10 ++++++
tests/ref/fate/fitsenc-gray16be | 10 ++++++
tests/ref/lavf/fits | 18 ++++++++++
22 files changed, 220 insertions(+)
diff --git a/tests/Makefile b/tests/Makefile
index 30f05bec15..18fe9c5b4a 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -131,6 +131,7 @@ include $(SRC_PATH)/tests/fate/fft.mak
include $(SRC_PATH)/tests/fate/fifo-muxer.mak
include $(SRC_PATH)/tests/fate/filter-audio.mak
include $(SRC_PATH)/tests/fate/filter-video.mak
+include $(SRC_PATH)/tests/fate/fits.mak
include $(SRC_PATH)/tests/fate/flac.mak
include $(SRC_PATH)/tests/fate/flvenc.mak
include $(SRC_PATH)/tests/fate/gapless.mak
diff --git a/tests/fate/avformat.mak b/tests/fate/avformat.mak
index 82a531c7a5..c4cf2bc473 100644
--- a/tests/fate/avformat.mak
+++ b/tests/fate/avformat.mak
@@ -10,6 +10,7 @@ FATE_LAVF-$(call ENCDEC, PCM_S16BE, CAF) += caf
FATE_LAVF-$(call ENCDEC, DPX, IMAGE2) += dpx
FATE_LAVF-$(call ENCDEC2, DVVIDEO, PCM_S16LE, AVI) += dv_fmt
FATE_LAVF-$(call ENCDEC2, MPEG1VIDEO, MP2, FFM) += ffm
+FATE_LAVF-$(call ENCDEC, FITS, IMAGE2) += fits
FATE_LAVF-$(call ENCDEC, RAWVIDEO, FILMSTRIP) += flm
FATE_LAVF-$(call ENCDEC, FLV, FLV) += flv_fmt
FATE_LAVF-$(call ENCDEC, GIF, IMAGE2) += gif
diff --git a/tests/fate/demux.mak b/tests/fate/demux.mak
index 8a2703fc84..261b004d69 100644
--- a/tests/fate/demux.mak
+++ b/tests/fate/demux.mak
@@ -36,6 +36,10 @@ fate-d-cinema-demux: CMD = framecrc -i $(TARGET_SAMPLES)/d-cinema/THX_Science_FL
FATE_SAMPLES_DEMUX-$(CONFIG_EA_DEMUXER) += fate-d-eavp6-demux
fate-d-eavp6-demux: CMD = framecrc -i $(TARGET_SAMPLES)/ea-vp6/SmallRing.vp6 -map 0 -vcodec copy
+FATE_SAMPLES_DEMUX-$(CONFIG_FITS_DEMUXER) += fate-fits-demux
+fate-fits-demux: tests/data/fits-multi.fits
+fate-fits-demux: CMD = framecrc -i $(TARGET_PATH)/tests/data/fits-multi.fits -vcodec copy
+
FATE_SAMPLES_DEMUX-$(CONFIG_FLV_DEMUXER) += fate-flv-demux
fate-flv-demux: CMD = framecrc -i $(TARGET_SAMPLES)/flv/Enigma_Principles_of_Lust-part.flv -codec copy
diff --git a/tests/fate/fits.mak b/tests/fate/fits.mak
new file mode 100644
index 0000000000..bc1b771a52
--- /dev/null
+++ b/tests/fate/fits.mak
@@ -0,0 +1,59 @@
+tests/data/fits-multi.fits: TAG = GEN
+tests/data/fits-multi.fits: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
+ $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
+ -i $(TARGET_SAMPLES)/gif/m4nb.gif \
+ -y $(TARGET_PATH)/$(@) 2>/dev/null
+
+#mapping of fits file formats to png filenames
+map.tests/data/lena-gray.fits := gray8
+map.tests/data/lena-gbrp.fits := rgb24
+map.tests/data/lena-gbrp16.fits := rgb48
+map.tests/data/lena-gbrap16.fits := rgba64
+
+tests/data/lena%.fits: TAG = GEN
+tests/data/lena%.fits: NAME = $(map.$(@))
+tests/data/lena%.fits: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
+ $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
+ -i $(TARGET_SAMPLES)/png1/lena-$(map.$(@)).png \
+ -y $(TARGET_PATH)/$(@) 2>/dev/null
+
+FATE_FITS_DEC-$(call DEMDEC, FITS, FITS) += fate-fitsdec-ext_data_min_max
+fate-fitsdec-ext_data_min_max: CMD = framecrc -i $(TARGET_SAMPLES)/fits/x0cj010ct_d0h.fit -pix_fmt gray16
+
+FATE_FITS_DEC-$(call DEMDEC, FITS, FITS) += fate-fitsdec-blank_bitpix32
+fate-fitsdec-blank_bitpix32: CMD = framecrc -blank_value 65535 -i $(TARGET_SAMPLES)/fits/file008.fits -pix_fmt gray16
+
+FATE_FITS_DEC-$(call DEMDEC, FITS, FITS) += fate-fitsdec-bitpix-32
+fate-fitsdec-bitpix-32: CMD = framecrc -i $(TARGET_SAMPLES)/fits/tst0005.fits -pix_fmt gray16
+
+FATE_FITS_DEC-$(call DEMDEC, FITS, FITS) += fate-fitsdec-bitpix-64
+fate-fitsdec-bitpix-64: CMD = framecrc -i $(TARGET_SAMPLES)/fits/tst0006.fits -pix_fmt gray16
+
+FATE_FITS_DEC-$(call DEMDEC, FITS, FITS) += fate-fitsdec-multi
+fate-fitsdec-multi: tests/data/fits-multi.fits
+fate-fitsdec-multi: CMD = framecrc -i $(TARGET_PATH)/tests/data/fits-multi.fits -pix_fmt gbrap
+
+fate-fitsdec%: PIXFMT = $(word 3, $(subst -, ,$(@)))
+fate-fitsdec%: SRC = $(TARGET_PATH)/tests/data/lena-$(PIXFMT).fits
+fate-fitsdec%: CMD = framecrc -i $(SRC) -pix_fmt $(PIXFMT)
+
+FATE_FITS_DEC_PIXFMT = gray gbrp gbrp16 gbrap16
+$(FATE_FITS_DEC_PIXFMT:%=fate-fitsdec-%): fate-fitsdec-%: tests/data/lena-%.fits
+FATE_FITS_DEC-$(call DEMDEC, FITS, FITS) += $(FATE_FITS_DEC_PIXFMT:%=fate-fitsdec-%)
+
+FATE_FITS += $(FATE_FITS_DEC-yes)
+fate-fitsdec: $(FATE_FITS_DEC-yes)
+
+fate-fitsenc%: PIXFMT = $(word 3, $(subst -, ,$(@)))
+fate-fitsenc%: SRC = $(TARGET_PATH)/tests/data/fits-multi.fits
+fate-fitsenc%: CMD = framecrc -i $(SRC) -c:v fits -pix_fmt $(PIXFMT)
+
+FATE_FITS_ENC_PIXFMT = gray gray16be gbrp gbrap gbrp16be gbrap16be
+$(FATE_FITS_ENC_PIXFMT:%=fate-fitsenc-%): tests/data/fits-multi.fits
+FATE_FITS_ENC-$(call ENCDEC, FITS, FITS) += $(FATE_FITS_ENC_PIXFMT:%=fate-fitsenc-%)
+
+FATE_FITS += $(FATE_FITS_ENC-yes)
+fate-fitsenc: $(FATE_FITS_ENC-yes)
+
+FATE_SAMPLES_FFMPEG += $(FATE_FITS)
+fate-fits: $(FATE_FITS)
diff --git a/tests/lavf-regression.sh b/tests/lavf-regression.sh
index eda40f25db..d9026de021 100755
--- a/tests/lavf-regression.sh
+++ b/tests/lavf-regression.sh
@@ -230,6 +230,15 @@ do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 -q
#do_avconv_crc $file -i $target_path/$file
fi
+if [ -n "$do_fits" ] ; then
+pix_fmts="gray gray16be gbrp gbrap gbrp16be gbrap16be"
+for pix_fmt in $pix_fmts ; do
+ file=${outfile}${pix_fmt}lavf.fits
+ do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -pix_fmt $pix_fmt
+ do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt $pix_fmt
+done
+fi
+
# image formats
if [ -n "$do_pgm" ] ; then
diff --git a/tests/ref/fate/fits-demux b/tests/ref/fate/fits-demux
new file mode 100644
index 0000000000..85605ab11a
--- /dev/null
+++ b/tests/ref/fate/fits-demux
@@ -0,0 +1,10 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: fits
+#dimensions 0: 72x36
+#sar 0: 0/1
+0, 0, 0, 1, 14320, 0x0ecf72e0
+0, 1, 1, 1, 14320, 0xd94af6eb
+0, 2, 2, 1, 14320, 0x15c21892
+0, 3, 3, 1, 14320, 0xb18adc01
+0, 4, 4, 1, 14320, 0xc2be706d
diff --git a/tests/ref/fate/fitsdec-bitpix-32 b/tests/ref/fate/fitsdec-bitpix-32
new file mode 100644
index 0000000000..9bce361555
--- /dev/null
+++ b/tests/ref/fate/fitsdec-bitpix-32
@@ -0,0 +1,6 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 102x109
+#sar 0: 0/1
+0, 0, 0, 1, 22236, 0x34490902
diff --git a/tests/ref/fate/fitsdec-bitpix-64 b/tests/ref/fate/fitsdec-bitpix-64
new file mode 100644
index 0000000000..9febdd68f4
--- /dev/null
+++ b/tests/ref/fate/fitsdec-bitpix-64
@@ -0,0 +1,6 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 77x173
+#sar 0: 0/1
+0, 0, 0, 1, 26642, 0x0ad2a46a
diff --git a/tests/ref/fate/fitsdec-blank_bitpix32 b/tests/ref/fate/fitsdec-blank_bitpix32
new file mode 100644
index 0000000000..184fd41c59
--- /dev/null
+++ b/tests/ref/fate/fitsdec-blank_bitpix32
@@ -0,0 +1,6 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 256x256
+#sar 0: 0/1
+0, 0, 0, 1, 131072, 0x7fb22427
diff --git a/tests/ref/fate/fitsdec-ext_data_min_max b/tests/ref/fate/fitsdec-ext_data_min_max
new file mode 100644
index 0000000000..9009a4efb3
--- /dev/null
+++ b/tests/ref/fate/fitsdec-ext_data_min_max
@@ -0,0 +1,6 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 512x512
+#sar 0: 0/1
+0, 0, 0, 1, 524288, 0xc327ed23
diff --git a/tests/ref/fate/fitsdec-gbrap16 b/tests/ref/fate/fitsdec-gbrap16
new file mode 100644
index 0000000000..78abb5cde7
--- /dev/null
+++ b/tests/ref/fate/fitsdec-gbrap16
@@ -0,0 +1,6 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 128x128
+#sar 0: 0/1
+0, 0, 0, 1, 131072, 0x487894b2
diff --git a/tests/ref/fate/fitsdec-gbrp b/tests/ref/fate/fitsdec-gbrp
new file mode 100644
index 0000000000..8767b6715f
--- /dev/null
+++ b/tests/ref/fate/fitsdec-gbrp
@@ -0,0 +1,6 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 128x128
+#sar 0: 0/1
+0, 0, 0, 1, 49152, 0x565c3dee
diff --git a/tests/ref/fate/fitsdec-gbrp16 b/tests/ref/fate/fitsdec-gbrp16
new file mode 100644
index 0000000000..f6368f2c02
--- /dev/null
+++ b/tests/ref/fate/fitsdec-gbrp16
@@ -0,0 +1,6 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 128x128
+#sar 0: 0/1
+0, 0, 0, 1, 98304, 0x1b917bdc
diff --git a/tests/ref/fate/fitsdec-gray b/tests/ref/fate/fitsdec-gray
new file mode 100644
index 0000000000..425b31fc0f
--- /dev/null
+++ b/tests/ref/fate/fitsdec-gray
@@ -0,0 +1,6 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 128x128
+#sar 0: 0/1
+0, 0, 0, 1, 16384, 0xd788a2d2
diff --git a/tests/ref/fate/fitsdec-multi b/tests/ref/fate/fitsdec-multi
new file mode 100644
index 0000000000..f24f0adaab
--- /dev/null
+++ b/tests/ref/fate/fitsdec-multi
@@ -0,0 +1,10 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 72x36
+#sar 0: 0/1
+0, 0, 0, 1, 10368, 0xb4490cc8
+0, 1, 1, 1, 10368, 0x37198e4f
+0, 2, 2, 1, 10368, 0x1e89afe7
+0, 3, 3, 1, 10368, 0x80127365
+0, 4, 4, 1, 10368, 0xfd2d07d1
diff --git a/tests/ref/fate/fitsenc-gbrap b/tests/ref/fate/fitsenc-gbrap
new file mode 100644
index 0000000000..3e32fc687e
--- /dev/null
+++ b/tests/ref/fate/fitsenc-gbrap
@@ -0,0 +1,10 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: fits
+#dimensions 0: 72x36
+#sar 0: 0/1
+0, 0, 0, 1, 11520, 0xeb0a0cc8
+0, 1, 1, 1, 11520, 0x9d7d8e4f
+0, 2, 2, 1, 11520, 0xd9e6afe7
+0, 3, 3, 1, 11520, 0x75bd7365
+0, 4, 4, 1, 11520, 0x86f107d1
diff --git a/tests/ref/fate/fitsenc-gbrap16be b/tests/ref/fate/fitsenc-gbrap16be
new file mode 100644
index 0000000000..1f74f4e750
--- /dev/null
+++ b/tests/ref/fate/fitsenc-gbrap16be
@@ -0,0 +1,10 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: fits
+#dimensions 0: 72x36
+#sar 0: 0/1
+0, 0, 0, 1, 23040, 0xfa4ff4f0
+0, 1, 1, 1, 23040, 0xf57102d4
+0, 2, 2, 1, 23040, 0x58e0294d
+0, 3, 3, 1, 23040, 0x8097502a
+0, 4, 4, 1, 23040, 0x65fd7b54
diff --git a/tests/ref/fate/fitsenc-gbrp b/tests/ref/fate/fitsenc-gbrp
new file mode 100644
index 0000000000..4101a0e452
--- /dev/null
+++ b/tests/ref/fate/fitsenc-gbrp
@@ -0,0 +1,10 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: fits
+#dimensions 0: 72x36
+#sar 0: 0/1
+0, 0, 0, 1, 8640, 0xf6b9f643
+0, 1, 1, 1, 8640, 0x250d77d9
+0, 2, 2, 1, 8640, 0x652595e5
+0, 3, 3, 1, 8640, 0x4b8e5963
+0, 4, 4, 1, 8640, 0xd8d611ab
diff --git a/tests/ref/fate/fitsenc-gbrp16be b/tests/ref/fate/fitsenc-gbrp16be
new file mode 100644
index 0000000000..d4b043ffe6
--- /dev/null
+++ b/tests/ref/fate/fitsenc-gbrp16be
@@ -0,0 +1,10 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: fits
+#dimensions 0: 72x36
+#sar 0: 0/1
+0, 0, 0, 1, 17280, 0x6b87eec5
+0, 1, 1, 1, 17280, 0x1bf0fc9a
+0, 2, 2, 1, 17280, 0xaf071b1e
+0, 3, 3, 1, 17280, 0xfbe941fb
+0, 4, 4, 1, 17280, 0xbbc26d01
diff --git a/tests/ref/fate/fitsenc-gray b/tests/ref/fate/fitsenc-gray
new file mode 100644
index 0000000000..46eb76c43b
--- /dev/null
+++ b/tests/ref/fate/fitsenc-gray
@@ -0,0 +1,10 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: fits
+#dimensions 0: 72x36
+#sar 0: 0/1
+0, 0, 0, 1, 2880, 0xd2d83752
+0, 1, 1, 1, 2880, 0x77246e79
+0, 2, 2, 1, 2880, 0xdf480c1f
+0, 3, 3, 1, 2880, 0x559247a9
+0, 4, 4, 1, 2880, 0xc3df2cc4
diff --git a/tests/ref/fate/fitsenc-gray16be b/tests/ref/fate/fitsenc-gray16be
new file mode 100644
index 0000000000..ec4e0efd3c
--- /dev/null
+++ b/tests/ref/fate/fitsenc-gray16be
@@ -0,0 +1,10 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: fits
+#dimensions 0: 72x36
+#sar 0: 0/1
+0, 0, 0, 1, 5760, 0x317ba180
+0, 1, 1, 1, 5760, 0x439c9e40
+0, 2, 2, 1, 5760, 0x6136ff8f
+0, 3, 3, 1, 5760, 0x2c331324
+0, 4, 4, 1, 5760, 0x2f0816c1
diff --git a/tests/ref/lavf/fits b/tests/ref/lavf/fits
new file mode 100644
index 0000000000..489542b32b
--- /dev/null
+++ b/tests/ref/lavf/fits
@@ -0,0 +1,18 @@
+ed9fd697d0d782df6201f6a2db184552 *./tests/data/lavf/graylavf.fits
+5328000 ./tests/data/lavf/graylavf.fits
+./tests/data/lavf/graylavf.fits CRC=0xbacf446c
+48e6caf6a59e32f9a8a39979c9183a7f *./tests/data/lavf/gray16belavf.fits
+10368000 ./tests/data/lavf/gray16belavf.fits
+./tests/data/lavf/gray16belavf.fits CRC=0xae2b58d4
+be2f7112fd193c9a909304c81e662769 *./tests/data/lavf/gbrplavf.fits
+15408000 ./tests/data/lavf/gbrplavf.fits
+./tests/data/lavf/gbrplavf.fits CRC=0x04ed3828
+c89a72185cfad363aa9cc42e84fed301 *./tests/data/lavf/gbraplavf.fits
+20448000 ./tests/data/lavf/gbraplavf.fits
+./tests/data/lavf/gbraplavf.fits CRC=0x032a6409
+d539b9e02f5ab8fb85717c8adb60b6cc *./tests/data/lavf/gbrp16belavf.fits
+30672000 ./tests/data/lavf/gbrp16belavf.fits
+./tests/data/lavf/gbrp16belavf.fits CRC=0x81897ff7
+3dc3622fb09a338b406d8a12a30f2545 *./tests/data/lavf/gbrap16belavf.fits
+40752000 ./tests/data/lavf/gbrap16belavf.fits
+./tests/data/lavf/gbrap16belavf.fits CRC=0x247dd7b9
More information about the ffmpeg-cvslog
mailing list