Fix palette mode in multi-thread encoding setting

Fix a couple of memory related errors. Also fix thread test failures.

Change-Id: I0103995f832cecf1dd2380000321ac7204f0cfc0
This commit is contained in:
hui su
2015-10-14 20:18:18 -07:00
parent a5d74843eb
commit aaf6f6215f
5 changed files with 13 additions and 13 deletions

View File

@@ -96,13 +96,6 @@ void vp10_encode_tiles_mt(VP10_COMP *cpi) {
CHECK_MEM_ERROR(cm, thread_data->td->counts,
vpx_calloc(1, sizeof(*thread_data->td->counts)));
// Allocate buffers used by palette coding mode.
if (cpi->common.allow_screen_content_tools) {
MACROBLOCK *x = &thread_data->td->mb;
CHECK_MEM_ERROR(cm, x->palette_buffer,
vpx_memalign(16, sizeof(*x->palette_buffer)));
}
// Create threads
if (!winterface->reset(worker))
vpx_internal_error(&cm->error, VPX_CODEC_ERROR,
@@ -135,6 +128,13 @@ void vp10_encode_tiles_mt(VP10_COMP *cpi) {
memcpy(thread_data->td->counts, &cpi->common.counts,
sizeof(cpi->common.counts));
}
// Allocate buffers used by palette coding mode.
if (cpi->common.allow_screen_content_tools && i < num_workers - 1) {
MACROBLOCK *x = &thread_data->td->mb;
CHECK_MEM_ERROR(cm, x->palette_buffer,
vpx_memalign(16, sizeof(*x->palette_buffer)));
}
}
// Encode a frame