[FFmpeg-cvslog] avfilter/vf_dnn_processing.c: fix typo for the linesize of dnn data

Guo, Yejun git at videolan.org
Tue Apr 7 06:10:44 EEST 2020


ffmpeg | branch: master | Guo, Yejun <yejun.guo at intel.com> | Sat Mar 21 17:33:26 2020 +0800| [2114c4241891849323fd65e56f1ab6f70375a291] | committer: Guo, Yejun

avfilter/vf_dnn_processing.c: fix typo for the linesize of dnn data

Signed-off-by: Guo, Yejun <yejun.guo at intel.com>

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

 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 fabe4f1d01..cf589acedf 100644
--- a/libavfilter/vf_dnn_processing.c
+++ b/libavfilter/vf_dnn_processing.c
@@ -329,7 +329,7 @@ static int copy_from_frame_to_dnn(DnnProcessingContext *ctx, const AVFrame *fram
         if (dnn_input->dt == DNN_FLOAT) {
             sws_scale(ctx->sws_gray8_to_grayf32, (const uint8_t **)frame->data, frame->linesize,
                       0, frame->height, (uint8_t * const*)(&dnn_input->data),
-                      (const int [4]){frame->linesize[0] * sizeof(float), 0, 0, 0});
+                      (const int [4]){frame->width * 3 * sizeof(float), 0, 0, 0});
         } else {
             av_assert0(dnn_input->dt == DNN_UINT8);
             av_image_copy_plane(dnn_input->data, bytewidth,
@@ -369,7 +369,7 @@ static int copy_from_dnn_to_frame(DnnProcessingContext *ctx, AVFrame *frame)
     case AV_PIX_FMT_BGR24:
         if (dnn_output->dt == DNN_FLOAT) {
             sws_scale(ctx->sws_grayf32_to_gray8, (const uint8_t *[4]){(const uint8_t *)dnn_output->data, 0, 0, 0},
-                      (const int[4]){frame->linesize[0] * sizeof(float), 0, 0, 0},
+                      (const int[4]){frame->width * 3 * sizeof(float), 0, 0, 0},
                       0, frame->height, (uint8_t * const*)frame->data, frame->linesize);
 
         } else {



More information about the ffmpeg-cvslog mailing list