[FFmpeg-cvslog] avcodec/extract_extradata_bsf: fix typo in comments

2019-11-06 Thread leozhang
ffmpeg | branch: master | leozhang  | Wed Nov  6 15:00:59 
2019 +0800| [84c27c8c082b320ea518b48c842a6e419c5c5d89] | committer: Michael 
Niedermayer

avcodec/extract_extradata_bsf: fix typo in comments

Signed-off-by: leozhang 
Reviewed-by: Gyan 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=84c27c8c082b320ea518b48c842a6e419c5c5d89
---

 libavcodec/extract_extradata_bsf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/extract_extradata_bsf.c 
b/libavcodec/extract_extradata_bsf.c
index 17e5deb96b..ff111de48c 100644
--- a/libavcodec/extract_extradata_bsf.c
+++ b/libavcodec/extract_extradata_bsf.c
@@ -38,10 +38,10 @@ typedef struct ExtractExtradataContext {
 int (*extract)(AVBSFContext *ctx, AVPacket *pkt,
uint8_t **data, int *size);
 
-/* AV1 specifc fields */
+/* AV1 specific fields */
 AV1Packet av1_pkt;
 
-/* H264/HEVC specifc fields */
+/* H264/HEVC specific fields */
 H2645Packet h2645_pkt;
 
 /* AVOptions */

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/vf_dnn_processing: correct duplicate statement

2019-11-08 Thread leozhang
ffmpeg | branch: master | leozhang  | Fri Nov  8 11:55:10 
2019 +0800| [c79307b7de9c562c10d45eda2ac58d5d5262e666] | committer: Michael 
Niedermayer

avfilter/vf_dnn_processing: correct duplicate statement

Signed-off-by: leozhang 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c79307b7de9c562c10d45eda2ac58d5d5262e666
---

 libavfilter/vf_dnn_processing.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_dnn_processing.c b/libavfilter/vf_dnn_processing.c
index a916d38ec1..f59cfb0da2 100644
--- a/libavfilter/vf_dnn_processing.c
+++ b/libavfilter/vf_dnn_processing.c
@@ -204,7 +204,7 @@ static int config_output(AVFilterLink *outlink)
 static int copy_from_frame_to_dnn(DNNData *dnn_data, const AVFrame *in)
 {
 // extend this function to support more formats
-av_assert0(in->format == AV_PIX_FMT_RGB24 || in->format == 
AV_PIX_FMT_RGB24);
+av_assert0(in->format == AV_PIX_FMT_RGB24 || in->format == 
AV_PIX_FMT_BGR24);
 
 if (dnn_data->dt == DNN_FLOAT) {
 float *dnn_input = dnn_data->data;
@@ -233,7 +233,7 @@ static int copy_from_frame_to_dnn(DNNData *dnn_data, const 
AVFrame *in)
 static int copy_from_dnn_to_frame(AVFrame *out, const DNNData *dnn_data)
 {
 // extend this function to support more formats
-av_assert0(out->format == AV_PIX_FMT_RGB24 || out->format == 
AV_PIX_FMT_RGB24);
+av_assert0(out->format == AV_PIX_FMT_RGB24 || out->format == 
AV_PIX_FMT_BGR24);
 
 if (dnn_data->dt == DNN_FLOAT) {
 float *dnn_output = dnn_data->data;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/avfilter: fix indentation

2019-11-21 Thread leozhang
ffmpeg | branch: master | leozhang  | Wed Nov 20 20:10:57 
2019 +0800| [4a3aa77d7437d17ecf888ba3d5f4a199a9d1d555] | committer: Michael 
Niedermayer

avfilter/avfilter: fix indentation

Signed-off-by: leozhang 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4a3aa77d7437d17ecf888ba3d5f4a199a9d1d555
---

 libavfilter/avfilter.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 09f33e0e7c..1004a6ee1d 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -801,9 +801,9 @@ void avfilter_free(AVFilterContext *filter)
 
 int ff_filter_get_nb_threads(AVFilterContext *ctx)
 {
- if (ctx->nb_threads > 0)
- return FFMIN(ctx->nb_threads, ctx->graph->nb_threads);
- return ctx->graph->nb_threads;
+if (ctx->nb_threads > 0)
+return FFMIN(ctx->nb_threads, ctx->graph->nb_threads);
+return ctx->graph->nb_threads;
 }
 
 static int process_options(AVFilterContext *ctx, AVDictionary **options,

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/vf_yaepblur: add yaepblur filter

2019-12-06 Thread leozhang
ffmpeg | branch: master | leozhang  | Mon Nov 25 17:53:05 
2019 +0800| [0c7f9f714d870b768a68f06310c3175ac7528057] | committer: Michael 
Niedermayer

avfilter/vf_yaepblur: add yaepblur filter

Signed-off-by: leozhang 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0c7f9f714d870b768a68f06310c3175ac7528057
---

 doc/filters.texi  |  22 +++
 libavfilter/Makefile  |   1 +
 libavfilter/allfilters.c  |   1 +
 libavfilter/version.h |   2 +-
 libavfilter/vf_yaepblur.c | 349 ++
 5 files changed, 374 insertions(+), 1 deletion(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 5fdec6f015..6c14030c8d 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -19918,6 +19918,28 @@ Only deinterlace frames marked as interlaced.
 The default value is @code{all}.
 @end table
 
+@section yaepblur
+
+Apply blur filter while preserving edges ("yaepblur" means "yet another edge 
preserving blur filter").
+The algorithm is described in
+"J. S. Lee, Digital image enhancement and noise filtering by use of local 
statistics, IEEE Trans. Pattern Anal. Mach. Intell. PAMI-2, 1980."
+
+It accepts the following parameters:
+
+@table @option
+@item radius, r
+Set the window radius. Default value is 3.
+
+@item planes, p
+Set which planes to filter. Default is only the first plane.
+
+@item sigma, s
+Set blur strength. Default value is 128.
+@end table
+
+@subsection Commands
+This filter supports same @ref{commands} as options.
+
 @section zoompan
 
 Apply Zoom & Pan effect.
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 46e3eecf9a..52f3616b2f 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -443,6 +443,7 @@ OBJS-$(CONFIG_XSTACK_FILTER) += vf_stack.o 
framesync.o
 OBJS-$(CONFIG_YADIF_FILTER)  += vf_yadif.o yadif_common.o
 OBJS-$(CONFIG_YADIF_CUDA_FILTER) += vf_yadif_cuda.o 
vf_yadif_cuda.ptx.o \
 yadif_common.o
+OBJS-$(CONFIG_YAEPBLUR_FILTER)   += vf_yaepblur.o
 OBJS-$(CONFIG_ZMQ_FILTER)+= f_zmq.o
 OBJS-$(CONFIG_ZOOMPAN_FILTER)+= vf_zoompan.o
 OBJS-$(CONFIG_ZSCALE_FILTER) += vf_zscale.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 2a69227476..69953832da 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -421,6 +421,7 @@ extern AVFilter ff_vf_xmedian;
 extern AVFilter ff_vf_xstack;
 extern AVFilter ff_vf_yadif;
 extern AVFilter ff_vf_yadif_cuda;
+extern AVFilter ff_vf_yaepblur;
 extern AVFilter ff_vf_zmq;
 extern AVFilter ff_vf_zoompan;
 extern AVFilter ff_vf_zscale;
diff --git a/libavfilter/version.h b/libavfilter/version.h
index 7e8d849e0c..a3625006af 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -30,7 +30,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVFILTER_VERSION_MAJOR   7
-#define LIBAVFILTER_VERSION_MINOR  67
+#define LIBAVFILTER_VERSION_MINOR  68
 #define LIBAVFILTER_VERSION_MICRO 100
 
 
diff --git a/libavfilter/vf_yaepblur.c b/libavfilter/vf_yaepblur.c
new file mode 100644
index 00..0fb7b84afc
--- /dev/null
+++ b/libavfilter/vf_yaepblur.c
@@ -0,0 +1,349 @@
+/*
+ * Copyright (C) 2019 Leo Zhang 
+
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * yaep(yet another edge preserving) blur filter
+ *
+ * This implementation is based on an algorithm described in
+ * "J. S. Lee, Digital image enhancement and noise filtering by use of local 
statistics, IEEE Trans. Pattern
+ * Anal. Mach. Intell. PAMI-2, 1980."
+ */
+
+#include "libavutil/opt.h"
+#include "libavutil/imgutils.h"
+#include "avfilter.h"
+#include "internal.h"
+
+typedef struct YAEPContext {
+const AVClass *class;
+
+int planes;
+int radius;
+int sigma;
+
+int nb_planes;
+int planewidth[4];
+int planeheight[4];
+int depth;
+
+uint64_t *sat;///< summed area table
+uint64_t *square_sat; ///< square summed area table
+int sat_linesize;
+
+int (*pre_calculate_row)(AVFilterContext *ctx, void *arg, int jobnr

[FFmpeg-cvslog] avcodec/utils: remove extra brackets

2020-02-01 Thread leozhang
ffmpeg | branch: master | leozhang  | Sat Feb  1 17:12:13 
2020 +0800| [81d25e5bfc4be0c82cf2f9aec28d4ef6e3a5d270] | committer: Michael 
Niedermayer

avcodec/utils: remove extra brackets

Signed-off-by: leozhang 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=81d25e5bfc4be0c82cf2f9aec28d4ef6e3a5d270
---

 libavcodec/utils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index ab48754a64..c685b9c9d7 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -556,11 +556,11 @@ int attribute_align_arg avcodec_open2(AVCodecContext 
*avctx, const AVCodec *code
 if (avcodec_is_open(avctx))
 return 0;
 
-if ((!codec && !avctx->codec)) {
+if (!codec && !avctx->codec) {
 av_log(avctx, AV_LOG_ERROR, "No codec provided to avcodec_open2()\n");
 return AVERROR(EINVAL);
 }
-if ((codec && avctx->codec && codec != avctx->codec)) {
+if (codec && avctx->codec && codec != avctx->codec) {
 av_log(avctx, AV_LOG_ERROR, "This AVCodecContext was allocated for %s, 
"
 "but %s passed to avcodec_open2()\n", 
avctx->codec->name, codec->name);
 return AVERROR(EINVAL);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/vf_bilateral: remove useless memcpy

2020-07-17 Thread leozhang
ffmpeg | branch: master | leozhang  | Wed Oct 30 11:07:12 
2019 +0800| [fe591393cd9f0fa130631ac7695420d4cac60d46] | committer: Paul B Mahol

avfilter/vf_bilateral: remove useless memcpy

Signed-off-by: leozhang 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fe591393cd9f0fa130631ac7695420d4cac60d46
---

 libavfilter/vf_bilateral.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_bilateral.c b/libavfilter/vf_bilateral.c
index 47959afdad..3025b49ae5 100644
--- a/libavfilter/vf_bilateral.c
+++ b/libavfilter/vf_bilateral.c
@@ -277,8 +277,8 @@ static void bilateral_##name(BilateralContext *s, const 
uint8_t *ssrc, uint8_t *
 factor_++; 
   \
 }  
   \

   \
-memcpy(ypy, ycy, sizeof(float) * width);   
   \
-memcpy(ypf, ycf, sizeof(float) * width);   
   \
+ypy = ycy; 
   \
+ypf = ycf; 
   \
 }  
   \

   \
 for (int i = 0; i < height; i++)   
   \

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avutil/video_enc_params: fix code comment

2020-08-20 Thread leozhang
ffmpeg | branch: master | leozhang  | Thu Aug 13 11:57:05 
2020 +0800| [3b7036bc1d3bea6631088b58a6dc6399aad157e3] | committer: Steven Liu

avutil/video_enc_params: fix code comment

Reviewed-by: Zhao Zhili 
Signed-off-by: leozhang 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3b7036bc1d3bea6631088b58a6dc6399aad157e3
---

 libavutil/video_enc_params.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/video_enc_params.h b/libavutil/video_enc_params.h
index 43fa443154..e3b422d6f3 100644
--- a/libavutil/video_enc_params.h
+++ b/libavutil/video_enc_params.h
@@ -153,7 +153,7 @@ AVVideoEncParams *av_video_enc_params_alloc(enum 
AVVideoEncParamsType type,
 /**
  * Allocates memory for AVEncodeInfoFrame plus an array of
  * {@code nb_blocks} AVEncodeInfoBlock in the given AVFrame {@code frame}
- * as AVFrameSideData of type AV_FRAME_DATA_ENCODE_INFO
+ * as AVFrameSideData of type AV_FRAME_DATA_VIDEO_ENC_PARAMS
  * and initializes the variables.
  */
 AVVideoEncParams*

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/vf_scale_cuda: unload cuModule on uninit

2020-10-12 Thread leozhang
ffmpeg | branch: master | leozhang  | Mon Oct 12 19:59:39 
2020 +0800| [b9727870ae26eadbaa443828d856f33c79938579] | committer: Timo 
Rothenpieler

avfilter/vf_scale_cuda: unload cuModule on uninit

Signed-off-by: leozhang 
Signed-off-by: Timo Rothenpieler 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b9727870ae26eadbaa443828d856f33c79938579
---

 libavfilter/vf_scale_cuda.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/libavfilter/vf_scale_cuda.c b/libavfilter/vf_scale_cuda.c
index 1ffb73f831..9d59ed4863 100644
--- a/libavfilter/vf_scale_cuda.c
+++ b/libavfilter/vf_scale_cuda.c
@@ -120,6 +120,16 @@ static av_cold void cudascale_uninit(AVFilterContext *ctx)
 {
 CUDAScaleContext *s = ctx->priv;
 
+if (s->hwctx && s->cu_module) {
+CudaFunctions *cu = s->hwctx->internal->cuda_dl;
+CUcontext dummy;
+
+CHECK_CU(cu->cuCtxPushCurrent(s->hwctx->cuda_ctx));
+CHECK_CU(cu->cuModuleUnload(s->cu_module));
+s->cu_module = NULL;
+CHECK_CU(cu->cuCtxPopCurrent(&dummy));
+}
+
 av_frame_free(&s->frame);
 av_buffer_unref(&s->frames_ctx);
 av_frame_free(&s->tmp_frame);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avformat/flvdec: delete unused code

2019-08-23 Thread leozhang
ffmpeg | branch: master | leozhang  | Wed Aug 14 11:07:18 
2019 +0800| [b2bb09bcc330156e9d79d7ddfa59f9c5d05ca149] | committer: Michael 
Niedermayer

avformat/flvdec: delete unused code

Reviewed-by: Carl Eugen Hoyos 
Signed-off-by: leozhang 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b2bb09bcc330156e9d79d7ddfa59f9c5d05ca149
---

 libavformat/flvdec.c | 17 -
 1 file changed, 17 deletions(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index b531a39adc..6bfe6248d6 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -32,7 +32,6 @@
 #include "libavutil/mathematics.h"
 #include "libavutil/time_internal.h"
 #include "libavcodec/bytestream.h"
-#include "libavcodec/mpeg4audio.h"
 #include "avformat.h"
 #include "internal.h"
 #include "avio_internal.h"
@@ -1265,22 +1264,6 @@ retry_duration:
 if (st->codecpar->codec_id == AV_CODEC_ID_AAC && t && 
!strcmp(t->value, "Omnia A/XE"))
 st->codecpar->extradata_size = 2;
 
-if (st->codecpar->codec_id == AV_CODEC_ID_AAC && 0) {
-MPEG4AudioConfig cfg;
-
-if (avpriv_mpeg4audio_get_config(&cfg, st->codecpar->extradata,
- st->codecpar->extradata_size 
* 8, 1) >= 0) {
-st->codecpar->channels   = cfg.channels;
-st->codecpar->channel_layout = 0;
-if (cfg.ext_sample_rate)
-st->codecpar->sample_rate = cfg.ext_sample_rate;
-else
-st->codecpar->sample_rate = cfg.sample_rate;
-av_log(s, AV_LOG_TRACE, "mp4a config channels %d sample rate 
%d\n",
-st->codecpar->channels, st->codecpar->sample_rate);
-}
-}
-
 ret = FFERROR_REDO;
 goto leave;
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avcodec/cuviddec: fix missing context push/pop

2020-11-21 Thread leozhang
ffmpeg | branch: master | leozhang  | Fri Nov 20 11:23:43 
2020 +0800| [7ce7d33d1537bebe3e11b4046466d6c694f2e9c7] | committer: Timo 
Rothenpieler

avcodec/cuviddec: fix missing context push/pop

Test command like below:
cuda-memcheck ./ffmpeg -hwaccel cuvid -c:v h264_cuvid -i input_file -c:v 
h264_nvenc -f null -

Signed-off-by: leozhang 
Signed-off-by: Timo Rothenpieler 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7ce7d33d1537bebe3e11b4046466d6c694f2e9c7
---

 libavcodec/cuviddec.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c
index 5e698d4cd0..61d7f36c79 100644
--- a/libavcodec/cuviddec.c
+++ b/libavcodec/cuviddec.c
@@ -673,15 +673,22 @@ static int cuvid_decode_frame(AVCodecContext *avctx, void 
*data, int *got_frame,
 static av_cold int cuvid_decode_end(AVCodecContext *avctx)
 {
 CuvidContext *ctx = avctx->priv_data;
+AVHWDeviceContext *device_ctx = (AVHWDeviceContext *)ctx->hwdevice->data;
+AVCUDADeviceContext *device_hwctx = device_ctx->hwctx;
+CUcontext dummy, cuda_ctx = device_hwctx->cuda_ctx;
 
 av_fifo_freep(&ctx->frame_queue);
 
+ctx->cudl->cuCtxPushCurrent(cuda_ctx);
+
 if (ctx->cuparser)
 ctx->cvdl->cuvidDestroyVideoParser(ctx->cuparser);
 
 if (ctx->cudecoder)
 ctx->cvdl->cuvidDestroyDecoder(ctx->cudecoder);
 
+ctx->cudl->cuCtxPopCurrent(&dummy);
+
 ctx->cudl = NULL;
 
 av_buffer_unref(&ctx->hwframe);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".