[FFmpeg-cvslog] avcodec: add missing FF_API_DEBUG_MV wrappers
James Almer
git at videolan.org
Fri Aug 25 19:48:31 EEST 2017
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Fri Aug 25 13:44:52 2017 -0300| [8a0954dd51ca5c8f8e1c6d2c2d0961ae24055814] | committer: James Almer
avcodec: add missing FF_API_DEBUG_MV wrappers
Signed-off-by: James Almer <jamrial at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8a0954dd51ca5c8f8e1c6d2c2d0961ae24055814
---
ffmpeg.c | 6 +++++-
libavcodec/mpegpicture.c | 5 ++++-
libavcodec/mpegvideo.c | 2 ++
libavcodec/options_table.h | 2 ++
libavcodec/pthread_frame.c | 2 ++
5 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/ffmpeg.c b/ffmpeg.c
index 888d19a647..ccb6638e0a 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3928,7 +3928,11 @@ static int check_keyboard_interaction(int64_t cur_time)
if(key == 'D') {
debug = input_streams[0]->st->codec->debug<<1;
if(!debug) debug = 1;
- while(debug & (FF_DEBUG_DCT_COEFF|FF_DEBUG_VIS_QP|FF_DEBUG_VIS_MB_TYPE)) //unsupported, would just crash
+ while(debug & (FF_DEBUG_DCT_COEFF
+#if FF_API_DEBUG_MV
+ |FF_DEBUG_VIS_QP|FF_DEBUG_VIS_MB_TYPE
+#endif
+ )) //unsupported, would just crash
debug += debug;
}else{
char buf[32];
diff --git a/libavcodec/mpegpicture.c b/libavcodec/mpegpicture.c
index 302f9d20d3..53fb35b4bd 100644
--- a/libavcodec/mpegpicture.c
+++ b/libavcodec/mpegpicture.c
@@ -202,7 +202,10 @@ static int alloc_picture_tables(AVCodecContext *avctx, Picture *pic, int encodin
return AVERROR(ENOMEM);
}
- if (out_format == FMT_H263 || encoding || avctx->debug_mv ||
+ if (out_format == FMT_H263 || encoding ||
+#if FF_API_DEBUG_MV
+ avctx->debug_mv ||
+#endif
(avctx->flags2 & AV_CODEC_FLAG2_EXPORT_MVS)) {
int mv_size = 2 * (b8_array_size + 4) * sizeof(int16_t);
int ref_index_size = 4 * mb_array_size;
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index e29558b3a2..82b94253ae 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1743,6 +1743,7 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, uint8_t *mbskip_
}
}
+#if FF_API_DEBUG_MV
if ((avctx->debug & (FF_DEBUG_VIS_QP | FF_DEBUG_VIS_MB_TYPE)) ||
(avctx->debug_mv)) {
int mb_y;
@@ -1956,6 +1957,7 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, uint8_t *mbskip_
}
}
}
+#endif
}
void ff_print_debug_info(MpegEncContext *s, Picture *p, AVFrame *pict)
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 57a098e76e..12712fb541 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -275,8 +275,10 @@ static const AVOption avcodec_options[] = {
{"er", "error recognition", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_ER }, INT_MIN, INT_MAX, V|D, "debug"},
{"mmco", "memory management control operations (H.264)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_MMCO }, INT_MIN, INT_MAX, V|D, "debug"},
{"bugs", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_BUGS }, INT_MIN, INT_MAX, V|D, "debug"},
+#if FF_API_DEBUG_MV
{"vis_qp", "visualize quantization parameter (QP), lower QP are tinted greener", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_VIS_QP }, INT_MIN, INT_MAX, V|D, "debug"},
{"vis_mb_type", "visualize block types", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_VIS_MB_TYPE }, INT_MIN, INT_MAX, V|D, "debug"},
+#endif
{"buffers", "picture buffer allocations", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_BUFFERS }, INT_MIN, INT_MAX, V|D, "debug"},
{"thread_ops", "threading operations", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_THREADS }, INT_MIN, INT_MAX, V|A|D, "debug"},
{"nomc", "skip motion compensation", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_NOMC }, INT_MIN, INT_MAX, V|A|D, "debug"},
diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
index 08e182c3d1..2c702c7372 100644
--- a/libavcodec/pthread_frame.c
+++ b/libavcodec/pthread_frame.c
@@ -739,8 +739,10 @@ int ff_frame_thread_init(AVCodecContext *avctx)
if (!thread_count) {
int nb_cpus = av_cpu_count();
+#if FF_API_DEBUG_MV
if ((avctx->debug & (FF_DEBUG_VIS_QP | FF_DEBUG_VIS_MB_TYPE)) || avctx->debug_mv)
nb_cpus = 1;
+#endif
// use number of cores + 1 as thread count if there is more than one
if (nb_cpus > 1)
thread_count = avctx->thread_count = FFMIN(nb_cpus + 1, MAX_AUTO_THREADS);
More information about the ffmpeg-cvslog
mailing list