diff mbox

[FFmpeg-devel] lavc/cbs_av1: Add read/write flag in log message

Message ID 1576392052-30861-1-git-send-email-mypopydev@gmail.com
State New
Headers show

Commit Message

Jun Zhao Dec. 15, 2019, 6:40 a.m. UTC
From: Jun Zhao <barryjzhao@tencent.com>

Before this change, the command:

ffmpeg -y -i bear-av1.mp4 -c:v copy bear-av1.ivf -loglevel 99

always dump the log message like:

AVBSFContext @ 0x55ff99e78e00] Frame 4:  size 320x240  upscaled 320  render 320x240  subsample 2x2  bitdepth 8  tiles 1x1.
    Last message repeated 1 times

it's hard to distinguish writing or reading.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
---
 libavcodec/cbs_av1_syntax_template.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

Comments

James Almer Dec. 15, 2019, 1:50 p.m. UTC | #1
On 12/15/2019 3:40 AM, Jun Zhao wrote:
> From: Jun Zhao <barryjzhao@tencent.com>
> 
> Before this change, the command:
> 
> ffmpeg -y -i bear-av1.mp4 -c:v copy bear-av1.ivf -loglevel 99
> 
> always dump the log message like:
> 
> AVBSFContext @ 0x55ff99e78e00] Frame 4:  size 320x240  upscaled 320  render 320x240  subsample 2x2  bitdepth 8  tiles 1x1.
>     Last message repeated 1 times
> 
> it's hard to distinguish writing or reading.
> 
> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
> ---
>  libavcodec/cbs_av1_syntax_template.c |   10 ++++++++--
>  1 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c
> index 523f935..9947441 100644
> --- a/libavcodec/cbs_av1_syntax_template.c
> +++ b/libavcodec/cbs_av1_syntax_template.c
> @@ -1552,9 +1552,15 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
>          }
>      }
>  
> -    av_log(ctx->log_ctx, AV_LOG_DEBUG, "Frame %d:  size %dx%d  "
> +    av_log(ctx->log_ctx, AV_LOG_DEBUG, "%s Frame %d:  size %dx%d  "
>             "upscaled %d  render %dx%d  subsample %dx%d  "
> -           "bitdepth %d  tiles %dx%d.\n", current->order_hint,
> +           "bitdepth %d  tiles %dx%d.\n",

The line break should be at the end of the string.

> +#ifdef READ
> +           "Read",
> +#else
> +           "Write",

Nit: Written.

> +#endif
> +           current->order_hint,
>             priv->frame_width, priv->frame_height, priv->upscaled_width,
>             priv->render_width, priv->render_height,
>             seq->color_config.subsampling_x + 1,
>
Michael Niedermayer Dec. 15, 2019, 10:37 p.m. UTC | #2
On Sun, Dec 15, 2019 at 02:40:52PM +0800, Jun Zhao wrote:
> From: Jun Zhao <barryjzhao@tencent.com>
> 
> Before this change, the command:
> 
> ffmpeg -y -i bear-av1.mp4 -c:v copy bear-av1.ivf -loglevel 99
> 
> always dump the log message like:
> 
> AVBSFContext @ 0x55ff99e78e00] Frame 4:  size 320x240  upscaled 320  render 320x240  subsample 2x2  bitdepth 8  tiles 1x1.
>     Last message repeated 1 times
> 
> it's hard to distinguish writing or reading.

Iam not objecting to this patch but i think this should be done in
a more generic way (so that information is availble in all messages
which need it and doesnt require a per message R/W string addition)

Thanks

[...]
Jun Zhao Dec. 16, 2019, 5:16 a.m. UTC | #3
On Mon, Dec 16, 2019 at 6:37 AM Michael Niedermayer
<michael@niedermayer.cc> wrote:
>
> On Sun, Dec 15, 2019 at 02:40:52PM +0800, Jun Zhao wrote:
> > From: Jun Zhao <barryjzhao@tencent.com>
> >
> > Before this change, the command:
> >
> > ffmpeg -y -i bear-av1.mp4 -c:v copy bear-av1.ivf -loglevel 99
> >
> > always dump the log message like:
> >
> > AVBSFContext @ 0x55ff99e78e00] Frame 4:  size 320x240  upscaled 320  render 320x240  subsample 2x2  bitdepth 8  tiles 1x1.
> >     Last message repeated 1 times
> >
> > it's hard to distinguish writing or reading.
>
> Iam not objecting to this patch but i think this should be done in
> a more generic way (so that information is availble in all messages
> which need it and doesnt require a per message R/W string addition)
>
> Thanks
>
Yes, for CBS, I think we need a better way for this type case, will
try another solution
diff mbox

Patch

diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c
index 523f935..9947441 100644
--- a/libavcodec/cbs_av1_syntax_template.c
+++ b/libavcodec/cbs_av1_syntax_template.c
@@ -1552,9 +1552,15 @@  static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
         }
     }
 
-    av_log(ctx->log_ctx, AV_LOG_DEBUG, "Frame %d:  size %dx%d  "
+    av_log(ctx->log_ctx, AV_LOG_DEBUG, "%s Frame %d:  size %dx%d  "
            "upscaled %d  render %dx%d  subsample %dx%d  "
-           "bitdepth %d  tiles %dx%d.\n", current->order_hint,
+           "bitdepth %d  tiles %dx%d.\n",
+#ifdef READ
+           "Read",
+#else
+           "Write",
+#endif
+           current->order_hint,
            priv->frame_width, priv->frame_height, priv->upscaled_width,
            priv->render_width, priv->render_height,
            seq->color_config.subsampling_x + 1,