2 ## Copyright (c) 2017, Alliance for Open Media. All rights reserved
4 ## This source code is subject to the terms of the BSD 2 Clause License and
5 ## the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6 ## was not distributed with this source code in the LICENSE file, you can
7 ## obtain it at www.aomedia.org/license/software. If the Alliance for Open
8 ## Media Patent License 1.0 was not distributed with this source code in the
9 ## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
11 """Aggregate multiple entropy stats output which is written in 32-bit int.
13 python ./aggregate_entropy_stats.py [dir of stats files] [keyword of filenames]
14 [filename of final stats]
17 __author__
= "yuec@google.com"
26 for fn
in os
.listdir(dir):
28 stats
= np
.fromfile(dir + fn
, dtype
=np
.int32
)
32 sum = np
.add(sum, stats
)
34 print("No stats file is found. Double-check directory and keyword?")
36 sum.tofile(dir+sys
.argv
[3])
38 if __name__
== '__main__':