[x264-devel] commit: Fix x264_encoder_reconfig with multithreading ( Jason Garrett-Glaser )
git version control
git at videolan.org
Wed Aug 19 04:53:59 CEST 2009
x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Tue Aug 18 15:46:26 2009 -0700| [9892984392cd550e65e3f2cd6fd08d6afb083472] | committer: Jason Garrett-Glaser
Fix x264_encoder_reconfig with multithreading
New behavior: reconfigging the encoder will result in changes being applied
to each of the encoding threads as they finish encoding the current frame.
> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=9892984392cd550e65e3f2cd6fd08d6afb083472
---
encoder/encoder.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/encoder/encoder.c b/encoder/encoder.c
index 6d28d09..02399fe 100644
--- a/encoder/encoder.c
+++ b/encoder/encoder.c
@@ -882,6 +882,7 @@ fail:
****************************************************************************/
int x264_encoder_reconfig( x264_t *h, x264_param_t *param )
{
+ h = h->thread[h->i_thread_phase%h->param.i_threads];
#define COPY(var) h->param.var = param->var
COPY( i_frame_reference ); // but never uses more refs than initially specified
COPY( i_bframe_bias );
@@ -1391,6 +1392,7 @@ static void x264_thread_sync_context( x264_t *dst, x264_t *src )
// copy everything except the per-thread pointers and the constants.
memcpy( &dst->i_frame, &src->i_frame, offsetof(x264_t, mb.type) - offsetof(x264_t, i_frame) );
+ dst->param = src->param;
dst->stat = src->stat;
}
More information about the x264-devel
mailing list