diff mbox series

[FFmpeg-devel] lavfi/vf_dnn_processing: Fix compile warning of mixed declarations and code

Message ID 1584505390-21393-1-git-send-email-linjie.fu@intel.com
State Accepted
Headers show
Series [FFmpeg-devel] lavfi/vf_dnn_processing: Fix compile warning of mixed declarations and code
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Fu, Linjie March 18, 2020, 4:23 a.m. UTC
Signed-off-by: Linjie Fu <linjie.fu@intel.com>
---
 libavfilter/vf_dnn_processing.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Guo, Yejun March 19, 2020, 6:32 a.m. UTC | #1
> -----Original Message-----
> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces@ffmpeg.org] On Behalf Of
> Linjie Fu
> Sent: Wednesday, March 18, 2020 12:23 PM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Fu, Linjie <linjie.fu@intel.com>
> Subject: [FFmpeg-devel] [PATCH] lavfi/vf_dnn_processing: Fix compile warning
> of mixed declarations and code
> 
> Signed-off-by: Linjie Fu <linjie.fu@intel.com>
> ---
>  libavfilter/vf_dnn_processing.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/libavfilter/vf_dnn_processing.c b/libavfilter/vf_dnn_processing.c
> index 7f40f85..fabe4f1 100644
> --- a/libavfilter/vf_dnn_processing.c
> +++ b/libavfilter/vf_dnn_processing.c
> @@ -418,10 +418,13 @@ static av_always_inline int isPlanarYUV(enum
> AVPixelFormat pix_fmt)
> 
>  static int copy_uv_planes(DnnProcessingContext *ctx, AVFrame *out, const
> AVFrame *in)
>  {
> +    const AVPixFmtDescriptor *desc;
> +    int uv_height;
> +
>      if (!ctx->sws_uv_scale) {
>          av_assert0(in->height == out->height && in->width == out->width);
> -        const AVPixFmtDescriptor *desc =
> av_pix_fmt_desc_get(in->format);
> -        int uv_height = AV_CEIL_RSHIFT(in->height, desc->log2_chroma_h);
> +        desc = av_pix_fmt_desc_get(in->format);
> +        uv_height = AV_CEIL_RSHIFT(in->height, desc->log2_chroma_h);
>          for (int i = 1; i < 3; ++i) {
>              int bytewidth = av_image_get_linesize(in->format, in->width,
> i);
>              av_image_copy_plane(out->data[i], out->linesize[i],

LGTM, thanks, will push soon.

> --
> 2.7.4
> 
> _______________________________________________
> 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".
diff mbox series

Patch

diff --git a/libavfilter/vf_dnn_processing.c b/libavfilter/vf_dnn_processing.c
index 7f40f85..fabe4f1 100644
--- a/libavfilter/vf_dnn_processing.c
+++ b/libavfilter/vf_dnn_processing.c
@@ -418,10 +418,13 @@  static av_always_inline int isPlanarYUV(enum AVPixelFormat pix_fmt)
 
 static int copy_uv_planes(DnnProcessingContext *ctx, AVFrame *out, const AVFrame *in)
 {
+    const AVPixFmtDescriptor *desc;
+    int uv_height;
+
     if (!ctx->sws_uv_scale) {
         av_assert0(in->height == out->height && in->width == out->width);
-        const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(in->format);
-        int uv_height = AV_CEIL_RSHIFT(in->height, desc->log2_chroma_h);
+        desc = av_pix_fmt_desc_get(in->format);
+        uv_height = AV_CEIL_RSHIFT(in->height, desc->log2_chroma_h);
         for (int i = 1; i < 3; ++i) {
             int bytewidth = av_image_get_linesize(in->format, in->width, i);
             av_image_copy_plane(out->data[i], out->linesize[i],