OSDN Git Service

dxva2_hevc: properly signal the num_delta_pocs from the SPS RPS
authorHendrik Leppkes <h.leppkes@gmail.com>
Fri, 12 Feb 2016 18:38:40 +0000 (20:38 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Sat, 13 Feb 2016 13:19:54 +0000 (14:19 +0100)
ucNumDeltaPocsOfRefRpsIdx needs to contain the flat value from the SPS RPS,
and not the final computed value from the slice header RPS, as this calculation
is done internally by the driver again.

Sample-Id: http://trailers.divx.com/hevc/Sintel_4k_27qp_24fps_1aud_9subs.mkvi
Signed-off-by: RĂ©mi Denis-Courmont <remi@remlab.net>
libavcodec/dxva2_hevc.c
libavcodec/hevc.h
libavcodec/hevc_ps.c

index aa684bb..5bb10d6 100644 (file)
@@ -96,7 +96,7 @@ static void fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *
     pp->init_qp_minus26                          = pps->pic_init_qp_minus26;
 
     if (h->sh.short_term_ref_pic_set_sps_flag == 0 && h->sh.short_term_rps) {
-        pp->ucNumDeltaPocsOfRefRpsIdx            = h->sh.short_term_rps->num_delta_pocs;
+        pp->ucNumDeltaPocsOfRefRpsIdx            = h->sh.short_term_rps->rps_idx_num_delta_pocs;
         pp->wNumBitsForShortTermRPSInSlice       = h->sh.short_term_ref_pic_set_size;
     }
 
index 7c87a55..62edcf2 100644 (file)
@@ -262,6 +262,7 @@ enum ScanType {
 typedef struct ShortTermRPS {
     unsigned int num_negative_pics;
     int num_delta_pocs;
+    int rps_idx_num_delta_pocs;
     int32_t delta_poc[32];
     uint8_t used[32];
 } ShortTermRPS;
index 2faee96..583fa06 100644 (file)
@@ -134,6 +134,7 @@ int ff_hevc_decode_short_term_rps(GetBitContext *gb, AVCodecContext *avctx,
                 return AVERROR_INVALIDDATA;
             }
             rps_ridx = &sps->st_rps[sps->nb_st_rps - delta_idx];
+            rps->rps_idx_num_delta_pocs = rps_ridx->num_delta_pocs;
         } else
             rps_ridx = &sps->st_rps[rps - sps->st_rps - 1];