Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Philip Langdale <philipl@overt.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Philip Langdale <philipl@overt.org>
Subject: [FFmpeg-devel] [PATCH] avfilter/vf_yadif_cuda: remove unnecessary private struct fields
Date: Wed, 14 Jun 2023 20:04:35 -0700
Message-ID: <20230615030436.358664-1-philipl@overt.org> (raw)

I'm not sure why I originally did this, but there's no good reason to
put pointers to the cuda context and stream in the priv struct. They
are directly available in the device context that is already being
stored there.

Signed-off-by: Philip Langdale <philipl@overt.org>
---
 libavfilter/vf_yadif_cuda.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/libavfilter/vf_yadif_cuda.c b/libavfilter/vf_yadif_cuda.c
index b5ff84e11a..d777757e65 100644
--- a/libavfilter/vf_yadif_cuda.c
+++ b/libavfilter/vf_yadif_cuda.c
@@ -38,8 +38,6 @@ typedef struct DeintCUDAContext {
     AVBufferRef         *input_frames_ref;
     AVHWFramesContext   *input_frames;
 
-    CUcontext   cu_ctx;
-    CUstream    stream;
     CUmodule    cu_module;
     CUfunction  cu_func_uchar;
     CUfunction  cu_func_uchar2;
@@ -109,7 +107,7 @@ static CUresult call_kernel(AVFilterContext *ctx, CUfunction func,
     ret = CHECK_CU(cu->cuLaunchKernel(func,
                                       DIV_UP(dst_width, BLOCKX), DIV_UP(dst_height, BLOCKY), 1,
                                       BLOCKX, BLOCKY, 1,
-                                      0, s->stream, args, NULL));
+                                      0, s->hwctx->stream, args, NULL));
 
 exit:
     if (tex_prev)
@@ -131,7 +129,7 @@ static void filter(AVFilterContext *ctx, AVFrame *dst,
     CUcontext dummy;
     int i, ret;
 
-    ret = CHECK_CU(cu->cuCtxPushCurrent(s->cu_ctx));
+    ret = CHECK_CU(cu->cuCtxPushCurrent(s->hwctx->cuda_ctx));
     if (ret < 0)
         return;
 
@@ -197,7 +195,7 @@ static av_cold void deint_cuda_uninit(AVFilterContext *ctx)
 
     if (s->hwctx && s->cu_module) {
         CudaFunctions *cu = s->hwctx->internal->cuda_dl;
-        CHECK_CU(cu->cuCtxPushCurrent(s->cu_ctx));
+        CHECK_CU(cu->cuCtxPushCurrent(s->hwctx->cuda_ctx));
         CHECK_CU(cu->cuModuleUnload(s->cu_module));
         CHECK_CU(cu->cuCtxPopCurrent(&dummy));
     }
@@ -253,8 +251,6 @@ static int config_output(AVFilterLink *link)
         return AVERROR(ENOMEM);
     }
     s->hwctx = ((AVHWDeviceContext*)s->device_ref->data)->hwctx;
-    s->cu_ctx = s->hwctx->cuda_ctx;
-    s->stream = s->hwctx->stream;
     cu = s->hwctx->internal->cuda_dl;
 
     link->hw_frames_ctx = av_hwframe_ctx_alloc(s->device_ref);
@@ -310,7 +306,7 @@ static int config_output(AVFilterLink *link)
     y->csp = av_pix_fmt_desc_get(output_frames->sw_format);
     y->filter = filter;
 
-    ret = CHECK_CU(cu->cuCtxPushCurrent(s->cu_ctx));
+    ret = CHECK_CU(cu->cuCtxPushCurrent(s->hwctx->cuda_ctx));
     if (ret < 0)
         goto exit;
 
-- 
2.39.2

_______________________________________________
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".

             reply	other threads:[~2023-06-15  3:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15  3:04 Philip Langdale [this message]
2023-06-15  3:04 ` [FFmpeg-devel] [PATCH v3] avfilter/vf_bwdif_cuda: CUDA accelerated bwdif deinterlacer Philip Langdale
2023-06-15 19:35 ` [FFmpeg-devel] [PATCH] avfilter/vf_yadif_cuda: remove unnecessary private struct fields Philip Langdale

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230615030436.358664-1-philipl@overt.org \
    --to=philipl@overt.org \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git