Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/github_actions/actions/checkout…
Browse files Browse the repository at this point in the history
…-4.2.1
  • Loading branch information
uartie authored Oct 14, 2024
2 parents b89290a + 8166253 commit 05ef5c7
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,19 @@ def gen_jpeg_cqp_parameters(spec):
params = gen_jpeg_cqp_variants(spec)
return keys, params

def gen_jpeg_seek_variants(spec):
for case, params in spec.items():
variants = params.get("variants", dict()).get("seek", [])
for variant in variants:
yield [
case, variant.get("fps", 25), variant.get("seek", 1)
]

def gen_jpeg_seek_parameters(spec):
keys = ("case", "fps", "seek")
params = gen_jpeg_seek_variants(spec)
return keys, params

def gen_vp8_cqp_variants(spec):
for case, params in spec.items():
variants = params.get("variants", dict()).get("cqp", None)
Expand Down Expand Up @@ -952,6 +965,7 @@ def gen_vp9_seek_lp_parameters(spec):
gen_avc_seek_lp_parameters = gen_vp9_seek_lp_parameters
gen_av1_seek_parameters = gen_vp9_seek_parameters
gen_av1_seek_lp_parameters = gen_vp9_seek_lp_parameters
gen_mpeg2_seek_parameters = gen_vp9_seek_parameters

def gen_av1_cqp_variants(spec, strapi=False):
for case, params in spec.items():
Expand Down
15 changes: 15 additions & 0 deletions test/ffmpeg-qsv/encode/jpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,18 @@ def test_r2r(self, case, quality):
self.init(spec_r2r, case, quality)
vars(self).setdefault("r2r", 5)
self.encode()

class seek(JPEGEncoderTest):
def init(self, tspec, case, fps, seek):
vars(self).update(tspec[case].copy())
vars(self).update(
case = case,
rcmode = "cqp",
fps = fps,
seek = seek,
)

@slash.parametrize(*gen_jpeg_seek_parameters(spec))
def test(self, case, fps, seek):
self.init(spec, case, fps, seek)
self.encode()
18 changes: 18 additions & 0 deletions test/ffmpeg-qsv/encode/mpeg2.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,21 @@ def test_r2r(self, case, gop, bframes, qp, quality):
self.init(spec_r2r, case, gop, bframes, qp, quality)
vars(self).setdefault("r2r", 5)
self.encode()

class seek(MPEG2EncoderTest):
def init(self, tspec, case, rcmode, bitrate, maxrate, fps, seek):
vars(self).update(tspec[case].copy())
vars(self).update(
case = case,
bitrate = bitrate,
maxrate = maxrate,
minrate = bitrate,
rcmode = rcmode,
fps = fps,
seek = seek,
)

@slash.parametrize(*gen_mpeg2_seek_parameters(spec))
def test(self, case, rcmode, bitrate, maxrate, fps, seek):
self.init(spec, case, rcmode, bitrate, maxrate, fps, seek)
self.encode()

0 comments on commit 05ef5c7

Please sign in to comment.