History

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

Cameron Gutman committed 2 years ago

Commit 4cbb9971 parent 8a951ef1 file · +2 −1Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/amfenc_hevc.c+2−1
@@ -269,7 +269,7 @@ FF_ENABLE_DEPRECATION_WARNINGS · 268 unmodified lines
269 if (avctx->slices > 1) {269 if (avctx->slices > 1) {
270 AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_SLICES_PER_FRAME, avctx->slices);270 AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_SLICES_PER_FRAME, avctx->slices);
271 }271 }
272 AMF_ASSIGN_PROPERTY_BOOL(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_DE_BLOCKING_FILTER_DISABLE, deblocking_filter);272 AMF_ASSIGN_PROPERTY_BOOL(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_DE_BLOCKING_FILTER_DISABLE, !deblocking_filter);
273 273
274 if (ctx->header_insertion_mode != -1) {274 if (ctx->header_insertion_mode != -1) {
275 AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_HEADER_INSERTION_MODE, ctx->header_insertion_mode);275 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[] = { · 235 unmodified lines
511 { "slices", "1" },511 { "slices", "1" },
512 { "qmin", "-1" },512 { "qmin", "-1" },
513 { "qmax", "-1" },513 { "qmax", "-1" },
514 { "flags", "+loop"},
514 { NULL },515 { NULL },
515};516};
516static const AVClass hevc_amf_class = {517static const AVClass hevc_amf_class = {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t