[x264-devel] Fix reconfiguration of parameters that modify the SPS

Jason Garrett-Glaser git at videolan.org
Mon Feb 7 06:31:29 CET 2011


x264 | branch: master | Jason Garrett-Glaser <jason at x264.com> | Fri Jan 28 15:19:06 2011 -0800| [6dd825ddb87c004606b6645ae1ebee34a70ea19e] | committer: Jason Garrett-Glaser

Fix reconfiguration of parameters that modify the SPS
For now, this is only aspect ratio.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=6dd825ddb87c004606b6645ae1ebee34a70ea19e
---

 common/common.h   |    5 +++--
 encoder/encoder.c |    4 ++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/common/common.h b/common/common.h
index 4654c17..868f526 100644
--- a/common/common.h
+++ b/common/common.h
@@ -418,6 +418,9 @@ struct x264_t
     uint8_t *nal_buffer;
     int      nal_buffer_size;
 
+    x264_sps_t      *sps;
+    x264_pps_t      *pps;
+
     /**** thread synchronization starts here ****/
 
     /* frame number/poc */
@@ -445,9 +448,7 @@ struct x264_t
 
     /* We use only one SPS and one PPS */
     x264_sps_t      sps_array[1];
-    x264_sps_t      *sps;
     x264_pps_t      pps_array[1];
-    x264_pps_t      *pps;
     int             i_idr_pic_id;
 
     /* quantization matrix for decoding, [cqm][qp%6][coef] */
diff --git a/encoder/encoder.c b/encoder/encoder.c
index da14774..02fcf85 100644
--- a/encoder/encoder.c
+++ b/encoder/encoder.c
@@ -909,6 +909,7 @@ static void x264_set_aspect_ratio( x264_t *h, x264_param_t *param, int initial )
                 h->param.vui.i_sar_width = i_w;
                 h->param.vui.i_sar_height = i_h;
             }
+            x264_sps_init( h->sps, h->param.i_sps_id, &h->param );
         }
     }
 }
@@ -1124,6 +1125,9 @@ x264_t *x264_encoder_open( x264_param_t *param )
         else
             h->thread[i]->fdec = h->thread[0]->fdec;
 
+        h->thread[i]->sps = &h->thread[i]->sps_array[0];
+        h->thread[i]->pps = &h->thread[i]->pps_array[0];
+
         CHECKED_MALLOC( h->thread[i]->out.p_bitstream, h->out.i_bitstream );
         /* Start each thread with room for init_nal_count NAL units; it'll realloc later if needed. */
         CHECKED_MALLOC( h->thread[i]->out.nal, init_nal_count*sizeof(x264_nal_t) );



More information about the x264-devel mailing list