Skip to content

Commit d442483

Browse files
committed
Bug 1963852 - Vendor libwebrtc from ecde63eab5
Upstream commit: https://webrtc.googlesource.com/src/+/ecde63eab5b643e9d84220b8a50208b4cd8ad866 Do not crop to render resolution by default Disable cropping to render resolution by default. This functionality was added in https://webrtc-review.googlesource.com/c/src/+/381340 and https://webrtc-review.googlesource.com/c/src/+/382241 and was enabled by default to make things work with HW encoders which use render resolution to signal cropping. After discussions with AV1 folks the consensus is that encoders should not use render resolution to signal crop. Currently there is no way to signal crop in AV1 bitstream. There is a proposal for adding this info to AV1 metadata: AOMediaCodec/av1-spec#346. Bug: webrtc:405341160, b:402019802, b:405299912 Change-Id: I9cff9f2f8e7c9b8933fd0fbb100ce37221eaf084 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/382640 Reviewed-by: Danil Chapovalov <danilchapwebrtc.org> Commit-Queue: Sergey Silkin <ssilkinwebrtc.org> Cr-Commit-Position: refs/heads/main{#44228} UltraBlame original commit: 03d8ebe4ce8f1794a65113a7d3b05147e10be5a7
1 parent fe330f8 commit d442483

File tree

4 files changed

+184
-44
lines changed

4 files changed

+184
-44
lines changed

third_party/libwebrtc/README.mozilla.last-vendor

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ on
7676
-
7777
16T17
7878
:
79-
54
79+
55
8080
:
81-
26
81+
29
8282
.
83-
514856
83+
566850
8484
+
8585
00
8686
:
@@ -91,4 +91,4 @@ base
9191
of
9292
lastest
9393
vendoring
94-
0802e02aa2
94+
ecde63eab5

third_party/libwebrtc/modules/video_coding/codecs/av1/BUILD.gn

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,23 @@ video_codec_interface
325325
/
326326
api
327327
:
328+
refcountedbase
329+
"
330+
"
331+
.
332+
.
333+
/
334+
.
335+
.
336+
/
337+
.
338+
.
339+
/
340+
.
341+
.
342+
/
343+
api
344+
:
328345
scoped_refptr
329346
"
330347
"
@@ -1013,21 +1030,6 @@ test
10131030
:
10141031
test_support
10151032
"
1016-
"
1017-
/
1018-
/
1019-
third_party
1020-
/
1021-
abseil
1022-
-
1023-
cpp
1024-
/
1025-
absl
1026-
/
1027-
functional
1028-
:
1029-
any_invocable
1030-
"
10311033
]
10321034
if
10331035
(

third_party/libwebrtc/modules/video_coding/codecs/av1/dav1d_decoder.cc

Lines changed: 86 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,41 @@ algorithm
2020
>
2121
#
2222
include
23+
<
24+
cstdint
25+
>
26+
#
27+
include
28+
<
29+
memory
30+
>
31+
#
32+
include
33+
<
34+
optional
35+
>
36+
#
37+
include
38+
"
39+
api
40+
/
41+
environment
42+
/
43+
environment
44+
.
45+
h
46+
"
47+
#
48+
include
49+
"
50+
api
51+
/
52+
ref_counted_base
53+
.
54+
h
55+
"
56+
#
57+
include
2358
"
2459
api
2560
/
@@ -45,13 +80,35 @@ api
4580
/
4681
video
4782
/
83+
video_frame
84+
.
85+
h
86+
"
87+
#
88+
include
89+
"
90+
api
91+
/
92+
video
93+
/
4894
video_frame_buffer
4995
.
5096
h
5197
"
5298
#
5399
include
54100
"
101+
api
102+
/
103+
video_codecs
104+
/
105+
video_decoder
106+
.
107+
h
108+
"
109+
#
110+
include
111+
"
55112
common_video
56113
/
57114
include
@@ -95,6 +152,23 @@ include
95152
/
96153
dav1d
97154
/
155+
data
156+
.
157+
h
158+
"
159+
#
160+
include
161+
"
162+
third_party
163+
/
164+
dav1d
165+
/
166+
libdav1d
167+
/
168+
include
169+
/
170+
dav1d
171+
/
98172
dav1d
99173
.
100174
h
@@ -104,13 +178,15 @@ include
104178
"
105179
third_party
106180
/
107-
libyuv
181+
dav1d
182+
/
183+
libdav1d
108184
/
109185
include
110186
/
111-
libyuv
187+
dav1d
112188
/
113-
convert
189+
headers
114190
.
115191
h
116192
"
@@ -119,13 +195,15 @@ include
119195
"
120196
third_party
121197
/
122-
libyuv
198+
dav1d
199+
/
200+
libdav1d
123201
/
124202
include
125203
/
126-
libyuv
204+
dav1d
127205
/
128-
planar_functions
206+
picture
129207
.
130208
h
131209
"
@@ -253,7 +331,7 @@ const
253331
bool
254332
crop_to_render_resolution_
255333
=
256-
true
334+
false
257335
;
258336
}
259337
;
@@ -395,14 +473,13 @@ env
395473
:
396474
crop_to_render_resolution_
397475
(
398-
!
399476
env
400477
.
401478
field_trials
402479
(
403480
)
404481
.
405-
IsDisabled
482+
IsEnabled
406483
(
407484
"
408485
WebRTC

third_party/libwebrtc/modules/video_coding/codecs/av1/dav1d_decoder_unittest.cc

Lines changed: 77 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ h
1616
#
1717
include
1818
<
19-
memory
19+
cstdint
2020
>
2121
#
2222
include
2323
<
24-
optional
24+
memory
2525
>
2626
#
2727
include
2828
<
29-
string
29+
optional
3030
>
3131
#
3232
include
@@ -36,17 +36,6 @@ utility
3636
#
3737
include
3838
"
39-
absl
40-
/
41-
functional
42-
/
43-
any_invocable
44-
.
45-
h
46-
"
47-
#
48-
include
49-
"
5039
api
5140
/
5241
array_view
@@ -511,14 +500,86 @@ decoded_frame_
511500
TEST
512501
(
513502
Dav1dDecoderTest
514-
CropsToRenderResolutionByDefault
503+
KeepsDecodedResolutionByDefault
504+
)
505+
{
506+
TestAv1Decoder
507+
decoder
508+
(
509+
CreateEnvironment
510+
(
511+
)
512+
)
513+
;
514+
decoder
515+
.
516+
Decode
517+
(
518+
CreateEncodedImage
519+
(
520+
kAv1FrameWith36x20EncodededAnd32x16RenderResolution
521+
)
522+
)
523+
;
524+
EXPECT_EQ
525+
(
526+
decoder
527+
.
528+
decoded_frame
529+
(
530+
)
531+
.
532+
width
533+
(
534+
)
535+
36
536+
)
537+
;
538+
EXPECT_EQ
539+
(
540+
decoder
541+
.
542+
decoded_frame
543+
(
544+
)
545+
.
546+
height
547+
(
548+
)
549+
20
550+
)
551+
;
552+
}
553+
TEST
554+
(
555+
Dav1dDecoderTest
556+
CropsToRenderResolutionWhenCropIsEnabled
515557
)
516558
{
517559
TestAv1Decoder
518560
decoder
519561
(
520562
CreateEnvironment
521563
(
564+
std
565+
:
566+
:
567+
make_unique
568+
<
569+
ExplicitKeyValueConfig
570+
>
571+
(
572+
"
573+
WebRTC
574+
-
575+
Dav1dDecoder
576+
-
577+
CropToRenderResolution
578+
/
579+
Enabled
580+
/
581+
"
582+
)
522583
)
523584
)
524585
;
@@ -564,7 +625,7 @@ height
564625
TEST
565626
(
566627
Dav1dDecoderTest
567-
KeepsDecodedResolutionWhenCropIsDisabled
628+
DoesNotCropToRenderResolutionWhenCropIsDisabled
568629
)
569630
{
570631
TestAv1Decoder

0 commit comments

Comments
 (0)