diff mbox series

[FFmpeg-devel,v2,2/6] avcodec/libsvtav1: make coded GOP type configurable

Message ID 1631928405-26935-2-git-send-email-lance.lmwang@gmail.com
State Accepted
Commit 64e2fb3f9d89e5ad552f48e2d5beb9be7a91572a
Headers show
Series [FFmpeg-devel,v2,1/6] avcodec/libsvtav1: Fix override setting of caps_internal | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Lance Wang Sept. 18, 2021, 1:26 a.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavcodec/libsvtav1.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Jan Ekström Sept. 25, 2021, 10:03 a.m. UTC | #1
On Sat, Sep 18, 2021 at 4:27 AM <lance.lmwang@gmail.com> wrote:
>
> From: Limin Wang <lance.lmwang@gmail.com>
>
> Reviewed-by: Jan Ekström <jeebjp@gmail.com>
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>

I still hate how SVT-AV1 has no enum/defines for these, but so be it :)

LGTM.

Jan
diff mbox series

Patch

diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
index 82ae2b9..0dc25ca 100644
--- a/libavcodec/libsvtav1.c
+++ b/libavcodec/libsvtav1.c
@@ -210,7 +210,8 @@  static int config_enc_params(EbSvtAv1EncConfiguration *param,
         param->min_qp_allowed       = avctx->qmin;
     }
 
-    param->intra_refresh_type       = 2; /* Real keyframes only */
+    /* 2 = IDR, closed GOP, 1 = CRA, open GOP */
+    param->intra_refresh_type = avctx->flags & AV_CODEC_FLAG_CLOSED_GOP ? 2 : 1;
 
     if (svt_enc->la_depth >= 0)
         param->look_ahead_distance  = svt_enc->la_depth;
@@ -545,6 +546,7 @@  static const AVClass class = {
 
 static const AVCodecDefault eb_enc_defaults[] = {
     { "b",         "7M"    },
+    { "flags",     "+cgop" },
     { "g",         "-1"    },
     { "qmin",      "0"     },
     { "qmax",      "63"    },