[FFmpeg-devel,v3,2/3] lavc/libdavs2.c: change decoder info level

Submitted by hwren on July 12, 2019, 3:21 p.m.

Details

Message ID 1562944894-29396-3-git-send-email-hwrenx@126.com
State New
Headers show

Commit Message

hwren July 12, 2019, 3:21 p.m.
Signed-off-by: hwrenx <hwrenx@126.com>
---
 libavcodec/libdavs2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Zhong Li July 13, 2019, 1:34 p.m.
> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces@ffmpeg.org] On Behalf

> Of hwrenx

> Sent: Friday, July 12, 2019 11:22 PM

> To: ffmpeg-devel@ffmpeg.org

> Subject: [FFmpeg-devel] [PATCH v3 2/3] lavc/libdavs2.c: change decoder info

> level

> 

> Signed-off-by: hwrenx <hwrenx@126.com>

> ---

>  libavcodec/libdavs2.c | 4 +++-

>  1 file changed, 3 insertions(+), 1 deletion(-)

> 

> diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c index

> 218f3ec..1b274a3 100644

> --- a/libavcodec/libdavs2.c

> +++ b/libavcodec/libdavs2.c

> @@ -44,7 +44,9 @@ static av_cold int davs2_init(AVCodecContext *avctx)

> 

>      /* init the decoder */

>      cad->param.threads      = avctx->thread_count;

> -    cad->param.info_level   = 0;

> +    cad->param.info_level   = av_log_get_level() > AV_LOG_INFO

> +                                                 ?

> DAVS2_LOG_DEBUG

> +                                                 :

> DAVS2_LOG_WARNING;


How about exactly map AV_LOG_XXX to DAVS2_LOG_XXX?
hwren July 14, 2019, 2:24 a.m.
At 2019-07-13 21:34:30, "Li, Zhong" <zhong.li@intel.com> wrote:
>> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces@ffmpeg.org] On Behalf
>> Of hwrenx
>> Sent: Friday, July 12, 2019 11:22 PM
>> To: ffmpeg-devel@ffmpeg.org
>> Subject: [FFmpeg-devel] [PATCH v3 2/3] lavc/libdavs2.c: change decoder info
>> level
>> 
>> Signed-off-by: hwrenx <hwrenx@126.com>
>> ---
>>  libavcodec/libdavs2.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>> 
>> diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c index
>> 218f3ec..1b274a3 100644
>> --- a/libavcodec/libdavs2.c
>> +++ b/libavcodec/libdavs2.c
>> @@ -44,7 +44,9 @@ static av_cold int davs2_init(AVCodecContext *avctx)
>> 
>>      /* init the decoder */
>>      cad->param.threads      = avctx->thread_count;
>> -    cad->param.info_level   = 0;
>> +    cad->param.info_level   = av_log_get_level() > AV_LOG_INFO
>> +                                                 ?
>> DAVS2_LOG_DEBUG
>> +                                                 :
>> DAVS2_LOG_WARNING;
>
>How about exactly map AV_LOG_XXX to DAVS2_LOG_XXX?

Exactly, a map would be better. Two levels are enough now, and I will update if there are new versions of these patches.

Thanks : )
Huiwen REN

>_______________________________________________
>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".
hwren July 22, 2019, 4:23 a.m.
Version 4:
1. Change info level setting.
2. Remove `Decoder not found` condition.

--------
The previous version 2 patches were deprecated for using
pointer to itself can be unsafe when release frames.

This patch set is mainly about avoiding using memcpy when fetching
frame data, and fixed missing start codes which may cause error
packetization sometime. Default info level of libdavs2 was changed
because we found debug info is useless in most of the time.

hwrenx (3):
  lavc/avs2_parser.c: fix missing start code
  lavc/libdavs2.c: fix decoder info level setting
  lavc/libdavs2.c: reduce memcpy

 libavcodec/avs2_parser.c |  4 +++-
 libavcodec/libdavs2.c    | 61 +++++++++++++++++++++++++++++-------------------
 2 files changed, 40 insertions(+), 25 deletions(-)

The performance comparison is like following:

[Platform]
  Intel® Core™ i7-8700k CPU @ 3.70GHz × 6 / 16GiB
[Command]
  ffmpeg -i test.avs2 -vsync 0 -f null -
[Stream]
  7680x4320 yuv420p Random Access
[Original version]
  frame= 2669 fps= 23 q=-0.0 Lsize=N/A time=00:00:53.44 bitrate=N/A speed=0.465x
[Optimized version]
  frame= 2669 fps= 42 q=-0.0 Lsize=N/A time=00:00:53.44 bitrate=N/A speed=0.836x

Patch hide | download patch | download mbox

diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
index 218f3ec..1b274a3 100644
--- a/libavcodec/libdavs2.c
+++ b/libavcodec/libdavs2.c
@@ -44,7 +44,9 @@  static av_cold int davs2_init(AVCodecContext *avctx)
 
     /* init the decoder */
     cad->param.threads      = avctx->thread_count;
-    cad->param.info_level   = 0;
+    cad->param.info_level   = av_log_get_level() > AV_LOG_INFO
+                                                 ? DAVS2_LOG_DEBUG
+                                                 : DAVS2_LOG_WARNING;
     cad->param.disable_avx  = !(cpu_flags & AV_CPU_FLAG_AVX &&
                                 cpu_flags & AV_CPU_FLAG_AVX2);
     cad->decoder            = davs2_decoder_open(&cad->param);