Skip to content

Commit

Permalink
[strapi]ffmpeg-qsv av1 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 23, 2024
1 parent 903992a commit e457674
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions test/ffmpeg-qsv/encode/av1.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 AV1EncoderLPTest, AV1EncoderTest
from ....lib.ffmpeg.qsv.encoder import StringAPIEncoder

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

@slash.requires(*have_ffmpeg_encoder_options("av1_qsv", "qsv_params"))
@slash.parametrize(*gen_av1_cqp_parameters(spec, strapi=True))
def test_strapi(self, case, gop, bframes, tilecols, tilerows, qp, quality, profile):
self.EncoderClass = StringAPIEncoder
self.init(spec, case, gop, bframes, tilecols, tilerows, qp, quality, profile)
self.encode()

class icq(AV1EncoderTest):
def init(self, tspec, case, gop, bframes, tilecols, tilerows,qp, quality, profile):
vars(self).update(tspec[case].copy())
Expand Down Expand Up @@ -92,6 +100,13 @@ def test_r2r(self, case, gop, bframes, tilecols, tilerows, bitrate, quality, fps
vars(self).setdefault("r2r", 5)
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("av1_qsv", "qsv_params"))
@slash.parametrize(*gen_av1_cbr_parameters(spec, strapi=True))
def test_strapi(self, case, gop, bframes, tilecols, tilerows, bitrate, quality, fps, profile):
self.EncoderClass = StringAPIEncoder
self.init(spec, case, gop, bframes, tilecols, tilerows, bitrate, fps, quality, profile)
self.encode()

class vbr(AV1EncoderTest):
def init(self, tspec, case, gop, bframes, tilecols, tilerows, bitrate, fps, quality, profile):
vars(self).update(tspec[case].copy())
Expand Down Expand Up @@ -122,6 +137,13 @@ def test_r2r(self, case, gop, bframes, tilecols, tilerows, bitrate, fps, quality
vars(self).setdefault("r2r", 5)
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("av1_qsv", "qsv_params"))
@slash.parametrize(*gen_av1_vbr_parameters(spec, strapi=True))
def test_strapi(self, case, gop, bframes, tilecols, tilerows, bitrate, fps, quality, profile):
self.EncoderClass = StringAPIEncoder
self.init(spec, case, gop, bframes, tilecols, tilerows, bitrate, fps, quality, profile)
self.encode()

class cqp_lp(AV1EncoderLPTest):
def init(self, tspec, case, gop, bframes, tilecols, tilerows,qp, quality, profile):
vars(self).update(tspec[case].copy())
Expand All @@ -148,6 +170,13 @@ def test_r2r(self, case, gop, bframes, tilecols, tilerows, qp, quality, profile)
vars(self).setdefault("r2r", 5)
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("av1_qsv", "qsv_params"))
@slash.parametrize(*gen_av1_cqp_lp_parameters(spec, strapi=True))
def test_strapi(self, case, gop, bframes, tilecols, tilerows, qp, quality, profile):
self.EncoderClass = StringAPIEncoder
self.init(spec, case, gop, bframes, tilecols, tilerows, qp, quality, profile)
self.encode()

class icq_lp(AV1EncoderLPTest):
def init(self, tspec, case, gop, bframes, tilecols, tilerows,qp, quality, profile):
vars(self).update(tspec[case].copy())
Expand Down Expand Up @@ -203,6 +232,13 @@ def test_r2r(self, case, gop, bframes, tilecols, tilerows, bitrate, quality, fps
vars(self).setdefault("r2r", 5)
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("av1_qsv", "qsv_params"))
@slash.parametrize(*gen_av1_cbr_lp_parameters(spec, strapi=True))
def test_strapi(self, case, gop, bframes, tilecols, tilerows, bitrate, quality, fps, profile):
self.EncoderClass = StringAPIEncoder
self.init(spec, case, gop, bframes, tilecols, tilerows, bitrate, fps, quality, profile)
self.encode()

class vbr_lp(AV1EncoderLPTest):
def init(self, tspec, case, gop, bframes, tilecols, tilerows, bitrate, fps, quality, profile):
vars(self).update(tspec[case].copy())
Expand Down Expand Up @@ -232,3 +268,11 @@ def test_r2r(self, case, gop, bframes, tilecols, tilerows, bitrate, fps, quality
self.init(spec_r2r, case, gop, bframes, tilecols, tilerows, bitrate, fps, quality, profile)
vars(self).setdefault("r2r", 5)
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("av1_qsv", "qsv_params"))
@slash.parametrize(*gen_av1_vbr_lp_parameters(spec, strapi=True))
def test_strapi(self, case, gop, bframes, tilecols, tilerows, bitrate, fps, quality, profile):
self.EncoderClass = StringAPIEncoder
self.init(spec, case, gop, bframes, tilecols, tilerows, bitrate, fps, quality, profile)
self.encode()

0 comments on commit e457674

Please sign in to comment.