avcodec: add missing FF_API_DEBUG_MV wrappers

Signed-off-by: James Almer <jamrial@gmail.com>
pull/269/head
James Almer 7 years ago
parent 2c800eb737
commit 8a0954dd51
  1. 6
      ffmpeg.c
  2. 5
      libavcodec/mpegpicture.c
  3. 2
      libavcodec/mpegvideo.c
  4. 2
      libavcodec/options_table.h
  5. 2
      libavcodec/pthread_frame.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];

@ -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;

@ -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)

@ -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"},

@ -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);

Loading…
Cancel
Save