Skip to content

Commit a133f16

Browse files
committed
Bug 1995393 - Vendor libwebrtc from 8e8480de52
Upstream commit: https://webrtc.googlesource.com/src/+/8e8480de52505e4a086010b4732ce1197bc17139 Calculate video encode PSNR (in supported codecs) the Y, U and V components, applications can do a weighted average. https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-psnrsum Depends on cisco/openh264#3824 (for OpenH264) https://chromium-review.googlesource.com/c/webm/libvpx/+/6167966 (libvpx) https://aomedia-review.googlesource.com/c/aom/+/196501 (libaom) This CL implements the codec changes, https://webrtc-review.googlesource.com/c/src/+/375021 is a follow-up to wire up getStats. BUG=webrtc:388070060 Change-Id: I7046158a7b6e4183a9ec939fcac94eee9d65530d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/368960 Reviewed-by: Erik Språng <sprangwebrtc.org> Commit-Queue: Philipp Hancke <phanckemeta.com> Reviewed-by: Harald Alvestrand <htawebrtc.org> Cr-Commit-Position: refs/heads/main{#45312} UltraBlame original commit: befe911a3f68a9dc904c9ae60f4e3d2262e5c1ea
1 parent 738f025 commit a133f16

29 files changed

+1577
-108
lines changed

third_party/libwebrtc/README.mozilla.last-vendor

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ on
7070
-
7171
10
7272
-
73-
22T20
73+
22T21
7474
:
75-
59
75+
02
7676
:
77-
28
77+
26
7878
.
79-
116125
79+
587370
8080
+
8181
00
8282
:
@@ -87,4 +87,4 @@ base
8787
of
8888
lastest
8989
vendoring
90-
b7bde5ab8a
90+
8e8480de52

third_party/libwebrtc/api/video/encoded_image.h

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,32 @@ EncodedImage
383383
{
384384
public
385385
:
386+
struct
387+
Psnr
388+
{
389+
double
390+
y
391+
=
392+
0
393+
.
394+
0
395+
;
396+
double
397+
u
398+
=
399+
0
400+
.
401+
0
402+
;
403+
double
404+
v
405+
=
406+
0
407+
.
408+
0
409+
;
410+
}
411+
;
386412
EncodedImage
387413
(
388414
)
@@ -1261,6 +1287,40 @@ return
12611287
timing_
12621288
;
12631289
}
1290+
std
1291+
:
1292+
:
1293+
optional
1294+
<
1295+
Psnr
1296+
>
1297+
psnr
1298+
(
1299+
)
1300+
const
1301+
{
1302+
return
1303+
psnr_
1304+
;
1305+
}
1306+
void
1307+
set_psnr
1308+
(
1309+
std
1310+
:
1311+
:
1312+
optional
1313+
<
1314+
Psnr
1315+
>
1316+
psnr
1317+
)
1318+
{
1319+
psnr_
1320+
=
1321+
psnr
1322+
;
1323+
}
12641324
private
12651325
:
12661326
size_t
@@ -1401,6 +1461,15 @@ CorruptionDetectionFilterSettings
14011461
>
14021462
corruption_detection_filter_settings_
14031463
;
1464+
std
1465+
:
1466+
:
1467+
optional
1468+
<
1469+
Psnr
1470+
>
1471+
psnr_
1472+
;
14041473
}
14051474
;
14061475
}

third_party/libwebrtc/call/BUILD.gn

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2929,6 +2929,16 @@ api
29292929
/
29302930
video
29312931
:
2932+
encoded_image
2933+
"
2934+
"
2935+
.
2936+
.
2937+
/
2938+
api
2939+
/
2940+
video
2941+
:
29322942
video_frame
29332943
"
29342944
"

third_party/libwebrtc/call/video_send_stream.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,17 @@ api
127127
/
128128
video
129129
/
130+
encoded_image
131+
.
132+
h
133+
"
134+
#
135+
include
136+
"
137+
api
138+
/
139+
video
140+
/
130141
video_content_type
131142
.
132143
h
@@ -401,6 +412,17 @@ uint64_t
401412
>
402413
qp_sum
403414
;
415+
EncodedImage
416+
:
417+
:
418+
Psnr
419+
psnr_sum
420+
;
421+
uint64_t
422+
psnr_measurements
423+
=
424+
0
425+
;
404426
uint64_t
405427
total_encode_time_ms
406428
=

third_party/libwebrtc/experiments/field_trials.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,26 @@
11411141
)
11421142
)
11431143

1144+
FieldTrial
1145+
(
1146+
'
1147+
WebRTC
1148+
-
1149+
Video
1150+
-
1151+
CalculatePsnr
1152+
'
1153+
1154+
388070060
1155+
1156+
date
1157+
(
1158+
2026
1159+
1
1160+
1
1161+
)
1162+
)
1163+
11441164
FieldTrial
11451165
(
11461166
'

third_party/libwebrtc/media/BUILD.gn

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2406,6 +2406,16 @@ api
24062406
/
24072407
video
24082408
:
2409+
encoded_image
2410+
"
2411+
"
2412+
.
2413+
.
2414+
/
2415+
api
2416+
/
2417+
video
2418+
:
24092419
recordable_encoded_frame
24102420
"
24112421
"

third_party/libwebrtc/media/base/media_channel.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,17 @@ api
276276
/
277277
video
278278
/
279+
encoded_image
280+
.
281+
h
282+
"
283+
#
284+
include
285+
"
286+
api
287+
/
288+
video
289+
/
279290
recordable_encoded_frame
280291
.
281292
h
@@ -2643,6 +2654,20 @@ VideoContentType
26432654
:
26442655
UNSPECIFIED
26452656
;
2657+
webrtc
2658+
:
2659+
:
2660+
EncodedImage
2661+
:
2662+
:
2663+
Psnr
2664+
psnr_sum
2665+
;
2666+
uint32_t
2667+
psnr_measurements
2668+
=
2669+
0
2670+
;
26462671
uint32_t
26472672
frames_sent
26482673
=

third_party/libwebrtc/media/engine/webrtc_video_engine.cc

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14843,6 +14843,22 @@ qp_sum
1484314843
;
1484414844
info
1484514845
.
14846+
psnr_sum
14847+
=
14848+
stream_stats
14849+
.
14850+
psnr_sum
14851+
;
14852+
info
14853+
.
14854+
psnr_measurements
14855+
=
14856+
stream_stats
14857+
.
14858+
psnr_measurements
14859+
;
14860+
info
14861+
.
1484614862
total_encode_time_ms
1484714863
=
1484814864
stream_stats
@@ -15287,6 +15303,79 @@ i
1528715303
qp_sum
1528815304
;
1528915305
}
15306+
if
15307+
(
15308+
infos
15309+
[
15310+
i
15311+
]
15312+
.
15313+
psnr_measurements
15314+
>
15315+
0
15316+
)
15317+
{
15318+
info
15319+
.
15320+
psnr_measurements
15321+
+
15322+
=
15323+
infos
15324+
[
15325+
i
15326+
]
15327+
.
15328+
psnr_measurements
15329+
;
15330+
info
15331+
.
15332+
psnr_sum
15333+
.
15334+
y
15335+
+
15336+
=
15337+
infos
15338+
[
15339+
i
15340+
]
15341+
.
15342+
psnr_sum
15343+
.
15344+
y
15345+
;
15346+
info
15347+
.
15348+
psnr_sum
15349+
.
15350+
u
15351+
+
15352+
=
15353+
infos
15354+
[
15355+
i
15356+
]
15357+
.
15358+
psnr_sum
15359+
.
15360+
u
15361+
;
15362+
info
15363+
.
15364+
psnr_sum
15365+
.
15366+
v
15367+
+
15368+
=
15369+
infos
15370+
[
15371+
i
15372+
]
15373+
.
15374+
psnr_sum
15375+
.
15376+
v
15377+
;
15378+
}
1529015379
info
1529115380
.
1529215381
frames_encoded

0 commit comments

Comments
 (0)