mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-13 18:40:03 +01:00
hw_base_encode: Support refs option to limit number of references
Set default value to 0 to keep the old behavior of using maximum number of references.
This commit is contained in:
@@ -762,6 +762,7 @@ static const FFCodecDefault d3d12va_encode_hevc_defaults[] = {
|
||||
{ "b_qoffset", "0" },
|
||||
{ "qmin", "-1" },
|
||||
{ "qmax", "-1" },
|
||||
{ "refs", "0" },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
||||
@@ -666,6 +666,11 @@ int ff_hw_base_init_gop_structure(FFHWBaseEncodeContext *ctx, AVCodecContext *av
|
||||
ctx->ref_l0 = FFMIN(ref_l0, MAX_PICTURE_REFERENCES);
|
||||
ctx->ref_l1 = FFMIN(ref_l1, MAX_PICTURE_REFERENCES);
|
||||
|
||||
if (avctx->refs > 0) {
|
||||
ctx->ref_l0 = FFMIN(ctx->ref_l0, avctx->refs);
|
||||
ctx->ref_l1 = FFMIN(ctx->ref_l1, avctx->refs);
|
||||
}
|
||||
|
||||
if (flags & FF_HW_FLAG_INTRA_ONLY || avctx->gop_size <= 1) {
|
||||
av_log(avctx, AV_LOG_VERBOSE, "Using intra frames only.\n");
|
||||
ctx->gop_size = 1;
|
||||
|
||||
@@ -1027,6 +1027,7 @@ static const FFCodecDefault vaapi_encode_av1_defaults[] = {
|
||||
{ "g", "120" },
|
||||
{ "qmin", "1" },
|
||||
{ "qmax", "255" },
|
||||
{ "refs", "0" },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
||||
@@ -1153,6 +1153,7 @@ static const FFCodecDefault vaapi_encode_h264_defaults[] = {
|
||||
{ "b_qoffset", "0" },
|
||||
{ "qmin", "-1" },
|
||||
{ "qmax", "-1" },
|
||||
{ "refs", "0" },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
||||
@@ -1184,6 +1184,7 @@ static const FFCodecDefault vaapi_encode_h265_defaults[] = {
|
||||
{ "b_qoffset", "0" },
|
||||
{ "qmin", "-1" },
|
||||
{ "qmax", "-1" },
|
||||
{ "refs", "0" },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
||||
@@ -235,6 +235,7 @@ static const FFCodecDefault vaapi_encode_vp8_defaults[] = {
|
||||
{ "g", "120" },
|
||||
{ "qmin", "-1" },
|
||||
{ "qmax", "-1" },
|
||||
{ "refs", "0" },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
||||
@@ -292,6 +292,7 @@ static const FFCodecDefault vaapi_encode_vp9_defaults[] = {
|
||||
{ "g", "250" },
|
||||
{ "qmin", "-1" },
|
||||
{ "qmax", "-1" },
|
||||
{ "refs", "0" },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
||||
@@ -1367,6 +1367,7 @@ static const FFCodecDefault vulkan_encode_av1_defaults[] = {
|
||||
{ "g", "300" },
|
||||
{ "qmin", "1" },
|
||||
{ "qmax", "255" },
|
||||
{ "refs", "0" },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
||||
@@ -1634,6 +1634,7 @@ static const FFCodecDefault vulkan_encode_h264_defaults[] = {
|
||||
{ "b_qoffset", "0" },
|
||||
{ "qmin", "-1" },
|
||||
{ "qmax", "-1" },
|
||||
{ "refs", "0" },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
||||
@@ -1761,6 +1761,7 @@ static const FFCodecDefault vulkan_encode_h265_defaults[] = {
|
||||
{ "b_qoffset", "0" },
|
||||
{ "qmin", "-1" },
|
||||
{ "qmax", "-1" },
|
||||
{ "refs", "0" },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user