[vlc-commits] [Git][videolan/vlc][master] contrib: ffmpeg: update to 7.1

François Cartegnie (@fcartegnie) gitlab at videolan.org
Thu Oct 10 12:42:29 UTC 2024



François Cartegnie pushed to branch master at VideoLAN / VLC


Commits:
bbc9223f by Steve Lhomme at 2024-10-10T11:57:49+00:00
contrib: ffmpeg: update to 7.1

- - - - -


12 changed files:

- contrib/src/ffmpeg/0001-avcodec-dxva2_hevc-add-support-for-parsing-HEVC-Rang.patch
- contrib/src/ffmpeg/0001-avcodec-mpeg12dec-don-t-call-hw-end_frame-when-start.patch
- contrib/src/ffmpeg/0001-fix-mf_utils-compilation-with-mingw64.patch
- contrib/src/ffmpeg/0002-avcodec-hevcdec-allow-HEVC-444-8-10-12-bits-decoding.patch
- contrib/src/ffmpeg/0002-avcodec-mpeg12dec-don-t-end-a-slice-without-first_sl.patch
- contrib/src/ffmpeg/0003-avcodec-hevcdec-allow-HEVC-422-10-12-bits-decoding-w.patch
- contrib/src/ffmpeg/0011-avcodec-videotoolboxenc-disable-calls-on-unsupported.patch
- contrib/src/ffmpeg/SHA512SUMS
- contrib/src/ffmpeg/avcodec-fix-compilation-visionos.patch
- contrib/src/ffmpeg/dxva_vc1_crash.patch
- contrib/src/ffmpeg/h264_early_SAR.patch
- contrib/src/ffmpeg/rules.mak


Changes:

=====================================
contrib/src/ffmpeg/0001-avcodec-dxva2_hevc-add-support-for-parsing-HEVC-Rang.patch
=====================================
@@ -1,84 +1,125 @@
-From 575d81193f7cc308e2a397cd660011fecf67915e Mon Sep 17 00:00:00 2001
+From 8353ed0ad5634cee0d66936e5ccbe54aa845dff7 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Thu, 3 Oct 2019 14:05:40 +0200
-Subject: [PATCH 04/10] avcodec/dxva2_hevc: add support for parsing HEVC Range
+Subject: [PATCH 2/9] avcodec/dxva2_hevc: add support for parsing HEVC Range
  Extension data
 
 ---
- libavcodec/d3d11va.h    |  1 +
- libavcodec/dxva2.h      |  1 +
- libavcodec/dxva2_hevc.c | 79 ++++++++++++++++++++++++++++++++++++++---
- 3 files changed, 76 insertions(+), 5 deletions(-)
+ libavcodec/d3d11va.h        |  2 ++
+ libavcodec/d3d12va_hevc.c   |  9 +++++---
+ libavcodec/dxva2.c          | 19 ++++++++++++++++
+ libavcodec/dxva2.h          |  2 ++
+ libavcodec/dxva2_hevc.c     | 43 ++++++++++++++++++++++++++++++++-----
+ libavcodec/dxva2_internal.h | 41 ++++++++++++++++++++++++++++++++++-
+ 6 files changed, 107 insertions(+), 9 deletions(-)
 
 diff --git a/libavcodec/d3d11va.h b/libavcodec/d3d11va.h
-index 6816b6c1e6..68a69c372d 100644
+index 27f40e5519..67ce8d3871 100644
 --- a/libavcodec/d3d11va.h
 +++ b/libavcodec/d3d11va.h
-@@ -47,6 +47,7 @@
- 
- #define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for Direct3D11 and old UVD/UVD+ ATI video cards
- #define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO    2 ///< Work around for Direct3D11 and old Intel GPUs with ClearVideo interface
-+#define FF_DXVA2_WORKAROUND_HEVC_REXT           4 ///< Signal the D3D11VA decoder is using the HEVC Rext picture structure
+@@ -38,6 +38,8 @@
+ #include <stdint.h>
+ #include <d3d11.h>
  
++#define FF_DXVA2_WORKAROUND_HEVC_REXT  4
++
  /**
-  * This structure is used to provides the necessary configurations and data
+  * @defgroup lavc_codec_hwaccel_d3d11va Direct3D11
+  * @ingroup lavc_codec_hwaccel
+diff --git a/libavcodec/d3d12va_hevc.c b/libavcodec/d3d12va_hevc.c
+index 7686f0eb6c..2b1633fca9 100644
+--- a/libavcodec/d3d12va_hevc.c
++++ b/libavcodec/d3d12va_hevc.c
+@@ -33,7 +33,7 @@
+ #define MAX_SLICES 256
+ 
+ typedef struct HEVCDecodePictureContext {
+-    DXVA_PicParams_HEVC    pp;
++    DXVA_PicParams_HEVC_Rext pp;
+     DXVA_Qmatrix_HEVC      qm;
+     unsigned               slice_count;
+     DXVA_Slice_HEVC_Short  slice_short[MAX_SLICES];
+@@ -148,15 +148,18 @@ static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPU
+ 
+ static int d3d12va_hevc_end_frame(AVCodecContext *avctx)
+ {
++    D3D12VADecodeContext     *ctx     = D3D12VA_DECODE_CONTEXT(avctx);
+     HEVCContext              *h       = avctx->priv_data;
+     HEVCDecodePictureContext *ctx_pic = h->cur_frame->hwaccel_picture_private;
++    int rext = (DXVA_CONTEXT_WORKAROUND(avctx, ((AVDXVAContext *)ctx)) & FF_DXVA2_WORKAROUND_INTEL_HEVC_REXT);
+ 
+-    int scale = ctx_pic->pp.dwCodingParamToolFlags & 1;
++    int scale = ctx_pic->pp.main.dwCodingParamToolFlags & 1;
+ 
+     if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0)
+         return -1;
+ 
+-    return ff_d3d12va_common_end_frame(avctx, h->cur_frame->f, &ctx_pic->pp, sizeof(ctx_pic->pp),
++    return ff_d3d12va_common_end_frame(avctx, h->cur_frame->f,
++               &ctx_pic->pp, rext ? sizeof(ctx_pic->pp) : sizeof(ctx_pic->pp.main),
+                scale ? &ctx_pic->qm : NULL, scale ? sizeof(ctx_pic->qm) : 0, update_input_arguments);
+ }
+ 
+diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c
+index 22ecd5acaf..f7b0c5aed2 100644
+--- a/libavcodec/dxva2.c
++++ b/libavcodec/dxva2.c
+@@ -51,6 +51,15 @@ DEFINE_GUID(ff_DXVA2_NoEncrypt,          0x1b81beD0, 0xa0c7,0x11d3,0xb9,0x84,0x0
+ DEFINE_GUID(ff_GUID_NULL,                0x00000000, 0x0000,0x0000,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
+ DEFINE_GUID(ff_IID_IDirectXVideoDecoderService, 0xfc51a551,0xd5e7,0x11d9,0xaf,0x55,0x00,0x05,0x4e,0x43,0xff,0x02);
+ 
++DEFINE_GUID(ff_DXVA_ModeHEVC_VLD_Main_Intel,           0x8c56eb1e, 0x2b47, 0x466f, 0x8d, 0x33, 0x7d, 0xbc, 0xd6, 0x3f, 0x3d, 0xf2);
++DEFINE_GUID(ff_DXVA_ModeHEVC_VLD_Main10_Intel,         0x75fc75f7, 0xc589, 0x4a07, 0xa2, 0x5b, 0x72, 0xe0, 0x3b, 0x03, 0x83, 0xb3);
++DEFINE_GUID(ff_DXVA_ModeHEVC_VLD_Main12_Intel,         0x8ff8a3aa, 0xc456, 0x4132, 0xb6, 0xef, 0x69, 0xd9, 0xdd, 0x72, 0x57, 0x1d);
++DEFINE_GUID(ff_DXVA_ModeHEVC_VLD_Main422_10_Intel,     0xe484dcb8, 0xcac9, 0x4859, 0x99, 0xf5, 0x5c, 0x0d, 0x45, 0x06, 0x90, 0x89);
++DEFINE_GUID(ff_DXVA_ModeHEVC_VLD_Main422_12_Intel,     0xc23dd857, 0x874b, 0x423c, 0xb6, 0xe0, 0x82, 0xce, 0xaa, 0x9b, 0x11, 0x8a);
++DEFINE_GUID(ff_DXVA_ModeHEVC_VLD_Main444_Intel,        0x41a5af96, 0xe415, 0x4b0c, 0x9d, 0x03, 0x90, 0x78, 0x58, 0xe2, 0x3e, 0x78);
++DEFINE_GUID(ff_DXVA_ModeHEVC_VLD_Main444_10_Intel,     0x6a6a81ba, 0x912a, 0x485d, 0xb5, 0x7f, 0xcc, 0xd2, 0xd3, 0x7b, 0x8d, 0x94);
++DEFINE_GUID(ff_DXVA_ModeHEVC_VLD_Main444_12_Intel,     0x5b08e35d, 0x0c66, 0x4c51, 0xa6, 0xf1, 0x89, 0xd0, 0x0c, 0xb2, 0xc1, 0x97);
++
+ typedef struct dxva_mode {
+     const GUID     *guid;
+     enum AVCodecID codec;
+@@ -302,6 +311,16 @@ static int dxva_get_decoder_guid(AVCodecContext *avctx, void *service, void *sur
+     if (IsEqualGUID(decoder_guid, &ff_DXVADDI_Intel_ModeH264_E))
+         sctx->workaround |= FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO;
+ 
++    if (IsEqualGUID(decoder_guid, &ff_DXVA_ModeHEVC_VLD_Main_Intel) ||
++        IsEqualGUID(decoder_guid, &ff_DXVA_ModeHEVC_VLD_Main10_Intel) ||
++        IsEqualGUID(decoder_guid, &ff_DXVA_ModeHEVC_VLD_Main12_Intel) ||
++        IsEqualGUID(decoder_guid, &ff_DXVA_ModeHEVC_VLD_Main422_10_Intel) ||
++        IsEqualGUID(decoder_guid, &ff_DXVA_ModeHEVC_VLD_Main422_12_Intel) ||
++        IsEqualGUID(decoder_guid, &ff_DXVA_ModeHEVC_VLD_Main444_Intel) ||
++        IsEqualGUID(decoder_guid, &ff_DXVA_ModeHEVC_VLD_Main444_10_Intel) ||
++        IsEqualGUID(decoder_guid, &ff_DXVA_ModeHEVC_VLD_Main444_12_Intel))
++        sctx->workaround |= FF_DXVA2_WORKAROUND_INTEL_HEVC_REXT;
++
+     return 0;
+ }
+ 
 diff --git a/libavcodec/dxva2.h b/libavcodec/dxva2.h
-index 22c93992f2..024999239d 100644
+index bdec6112e9..1520964878 100644
 --- a/libavcodec/dxva2.h
 +++ b/libavcodec/dxva2.h
-@@ -47,6 +47,7 @@
- 
- #define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards
- #define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO    2 ///< Work around for DXVA2 and old Intel GPUs with ClearVideo interface
-+#define FF_DXVA2_WORKAROUND_HEVC_REXT           4 ///< Signal the DXVA2 decoder is using the HEVC Rext picture structure
+@@ -38,6 +38,8 @@
+ #include <d3d9.h>
+ #include <dxva2api.h>
  
++#define FF_DXVA2_WORKAROUND_HEVC_REXT  4
++
  /**
-  * This structure is used to provides the necessary configurations and data
+  * @defgroup lavc_codec_hwaccel_dxva2 DXVA2
+  * @ingroup lavc_codec_hwaccel
 diff --git a/libavcodec/dxva2_hevc.c b/libavcodec/dxva2_hevc.c
-index b6c08943f0..d29ae05b55 100644
+index d01d1e76e8..cc922f5077 100644
 --- a/libavcodec/dxva2_hevc.c
 +++ b/libavcodec/dxva2_hevc.c
-@@ -29,10 +29,47 @@
- #include "hevcdec.h"
+@@ -28,11 +28,12 @@
+ #include "hevc/data.h"
+ #include "hevc/hevcdec.h"
  #include "hwaccel_internal.h"
++#include "cbs_h265.h"
  
-+#pragma pack(push, 1)
-+typedef struct
-+{
-+    DXVA_PicParams_HEVC main;
-+
-+    // HEVC Range Extension
-+    __C89_NAMELESS union {
-+        __C89_NAMELESS struct {
-+            UINT32 transform_skip_rotation_enabled_flag : 1;
-+            UINT32 transform_skip_context_enabled_flag : 1;
-+            UINT32 implicit_rdpcm_enabled_flag : 1;
-+            UINT32 explicit_rdpcm_enabled_flag : 1;
-+            UINT32 extended_precision_processing_flag : 1;
-+            UINT32 intra_smoothing_disabled_flag : 1;
-+            UINT32 high_precision_offsets_enabled_flag : 1;
-+            UINT32 persistent_rice_adaptation_enabled_flag : 1;
-+            UINT32 cabac_bypass_alignment_enabled_flag : 1;
-+            UINT32 cross_component_prediction_enabled_flag : 1;
-+            UINT32 chroma_qp_offset_list_enabled_flag : 1;
-+            UINT32 BitDepthLuma16 : 1; // TODO merge in ReservedBits5 if not needed
-+            UINT32 BitDepthChroma16 : 1; // TODO merge in ReservedBits5 if not needed
-+            UINT32 ReservedBits8 : 19;
-+        };
-+        UINT32 dwRangeExtensionFlags;
-+    };
-+
-+    UCHAR diff_cu_chroma_qp_offset_depth;
-+    UCHAR chroma_qp_offset_list_len_minus1;
-+    UCHAR log2_sao_offset_scale_luma;
-+    UCHAR log2_sao_offset_scale_chroma;
-+    UCHAR log2_max_transform_skip_block_size_minus2;
-+    CHAR cb_qp_offset_list[6];
-+    CHAR cr_qp_offset_list[6];
-+
-+} DXVA_PicParams_HEVC_Rext;
-+#pragma pack(pop)
-+
  #define MAX_SLICES 256
  
  struct hevc_dxva2_picture_context {
@@ -87,16 +128,18 @@ index b6c08943f0..d29ae05b55 100644
      DXVA_Qmatrix_HEVC     qm;
      unsigned              slice_count;
      DXVA_Slice_HEVC_Short slice_short[MAX_SLICES];
-@@ -58,18 +95,48 @@ static int get_refpic_index(const DXVA_PicParams_HEVC *pp, int surface_index)
+@@ -58,7 +59,7 @@ static int get_refpic_index(const DXVA_PicParams_HEVC *pp, int surface_index)
  }
  
- static void fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *ctx, const HEVCContext *h,
+ void ff_dxva2_hevc_fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *ctx,
 -                                    DXVA_PicParams_HEVC *pp)
 +                                    DXVA_PicParams_HEVC_Rext *ppext)
  {
-     const HEVCFrame *current_picture = h->ref;
-     const HEVCSPS *sps = h->ps.sps;
-     const HEVCPPS *pps = h->ps.pps;
+     const HEVCContext *h = avctx->priv_data;
+     const HEVCLayerContext *l = &h->layers[h->cur_layer];
+@@ -66,12 +67,42 @@ void ff_dxva2_hevc_fill_picture_parameters(const AVCodecContext *avctx, AVDXVACo
+     const HEVCPPS *pps = h->pps;
+     const HEVCSPS *sps = pps->sps;
      int i, j;
 +    DXVA_PicParams_HEVC *pp = &ppext->main;
  
@@ -106,16 +149,16 @@ index b6c08943f0..d29ae05b55 100644
      pp->PicWidthInMinCbsY  = sps->min_cb_width;
      pp->PicHeightInMinCbsY = sps->min_cb_height;
  
-+    if (sps->sps_range_extension_flag) {
-+        ppext->dwRangeExtensionFlags |= (sps->transform_skip_rotation_enabled_flag     <<  0) |
-+                                        (sps->transform_skip_context_enabled_flag      <<  1) |
-+                                        (sps->implicit_rdpcm_enabled_flag              <<  2) |
-+                                        (sps->explicit_rdpcm_enabled_flag              <<  3) |
-+                                        (sps->extended_precision_processing_flag       <<  4) |
-+                                        (sps->intra_smoothing_disabled_flag            <<  5) |
-+                                        (sps->high_precision_offsets_enabled_flag      <<  5) |
-+                                        (sps->persistent_rice_adaptation_enabled_flag  <<  7) |
-+                                        (sps->cabac_bypass_alignment_enabled_flag      <<  8);
++    if (sps->range_extension) {
++        ppext->dwRangeExtensionFlags |= (sps->transform_skip_rotation_enabled     <<  0) |
++                                        (sps->transform_skip_context_enabled      <<  1) |
++                                        (sps->implicit_rdpcm_enabled              <<  2) |
++                                        (sps->explicit_rdpcm_enabled              <<  3) |
++                                        (sps->extended_precision_processing       <<  4) |
++                                        (sps->intra_smoothing_disabled            <<  5) |
++                                        (sps->high_precision_offsets_enabled      <<  5) |
++                                        (sps->persistent_rice_adaptation_enabled  <<  7) |
++                                        (sps->cabac_bypass_alignment_enabled      <<  8);
 +    }
 +    if (pps->pps_range_extensions_flag) {
 +        ppext->dwRangeExtensionFlags |= (pps->cross_component_prediction_enabled_flag  <<  9) |
@@ -136,29 +179,95 @@ index b6c08943f0..d29ae05b55 100644
 +    }
 +
      pp->wFormatAndSequenceInfoFlags = (sps->chroma_format_idc             <<  0) |
-                                       (sps->separate_colour_plane_flag    <<  2) |
+                                       (sps->separate_colour_plane         <<  2) |
                                        ((sps->bit_depth - 8)               <<  3) |
-@@ -405,16 +472,18 @@ static int dxva2_hevc_decode_slice(AVCodecContext *avctx,
+@@ -411,16 +442,18 @@ static int dxva2_hevc_decode_slice(AVCodecContext *avctx,
  
  static int dxva2_hevc_end_frame(AVCodecContext *avctx)
  {
 +    AVDXVAContext *ctx = DXVA_CONTEXT(avctx);
      HEVCContext *h = avctx->priv_data;
-     struct hevc_dxva2_picture_context *ctx_pic = h->ref->hwaccel_picture_private;
+     struct hevc_dxva2_picture_context *ctx_pic = h->cur_frame->hwaccel_picture_private;
 -    int scale = ctx_pic->pp.dwCodingParamToolFlags & 1;
 +    int scale = ctx_pic->pp.main.dwCodingParamToolFlags & 1;
-+    int rext = (DXVA_CONTEXT_WORKAROUND(avctx, ctx) & FF_DXVA2_WORKAROUND_HEVC_REXT);
++    int rext = (DXVA_CONTEXT_WORKAROUND(avctx, ctx) & FF_DXVA2_WORKAROUND_INTEL_HEVC_REXT);
      int ret;
  
      if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0)
          return -1;
  
-     ret = ff_dxva2_common_end_frame(avctx, h->ref->frame,
+     ret = ff_dxva2_common_end_frame(avctx, h->cur_frame->f,
 -                                    &ctx_pic->pp, sizeof(ctx_pic->pp),
 +                                    &ctx_pic->pp, rext ? sizeof(ctx_pic->pp) : sizeof(ctx_pic->pp.main),
                                      scale ? &ctx_pic->qm : NULL, scale ? sizeof(ctx_pic->qm) : 0,
                                      commit_bitstream_and_slice_buffer);
      return ret;
+diff --git a/libavcodec/dxva2_internal.h b/libavcodec/dxva2_internal.h
+index 224a867ebc..7f3e5938ac 100644
+--- a/libavcodec/dxva2_internal.h
++++ b/libavcodec/dxva2_internal.h
+@@ -33,6 +33,7 @@
+ 
+ #define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2/Direct3D11 and old UVD/UVD+ ATI video cards
+ #define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO    2 ///< Work around for DXVA2/Direct3D11 and old Intel GPUs with ClearVideo interface
++#define FF_DXVA2_WORKAROUND_INTEL_HEVC_REXT     4 ///< Signal the DXVA2 decoder is using the HEVC Rext picture structure
+ 
+ #if CONFIG_DXVA2
+ #include "dxva2.h"
+@@ -113,6 +114,44 @@ typedef struct FFDXVASharedContext {
+     AVDXVAContext ctx;
+ } FFDXVASharedContext;
+ 
++#pragma pack(push, 1)
++typedef struct
++{
++    DXVA_PicParams_HEVC main;
++
++    // HEVC Range Extension
++    union {
++        struct {
++            UINT32 transform_skip_rotation_enabled_flag : 1;
++            UINT32 transform_skip_context_enabled_flag : 1;
++            UINT32 implicit_rdpcm_enabled_flag : 1;
++            UINT32 explicit_rdpcm_enabled_flag : 1;
++            UINT32 extended_precision_processing_flag : 1;
++            UINT32 intra_smoothing_disabled_flag : 1;
++            UINT32 high_precision_offsets_enabled_flag : 1;
++            UINT32 persistent_rice_adaptation_enabled_flag : 1;
++            UINT32 cabac_bypass_alignment_enabled_flag : 1;
++            UINT32 cross_component_prediction_enabled_flag : 1;
++            UINT32 chroma_qp_offset_list_enabled_flag : 1;
++            UINT32 BitDepthLuma16 : 1; // TODO merge in ReservedBits5 if not needed
++            UINT32 BitDepthChroma16 : 1; // TODO merge in ReservedBits5 if not needed
++            UINT32 ReservedBits8 : 19;
++        };
++        UINT32 dwRangeExtensionFlags;
++    };
++
++    UCHAR diff_cu_chroma_qp_offset_depth;
++    UCHAR chroma_qp_offset_list_len_minus1;
++    UCHAR log2_sao_offset_scale_luma;
++    UCHAR log2_sao_offset_scale_chroma;
++    UCHAR log2_max_transform_skip_block_size_minus2;
++    CHAR cb_qp_offset_list[6];
++    CHAR cr_qp_offset_list[6];
++
++} DXVA_PicParams_HEVC_Rext;
++#pragma pack(pop)
++
++
+ #define DXVA_SHARED_CONTEXT(avctx) ((FFDXVASharedContext *)((avctx)->internal->hwaccel_priv_data))
+ 
+ #define DXVA_CONTEXT(avctx) (AVDXVAContext *)((avctx)->hwaccel_context ? (avctx)->hwaccel_context : (&(DXVA_SHARED_CONTEXT(avctx)->ctx)))
+@@ -171,7 +210,7 @@ void ff_dxva2_h264_fill_picture_parameters(const AVCodecContext *avctx, AVDXVACo
+ 
+ void ff_dxva2_h264_fill_scaling_lists(const AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_Qmatrix_H264 *qm);
+ 
+-void ff_dxva2_hevc_fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_PicParams_HEVC *pp);
++void ff_dxva2_hevc_fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_PicParams_HEVC_Rext *pp);
+ 
+ void ff_dxva2_hevc_fill_scaling_lists(const AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_Qmatrix_HEVC *qm);
+ 
 -- 
-2.37.3.windows.1
+2.45.0.windows.1
 


=====================================
contrib/src/ffmpeg/0001-avcodec-mpeg12dec-don-t-call-hw-end_frame-when-start.patch
=====================================
@@ -1,8 +1,8 @@
-From 44f913546d4b0aa29ef30f72428eef38f2b6d4ed Mon Sep 17 00:00:00 2001
+From 9ec0de5f215f6d7e6854e619071f79ff095432ad Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Fri, 12 Feb 2021 08:20:56 +0100
-Subject: [PATCH 07/10] avcodec/mpeg12dec: don't call hw->end_frame when
- starting second field decoding
+Subject: [PATCH 1/2] avcodec/mpeg12dec: don't call hw->end_frame when starting
+ second field decoding
 
 This call is unbalanced with a hwaccel->start_frame. It fixes some crashes
 because this call ends up using uninitialized memory. Decoding works as
@@ -12,13 +12,14 @@ expected after this patch.
  1 file changed, 8 deletions(-)
 
 diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
-index 5dac83ebcd..be8e74eb53 100644
+index 4f784611de..a9e2383892 100644
 --- a/libavcodec/mpeg12dec.c
 +++ b/libavcodec/mpeg12dec.c
-@@ -1614,14 +1614,6 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
+@@ -1340,14 +1340,6 @@ static int mpeg_field_start(Mpeg1Context *s1, const uint8_t *buf, int buf_size)
+             av_log(s->avctx, AV_LOG_ERROR, "first field missing\n");
              return AVERROR_INVALIDDATA;
          }
- 
+-
 -        if (s->avctx->hwaccel) {
 -            if ((ret = FF_HW_SIMPLE_CALL(s->avctx, end_frame)) < 0) {
 -                av_log(avctx, AV_LOG_ERROR,
@@ -26,10 +27,9 @@ index 5dac83ebcd..be8e74eb53 100644
 -                return ret;
 -            }
 -        }
--
-         for (i = 0; i < 4; i++) {
-             s->current_picture.f->data[i] = s->current_picture_ptr->f->data[i];
-             if (s->picture_structure == PICT_BOTTOM_FIELD)
+         ret = ff_mpv_alloc_dummy_frames(s);
+         if (ret < 0)
+             return ret;
 -- 
-2.37.3.windows.1
+2.45.0.windows.1
 


=====================================
contrib/src/ffmpeg/0001-fix-mf_utils-compilation-with-mingw64.patch
=====================================
@@ -1,7 +1,7 @@
-From 40322f6f15f54966b58c8afcbbe8a450351186dd Mon Sep 17 00:00:00 2001
+From 1be62d64ffd3c498265fc2387a61fdac7899d85c Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Mon, 31 May 2021 13:36:39 +0200
-Subject: [PATCH 09/10] fix MediaFoundation compilation if WINVER was forced by
+Subject: [PATCH 5/9] fix MediaFoundation compilation if WINVER was forced by
  the user
 
 In mingw64 and Windows Kits the MF_MT_VIDEO_ROTATION is defined if WINVER is at
@@ -27,7 +27,7 @@ index 48e3a63efc..98cf3c8db2 100644
  
  #include "mf_utils.h"
 diff --git a/libavcodec/mfenc.c b/libavcodec/mfenc.c
-index 3c50a6c074..3092e4e003 100644
+index b8f8a25f43..737e4fcc81 100644
 --- a/libavcodec/mfenc.c
 +++ b/libavcodec/mfenc.c
 @@ -19,7 +19,9 @@
@@ -41,5 +41,5 @@ index 3c50a6c074..3092e4e003 100644
  
  #include "encode.h"
 -- 
-2.37.3.windows.1
+2.45.0.windows.1
 


=====================================
contrib/src/ffmpeg/0002-avcodec-hevcdec-allow-HEVC-444-8-10-12-bits-decoding.patch
=====================================
@@ -1,19 +1,19 @@
-From 5c61c842179d24d8346bf31c96216cfe2bcec594 Mon Sep 17 00:00:00 2001
+From 86dd05c31e1de90f25c01b70c8b5b28a04db0d04 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Tue, 20 Aug 2019 13:10:24 +0200
-Subject: [PATCH 05/10] avcodec/hevcdec: allow HEVC 444 8/10/12 bits decoding
- with DXVA2/D3D11VA
+Subject: [PATCH 3/9] avcodec/hevcdec: allow HEVC 444 8/10/12 bits decoding
+ with DXVA2/D3D11VA/D3D12VA
 
 And 4:2:0 12 bits as well.
 ---
- libavcodec/hevcdec.c | 14 ++++++++++++++
- 1 file changed, 14 insertions(+)
+ libavcodec/hevc/hevcdec.c | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
 
-diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
-index b267f6ebcf..04e946ee6c 100644
---- a/libavcodec/hevcdec.c
-+++ b/libavcodec/hevcdec.c
-@@ -461,6 +461,13 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
+diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
+index 0dc24f82f8..db191b5262 100644
+--- a/libavcodec/hevc/hevcdec.c
++++ b/libavcodec/hevc/hevcdec.c
+@@ -594,6 +594,16 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
  #if CONFIG_HEVC_VAAPI_HWACCEL
          *fmt++ = AV_PIX_FMT_VAAPI;
  #endif
@@ -23,11 +23,14 @@ index b267f6ebcf..04e946ee6c 100644
 +#if CONFIG_HEVC_D3D11VA_HWACCEL
 +        *fmt++ = AV_PIX_FMT_D3D11VA_VLD;
 +        *fmt++ = AV_PIX_FMT_D3D11;
++#endif
++#if CONFIG_HEVC_D3D12VA_HWACCEL
++        *fmt++ = AV_PIX_FMT_D3D12;
 +#endif
  #if CONFIG_HEVC_VDPAU_HWACCEL
          *fmt++ = AV_PIX_FMT_VDPAU;
  #endif
-@@ -496,6 +503,13 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
+@@ -629,6 +639,16 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
  #if CONFIG_HEVC_VAAPI_HWACCEL
         *fmt++ = AV_PIX_FMT_VAAPI;
  #endif
@@ -37,10 +40,13 @@ index b267f6ebcf..04e946ee6c 100644
 +#if CONFIG_HEVC_D3D11VA_HWACCEL
 +        *fmt++ = AV_PIX_FMT_D3D11VA_VLD;
 +        *fmt++ = AV_PIX_FMT_D3D11;
++#endif
++#if CONFIG_HEVC_D3D12VA_HWACCEL
++        *fmt++ = AV_PIX_FMT_D3D12;
 +#endif
  #if CONFIG_HEVC_VDPAU_HWACCEL
          *fmt++ = AV_PIX_FMT_VDPAU;
  #endif
 -- 
-2.37.3.windows.1
+2.45.0.windows.1
 


=====================================
contrib/src/ffmpeg/0002-avcodec-mpeg12dec-don-t-end-a-slice-without-first_sl.patch
=====================================
@@ -1,8 +1,7 @@
-From 2583c7346227b5967f3626f5f5ff97f4db2748ef Mon Sep 17 00:00:00 2001
+From 70ef5f6aa8865e04a1df3e7a3c73542fb3f7d49f Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Fri, 12 Feb 2021 11:10:03 +0100
-Subject: [PATCH 08/10] avcodec/mpeg12dec: don't end a slice without
- first_slice
+Subject: [PATCH 2/2] avcodec/mpeg12dec: don't end a slice without first_slice
 
 If first_slice is set that means the first slice/field is not started yet. We
 should not end the slice. In particular calling hwaccel->end_frame may crash as
@@ -11,40 +10,29 @@ we're ending a frame that was not started.
 We also need to reset first_slice once the slice_end is finished handling
 for this check to work.
 ---
- libavcodec/mpeg12dec.c | 20 +++++++++++++-------
- 1 file changed, 13 insertions(+), 7 deletions(-)
+ libavcodec/mpeg12dec.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
 
 diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
-index be8e74eb53..a78ca29b66 100644
+index a9e2383892..f796e60514 100644
 --- a/libavcodec/mpeg12dec.c
 +++ b/libavcodec/mpeg12dec.c
-@@ -2425,13 +2425,19 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
+@@ -2187,9 +2187,14 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
                          s2->er.error_count += s2->thread_context[i]->er.error_count;
                  }
- 
--                ret = slice_end(avctx, picture);
--                if (ret < 0)
--                    return ret;
--                else if (ret) {
--                    // FIXME: merge with the stuff in mpeg_decode_slice
--                    if (s2->last_picture_ptr || s2->low_delay || s2->pict_type == AV_PICTURE_TYPE_B)
--                        *got_output = 1;
+
+-                ret = slice_end(avctx, picture, got_output);
 +                if (s->first_slice) // not started yet. don't end it
 +                    ret = 0;
-+                else {
-+                    ret = slice_end(avctx, picture);
-+                    if (ret < 0)
-+                        return ret;
-+                    else if (ret) {
-+                        // FIXME: merge with the stuff in mpeg_decode_slice
-+                        if (s2->last_picture_ptr || s2->low_delay || s2->pict_type == AV_PICTURE_TYPE_B)
-+                            *got_output = 1;
-+                    }
-+                    // slice ended, don't end it again later
-+                    s->first_slice = 1;
-                 }
++                else
++                    ret = slice_end(avctx, picture, got_output);
+                 if (ret < 0)
+                     return ret;
++                // slice ended, don't end it again later
++                s->first_slice = 1;
              }
              s2->pict_type = 0;
--- 
-2.37.3.windows.1
+
+--
+2.45.0.windows.1
 


=====================================
contrib/src/ffmpeg/0003-avcodec-hevcdec-allow-HEVC-422-10-12-bits-decoding-w.patch
=====================================
@@ -1,18 +1,18 @@
-From 3667c6a94f8cd1580dbfc447b2dbebe1fc80fb21 Mon Sep 17 00:00:00 2001
+From f5c129ae85d23e8968310dc8f9b5be5f9e8f0152 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Fri, 4 Oct 2019 12:42:11 +0200
-Subject: [PATCH 06/10] avcodec/hevcdec: allow HEVC 422 10/12 bits decoding
- with DXVA2/D3D11VA
+Subject: [PATCH 4/9] avcodec/hevcdec: allow HEVC 422 10/12 bits decoding with
+ DXVA2/D3D11VA/D3D12VA
 
 ---
- libavcodec/hevcdec.c | 14 ++++++++++++++
- 1 file changed, 14 insertions(+)
+ libavcodec/hevc/hevcdec.c | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
 
-diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
-index 04e946ee6c..abf898f968 100644
---- a/libavcodec/hevcdec.c
-+++ b/libavcodec/hevcdec.c
-@@ -491,6 +491,13 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
+diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
+index db191b5262..c512534526 100644
+--- a/libavcodec/hevc/hevcdec.c
++++ b/libavcodec/hevc/hevcdec.c
+@@ -627,6 +627,16 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
  #endif
  #if CONFIG_HEVC_VULKAN_HWACCEL
          *fmt++ = AV_PIX_FMT_VULKAN;
@@ -23,10 +23,13 @@ index 04e946ee6c..abf898f968 100644
 +#if CONFIG_HEVC_D3D11VA_HWACCEL
 +        *fmt++ = AV_PIX_FMT_D3D11VA_VLD;
 +        *fmt++ = AV_PIX_FMT_D3D11;
++#endif
++#if CONFIG_HEVC_D3D12VA_HWACCEL
++        *fmt++ = AV_PIX_FMT_D3D12;
  #endif
          break;
      case AV_PIX_FMT_YUV444P10:
-@@ -526,6 +533,13 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
+@@ -665,6 +675,16 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
  #endif
  #if CONFIG_HEVC_VULKAN_HWACCEL
          *fmt++ = AV_PIX_FMT_VULKAN;
@@ -37,9 +40,12 @@ index 04e946ee6c..abf898f968 100644
 +#if CONFIG_HEVC_D3D11VA_HWACCEL
 +        *fmt++ = AV_PIX_FMT_D3D11VA_VLD;
 +        *fmt++ = AV_PIX_FMT_D3D11;
++#endif
++#if CONFIG_HEVC_D3D12VA_HWACCEL
++        *fmt++ = AV_PIX_FMT_D3D12;
  #endif
          break;
      }
 -- 
-2.37.3.windows.1
+2.45.0.windows.1
 


=====================================
contrib/src/ffmpeg/0011-avcodec-videotoolboxenc-disable-calls-on-unsupported.patch
=====================================
@@ -1,7 +1,7 @@
-From 308c7e89093e370082ea7341bdb0d4eb7a6bc52a Mon Sep 17 00:00:00 2001
+From 122235558093bb6fb6edceca51a8a11ef8e055c4 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Tue, 20 Feb 2024 13:21:36 +0100
-Subject: [PATCH 11/11] avcodec/videotoolboxenc: disable calls on unsupported
+Subject: [PATCH 6/9] avcodec/videotoolboxenc: disable calls on unsupported
  iOS/tvOS version
 
 VTCopySupportedPropertyDictionaryForEncoder and kVTCompressionPropertyKey_EncoderID are not
@@ -10,40 +10,41 @@ available.
 "supported_props" seems to be read but never used.
 We don't need to dump encoder data for debugging in those cases.
 ---
- libavcodec/videotoolboxenc.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
+ libavcodec/videotoolboxenc.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
 
 diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
-index b0e827d14a..5d1bc8cba8 100644
+index da7b291b03..6b263ee6e9 100644
 --- a/libavcodec/videotoolboxenc.c
 +++ b/libavcodec/videotoolboxenc.c
-@@ -1159,7 +1159,7 @@ static int vtenc_create_encoder(AVCodecContext   *avctx,
+@@ -1203,8 +1203,10 @@ static int vtenc_create_encoder(AVCodecContext   *avctx,
+         return AVERROR_EXTERNAL;
      }
  
- #if defined (MAC_OS_X_VERSION_10_13) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_13)
+-#if defined (MAC_OS_X_VERSION_10_13) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_13)
 -    if (__builtin_available(macOS 10.13, *)) {
++#if (TARGET_OS_OSX    && defined(__MAC_13_0)    && __MAC_OS_X_VERSION_MAX_ALLOWED  >= __MAC_13_0)     || \
++    (TARGET_OS_IOS    && defined(__IPHONE_11_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0)  || \
++    (TARGET_OS_TV     && defined(__TVOS_11_0)   && __TV_OS_VERSION_MAX_ALLOWED     >= __TVOS_11_0)
 +    if (__builtin_available(macOS 10.13, iOS 11, tvOS 11, *)) {
-         status = VTCopySupportedPropertyDictionaryForEncoder(avctx->width,
-                                                              avctx->height,
-                                                              codec_type,
-@@ -1171,8 +1171,6 @@ static int vtenc_create_encoder(AVCodecContext   *avctx,
+         if (vtctx->supported_props) {
+             CFRelease(vtctx->supported_props);
+             vtctx->supported_props = NULL;
+@@ -1220,12 +1222,12 @@ static int vtenc_create_encoder(AVCodecContext   *avctx,
              av_log(avctx, AV_LOG_ERROR,"Error retrieving the supported property dictionary err=%"PRId64"\n", (int64_t)status);
              return AVERROR_EXTERNAL;
          }
 -    }
 -#endif
  
-     // Dump the init encoder
-     {
-@@ -1201,6 +1199,8 @@ static int vtenc_create_encoder(AVCodecContext   *avctx,
-         if (encoderID != NULL)
-             CFRelease(encoderID);
-     }
+     status = vt_dump_encoder(avctx);
+     if (status < 0)
+         return status;
 +    }
 +#endif
  
      if (avctx->flags & AV_CODEC_FLAG_QSCALE && !vtenc_qscale_enabled()) {
          av_log(avctx, AV_LOG_ERROR, "Error: -q:v qscale not available for encoder. Use -b:v bitrate instead.\n");
 -- 
-2.37.3.windows.1
+2.45.0.windows.1
 


=====================================
contrib/src/ffmpeg/SHA512SUMS
=====================================
@@ -1 +1 @@
-fca3f8635f29182e3ae0fe843a8a53614e4b47e22c11508df3ff7cdbafbb4b5ee0d82d9b3332871f7c1032033b1cad2f67557d7c5f7f7d85e2adadca122965d5  ffmpeg-6.1.1.tar.xz
+7282fff068452bf154b2bf814e7f20d44ed4d961687dffd841bd77b88f26d9eee2cf4cf02e9a60b48b50e77a0c34731580d9e7c0945e3bc14c8ace840d920cde  ffmpeg-7.1.tar.xz


=====================================
contrib/src/ffmpeg/avcodec-fix-compilation-visionos.patch
=====================================
@@ -1,7 +1,17 @@
-diff -ru ffmpeg/libavcodec/videotoolbox.c ffmpeg/libavcodec/videotoolbox.c
---- ffmpeg/libavcodec/videotoolbox.c	2023-11-11 01:25:17
-+++ ffmpeg/libavcodec/videotoolbox.c	2024-03-17 11:32:05
-@@ -784,7 +784,9 @@
+From 28a1eaf1477329824b38dd75c8d44ee9239848e3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne at videolan.org>
+Date: Sun, 17 Mar 2024 16:03:53 +0100
+Subject: [PATCH 7/9] fix compilation for xrOS
+
+---
+ libavcodec/videotoolbox.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
+index 505483ef66..0bfaa3d097 100644
+--- a/libavcodec/videotoolbox.c
++++ b/libavcodec/videotoolbox.c
+@@ -788,7 +788,9 @@ static CFDictionaryRef videotoolbox_buffer_attributes_create(int width,
      CFDictionarySetValue(buffer_attributes, kCVPixelBufferWidthKey, w);
      CFDictionarySetValue(buffer_attributes, kCVPixelBufferHeightKey, h);
  #if TARGET_OS_IPHONE
@@ -11,3 +21,6 @@ diff -ru ffmpeg/libavcodec/videotoolbox.c ffmpeg/libavcodec/videotoolbox.c
  #else
      CFDictionarySetValue(buffer_attributes, kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey, kCFBooleanTrue);
  #endif
+-- 
+2.45.0.windows.1
+


=====================================
contrib/src/ffmpeg/dxva_vc1_crash.patch
=====================================
@@ -1,7 +1,7 @@
-From f119b395362c9207f70bb86c561d9f4325beb744 Mon Sep 17 00:00:00 2001
+From 2dbcebff1e80541d8aa71041f36a086856987373 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Tue, 23 Jan 2018 13:01:22 +0100
-Subject: [PATCH 02/10] fix crash on bogus frame reference in VC1/MPEG-2 with
+Subject: [PATCH 8/9] fix crash on bogus frame reference in VC1/MPEG-2 with
  DXVA
 
 ---
@@ -10,41 +10,41 @@ Subject: [PATCH 02/10] fix crash on bogus frame reference in VC1/MPEG-2 with
  2 files changed, 4 insertions(+), 4 deletions(-)
 
 diff --git a/libavcodec/dxva2_mpeg2.c b/libavcodec/dxva2_mpeg2.c
-index 75c416654f..5476db245d 100644
+index d88e782414..c3097cb6e5 100644
 --- a/libavcodec/dxva2_mpeg2.c
 +++ b/libavcodec/dxva2_mpeg2.c
-@@ -51,11 +51,11 @@ static void fill_picture_parameters(AVCodecContext *avctx,
+@@ -50,11 +50,11 @@ void ff_dxva2_mpeg2_fill_picture_parameters(AVCodecContext *avctx,
+ 
      memset(pp, 0, sizeof(*pp));
-     pp->wDecodedPictureIndex         = ff_dxva2_get_surface_index(avctx, ctx, current_picture->f);
      pp->wDeblockedPictureIndex       = 0;
 -    if (s->pict_type != AV_PICTURE_TYPE_I)
-+    if (s->pict_type != AV_PICTURE_TYPE_I && s->last_picture.f->data[0])
-         pp->wForwardRefPictureIndex  = ff_dxva2_get_surface_index(avctx, ctx, s->last_picture.f);
++    if (s->pict_type != AV_PICTURE_TYPE_I && s->last_pic.data[0])
+         pp->wForwardRefPictureIndex  = ff_dxva2_get_surface_index(avctx, ctx, s->last_pic.ptr->f, 0);
      else
          pp->wForwardRefPictureIndex  = 0xffff;
 -    if (s->pict_type == AV_PICTURE_TYPE_B)
-+    if (s->pict_type == AV_PICTURE_TYPE_B && s->next_picture.f->data[0])
-         pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_picture.f);
++    if (s->pict_type == AV_PICTURE_TYPE_B && s->next_pic.data[0])
+         pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_pic.ptr->f, 0);
      else
          pp->wBackwardRefPictureIndex = 0xffff;
 diff --git a/libavcodec/dxva2_vc1.c b/libavcodec/dxva2_vc1.c
-index b35fb115f7..f8fe47117e 100644
+index bc9ad9648e..b7608228b0 100644
 --- a/libavcodec/dxva2_vc1.c
 +++ b/libavcodec/dxva2_vc1.c
-@@ -59,11 +59,11 @@ static void fill_picture_parameters(AVCodecContext *avctx,
+@@ -58,11 +58,11 @@ void ff_dxva2_vc1_fill_picture_parameters(AVCodecContext *avctx,
+     }
+ 
      memset(pp, 0, sizeof(*pp));
-     pp->wDecodedPictureIndex    =
-     pp->wDeblockedPictureIndex  = ff_dxva2_get_surface_index(avctx, ctx, current_picture->f);
--    if (s->pict_type != AV_PICTURE_TYPE_I && !v->bi_type)
-+    if (s->pict_type != AV_PICTURE_TYPE_I && !v->bi_type && s->last_picture.f->data[0])
-         pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->last_picture.f);
+-    if (s->pict_type != AV_PICTURE_TYPE_I && !v->bi_type && s->last_pic.ptr)
++    if (s->pict_type != AV_PICTURE_TYPE_I && !v->bi_type && s->last_pic.ptr && s->last_pic.data[0])
+         pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->last_pic.ptr->f, 0);
      else
          pp->wForwardRefPictureIndex = 0xffff;
--    if (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type)
-+    if (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type && s->next_picture.f->data[0])
-         pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_picture.f);
+-    if (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type && s->next_pic.ptr)
++    if (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type && s->next_pic.ptr && s->next_pic.data[0])
+         pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_pic.ptr->f, 0);
      else
          pp->wBackwardRefPictureIndex = 0xffff;
 -- 
-2.37.3.windows.1
+2.45.0.windows.1
 


=====================================
contrib/src/ffmpeg/h264_early_SAR.patch
=====================================
@@ -1,7 +1,7 @@
-From b78662c0d763156f297cfba5331ae4b3c012c940 Mon Sep 17 00:00:00 2001
+From 493ea35f144dbe4dc5abbd18edfb803cba1dcaf0 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Mon, 22 Jan 2018 11:09:56 +0100
-Subject: [PATCH 03/10] avcodec/h264_slice: use the new SAR early when setting
+Subject: [PATCH 1/9] avcodec/h264_slice: use the new SAR early when setting
  the decoder
 
 If we don't do that get_format might not be called for a while and the proper
@@ -13,10 +13,10 @@ See the sample mentioned here: https://trac.videolan.org/vlc/ticket/19435
  1 file changed, 3 insertions(+), 1 deletion(-)
 
 diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
-index 5c17edf9a4..40200a3a3f 100644
+index a66b75ca80..094b36ae28 100644
 --- a/libavcodec/h264_slice.c
 +++ b/libavcodec/h264_slice.c
-@@ -1081,8 +1081,10 @@ static int h264_init_ps(H264Context *h, const H264SliceContext *sl, int first_sl
+@@ -1079,8 +1079,10 @@ static int h264_init_ps(H264Context *h, const H264SliceContext *sl, int first_sl
          || (non_j_pixfmt(h->avctx->pix_fmt) != non_j_pixfmt(get_pixel_format(h, 0))))
          must_reinit = 1;
  
@@ -29,5 +29,5 @@ index 5c17edf9a4..40200a3a3f 100644
      if (!h->setup_finished) {
          h->avctx->profile = ff_h264_get_profile(sps);
 -- 
-2.37.3.windows.1
+2.45.0.windows.1
 


=====================================
contrib/src/ffmpeg/rules.mak
=====================================
@@ -1,9 +1,10 @@
 # FFmpeg
 
 FFMPEG_HASH=ec47a3b95f88fc3f820b900038ac439e4eb3fede
-FFMPEG_MAJVERSION := 6.1
-FFMPEG_REVISION := 1
-FFMPEG_VERSION := $(FFMPEG_MAJVERSION).$(FFMPEG_REVISION)
+FFMPEG_MAJVERSION := 7.1
+FFMPEG_REVISION := 0
+# FFMPEG_VERSION := $(FFMPEG_MAJVERSION).$(FFMPEG_REVISION)
+FFMPEG_VERSION := $(FFMPEG_MAJVERSION)
 FFMPEG_BRANCH=release/$(FFMPEG_MAJVERSION)
 FFMPEG_URL := https://ffmpeg.org/releases/ffmpeg-$(FFMPEG_VERSION).tar.xz
 FFMPEG_GITURL := $(VIDEOLAN_GIT)/ffmpeg.git
@@ -169,10 +170,12 @@ endif
 # Windows
 ifdef HAVE_WIN32
 ifndef HAVE_VISUALSTUDIO
-DEPS_ffmpeg += wine-headers mingw12-fixes
+DEPS_ffmpeg += wine-headers $(DEPS_wine-headers) mingw12-fixes $(DEPS_mingw12-fixes) d3d12 $(DEPS_d3d12)
 endif
 FFMPEGCONF += --target-os=mingw32
 FFMPEGCONF += --enable-w32threads
+# We don't currently support D3D12 in VLC
+FFMPEGCONF += --disable-d3d12va
 ifndef HAVE_WINSTORE
 FFMPEGCONF += --enable-dxva2
 else



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/bbc9223fcd06884409dad1597104bd6d8021332d

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/bbc9223fcd06884409dad1597104bd6d8021332d
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list