For example, ./ffmpeg -nostats -threads 1 -debug qp \ -export_side_data +venc_params \ -i reinit-small_420_9-to-small_420_8.h264 \ -frames 2 \ -f null - New frame, type: B 0 64 128 192 0 313131313131313131313131313129 16 292929292929292929292929292929 32 323232323232323232323232323232 48 323232323232323232323232323232 64 323232323232323232323232323232 80 323232323232323232323232323232 96 323232323030303030303030303030 112 303030303030303030303030303030 128 303030303030303030303030303028 144 313131312929292929292929292929 160 292929292929292929292929292929 176 292929292929292929292929292931 192 312831312631313131312730283131
Unified · Split
| @@ -254,12 +254,43 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, · 253 unmodified lines | ||
| 254 | 254 | AVBPrint buf; |
| 255 | 255 | char *str = NULL; |
| 256 | 256 | int n; |
| 257 | + int margin_left; | |
| 258 | + int x_step; | |
| 257 | 259 | |
| 258 | 260 | av_log(avctx, AV_LOG_DEBUG, "New frame, type: %c\n", |
| 259 | 261 | av_get_picture_type_char(pict->pict_type)); |
| 262 | + | |
| 263 | + margin_left = 2; | |
| 264 | + n = mb_width << 4; | |
| 265 | + while ((n /= 10)) | |
| 266 | + margin_left++; | |
| 267 | + | |
| 268 | + av_bprint_init(&buf, 1, AV_BPRINT_SIZE_UNLIMITED); | |
| 269 | + av_bprintf(&buf, "%*s", margin_left, " "); | |
| 270 | + | |
| 271 | + n = 0; | |
| 272 | + if (avctx->debug & FF_DEBUG_SKIP) | |
| 273 | + n++; | |
| 274 | + if (avctx->debug & FF_DEBUG_QP) | |
| 275 | + n += 2; | |
| 276 | + if (avctx->debug & FF_DEBUG_MB_TYPE) | |
| 277 | + n += 3; | |
| 278 | + x_step = (mb_width * 16 > 999) ? 8 : 4; | |
| 279 | + for (x = 0; x < mb_width; x += x_step) | |
| 280 | + av_bprintf(&buf, "%-*d", n * x_step, x << 4); | |
| 281 | + n = av_bprint_finalize(&buf, &str); | |
| 282 | + if (n < 0) { | |
| 283 | + av_log(avctx, AV_LOG_ERROR, "%s failed, %s\n", __func__, av_err2str(n)); | |
| 284 | + return; | |
| 285 | + } | |
| 286 | + av_log(avctx, AV_LOG_DEBUG, "%s\n", str); | |
| 287 | + av_freep(&str); | |
| 288 | + | |
| 260 | 289 | for (y = 0; y < mb_height; y++) { |
| 261 | 290 | av_bprint_init(&buf, 1, AV_BPRINT_SIZE_UNLIMITED); |
| 262 | 291 | for (x = 0; x < mb_width; x++) { |
| 292 | + if (x == 0) | |
| 293 | + av_bprintf(&buf, "%*d ", margin_left - 1, y << 4); | |
| 263 | 294 | if (avctx->debug & FF_DEBUG_SKIP) { |
| 264 | 295 | int count = mbskip_table ? mbskip_table[x + y * mb_stride] : 0; |
| 265 | 296 | if (count > 9) |