summaryrefslogtreecommitdiff
path: root/libavcodec/libx265.c
diff options
context:
space:
mode:
authorGuo, Yejun <yejun.guo@intel.com>2019-09-23 10:02:35 +0800
committerMark Thompson <sw@jkqxz.net>2019-09-24 17:22:15 +0100
commit85e338ab0da63cc9f319d657ee2eefe4d6f32094 (patch)
treec6b65ec221f096ab56ad0e27833de08659678bff /libavcodec/libx265.c
parent104d44138be1f668973ed9ed5693a40d2514600c (diff)
libavcodec/libx265: add a flag to output ROI warnings only once.
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Diffstat (limited to 'libavcodec/libx265.c')
-rw-r--r--libavcodec/libx265.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index 665b780643..4e7507728f 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -47,6 +47,12 @@ typedef struct libx265Context {
char *tune;
char *profile;
char *x265_opts;
+
+ /**
+ * If the encoder does not support ROI then warn the first time we
+ * encounter a frame with ROI side data.
+ */
+ int roi_warned;
} libx265Context;
static int is_keyframe(NalUnitType naltype)
@@ -310,7 +316,10 @@ static av_cold int libx265_encode_set_roi(libx265Context *ctx, const AVFrame *fr
AVFrameSideData *sd = av_frame_get_side_data(frame, AV_FRAME_DATA_REGIONS_OF_INTEREST);
if (sd) {
if (ctx->params->rc.aqMode == X265_AQ_NONE) {
- av_log(ctx, AV_LOG_WARNING, "Adaptive quantization must be enabled to use ROI encoding, skipping ROI.\n");
+ if (!ctx->roi_warned) {
+ ctx->roi_warned = 1;
+ av_log(ctx, AV_LOG_WARNING, "Adaptive quantization must be enabled to use ROI encoding, skipping ROI.\n");
+ }
} else {
/* 8x8 block when qg-size is 8, 16*16 block otherwise. */
int mb_size = (ctx->params->rc.qgSize == 8) ? 8 : 16;