* [FFmpeg-devel] [PATCH 2/2] avcodec/mpegutils: print axis in debug_info2 [not found] <20231229172016.729510-1-quinkblack@foxmail.com> @ 2023-12-29 17:20 ` Zhao Zhili 2023-12-29 18:09 ` Michael Niedermayer 0 siblings, 1 reply; 2+ messages in thread From: Zhao Zhili @ 2023-12-29 17:20 UTC (permalink / raw) To: ffmpeg-devel; +Cc: Zhao Zhili From: Zhao Zhili <zhilizhao@tencent.com> 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 Signed-off-by: Zhao Zhili <zhilizhao@tencent.com> --- libavcodec/mpegutils.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/libavcodec/mpegutils.c b/libavcodec/mpegutils.c index a565773c5e..fc3e270631 100644 --- a/libavcodec/mpegutils.c +++ b/libavcodec/mpegutils.c @@ -254,12 +254,43 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, AVBPrint buf; char *str = NULL; int n; + int margin_left; + int x_step; av_log(avctx, AV_LOG_DEBUG, "New frame, type: %c\n", av_get_picture_type_char(pict->pict_type)); + + margin_left = 2; + n = mb_width << 4; + while ((n /= 10)) + margin_left++; + + av_bprint_init(&buf, 1, AV_BPRINT_SIZE_UNLIMITED); + av_bprintf(&buf, "%*s", margin_left, " "); + + n = 0; + if (avctx->debug & FF_DEBUG_SKIP) + n++; + if (avctx->debug & FF_DEBUG_QP) + n += 2; + if (avctx->debug & FF_DEBUG_MB_TYPE) + n += 3; + x_step = (mb_width * 16 > 999) ? 8 : 4; + for (x = 0; x < mb_width; x += x_step) + av_bprintf(&buf, "%-*d", n * x_step, x << 4); + n = av_bprint_finalize(&buf, &str); + if (n < 0) { + av_log(avctx, AV_LOG_ERROR, "%s failed, %s\n", __func__, av_err2str(n)); + return; + } + av_log(avctx, AV_LOG_DEBUG, "%s\n", str); + av_freep(&str); + for (y = 0; y < mb_height; y++) { av_bprint_init(&buf, 1, AV_BPRINT_SIZE_UNLIMITED); for (x = 0; x < mb_width; x++) { + if (x == 0) + av_bprintf(&buf, "%*d ", margin_left - 1, y << 4); if (avctx->debug & FF_DEBUG_SKIP) { int count = mbskip_table ? mbskip_table[x + y * mb_stride] : 0; if (count > 9) -- 2.25.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/2] avcodec/mpegutils: print axis in debug_info2 2023-12-29 17:20 ` [FFmpeg-devel] [PATCH 2/2] avcodec/mpegutils: print axis in debug_info2 Zhao Zhili @ 2023-12-29 18:09 ` Michael Niedermayer 0 siblings, 0 replies; 2+ messages in thread From: Michael Niedermayer @ 2023-12-29 18:09 UTC (permalink / raw) To: FFmpeg development discussions and patches [-- Attachment #1.1: Type: text/plain, Size: 1146 bytes --] On Sat, Dec 30, 2023 at 01:20:16AM +0800, Zhao Zhili wrote: > From: Zhao Zhili <zhilizhao@tencent.com> > > 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 the output looks nice thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Whats the most studid thing your enemy could do ? Blow himself up Whats the most studid thing you could do ? Give up your rights and freedom because your enemy blew himself up. [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 195 bytes --] [-- Attachment #2: Type: text/plain, Size: 251 bytes --] _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-12-29 18:09 UTC | newest] Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20231229172016.729510-1-quinkblack@foxmail.com> 2023-12-29 17:20 ` [FFmpeg-devel] [PATCH 2/2] avcodec/mpegutils: print axis in debug_info2 Zhao Zhili 2023-12-29 18:09 ` Michael Niedermayer
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git