Module: Mesa
Branch: main
Commit: ffdc83e9dd7bfcd638d1669a7ed807ebf79cbaea
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ffdc83e9dd7bfcd638d1669a7ed807ebf79cbaea

Author: Boyuan Zhang <[email protected]>
Date:   Mon Nov  6 13:29:57 2023 -0500

frontend/va: add support for multi slices reflist

According to codec spec, hevc supports different reference picture lists
for multi slices case. For example, each slice can have it's own ref pic
list. Add this support to pipe, and modify both frontend/va and radeonsi
accordingly.

Signed-off-by: Boyuan Zhang <[email protected]>
Reviewed-by: Leo Liu <[email protected]>
Reviewed-by: Ruijing Dong <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26081>

---

 src/gallium/drivers/radeonsi/radeon_uvd.c     | 2 +-
 src/gallium/drivers/radeonsi/radeon_vcn_dec.c | 2 +-
 src/gallium/frontends/va/picture_hevc.c       | 4 ++--
 src/gallium/include/pipe/p_video_state.h      | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/radeon_uvd.c 
b/src/gallium/drivers/radeonsi/radeon_uvd.c
index dd203777df9..d51b1b6c545 100644
--- a/src/gallium/drivers/radeonsi/radeon_uvd.c
+++ b/src/gallium/drivers/radeonsi/radeon_uvd.c
@@ -733,7 +733,7 @@ static struct ruvd_h265 get_h265_msg(struct ruvd_decoder 
*dec, struct pipe_video
 
    for (i = 0; i < 2; i++) {
       for (j = 0; j < 15; j++)
-         result.direct_reflist[i][j] = pic->RefPicList[i][j];
+         result.direct_reflist[i][j] = pic->RefPicList[0][i][j];
    }
 
    if (pic->base.profile == PIPE_VIDEO_PROFILE_HEVC_MAIN_10) {
diff --git a/src/gallium/drivers/radeonsi/radeon_vcn_dec.c 
b/src/gallium/drivers/radeonsi/radeon_vcn_dec.c
index 9f044005ee0..4755af42de4 100644
--- a/src/gallium/drivers/radeonsi/radeon_vcn_dec.c
+++ b/src/gallium/drivers/radeonsi/radeon_vcn_dec.c
@@ -446,7 +446,7 @@ static rvcn_dec_message_hevc_t get_h265_msg(struct 
radeon_decoder *dec,
 
    for (i = 0; i < 2; i++) {
       for (j = 0; j < 15; j++)
-         result.direct_reflist[i][j] = pic->RefPicList[i][j];
+         result.direct_reflist[i][j] = pic->RefPicList[0][i][j];
    }
 
    if (pic->base.profile == PIPE_VIDEO_PROFILE_HEVC_MAIN_10) {
diff --git a/src/gallium/frontends/va/picture_hevc.c 
b/src/gallium/frontends/va/picture_hevc.c
index 783ddb828a6..f773bd01adc 100644
--- a/src/gallium/frontends/va/picture_hevc.c
+++ b/src/gallium/frontends/va/picture_hevc.c
@@ -233,11 +233,11 @@ void vlVaHandleSliceParameterBufferHEVC(vlVaContext 
*context, vlVaBuffer *buf)
    /* Depending on slice_type, only update relevant reference */
    case 0: /* HEVC_SLICE_B */
       for (int j = 0 ; j < 15 ; j++)
-         context->desc.h265.RefPicList[1][j] = h265->RefPicList[1][j];
+         
context->desc.h265.RefPicList[context->desc.h265.slice_parameter.slice_count][1][j]
 = h265->RefPicList[1][j];
       FALLTHROUGH;
    case 1: /* HEVC_SLICE_P */
       for (int j = 0 ; j < 15 ; j++)
-         context->desc.h265.RefPicList[0][j] = h265->RefPicList[0][j];
+         
context->desc.h265.RefPicList[context->desc.h265.slice_parameter.slice_count][0][j]
 = h265->RefPicList[0][j];
       FALLTHROUGH;
    default:
       break;
diff --git a/src/gallium/include/pipe/p_video_state.h 
b/src/gallium/include/pipe/p_video_state.h
index 2ee1201cc52..f3e7d418207 100644
--- a/src/gallium/include/pipe/p_video_state.h
+++ b/src/gallium/include/pipe/p_video_state.h
@@ -1160,7 +1160,7 @@ struct pipe_h265_picture_desc
    uint8_t RefPicSetStCurrBefore[8];
    uint8_t RefPicSetStCurrAfter[8];
    uint8_t RefPicSetLtCurr[8];
-   uint8_t RefPicList[2][15];
+   uint8_t RefPicList[PIPE_H265_MAX_SLICES][2][15];
    bool UseRefPicList;
    bool UseStRpsBits;
 

Reply via email to