]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dxva2_hevc.c
vaapi_encode: Support VBR mode
[ffmpeg] / libavcodec / dxva2_hevc.c
index 88d47823b86d9753d39731c543ab3caab1364f06..17548d25bb3819533c3090aa61b3cae4e5985c39 100644 (file)
 
 #include "libavutil/avassert.h"
 
+#include "hevc_data.h"
+#include "hevcdec.h"
+
+// The headers above may include w32threads.h, which uses the original
+// _WIN32_WINNT define, while dxva2_internal.h redefines it to target a
+// potentially newer version.
 #include "dxva2_internal.h"
-#include "hevc.h"
 
 #define MAX_SLICES 256
 
@@ -92,7 +97,7 @@ static void fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *
     pp->init_qp_minus26                          = pps->pic_init_qp_minus26;
 
     if (h->sh.short_term_ref_pic_set_sps_flag == 0 && h->sh.short_term_rps) {
-        pp->ucNumDeltaPocsOfRefRpsIdx            = h->sh.short_term_rps->num_delta_pocs;
+        pp->ucNumDeltaPocsOfRefRpsIdx            = h->sh.short_term_rps->rps_idx_num_delta_pocs;
         pp->wNumBitsForShortTermRPSInSlice       = h->sh.short_term_ref_pic_set_size;
     }
 
@@ -360,9 +365,7 @@ static int dxva2_hevc_start_frame(AVCodecContext *avctx,
     AVDXVAContext *ctx = avctx->hwaccel_context;
     struct hevc_dxva2_picture_context *ctx_pic = h->ref->hwaccel_picture_private;
 
-    if (DXVA_CONTEXT_DECODER(avctx, ctx) == NULL ||
-        DXVA_CONTEXT_CFG(avctx, ctx) == NULL ||
-        DXVA_CONTEXT_COUNT(avctx, ctx) <= 0)
+    if (!DXVA_CONTEXT_VALID(avctx, ctx))
         return -1;
     av_assert0(ctx_pic);