Skip to content

Commit

Permalink
[strapi]ffmpeg-qsv test 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 19, 2024
1 parent 36e5007 commit c2d5d42
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
13 changes: 6 additions & 7 deletions test/ffmpeg-qsv/encode/av1.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
###

from ....lib import *
from ....lib.parameters_strapi import *
from ....lib.ffmpeg.qsv.util import *
from ....lib.ffmpeg.qsv.encoder import AV1EncoderLPTest, AV1EncoderTest
from ....lib.ffmpeg.qsv.encoder import StringAPIEncoder
Expand Down Expand Up @@ -40,7 +39,7 @@ def test_r2r(self, case, gop, bframes, tilecols, tilerows, qp, quality, profile)
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("av1_qsv", "qsv_params"))
@slash.parametrize(*gen_av1_cqp_strapi_parameters(spec))
@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)
Expand Down Expand Up @@ -102,7 +101,7 @@ def test_r2r(self, case, gop, bframes, tilecols, tilerows, bitrate, quality, fps
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("av1_qsv", "qsv_params"))
@slash.parametrize(*gen_av1_cbr_strapi_parameters(spec))
@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)
Expand Down Expand Up @@ -139,7 +138,7 @@ def test_r2r(self, case, gop, bframes, tilecols, tilerows, bitrate, fps, quality
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("av1_qsv", "qsv_params"))
@slash.parametrize(*gen_av1_vbr_strapi_parameters(spec))
@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)
Expand Down Expand Up @@ -172,7 +171,7 @@ def test_r2r(self, case, gop, bframes, tilecols, tilerows, qp, quality, profile)
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("av1_qsv", "qsv_params"))
@slash.parametrize(*gen_av1_cqp_lp_strapi_parameters(spec))
@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)
Expand Down Expand Up @@ -234,7 +233,7 @@ def test_r2r(self, case, gop, bframes, tilecols, tilerows, bitrate, quality, fps
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("av1_qsv", "qsv_params"))
@slash.parametrize(*gen_av1_cbr_lp_strapi_parameters(spec))
@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)
Expand Down Expand Up @@ -271,7 +270,7 @@ def test_r2r(self, case, gop, bframes, tilecols, tilerows, bitrate, fps, quality
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("av1_qsv", "qsv_params"))
@slash.parametrize(*gen_av1_vbr_lp_strapi_parameters(spec))
@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)
Expand Down
13 changes: 6 additions & 7 deletions test/ffmpeg-qsv/encode/avc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
###

from ....lib import *
from ....lib.parameters_strapi import *
from ....lib.ffmpeg.qsv.util import *
from ....lib.ffmpeg.qsv.encoder import AVCEncoderTest, AVCEncoderLPTest
from ....lib.ffmpeg.qsv.encoder import StringAPIEncoder
Expand Down Expand Up @@ -39,7 +38,7 @@ def test_r2r(self, case, gop, slices, bframes, qp, quality, profile):
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("h264_qsv", "qsv_params"))
@slash.parametrize(*gen_avc_cqp_strapi_parameters(spec, ['high', 'main', 'baseline']))
@slash.parametrize(*gen_avc_cqp_parameters(spec, ['high', 'main', 'baseline'], 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)
Expand Down Expand Up @@ -71,7 +70,7 @@ def test_r2r(self, case, gop, slices, bframes, qp, quality, profile):
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("h264_qsv", "qsv_params"))
@slash.parametrize(*gen_avc_cqp_lp_strapi_parameters(spec, ['high', 'main']))
@slash.parametrize(*gen_avc_cqp_lp_parameters(spec, ['high', '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)
Expand Down Expand Up @@ -105,7 +104,7 @@ def test_r2r(self, case, gop, slices, bframes, bitrate, fps, profile):
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("h264_qsv", "qsv_params"))
@slash.parametrize(*gen_avc_cbr_strapi_parameters(spec, ['high', 'main', 'baseline']))
@slash.parametrize(*gen_avc_cbr_parameters(spec, ['high', 'main', 'baseline'], 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)
Expand Down Expand Up @@ -139,7 +138,7 @@ def test_r2r(self, case, gop, slices, bframes, bitrate, fps, profile):
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("h264_qsv", "qsv_params"))
@slash.parametrize(*gen_avc_cbr_lp_strapi_parameters(spec, ['high', 'main']))
@slash.parametrize(*gen_avc_cbr_lp_parameters(spec, ['high', '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)
Expand Down Expand Up @@ -175,7 +174,7 @@ def test_r2r(self, case, gop, slices, bframes, bitrate, fps, quality, refs, prof
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("h264_qsv", "qsv_params"))
@slash.parametrize(*gen_avc_vbr_strapi_parameters(spec_r2r, ['high', 'main', 'baseline']))
@slash.parametrize(*gen_avc_vbr_parameters(spec, ['high', 'main', 'baseline'], 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)
Expand Down Expand Up @@ -229,7 +228,7 @@ def test_tcbrc(self, case, bitrate, fps, profile):
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("h264_qsv", "qsv_params"))
@slash.parametrize(*gen_avc_vbr_lp_strapi_parameters(spec, ['high', 'main']))
@slash.parametrize(*gen_avc_vbr_lp_parameters(spec, ['high', '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)
Expand Down
14 changes: 6 additions & 8 deletions test/ffmpeg-qsv/encode/hevc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
###

from ....lib import *
from ....lib.parameters_strapi import *
from ....lib.ffmpeg.qsv.util import *
from ....lib.ffmpeg.qsv.encoder import HEVC8EncoderTest, HEVC8EncoderLPTest
from ....lib.ffmpeg.qsv.encoder import StringAPIEncoder
Expand Down Expand Up @@ -39,11 +38,10 @@ def test_r2r(self, case, gop, slices, bframes, qp, quality, profile):
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("hevc_qsv", "qsv_params"))
@slash.parametrize(*gen_hevc_cqp_strapi_parameters(spec, ['main']))
@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.EncoderClass = StringAPIEncoder
self.encode()

class cqp_lp(HEVC8EncoderLPTest):
Expand Down Expand Up @@ -71,7 +69,7 @@ def test_r2r(self, case, gop, slices, qp, quality, profile):
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("hevc_qsv", "qsv_params"))
@slash.parametrize(*gen_hevc_cqp_lp_strapi_parameters(spec, ['main']))
@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)
Expand Down Expand Up @@ -105,7 +103,7 @@ def test_r2r(self, case, gop, slices, bframes, bitrate, fps, profile):
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("hevc_qsv", "qsv_params"))
@slash.parametrize(*gen_hevc_cbr_strapi_parameters(spec, ['main']))
@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)
Expand Down Expand Up @@ -138,7 +136,7 @@ def test_r2r(self, case, gop, slices, bitrate, fps, profile):
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("hevc_qsv", "qsv_params"))
@slash.parametrize(*gen_hevc_cbr_lp_strapi_parameters(spec, ['main']))
@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)
Expand Down Expand Up @@ -174,7 +172,7 @@ def test_r2r(self, case, gop, slices, bframes, bitrate, fps, quality, refs, prof
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("hevc_qsv", "qsv_params"))
@slash.parametrize(*gen_hevc_vbr_strapi_parameters(spec, ['main']))
@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)
Expand Down Expand Up @@ -212,7 +210,7 @@ def test_r2r(self, case, gop, slices, bitrate, fps, quality, refs, profile):
self.encode()

@slash.requires(*have_ffmpeg_encoder_options("hevc_qsv", "qsv_params"))
@slash.parametrize(*gen_hevc_vbr_lp_strapi_parameters(spec, ['main']))
@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)
Expand Down

0 comments on commit c2d5d42

Please sign in to comment.