Skip to content

Commit f934a7f

Browse files
committed
Resync WebCodec's Audio{Decoder,Encoder} web-platform-tests.
https://bugs.webkit.org/show_bug.cgi?id=283900 rdar://140781718 Reviewed by NOBODY (OOPS!). Upstream commit: web-platform-tests/wpt@76dfa54 Make modifications to our code to pass some new tests that caused failures. All of them are about non-normalised changes with non-specified specification. Corresponding WPT or spec bugs were opened as mentioned in the related code comments. We have two failures marked as expected as they are clearly not spec compliant web-platform-tests/wpt#49636 * LayoutTests/TestExpectations: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/README.md: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/WEB_FEATURES.yml: Added. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audio-data.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audio-data.any.js: (createDefaultAudioData): (pow2): (isInteger): (epsilon): (get_type_values): (typeToArrayType): (arrayTypeToType): (check_array_equality): (conversionTest): * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audio-data.any.worker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audio-decoder.https.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audio-decoder.https.any.js: (description.new.Uint8Array): * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audio-decoder.https.any.worker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audio-encoder-config.https.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audio-encoder-config.https.any.js: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audio-encoder-config.https.any.worker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.html: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.js: (pcm): * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker.html: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_flac-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_pcm_mulaw-expected.txt. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_pcm_f32-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any_pcm_mulaw-expected.txt. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_pcm_s16-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_pcm_mulaw-expected.txt. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_pcm_s24-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_pcm_mulaw-expected.txt. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_pcm_s32-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_pcm_mulaw-expected.txt. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_pcm_u8-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_pcm_mulaw-expected.txt. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_pcm_ulaw-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_pcm_mulaw-expected.txt. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_vorbis-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_pcm_mulaw-expected.txt. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any_flac-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_pcm_mulaw-expected.txt. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any_pcm_f32-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_pcm_mulaw-expected.txt. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any_pcm_s16-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_pcm_mulaw-expected.txt. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any_pcm_s24-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_pcm_mulaw-expected.txt. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any_pcm_s32-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_pcm_mulaw-expected.txt. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any_pcm_u8-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_pcm_mulaw-expected.txt. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any_pcm_ulaw-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_pcm_mulaw-expected.txt. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any_vorbis-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker_pcm_mulaw-expected.txt. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/idlharness.https.any.js: (async idlArray): * LayoutTests/imported/w3c/web-platform-tests/webcodecs/sfx-pcm-f32.wav: Added. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/sfx-pcm-s16.wav: Added. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/sfx-pcm-s24.wav: Added. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/sfx-pcm-s32.wav: Added. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/sfx-pcm-u8.wav: Added. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/sfx-ulaw.wav: Renamed from LayoutTests/imported/w3c/web-platform-tests/webcodecs/sfx-mulaw.wav. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/sfx-vorbis.ogg: Added. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/sfx.flac: Added. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/w3c-import.log: * Source/WebCore/Modules/webcodecs/WebCodecsAudioDecoder.cpp: (WebCore::isValidDecoderConfig): * Source/WebCore/Modules/webcodecs/WebCodecsAudioEncoder.cpp: (WebCore::isSupportedEncoderCodec): (WebCore::isValidEncoderConfig):
1 parent 4818979 commit f934a7f

File tree

44 files changed

+863
-312
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+863
-312
lines changed

LayoutTests/TestExpectations

+6
Original file line numberDiff line numberDiff line change
@@ -5761,6 +5761,12 @@ imported/w3c/web-platform-tests/html/canvas/offscreen/text/canvas.2d.fontStretch
57615761
imported/w3c/web-platform-tests/html/canvas/offscreen/text/canvas.2d.fontStretch.ultra-expanded.html [ ImageOnlyFailure ]
57625762
imported/w3c/web-platform-tests/webcodecs/videoFrame-drawImage.any.worker.html [ Failure ]
57635763

5764+
# Flac and Vorbis decoding requires an extra description which isn't provided.
5765+
imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.html?flac [ Failure ]
5766+
imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.html?vorbis [ Failure ]
5767+
imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker.html?flac [ Failure ]
5768+
imported/w3c/web-platform-tests/webcodecs/audioDecoder-codec-specific.https.any.worker.html?vorbis [ Failure ]
5769+
57645770
# HEVC support may not be available to all platforms.
57655771
imported/w3c/web-platform-tests/webcodecs/full-cycle-test.https.any.html?h265_annexb [ Pass Failure ]
57665772
imported/w3c/web-platform-tests/webcodecs/full-cycle-test.https.any.html?h265_hevc [ Pass Failure ]

LayoutTests/imported/w3c/web-platform-tests/webcodecs/README.md

+20-6
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,16 @@ sox -n -r 48000 sfx.wav synth 1 sine 480
114114
ffmpeg -i sfx.wav -frames:a 10 -acodec aac -b:a 96K sfx.adts
115115
```
116116

117-
### sfx-alaw.wav
117+
### sfx.mp3
118118
```
119119
sox -n -r 48000 sfx.wav synth 1 sine 480
120-
ffmpeg -i sfx.wav -frames:a 10 -acodec pcm_alaw sfx-alaw.wav
120+
ffmpeg -i sfx.wav -frames:a 10 -acodec libmp3lame -b:a 96K sfx.mp3
121121
```
122122

123-
### sfx.mp3
123+
### sfx.flac
124124
```
125125
sox -n -r 48000 sfx.wav synth 1 sine 480
126-
ffmpeg -i sfx.wav -frames:a 10 -acodec libmp3lame -b:a 96K sfx.mp3
126+
ffmpeg -i sfx.wav -frames:a 10 sfx.flac
127127
```
128128

129129
### sfx-aac.mp4
@@ -132,16 +132,30 @@ sox -n -r 48000 sfx.wav synth 1 sine 480
132132
ffmpeg -i sfx.wav -frames:a 10 -acodec aac -b:a 96K sfx-aac.mp4
133133
```
134134

135-
### sfx-mulaw.wav
135+
### sfx-*.wav
136136
```
137137
sox -n -r 48000 sfx.wav synth 1 sine 480
138-
ffmpeg -i sfx.wav -frames:a 10 -acodec pcm_mulaw sfx-mulaw.wav
138+
for codec in s16 s24 s32 f32
139+
do
140+
# Add "le" suffix
141+
ffmpeg -i sfx.wav -frames:a 10 -acodec pcm_"$codec"le sfx-pcm-$codec.wav
142+
done
143+
ffmpeg -i sfx.wav -frames:a 10 -acodec pcm_u8 sfx-pcm-u8.wav
144+
for codec in alaw mulaw
145+
do
146+
ffmpeg -i sfx.wav -frames:a 10 -acodec pcm_$codec sfx-$codec.wav
147+
done
139148
```
140149

141150
### sfx-opus.ogg
142151
```
143152
sox -n -r 48000 sfx.wav synth 1 sine 480
144153
ffmpeg -i sfx.wav -frames:a 10 -acodec libopus -b:a 96K sfx-opus.ogg
154+
155+
### sfx-vorbis.ogg
156+
```
157+
sox -n -r 48000 sfx.wav synth 1 sine 480
158+
ffmpeg -i sfx.wav -frames:a 10 -acodec libvorbis -b:a 96K sfx-vorbis.ogg
145159
```
146160
147161
### av1.mp4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
features:
2+
- name: webcodecs
3+
files: "**"

LayoutTests/imported/w3c/web-platform-tests/webcodecs/audio-data.any-expected.txt

+18-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,22 @@
22
PASS Verify AudioData constructors
33
PASS Verify closing and cloning AudioData
44
PASS Test we can construct AudioData with a negative timestamp.
5-
PASS Test conversion of uint8 data to float32
6-
PASS Test conversion of int16 data to float32
7-
PASS Test conversion of int32 data to float32
8-
PASS Test conversion of float32 data to float32
9-
PASS Test copying out planar and interleaved data
5+
PASS Test input array is copied on construction
6+
PASS Test that copyTo throws if copying from interleaved with a non-zero planeIndex
7+
PASS Test conversion of u8 to u8
8+
PASS Test conversion of u8 to s16
9+
PASS Test conversion of u8 to s32
10+
PASS Test conversion of u8 to f32
11+
PASS Test conversion of s16 to u8
12+
PASS Test conversion of s16 to s16
13+
PASS Test conversion of s16 to s32
14+
PASS Test conversion of s16 to f32
15+
PASS Test conversion of s32 to u8
16+
PASS Test conversion of s32 to s16
17+
PASS Test conversion of s32 to s32
18+
PASS Test conversion of s32 to f32
19+
PASS Test conversion of f32 to u8
20+
PASS Test conversion of f32 to s16
21+
PASS Test conversion of f32 to s32
22+
PASS Test conversion of f32 to f32
1023

0 commit comments

Comments
 (0)