This repository has been archived by the owner on Feb 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path0075-lavc-vaapi_hevc-Loose-the-restricts-for-SCC-decoding.patch
52 lines (43 loc) · 2.21 KB
/
0075-lavc-vaapi_hevc-Loose-the-restricts-for-SCC-decoding.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From 9016ed8c0097398f46a83dbe01b22b405faf87e9 Mon Sep 17 00:00:00 2001
From: Linjie Fu <[email protected]>
Date: Wed, 8 Jul 2020 17:27:48 +0800
Subject: [PATCH 11/15] lavc/vaapi_hevc: Loose the restricts for SCC decoding
Allow current picture as the reference picture.
Allow P/B slice without weighted_pred_flag/weighted_bipred_flag.
Signed-off-by: Linjie Fu <[email protected]>
---
libavcodec/vaapi_hevc.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c
index fb9cee36bd..1fc26590fd 100644
--- a/libavcodec/vaapi_hevc.c
+++ b/libavcodec/vaapi_hevc.c
@@ -103,7 +103,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++;
}
@@ -221,7 +222,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,
@@ -377,9 +379,7 @@ static void fill_pred_weight_table(const AVCodecContext *avctx,
slice_param->delta_chroma_log2_weight_denom = 0;
slice_param->luma_log2_weight_denom = 0;
- if (sh->slice_type == HEVC_SLICE_I ||
- (sh->slice_type == HEVC_SLICE_P && !h->ps.pps->weighted_pred_flag) ||
- (sh->slice_type == HEVC_SLICE_B && !h->ps.pps->weighted_bipred_flag))
+ if (sh->slice_type == HEVC_SLICE_I)
return;
slice_param->luma_log2_weight_denom = sh->luma_log2_weight_denom;
--
2.17.1