[FFmpeg-cvslog] avcodec/amfenc: Fix inverted loop filter option
Cameron Gutman
git at videolan.org
Sat Sep 28 17:02:15 EEST 2024
ffmpeg | branch: master | Cameron Gutman <aicommander at gmail.com> | Sat Sep 14 00:32:05 2024 -0500| [4cbb997e15deecce0628449dabd8856667ec570d] | committer: Dmitrii Ovchinnikov
avcodec/amfenc: Fix inverted loop filter option
The AMF HEVC encoder takes a bool option for whether deblocking filter
should be _disabled_ instead of whether it should _enabled_ like the
AMF H.264 encoder does. The logic was accidentally copied from H.264 to
HEVC without negating the bool value, so the deblocking filter was
actually disabled when AV_CODEC_FLAG_LOOP_FILTER was set.
Before this patch:
------------------
no flags set => deblocking filter on
flags +loop => deblocking filter off
flags -loop => deblocking filter on
After this patch:
-----------------
no flags set => deblocking filter on
flags +loop => deblocking filter on
flags -loop => deblocking filter off
Signed-off-by: Cameron Gutman <aicommander at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4cbb997e15deecce0628449dabd8856667ec570d
---
libavcodec/amfenc_hevc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavcodec/amfenc_hevc.c b/libavcodec/amfenc_hevc.c
index 4898824f3a..3fad1d6b59 100644
--- a/libavcodec/amfenc_hevc.c
+++ b/libavcodec/amfenc_hevc.c
@@ -269,7 +269,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (avctx->slices > 1) {
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_SLICES_PER_FRAME, avctx->slices);
}
- AMF_ASSIGN_PROPERTY_BOOL(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_DE_BLOCKING_FILTER_DISABLE, deblocking_filter);
+ AMF_ASSIGN_PROPERTY_BOOL(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_DE_BLOCKING_FILTER_DISABLE, !deblocking_filter);
if (ctx->header_insertion_mode != -1) {
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_HEADER_INSERTION_MODE, ctx->header_insertion_mode);
@@ -511,6 +511,7 @@ static const FFCodecDefault defaults[] = {
{ "slices", "1" },
{ "qmin", "-1" },
{ "qmax", "-1" },
+ { "flags", "+loop"},
{ NULL },
};
static const AVClass hevc_amf_class = {
More information about the ffmpeg-cvslog
mailing list