Skip to content

Commit

Permalink
[strapi]ffmpeg-qsv hevc using consolidated strapi generators
Browse files Browse the repository at this point in the history
Signed-off-by: Focus Luo <[email protected]>
  • Loading branch information
FocusLuo committed Aug 22, 2024
1 parent 3a70d3a commit 700a977
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions test/ffmpeg-qsv/encode/hevc.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from ....lib import *
from ....lib.ffmpeg.qsv.util import *
from ....lib.ffmpeg.qsv.encoder import HEVC8EncoderTest, HEVC8EncoderLPTest
from ....lib.ffmpeg.qsv.encoder import StringAPIEncoder

spec = load_test_spec("hevc", "encode", "8bit")
spec_r2r = load_test_spec("hevc", "encode", "8bit", "r2r")
Expand Down Expand Up @@ -36,6 +37,13 @@ def test_r2r(self, case, gop, slices, bframes, qp, quality, profile):
vars(self).setdefault("r2r", 5)
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("hevc_qsv", "qsv_params"))
@slash.parametrize(*gen_hevc_cqp_parameters(spec, ['main'], strapi=True))
def test_strapi(self, case, gop, slices, bframes, qp, quality, profile):
self.EncoderClass = StringAPIEncoder
self.init(spec, case, gop, slices, bframes, qp, quality, profile)
self.encode()

class cqp_lp(HEVC8EncoderLPTest):
def init(self, tspec, case, gop, slices, qp, quality, profile):
vars(self).update(tspec[case].copy())
Expand All @@ -60,6 +68,13 @@ def test_r2r(self, case, gop, slices, qp, quality, profile):
vars(self).setdefault("r2r", 5)
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("hevc_qsv", "qsv_params"))
@slash.parametrize(*gen_hevc_cqp_lp_parameters(spec, ['main'], strapi=True))
def test_strapi(self, case, gop, slices, qp, quality, profile):
self.EncoderClass = StringAPIEncoder
self.init(spec, case, gop, slices, qp, quality, profile)
self.encode()

class cbr(HEVC8EncoderTest):
def init(self, tspec, case, gop, slices, bframes, bitrate, fps, profile):
vars(self).update(tspec[case].copy())
Expand Down Expand Up @@ -87,6 +102,13 @@ def test_r2r(self, case, gop, slices, bframes, bitrate, fps, profile):
vars(self).setdefault("r2r", 5)
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("hevc_qsv", "qsv_params"))
@slash.parametrize(*gen_hevc_cbr_parameters(spec, ['main'], strapi=True))
def test_strapi(self, case, gop, slices, bframes, bitrate, fps, profile):
self.EncoderClass = StringAPIEncoder
self.init(spec, case, gop, slices, bframes, bitrate, fps, profile)
self.encode()

class cbr_lp(HEVC8EncoderLPTest):
def init(self, tspec, case, gop, slices, bitrate, fps, profile):
vars(self).update(tspec[case].copy())
Expand All @@ -113,6 +135,13 @@ def test_r2r(self, case, gop, slices, bitrate, fps, profile):
vars(self).setdefault("r2r", 5)
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("hevc_qsv", "qsv_params"))
@slash.parametrize(*gen_hevc_cbr_lp_parameters(spec, ['main'], strapi=True))
def test_strapi(self, case, gop, slices, bitrate, fps, profile):
self.EncoderClass = StringAPIEncoder
self.init(spec, case, gop, slices, bitrate, fps, profile)
self.encode()

class vbr(HEVC8EncoderTest):
def init(self, tspec, case, gop, slices, bframes, bitrate, fps, quality, refs, profile):
vars(self).update(tspec[case].copy())
Expand Down Expand Up @@ -142,6 +171,13 @@ def test_r2r(self, case, gop, slices, bframes, bitrate, fps, quality, refs, prof
vars(self).setdefault("r2r", 5)
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("hevc_qsv", "qsv_params"))
@slash.parametrize(*gen_hevc_vbr_parameters(spec, ['main'], strapi=True))
def test_strapi(self, case, gop, slices, bframes, bitrate, fps, quality, refs, profile):
self.EncoderClass = StringAPIEncoder
self.init(spec, case, gop, slices, bframes, bitrate, fps, quality, refs, profile)
self.encode()

class vbr_lp(HEVC8EncoderLPTest):
def before(self):
super().before()
Expand Down Expand Up @@ -173,6 +209,13 @@ def test_r2r(self, case, gop, slices, bitrate, fps, quality, refs, profile):
vars(self).setdefault("r2r", 5)
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("hevc_qsv", "qsv_params"))
@slash.parametrize(*gen_hevc_vbr_lp_parameters(spec, ['main'], strapi=True))
def test_strapi(self, case, gop, slices, bitrate, fps, quality, refs, profile):
self.EncoderClass = StringAPIEncoder
self.init(spec, case, gop, slices, bitrate, fps, quality, refs, profile)
self.encode()

# TCBRC is VBR LP + LDB + Strict(-1)
@slash.parametrize(*gen_hevc_tcbrc_parameters(spec, ['main']))
def test_tcbrc(self, case, bitrate, fps, profile):
Expand Down

0 comments on commit 700a977

Please sign in to comment.