fate/spdif: Add spdif tests

These tests test both the demuxer as well as the muxer
wherever possible. It is not always possible due to the fact
that the muxer supports more codecs than the demuxer.

The spdif demuxer does currently not set the need_parsing flag.
If one were to set this to AVSTREAM_PARSE_FULL, the test results
would change as follows:
- For spdif-aac-remux, the packets are currently padded to 16bits,
i.e. if the actual packet size is odd, there is a padding byte.
The parser splits this byte away into a one byte packet of its own.
Insanely, these one byte packets get the same duration as normal
packets, i.e. timing is ruined.
- The DCA-remux tests get proper duration/timestamps.
- In the spdif-mp2-remux test the demuxer marks the stream as
being MP2; the parser sets it to MP3 and this triggers
the "Codec change in IEC 61937" codepath; this test therefore
returns only two packets with the parser.
- For spdif-mp3-remux some bytes end up in different packets:
Some input packets of this file have an odd length (417B instead
of 418B like all the other packets) and are padded to 418B.
Without a parser, all returned packets from the spdif-demuxer
are 418B. With a parser, the packets that were originally 417B
are 417B again, but the padding byte has not been discarded,
but added to the next packet which is now 419B.
This fixes "Multiple frames in a packet" warning and avoids
an "Invalid data found when processing input" error when decoding.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2022-09-11 18:34:47 +02:00
parent 50a4dff69f
commit 9ad3db3ad9
14 changed files with 1496 additions and 0 deletions

View File

@ -231,6 +231,7 @@ include $(SRC_PATH)/tests/fate/real.mak
include $(SRC_PATH)/tests/fate/screen.mak
include $(SRC_PATH)/tests/fate/segment.mak
include $(SRC_PATH)/tests/fate/source.mak
include $(SRC_PATH)/tests/fate/spdif.mak
include $(SRC_PATH)/tests/fate/speedhq.mak
include $(SRC_PATH)/tests/fate/subtitles.mak
include $(SRC_PATH)/tests/fate/truehd.mak

44
tests/fate/spdif.mak Normal file
View File

@ -0,0 +1,44 @@
# This padds the AAC frames to 16 bit words (the actual size is
# still available in the ADTS headers).
FATE_SPDIF_REMUX-$(call ALLYES, AAC_DEMUXER AAC_DECODER) += fate-spdif-aac-remux
fate-spdif-aac-remux: CMD = transcode aac $(TARGET_SAMPLES)/aac/foo.aac spdif "-c copy" "-c copy"
FATE_SPDIF_REMUX-$(call ALLYES, AC3_DEMUXER AC3_DECODER) += fate-spdif-ac3-remux
fate-spdif-ac3-remux: CMD = transcode ac3 $(TARGET_SAMPLES)/ac3/monsters_inc_5.1_448_small.ac3 spdif "-c copy" "-c copy"
FATE_SPDIF_REMUX-$(call ALLYES, DTS_DEMUXER DCA_DECODER) += fate-spdif-dca-core-remux
fate-spdif-dca-core-remux: CMD = transcode dts $(TARGET_SAMPLES)/dts/dcadec-suite/core_51_24_48_768_0.dtshd spdif "-c copy" "-c copy"
FATE_SPDIF-$(call DEMMUX, DTSHD, SPDIF) += fate-spdif-dca-core-bswap
fate-spdif-dca-core-bswap: CMD = md5 -i $(TARGET_SAMPLES)/dts/dcadec-suite/core_51_24_48_768_0.dtshd -c copy -spdif_flags +be -f spdif
# Only the core will be transferred, extensions are discarded.
FATE_SPDIF_REMUX-$(call ALLYES, DTS_DEMUXER DCA_DECODER) += fate-spdif-dca-master-core-remux
fate-spdif-dca-master-core-remux: CMD = transcode dts $(TARGET_SAMPLES)/dts/master_audio_7.1_24bit.dts spdif "-c copy" "-c copy"
FATE_SPDIF-$(call DEMMUX, DTS, SPDIF) += fate-spdif-dca-master fate-spdif-dca-master-core
fate-spdif-dca-master: CMD = md5 -i $(TARGET_SAMPLES)/dts/master_audio_7.1_24bit.dts -c copy -dtshd_rate 192000 -f spdif
# This test uses a too low bitrate and therefore switches to only transmit the core.
fate-spdif-dca-master-core: CMD = md5 -i $(TARGET_SAMPLES)/dts/master_audio_7.1_24bit.dts -c copy -dtshd_rate 96000 -f spdif
FATE_SPDIF-$(call DEMMUX, EAC3, SPDIF) += fate-spdif-eac3
fate-spdif-eac3: CMD = md5 -i $(TARGET_SAMPLES)/eac3/csi_miami_stereo_128_spx.eac3 -c copy -f spdif
FATE_SPDIF-$(call DEMMUX, MLP, SPDIF) += fate-spdif-mlp
fate-spdif-mlp: CMD = md5 -i $(TARGET_SAMPLES)/lossless-audio/luckynight-partial.mlp -c copy -f spdif
# Note: The spdif demuxer marks the generated file as containing MP3.
FATE_SPDIF_REMUX-$(call ALLYES, MPEGTS_DEMUXER MPEGAUDIO_PARSER MP3_DECODER) += fate-spdif-mp2-remux
fate-spdif-mp2-remux: CMD = transcode mpegts $(TARGET_SAMPLES)/mpeg2/xdcam8mp2-1s_small.ts spdif "-map 0:a -c copy" "-c copy"
FATE_SPDIF_REMUX-$(call ALLYES, MP3_DEMUXER MP3_DECODER) += fate-spdif-mp3-remux
fate-spdif-mp3-remux: CMD = transcode mp3 $(TARGET_SAMPLES)/audiomatch/square3.mp3 spdif "-c copy" "-c copy"
FATE_SPDIF-$(call DEMMUX, TRUEHD, SPDIF) += fate-spdif-truehd
fate-spdif-truehd: CMD = md5 -i $(TARGET_SAMPLES)/truehd/atmos.thd -c copy -f spdif
# Make the demuxer support all the formats supported by the muxer
# and switch the md5 tests to remux tests?
FATE_SPDIF-$(call REMUX, SPDIF) += $(FATE_SPDIF_REMUX-yes)
FATE_SAMPLES_FFMPEG += $(FATE_SPDIF-yes)
fate-spdif: $(FATE_SPDIF-yes)

View File

@ -0,0 +1,93 @@
1a324961354902555e25d30f67300f51 *tests/data/fate/spdif-aac-remux.spdif
352256 tests/data/fate/spdif-aac-remux.spdif
#tb 0: 1/90000
#media_type 0: audio
#codec_id 0: aac
#sample_rate 0: 44100
#channel_layout_name 0: stereo
0, 0, 0, 2089, 378, 0x5ebf1e99
0, 2089, 2089, 2089, 410, 0x9a9cc8b5
0, 4179, 4179, 2089, 410, 0xf2ffc522
0, 6268, 6268, 2089, 404, 0x4a1dc5a1
0, 8358, 8358, 2089, 412, 0x38c5cd55
0, 10448, 10448, 2089, 440, 0x363fdb80
0, 12538, 12538, 2089, 376, 0x269ec08b
0, 14628, 14628, 2089, 378, 0xd627be91
0, 16717, 16717, 2089, 434, 0x7f68d7ba
0, 18807, 18807, 2089, 354, 0x52b5b11f
0, 20897, 20897, 2089, 368, 0x4458a8c2
0, 22987, 22987, 2089, 378, 0x789ab43a
0, 25077, 25077, 2089, 378, 0x476ec1f4
0, 27166, 27166, 2089, 366, 0xe13fb37a
0, 29256, 29256, 2089, 370, 0x3772b685
0, 31346, 31346, 2089, 366, 0x54bbb52b
0, 33436, 33436, 2089, 380, 0x28a9bc19
0, 35526, 35526, 2089, 496, 0x761efc09
0, 37615, 37615, 2089, 354, 0xb524bb1f
0, 39705, 39705, 2089, 348, 0xcef9b075
0, 41795, 41795, 2089, 360, 0x5a50bc48
0, 43885, 43885, 2089, 362, 0xb454b67c
0, 45975, 45975, 2089, 362, 0x2502aab4
0, 48064, 48064, 2089, 378, 0x9336b10f
0, 50154, 50154, 2089, 376, 0x2dcbb1e6
0, 52244, 52244, 2089, 370, 0x8064ac7f
0, 54334, 54334, 2089, 368, 0x300ebac3
0, 56424, 56424, 2089, 372, 0x88ccba7c
0, 58513, 58513, 2089, 370, 0x1ad6b67b
0, 60603, 60603, 2089, 374, 0x1969bafe
0, 62693, 62693, 2089, 378, 0x1d55b287
0, 64783, 64783, 2089, 370, 0xffc7b1e0
0, 66873, 66873, 2089, 392, 0x1ab2c1af
0, 68962, 68962, 2089, 382, 0xc98bbd75
0, 71052, 71052, 2089, 394, 0xbf2ac43b
0, 73142, 73142, 2089, 370, 0xcd31bbef
0, 75232, 75232, 2089, 394, 0x579eca77
0, 77322, 77322, 2089, 386, 0xdeebc55a
0, 79411, 79411, 2089, 384, 0xc125c2b8
0, 81501, 81501, 2089, 366, 0x0ce6bf87
0, 83591, 83591, 2089, 380, 0x202fbd37
0, 85681, 85681, 2089, 454, 0x6997e64d
0, 87771, 87771, 2089, 356, 0x41f9b837
0, 89860, 89860, 2089, 362, 0x3f9bb026
0, 91950, 91950, 2089, 368, 0xe511af25
0, 94040, 94040, 2089, 418, 0x42f7d1d5
0, 96130, 96130, 2089, 410, 0x657dd072
0, 98220, 98220, 2089, 490, 0x1476f7f6
0, 100309, 100309, 2089, 350, 0x44fbb45f
0, 102399, 102399, 2089, 350, 0xfd52aef1
0, 104489, 104489, 2089, 350, 0xd354aa2f
0, 106579, 106579, 2089, 352, 0xbaaaad58
0, 108668, 108668, 2089, 354, 0x591baa8c
0, 110758, 110758, 2089, 362, 0xf053b0e1
0, 112848, 112848, 2089, 376, 0x8fafbbf8
0, 114938, 114938, 2089, 444, 0xde95eef0
0, 117028, 117028, 2089, 342, 0x5869a95e
0, 119117, 119117, 2089, 402, 0x6d2eca68
0, 121207, 121207, 2089, 380, 0xe1c1b4ee
0, 123297, 123297, 2089, 358, 0x3807ad6f
0, 125387, 125387, 2089, 350, 0xaa47aa0f
0, 127477, 127477, 2089, 358, 0xf8dbabbf
0, 129566, 129566, 2089, 368, 0x701fae8c
0, 131656, 131656, 2089, 368, 0x60c1b34e
0, 133746, 133746, 2089, 392, 0x749ac181
0, 135836, 135836, 2089, 478, 0xce58f5ab
0, 137926, 137926, 2089, 346, 0x5767a88b
0, 140015, 140015, 2089, 362, 0x7998b479
0, 142105, 142105, 2089, 356, 0x300bb3eb
0, 144195, 144195, 2089, 362, 0xa783b13f
0, 146285, 146285, 2089, 356, 0x8ce5b0bd
0, 148375, 148375, 2089, 402, 0x684fc5d8
0, 150464, 150464, 2089, 434, 0x83d8e111
0, 152554, 152554, 2089, 352, 0x5e3ab34f
0, 154644, 154644, 2089, 364, 0xa2a5ab60
0, 156734, 156734, 2089, 380, 0x0c90bbfd
0, 158824, 158824, 2089, 378, 0x1ee7bf81
0, 160913, 160913, 2089, 378, 0xb3d1b08e
0, 163003, 163003, 2089, 372, 0x7480b657
0, 165093, 165093, 2089, 376, 0x9e31bfd0
0, 167183, 167183, 2089, 424, 0x963bdd40
0, 169273, 169273, 2089, 468, 0x6016f010
0, 171362, 171362, 2089, 472, 0x69c4e4c5
0, 173452, 173452, 2089, 334, 0x2354ab0b
0, 175542, 175542, 2089, 346, 0xe85bab65
0, 177632, 177632, 2089, 266, 0x93bb7efa

View File

@ -0,0 +1,63 @@
d2c51a1156406cd8895122998efa66ec *tests/data/fate/spdif-ac3-remux.spdif
344064 tests/data/fate/spdif-ac3-remux.spdif
#tb 0: 1/90000
#media_type 0: audio
#codec_id 0: ac3
#sample_rate 0: 48000
#channel_layout_name 0: 5.1(side)
0, 0, 0, 2880, 1792, 0xc6250823
0, 2880, 2880, 2880, 1792, 0xb76a1098
0, 5760, 5760, 2880, 1792, 0xfe6e1038
0, 8640, 8640, 2880, 1792, 0x102f060a
0, 11520, 11520, 2880, 1792, 0xfd881629
0, 14400, 14400, 2880, 1792, 0x950505f6
0, 17280, 17280, 2880, 1792, 0x3d9a143f
0, 20160, 20160, 2880, 1792, 0xa2261142
0, 23040, 23040, 2880, 1792, 0x9cc9053d
0, 25920, 25920, 2880, 1792, 0xaaeb109b
0, 28800, 28800, 2880, 1792, 0xd36308f6
0, 31680, 31680, 2880, 1792, 0xb08a125d
0, 34560, 34560, 2880, 1792, 0xd8d31026
0, 37440, 37440, 2880, 1792, 0x9b87a34d
0, 40320, 40320, 2880, 1792, 0x51ed77f6
0, 43200, 43200, 2880, 1792, 0x29c16ed2
0, 46080, 46080, 2880, 1792, 0x8c9662d6
0, 48960, 48960, 2880, 1792, 0x32c85025
0, 51840, 51840, 2880, 1792, 0x32914d88
0, 54720, 54720, 2880, 1792, 0x84b9382b
0, 57600, 57600, 2880, 1792, 0x003e4890
0, 60480, 60480, 2880, 1792, 0x70325b4e
0, 63360, 63360, 2880, 1792, 0x80e04a58
0, 66240, 66240, 2880, 1792, 0x2c46323a
0, 69120, 69120, 2880, 1792, 0x7be152a5
0, 72000, 72000, 2880, 1792, 0x08615466
0, 74880, 74880, 2880, 1792, 0x55364eaf
0, 77760, 77760, 2880, 1792, 0x46595d56
0, 80640, 80640, 2880, 1792, 0xdf476ace
0, 83520, 83520, 2880, 1792, 0x9ff767dc
0, 86400, 86400, 2880, 1792, 0xb4d450a7
0, 89280, 89280, 2880, 1792, 0x032c7506
0, 92160, 92160, 2880, 1792, 0x50e35426
0, 95040, 95040, 2880, 1792, 0xe5575597
0, 97920, 97920, 2880, 1792, 0x86565611
0, 100800, 100800, 2880, 1792, 0xed6f54aa
0, 103680, 103680, 2880, 1792, 0x4cee4aab
0, 106560, 106560, 2880, 1792, 0x8aa33ac7
0, 109440, 109440, 2880, 1792, 0xb665442c
0, 112320, 112320, 2880, 1792, 0x9a4b647d
0, 115200, 115200, 2880, 1792, 0xf40d582d
0, 118080, 118080, 2880, 1792, 0xf22e5d98
0, 120960, 120960, 2880, 1792, 0x2f7745be
0, 123840, 123840, 2880, 1792, 0xa918561a
0, 126720, 126720, 2880, 1792, 0x59cc56fb
0, 129600, 129600, 2880, 1792, 0xaefe5dca
0, 132480, 132480, 2880, 1792, 0x80ba657d
0, 135360, 135360, 2880, 1792, 0x09137032
0, 138240, 138240, 2880, 1792, 0xf51b5d34
0, 141120, 141120, 2880, 1792, 0x1d695fb1
0, 144000, 144000, 2880, 1792, 0xf6f56509
0, 146880, 146880, 2880, 1792, 0xd1f658d5
0, 149760, 149760, 2880, 1792, 0xb8614f64
0, 152640, 152640, 2880, 1792, 0x8dd55743
0, 155520, 155520, 2880, 1792, 0xcb1f50df
0, 158400, 158400, 2880, 1440, 0xa129aa95

View File

@ -0,0 +1 @@
45ff602f64887babf37f4ee14e5d5072

View File

@ -0,0 +1,14 @@
a4e739ebe07c75dd569156d5038696a9 *tests/data/fate/spdif-dca-core-remux.spdif
14336 tests/data/fate/spdif-dca-core-remux.spdif
#tb 0: 1/90000
#media_type 0: audio
#codec_id 0: dts
#sample_rate 0: 48000
#channel_layout_name 0: 5.1(side)
0, 0, 0, 0, 1024, 0x07b79d2a
0, 0, 0, 0, 1024, 0x7eaaba77
0, 0, 0, 0, 1024, 0xbed65c1d
0, 0, 0, 0, 1024, 0x10bc6792
0, 0, 0, 0, 1024, 0xf8436f6e
0, 0, 0, 0, 1024, 0x4454a681
0, 0, 0, 0, 1024, 0xda3ba189

View File

@ -0,0 +1 @@
00d1ec506aa862a0c17c197c3773a82b

View File

@ -0,0 +1 @@
43fc10a0a8360931f946f80b9941c9c5

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
b881db03eb6370e057645396d1880260

1
tests/ref/fate/spdif-mlp Normal file
View File

@ -0,0 +1 @@
6deb20b45c83b0edce9b91a44a76137c

View File

@ -0,0 +1,49 @@
1ca2b4cb48fd0f14b8a53d9330152d33 *tests/data/fate/spdif-mp2-remux.spdif
193536 tests/data/fate/spdif-mp2-remux.spdif
#tb 0: 1/90000
#media_type 0: audio
#codec_id 0: mp3
#sample_rate 0: 48000
#channel_layout_name 0: stereo
0, 0, 0, 2160, 1152, 0x6f926334
0, 2160, 2160, 2160, 1152, 0xa1ca68b3
0, 4320, 4320, 2160, 1152, 0xefa54d9e
0, 6480, 6480, 2160, 1152, 0xd224482c
0, 8640, 8640, 2160, 1152, 0xa1003b3d
0, 10800, 10800, 2160, 1152, 0x196d2d8d
0, 12960, 12960, 2160, 1152, 0x76616814
0, 15120, 15120, 2160, 1152, 0x7de26bc5
0, 17280, 17280, 2160, 1152, 0xaf093a77
0, 19440, 19440, 2160, 1152, 0xa128456e
0, 21600, 21600, 2160, 1152, 0xb4152c91
0, 23760, 23760, 2160, 1152, 0xe14e51c0
0, 25920, 25920, 2160, 1152, 0x9ec060bb
0, 28080, 28080, 2160, 1152, 0x8fc34ee7
0, 30240, 30240, 2160, 1152, 0xa6194f4e
0, 32400, 32400, 2160, 1152, 0x7612307a
0, 34560, 34560, 2160, 1152, 0x2ad2523f
0, 36720, 36720, 2160, 1152, 0xd7686d66
0, 38880, 38880, 2160, 1152, 0x47af67e7
0, 41040, 41040, 2160, 1152, 0x25a357d4
0, 43200, 43200, 2160, 1152, 0x94a66533
0, 45360, 45360, 2160, 1152, 0xcd646915
0, 47520, 47520, 2160, 1152, 0xc3614dc2
0, 49680, 49680, 2160, 1152, 0x17da5f3e
0, 51840, 51840, 2160, 1152, 0x11194069
0, 54000, 54000, 2160, 1152, 0x29af3e5b
0, 56160, 56160, 2160, 1152, 0x37c83b1b
0, 58320, 58320, 2160, 1152, 0xaba73200
0, 60480, 60480, 2160, 1152, 0x743a482d
0, 62640, 62640, 2160, 1152, 0xab435176
0, 64800, 64800, 2160, 1152, 0x3f363c6a
0, 66960, 66960, 2160, 1152, 0xbbaf35ad
0, 69120, 69120, 2160, 1152, 0xc7783d29
0, 71280, 71280, 2160, 1152, 0x28963a4e
0, 73440, 73440, 2160, 1152, 0xdda343dd
0, 75600, 75600, 2160, 1152, 0x1e4857e3
0, 77760, 77760, 2160, 1152, 0x0bfd43bf
0, 79920, 79920, 2160, 1152, 0x1bee45f5
0, 82080, 82080, 2160, 1152, 0xf816371b
0, 84240, 84240, 2160, 1152, 0x70eb4605
0, 86400, 86400, 2160, 1152, 0x3dea4608
0, 88560, 88560, 2160, 1152, 0x709d5317

View File

@ -0,0 +1,47 @@
a7c7fb1e53b1758096f11974ca93cdf7 *tests/data/fate/spdif-mp3-remux.spdif
184320 tests/data/fate/spdif-mp3-remux.spdif
#tb 0: 1/90000
#media_type 0: audio
#codec_id 0: mp3
#sample_rate 0: 44100
#channel_layout_name 0: mono
0, 0, 0, 2351, 418, 0x64d1b620
0, 2351, 2351, 2351, 418, 0x04edc6dd
0, 4702, 4702, 2351, 418, 0x2f1ac32b
0, 7053, 7053, 2351, 418, 0xa5ebce7b
0, 9404, 9404, 2351, 418, 0xa4e1d8b5
0, 11755, 11755, 2351, 418, 0xf927d670
0, 14106, 14106, 2351, 418, 0x4e8ccae5
0, 16457, 16457, 2351, 418, 0x2b0ad5c2
0, 18808, 18808, 2351, 418, 0x4a2fcc63
0, 21159, 21159, 2351, 418, 0xe945dbc7
0, 23510, 23510, 2351, 418, 0x601cd144
0, 25861, 25861, 2351, 418, 0x052dc6a9
0, 28212, 28212, 2351, 418, 0x348bd06b
0, 30563, 30563, 2351, 418, 0x2996d2bd
0, 32914, 32914, 2351, 418, 0xf658cc71
0, 35265, 35265, 2351, 418, 0xeb19d2bf
0, 37616, 37616, 2351, 418, 0xd547d84e
0, 39967, 39967, 2351, 418, 0x4a59d73f
0, 42318, 42318, 2351, 418, 0xedbcd9bf
0, 44669, 44669, 2351, 418, 0x36c1d5fb
0, 47020, 47020, 2351, 418, 0x30ddcf11
0, 49371, 49371, 2351, 418, 0xc1c6d2de
0, 51722, 51722, 2351, 418, 0xeed0cfc8
0, 54073, 54073, 2351, 418, 0xe7bfde05
0, 56424, 56424, 2351, 418, 0x3bbec91f
0, 58775, 58775, 2351, 418, 0x4f76cc86
0, 61126, 61126, 2351, 418, 0x9819cdd2
0, 63477, 63477, 2351, 418, 0x2cddd971
0, 65828, 65828, 2351, 418, 0x2b84d6f8
0, 68179, 68179, 2351, 418, 0xe483ce32
0, 70530, 70530, 2351, 418, 0x68add0b0
0, 72881, 72881, 2351, 418, 0xddd6d0bf
0, 75232, 75232, 2351, 418, 0x00c7d8aa
0, 77583, 77583, 2351, 418, 0x915fd36c
0, 79934, 79934, 2351, 418, 0x28d2d73c
0, 82285, 82285, 2351, 418, 0xaa7ad8b4
0, 84636, 84636, 2351, 418, 0xe4e6d680
0, 86987, 86987, 2351, 418, 0x4084d578
0, 89338, 89338, 2351, 418, 0x3ab4b6e7
0, 91689, 91689, 2351, 418, 0x951b66f9

View File

@ -0,0 +1 @@
ed9617614478a05b3f94a74d3f1061d9