* [FFmpeg-devel] [PATCH 1/5] avcodec/d3d12va_vp9: fix vp9 max_num_refs value @ 2023-12-25 14:18 Tong Wu 2023-12-25 14:18 ` [FFmpeg-devel] [PATCH 2/5] avcodec/d3d12va_decode: delete an empty line and fix a fuction alignment Tong Wu ` (4 more replies) 0 siblings, 5 replies; 8+ messages in thread From: Tong Wu @ 2023-12-25 14:18 UTC (permalink / raw) To: ffmpeg-devel; +Cc: Tong Wu Previous max_num_refs was based on pp.frame_refs plus 1 and it could possibly reaches the size limit. Actually it should be the size of pp.ref_frame_map plus 1. Signed-off-by: Tong Wu <tong1.wu@intel.com> --- libavcodec/d3d12va_vp9.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/d3d12va_vp9.c b/libavcodec/d3d12va_vp9.c index bb94e18781..d6dfc905d9 100644 --- a/libavcodec/d3d12va_vp9.c +++ b/libavcodec/d3d12va_vp9.c @@ -148,7 +148,7 @@ static int d3d12va_vp9_decode_init(AVCodecContext *avctx) break; }; - ctx->max_num_ref = FF_ARRAY_ELEMS(pp.frame_refs) + 1; + ctx->max_num_ref = FF_ARRAY_ELEMS(pp.ref_frame_map) + 1; return ff_d3d12va_decode_init(avctx); } -- 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] 8+ messages in thread
* [FFmpeg-devel] [PATCH 2/5] avcodec/d3d12va_decode: delete an empty line and fix a fuction alignment 2023-12-25 14:18 [FFmpeg-devel] [PATCH 1/5] avcodec/d3d12va_vp9: fix vp9 max_num_refs value Tong Wu @ 2023-12-25 14:18 ` Tong Wu 2023-12-25 14:18 ` [FFmpeg-devel] [PATCH 3/5] avcodec/d3d12va_h264: replace assert with av_assert0 Tong Wu ` (3 subsequent siblings) 4 siblings, 0 replies; 8+ messages in thread From: Tong Wu @ 2023-12-25 14:18 UTC (permalink / raw) To: ffmpeg-devel; +Cc: Tong Wu Signed-off-by: Tong Wu <tong1.wu@intel.com> --- libavcodec/d3d12va_decode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/d3d12va_decode.c b/libavcodec/d3d12va_decode.c index e0b67bf964..50d5b8d601 100644 --- a/libavcodec/d3d12va_decode.c +++ b/libavcodec/d3d12va_decode.c @@ -324,11 +324,10 @@ int ff_d3d12va_decode_init(AVCodecContext *avctx) return AVERROR(ENOMEM); ctx->objects_queue = av_fifo_alloc2(D3D12VA_VIDEO_DEC_ASYNC_DEPTH, - sizeof(HelperObjects), AV_FIFO_FLAG_AUTO_GROW); + sizeof(HelperObjects), AV_FIFO_FLAG_AUTO_GROW); if (!ctx->objects_queue) return AVERROR(ENOMEM); - DX_CHECK(ID3D12Device_CreateFence(ctx->device_ctx->device, 0, D3D12_FENCE_FLAG_NONE, &IID_ID3D12Fence, (void **)&ctx->sync_ctx.fence)); -- 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] 8+ messages in thread
* [FFmpeg-devel] [PATCH 3/5] avcodec/d3d12va_h264: replace assert with av_assert0 2023-12-25 14:18 [FFmpeg-devel] [PATCH 1/5] avcodec/d3d12va_vp9: fix vp9 max_num_refs value Tong Wu 2023-12-25 14:18 ` [FFmpeg-devel] [PATCH 2/5] avcodec/d3d12va_decode: delete an empty line and fix a fuction alignment Tong Wu @ 2023-12-25 14:18 ` Tong Wu 2023-12-25 14:18 ` [FFmpeg-devel] [PATCH 4/5] avcodec/d3d12va_decode: remove assertion from get_surface_index Tong Wu ` (2 subsequent siblings) 4 siblings, 0 replies; 8+ messages in thread From: Tong Wu @ 2023-12-25 14:18 UTC (permalink / raw) To: ffmpeg-devel; +Cc: Tong Wu Signed-off-by: Tong Wu <tong1.wu@intel.com> --- libavcodec/d3d12va_h264.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/d3d12va_h264.c b/libavcodec/d3d12va_h264.c index 5a6d6852c8..24e1c523fa 100644 --- a/libavcodec/d3d12va_h264.c +++ b/libavcodec/d3d12va_h264.c @@ -60,7 +60,7 @@ static int d3d12va_h264_start_frame(AVCodecContext *avctx, if (!ctx) return -1; - assert(ctx_pic); + av_assert0(ctx_pic); ctx->used_mask = 0; -- 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] 8+ messages in thread
* [FFmpeg-devel] [PATCH 4/5] avcodec/d3d12va_decode: remove assertion from get_surface_index 2023-12-25 14:18 [FFmpeg-devel] [PATCH 1/5] avcodec/d3d12va_vp9: fix vp9 max_num_refs value Tong Wu 2023-12-25 14:18 ` [FFmpeg-devel] [PATCH 2/5] avcodec/d3d12va_decode: delete an empty line and fix a fuction alignment Tong Wu 2023-12-25 14:18 ` [FFmpeg-devel] [PATCH 3/5] avcodec/d3d12va_h264: replace assert with av_assert0 Tong Wu @ 2023-12-25 14:18 ` Tong Wu 2023-12-27 5:42 ` Xiang, Haihao 2023-12-25 14:18 ` [FFmpeg-devel] [PATCH 5/5] avcodec/dxva2(h264|mpeg2|vc1): use av_assert0 instead of assert Tong Wu 2023-12-25 14:47 ` [FFmpeg-devel] 回复: [PATCH 1/5] avcodec/d3d12va_vp9: fix vp9 max_num_refs value Wu Jianhua 4 siblings, 1 reply; 8+ messages in thread From: Tong Wu @ 2023-12-25 14:18 UTC (permalink / raw) To: ffmpeg-devel; +Cc: Tong Wu Return zero for failed case and avoid aborting the program. Signed-off-by: Tong Wu <tong1.wu@intel.com> --- libavcodec/d3d12va_decode.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/d3d12va_decode.c b/libavcodec/d3d12va_decode.c index 50d5b8d601..20dc485284 100644 --- a/libavcodec/d3d12va_decode.c +++ b/libavcodec/d3d12va_decode.c @@ -20,7 +20,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <assert.h> #include <string.h> #include <initguid.h> @@ -80,7 +79,6 @@ unsigned ff_d3d12va_get_surface_index(const AVCodecContext *avctx, } fail: - assert(0); return 0; } -- 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] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH 4/5] avcodec/d3d12va_decode: remove assertion from get_surface_index 2023-12-25 14:18 ` [FFmpeg-devel] [PATCH 4/5] avcodec/d3d12va_decode: remove assertion from get_surface_index Tong Wu @ 2023-12-27 5:42 ` Xiang, Haihao 0 siblings, 0 replies; 8+ messages in thread From: Xiang, Haihao @ 2023-12-27 5:42 UTC (permalink / raw) To: ffmpeg-devel; +Cc: Wu, Tong1 On Ma, 2023-12-25 at 22:18 +0800, Tong Wu wrote: > Return zero for failed case and avoid aborting the program. > > Signed-off-by: Tong Wu <tong1.wu@intel.com> > --- > libavcodec/d3d12va_decode.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/libavcodec/d3d12va_decode.c b/libavcodec/d3d12va_decode.c > index 50d5b8d601..20dc485284 100644 > --- a/libavcodec/d3d12va_decode.c > +++ b/libavcodec/d3d12va_decode.c > @@ -20,7 +20,6 @@ > * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 > USA > */ > > -#include <assert.h> > #include <string.h> > #include <initguid.h> > > @@ -80,7 +79,6 @@ unsigned ff_d3d12va_get_surface_index(const AVCodecContext > *avctx, > } > > fail: > - assert(0); Something is wrong if arriving here, could you add a warning message ? Thanks Haihao > return 0; > } > _______________________________________________ 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] 8+ messages in thread
* [FFmpeg-devel] [PATCH 5/5] avcodec/dxva2(h264|mpeg2|vc1): use av_assert0 instead of assert 2023-12-25 14:18 [FFmpeg-devel] [PATCH 1/5] avcodec/d3d12va_vp9: fix vp9 max_num_refs value Tong Wu ` (2 preceding siblings ...) 2023-12-25 14:18 ` [FFmpeg-devel] [PATCH 4/5] avcodec/d3d12va_decode: remove assertion from get_surface_index Tong Wu @ 2023-12-25 14:18 ` Tong Wu 2023-12-27 5:45 ` Xiang, Haihao 2023-12-25 14:47 ` [FFmpeg-devel] 回复: [PATCH 1/5] avcodec/d3d12va_vp9: fix vp9 max_num_refs value Wu Jianhua 4 siblings, 1 reply; 8+ messages in thread From: Tong Wu @ 2023-12-25 14:18 UTC (permalink / raw) To: ffmpeg-devel; +Cc: Tong Wu Signed-off-by: Tong Wu <tong1.wu@intel.com> --- libavcodec/dxva2.c | 6 +++--- libavcodec/dxva2_h264.c | 16 ++++++++-------- libavcodec/dxva2_mpeg2.c | 2 +- libavcodec/dxva2_vc1.c | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c index 7160a0008b..c60393a60b 100644 --- a/libavcodec/dxva2.c +++ b/libavcodec/dxva2.c @@ -20,10 +20,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <assert.h> #include <string.h> #include <initguid.h> +#include "libavutil/avassert.h" #include "libavutil/common.h" #include "libavutil/log.h" #include "libavutil/time.h" @@ -795,7 +795,7 @@ unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx, } #endif - assert(0); + av_assert0(0); return 0; } @@ -1012,7 +1012,7 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, AVFrame *frame, /* TODO Film Grain when possible */ - assert(buffer_count == 1 + (qm_size > 0) + 2); + av_assert0(buffer_count == 1 + (qm_size > 0) + 2); #if CONFIG_D3D11VA if (ff_dxva2_is_d3d11(avctx)) diff --git a/libavcodec/dxva2_h264.c b/libavcodec/dxva2_h264.c index e0ec4878a7..0fe4152625 100644 --- a/libavcodec/dxva2_h264.c +++ b/libavcodec/dxva2_h264.c @@ -44,7 +44,7 @@ struct dxva2_picture_context { static void fill_picture_entry(DXVA_PicEntry_H264 *pic, unsigned index, unsigned flag) { - assert((index&0x7f) == index && (flag&0x01) == flag); + av_assert0((index&0x7f) == index && (flag&0x01) == flag); pic->bPicEntry = index | (flag << 7); } @@ -194,8 +194,8 @@ void ff_dxva2_h264_fill_scaling_lists(const AVCodecContext *avctx, AVDXVAContext static int is_slice_short(const AVCodecContext *avctx, AVDXVAContext *ctx) { - assert(DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) == 1 || - DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) == 2); + av_assert0(DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) == 1 || + DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) == 2); return DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) == 2; } @@ -348,10 +348,10 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, static const unsigned start_code_size = sizeof(start_code); unsigned position, size; - assert(offsetof(DXVA_Slice_H264_Short, BSNALunitDataLocation) == - offsetof(DXVA_Slice_H264_Long, BSNALunitDataLocation)); - assert(offsetof(DXVA_Slice_H264_Short, SliceBytesInBuffer) == - offsetof(DXVA_Slice_H264_Long, SliceBytesInBuffer)); + av_assert0(offsetof(DXVA_Slice_H264_Short, BSNALunitDataLocation) == + offsetof(DXVA_Slice_H264_Long, BSNALunitDataLocation)); + av_assert0(offsetof(DXVA_Slice_H264_Short, SliceBytesInBuffer) == + offsetof(DXVA_Slice_H264_Long, SliceBytesInBuffer)); if (is_slice_short(avctx, ctx)) slice = &ctx_pic->slice_short[i]; @@ -453,7 +453,7 @@ static int dxva2_h264_start_frame(AVCodecContext *avctx, if (!DXVA_CONTEXT_VALID(avctx, ctx)) return -1; - assert(ctx_pic); + av_assert0(ctx_pic); /* Fill up DXVA_PicParams_H264 */ ff_dxva2_h264_fill_picture_parameters(avctx, ctx, &ctx_pic->pp); diff --git a/libavcodec/dxva2_mpeg2.c b/libavcodec/dxva2_mpeg2.c index 4c9ed1d761..d31a8bb872 100644 --- a/libavcodec/dxva2_mpeg2.c +++ b/libavcodec/dxva2_mpeg2.c @@ -264,7 +264,7 @@ static int dxva2_mpeg2_start_frame(AVCodecContext *avctx, if (!DXVA_CONTEXT_VALID(avctx, ctx)) return -1; - assert(ctx_pic); + av_assert0(ctx_pic); ff_dxva2_mpeg2_fill_picture_parameters(avctx, ctx, &ctx_pic->pp); ff_dxva2_mpeg2_fill_quantization_matrices(avctx, ctx, &ctx_pic->qm); diff --git a/libavcodec/dxva2_vc1.c b/libavcodec/dxva2_vc1.c index 2b1b3f97ea..f7513b2b15 100644 --- a/libavcodec/dxva2_vc1.c +++ b/libavcodec/dxva2_vc1.c @@ -321,7 +321,7 @@ static int dxva2_vc1_start_frame(AVCodecContext *avctx, if (!DXVA_CONTEXT_VALID(avctx, ctx)) return -1; - assert(ctx_pic); + av_assert0(ctx_pic); ff_dxva2_vc1_fill_picture_parameters(avctx, ctx, &ctx_pic->pp); -- 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] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH 5/5] avcodec/dxva2(h264|mpeg2|vc1): use av_assert0 instead of assert 2023-12-25 14:18 ` [FFmpeg-devel] [PATCH 5/5] avcodec/dxva2(h264|mpeg2|vc1): use av_assert0 instead of assert Tong Wu @ 2023-12-27 5:45 ` Xiang, Haihao 0 siblings, 0 replies; 8+ messages in thread From: Xiang, Haihao @ 2023-12-27 5:45 UTC (permalink / raw) To: ffmpeg-devel; +Cc: Wu, Tong1 On Ma, 2023-12-25 at 22:18 +0800, Tong Wu wrote: > Signed-off-by: Tong Wu <tong1.wu@intel.com> > --- > libavcodec/dxva2.c | 6 +++--- > libavcodec/dxva2_h264.c | 16 ++++++++-------- > libavcodec/dxva2_mpeg2.c | 2 +- > libavcodec/dxva2_vc1.c | 2 +- > 4 files changed, 13 insertions(+), 13 deletions(-) > > diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c > index 7160a0008b..c60393a60b 100644 > --- a/libavcodec/dxva2.c > +++ b/libavcodec/dxva2.c > @@ -20,10 +20,10 @@ > * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 > USA > */ > > -#include <assert.h> > #include <string.h> > #include <initguid.h> > > +#include "libavutil/avassert.h" > #include "libavutil/common.h" > #include "libavutil/log.h" > #include "libavutil/time.h" > @@ -795,7 +795,7 @@ unsigned ff_dxva2_get_surface_index(const AVCodecContext > *avctx, > } > #endif > > - assert(0); > + av_assert0(0); The assertion in ff_d3d12va_get_surface_index() was removed in patch 4/5, could you remove this assertion too ? Thanks Haihao > return 0; > } > > @@ -1012,7 +1012,7 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, > AVFrame *frame, > > /* TODO Film Grain when possible */ > > - assert(buffer_count == 1 + (qm_size > 0) + 2); > + av_assert0(buffer_count == 1 + (qm_size > 0) + 2); > > #if CONFIG_D3D11VA > if (ff_dxva2_is_d3d11(avctx)) > diff --git a/libavcodec/dxva2_h264.c b/libavcodec/dxva2_h264.c > index e0ec4878a7..0fe4152625 100644 > --- a/libavcodec/dxva2_h264.c > +++ b/libavcodec/dxva2_h264.c > @@ -44,7 +44,7 @@ struct dxva2_picture_context { > static void fill_picture_entry(DXVA_PicEntry_H264 *pic, > unsigned index, unsigned flag) > { > - assert((index&0x7f) == index && (flag&0x01) == flag); > + av_assert0((index&0x7f) == index && (flag&0x01) == flag); > pic->bPicEntry = index | (flag << 7); > } > > @@ -194,8 +194,8 @@ void ff_dxva2_h264_fill_scaling_lists(const AVCodecContext > *avctx, AVDXVAContext > > static int is_slice_short(const AVCodecContext *avctx, AVDXVAContext *ctx) > { > - assert(DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) == 1 || > - DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) == 2); > + av_assert0(DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) == 1 || > + DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) == 2); > return DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) == 2; > } > > @@ -348,10 +348,10 @@ static int > commit_bitstream_and_slice_buffer(AVCodecContext *avctx, > static const unsigned start_code_size = sizeof(start_code); > unsigned position, size; > > - assert(offsetof(DXVA_Slice_H264_Short, BSNALunitDataLocation) == > - offsetof(DXVA_Slice_H264_Long, BSNALunitDataLocation)); > - assert(offsetof(DXVA_Slice_H264_Short, SliceBytesInBuffer) == > - offsetof(DXVA_Slice_H264_Long, SliceBytesInBuffer)); > + av_assert0(offsetof(DXVA_Slice_H264_Short, BSNALunitDataLocation) == > + offsetof(DXVA_Slice_H264_Long, BSNALunitDataLocation)); > + av_assert0(offsetof(DXVA_Slice_H264_Short, SliceBytesInBuffer) == > + offsetof(DXVA_Slice_H264_Long, SliceBytesInBuffer)); > > if (is_slice_short(avctx, ctx)) > slice = &ctx_pic->slice_short[i]; > @@ -453,7 +453,7 @@ static int dxva2_h264_start_frame(AVCodecContext *avctx, > > if (!DXVA_CONTEXT_VALID(avctx, ctx)) > return -1; > - assert(ctx_pic); > + av_assert0(ctx_pic); > > /* Fill up DXVA_PicParams_H264 */ > ff_dxva2_h264_fill_picture_parameters(avctx, ctx, &ctx_pic->pp); > diff --git a/libavcodec/dxva2_mpeg2.c b/libavcodec/dxva2_mpeg2.c > index 4c9ed1d761..d31a8bb872 100644 > --- a/libavcodec/dxva2_mpeg2.c > +++ b/libavcodec/dxva2_mpeg2.c > @@ -264,7 +264,7 @@ static int dxva2_mpeg2_start_frame(AVCodecContext *avctx, > > if (!DXVA_CONTEXT_VALID(avctx, ctx)) > return -1; > - assert(ctx_pic); > + av_assert0(ctx_pic); > > ff_dxva2_mpeg2_fill_picture_parameters(avctx, ctx, &ctx_pic->pp); > ff_dxva2_mpeg2_fill_quantization_matrices(avctx, ctx, &ctx_pic->qm); > diff --git a/libavcodec/dxva2_vc1.c b/libavcodec/dxva2_vc1.c > index 2b1b3f97ea..f7513b2b15 100644 > --- a/libavcodec/dxva2_vc1.c > +++ b/libavcodec/dxva2_vc1.c > @@ -321,7 +321,7 @@ static int dxva2_vc1_start_frame(AVCodecContext *avctx, > > if (!DXVA_CONTEXT_VALID(avctx, ctx)) > return -1; > - assert(ctx_pic); > + av_assert0(ctx_pic); > > ff_dxva2_vc1_fill_picture_parameters(avctx, ctx, &ctx_pic->pp); > _______________________________________________ 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] 8+ messages in thread
* [FFmpeg-devel] 回复: [PATCH 1/5] avcodec/d3d12va_vp9: fix vp9 max_num_refs value 2023-12-25 14:18 [FFmpeg-devel] [PATCH 1/5] avcodec/d3d12va_vp9: fix vp9 max_num_refs value Tong Wu ` (3 preceding siblings ...) 2023-12-25 14:18 ` [FFmpeg-devel] [PATCH 5/5] avcodec/dxva2(h264|mpeg2|vc1): use av_assert0 instead of assert Tong Wu @ 2023-12-25 14:47 ` Wu Jianhua 4 siblings, 0 replies; 8+ messages in thread From: Wu Jianhua @ 2023-12-25 14:47 UTC (permalink / raw) To: ffmpeg-devel; +Cc: Tong Wu Tong Wu <tong1.wu-at-intel.com@ffmpeg.org>: > subject: [FFmpeg-devel] [PATCH 1/5] avcodec/d3d12va_vp9: fix vp9 max_num_refs value > > Previous max_num_refs was based on pp.frame_refs plus 1 and it could possibly > reaches the size limit. Actually it should be the size of pp.ref_frame_map > plus 1. > > Signed-off-by: Tong Wu <tong1.wu@intel.com> > --- > libavcodec/d3d12va_vp9.c | 2 +- >1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavcodec/d3d12va_vp9.c b/libavcodec/d3d12va_vp9.c > index bb94e18781..d6dfc905d9 100644 > --- a/libavcodec/d3d12va_vp9.c > +++ b/libavcodec/d3d12va_vp9.c > @@ -148,7 +148,7 @@ static int d3d12va_vp9_decode_init(AVCodecContext *avctx) > break; > }; > > - ctx->max_num_ref = FF_ARRAY_ELEMS(pp.frame_refs) + 1; > + ctx->max_num_ref = FF_ARRAY_ELEMS(pp.ref_frame_map) + 1; > > return ff_d3d12va_decode_init(avctx); > } > -- > 2.41.0.windows.1 LGTM. I tested this fix both in command line and C API and it fixed the VP9 decoding issue that the decoded reference frames of some samples have corrupted. Thanks, Jianhua _______________________________________________ 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] 8+ messages in thread
end of thread, other threads:[~2023-12-27 5:45 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2023-12-25 14:18 [FFmpeg-devel] [PATCH 1/5] avcodec/d3d12va_vp9: fix vp9 max_num_refs value Tong Wu 2023-12-25 14:18 ` [FFmpeg-devel] [PATCH 2/5] avcodec/d3d12va_decode: delete an empty line and fix a fuction alignment Tong Wu 2023-12-25 14:18 ` [FFmpeg-devel] [PATCH 3/5] avcodec/d3d12va_h264: replace assert with av_assert0 Tong Wu 2023-12-25 14:18 ` [FFmpeg-devel] [PATCH 4/5] avcodec/d3d12va_decode: remove assertion from get_surface_index Tong Wu 2023-12-27 5:42 ` Xiang, Haihao 2023-12-25 14:18 ` [FFmpeg-devel] [PATCH 5/5] avcodec/dxva2(h264|mpeg2|vc1): use av_assert0 instead of assert Tong Wu 2023-12-27 5:45 ` Xiang, Haihao 2023-12-25 14:47 ` [FFmpeg-devel] 回复: [PATCH 1/5] avcodec/d3d12va_vp9: fix vp9 max_num_refs value Wu Jianhua
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