Commit a39b5af1 authored by John Koleszar's avatar John Koleszar Committed by Code Review
Browse files

Merge "Put more code under #if CONFIG_MULTITHREAD."

parents 85e79ce2 315e3c25
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define VPXINFINITE 10000 /* 10second. */ #define VPXINFINITE 10000 /* 10second. */
#if CONFIG_OS_SUPPORT #if CONFIG_OS_SUPPORT && CONFIG_MULTITHREAD
/* Thread management macros */ /* Thread management macros */
#ifdef _WIN32 #ifdef _WIN32
...@@ -90,8 +90,6 @@ ...@@ -90,8 +90,6 @@
#define x86_pause_hint() #define x86_pause_hint()
#endif #endif
#else /* CONFIG_OS_SUPPORT = 0 */ #endif /* CONFIG_OS_SUPPORT && CONFIG_MULTITHREAD */
#define THREAD_FUNCTION void *
#endif /* CONFIG_OS_SUPPORT */
#endif #endif
...@@ -484,9 +484,11 @@ static void setup_token_decoder(VP8D_COMP *pbi, ...@@ -484,9 +484,11 @@ static void setup_token_decoder(VP8D_COMP *pbi,
bool_decoder++; bool_decoder++;
} }
#if CONFIG_MULTITHREAD
/* Clamp number of decoder threads */ /* Clamp number of decoder threads */
if (pbi->decoding_thread_count > num_part - 1) if (pbi->decoding_thread_count > num_part - 1)
pbi->decoding_thread_count = num_part - 1; pbi->decoding_thread_count = num_part - 1;
#endif
} }
...@@ -844,7 +846,9 @@ int vp8_decode_frame(VP8D_COMP *pbi) ...@@ -844,7 +846,9 @@ int vp8_decode_frame(VP8D_COMP *pbi)
vpx_memcpy(&xd->dst, &pc->yv12_fb[pc->new_fb_idx], sizeof(YV12_BUFFER_CONFIG)); vpx_memcpy(&xd->dst, &pc->yv12_fb[pc->new_fb_idx], sizeof(YV12_BUFFER_CONFIG));
/* set up frame new frame for intra coded blocks */ /* set up frame new frame for intra coded blocks */
#if CONFIG_MULTITHREAD
if (!(pbi->b_multithreaded_rd) || pc->multi_token_partition == ONE_PARTITION || !(pc->filter_level)) if (!(pbi->b_multithreaded_rd) || pc->multi_token_partition == ONE_PARTITION || !(pc->filter_level))
#endif
vp8_setup_intra_recon(&pc->yv12_fb[pc->new_fb_idx]); vp8_setup_intra_recon(&pc->yv12_fb[pc->new_fb_idx]);
vp8_setup_block_dptrs(xd); vp8_setup_block_dptrs(xd);
...@@ -864,6 +868,7 @@ int vp8_decode_frame(VP8D_COMP *pbi) ...@@ -864,6 +868,7 @@ int vp8_decode_frame(VP8D_COMP *pbi)
vpx_memcpy(&xd->block[0].bmi, &xd->mode_info_context->bmi[0], sizeof(B_MODE_INFO)); vpx_memcpy(&xd->block[0].bmi, &xd->mode_info_context->bmi[0], sizeof(B_MODE_INFO));
#if CONFIG_MULTITHREAD
if (pbi->b_multithreaded_rd && pc->multi_token_partition != ONE_PARTITION) if (pbi->b_multithreaded_rd && pc->multi_token_partition != ONE_PARTITION)
{ {
vp8mt_decode_mb_rows(pbi, xd); vp8mt_decode_mb_rows(pbi, xd);
...@@ -878,6 +883,7 @@ int vp8_decode_frame(VP8D_COMP *pbi) ...@@ -878,6 +883,7 @@ int vp8_decode_frame(VP8D_COMP *pbi)
vp8_yv12_extend_frame_borders_ptr(&pc->yv12_fb[pc->new_fb_idx]); /*cm->frame_to_show);*/ vp8_yv12_extend_frame_borders_ptr(&pc->yv12_fb[pc->new_fb_idx]); /*cm->frame_to_show);*/
} }
else else
#endif
{ {
int ibc = 0; int ibc = 0;
int num_part = 1 << pc->multi_token_partition; int num_part = 1 << pc->multi_token_partition;
......
...@@ -114,8 +114,10 @@ VP8D_PTR vp8dx_create_decompressor(VP8D_CONFIG *oxcf) ...@@ -114,8 +114,10 @@ VP8D_PTR vp8dx_create_decompressor(VP8D_CONFIG *oxcf)
pbi->ready_for_new_data = 1; pbi->ready_for_new_data = 1;
pbi->CPUFreq = 0; /*vp8_get_processor_freq();*/ pbi->CPUFreq = 0; /*vp8_get_processor_freq();*/
#if CONFIG_MULTITHREAD
pbi->max_threads = oxcf->max_threads; pbi->max_threads = oxcf->max_threads;
vp8_decoder_create_threads(pbi); vp8_decoder_create_threads(pbi);
#endif
/* vp8cx_init_de_quantizer() is first called here. Add check in frame_init_dequantizer() to avoid /* vp8cx_init_de_quantizer() is first called here. Add check in frame_init_dequantizer() to avoid
* unnecessary calling of vp8cx_init_de_quantizer() for every frame. * unnecessary calling of vp8cx_init_de_quantizer() for every frame.
...@@ -149,8 +151,8 @@ void vp8dx_remove_decompressor(VP8D_PTR ptr) ...@@ -149,8 +151,8 @@ void vp8dx_remove_decompressor(VP8D_PTR ptr)
#if CONFIG_MULTITHREAD #if CONFIG_MULTITHREAD
if (pbi->b_multithreaded_rd) if (pbi->b_multithreaded_rd)
vp8mt_de_alloc_temp_buffers(pbi, pbi->common.mb_rows); vp8mt_de_alloc_temp_buffers(pbi, pbi->common.mb_rows);
#endif
vp8_decoder_remove_threads(pbi); vp8_decoder_remove_threads(pbi);
#endif
vp8_remove_common(&pbi->common); vp8_remove_common(&pbi->common);
vpx_free(pbi); vpx_free(pbi);
} }
...@@ -407,6 +409,7 @@ int vp8dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsign ...@@ -407,6 +409,7 @@ int vp8dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsign
return retcode; return retcode;
} }
#if CONFIG_MULTITHREAD
if (pbi->b_multithreaded_rd && cm->multi_token_partition != ONE_PARTITION) if (pbi->b_multithreaded_rd && cm->multi_token_partition != ONE_PARTITION)
{ {
if (swap_frame_buffers (cm)) if (swap_frame_buffers (cm))
...@@ -424,6 +427,7 @@ int vp8dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsign ...@@ -424,6 +427,7 @@ int vp8dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsign
return -1; return -1;
} }
} else } else
#endif
{ {
if (swap_frame_buffers (cm)) if (swap_frame_buffers (cm))
{ {
......
...@@ -87,14 +87,15 @@ typedef struct VP8Decompressor ...@@ -87,14 +87,15 @@ typedef struct VP8Decompressor
unsigned int time_decoding; unsigned int time_decoding;
unsigned int time_loop_filtering; unsigned int time_loop_filtering;
#if CONFIG_MULTITHREAD
/* variable for threading */
volatile int b_multithreaded_rd; volatile int b_multithreaded_rd;
int max_threads; int max_threads;
int current_mb_col_main; int current_mb_col_main;
int decoding_thread_count; int decoding_thread_count;
int allocated_decoding_thread_count; int allocated_decoding_thread_count;
/* variable for threading */
#if CONFIG_MULTITHREAD
int mt_baseline_filter_level[MAX_MB_SEGMENTS]; int mt_baseline_filter_level[MAX_MB_SEGMENTS];
int sync_range; int sync_range;
int *mt_current_mb_col; /* Each row remembers its already decoded column. */ int *mt_current_mb_col; /* Each row remembers its already decoded column. */
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
void vp8mt_build_intra_predictors_mby(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col) void vp8mt_build_intra_predictors_mby(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col)
{ {
#if CONFIG_MULTITHREAD
unsigned char *yabove_row; /* = x->dst.y_buffer - x->dst.y_stride; */ unsigned char *yabove_row; /* = x->dst.y_buffer - x->dst.y_stride; */
unsigned char *yleft_col; unsigned char *yleft_col;
unsigned char yleft_buf[16]; unsigned char yleft_buf[16];
...@@ -146,17 +145,10 @@ void vp8mt_build_intra_predictors_mby(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row ...@@ -146,17 +145,10 @@ void vp8mt_build_intra_predictors_mby(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row
case MB_MODE_COUNT: case MB_MODE_COUNT:
break; break;
} }
#else
(void) pbi;
(void) x;
(void) mb_row;
(void) mb_col;
#endif
} }
void vp8mt_build_intra_predictors_mby_s(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col) void vp8mt_build_intra_predictors_mby_s(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col)
{ {
#if CONFIG_MULTITHREAD
unsigned char *yabove_row; /* = x->dst.y_buffer - x->dst.y_stride; */ unsigned char *yabove_row; /* = x->dst.y_buffer - x->dst.y_stride; */
unsigned char *yleft_col; unsigned char *yleft_col;
unsigned char yleft_buf[16]; unsigned char yleft_buf[16];
...@@ -289,17 +281,10 @@ void vp8mt_build_intra_predictors_mby_s(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_r ...@@ -289,17 +281,10 @@ void vp8mt_build_intra_predictors_mby_s(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_r
case MB_MODE_COUNT: case MB_MODE_COUNT:
break; break;
} }
#else
(void) pbi;
(void) x;
(void) mb_row;
(void) mb_col;
#endif
} }
void vp8mt_build_intra_predictors_mbuv(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col) void vp8mt_build_intra_predictors_mbuv(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col)
{ {
#if CONFIG_MULTITHREAD
unsigned char *uabove_row; /* = x->dst.u_buffer - x->dst.uv_stride; */ unsigned char *uabove_row; /* = x->dst.u_buffer - x->dst.uv_stride; */
unsigned char *uleft_col; /*[16];*/ unsigned char *uleft_col; /*[16];*/
unsigned char uleft_buf[8]; unsigned char uleft_buf[8];
...@@ -452,17 +437,10 @@ void vp8mt_build_intra_predictors_mbuv(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_ro ...@@ -452,17 +437,10 @@ void vp8mt_build_intra_predictors_mbuv(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_ro
case MB_MODE_COUNT: case MB_MODE_COUNT:
break; break;
} }
#else
(void) pbi;
(void) x;
(void) mb_row;
(void) mb_col;
#endif
} }
void vp8mt_build_intra_predictors_mbuv_s(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col) void vp8mt_build_intra_predictors_mbuv_s(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col)
{ {
#if CONFIG_MULTITHREAD
unsigned char *uabove_row; /* = x->dst.u_buffer - x->dst.uv_stride; */ unsigned char *uabove_row; /* = x->dst.u_buffer - x->dst.uv_stride; */
unsigned char *uleft_col; /*[16];*/ unsigned char *uleft_col; /*[16];*/
unsigned char uleft_buf[8]; unsigned char uleft_buf[8];
...@@ -621,12 +599,6 @@ void vp8mt_build_intra_predictors_mbuv_s(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_ ...@@ -621,12 +599,6 @@ void vp8mt_build_intra_predictors_mbuv_s(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_
case MB_MODE_COUNT: case MB_MODE_COUNT:
break; break;
} }
#else
(void) pbi;
(void) x;
(void) mb_row;
(void) mb_col;
#endif
} }
...@@ -638,7 +610,6 @@ void vp8mt_predict_intra4x4(VP8D_COMP *pbi, ...@@ -638,7 +610,6 @@ void vp8mt_predict_intra4x4(VP8D_COMP *pbi,
int mb_col, int mb_col,
int num) int num)
{ {
#if CONFIG_MULTITHREAD
int i, r, c; int i, r, c;
unsigned char *Above; /* = *(x->base_dst) + x->dst - x->dst_stride; */ unsigned char *Above; /* = *(x->base_dst) + x->dst - x->dst_stride; */
...@@ -935,15 +906,6 @@ void vp8mt_predict_intra4x4(VP8D_COMP *pbi, ...@@ -935,15 +906,6 @@ void vp8mt_predict_intra4x4(VP8D_COMP *pbi,
} }
#else
(void) pbi;
(void) xd;
(void) b_mode;
(void) predictor;
(void) mb_row;
(void) mb_col;
(void) num;
#endif
} }
/* copy 4 bytes from the above right down so that the 4x4 prediction modes using pixels above and /* copy 4 bytes from the above right down so that the 4x4 prediction modes using pixels above and
...@@ -951,7 +913,6 @@ void vp8mt_predict_intra4x4(VP8D_COMP *pbi, ...@@ -951,7 +913,6 @@ void vp8mt_predict_intra4x4(VP8D_COMP *pbi,
*/ */
void vp8mt_intra_prediction_down_copy(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col) void vp8mt_intra_prediction_down_copy(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col)
{ {
#if CONFIG_MULTITHREAD
unsigned char *above_right; /* = *(x->block[0].base_dst) + x->block[0].dst - x->block[0].dst_stride + 16; */ unsigned char *above_right; /* = *(x->block[0].base_dst) + x->block[0].dst - x->block[0].dst_stride + 16; */
unsigned int *src_ptr; unsigned int *src_ptr;
unsigned int *dst_ptr0; unsigned int *dst_ptr0;
...@@ -973,10 +934,4 @@ void vp8mt_intra_prediction_down_copy(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row ...@@ -973,10 +934,4 @@ void vp8mt_intra_prediction_down_copy(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row
*dst_ptr0 = *src_ptr; *dst_ptr0 = *src_ptr;
*dst_ptr1 = *src_ptr; *dst_ptr1 = *src_ptr;
*dst_ptr2 = *src_ptr; *dst_ptr2 = *src_ptr;
#else
(void) pbi;
(void) x;
(void) mb_row;
(void) mb_col;
#endif
} }
...@@ -38,7 +38,6 @@ extern void vp8_build_uvmvs(MACROBLOCKD *x, int fullpixel); ...@@ -38,7 +38,6 @@ extern void vp8_build_uvmvs(MACROBLOCKD *x, int fullpixel);
void vp8_setup_decoding_thread_data(VP8D_COMP *pbi, MACROBLOCKD *xd, MB_ROW_DEC *mbrd, int count) void vp8_setup_decoding_thread_data(VP8D_COMP *pbi, MACROBLOCKD *xd, MB_ROW_DEC *mbrd, int count)
{ {
#if CONFIG_MULTITHREAD
VP8_COMMON *const pc = & pbi->common; VP8_COMMON *const pc = & pbi->common;
int i, j; int i, j;
...@@ -88,18 +87,11 @@ void vp8_setup_decoding_thread_data(VP8D_COMP *pbi, MACROBLOCKD *xd, MB_ROW_DEC ...@@ -88,18 +87,11 @@ void vp8_setup_decoding_thread_data(VP8D_COMP *pbi, MACROBLOCKD *xd, MB_ROW_DEC
for (i=0; i< pc->mb_rows; i++) for (i=0; i< pc->mb_rows; i++)
pbi->mt_current_mb_col[i]=-1; pbi->mt_current_mb_col[i]=-1;
#else
(void) pbi;
(void) xd;
(void) mbrd;
(void) count;
#endif
} }
void vp8mt_decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int mb_col) void vp8mt_decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int mb_col)
{ {
#if CONFIG_MULTITHREAD
int eobtotal = 0; int eobtotal = 0;
int i, do_clamp = xd->mode_info_context->mbmi.need_to_clamp_mvs; int i, do_clamp = xd->mode_info_context->mbmi.need_to_clamp_mvs;
VP8_COMMON *pc = &pbi->common; VP8_COMMON *pc = &pbi->common;
...@@ -222,18 +214,11 @@ void vp8mt_decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int mb ...@@ -222,18 +214,11 @@ void vp8mt_decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int mb
(xd->qcoeff+16*16, xd->block[16].dequant, (xd->qcoeff+16*16, xd->block[16].dequant,
xd->predictor+16*16, xd->dst.u_buffer, xd->dst.v_buffer, xd->predictor+16*16, xd->dst.u_buffer, xd->dst.v_buffer,
xd->dst.uv_stride, xd->eobs+16); xd->dst.uv_stride, xd->eobs+16);
#else
(void) pbi;
(void) xd;
(void) mb_row;
(void) mb_col;
#endif
} }
THREAD_FUNCTION vp8_thread_decoding_proc(void *p_data) THREAD_FUNCTION vp8_thread_decoding_proc(void *p_data)
{ {
#if CONFIG_MULTITHREAD
int ithread = ((DECODETHREAD_DATA *)p_data)->ithread; int ithread = ((DECODETHREAD_DATA *)p_data)->ithread;
VP8D_COMP *pbi = (VP8D_COMP *)(((DECODETHREAD_DATA *)p_data)->ptr1); VP8D_COMP *pbi = (VP8D_COMP *)(((DECODETHREAD_DATA *)p_data)->ptr1);
MB_ROW_DEC *mbrd = (MB_ROW_DEC *)(((DECODETHREAD_DATA *)p_data)->ptr2); MB_ROW_DEC *mbrd = (MB_ROW_DEC *)(((DECODETHREAD_DATA *)p_data)->ptr2);
...@@ -438,9 +423,6 @@ THREAD_FUNCTION vp8_thread_decoding_proc(void *p_data) ...@@ -438,9 +423,6 @@ THREAD_FUNCTION vp8_thread_decoding_proc(void *p_data)
sem_post(&pbi->h_event_end_decoding); sem_post(&pbi->h_event_end_decoding);
} }
} }
#else
(void) p_data;
#endif
return 0 ; return 0 ;
} }
...@@ -448,7 +430,6 @@ THREAD_FUNCTION vp8_thread_decoding_proc(void *p_data) ...@@ -448,7 +430,6 @@ THREAD_FUNCTION vp8_thread_decoding_proc(void *p_data)
void vp8_decoder_create_threads(VP8D_COMP *pbi) void vp8_decoder_create_threads(VP8D_COMP *pbi)
{ {
#if CONFIG_MULTITHREAD
int core_count = 0; int core_count = 0;
int ithread; int ithread;
...@@ -482,16 +463,11 @@ void vp8_decoder_create_threads(VP8D_COMP *pbi) ...@@ -482,16 +463,11 @@ void vp8_decoder_create_threads(VP8D_COMP *pbi)
pbi->allocated_decoding_thread_count = pbi->decoding_thread_count; pbi->allocated_decoding_thread_count = pbi->decoding_thread_count;
} }
#else
(void) pbi;
#endif
} }
void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows) void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows)
{ {
#if CONFIG_MULTITHREAD
VP8_COMMON *const pc = & pbi->common; VP8_COMMON *const pc = & pbi->common;
int i; int i;
...@@ -589,15 +565,11 @@ void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows) ...@@ -589,15 +565,11 @@ void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows)
pbi->mt_vleft_col = NULL ; pbi->mt_vleft_col = NULL ;
} }
} }
#else
(void) pbi;
#endif
} }
void vp8mt_alloc_temp_buffers(VP8D_COMP *pbi, int width, int prev_mb_rows) void vp8mt_alloc_temp_buffers(VP8D_COMP *pbi, int width, int prev_mb_rows)
{ {
#if CONFIG_MULTITHREAD
VP8_COMMON *const pc = & pbi->common; VP8_COMMON *const pc = & pbi->common;
int i; int i;
int uv_width; int uv_width;
...@@ -646,17 +618,11 @@ void vp8mt_alloc_temp_buffers(VP8D_COMP *pbi, int width, int prev_mb_rows) ...@@ -646,17 +618,11 @@ void vp8mt_alloc_temp_buffers(VP8D_COMP *pbi, int width, int prev_mb_rows)
for (i=0; i< pc->mb_rows; i++) for (i=0; i< pc->mb_rows; i++)
CHECK_MEM_ERROR(pbi->mt_vleft_col[i], vpx_calloc(sizeof(unsigned char) * 8, 1)); CHECK_MEM_ERROR(pbi->mt_vleft_col[i], vpx_calloc(sizeof(unsigned char) * 8, 1));
} }
#else
(void) pbi;
(void) width;
#endif
} }
void vp8_decoder_remove_threads(VP8D_COMP *pbi) void vp8_decoder_remove_threads(VP8D_COMP *pbi)
{ {
#if CONFIG_MULTITHREAD
/* shutdown MB Decoding thread; */ /* shutdown MB Decoding thread; */
if (pbi->b_multithreaded_rd) if (pbi->b_multithreaded_rd)
{ {
...@@ -702,15 +668,11 @@ void vp8_decoder_remove_threads(VP8D_COMP *pbi) ...@@ -702,15 +668,11 @@ void vp8_decoder_remove_threads(VP8D_COMP *pbi)
pbi->de_thread_data = NULL; pbi->de_thread_data = NULL;
} }
} }
#else
(void) pbi;
#endif
} }
void vp8mt_lpf_init( VP8D_COMP *pbi, int default_filt_lvl) void vp8mt_lpf_init( VP8D_COMP *pbi, int default_filt_lvl)
{ {
#if CONFIG_MULTITHREAD
VP8_COMMON *cm = &pbi->common; VP8_COMMON *cm = &pbi->common;
MACROBLOCKD *mbd = &pbi->mb; MACROBLOCKD *mbd = &pbi->mb;
/*YV12_BUFFER_CONFIG *post = &cm->new_frame;*/ /*frame_to_show;*/ /*YV12_BUFFER_CONFIG *post = &cm->new_frame;*/ /*frame_to_show;*/
...@@ -752,16 +714,11 @@ void vp8mt_lpf_init( VP8D_COMP *pbi, int default_filt_lvl) ...@@ -752,16 +714,11 @@ void vp8mt_lpf_init( VP8D_COMP *pbi, int default_filt_lvl)
vp8_init_loop_filter(cm); vp8_init_loop_filter(cm);
else if (frame_type != cm->last_frame_type) else if (frame_type != cm->last_frame_type)
vp8_frame_init_loop_filter(lfi, frame_type); vp8_frame_init_loop_filter(lfi, frame_type);
#else
(void) pbi;
(void) default_filt_lvl;
#endif
} }
void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd) void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd)
{ {
#if CONFIG_MULTITHREAD
int mb_row; int mb_row;
VP8_COMMON *pc = &pbi->common; VP8_COMMON *pc = &pbi->common;
...@@ -981,8 +938,4 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd) ...@@ -981,8 +938,4 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd)
} }
sem_wait(&pbi->h_event_end_decoding); /* add back for each frame */ sem_wait(&pbi->h_event_end_decoding); /* add back for each frame */
#else
(void) pbi;
(void) xd;
#endif
} }
...@@ -1654,10 +1654,12 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size) ...@@ -1654,10 +1654,12 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size)
{ {
vp8_start_encode(&cpi->bc2, cx_data + bc->pos); vp8_start_encode(&cpi->bc2, cx_data + bc->pos);
if (!cpi->b_multi_threaded) #if CONFIG_MULTITHREAD
pack_tokens(&cpi->bc2, cpi->tok, cpi->tok_count); if (cpi->b_multi_threaded)
else
pack_mb_row_tokens(cpi, &cpi->bc2); pack_mb_row_tokens(cpi, &cpi->bc2);
else
#endif
pack_tokens(&cpi->bc2, cpi->tok, cpi->tok_count);
vp8_stop_encode(&cpi->bc2); vp8_stop_encode(&cpi->bc2);
oh.first_partition_length_in_bytes = cpi->bc.pos ; oh.first_partition_length_in_bytes = cpi->bc.pos ;
......
...@@ -800,28 +800,9 @@ void vp8_encode_frame(VP8_COMP *cpi) ...@@ -800,28 +800,9 @@ void vp8_encode_frame(VP8_COMP *cpi)
struct vpx_usec_timer emr_timer; struct vpx_usec_timer emr_timer;
vpx_usec_timer_start(&emr_timer); vpx_usec_timer_start(&emr_timer);
if (!cpi->b_multi_threaded)
{
// for each macroblock row in image
for (mb_row = 0; mb_row < cm->mb_rows; mb_row++)
{
vp8_zero(cm->left_context)
encode_mb_row(cpi, cm, mb_row, x, xd, &tp, segment_counts, &totalrate);
// adjust to the next row of mbs
x->src.y_buffer += 16 * x->src.y_stride - 16 * cm->mb_cols;
x->src.u_buffer += 8 * x->src.uv_stride - 8 * cm->mb_cols;
x->src.v_buffer += 8 * x->src.uv_stride - 8 * cm->mb_cols;
}
cpi->tok_count = tp - cpi->tok;
}
else
{
#if CONFIG_MULTITHREAD