[FFmpeg-cvslog] hevcdec: remove redundant bits_used_for_short_term_rps field

Lynne git at videolan.org
Thu Jun 8 00:59:47 EEST 2023


ffmpeg | branch: master | Lynne <dev at lynne.ee> | Tue Jun  6 12:48:11 2023 +0200| [697382168dbb4ba80201352eaf239511cb82074f] | committer: Lynne

hevcdec: remove redundant bits_used_for_short_term_rps field

It was introduced for Vulkan, but it is equivalent to
short_term_ref_pic_set_size when !short_term_ref_pic_set_sps_flag,
and when !!short_term_ref_pic_set_sps_flag, Vulkan hardcodes a zero
anyway.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=697382168dbb4ba80201352eaf239511cb82074f
---

 libavcodec/hevcdec.c     | 1 -
 libavcodec/hevcdec.h     | 1 -
 libavcodec/vulkan_hevc.c | 2 +-
 3 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index eee77ec4db..a4284921cb 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -723,7 +723,6 @@ static int hls_slice_header(HEVCContext *s)
                 if (ret < 0)
                     return ret;
 
-                sh->bits_used_for_short_term_rps = pos - get_bits_left(gb);
                 sh->short_term_rps = &sh->slice_rps;
             } else {
                 int numbits, rps_idx;
diff --git a/libavcodec/hevcdec.h b/libavcodec/hevcdec.h
index 04ec25d540..94609e4699 100644
--- a/libavcodec/hevcdec.h
+++ b/libavcodec/hevcdec.h
@@ -268,7 +268,6 @@ typedef struct SliceHeader {
 
     ///< RPS coded in the slice header itself is stored here
     int short_term_ref_pic_set_sps_flag;
-    int bits_used_for_short_term_rps;
     int short_term_ref_pic_set_size;
     ShortTermRPS slice_rps;
     const ShortTermRPS *short_term_rps;
diff --git a/libavcodec/vulkan_hevc.c b/libavcodec/vulkan_hevc.c
index c9b6888410..dcf7e75bc5 100644
--- a/libavcodec/vulkan_hevc.c
+++ b/libavcodec/vulkan_hevc.c
@@ -788,7 +788,7 @@ static int vk_hevc_start_frame(AVCodecContext          *avctx,
         .NumDeltaPocsOfRefRpsIdx = h->sh.short_term_rps ? h->sh.short_term_rps->rps_idx_num_delta_pocs : 0,
         .PicOrderCntVal = h->poc,
         .NumBitsForSTRefPicSetInSlice = !h->sh.short_term_ref_pic_set_sps_flag ?
-                                         h->sh.bits_used_for_short_term_rps : 0,
+                                         h->sh.short_term_ref_pic_set_size : 0,
     };
 
     /* Fill in references */



More information about the ffmpeg-cvslog mailing list