Skip to content

Commit

Permalink
separate in two scripts by name
Browse files Browse the repository at this point in the history
  • Loading branch information
rsanchez87 committed Jul 17, 2024
1 parent 7ac794b commit 273eb9c
Show file tree
Hide file tree
Showing 3 changed files with 301 additions and 74 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ Check out the JSON format they follow in the [test_suites](test_suites)
directory. Add a new json file within, Fluster will automatically pick it
up.
There is also a [generator script](scripts/gen_jct_vc.py) for the [conformance
There are also a [generator script (H.265, H.266)](scripts/gen_jvet_jct_vc.py) and a [generator script (H.264)](scripts/gen_jvt.py) for the [conformance
test suites](#test_suites) that you can use as a base to generate automatically
new ones.
Expand Down
73 changes: 0 additions & 73 deletions scripts/gen_jct_vc.py → scripts/gen_jvet_jct_vc.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,14 @@
BASE_URL = "https://www.itu.int/"
H266_URL = BASE_URL + "wftp3/av-arch/jvet-site/bitstream_exchange/VVC/draft_conformance/"
H265_URL = BASE_URL + "wftp3/av-arch/jctvc-site/bitstream_exchange/draft_conformance/"
H264_URL = BASE_URL + "wftp3/av-arch/jvt-site/draft_conformance/"
BITSTREAM_EXTS = (
".bin",
".bit",
".264",
".h264",
".jvc",
".jsv",
".jvt",
".avc",
".26l",
".bits",
)
MD5_EXTS = ("yuv_2.md5", "yuv.md5", ".md5", "md5.txt", "md5sum.txt")
MD5_EXCLUDES = (".bin.md5", "bit.md5")
Expand Down Expand Up @@ -192,29 +188,10 @@ def generate(self, download, jobs):

if self.codec == Codec.H265:
self._fill_checksum_h265(test_vector, dest_dir)
elif self.codec == Codec.H264:
if self.name != "Professional_profiles": # result md5 generated from h264_reference_decoder
if self.name == "SVC": # result md5 generated for different Lines (L0, L1...)
self._fill_checksum_h264_multiple(test_vector, dest_dir)
else:
self._fill_checksum_h264(test_vector, dest_dir)

test_suite.to_json_file(output_filepath)
print("Generate new test suite: " + test_suite.name + ".json")

def _fill_checksum_h264(self, test_vector, dest_dir):
raw_file = self._find_by_ext(dest_dir, RAW_EXTS)
if raw_file is None or len(raw_file) == 0:
raise Exception(f"RAW file not found in {dest_dir}")
test_vector.result = utils.file_checksum(raw_file[0])

def _fill_checksum_h264_multiple(self, test_vector, dest_dir):
raw_files = self._find_by_ext_multiple(dest_dir, RAW_EXTS)
if not raw_files:
raise Exception(f"RAW file not found in {dest_dir}")
for raw_file in raw_files:
test_vector.result = utils.file_checksum(raw_file)

def _fill_checksum_h265(self, test_vector, dest_dir):
checksum_file = self._find_by_ext(dest_dir, MD5_EXTS, MD5_EXCLUDES)
if checksum_file is None:
Expand Down Expand Up @@ -281,27 +258,6 @@ def _find_by_ext(dest_dir, exts, excludes=None):
return filepath
return None

@staticmethod
def _find_by_ext_multiple(dest_dir, exts, excludes=None):
excludes = excludes or []
found_files = []

# Respect the priority for extensions
for ext in exts:
for subdir, _, files in os.walk(dest_dir):
for filename in files:
excluded = False
filepath = subdir + os.sep + filename
if not filepath.endswith(ext) or "__MACOSX" in filepath:
continue
for excl in excludes:
if excl in filepath:
excluded = True
break
if not excluded:
found_files.append(filepath)
return found_files


if __name__ == "__main__":
parser = argparse.ArgumentParser()
Expand Down Expand Up @@ -358,15 +314,6 @@ def _find_by_ext_multiple(dest_dir, exts, excludes=None):
)
generator.generate(not args.skip_download, args.jobs)

generator = JCTVTGenerator(
"AVCv1",
"JVT-AVC_V1",
Codec.H264,
"JVT AVC version 1",
H264_URL
)
generator.generate(not args.skip_download, args.jobs)

generator = JCTVTGenerator(
'draft6',
'JVET-VVC_draft6',
Expand All @@ -375,23 +322,3 @@ def _find_by_ext_multiple(dest_dir, exts, excludes=None):
H266_URL
)
generator.generate(not args.skip_download, args.jobs)

generator = JCTVTGenerator(
"SVC",
"JVT-SVC_V1",
Codec.H264,
"JVT SVC version 1",
H264_URL,
True
)
generator.generate(not args.skip_download, args.jobs)

generator = JCTVTGenerator(
"Professional_profiles",
"JVT-Professional_profiles_V1",
Codec.H264,
"JVT professional profiles version 1",
H264_URL,
True
)
generator.generate(not args.skip_download, args.jobs)
Loading

0 comments on commit 273eb9c

Please sign in to comment.