diff mbox series

[FFmpeg-devel,1/2] lavc/hevc: Add poc_msb_present filed in LongTermRPS

Message ID 1589290969-3832-1-git-send-email-linjie.fu@intel.com
State Accepted
Commit 939a4db227be629b7ff5492c6cc7cd75f40bf0f8
Headers show
Series [FFmpeg-devel,1/2] lavc/hevc: Add poc_msb_present filed in LongTermRPS
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Fu, Linjie May 12, 2020, 1:42 p.m. UTC
From: Xu Guangxin <guangxin.xu@intel.com>

delta_poc_msb_present_flag is needed in find_ref_idx() to
indicate whether MSB of POC should be taken into account.

Details in 8.3.2.

Signed-off-by: Xu Guangxin <guangxin.xu@intel.com>
Signed-off-by: Linjie Fu <linjie.fu@intel.com>
---
 libavcodec/hevc_ps.h | 1 +
 libavcodec/hevcdec.c | 5 ++---
 2 files changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/hevc_ps.h b/libavcodec/hevc_ps.h
index 8e1bccd..238edd3 100644
--- a/libavcodec/hevc_ps.h
+++ b/libavcodec/hevc_ps.h
@@ -41,6 +41,7 @@  typedef struct ShortTermRPS {
 
 typedef struct LongTermRPS {
     int     poc[32];
+    uint8_t poc_msb_present[32];
     uint8_t used[32];
     uint8_t nb_refs;
 } LongTermRPS;
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 78299f4..0772608 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -280,7 +280,6 @@  static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb)
     rps->nb_refs = nb_sh + nb_sps;
 
     for (i = 0; i < rps->nb_refs; i++) {
-        uint8_t delta_poc_msb_present;
 
         if (i < nb_sps) {
             uint8_t lt_idx_sps = 0;
@@ -295,8 +294,8 @@  static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb)
             rps->used[i] = get_bits1(gb);
         }
 
-        delta_poc_msb_present = get_bits1(gb);
-        if (delta_poc_msb_present) {
+        rps->poc_msb_present[i] = get_bits1(gb);
+        if (rps->poc_msb_present[i]) {
             int64_t delta = get_ue_golomb_long(gb);
             int64_t poc;