]> git.sesse.net Git - ffmpeg/commitdiff
dxva2_hevc: properly signal the num_delta_pocs from the SPS RPS
authorHendrik Leppkes <h.leppkes@gmail.com>
Mon, 2 Mar 2015 11:04:33 +0000 (12:04 +0100)
committerHendrik Leppkes <h.leppkes@gmail.com>
Mon, 3 Aug 2015 13:48:21 +0000 (15:48 +0200)
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

libavcodec/dxva2_hevc.c
libavcodec/hevc.h
libavcodec/hevc_ps.c

index 7e39677ad3eab6d4b10b1014fcc800d3a08eccbe..79d2d2824e4630d83f1c8a5b8ff7f1be4b0e14c6 100644 (file)
@@ -92,7 +92,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 2c1aff77b3eb52e2644822eec30f4967d7876f8f..32d6da9968100ba81f84fc3b08e097ebdc9b62a2 100644 (file)
@@ -276,6 +276,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 d507c9ba8dbf83cceac8361f17b4445fc6cc5fc6..427cf098aa7a49885d0d9942eb9436d5bb2aa53c 100644 (file)
@@ -136,6 +136,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];