* [FFmpeg-devel] [PATCH v2 1/2] lavc/d3d12va: remove unused variables
@ 2024-01-15 2:34 tong1.wu-at-intel.com
2024-01-15 2:34 ` [FFmpeg-devel] [PATCH v2 2/2] d3d12va_av1|h264|hevc|vc1|vp9: input void** for ID3D12Resource_Map tong1.wu-at-intel.com
2024-01-17 6:22 ` [FFmpeg-devel] [PATCH v2 1/2] lavc/d3d12va: remove unused variables Xiang, Haihao
0 siblings, 2 replies; 4+ messages in thread
From: tong1.wu-at-intel.com @ 2024-01-15 2:34 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Tong Wu
From: Tong Wu <tong1.wu@intel.com>
Signed-off-by: Tong Wu <tong1.wu@intel.com>
---
libavcodec/d3d12va_av1.c | 18 +++++-------------
libavcodec/d3d12va_decode.c | 9 ++-------
libavcodec/d3d12va_h264.c | 4 ----
libavcodec/d3d12va_hevc.c | 5 -----
libavcodec/d3d12va_vc1.c | 3 ---
libavcodec/d3d12va_vp9.c | 4 ----
6 files changed, 7 insertions(+), 36 deletions(-)
diff --git a/libavcodec/d3d12va_av1.c b/libavcodec/d3d12va_av1.c
index 6a3543353f..5f96f7da04 100644
--- a/libavcodec/d3d12va_av1.c
+++ b/libavcodec/d3d12va_av1.c
@@ -108,11 +108,8 @@ static int d3d12va_av1_decode_slice(AVCodecContext *avctx,
static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource *buffer)
{
- D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
- AVHWFramesContext *frames_ctx = D3D12VA_FRAMES_CONTEXT(avctx);
- AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx;
- const AV1DecContext *h = avctx->priv_data;
- AV1DecodePictureContext *ctx_pic = h->cur_frame.hwaccel_picture_private;
+ const AV1DecContext *h = avctx->priv_data;
+ AV1DecodePictureContext *ctx_pic = h->cur_frame.hwaccel_picture_private;
uint8_t *mapped_data;
D3D12_VIDEO_DECODE_FRAME_ARGUMENT *args = &input_args->FrameArguments[input_args->NumFrameArguments++];
@@ -142,7 +139,6 @@ static int d3d12va_av1_end_frame(AVCodecContext *avctx)
{
int ret;
const AV1DecContext *h = avctx->priv_data;
- D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
AV1DecodePictureContext *ctx_pic = h->cur_frame.hwaccel_picture_private;
if (ctx_pic->tiles <= 0 || ctx_pic->bitstream_size <= 0)
@@ -156,10 +152,8 @@ static int d3d12va_av1_end_frame(AVCodecContext *avctx)
static int d3d12va_av1_decode_init(AVCodecContext *avctx)
{
- const AV1DecContext *h = avctx->priv_data;
- D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
- D3D12AV1DecodeContext *av1_ctx = D3D12_AV1_DECODE_CONTEXT(avctx);
- AV1DecodePictureContext *ctx_pic = h->cur_frame.hwaccel_picture_private;
+ D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
+ D3D12AV1DecodeContext *av1_ctx = D3D12_AV1_DECODE_CONTEXT(avctx);
DXVA_PicParams_AV1 pp;
int ret;
@@ -186,9 +180,7 @@ static int d3d12va_av1_decode_init(AVCodecContext *avctx)
static int d3d12va_av1_decode_uninit(AVCodecContext *avctx)
{
- const AV1DecContext *h = avctx->priv_data;
- D3D12AV1DecodeContext *ctx = D3D12_AV1_DECODE_CONTEXT(avctx);
- AV1DecodePictureContext *ctx_pic = h->cur_frame.hwaccel_picture_private;
+ D3D12AV1DecodeContext *ctx = D3D12_AV1_DECODE_CONTEXT(avctx);
if (ctx->bitstream_buffer)
av_freep(&ctx->bitstream_buffer);
diff --git a/libavcodec/d3d12va_decode.c b/libavcodec/d3d12va_decode.c
index c5c599675e..ae2f577e25 100644
--- a/libavcodec/d3d12va_decode.c
+++ b/libavcodec/d3d12va_decode.c
@@ -265,8 +265,7 @@ fail:
int ff_d3d12va_common_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
{
- AVHWFramesContext *frames_ctx = (AVHWFramesContext *)hw_frames_ctx->data;
- AVHWDeviceContext *device_ctx = frames_ctx->device_ctx;
+ AVHWFramesContext *frames_ctx = (AVHWFramesContext *)hw_frames_ctx->data;
frames_ctx->format = AV_PIX_FMT_D3D12;
frames_ctx->sw_format = avctx->sw_pix_fmt == AV_PIX_FMT_YUV420P10 ? AV_PIX_FMT_P010 : AV_PIX_FMT_NV12;
@@ -407,9 +406,7 @@ int ff_d3d12va_decode_uninit(AVCodecContext *avctx)
static inline int d3d12va_update_reference_frames_state(AVCodecContext *avctx, D3D12_RESOURCE_BARRIER *barriers,
ID3D12Resource *current_resource, int state_before, int state_end)
{
- D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
- AVHWFramesContext *frames_ctx = D3D12VA_FRAMES_CONTEXT(avctx);
- AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx;
+ D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
int num_barrier = 0;
for (int i = 0; i < ctx->max_num_ref; i++) {
@@ -436,8 +433,6 @@ int ff_d3d12va_common_end_frame(AVCodecContext *avctx, AVFrame *frame,
{
int ret;
D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
- AVHWFramesContext *frames_ctx = D3D12VA_FRAMES_CONTEXT(avctx);
- AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx;
ID3D12Resource *buffer = NULL;
ID3D12CommandAllocator *command_allocator = NULL;
AVD3D12VAFrame *f = (AVD3D12VAFrame *)frame->data[0];
diff --git a/libavcodec/d3d12va_h264.c b/libavcodec/d3d12va_h264.c
index 24e1c523fa..e89c90995c 100644
--- a/libavcodec/d3d12va_h264.c
+++ b/libavcodec/d3d12va_h264.c
@@ -104,10 +104,6 @@ static int d3d12va_h264_decode_slice(AVCodecContext *avctx, const uint8_t *buffe
#define START_CODE_SIZE 3
static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource *buffer)
{
- D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
- AVHWFramesContext *frames_ctx = D3D12VA_FRAMES_CONTEXT(avctx);
- AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx;
-
const H264Context *h = avctx->priv_data;
const H264Picture *current_picture = h->cur_pic_ptr;
H264DecodePictureContext *ctx_pic = current_picture->hwaccel_picture_private;
diff --git a/libavcodec/d3d12va_hevc.c b/libavcodec/d3d12va_hevc.c
index 7e0c295a2d..a6a3b802f9 100644
--- a/libavcodec/d3d12va_hevc.c
+++ b/libavcodec/d3d12va_hevc.c
@@ -98,10 +98,6 @@ static int d3d12va_hevc_decode_slice(AVCodecContext *avctx, const uint8_t *buffe
#define START_CODE_SIZE 3
static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource *buffer)
{
- D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
- AVHWFramesContext *frames_ctx = D3D12VA_FRAMES_CONTEXT(avctx);
- AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx;
-
const HEVCContext *h = avctx->priv_data;
const HEVCFrame *current_picture = h->ref;
HEVCDecodePictureContext *ctx_pic = current_picture->hwaccel_picture_private;
@@ -166,7 +162,6 @@ static int d3d12va_hevc_end_frame(AVCodecContext *avctx)
static int d3d12va_hevc_decode_init(AVCodecContext *avctx)
{
- HEVCContext *h = avctx->priv_data;
D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
DXVA_PicParams_HEVC pp;
diff --git a/libavcodec/d3d12va_vc1.c b/libavcodec/d3d12va_vc1.c
index 3d15abd1f1..b39b03ab45 100644
--- a/libavcodec/d3d12va_vc1.c
+++ b/libavcodec/d3d12va_vc1.c
@@ -95,9 +95,6 @@ static int d3d12va_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer
static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource *buffer)
{
- D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
- AVHWFramesContext *frames_ctx = D3D12VA_FRAMES_CONTEXT(avctx);
- AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx;
const VC1Context *v = avctx->priv_data;
const MpegEncContext *s = &v->s;
D3D12DecodePictureContext *ctx_pic = s->current_picture_ptr->hwaccel_picture_private;
diff --git a/libavcodec/d3d12va_vp9.c b/libavcodec/d3d12va_vp9.c
index d6dfc905d9..5a1cb0187d 100644
--- a/libavcodec/d3d12va_vp9.c
+++ b/libavcodec/d3d12va_vp9.c
@@ -85,10 +85,6 @@ static int d3d12va_vp9_decode_slice(AVCodecContext *avctx, const uint8_t *buffer
static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource *buffer)
{
- D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
- AVHWFramesContext *frames_ctx = D3D12VA_FRAMES_CONTEXT(avctx);
- AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx;
-
const VP9SharedContext *h = avctx->priv_data;
VP9DecodePictureContext *ctx_pic = h->frames[CUR_FRAME].hwaccel_picture_private;
--
2.41.0.windows.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] 4+ messages in thread
* [FFmpeg-devel] [PATCH v2 2/2] d3d12va_av1|h264|hevc|vc1|vp9: input void** for ID3D12Resource_Map
2024-01-15 2:34 [FFmpeg-devel] [PATCH v2 1/2] lavc/d3d12va: remove unused variables tong1.wu-at-intel.com
@ 2024-01-15 2:34 ` tong1.wu-at-intel.com
2024-01-17 6:22 ` [FFmpeg-devel] [PATCH v2 1/2] lavc/d3d12va: remove unused variables Xiang, Haihao
1 sibling, 0 replies; 4+ messages in thread
From: tong1.wu-at-intel.com @ 2024-01-15 2:34 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Tong Wu
From: Tong Wu <tong1.wu@intel.com>
Fixes -Wincompatible-pointer-types warnings.
Signed-off-by: Tong Wu <tong1.wu@intel.com>
---
libavcodec/d3d12va_av1.c | 2 +-
libavcodec/d3d12va_h264.c | 2 +-
libavcodec/d3d12va_hevc.c | 2 +-
libavcodec/d3d12va_vc1.c | 2 +-
libavcodec/d3d12va_vp9.c | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/libavcodec/d3d12va_av1.c b/libavcodec/d3d12va_av1.c
index 5f96f7da04..05cebc3148 100644
--- a/libavcodec/d3d12va_av1.c
+++ b/libavcodec/d3d12va_av1.c
@@ -110,7 +110,7 @@ static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPU
{
const AV1DecContext *h = avctx->priv_data;
AV1DecodePictureContext *ctx_pic = h->cur_frame.hwaccel_picture_private;
- uint8_t *mapped_data;
+ void *mapped_data;
D3D12_VIDEO_DECODE_FRAME_ARGUMENT *args = &input_args->FrameArguments[input_args->NumFrameArguments++];
args->Type = D3D12_VIDEO_DECODE_ARGUMENT_TYPE_SLICE_CONTROL;
diff --git a/libavcodec/d3d12va_h264.c b/libavcodec/d3d12va_h264.c
index e89c90995c..b2fe2955c8 100644
--- a/libavcodec/d3d12va_h264.c
+++ b/libavcodec/d3d12va_h264.c
@@ -113,7 +113,7 @@ static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPU
DXVA_Slice_H264_Short *slice;
D3D12_VIDEO_DECODE_FRAME_ARGUMENT *args;
- if (FAILED(ID3D12Resource_Map(buffer, 0, NULL, &mapped_data))) {
+ if (FAILED(ID3D12Resource_Map(buffer, 0, NULL, (void **)&mapped_data))) {
av_log(avctx, AV_LOG_ERROR, "Failed to map D3D12 Buffer resource!\n");
return AVERROR(EINVAL);
}
diff --git a/libavcodec/d3d12va_hevc.c b/libavcodec/d3d12va_hevc.c
index a6a3b802f9..ca345c845f 100644
--- a/libavcodec/d3d12va_hevc.c
+++ b/libavcodec/d3d12va_hevc.c
@@ -107,7 +107,7 @@ static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPU
DXVA_Slice_HEVC_Short *slice;
D3D12_VIDEO_DECODE_FRAME_ARGUMENT *args;
- if (FAILED(ID3D12Resource_Map(buffer, 0, NULL, &mapped_data))) {
+ if (FAILED(ID3D12Resource_Map(buffer, 0, NULL, (void **)&mapped_data))) {
av_log(avctx, AV_LOG_ERROR, "Failed to map D3D12 Buffer resource!\n");
return AVERROR(EINVAL);
}
diff --git a/libavcodec/d3d12va_vc1.c b/libavcodec/d3d12va_vc1.c
index b39b03ab45..8d8834b1cc 100644
--- a/libavcodec/d3d12va_vc1.c
+++ b/libavcodec/d3d12va_vc1.c
@@ -105,7 +105,7 @@ static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPU
static const uint8_t start_code[] = { 0, 0, 1, 0x0d };
- if (FAILED(ID3D12Resource_Map(buffer, 0, NULL, &mapped_data))) {
+ if (FAILED(ID3D12Resource_Map(buffer, 0, NULL, (void **)&mapped_data))) {
av_log(avctx, AV_LOG_ERROR, "Failed to map D3D12 Buffer resource!\n");
return AVERROR(EINVAL);
}
diff --git a/libavcodec/d3d12va_vp9.c b/libavcodec/d3d12va_vp9.c
index 5a1cb0187d..8c54c97f5b 100644
--- a/libavcodec/d3d12va_vp9.c
+++ b/libavcodec/d3d12va_vp9.c
@@ -88,7 +88,7 @@ static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPU
const VP9SharedContext *h = avctx->priv_data;
VP9DecodePictureContext *ctx_pic = h->frames[CUR_FRAME].hwaccel_picture_private;
- uint8_t *mapped_data;
+ void *mapped_data;
D3D12_VIDEO_DECODE_FRAME_ARGUMENT *args;
if (FAILED(ID3D12Resource_Map(buffer, 0, NULL, &mapped_data))) {
--
2.41.0.windows.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2 1/2] lavc/d3d12va: remove unused variables
2024-01-15 2:34 [FFmpeg-devel] [PATCH v2 1/2] lavc/d3d12va: remove unused variables tong1.wu-at-intel.com
2024-01-15 2:34 ` [FFmpeg-devel] [PATCH v2 2/2] d3d12va_av1|h264|hevc|vc1|vp9: input void** for ID3D12Resource_Map tong1.wu-at-intel.com
@ 2024-01-17 6:22 ` Xiang, Haihao
2024-01-24 7:13 ` Xiang, Haihao
1 sibling, 1 reply; 4+ messages in thread
From: Xiang, Haihao @ 2024-01-17 6:22 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Wu, Tong1
On Ma, 2024-01-15 at 10:34 +0800, tong1.wu-at-intel.com@ffmpeg.org wrote:
> From: Tong Wu <tong1.wu@intel.com>
>
> Signed-off-by: Tong Wu <tong1.wu@intel.com>
> ---
> libavcodec/d3d12va_av1.c | 18 +++++-------------
> libavcodec/d3d12va_decode.c | 9 ++-------
> libavcodec/d3d12va_h264.c | 4 ----
> libavcodec/d3d12va_hevc.c | 5 -----
> libavcodec/d3d12va_vc1.c | 3 ---
> libavcodec/d3d12va_vp9.c | 4 ----
> 6 files changed, 7 insertions(+), 36 deletions(-)
>
> diff --git a/libavcodec/d3d12va_av1.c b/libavcodec/d3d12va_av1.c
> index 6a3543353f..5f96f7da04 100644
> --- a/libavcodec/d3d12va_av1.c
> +++ b/libavcodec/d3d12va_av1.c
> @@ -108,11 +108,8 @@ static int d3d12va_av1_decode_slice(AVCodecContext
> *avctx,
>
> static int update_input_arguments(AVCodecContext *avctx,
> D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource *buffer)
> {
> - D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
> - AVHWFramesContext *frames_ctx = D3D12VA_FRAMES_CONTEXT(avctx);
> - AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx;
> - const AV1DecContext *h = avctx->priv_data;
> - AV1DecodePictureContext *ctx_pic = h-
> >cur_frame.hwaccel_picture_private;
> + const AV1DecContext *h = avctx->priv_data;
> + AV1DecodePictureContext *ctx_pic = h->cur_frame.hwaccel_picture_private;
> uint8_t *mapped_data;
>
> D3D12_VIDEO_DECODE_FRAME_ARGUMENT *args = &input_args-
> >FrameArguments[input_args->NumFrameArguments++];
> @@ -142,7 +139,6 @@ static int d3d12va_av1_end_frame(AVCodecContext *avctx)
> {
> int ret;
> const AV1DecContext *h = avctx->priv_data;
> - D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
> AV1DecodePictureContext *ctx_pic = h->cur_frame.hwaccel_picture_private;
>
> if (ctx_pic->tiles <= 0 || ctx_pic->bitstream_size <= 0)
> @@ -156,10 +152,8 @@ static int d3d12va_av1_end_frame(AVCodecContext *avctx)
>
> static int d3d12va_av1_decode_init(AVCodecContext *avctx)
> {
> - const AV1DecContext *h = avctx->priv_data;
> - D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
> - D3D12AV1DecodeContext *av1_ctx = D3D12_AV1_DECODE_CONTEXT(avctx);
> - AV1DecodePictureContext *ctx_pic = h->cur_frame.hwaccel_picture_private;
> + D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
> + D3D12AV1DecodeContext *av1_ctx = D3D12_AV1_DECODE_CONTEXT(avctx);
> DXVA_PicParams_AV1 pp;
>
> int ret;
> @@ -186,9 +180,7 @@ static int d3d12va_av1_decode_init(AVCodecContext *avctx)
>
> static int d3d12va_av1_decode_uninit(AVCodecContext *avctx)
> {
> - const AV1DecContext *h = avctx->priv_data;
> - D3D12AV1DecodeContext *ctx = D3D12_AV1_DECODE_CONTEXT(avctx);
> - AV1DecodePictureContext *ctx_pic = h->cur_frame.hwaccel_picture_private;
> + D3D12AV1DecodeContext *ctx = D3D12_AV1_DECODE_CONTEXT(avctx);
>
> if (ctx->bitstream_buffer)
> av_freep(&ctx->bitstream_buffer);
> diff --git a/libavcodec/d3d12va_decode.c b/libavcodec/d3d12va_decode.c
> index c5c599675e..ae2f577e25 100644
> --- a/libavcodec/d3d12va_decode.c
> +++ b/libavcodec/d3d12va_decode.c
> @@ -265,8 +265,7 @@ fail:
>
> int ff_d3d12va_common_frame_params(AVCodecContext *avctx, AVBufferRef
> *hw_frames_ctx)
> {
> - AVHWFramesContext *frames_ctx = (AVHWFramesContext
> *)hw_frames_ctx->data;
> - AVHWDeviceContext *device_ctx = frames_ctx->device_ctx;
> + AVHWFramesContext *frames_ctx = (AVHWFramesContext *)hw_frames_ctx->data;
>
> frames_ctx->format = AV_PIX_FMT_D3D12;
> frames_ctx->sw_format = avctx->sw_pix_fmt == AV_PIX_FMT_YUV420P10 ?
> AV_PIX_FMT_P010 : AV_PIX_FMT_NV12;
> @@ -407,9 +406,7 @@ int ff_d3d12va_decode_uninit(AVCodecContext *avctx)
> static inline int d3d12va_update_reference_frames_state(AVCodecContext
> *avctx, D3D12_RESOURCE_BARRIER *barriers,
> ID3D12Resource
> *current_resource, int state_before, int state_end)
> {
> - D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
> - AVHWFramesContext *frames_ctx = D3D12VA_FRAMES_CONTEXT(avctx);
> - AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx;
> + D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
>
> int num_barrier = 0;
> for (int i = 0; i < ctx->max_num_ref; i++) {
> @@ -436,8 +433,6 @@ int ff_d3d12va_common_end_frame(AVCodecContext *avctx,
> AVFrame *frame,
> {
> int ret;
> D3D12VADecodeContext *ctx =
> D3D12VA_DECODE_CONTEXT(avctx);
> - AVHWFramesContext *frames_ctx =
> D3D12VA_FRAMES_CONTEXT(avctx);
> - AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx;
> ID3D12Resource *buffer = NULL;
> ID3D12CommandAllocator *command_allocator = NULL;
> AVD3D12VAFrame *f = (AVD3D12VAFrame *)frame-
> >data[0];
> diff --git a/libavcodec/d3d12va_h264.c b/libavcodec/d3d12va_h264.c
> index 24e1c523fa..e89c90995c 100644
> --- a/libavcodec/d3d12va_h264.c
> +++ b/libavcodec/d3d12va_h264.c
> @@ -104,10 +104,6 @@ static int d3d12va_h264_decode_slice(AVCodecContext
> *avctx, const uint8_t *buffe
> #define START_CODE_SIZE 3
> static int update_input_arguments(AVCodecContext *avctx,
> D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource *buffer)
> {
> - D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
> - AVHWFramesContext *frames_ctx = D3D12VA_FRAMES_CONTEXT(avctx);
> - AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx;
> -
> const H264Context *h = avctx->priv_data;
> const H264Picture *current_picture = h->cur_pic_ptr;
> H264DecodePictureContext *ctx_pic = current_picture-
> >hwaccel_picture_private;
> diff --git a/libavcodec/d3d12va_hevc.c b/libavcodec/d3d12va_hevc.c
> index 7e0c295a2d..a6a3b802f9 100644
> --- a/libavcodec/d3d12va_hevc.c
> +++ b/libavcodec/d3d12va_hevc.c
> @@ -98,10 +98,6 @@ static int d3d12va_hevc_decode_slice(AVCodecContext *avctx,
> const uint8_t *buffe
> #define START_CODE_SIZE 3
> static int update_input_arguments(AVCodecContext *avctx,
> D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource *buffer)
> {
> - D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
> - AVHWFramesContext *frames_ctx = D3D12VA_FRAMES_CONTEXT(avctx);
> - AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx;
> -
> const HEVCContext *h = avctx->priv_data;
> const HEVCFrame *current_picture = h->ref;
> HEVCDecodePictureContext *ctx_pic = current_picture-
> >hwaccel_picture_private;
> @@ -166,7 +162,6 @@ static int d3d12va_hevc_end_frame(AVCodecContext *avctx)
>
> static int d3d12va_hevc_decode_init(AVCodecContext *avctx)
> {
> - HEVCContext *h = avctx->priv_data;
> D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
> DXVA_PicParams_HEVC pp;
>
> diff --git a/libavcodec/d3d12va_vc1.c b/libavcodec/d3d12va_vc1.c
> index 3d15abd1f1..b39b03ab45 100644
> --- a/libavcodec/d3d12va_vc1.c
> +++ b/libavcodec/d3d12va_vc1.c
> @@ -95,9 +95,6 @@ static int d3d12va_vc1_decode_slice(AVCodecContext *avctx,
> const uint8_t *buffer
>
> static int update_input_arguments(AVCodecContext *avctx,
> D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource *buffer)
> {
> - D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
> - AVHWFramesContext *frames_ctx = D3D12VA_FRAMES_CONTEXT(avctx);
> - AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx;
> const VC1Context *v = avctx->priv_data;
> const MpegEncContext *s = &v->s;
> D3D12DecodePictureContext *ctx_pic = s->current_picture_ptr-
> >hwaccel_picture_private;
> diff --git a/libavcodec/d3d12va_vp9.c b/libavcodec/d3d12va_vp9.c
> index d6dfc905d9..5a1cb0187d 100644
> --- a/libavcodec/d3d12va_vp9.c
> +++ b/libavcodec/d3d12va_vp9.c
> @@ -85,10 +85,6 @@ static int d3d12va_vp9_decode_slice(AVCodecContext *avctx,
> const uint8_t *buffer
>
> static int update_input_arguments(AVCodecContext *avctx,
> D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource *buffer)
> {
> - D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
> - AVHWFramesContext *frames_ctx = D3D12VA_FRAMES_CONTEXT(avctx);
> - AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx;
> -
> const VP9SharedContext *h = avctx->priv_data;
> VP9DecodePictureContext *ctx_pic = h-
> >frames[CUR_FRAME].hwaccel_picture_private;
>
Patchset LGTM,
Thanks
Haihao
_______________________________________________
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".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2 1/2] lavc/d3d12va: remove unused variables
2024-01-17 6:22 ` [FFmpeg-devel] [PATCH v2 1/2] lavc/d3d12va: remove unused variables Xiang, Haihao
@ 2024-01-24 7:13 ` Xiang, Haihao
0 siblings, 0 replies; 4+ messages in thread
From: Xiang, Haihao @ 2024-01-24 7:13 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Wu, Tong1
On Wo, 2024-01-17 at 06:22 +0000, Xiang, Haihao wrote:
> On Ma, 2024-01-15 at 10:34 +0800, tong1.wu-at-intel.com@ffmpeg.org wrote:
> > From: Tong Wu <tong1.wu@intel.com>
> >
> > Signed-off-by: Tong Wu <tong1.wu@intel.com>
> > ---
> > libavcodec/d3d12va_av1.c | 18 +++++-------------
> > libavcodec/d3d12va_decode.c | 9 ++-------
> > libavcodec/d3d12va_h264.c | 4 ----
> > libavcodec/d3d12va_hevc.c | 5 -----
> > libavcodec/d3d12va_vc1.c | 3 ---
> > libavcodec/d3d12va_vp9.c | 4 ----
> > 6 files changed, 7 insertions(+), 36 deletions(-)
> >
> > diff --git a/libavcodec/d3d12va_av1.c b/libavcodec/d3d12va_av1.c
> > index 6a3543353f..5f96f7da04 100644
> > --- a/libavcodec/d3d12va_av1.c
> > +++ b/libavcodec/d3d12va_av1.c
> > @@ -108,11 +108,8 @@ static int d3d12va_av1_decode_slice(AVCodecContext
> > *avctx,
> >
> > static int update_input_arguments(AVCodecContext *avctx,
> > D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource
> > *buffer)
> > {
> > - D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
> > - AVHWFramesContext *frames_ctx = D3D12VA_FRAMES_CONTEXT(avctx);
> > - AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx;
> > - const AV1DecContext *h = avctx->priv_data;
> > - AV1DecodePictureContext *ctx_pic = h-
> > > cur_frame.hwaccel_picture_private;
> > + const AV1DecContext *h = avctx->priv_data;
> > + AV1DecodePictureContext *ctx_pic = h-
> > >cur_frame.hwaccel_picture_private;
> > uint8_t *mapped_data;
> >
> > D3D12_VIDEO_DECODE_FRAME_ARGUMENT *args = &input_args-
> > > FrameArguments[input_args->NumFrameArguments++];
> > @@ -142,7 +139,6 @@ static int d3d12va_av1_end_frame(AVCodecContext *avctx)
> > {
> > int ret;
> > const AV1DecContext *h = avctx->priv_data;
> > - D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
> > AV1DecodePictureContext *ctx_pic = h-
> > >cur_frame.hwaccel_picture_private;
> >
> > if (ctx_pic->tiles <= 0 || ctx_pic->bitstream_size <= 0)
> > @@ -156,10 +152,8 @@ static int d3d12va_av1_end_frame(AVCodecContext *avctx)
> >
> > static int d3d12va_av1_decode_init(AVCodecContext *avctx)
> > {
> > - const AV1DecContext *h = avctx->priv_data;
> > - D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
> > - D3D12AV1DecodeContext *av1_ctx = D3D12_AV1_DECODE_CONTEXT(avctx);
> > - AV1DecodePictureContext *ctx_pic = h-
> > >cur_frame.hwaccel_picture_private;
> > + D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
> > + D3D12AV1DecodeContext *av1_ctx = D3D12_AV1_DECODE_CONTEXT(avctx);
> > DXVA_PicParams_AV1 pp;
> >
> > int ret;
> > @@ -186,9 +180,7 @@ static int d3d12va_av1_decode_init(AVCodecContext
> > *avctx)
> >
> > static int d3d12va_av1_decode_uninit(AVCodecContext *avctx)
> > {
> > - const AV1DecContext *h = avctx->priv_data;
> > - D3D12AV1DecodeContext *ctx = D3D12_AV1_DECODE_CONTEXT(avctx);
> > - AV1DecodePictureContext *ctx_pic = h-
> > >cur_frame.hwaccel_picture_private;
> > + D3D12AV1DecodeContext *ctx = D3D12_AV1_DECODE_CONTEXT(avctx);
> >
> > if (ctx->bitstream_buffer)
> > av_freep(&ctx->bitstream_buffer);
> > diff --git a/libavcodec/d3d12va_decode.c b/libavcodec/d3d12va_decode.c
> > index c5c599675e..ae2f577e25 100644
> > --- a/libavcodec/d3d12va_decode.c
> > +++ b/libavcodec/d3d12va_decode.c
> > @@ -265,8 +265,7 @@ fail:
> >
> > int ff_d3d12va_common_frame_params(AVCodecContext *avctx, AVBufferRef
> > *hw_frames_ctx)
> > {
> > - AVHWFramesContext *frames_ctx = (AVHWFramesContext
> > *)hw_frames_ctx->data;
> > - AVHWDeviceContext *device_ctx = frames_ctx->device_ctx;
> > + AVHWFramesContext *frames_ctx = (AVHWFramesContext *)hw_frames_ctx-
> > >data;
> >
> > frames_ctx->format = AV_PIX_FMT_D3D12;
> > frames_ctx->sw_format = avctx->sw_pix_fmt == AV_PIX_FMT_YUV420P10 ?
> > AV_PIX_FMT_P010 : AV_PIX_FMT_NV12;
> > @@ -407,9 +406,7 @@ int ff_d3d12va_decode_uninit(AVCodecContext *avctx)
> > static inline int d3d12va_update_reference_frames_state(AVCodecContext
> > *avctx, D3D12_RESOURCE_BARRIER *barriers,
> > ID3D12Resource
> > *current_resource, int state_before, int state_end)
> > {
> > - D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
> > - AVHWFramesContext *frames_ctx = D3D12VA_FRAMES_CONTEXT(avctx);
> > - AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx;
> > + D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
> >
> > int num_barrier = 0;
> > for (int i = 0; i < ctx->max_num_ref; i++) {
> > @@ -436,8 +433,6 @@ int ff_d3d12va_common_end_frame(AVCodecContext *avctx,
> > AVFrame *frame,
> > {
> > int ret;
> > D3D12VADecodeContext *ctx =
> > D3D12VA_DECODE_CONTEXT(avctx);
> > - AVHWFramesContext *frames_ctx =
> > D3D12VA_FRAMES_CONTEXT(avctx);
> > - AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx;
> > ID3D12Resource *buffer = NULL;
> > ID3D12CommandAllocator *command_allocator = NULL;
> > AVD3D12VAFrame *f = (AVD3D12VAFrame *)frame-
> > > data[0];
> > diff --git a/libavcodec/d3d12va_h264.c b/libavcodec/d3d12va_h264.c
> > index 24e1c523fa..e89c90995c 100644
> > --- a/libavcodec/d3d12va_h264.c
> > +++ b/libavcodec/d3d12va_h264.c
> > @@ -104,10 +104,6 @@ static int d3d12va_h264_decode_slice(AVCodecContext
> > *avctx, const uint8_t *buffe
> > #define START_CODE_SIZE 3
> > static int update_input_arguments(AVCodecContext *avctx,
> > D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource
> > *buffer)
> > {
> > - D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
> > - AVHWFramesContext *frames_ctx = D3D12VA_FRAMES_CONTEXT(avctx);
> > - AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx;
> > -
> > const H264Context *h = avctx->priv_data;
> > const H264Picture *current_picture = h->cur_pic_ptr;
> > H264DecodePictureContext *ctx_pic = current_picture-
> > > hwaccel_picture_private;
> > diff --git a/libavcodec/d3d12va_hevc.c b/libavcodec/d3d12va_hevc.c
> > index 7e0c295a2d..a6a3b802f9 100644
> > --- a/libavcodec/d3d12va_hevc.c
> > +++ b/libavcodec/d3d12va_hevc.c
> > @@ -98,10 +98,6 @@ static int d3d12va_hevc_decode_slice(AVCodecContext
> > *avctx,
> > const uint8_t *buffe
> > #define START_CODE_SIZE 3
> > static int update_input_arguments(AVCodecContext *avctx,
> > D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource
> > *buffer)
> > {
> > - D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
> > - AVHWFramesContext *frames_ctx = D3D12VA_FRAMES_CONTEXT(avctx);
> > - AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx;
> > -
> > const HEVCContext *h = avctx->priv_data;
> > const HEVCFrame *current_picture = h->ref;
> > HEVCDecodePictureContext *ctx_pic = current_picture-
> > > hwaccel_picture_private;
> > @@ -166,7 +162,6 @@ static int d3d12va_hevc_end_frame(AVCodecContext *avctx)
> >
> > static int d3d12va_hevc_decode_init(AVCodecContext *avctx)
> > {
> > - HEVCContext *h = avctx->priv_data;
> > D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
> > DXVA_PicParams_HEVC pp;
> >
> > diff --git a/libavcodec/d3d12va_vc1.c b/libavcodec/d3d12va_vc1.c
> > index 3d15abd1f1..b39b03ab45 100644
> > --- a/libavcodec/d3d12va_vc1.c
> > +++ b/libavcodec/d3d12va_vc1.c
> > @@ -95,9 +95,6 @@ static int d3d12va_vc1_decode_slice(AVCodecContext *avctx,
> > const uint8_t *buffer
> >
> > static int update_input_arguments(AVCodecContext *avctx,
> > D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource
> > *buffer)
> > {
> > - D3D12VADecodeContext *ctx =
> > D3D12VA_DECODE_CONTEXT(avctx);
> > - AVHWFramesContext *frames_ctx =
> > D3D12VA_FRAMES_CONTEXT(avctx);
> > - AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx;
> > const VC1Context *v = avctx->priv_data;
> > const MpegEncContext *s = &v->s;
> > D3D12DecodePictureContext *ctx_pic = s->current_picture_ptr-
> > > hwaccel_picture_private;
> > diff --git a/libavcodec/d3d12va_vp9.c b/libavcodec/d3d12va_vp9.c
> > index d6dfc905d9..5a1cb0187d 100644
> > --- a/libavcodec/d3d12va_vp9.c
> > +++ b/libavcodec/d3d12va_vp9.c
> > @@ -85,10 +85,6 @@ static int d3d12va_vp9_decode_slice(AVCodecContext
> > *avctx,
> > const uint8_t *buffer
> >
> > static int update_input_arguments(AVCodecContext *avctx,
> > D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource
> > *buffer)
> > {
> > - D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
> > - AVHWFramesContext *frames_ctx = D3D12VA_FRAMES_CONTEXT(avctx);
> > - AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx;
> > -
> > const VP9SharedContext *h = avctx->priv_data;
> > VP9DecodePictureContext *ctx_pic = h-
> > > frames[CUR_FRAME].hwaccel_picture_private;
> >
>
> Patchset LGTM,
Will apply,
-Haihao
_______________________________________________
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".
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-01-24 7:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-15 2:34 [FFmpeg-devel] [PATCH v2 1/2] lavc/d3d12va: remove unused variables tong1.wu-at-intel.com
2024-01-15 2:34 ` [FFmpeg-devel] [PATCH v2 2/2] d3d12va_av1|h264|hevc|vc1|vp9: input void** for ID3D12Resource_Map tong1.wu-at-intel.com
2024-01-17 6:22 ` [FFmpeg-devel] [PATCH v2 1/2] lavc/d3d12va: remove unused variables Xiang, Haihao
2024-01-24 7:13 ` Xiang, Haihao
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