From 8c881320850542a496be53a107d1a13290a03785 Mon Sep 17 00:00:00 2001 From: Fiona Glaser Date: Fri, 28 Jan 2011 15:19:06 -0800 Subject: [PATCH] Fix reconfiguration of parameters that modify the SPS For now, this is only aspect ratio. --- 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 4654c174..868f5267 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 cb3b398f..0f3ee650 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) ); -- 2.40.0