Merge commit 'd8039ef8d221ea273aa4f1e62e5df21bf618c772'
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 25 May 2015 20:02:00 +0000 (22:02 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 25 May 2015 20:24:34 +0000 (22:24 +0200)
* commit 'd8039ef8d221ea273aa4f1e62e5df21bf618c772':
  D3D11va: add a Direct3D11 video decoder similar to DXVA2

Conflicts:
Changelog
configure
libavcodec/Makefile
libavcodec/allcodecs.c
libavcodec/dxva2_vc1.c
libavcodec/version.h
libavutil/pixdesc.c
libavutil/pixfmt.h
libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
19 files changed:
1  2 
Changelog
configure
libavcodec/Makefile
libavcodec/allcodecs.c
libavcodec/d3d11va.h
libavcodec/dxva2.c
libavcodec/dxva2_h264.c
libavcodec/dxva2_hevc.c
libavcodec/dxva2_internal.h
libavcodec/dxva2_mpeg2.c
libavcodec/dxva2_vc1.c
libavcodec/h264_slice.c
libavcodec/hevc.c
libavcodec/mpeg12dec.c
libavcodec/vc1dec.c
libavcodec/version.h
libavutil/pixdesc.c
libavutil/pixfmt.h
libavutil/version.h

diff --cc Changelog
+++ b/Changelog
@@@ -2,55 -2,17 +2,56 @@@ Entries are sorted chronologically fro
  releases are sorted from youngest to oldest.
  
  version <next>:
 -- aliases and defaults for Ogg subtypes (opus, spx)
 -- HEVC/H.265 RTP payload format (draft v6) packetizer and depacketizer
 -- avplay now exits by default at the end of playback
 -- XCB-based screen-grabber
 -- creating DASH compatible fragmented MP4, MPEG-DASH segmenting muxer
 -- H.261 RTP payload format (RFC 4587) depacketizer and experimental packetizer
 +- FFT video filter
 +- TDSC decoder
 +- DTS lossless extension (XLL) decoding (not lossless, disabled by default)
 +- showwavespic filter
 +- DTS decoding through libdcadec
 +- Drop support for nvenc API before 5.0
 +- nvenc H265 encoder
 +- Detelecine filter
 +- Intel QSV-accelerated H.264 encoding
 +- MMAL-accelerated H.264 decoding
 +- basic APNG encoder and muxer with default extension "apng"
 +- unpack DivX-style packed B-frames in MPEG-4 bitstream filter
 +- WebM Live Chunk Muxer
 +- nvenc level and tier options
 +- chorus filter
 +- Canopus HQ/HQA decoder
 +- Automatically rotate videos based on metadata in ffmpeg
 +- improved Quickdraw compatibility
 +- VP9 high bit-depth and extended colorspaces decoding support
 +- WebPAnimEncoder API when available for encoding and muxing WebP
++- Direct3D11-accelerated decoding
 +
 +
 +version 2.6:
 +- nvenc encoder
 +- 10bit spp filter
 +- colorlevels filter
 +- RIFX format for *.wav files
  - RTP/mpegts muxer
 -- VP8 in Ogg demuxing
 +- non continuous cache protocol support
 +- tblend filter
 +- cropdetect support for non 8bpp, absolute (if limit >= 1) and relative (if limit < 1.0) threshold
 +- Camellia symmetric block cipher
  - OpenH264 encoder wrapper
 +- VOC seeking support
 +- Closed caption Decoder
 +- fspp, uspp, pp7 MPlayer postprocessing filters ported to native filters
 +- showpalette filter
 +- Twofish symmetric block cipher
  - Support DNx100 (960x720@8)
 -- Direct3D11-accelerated decoding
 +- eq2 filter ported from libmpcodecs as eq filter
 +- removed libmpcodecs
 +- Changed default DNxHD colour range in QuickTime .mov derivatives to mpeg range
 +- ported softpulldown filter from libmpcodecs as repeatfields filter
 +- dcshift filter
 +- RTP depacketizer for loss tolerant payload format for MP3 audio (RFC 5219)
 +- RTP depacketizer for AC3 payload format (RFC 4184)
 +- palettegen and paletteuse filters
 +- VP9 RTP payload format (draft 0) experimental depacketizer
 +- RTP depacketizer for DV (RFC 6469)
  - DXVA2-accelerated HEVC decoding
  - AAC ELD 480 decoding
  - Intel QSV-accelerated H.264 decoding
diff --cc configure
+++ b/configure
@@@ -146,13 -131,13 +146,14 @@@ Component options
    --disable-rdft           disable RDFT code
    --disable-fft            disable FFT code
    --disable-faan           disable floating point AAN (I)DCT code
 +  --disable-pixelutils     disable pixel utils in libavutil
  
  Hardware accelerators:
 -  --enable-dxva2           enable DXVA2 code
 -  --enable-vaapi           enable VAAPI code
 -  --enable-vda             enable VDA code
 -  --enable-vdpau           enable VDPAU code
+   --enable-d3d11va         enable D3D11VA code
 +  --disable-dxva2          disable DXVA2 code [autodetect]
 +  --disable-vaapi          disable VAAPI code [autodetect]
 +  --disable-vda            disable VDA code [autodetect]
 +  --disable-vdpau          disable VDPAU code [autodetect]
  
  Individual component options:
    --disable-everything     disable all components listed below
@@@ -1670,8 -1398,8 +1672,9 @@@ HEADERS_LIST=
      dev_video_meteor_ioctl_meteor_h
      direct_h
      dlfcn_h
+     d3d11_h
      dxva_h
 +    ES2_gl_h
      gsm_h
      io_h
      mach_mach_time_h
@@@ -1845,7 -1554,8 +1848,9 @@@ HAVE_LIST=
      $TYPES_LIST
      atomics_native
      dos_paths
+     d3d11_cobj
+     d3d11va_lib
 +    dxva2api_cobj
      dxva2_lib
      libc_msvcrt
      libdc1394_1
@@@ -2306,14 -1963,14 +2311,15 @@@ wmv2_decoder_select="blockdsp h263_deco
  wmv2_encoder_select="h263_encoder"
  wmv3_decoder_select="vc1_decoder"
  wmv3image_decoder_select="wmv3_decoder"
 -zerocodec_decoder_deps="zlib"
 -zlib_decoder_deps="zlib"
 -zlib_encoder_deps="zlib"
 -zmbv_decoder_deps="zlib"
 -zmbv_encoder_deps="zlib"
 +zerocodec_decoder_select="zlib"
 +zlib_decoder_select="zlib"
 +zlib_encoder_select="zlib"
 +zmbv_decoder_select="zlib"
 +zmbv_encoder_select="zlib"
  
  # hardware accelerators
 +crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
+ d3d11va_deps="d3d11_h dxva_h"
  dxva2_deps="dxva2api_h"
  vaapi_deps="va_va_h"
  vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
@@@ -2325,7 -1981,8 +2331,9 @@@ h263_vaapi_hwaccel_deps="vaapi
  h263_vaapi_hwaccel_select="h263_decoder"
  h263_vdpau_hwaccel_deps="vdpau"
  h263_vdpau_hwaccel_select="h263_decoder"
 +h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
+ h264_d3d11va_hwaccel_deps="d3d11va"
+ h264_d3d11va_hwaccel_select="h264_decoder"
  h264_dxva2_hwaccel_deps="dxva2"
  h264_dxva2_hwaccel_select="h264_decoder"
  h264_mmal_decoder_deps="mmal"
@@@ -2341,52 -1996,37 +2349,59 @@@ h264_vda_hwaccel_deps="vda
  h264_vda_hwaccel_select="h264_decoder"
  h264_vda_old_hwaccel_deps="vda"
  h264_vda_old_hwaccel_select="h264_decoder"
 +h264_vdpau_decoder_deps="vdpau"
 +h264_vdpau_decoder_select="h264_decoder"
  h264_vdpau_hwaccel_deps="vdpau"
  h264_vdpau_hwaccel_select="h264_decoder"
+ hevc_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
+ hevc_d3d11va_hwaccel_select="hevc_decoder"
  hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
  hevc_dxva2_hwaccel_select="hevc_decoder"
 +mpeg_vdpau_decoder_deps="vdpau"
 +mpeg_vdpau_decoder_select="mpeg2video_decoder"
 +mpeg_xvmc_hwaccel_deps="xvmc"
 +mpeg_xvmc_hwaccel_select="mpeg2video_decoder"
 +mpeg1_vdpau_decoder_deps="vdpau"
 +mpeg1_vdpau_decoder_select="mpeg1video_decoder"
  mpeg1_vdpau_hwaccel_deps="vdpau"
  mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
 +mpeg1_xvmc_hwaccel_deps="xvmc"
 +mpeg1_xvmc_hwaccel_select="mpeg1video_decoder"
 +mpeg2_crystalhd_decoder_select="crystalhd"
+ mpeg2_d3d11va_hwaccel_deps="d3d11va"
+ mpeg2_d3d11va_hwaccel_select="mpeg2video_decoder"
  mpeg2_dxva2_hwaccel_deps="dxva2"
  mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
  mpeg2_vaapi_hwaccel_deps="vaapi"
  mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
  mpeg2_vdpau_hwaccel_deps="vdpau"
  mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
 +mpeg2_xvmc_hwaccel_deps="xvmc"
 +mpeg2_xvmc_hwaccel_select="mpeg2video_decoder"
 +mpeg4_crystalhd_decoder_select="crystalhd"
  mpeg4_vaapi_hwaccel_deps="vaapi"
  mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
 +mpeg4_vdpau_decoder_deps="vdpau"
 +mpeg4_vdpau_decoder_select="mpeg4_decoder"
  mpeg4_vdpau_hwaccel_deps="vdpau"
  mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
 +msmpeg4_crystalhd_decoder_select="crystalhd"
 +vc1_crystalhd_decoder_select="crystalhd"
+ vc1_d3d11va_hwaccel_deps="d3d11va"
+ vc1_d3d11va_hwaccel_select="vc1_decoder"
  vc1_dxva2_hwaccel_deps="dxva2"
  vc1_dxva2_hwaccel_select="vc1_decoder"
  vc1_vaapi_hwaccel_deps="vaapi"
  vc1_vaapi_hwaccel_select="vc1_decoder"
 +vc1_vdpau_decoder_deps="vdpau"
 +vc1_vdpau_decoder_select="vc1_decoder"
  vc1_vdpau_hwaccel_deps="vdpau"
  vc1_vdpau_hwaccel_select="vc1_decoder"
 +wmv3_crystalhd_decoder_select="crystalhd"
+ wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel"
  wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
  wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
 +wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
  wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
  
  # parsers
@@@ -2810,12 -2302,8 +2825,12 @@@ enable stati
  enable swscale_alpha
  enable valgrind_backtrace
  
 -# By default, enable only those hwaccels that have no external dependencies.
 -enable d3d11va dxva2 vda vdpau
 +sws_max_filter_size_default=256
 +set_default sws_max_filter_size
 +
 +# Enable hwaccels by default.
- enable dxva2 vaapi vda vdpau xvmc
++enable d3d11va dxva2 vaapi vda vdpau xvmc
 +enable xlib
  
  # build settings
  SHFLAGS='-shared -Wl,-soname,$$(@F)'
@@@ -4945,13 -4170,12 +4960,14 @@@ enabled xlib &
  
  check_header direct.h
  check_header dlfcn.h
+ check_header d3d11.h
  check_header dxva.h
 -check_header dxva2api.h
 +check_header dxva2api.h -D_WIN32_WINNT=0x0600
  check_header io.h
 +check_header libcrystalhd/libcrystalhd_if.h
  check_header mach/mach_time.h
  check_header malloc.h
 +check_header net/udplite.h
  check_header poll.h
  check_header sys/mman.h
  check_header sys/param.h
@@@ -5281,22 -4388,15 +5297,31 @@@ if enabled x11grab; the
      require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
  fi
  
 +check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
 +
 +enabled dxva2api_h &&
 +    check_cc <<EOF && enable dxva2api_cobj
 +#define _WIN32_WINNT 0x0600
 +#define COBJMACROS
 +#include <windows.h>
 +#include <d3d9.h>
 +#include <dxva2api.h>
 +int main(void) { IDirectXVideoDecoder *o = NULL; IDirectXVideoDecoder_Release(o); return 0; }
 +EOF
 +
+ enabled d3d11_h &&
+     check_cc <<EOF && enable d3d11_cobj
+ #define _WIN32_WINNT 0x0600
+ #define COBJMACROS
+ #include <windows.h>
+ #include <d3d11.h>
+ int main(void) { ID3D11VideoDecoder *o = NULL; ID3D11VideoDecoder_Release(o); return 0; }
+ EOF
 +enabled vaapi &&
 +    check_lib va/va.h vaInitialize -lva ||
 +    disable vaapi
 +
  enabled vaapi && enabled xlib &&
      check_lib2 "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 &&
      enable vaapi_x11
@@@ -5542,16 -4618,12 +5567,20 @@@ check_deps $CONFIG_LIST       
             $HAVE_LIST         \
             $ALL_COMPONENTS    \
  
 -    prepend avconv_libs $($ldflags_filter "-lole32") &&
 +enabled threads && ! enabled pthreads && ! enabled atomics_native && die "non pthread threading without atomics not supported, try adding --enable-pthreads or --cpu=i486 or higher if you are on x86"
 +
 +
 +if test $target_os = "haiku"; then
 +    disable memalign
 +    disable posix_memalign
 +fi
 +
+ enabled_all d3d11va d3d11_cobj CoTaskMemFree &&
 -enabled_all dxva2 CoTaskMemFree &&
 -    prepend avconv_libs $($ldflags_filter "-lole32") &&
++    prepend ffmpeg_libs $($ldflags_filter "-lole32") &&
+     enable d3d11va_lib
 +enabled_all dxva2 dxva2api_cobj CoTaskMemFree &&
 +    prepend ffmpeg_libs $($ldflags_filter "-lole32" "-luser32") &&
      enable dxva2_lib
  
  ! enabled_any memalign posix_memalign aligned_malloc &&
@@@ -5,8 -3,8 +5,9 @@@ NAME = avcode
  HEADERS = avcodec.h                                                     \
            avfft.h                                                       \
            dv_profile.h                                                  \
+           d3d11va.h                                                     \
            dxva2.h                                                       \
 +          old_codec_ids.h                                               \
            qsv.h                                                         \
            vaapi.h                                                       \
            vda.h                                                         \
@@@ -668,9 -556,9 +669,10 @@@ OBJS-$(CONFIG_ADPCM_VIMA_DECODER
  OBJS-$(CONFIG_ADPCM_XA_DECODER)           += adpcm.o adpcm_data.o
  OBJS-$(CONFIG_ADPCM_YAMAHA_DECODER)       += adpcm.o adpcm_data.o
  OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER)       += adpcmenc.o adpcm_data.o
 +OBJS-$(CONFIG_VIMA_DECODER)               += vima.o adpcm_data.o
  
  # hardware accelerators
+ OBJS-$(CONFIG_D3D11VA)                    += dxva2.o
  OBJS-$(CONFIG_DXVA2)                      += dxva2.o
  OBJS-$(CONFIG_VAAPI)                      += vaapi.o
  OBJS-$(CONFIG_VDA)                        += vda.o
@@@ -682,15 -571,16 +685,18 @@@ OBJS-$(CONFIG_H264_DXVA2_HWACCEL
  OBJS-$(CONFIG_H264_VAAPI_HWACCEL)         += vaapi_h264.o
  OBJS-$(CONFIG_H264_VDA_HWACCEL)           += vda_h264.o
  OBJS-$(CONFIG_H264_VDPAU_HWACCEL)         += vdpau_h264.o
+ OBJS-$(CONFIG_HEVC_D3D11VA_HWACCEL)       += dxva2_hevc.o
  OBJS-$(CONFIG_HEVC_DXVA2_HWACCEL)         += dxva2_hevc.o
  OBJS-$(CONFIG_MPEG1_VDPAU_HWACCEL)        += vdpau_mpeg12.o
 +OBJS-$(CONFIG_MPEG1_XVMC_HWACCEL)         += mpegvideo_xvmc.o
+ OBJS-$(CONFIG_MPEG2_D3D11VA_HWACCEL)      += dxva2_mpeg2.o
  OBJS-$(CONFIG_MPEG2_DXVA2_HWACCEL)        += dxva2_mpeg2.o
  OBJS-$(CONFIG_MPEG2_VAAPI_HWACCEL)        += vaapi_mpeg2.o
  OBJS-$(CONFIG_MPEG2_VDPAU_HWACCEL)        += vdpau_mpeg12.o
 +OBJS-$(CONFIG_MPEG2_XVMC_HWACCEL)         += mpegvideo_xvmc.o
  OBJS-$(CONFIG_MPEG4_VAAPI_HWACCEL)        += vaapi_mpeg4.o
  OBJS-$(CONFIG_MPEG4_VDPAU_HWACCEL)        += vdpau_mpeg4.o
+ OBJS-$(CONFIG_VC1_D3D11VA_HWACCEL)        += dxva2_vc1.o
  OBJS-$(CONFIG_VC1_DXVA2_HWACCEL)          += dxva2_vc1.o
  OBJS-$(CONFIG_VC1_VAAPI_HWACCEL)          += vaapi_vc1.o
  OBJS-$(CONFIG_VC1_VDPAU_HWACCEL)          += vdpau_vc1.o
@@@ -866,15 -726,13 +872,16 @@@ SKIPHEADERS                            
                                            %_tables.h                    \
                                            aac_tablegen_decl.h           \
                                            fft-internal.h                \
 +                                          libutvideo.h                  \
 +                                          old_codec_ids.h               \
                                            tableprint.h                  \
 +                                          tableprint_vlc.h              \
                                            $(ARCH)/vp56_arith.h          \
  
+ SKIPHEADERS-$(CONFIG_D3D11VA)          += d3d11va.h dxva2_internal.h
  SKIPHEADERS-$(CONFIG_DXVA2)            += dxva2.h dxva2_internal.h
  SKIPHEADERS-$(CONFIG_LIBSCHROEDINGER)  += libschroedinger.h
 -SKIPHEADERS-$(CONFIG_MPEG_XVMC_DECODER) += xvmc.h
 +SKIPHEADERS-$(CONFIG_LIBUTVIDEO)       += libutvideo.h
  SKIPHEADERS-$(CONFIG_QSV)              += qsv.h qsv_internal.h
  SKIPHEADERS-$(CONFIG_QSVDEC)           += qsvdec.h
  SKIPHEADERS-$(CONFIG_QSVENC)           += qsvenc.h
@@@ -83,10 -84,10 +84,12 @@@ void avcodec_register_all(void
      REGISTER_HWACCEL(H264_VDA,          h264_vda);
      REGISTER_HWACCEL(H264_VDA_OLD,      h264_vda_old);
      REGISTER_HWACCEL(H264_VDPAU,        h264_vdpau);
+     REGISTER_HWACCEL(HEVC_D3D11VA,      hevc_d3d11va);
      REGISTER_HWACCEL(HEVC_DXVA2,        hevc_dxva2);
 +    REGISTER_HWACCEL(MPEG1_XVMC,        mpeg1_xvmc);
      REGISTER_HWACCEL(MPEG1_VDPAU,       mpeg1_vdpau);
 +    REGISTER_HWACCEL(MPEG2_XVMC,        mpeg2_xvmc);
+     REGISTER_HWACCEL(MPEG2_D3D11VA,     mpeg2_d3d11va);
      REGISTER_HWACCEL(MPEG2_DXVA2,       mpeg2_dxva2);
      REGISTER_HWACCEL(MPEG2_VAAPI,       mpeg2_vaapi);
      REGISTER_HWACCEL(MPEG2_VDPAU,       mpeg2_vdpau);
index 0000000,2163b35..d51e2ff
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,98 +1,98 @@@
 - * This file is part of Libav.
+ /*
+  * Direct3D11 HW acceleration
+  *
+  * copyright (c) 2009 Laurent Aimar
+  * copyright (c) 2015 Steve Lhomme
+  *
 - * Libav is free software; you can redistribute it and/or
++ * This file is part of FFmpeg.
+  *
 - * Libav is distributed in the hope that it will be useful,
++ * FFmpeg is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU Lesser General Public
+  * License as published by the Free Software Foundation; either
+  * version 2.1 of the License, or (at your option) any later version.
+  *
 - * License along with Libav; if not, write to the Free Software
++ * FFmpeg is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
 - * to the Direct3D11 Libav HWAccel implementation.
++ * License along with FFmpeg; if not, write to the Free Software
+  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+  */
+ #ifndef AVCODEC_D3D11VA_H
+ #define AVCODEC_D3D11VA_H
+ /**
+  * @file
+  * @ingroup lavc_codec_hwaccel_d3d11va
+  * Public libavcodec D3D11VA header.
+  */
+ #if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600
+ #undef _WIN32_WINNT
+ #define _WIN32_WINNT 0x0600
+ #endif
+ #include <stdint.h>
+ #include <d3d11.h>
+ /**
+  * @defgroup lavc_codec_hwaccel_d3d11va Direct3D11
+  * @ingroup lavc_codec_hwaccel
+  *
+  * @{
+  */
+ #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
+ /**
+  * This structure is used to provides the necessary configurations and data
 -     * Private to the Libav AVHWAccel implementation
++ * to the Direct3D11 FFmpeg HWAccel implementation.
+  *
+  * The application must make it available as AVCodecContext.hwaccel_context.
+  */
+ struct AVD3D11VAContext {
+     /**
+      * D3D11 decoder object
+      */
+     ID3D11VideoDecoder *decoder;
+     /**
+       * D3D11 VideoContext
+       */
+     ID3D11VideoContext *video_context;
+     /**
+      * D3D11 configuration used to create the decoder
+      */
+     D3D11_VIDEO_DECODER_CONFIG *cfg;
+     /**
+      * The number of surface in the surface array
+      */
+     unsigned surface_count;
+     /**
+      * The array of Direct3D surfaces used to create the decoder
+      */
+     ID3D11VideoDecoderOutputView **surface;
+     /**
+      * A bit field configuring the workarounds needed for using the decoder
+      */
+     uint64_t workaround;
+     /**
++     * Private to the FFmpeg AVHWAccel implementation
+      */
+     unsigned report_id;
+ };
+ /**
+  * @}
+  */
+ #endif /* AVCODEC_D3D11VA_H */
Simple merge
@@@ -152,11 -152,11 +152,11 @@@ static void fill_picture_parameters(con
      pp->deblocking_filter_control_present_flag = h->pps.deblocking_filter_parameters_present;
      pp->redundant_pic_cnt_present_flag= h->pps.redundant_pic_cnt_present;
      pp->Reserved8BitsB                = 0;
 -    pp->slice_group_change_rate_minus1= 0;  /* XXX not implemented by Libav */
 -    //pp->SliceGroupMap[810];               /* XXX not implemented by Libav */
 +    pp->slice_group_change_rate_minus1= 0;  /* XXX not implemented by FFmpeg */
 +    //pp->SliceGroupMap[810];               /* XXX not implemented by FFmpeg */
  }
  
- static void fill_scaling_lists(struct dxva_context *ctx, const H264Context *h, DXVA_Qmatrix_H264 *qm)
+ static void fill_scaling_lists(const AVCodecContext *avctx, AVDXVAContext *ctx, const H264Context *h, DXVA_Qmatrix_H264 *qm)
  {
      unsigned i, j;
      memset(qm, 0, sizeof(*qm));
Simple merge
Simple merge
Simple merge
@@@ -82,9 -73,9 +82,9 @@@ static void fill_picture_parameters(AVC
      pp->bPicIntra               = s->pict_type == AV_PICTURE_TYPE_I || v->bi_type;
      pp->bPicBackwardPrediction  = s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type;
      pp->bBidirectionalAveragingMode = (1                                           << 7) |
-                                       ((ctx->cfg->ConfigIntraResidUnsigned != 0)   << 6) |
-                                       ((ctx->cfg->ConfigResidDiffAccelerator != 0) << 5) |
+                                       ((DXVA_CONTEXT_CFG_INTRARESID(avctx, ctx) != 0) << 6) |
+                                       ((DXVA_CONTEXT_CFG_RESIDACCEL(avctx, ctx) != 0) << 5) |
 -                                      ((v->lumscale != 32 || v->lumshift != 0)     << 4) |
 +                                      (intcomp                                     << 4) |
                                        ((v->profile == PROFILE_ADVANCED)            << 3);
      pp->bMVprecisionAndChromaRelation = ((v->mv_mode == MV_PMODE_1MV_HPEL_BILIN) << 3) |
                                          (1                                       << 2) |
Simple merge
@@@ -343,20 -446,18 +343,23 @@@ static int set_sps(HEVCContext *s, cons
  #if CONFIG_HEVC_DXVA2_HWACCEL
          *fmt++ = AV_PIX_FMT_DXVA2_VLD;
  #endif
+ #if CONFIG_HEVC_D3D11VA_HWACCEL
+         *fmt++ = AV_PIX_FMT_D3D11VA_VLD;
+ #endif
      }
  
 -    *fmt++ = sps->pix_fmt;
 -    *fmt = AV_PIX_FMT_NONE;
 +    if (pix_fmt == AV_PIX_FMT_NONE) {
 +        *fmt++ = sps->pix_fmt;
 +        *fmt = AV_PIX_FMT_NONE;
  
 -    ret = ff_get_format(s->avctx, pix_fmts);
 -    if (ret < 0)
 -        goto fail;
 -    s->avctx->pix_fmt = ret;
 +        ret = ff_thread_get_format(s->avctx, pix_fmts);
 +        if (ret < 0)
 +            goto fail;
 +        s->avctx->pix_fmt = ret;
 +    }
 +    else {
 +        s->avctx->pix_fmt = pix_fmt;
 +    }
  
      ff_hevc_pred_init(&s->hpc,     sps->bit_depth);
      ff_hevc_dsp_init (&s->hevcdsp, sps->bit_depth);
Simple merge
Simple merge
@@@ -29,8 -29,8 +29,8 @@@
  #include "libavutil/version.h"
  
  #define LIBAVCODEC_VERSION_MAJOR 56
- #define LIBAVCODEC_VERSION_MINOR  40
 -#define LIBAVCODEC_VERSION_MINOR 25
 -#define LIBAVCODEC_VERSION_MICRO  0
++#define LIBAVCODEC_VERSION_MINOR  41
 +#define LIBAVCODEC_VERSION_MICRO 100
  
  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                 LIBAVCODEC_VERSION_MINOR, \
@@@ -1538,54 -1333,12 +1538,60 @@@ const AVPixFmtDescriptor av_pix_fmt_des
          },
          .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
      },
 +    [AV_PIX_FMT_YUV444P12LE] = {
 +        .name = "yuv444p12le",
 +        .nb_components = 3,
 +        .log2_chroma_w = 0,
 +        .log2_chroma_h = 0,
 +        .comp = {
 +            { 0, 1, 1, 0, 11 },        /* Y */
 +            { 1, 1, 1, 0, 11 },        /* U */
 +            { 2, 1, 1, 0, 11 },        /* V */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_PLANAR,
 +    },
 +    [AV_PIX_FMT_YUV444P12BE] = {
 +        .name = "yuv444p12be",
 +        .nb_components = 3,
 +        .log2_chroma_w = 0,
 +        .log2_chroma_h = 0,
 +        .comp = {
 +            { 0, 1, 1, 0, 11 },        /* Y */
 +            { 1, 1, 1, 0, 11 },        /* U */
 +            { 2, 1, 1, 0, 11 },        /* V */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
 +    },
 +    [AV_PIX_FMT_YUV444P14LE] = {
 +        .name = "yuv444p14le",
 +        .nb_components = 3,
 +        .log2_chroma_w = 0,
 +        .log2_chroma_h = 0,
 +        .comp = {
 +            { 0, 1, 1, 0, 13 },        /* Y */
 +            { 1, 1, 1, 0, 13 },        /* U */
 +            { 2, 1, 1, 0, 13 },        /* V */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_PLANAR,
 +    },
 +    [AV_PIX_FMT_YUV444P14BE] = {
 +        .name = "yuv444p14be",
 +        .nb_components = 3,
 +        .log2_chroma_w = 0,
 +        .log2_chroma_h = 0,
 +        .comp = {
 +            { 0, 1, 1, 0, 13 },        /* Y */
 +            { 1, 1, 1, 0, 13 },        /* U */
 +            { 2, 1, 1, 0, 13 },        /* V */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
 +    },
+     [AV_PIX_FMT_D3D11VA_VLD] = {
+         .name = "d3d11va_vld",
+         .log2_chroma_w = 1,
+         .log2_chroma_h = 1,
+         .flags = AV_PIX_FMT_FLAG_HWACCEL,
+     },
      [AV_PIX_FMT_DXVA2_VLD] = {
          .name = "dxva2_vld",
          .log2_chroma_w = 1,
@@@ -258,60 -220,8 +258,62 @@@ enum AVPixelFormat 
       */
      AV_PIX_FMT_MMAL,
  
+     AV_PIX_FMT_D3D11VA_VLD,  ///< HW decoding through Direct3D11, Picture.data[3] contains a ID3D11VideoDecoderOutputView pointer
 +#ifndef AV_PIX_FMT_ABI_GIT_MASTER
 +    AV_PIX_FMT_RGBA64BE=0x123,  ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
 +    AV_PIX_FMT_RGBA64LE,  ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
 +    AV_PIX_FMT_BGRA64BE,  ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
 +    AV_PIX_FMT_BGRA64LE,  ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
 +#endif
 +    AV_PIX_FMT_0RGB=0x123+4,///< packed RGB 8:8:8, 32bpp, XRGBXRGB...   X=unused/undefined
 +    AV_PIX_FMT_RGB0,        ///< packed RGB 8:8:8, 32bpp, RGBXRGBX...   X=unused/undefined
 +    AV_PIX_FMT_0BGR,        ///< packed BGR 8:8:8, 32bpp, XBGRXBGR...   X=unused/undefined
 +    AV_PIX_FMT_BGR0,        ///< packed BGR 8:8:8, 32bpp, BGRXBGRX...   X=unused/undefined
 +    AV_PIX_FMT_YUVA444P,  ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
 +    AV_PIX_FMT_YUVA422P,  ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
 +
 +    AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
 +    AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
 +    AV_PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
 +    AV_PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
 +    AV_PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
 +    AV_PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
 +    AV_PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
 +    AV_PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
 +    AV_PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
 +    AV_PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
 +    AV_PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
 +    AV_PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
 +    AV_PIX_FMT_GBRP12BE,    ///< planar GBR 4:4:4 36bpp, big-endian
 +    AV_PIX_FMT_GBRP12LE,    ///< planar GBR 4:4:4 36bpp, little-endian
 +    AV_PIX_FMT_GBRP14BE,    ///< planar GBR 4:4:4 42bpp, big-endian
 +    AV_PIX_FMT_GBRP14LE,    ///< planar GBR 4:4:4 42bpp, little-endian
 +    AV_PIX_FMT_GBRAP,       ///< planar GBRA 4:4:4:4 32bpp
 +    AV_PIX_FMT_GBRAP16BE,   ///< planar GBRA 4:4:4:4 64bpp, big-endian
 +    AV_PIX_FMT_GBRAP16LE,   ///< planar GBRA 4:4:4:4 64bpp, little-endian
 +    AV_PIX_FMT_YUVJ411P,    ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV411P and setting color_range
 +
 +    AV_PIX_FMT_BAYER_BGGR8,    ///< bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples */
 +    AV_PIX_FMT_BAYER_RGGB8,    ///< bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples */
 +    AV_PIX_FMT_BAYER_GBRG8,    ///< bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples */
 +    AV_PIX_FMT_BAYER_GRBG8,    ///< bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples */
 +    AV_PIX_FMT_BAYER_BGGR16LE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, little-endian */
 +    AV_PIX_FMT_BAYER_BGGR16BE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, big-endian */
 +    AV_PIX_FMT_BAYER_RGGB16LE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian */
 +    AV_PIX_FMT_BAYER_RGGB16BE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, big-endian */
 +    AV_PIX_FMT_BAYER_GBRG16LE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian */
 +    AV_PIX_FMT_BAYER_GBRG16BE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian */
 +    AV_PIX_FMT_BAYER_GRBG16LE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian */
 +    AV_PIX_FMT_BAYER_GRBG16BE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian */
 +#if !FF_API_XVMC
 +    AV_PIX_FMT_XVMC,///< XVideo Motion Acceleration via common packet passing
 +#endif /* !FF_API_XVMC */
 +    AV_PIX_FMT_YUV440P10LE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
 +    AV_PIX_FMT_YUV440P10BE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
 +    AV_PIX_FMT_YUV440P12LE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
 +    AV_PIX_FMT_YUV440P12BE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
 +
      AV_PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
  
  #if FF_API_PIX_FMT
@@@ -55,9 -53,9 +55,9 @@@
   * @{
   */
  
 -#define LIBAVUTIL_VERSION_MAJOR 54
 -#define LIBAVUTIL_VERSION_MINOR 13
 -#define LIBAVUTIL_VERSION_MICRO  1
 +#define LIBAVUTIL_VERSION_MAJOR  54
- #define LIBAVUTIL_VERSION_MINOR  23
- #define LIBAVUTIL_VERSION_MICRO 101
++#define LIBAVUTIL_VERSION_MINOR  24
++#define LIBAVUTIL_VERSION_MICRO 100
  
  #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
                                                 LIBAVUTIL_VERSION_MINOR, \