[FFmpeg-devel] [PATCH] Fix a bug in ff_thread_report_progress in updating progress[field].

Wan-Teh Chang wtc at google.com
Wed Mar 2 02:05:55 CET 2016


On Tue, Mar 1, 2016 at 7:44 AM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> Hi,
>
> On Tue, Mar 1, 2016 at 9:34 AM, Wan-Teh Chang <wtc-at-google.com at ffmpeg.org>
> wrote:
>
>> By the way, I'm also wondering why ff_thread_report_progress is
>> sometimes called with progress[field] >= n? I saw it happen when I ran
>> make fate-h264, but did not investigate it.
>
> I don't know, which sample (test name) specifically?

The attached ff_thread_report_progress.txt file is a patch for ffmpeg
that counts the fast and slow code paths in ff_thread_report_progress
and ff_thread_await_progress, and prints the counters at the end.

I ran "make fate-h264 THREADS=4". Here are the results, which show
that the fast code path (progress[field] >= n) was taken in
ff_thread_report_progress.

wtc at hostname:~/ffmpeg-dev/fast-slow-paths-instrumentation/ffmpeg/tests/data/fate$
grep slow *.err
h264-conformance-aud_mw_e.err:report_progress: fast=100, slow=1000 |
await_progress: fast=10999, slow=198
h264-conformance-ba1_ft_c.err:report_progress: fast=299, slow=5382 |
await_progress: fast=112159, slow=1254
h264-conformance-ba1_sony_d.err:report_progress: fast=17, slow=153 |
await_progress: fast=0, slow=0
h264-conformance-ba2_sony_f.err:report_progress: fast=300, slow=2700 |
await_progress: fast=36259, slow=688
h264-conformance-ba3_sva_c.err:report_progress: fast=17, slow=153 |
await_progress: fast=6054, slow=48
h264-conformance-bamq1_jvc_c.err:report_progress: fast=30, slow=270 |
await_progress: fast=0, slow=0
h264-conformance-bamq2_jvc_c.err:report_progress: fast=30, slow=270 |
await_progress: fast=4235, slow=87
h264-conformance-ba_mw_d.err:report_progress: fast=100, slow=900 |
await_progress: fast=10969, slow=223
h264-conformance-banm_mw_d.err:report_progress: fast=100, slow=900 |
await_progress: fast=9003, slow=243
h264-conformance-basqp1_sony_c.err:report_progress: fast=4, slow=36 |
await_progress: fast=0, slow=0
h264-conformance-caba1_sony_d.err:report_progress: fast=50, slow=450 |
await_progress: fast=0, slow=0
h264-conformance-caba1_sva_b.err:report_progress: fast=17, slow=153 |
await_progress: fast=0, slow=0
h264-conformance-caba2_sony_e.err:report_progress: fast=300, slow=2700
| await_progress: fast=34215, slow=920
h264-conformance-caba2_sva_b.err:report_progress: fast=17, slow=153 |
await_progress: fast=1610, slow=24
h264-conformance-caba3_sony_c.err:report_progress: fast=101, slow=909
| await_progress: fast=60774, slow=264
h264-conformance-caba3_sva_b.err:report_progress: fast=17, slow=153 |
await_progress: fast=6637, slow=91
h264-conformance-caba3_toshiba_e.err:report_progress: fast=300,
slow=2700 | await_progress: fast=28113, slow=716
h264-conformance-cabaci3_sony_b.err:report_progress: fast=101,
slow=909 | await_progress: fast=60989, slow=302
h264-conformance-cabac_mot_fld0_full.err:report_progress: fast=24,
slow=360 | await_progress: fast=72775, slow=83
h264-conformance-cabac_mot_frm0_full.err:report_progress: fast=12,
slow=360 | await_progress: fast=79299, slow=225
h264-conformance-cabac_mot_mbaff0_full.err:report_progress: fast=12,
slow=180 | await_progress: fast=77371, slow=119
h264-conformance-cabac_mot_picaff0_full.err:report_progress: fast=18,
slow=346 | await_progress: fast=88910, slow=169
h264-conformance-cabast3_sony_e.err:report_progress: fast=9, slow=162
| await_progress: fast=7851, slow=54
h264-conformance-cabastbr3_sony_b.err:report_progress: fast=25,
slow=450 | await_progress: fast=7967, slow=119
h264-conformance-cabref3_sand_d.err:report_progress: fast=36, slow=324
| await_progress: fast=38201, slow=43
h264-conformance-cacqp3_sony_d.err:report_progress: fast=26, slow=234
| await_progress: fast=9512, slow=126
h264-conformance-cafi1_sva_c.err:report_progress: fast=34, slow=510 |
await_progress: fast=78904, slow=2
h264-conformance-cama1_sony_c.err:report_progress: fast=5, slow=75 |
await_progress: fast=0, slow=0
h264-conformance-cama1_toshiba_b.err:report_progress: fast=30,
slow=270 | await_progress: fast=72871, slow=191
h264-conformance-cama1_vtc_c.err:report_progress: fast=3, slow=45 |
await_progress: fast=9041, slow=14
h264-conformance-cama2_vtc_b.err:report_progress: fast=3, slow=57 |
await_progress: fast=13790, slow=14
h264-conformance-cama3_sand_e.err:report_progress: fast=18, slow=162 |
await_progress: fast=34497, slow=77
h264-conformance-cama3_vtc_b.err:report_progress: fast=3, slow=54 |
await_progress: fast=13784, slow=13
h264-conformance-camaci3_sony_c.err:report_progress: fast=7, slow=28 |
await_progress: fast=1327, slow=22
h264-conformance-camanl1_toshiba_b.err:report_progress: fast=30,
slow=300 | await_progress: fast=71845, slow=200
h264-conformance-camanl2_toshiba_b.err:report_progress: fast=30,
slow=300 | await_progress: fast=65382, slow=187
h264-conformance-camanl3_sand_e.err:report_progress: fast=18, slow=180
| await_progress: fast=34512, slow=61
h264-conformance-camasl3_sony_b.err:report_progress: fast=7, slow=28 |
await_progress: fast=3142, slow=23
h264-conformance-camp_mot_mbaff_l30.err:report_progress: fast=12,
slow=180 | await_progress: fast=76650, slow=41
h264-conformance-camp_mot_mbaff_l31.err:report_progress: fast=12,
slow=180 | await_progress: fast=75793, slow=73
h264-conformance-canl1_sony_e.err:report_progress: fast=50, slow=500 |
await_progress: fast=0, slow=0
h264-conformance-canl1_sva_b.err:report_progress: fast=17, slow=170 |
await_progress: fast=0, slow=0
h264-conformance-canl1_toshiba_g.err:report_progress: fast=300,
slow=3000 | await_progress: fast=0, slow=0
h264-conformance-canl2_sony_e.err:report_progress: fast=300, slow=3000
| await_progress: fast=34579, slow=593
h264-conformance-canl2_sva_b.err:report_progress: fast=17, slow=170 |
await_progress: fast=0, slow=0
h264-conformance-canl3_sony_c.err:report_progress: fast=101, slow=1010
| await_progress: fast=61221, slow=149
h264-conformance-canl3_sva_b.err:report_progress: fast=17, slow=170 |
await_progress: fast=1619, slow=35
h264-conformance-canl4_sva_b.err:report_progress: fast=17, slow=170 |
await_progress: fast=5735, slow=85
h264-conformance-canlma2_sony_c.err:report_progress: fast=17, slow=272
| await_progress: fast=21360, slow=61
h264-conformance-canlma3_sony_c.err:report_progress: fast=17, slow=272
| await_progress: fast=27912, slow=62
h264-conformance-capa1_toshiba_b.err:report_progress: fast=43,
slow=524 | await_progress: fast=82247, slow=219
h264-conformance-capama3_sand_f.err:report_progress: fast=28, slow=228
| await_progress: fast=43955, slow=60
h264-conformance-capcm1_sand_e.err:report_progress: fast=30, slow=540
| await_progress: fast=0, slow=0
h264-conformance-capcmnl1_sand_e.err:report_progress: fast=30,
slow=570 | await_progress: fast=0, slow=0
h264-conformance-capm3_sony_d.err:report_progress: fast=101, slow=909
| await_progress: fast=48474, slow=123
h264-conformance-caqp1_sony_b.err:report_progress: fast=50, slow=450 |
await_progress: fast=0, slow=0
h264-conformance-cavlc_mot_fld0_full_b.err:report_progress: fast=24,
slow=360 | await_progress: fast=63786, slow=36
h264-conformance-cavlc_mot_frm0_full_b.err:report_progress: fast=12,
slow=360 | await_progress: fast=63274, slow=77
h264-conformance-cavlc_mot_mbaff0_full_b.err:report_progress: fast=12,
slow=180 | await_progress: fast=62061, slow=64
h264-conformance-cavlc_mot_picaff0_full_b.err:report_progress:
fast=18, slow=346 | await_progress: fast=78081, slow=154
h264-conformance-cawp1_toshiba_e.err:report_progress: fast=90,
slow=1620 | await_progress: fast=39794, slow=273
h264-conformance-cawp5_toshiba_e.err:report_progress: fast=90,
slow=1620 | await_progress: fast=40739, slow=499
h264-conformance-ci1_ft_b.err:report_progress: fast=291, slow=5238 |
await_progress: fast=107699, slow=1051
h264-conformance-ci_mw_d.err:report_progress: fast=100, slow=900 |
await_progress: fast=11235, slow=272
h264-conformance-cvbs3_sony_c.err:report_progress: fast=101, slow=909
| await_progress: fast=59800, slow=176
h264-conformance-cvcanlma2_sony_c.err:report_progress: fast=17,
slow=272 | await_progress: fast=21351, slow=70
h264-conformance-cvfc1_sony_c.err:report_progress: fast=50, slow=900 |
await_progress: fast=28926, slow=297
h264-conformance-cvfi1_sony_d.err:report_progress: fast=34, slow=510 |
await_progress: fast=33593, slow=59
h264-conformance-cvfi1_sva_c.err:report_progress: fast=14, slow=210 |
await_progress: fast=9192, slow=2
h264-conformance-cvfi2_sony_h.err:report_progress: fast=14, slow=210 |
await_progress: fast=45249, slow=13
h264-conformance-cvfi2_sva_c.err:report_progress: fast=14, slow=210 |
await_progress: fast=31855, slow=0
h264-conformance-cvma1_sony_d.err:report_progress: fast=5, slow=75 |
await_progress: fast=0, slow=0
h264-conformance-cvma1_toshiba_b.err:report_progress: fast=30,
slow=270 | await_progress: fast=72911, slow=151
h264-conformance-cvmanl1_toshiba_b.err:report_progress: fast=30,
slow=300 | await_progress: fast=71834, slow=211
h264-conformance-cvmanl2_toshiba_b.err:report_progress: fast=30,
slow=300 | await_progress: fast=65494, slow=75
h264-conformance-cvmapaqp3_sony_e.err:report_progress: fast=6, slow=90
| await_progress: fast=18901, slow=19
h264-conformance-cvmaqp2_sony_g.err:report_progress: fast=17, slow=68
| await_progress: fast=2075, slow=36
h264-conformance-cvmaqp3_sony_d.err:report_progress: fast=7, slow=28 |
await_progress: fast=3236, slow=23
h264-conformance-cvmp_mot_fld_l30_b.err:report_progress: fast=24,
slow=360 | await_progress: fast=85696, slow=19
h264-conformance-cvmp_mot_frm_l31_b.err:report_progress: fast=24,
slow=360 | await_progress: fast=85486, slow=88
h264-conformance-cvnlfi1_sony_c.err:report_progress: fast=34, slow=544
| await_progress: fast=33449, slow=50
h264-conformance-cvnlfi2_sony_h.err:report_progress: fast=14, slow=224
| await_progress: fast=45181, slow=7
h264-conformance-cvpa1_toshiba_b.err:report_progress: fast=43,
slow=524 | await_progress: fast=79217, slow=178
h264-conformance-cvpcmnl1_sva_c.err:report_progress: fast=30, slow=570
| await_progress: fast=0, slow=0
h264-conformance-cvpcmnl2_sva_c.err:report_progress: fast=2, slow=92 |
await_progress: fast=0, slow=0
h264-conformance-cvwp1_toshiba_e.err:report_progress: fast=90,
slow=1620 | await_progress: fast=31120, slow=404
h264-conformance-cvwp2_toshiba_e.err:report_progress: fast=30,
slow=540 | await_progress: fast=64698, slow=135
h264-conformance-cvwp3_toshiba_e.err:report_progress: fast=30,
slow=540 | await_progress: fast=86291, slow=186
h264-conformance-cvwp5_toshiba_e.err:report_progress: fast=90,
slow=1620 | await_progress: fast=40740, slow=498
h264-conformance-fi1_sony_e.err:report_progress: fast=34, slow=136 |
await_progress: fast=0, slow=0
h264-conformance-frext-alphaconformanceg.err:report_progress: fast=43,
slow=1462 | await_progress: fast=88587, slow=159
h264-conformance-frext-bcrm_freh10.err:report_progress: fast=68,
slow=680 | await_progress: fast=60528, slow=86
h264-conformance-frext-brcm_freh11.err:report_progress: fast=68,
slow=612 | await_progress: fast=59051, slow=100
h264-conformance-frext-brcm_freh3.err:report_progress: fast=34,
slow=612 | await_progress: fast=65983, slow=421
h264-conformance-frext-brcm_freh4.err:report_progress: fast=68,
slow=612 | await_progress: fast=73068, slow=91
h264-conformance-frext-brcm_freh5.err:report_progress: fast=34,
slow=306 | await_progress: fast=60721, slow=203
h264-conformance-frext-brcm_freh8.err:report_progress: fast=34,
slow=646 | await_progress: fast=51951, slow=350
h264-conformance-frext-brcm_freh9.err:report_progress: fast=34,
slow=612 | await_progress: fast=51340, slow=324
h264-conformance-frext-freh12_b.err:report_progress: fast=34, slow=612
| await_progress: fast=52129, slow=316
h264-conformance-frext-freh1_b.err:report_progress: fast=34, slow=612
| await_progress: fast=61947, slow=141
h264-conformance-frext-freh2_b.err:report_progress: fast=34, slow=612
| await_progress: fast=43581, slow=173
h264-conformance-frext-freh6.err:report_progress: fast=68, slow=612 |
await_progress: fast=56440, slow=106
h264-conformance-frext-freh7_b.err:report_progress: fast=68, slow=612
| await_progress: fast=56684, slow=135
h264-conformance-frext-frext01_jvc_d.err:report_progress: fast=6,
slow=54 | await_progress: fast=13482, slow=49
h264-conformance-frext-frext02_jvc_c.err:report_progress: fast=6,
slow=54 | await_progress: fast=13482, slow=49
h264-conformance-frext-frext1_panasonic_c.err:report_progress: fast=4,
slow=72 | await_progress: fast=1943, slow=37
h264-conformance-frext-frext2_panasonic_b.err:report_progress:
fast=16, slow=144 | await_progress: fast=13633, slow=28
h264-conformance-frext-frext3_panasonic_d.err:report_progress: fast=5,
slow=90 | await_progress: fast=3920, slow=19
h264-conformance-frext-frext4_panasonic_a.err:report_progress: fast=6,
slow=54 | await_progress: fast=8580, slow=16
h264-conformance-frext-frext_mmco4_sony_b.err:report_progress:
fast=31, slow=558 | await_progress: fast=27686, slow=184
h264-conformance-frext-hcaff1_hhi_b.err:report_progress: fast=6,
slow=72 | await_progress: fast=7904, slow=15
h264-conformance-frext-hcafr1_hhi_c.err:report_progress: fast=4,
slow=72 | await_progress: fast=8483, slow=9
h264-conformance-frext-hcafr2_hhi_a.err:report_progress: fast=4,
slow=72 | await_progress: fast=6540, slow=56
h264-conformance-frext-hcafr3_hhi_a.err:report_progress: fast=4,
slow=72 | await_progress: fast=8823, slow=60
h264-conformance-frext-hcafr4_hhi_a.err:report_progress: fast=4,
slow=72 | await_progress: fast=1074, slow=13
h264-conformance-frext-hcamff1_hhi_b.err:report_progress: fast=4,
slow=36 | await_progress: fast=5978, slow=17
h264-conformance-frext-hi422fr10_sony_b.err:report_progress: fast=5,
slow=90 | await_progress: fast=0, slow=0
h264-conformance-frext-hi422fr13_sony_b.err:report_progress: fast=5,
slow=90 | await_progress: fast=0, slow=0
h264-conformance-frext-hi422fr1_sony_a.err:report_progress: fast=5,
slow=95 | await_progress: fast=0, slow=0
h264-conformance-frext-hi422fr6_sony_a.err:report_progress: fast=5,
slow=95 | await_progress: fast=0, slow=0
h264-conformance-frext-hpca_brcm_c.err:report_progress: fast=101,
slow=1818 | await_progress: fast=81705, slow=1121
h264-conformance-frext-hpcadq_brcm_b.err:report_progress: fast=101,
slow=1818 | await_progress: fast=78748, slow=892
h264-conformance-frext-hpcafl_bcrm_c.err:report_progress: fast=202,
slow=1818 | await_progress: fast=112421, slow=484
h264-conformance-frext-hpcaflnl_bcrm_c.err:report_progress: fast=202,
slow=2020 | await_progress: fast=112884, slow=543
h264-conformance-frext-hpcalq_brcm_b.err:report_progress: fast=101,
slow=1818 | await_progress: fast=78948, slow=692
h264-conformance-frext-hpcamapalq_bcrm_b.err:report_progress:
fast=149, slow=1261 | await_progress: fast=135882, slow=526
h264-conformance-frext-hpcamolq_brcm_b.err:report_progress: fast=34,
slow=612 | await_progress: fast=20573, slow=161
h264-conformance-frext-hpcanl_brcm_c.err:report_progress: fast=101,
slow=1919 | await_progress: fast=80281, slow=925
h264-conformance-frext-hpcaq2lq_brcm_b.err:report_progress: fast=34,
slow=612 | await_progress: fast=30687, slow=159
h264-conformance-frext-hpcv_brcm_a.err:report_progress: fast=101,
slow=1818 | await_progress: fast=81899, slow=927
h264-conformance-frext-hpcvfl_bcrm_a.err:report_progress: fast=202,
slow=1818 | await_progress: fast=112519, slow=386
h264-conformance-frext-hpcvflnl_bcrm_a.err:report_progress: fast=202,
slow=2020 | await_progress: fast=113011, slow=416
h264-conformance-frext-hpcvmolq_brcm_b.err:report_progress: fast=34,
slow=612 | await_progress: fast=20582, slow=153
h264-conformance-frext-hpcvnl_brcm_a.err:report_progress: fast=101,
slow=1919 | await_progress: fast=80519, slow=687
h264-conformance-frext-pph10i1_panasonic_a.err:report_progress:
fast=10, slow=450 | await_progress: fast=0, slow=0
h264-conformance-frext-pph10i2_panasonic_a.err:report_progress:
fast=10, slow=450 | await_progress: fast=0, slow=0
h264-conformance-frext-pph10i3_panasonic_a.err:report_progress:
fast=10, slow=460 | await_progress: fast=0, slow=0
h264-conformance-frext-pph10i4_panasonic_a.err:report_progress:
fast=10, slow=680 | await_progress: fast=0, slow=0
h264-conformance-frext-pph10i5_panasonic_a.err:report_progress:
fast=10, slow=680 | await_progress: fast=0, slow=0
h264-conformance-frext-pph10i6_panasonic_a.err:report_progress:
fast=10, slow=340 | await_progress: fast=0, slow=0
h264-conformance-frext-pph10i7_panasonic_a.err:report_progress:
fast=10, slow=340 | await_progress: fast=0, slow=0
h264-conformance-frext-pph422i1_panasonic_a.err:report_progress:
fast=10, slow=450 | await_progress: fast=0, slow=0
h264-conformance-frext-pph422i2_panasonic_a.err:report_progress:
fast=10, slow=450 | await_progress: fast=0, slow=0
h264-conformance-frext-pph422i3_panasonic_a.err:report_progress:
fast=10, slow=460 | await_progress: fast=0, slow=0
h264-conformance-frext-pph422i4_panasonic_a.err:report_progress:
fast=10, slow=680 | await_progress: fast=0, slow=0
h264-conformance-frext-pph422i5_panasonic_a.err:report_progress:
fast=10, slow=680 | await_progress: fast=0, slow=0
h264-conformance-frext-pph422i6_panasonic_a.err:report_progress:
fast=10, slow=340 | await_progress: fast=0, slow=0
h264-conformance-frext-pph422i7_panasonic_a.err:report_progress:
fast=10, slow=340 | await_progress: fast=0, slow=0
h264-conformance-hcbp2_hhi_a.err:report_progress: fast=125, slow=2250
| await_progress: fast=107052, slow=375
h264-conformance-hcmp1_hhi_a.err:report_progress: fast=125, slow=2250
| await_progress: fast=263099, slow=175
h264-conformance-ls_sva_d.err:report_progress: fast=1700, slow=15300 |
await_progress: fast=184066, slow=1691
h264-conformance-midr_mw_d.err:report_progress: fast=100, slow=900 |
await_progress: fast=11094, slow=242
h264-conformance-mps_mw_a.err:report_progress: fast=150, slow=1350 |
await_progress: fast=13609, slow=485
h264-conformance-mr1_bt_a.err:report_progress: fast=62, slow=558 |
await_progress: fast=6747, slow=218
h264-conformance-mr1_mw_a.err:report_progress: fast=150, slow=1350 |
await_progress: fast=13797, slow=404
h264-conformance-mr2_mw_a.err:report_progress: fast=300, slow=2700 |
await_progress: fast=27310, slow=951
h264-conformance-mr2_tandberg_e.err:report_progress: fast=300,
slow=2700 | await_progress: fast=28956, slow=645
h264-conformance-mr3_tandberg_b.err:report_progress: fast=300,
slow=3238 | await_progress: fast=26272, slow=557
h264-conformance-mr4_tandberg_c.err:report_progress: fast=300,
slow=2974 | await_progress: fast=27777, slow=537
h264-conformance-mr5_tandberg_c.err:report_progress: fast=300,
slow=2974 | await_progress: fast=27637, slow=677
h264-conformance-mr6_bt_b.err:report_progress: fast=120, slow=480 |
await_progress: fast=6339, slow=36
h264-conformance-mr7_bt_b.err:report_progress: fast=66, slow=480 |
await_progress: fast=5541, slow=100
h264-conformance-mr8_bt_b.err:report_progress: fast=40, slow=160 |
await_progress: fast=7493, slow=10
h264-conformance-mr9_bt_b.err:report_progress: fast=20, slow=80 |
await_progress: fast=7164, slow=52
h264-conformance-mv1_brcm_d.err:report_progress: fast=129, slow=3870 |
await_progress: fast=699786, slow=235
h264-conformance-nl1_sony_d.err:report_progress: fast=17, slow=170 |
await_progress: fast=0, slow=0
h264-conformance-nl2_sony_h.err:report_progress: fast=300, slow=3000 |
await_progress: fast=28330, slow=511
h264-conformance-nl3_sva_e.err:report_progress: fast=17, slow=170 |
await_progress: fast=5221, slow=3
h264-conformance-nlmq1_jvc_c.err:report_progress: fast=30, slow=300 |
await_progress: fast=0, slow=0
h264-conformance-nlmq2_jvc_c.err:report_progress: fast=30, slow=300 |
await_progress: fast=4204, slow=117
h264-conformance-nrf_mw_e.err:report_progress: fast=34, slow=306 |
await_progress: fast=10359, slow=114
h264-conformance-sharp_mp_field_1_b.err:report_progress: fast=30,
slow=480 | await_progress: fast=9284, slow=0
h264-conformance-sharp_mp_field_2_b.err:report_progress: fast=30,
slow=480 | await_progress: fast=23475, slow=58
h264-conformance-sharp_mp_field_3_b.err:report_progress: fast=12,
slow=192 | await_progress: fast=35493, slow=9
h264-conformance-sharp_mp_paff_1r2.err:report_progress: fast=10,
slow=190 | await_progress: fast=45759, slow=34
h264-conformance-sharp_mp_paff_2r.err:report_progress: fast=10,
slow=190 | await_progress: fast=45548, slow=51
h264-conformance-sl1_sva_b.err:report_progress: fast=17, slow=153 |
await_progress: fast=7146, slow=5
h264-conformance-sva_ba1_b.err:report_progress: fast=17, slow=153 |
await_progress: fast=0, slow=0
h264-conformance-sva_ba2_d.err:report_progress: fast=17, slow=153 |
await_progress: fast=1706, slow=15
h264-conformance-sva_base_b.err:report_progress: fast=17, slow=153 |
await_progress: fast=1671, slow=18
h264-conformance-sva_cl1_e.err:report_progress: fast=50, slow=500 |
await_progress: fast=5285, slow=6
h264-conformance-sva_fm1_e.err:report_progress: fast=17, slow=153 |
await_progress: fast=1695, slow=27
h264-conformance-sva_nl1_b.err:report_progress: fast=17, slow=170 |
await_progress: fast=0, slow=0
h264-conformance-sva_nl2_e.err:report_progress: fast=17, slow=170 |
await_progress: fast=1738, slow=4
h264-crop-to-container.err:report_progress: fast=1, slow=68 |
await_progress: fast=0, slow=0
h264-direct-bff.err:report_progress: fast=5, slow=80 | await_progress:
fast=22310, slow=20
h264-extreme-plane-pred.err:report_progress: fast=100, slow=1800 |
await_progress: fast=0, slow=0
h264-interlace-crop.err:report_progress: fast=5, slow=60 |
await_progress: fast=13824, slow=40
h264-lossless.err:report_progress: fast=10, slow=310 | await_progress:
fast=12163, slow=62
h264-reinit-large_420_8-to-small_420_8.err:report_progress: fast=55,
slow=850 | await_progress: fast=56609, slow=299
h264-reinit-small_420_8-to-large_444_10.err:report_progress: fast=55,
slow=850 | await_progress: fast=55029, slow=432
h264-reinit-small_420_9-to-small_420_8.err:report_progress: fast=56,
slow=728 | await_progress: fast=37270, slow=190
h264-reinit-small_422_9-to-small_420_9.err:report_progress: fast=56,
slow=728 | await_progress: fast=36944, slow=225

Wan-Teh Chang
-------------- next part --------------
diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
index b77dd1e..98fddf2 100644
--- a/libavcodec/pthread_frame.c
+++ b/libavcodec/pthread_frame.c
@@ -469,12 +469,21 @@ int ff_thread_decode_frame(AVCodecContext *avctx,
     return (p->result >= 0) ? avpkt->size : p->result;
 }
 
+static int report_progress_fast_path;
+static int report_progress_slow_path;
+
 void ff_thread_report_progress(ThreadFrame *f, int n, int field)
 {
     PerThreadContext *p;
     volatile int *progress = f->progress ? (int*)f->progress->data : NULL;
 
-    if (!progress || progress[field] >= n) return;
+    if (!progress) return;
+
+    if (progress[field] >= n) {
+        __atomic_add_fetch(&report_progress_fast_path, 1, __ATOMIC_RELAXED);
+        return;
+    }
+    __atomic_add_fetch(&report_progress_slow_path, 1, __ATOMIC_RELAXED);
 
     p = f->owner->internal->thread_ctx;
 
@@ -487,12 +496,21 @@ void ff_thread_report_progress(ThreadFrame *f, int n, int field)
     pthread_mutex_unlock(&p->progress_mutex);
 }
 
+static int await_progress_fast_path;
+static int await_progress_slow_path;
+
 void ff_thread_await_progress(ThreadFrame *f, int n, int field)
 {
     PerThreadContext *p;
     volatile int *progress = f->progress ? (int*)f->progress->data : NULL;
 
-    if (!progress || progress[field] >= n) return;
+    if (!progress) return;
+
+    if (progress[field] >= n) {
+        __atomic_add_fetch(&await_progress_fast_path, 1, __ATOMIC_RELAXED);
+        return;
+    }
+    __atomic_add_fetch(&await_progress_slow_path, 1, __ATOMIC_RELAXED);
 
     p = f->owner->internal->thread_ctx;
 
@@ -601,6 +619,11 @@ void ff_frame_thread_free(AVCodecContext *avctx, int thread_count)
     if (avctx->priv_data && avctx->codec && avctx->codec->priv_class)
         av_opt_free(avctx->priv_data);
     avctx->codec = NULL;
+
+    fprintf(stderr, "report_progress: fast=%d, slow=%d |"
+                    " await_progress: fast=%d, slow=%d\n",
+            report_progress_fast_path, report_progress_slow_path,
+            await_progress_fast_path, await_progress_slow_path);
 }
 
 int ff_frame_thread_init(AVCodecContext *avctx)
diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 16087cb..1812814 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -316,7 +316,8 @@ if test $err != 0 && test $gen != "no" ; then
 fi
 
 if test $err = 0; then
-    rm -f $outfile $errfile $cmpfile $cleanfiles
+    #rm -f $outfile $errfile $cmpfile $cleanfiles
+    echo "Test $test succeeded."
 elif test $gen = "no"; then
     echo "Test $test failed. Look at $errfile for details."
     test "${V:-0}" -gt 0 && cat $errfile


More information about the ffmpeg-devel mailing list