diff mbox series

[FFmpeg-devel,v1,11/13] lavc/vaapi_hevc: Loose the restricts for SCC decoding

Message ID 20221201081408.2194579-11-fei.w.wang@intel.com
State New
Headers show
Series [FFmpeg-devel,v1,01/13] lavc/hevc_ps: remove profile limitation of pps_range_extensions() | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Fei Wang Dec. 1, 2022, 8:14 a.m. UTC
From: Linjie Fu <linjie.fu@intel.com>

Allow current picture as the reference picture.

Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
---
 libavcodec/vaapi_hevc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c
index 005d782819..ca14052d56 100644
--- a/libavcodec/vaapi_hevc.c
+++ b/libavcodec/vaapi_hevc.c
@@ -104,7 +104,8 @@  static void fill_vaapi_reference_frames(const HEVCContext *h, VAPictureParameter
         const HEVCFrame *frame = NULL;
 
         while (!frame && j < FF_ARRAY_ELEMS(h->DPB)) {
-            if (&h->DPB[j] != current_picture && (h->DPB[j].flags & (HEVC_FRAME_FLAG_LONG_REF | HEVC_FRAME_FLAG_SHORT_REF)))
+            if ((&h->DPB[j] != current_picture || h->ps.pps->pps_curr_pic_ref_enabled_flag) &&
+                (h->DPB[j].flags & (HEVC_FRAME_FLAG_LONG_REF | HEVC_FRAME_FLAG_SHORT_REF)))
                 frame = &h->DPB[j];
             j++;
         }
@@ -222,7 +223,8 @@  static int vaapi_hevc_start_frame(AVCodecContext          *avctx,
     }
 
 #if VA_CHECK_VERSION(1, 2, 0)
-    if (avctx->profile == FF_PROFILE_HEVC_REXT) {
+    if (avctx->profile == FF_PROFILE_HEVC_REXT ||
+        avctx->profile == FF_PROFILE_HEVC_SCC) {
         pic->pic_param.rext = (VAPictureParameterBufferHEVCRext) {
             .range_extension_pic_fields.bits  = {
                 .transform_skip_rotation_enabled_flag       = sps->transform_skip_rotation_enabled_flag,