Skip to content

Commit

Permalink
Add workfile yuv type to the quality string and a relevant test
Browse files Browse the repository at this point in the history
  • Loading branch information
krasuluk committed Nov 1, 2023
1 parent 877215b commit 1de590a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions python/test/asset_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,15 @@ def test_str(self):
"test_0_1_refvideo_720x480_vs_disvideo_720x480_ebd_8_yuv420p10le_q_720x480"
)

asset = Asset(dataset="test", content_id=0, asset_id=1,
ref_path="dir/refvideo.yuv", dis_path="dir/disvideo.yuv",
asset_dict={'width': 720, 'height': 480,
'workfile_yuv_type': 'yuv420p10le'})
self.assertEqual(
str(asset),
"test_0_1_refvideo_720x480_vs_disvideo_720x480_q_720x480_wf_yuv420p10le"
)

def test_hash_equal(self):
asset1 = Asset(dataset="test", content_id=0, asset_id=2,
ref_path="dir/refvideo.yuv", dis_path="dir/disvideo.yuv",
Expand Down
5 changes: 5 additions & 0 deletions python/vmaf/core/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@ def quality_str(self):
s += "_"
s += "{w}x{h}".format(w=w, h=h)

if self.workfile_yuv_type != self.DEFAULT_YUV_TYPE:
if s != "":
s += "_"
s += "wf_" + self.workfile_yuv_type

return s

def to_string(self):
Expand Down

0 comments on commit 1de590a

Please sign in to comment.