Skip to content

Commit

Permalink
COM-12567 Refactor gen_av1_chromium.py absolute path for test suite a…
Browse files Browse the repository at this point in the history
…nd test vector generator.
  • Loading branch information
mcesariniflu committed Jan 16, 2025
1 parent 7552671 commit d69ddd8
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 34 deletions.
10 changes: 5 additions & 5 deletions scripts/gen_aac.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ def __init__(

def generate(self, download: bool, jobs: int) -> None:
"""Generates the test suite and saves it to a file"""
absolut_dest_dir = os.path.dirname(os.path.abspath(__file__))
absolut_resources_dir = os.path.join(absolut_dest_dir, "resources")
absolute_dest_dir = os.path.dirname(os.path.abspath(__file__))
absolute_resources_dir = os.path.join(absolute_dest_dir, "resources")
output_filepath = os.path.join(self.suite_name + ".json")
test_suite = TestSuite(
output_filepath,
absolut_resources_dir,
absolute_resources_dir,
self.suite_name,
self.codec,
self.description,
Expand Down Expand Up @@ -211,8 +211,8 @@ def generate(self, download: bool, jobs: int) -> None:
except KeyError as key_err:
raise key_err

absolut_output_filepath = os.path.join(absolut_dest_dir, output_filepath)
test_suite.to_json_file(absolut_output_filepath)
absolute_output_filepath = os.path.join(absolute_dest_dir, output_filepath)
test_suite.to_json_file(absolute_output_filepath)
print("Generate new test suite: " + test_suite.name + ".json")


Expand Down
10 changes: 5 additions & 5 deletions scripts/gen_av1_aom.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ def __init__(

def generate(self, download: bool, jobs: int) -> None:
"""Generates the test suite and saves it to a file"""
absolut_dest_dir = os.path.dirname(os.path.abspath(__file__))
absolut_resources_dir = os.path.join(absolut_dest_dir, "resources")
absolute_dest_dir = os.path.dirname(os.path.abspath(__file__))
absolute_resources_dir = os.path.join(absolute_dest_dir, "resources")
output_filepath = os.path.join(self.suite_name + ".json")
test_suite = TestSuite(
output_filepath,
absolut_resources_dir,
absolute_resources_dir,
self.suite_name,
self.codec,
self.description,
Expand Down Expand Up @@ -144,8 +144,8 @@ def generate(self, download: bool, jobs: int) -> None:
test_vector.result = self.decoder.decode(dest_path, out420, test_vector.output_format, 30, False, False)
os.remove(out420)

absolut_output_filepath = os.path.join(absolut_dest_dir, output_filepath)
test_suite.to_json_file(absolut_output_filepath)
absolute_output_filepath = os.path.join(absolute_dest_dir, output_filepath)
test_suite.to_json_file(absolute_output_filepath)
print("Generate new test suite: " + test_suite.name + ".json")


Expand Down
8 changes: 4 additions & 4 deletions scripts/gen_av1_argon.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def __init__(
def generate(self, download: bool) -> None:
"""Generates the test suite and saves it to a file"""
output_filepath = os.path.join(self.suite_name + ".json")
absolut_dest_dir = os.path.dirname(os.path.abspath(__file__))
extract_folder = os.path.join(absolut_dest_dir, "resources")
absolute_dest_dir = os.path.dirname(os.path.abspath(__file__))
extract_folder = os.path.join(absolute_dest_dir, "resources")
test_suite = TestSuite(
output_filepath,
extract_folder,
Expand Down Expand Up @@ -158,8 +158,8 @@ def generate(self, download: bool) -> None:
)
test_suite.test_vectors[filename] = test_vector

absolut_output_filepath = os.path.join(absolut_dest_dir, output_filepath)
test_suite.to_json_file(absolut_output_filepath)
absolute_output_filepath = os.path.join(absolute_dest_dir, output_filepath)
test_suite.to_json_file(absolute_output_filepath)
print("Generate new test suite: " + test_suite.name + ".json")

@staticmethod
Expand Down
10 changes: 5 additions & 5 deletions scripts/gen_av1_chromium.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ def __init__(

def generate(self, download: bool, jobs: int) -> Any:
"""Generates the test suite and saves it to a file"""
absolut_dest_dir = os.path.dirname(os.path.abspath(__file__))
absolut_resources_dir = os.path.join(absolut_dest_dir, "resources")
absolute_dest_dir = os.path.dirname(os.path.abspath(__file__))
absolute_resources_dir = os.path.join(absolute_dest_dir, "resources")
output_filepath = os.path.join(self.suite_name + ".json")
test_suite = TestSuite(
output_filepath,
"resources",
absolute_resources_dir,
self.suite_name,
self.codec,
self.description,
Expand Down Expand Up @@ -151,8 +151,8 @@ def generate(self, download: bool, jobs: int) -> Any:
test_vector.result = self.decoder.decode(dest_path, out420, test_vector.output_format, 30, False, False)
os.remove(out420)

absolut_output_filepath = os.path.join(absolut_dest_dir, output_filepath)
test_suite.to_json_file(absolut_output_filepath)
absolute_output_filepath = os.path.join(absolute_dest_dir, output_filepath)
test_suite.to_json_file(absolute_output_filepath)
print("Generate new test suite: " + test_suite.name + ".json")


Expand Down
10 changes: 5 additions & 5 deletions scripts/gen_jct_vc.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ def __init__(

def generate(self, download: bool, jobs: int) -> None:
"""Generates the test suite and saves it to a file"""
absolut_dest_dir = os.path.dirname(os.path.abspath(__file__))
absolut_resources_dir = os.path.join(absolut_dest_dir, "resources")
absolute_dest_dir = os.path.dirname(os.path.abspath(__file__))
absolute_resources_dir = os.path.join(absolute_dest_dir, "resources")
output_filepath = os.path.join(self.suite_name + ".json")
test_suite = TestSuite(
output_filepath,
absolut_resources_dir,
absolute_resources_dir,
self.suite_name,
self.codec,
self.description,
Expand Down Expand Up @@ -180,8 +180,8 @@ def generate(self, download: bool, jobs: int) -> None:

self._fill_checksum_h265(test_vector, dest_dir)

absolut_output_filepath = os.path.join(absolut_dest_dir, output_filepath)
test_suite.to_json_file(absolut_output_filepath)
absolute_output_filepath = os.path.join(absolute_dest_dir, output_filepath)
test_suite.to_json_file(absolute_output_filepath)
print("Generate new test suite: " + test_suite.name + ".json")

def _fill_checksum_h265(self, test_vector: TestVector, dest_dir: str) -> None:
Expand Down
10 changes: 5 additions & 5 deletions scripts/gen_jvet.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ def __init__(

def generate(self, download: bool, jobs: int) -> None:
"""Generates the test suite and saves it to a file"""
absolut_dest_dir = os.path.dirname(os.path.abspath(__file__))
absolut_resources_dir = os.path.join(absolut_dest_dir, "resources")
absolute_dest_dir = os.path.dirname(os.path.abspath(__file__))
absolute_resources_dir = os.path.join(absolute_dest_dir, "resources")
output_filepath = os.path.join(self.suite_name + ".json")
test_suite = TestSuite(
output_filepath,
absolut_resources_dir,
absolute_resources_dir,
self.suite_name,
self.codec,
self.description,
Expand Down Expand Up @@ -171,8 +171,8 @@ def generate(self, download: bool, jobs: int) -> None:

self._fill_checksum_h266(test_vector, dest_dir)

absolut_output_filepath = os.path.join(absolut_dest_dir, output_filepath)
test_suite.to_json_file(absolut_output_filepath)
absolute_output_filepath = os.path.join(absolute_dest_dir, output_filepath)
test_suite.to_json_file(absolute_output_filepath)
print("Generate new test suite: " + test_suite.name + ".json")

@staticmethod
Expand Down
10 changes: 5 additions & 5 deletions scripts/gen_jvt.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ def __init__(
def generate(self, download: bool, jobs: int) -> None:
"""Generates the test suite and saves it to a file"""
new_test_vectors = []
absolut_dest_dir = os.path.dirname(os.path.abspath(__file__))
absolut_resources_dir = os.path.join(absolut_dest_dir, "resources")
absolute_dest_dir = os.path.dirname(os.path.abspath(__file__))
absolute_resources_dir = os.path.join(absolute_dest_dir, "resources")
output_filepath = os.path.join(self.suite_name + ".json")
test_suite = TestSuite(
output_filepath,
absolut_resources_dir,
absolute_resources_dir,
self.suite_name,
self.codec,
self.description,
Expand Down Expand Up @@ -213,8 +213,8 @@ def generate(self, download: bool, jobs: int) -> None:
else:
self._fill_checksum_h264(test_vector, dest_dir)

absolut_output_filepath = os.path.join(absolut_dest_dir, output_filepath)
test_suite.to_json_file(absolut_output_filepath)
absolute_output_filepath = os.path.join(absolute_dest_dir, output_filepath)
test_suite.to_json_file(absolute_output_filepath)
print("Generate new test suite: " + test_suite.name + ".json")

@staticmethod
Expand Down

0 comments on commit d69ddd8

Please sign in to comment.