]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/libsvtav1.c
avfilter/vf_ssim: remove unnecessary check
[ffmpeg] / libavcodec / libsvtav1.c
index 13d3adc0f89451de3be3aad3574b476ff25ad79c..fabc4e6428f1eebb08c34395576add4b1c050db3 100644 (file)
@@ -85,7 +85,7 @@ static const struct {
     { EB_ErrorBadParameter,               AVERROR(EINVAL),      "bad parameter"             },
     { EB_ErrorDestroyThreadFailed,        AVERROR_EXTERNAL,     "failed to destroy thread"  },
     { EB_ErrorSemaphoreUnresponsive,      AVERROR_EXTERNAL,     "semaphore unresponsive"    },
-    { EB_ErrorDestroySemaphoreFailed,     AVERROR_EXTERNAL,     "semaphore unresponsive"    },
+    { EB_ErrorDestroySemaphoreFailed,     AVERROR_EXTERNAL,     "failed to destroy semaphore"},
     { EB_ErrorCreateMutexFailed,          AVERROR_EXTERNAL,     "failed to create mutex"    },
     { EB_ErrorMutexUnresponsive,          AVERROR_EXTERNAL,     "mutex unresponsive"        },
     { EB_ErrorDestroyMutexFailed,         AVERROR_EXTERNAL,     "failed to destroy mutex"   },
@@ -273,23 +273,17 @@ static av_cold int eb_enc_init(AVCodecContext *avctx)
 
     ret = config_enc_params(&svt_enc->enc_params, avctx);
     if (ret < 0) {
-        svt_av1_enc_deinit_handle(svt_enc->svt_handle);
-        svt_enc->svt_handle = NULL;
         av_log(avctx, AV_LOG_ERROR, "Error configuring encoder parameters\n");
         return ret;
     }
 
     svt_ret = svt_av1_enc_set_parameter(svt_enc->svt_handle, &svt_enc->enc_params);
     if (svt_ret != EB_ErrorNone) {
-        svt_av1_enc_deinit_handle(svt_enc->svt_handle);
-        svt_enc->svt_handle = NULL;
         return svt_print_error(avctx, svt_ret, "Error setting encoder parameters");
     }
 
     svt_ret = svt_av1_enc_init(svt_enc->svt_handle);
     if (svt_ret != EB_ErrorNone) {
-        svt_av1_enc_deinit_handle(svt_enc->svt_handle);
-        svt_enc->svt_handle = NULL;
         return svt_print_error(avctx, svt_ret, "Error initializing encoder");
     }
 
@@ -489,7 +483,7 @@ static const AVOption options[] = {
     { "preset", "Encoding preset [0, 8]",
       OFFSET(enc_mode), AV_OPT_TYPE_INT, { .i64 = MAX_ENC_PRESET }, 0, MAX_ENC_PRESET, VE },
 
-    { "tier", "Set tier (general_tier_flag)", OFFSET(tier),
+    { "tier", "Set operating point tier", OFFSET(tier),
       AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE, "tier" },
         { "main", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, VE, "tier" },
         { "high", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, VE, "tier" },
@@ -526,11 +520,11 @@ static const AVOption options[] = {
 
     { "rc", "Bit rate control mode", OFFSET(rc_mode),
       AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 3, VE , "rc"},
-        { "cqp", "Const Quantization Parameter", 0, AV_OPT_TYPE_CONST, { .i64 = 0 },  INT_MIN, INT_MAX, VE, "rc" },
+        { "cqp", "Constant quantizer", 0, AV_OPT_TYPE_CONST, { .i64 = 0 },  INT_MIN, INT_MAX, VE, "rc" },
         { "vbr", "Variable Bit Rate, use a target bitrate for the entire stream", 0, AV_OPT_TYPE_CONST, { .i64 = 1 },  INT_MIN, INT_MAX, VE, "rc" },
         { "cvbr", "Constrained Variable Bit Rate, use a target bitrate for each GOP", 0, AV_OPT_TYPE_CONST,{ .i64 = 2 },  INT_MIN, INT_MAX, VE, "rc" },
 
-    { "qp", "QP value for intra frames", OFFSET(qp),
+    { "qp", "Quantizer to use with cqp rate control mode", OFFSET(qp),
       AV_OPT_TYPE_INT, { .i64 = 50 }, 0, 63, VE },
 
     { "sc_detection", "Scene change detection", OFFSET(scd),
@@ -557,7 +551,7 @@ static const AVCodecDefault eb_enc_defaults[] = {
     { NULL },
 };
 
-AVCodec ff_libsvtav1_encoder = {
+const AVCodec ff_libsvtav1_encoder = {
     .name           = "libsvtav1",
     .long_name      = NULL_IF_CONFIG_SMALL("SVT-AV1(Scalable Video Technology for AV1) encoder"),
     .priv_data_size = sizeof(SvtContext),
@@ -566,7 +560,8 @@ AVCodec ff_libsvtav1_encoder = {
     .init           = eb_enc_init,
     .receive_packet = eb_receive_packet,
     .close          = eb_enc_close,
-    .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS,
+    .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS,
+    .caps_internal  = FF_CODEC_CAP_AUTO_THREADS,
     .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P,
                                                     AV_PIX_FMT_YUV420P10,
                                                     AV_PIX_FMT_NONE },