[FFmpeg-cvslog] h264: store current_sps_id inside the current sps

Vittorio Giovara git at videolan.org
Fri Feb 14 14:07:21 CET 2014


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Thu Feb 13 00:43:17 2014 +0100| [3a0576702825423abecb32627c530dbc4c0f73bc] | committer: Vittorio Giovara

h264: store current_sps_id inside the current sps

In preparation for MVC support.

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

 libavcodec/h264.c    |    5 ++---
 libavcodec/h264.h    |    2 +-
 libavcodec/h264_ps.c |    2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index c193630..dfabcf5 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3414,12 +3414,11 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
         return AVERROR_INVALIDDATA;
     }
 
-    if (h->pps.sps_id != h->current_sps_id ||
+    if (h->pps.sps_id != h->sps.sps_id ||
         h0->sps_buffers[h->pps.sps_id]->new) {
         h0->sps_buffers[h->pps.sps_id]->new = 0;
 
-        h->current_sps_id = h->pps.sps_id;
-        h->sps            = *h0->sps_buffers[h->pps.sps_id];
+        h->sps = *h0->sps_buffers[h->pps.sps_id];
 
         if (h->bit_depth_luma    != h->sps.bit_depth_luma ||
             h->chroma_format_idc != h->sps.chroma_format_idc) {
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 6aa30b9..ef81463 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -146,6 +146,7 @@ typedef enum {
  * Sequence parameter set
  */
 typedef struct SPS {
+    unsigned int sps_id;
     int profile_idc;
     int level_idc;
     int chroma_format_idc;
@@ -353,7 +354,6 @@ typedef struct H264Context {
     ptrdiff_t mb_linesize;  ///< may be equal to s->linesize or s->linesize * 2, for mbaff
     ptrdiff_t mb_uvlinesize;
 
-    unsigned current_sps_id; ///< id of the current SPS
     SPS sps; ///< current sps
 
     /**
diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index 88b973a..932c27a 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -318,6 +318,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
     if (!sps)
         return AVERROR(ENOMEM);
 
+    sps->sps_id               = sps_id;
     sps->time_offset_length   = 24;
     sps->profile_idc          = profile_idc;
     sps->constraint_set_flags = constraint_set_flags;
@@ -504,7 +505,6 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
     av_free(h->sps_buffers[sps_id]);
     h->sps_buffers[sps_id] = sps;
     h->sps                 = *sps;
-    h->current_sps_id      = sps_id;
 
     return 0;
 



More information about the ffmpeg-cvslog mailing list