]> git.sesse.net Git - ffmpeg/commitdiff
hevc: store the short term rps flag and size in the context
authorHendrik Leppkes <h.leppkes@gmail.com>
Sun, 25 Jan 2015 11:58:47 +0000 (12:58 +0100)
committerAnton Khirnov <anton@khirnov.net>
Tue, 27 Jan 2015 08:04:59 +0000 (09:04 +0100)
For future use by hardware accelerators.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavcodec/hevc.c
libavcodec/hevc.h

index 560d52c458d8624bf85616f3e5d04e9b4cecdd9e..0148aba658fd418f163eaaffd996faf53491e8e1 100644 (file)
@@ -552,7 +552,7 @@ static int hls_slice_header(HEVCContext *s)
             sh->colour_plane_id = get_bits(gb, 2);
 
         if (!IS_IDR(s)) {
-            int short_term_ref_pic_set_sps_flag, poc;
+            int poc;
 
             sh->pic_order_cnt_lsb = get_bits(gb, s->sps->log2_max_poc_lsb);
             poc = ff_hevc_compute_poc(s, sh->pic_order_cnt_lsb);
@@ -565,12 +565,14 @@ static int hls_slice_header(HEVCContext *s)
             }
             s->poc = poc;
 
-            short_term_ref_pic_set_sps_flag = get_bits1(gb);
-            if (!short_term_ref_pic_set_sps_flag) {
+            sh->short_term_ref_pic_set_sps_flag = get_bits1(gb);
+            if (!sh->short_term_ref_pic_set_sps_flag) {
+                int pos = get_bits_left(gb);
                 ret = ff_hevc_decode_short_term_rps(s, &sh->slice_rps, s->sps, 1);
                 if (ret < 0)
                     return ret;
 
+                sh->short_term_ref_pic_set_size = pos - get_bits_left(gb);
                 sh->short_term_rps = &sh->slice_rps;
             } else {
                 int numbits, rps_idx;
index c4162e735338650e056ae7292eac5906a4a96d68..b78b1645fc60c86626672e6505173b1f432232d8 100644 (file)
@@ -543,6 +543,8 @@ typedef struct SliceHeader {
     uint8_t colour_plane_id;
 
     ///< RPS coded in the slice header itself is stored here
+    int short_term_ref_pic_set_sps_flag;
+    int short_term_ref_pic_set_size;
     ShortTermRPS slice_rps;
     const ShortTermRPS *short_term_rps;
     LongTermRPS long_term_rps;