Merge remote branch 'internal/upstream' into HEAD

This commit is contained in:
John Koleszar 2011-02-16 00:05:13 -05:00
commit e786bd3a01
5 changed files with 12 additions and 70 deletions

View File

@ -472,24 +472,18 @@ void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows)
int i; int i;
if (pbi->b_multithreaded_rd) if (pbi->b_multithreaded_rd)
{
if (pbi->mt_current_mb_col)
{ {
vpx_free(pbi->mt_current_mb_col); vpx_free(pbi->mt_current_mb_col);
pbi->mt_current_mb_col = NULL ; pbi->mt_current_mb_col = NULL ;
}
/* Free above_row buffers. */ /* Free above_row buffers. */
if (pbi->mt_yabove_row) if (pbi->mt_yabove_row)
{ {
for (i=0; i< mb_rows; i++) for (i=0; i< mb_rows; i++)
{
if (pbi->mt_yabove_row[i])
{ {
vpx_free(pbi->mt_yabove_row[i]); vpx_free(pbi->mt_yabove_row[i]);
pbi->mt_yabove_row[i] = NULL ; pbi->mt_yabove_row[i] = NULL ;
} }
}
vpx_free(pbi->mt_yabove_row); vpx_free(pbi->mt_yabove_row);
pbi->mt_yabove_row = NULL ; pbi->mt_yabove_row = NULL ;
} }
@ -497,13 +491,10 @@ void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows)
if (pbi->mt_uabove_row) if (pbi->mt_uabove_row)
{ {
for (i=0; i< mb_rows; i++) for (i=0; i< mb_rows; i++)
{
if (pbi->mt_uabove_row[i])
{ {
vpx_free(pbi->mt_uabove_row[i]); vpx_free(pbi->mt_uabove_row[i]);
pbi->mt_uabove_row[i] = NULL ; pbi->mt_uabove_row[i] = NULL ;
} }
}
vpx_free(pbi->mt_uabove_row); vpx_free(pbi->mt_uabove_row);
pbi->mt_uabove_row = NULL ; pbi->mt_uabove_row = NULL ;
} }
@ -511,13 +502,10 @@ void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows)
if (pbi->mt_vabove_row) if (pbi->mt_vabove_row)
{ {
for (i=0; i< mb_rows; i++) for (i=0; i< mb_rows; i++)
{
if (pbi->mt_vabove_row[i])
{ {
vpx_free(pbi->mt_vabove_row[i]); vpx_free(pbi->mt_vabove_row[i]);
pbi->mt_vabove_row[i] = NULL ; pbi->mt_vabove_row[i] = NULL ;
} }
}
vpx_free(pbi->mt_vabove_row); vpx_free(pbi->mt_vabove_row);
pbi->mt_vabove_row = NULL ; pbi->mt_vabove_row = NULL ;
} }
@ -526,13 +514,10 @@ void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows)
if (pbi->mt_yleft_col) if (pbi->mt_yleft_col)
{ {
for (i=0; i< mb_rows; i++) for (i=0; i< mb_rows; i++)
{
if (pbi->mt_yleft_col[i])
{ {
vpx_free(pbi->mt_yleft_col[i]); vpx_free(pbi->mt_yleft_col[i]);
pbi->mt_yleft_col[i] = NULL ; pbi->mt_yleft_col[i] = NULL ;
} }
}
vpx_free(pbi->mt_yleft_col); vpx_free(pbi->mt_yleft_col);
pbi->mt_yleft_col = NULL ; pbi->mt_yleft_col = NULL ;
} }
@ -540,13 +525,10 @@ void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows)
if (pbi->mt_uleft_col) if (pbi->mt_uleft_col)
{ {
for (i=0; i< mb_rows; i++) for (i=0; i< mb_rows; i++)
{
if (pbi->mt_uleft_col[i])
{ {
vpx_free(pbi->mt_uleft_col[i]); vpx_free(pbi->mt_uleft_col[i]);
pbi->mt_uleft_col[i] = NULL ; pbi->mt_uleft_col[i] = NULL ;
} }
}
vpx_free(pbi->mt_uleft_col); vpx_free(pbi->mt_uleft_col);
pbi->mt_uleft_col = NULL ; pbi->mt_uleft_col = NULL ;
} }
@ -554,13 +536,10 @@ void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows)
if (pbi->mt_vleft_col) if (pbi->mt_vleft_col)
{ {
for (i=0; i< mb_rows; i++) for (i=0; i< mb_rows; i++)
{
if (pbi->mt_vleft_col[i])
{ {
vpx_free(pbi->mt_vleft_col[i]); vpx_free(pbi->mt_vleft_col[i]);
pbi->mt_vleft_col[i] = NULL ; pbi->mt_vleft_col[i] = NULL ;
} }
}
vpx_free(pbi->mt_vleft_col); vpx_free(pbi->mt_vleft_col);
pbi->mt_vleft_col = NULL ; pbi->mt_vleft_col = NULL ;
} }
@ -644,31 +623,19 @@ void vp8_decoder_remove_threads(VP8D_COMP *pbi)
sem_destroy(&pbi->h_event_end_decoding); sem_destroy(&pbi->h_event_end_decoding);
if (pbi->h_decoding_thread)
{
vpx_free(pbi->h_decoding_thread); vpx_free(pbi->h_decoding_thread);
pbi->h_decoding_thread = NULL; pbi->h_decoding_thread = NULL;
}
if (pbi->h_event_start_decoding)
{
vpx_free(pbi->h_event_start_decoding); vpx_free(pbi->h_event_start_decoding);
pbi->h_event_start_decoding = NULL; pbi->h_event_start_decoding = NULL;
}
if (pbi->mb_row_di)
{
vpx_free(pbi->mb_row_di); vpx_free(pbi->mb_row_di);
pbi->mb_row_di = NULL ; pbi->mb_row_di = NULL ;
}
if (pbi->de_thread_data)
{
vpx_free(pbi->de_thread_data); vpx_free(pbi->de_thread_data);
pbi->de_thread_data = NULL; pbi->de_thread_data = NULL;
} }
} }
}
void vp8mt_lpf_init( VP8D_COMP *pbi, int default_filt_lvl) void vp8mt_lpf_init( VP8D_COMP *pbi, int default_filt_lvl)

View File

@ -331,39 +331,32 @@ static void setup_features(VP8_COMP *cpi)
void vp8_dealloc_compressor_data(VP8_COMP *cpi) void vp8_dealloc_compressor_data(VP8_COMP *cpi)
{ {
if(cpi->tplist!=0)
vpx_free(cpi->tplist); vpx_free(cpi->tplist);
cpi->tplist = NULL; cpi->tplist = NULL;
// Delete last frame MV storage buffers // Delete last frame MV storage buffers
if (cpi->lfmv != 0)
vpx_free(cpi->lfmv); vpx_free(cpi->lfmv);
cpi->lfmv = 0; cpi->lfmv = 0;
if (cpi->lf_ref_frame_sign_bias != 0)
vpx_free(cpi->lf_ref_frame_sign_bias); vpx_free(cpi->lf_ref_frame_sign_bias);
cpi->lf_ref_frame_sign_bias = 0; cpi->lf_ref_frame_sign_bias = 0;
if (cpi->lf_ref_frame != 0)
vpx_free(cpi->lf_ref_frame); vpx_free(cpi->lf_ref_frame);
cpi->lf_ref_frame = 0; cpi->lf_ref_frame = 0;
// Delete sementation map // Delete sementation map
if (cpi->segmentation_map != 0)
vpx_free(cpi->segmentation_map); vpx_free(cpi->segmentation_map);
cpi->segmentation_map = 0; cpi->segmentation_map = 0;
if (cpi->active_map != 0)
vpx_free(cpi->active_map); vpx_free(cpi->active_map);
cpi->active_map = 0; cpi->active_map = 0;
// Delete first pass motion map // Delete first pass motion map
if (cpi->fp_motion_map != 0)
vpx_free(cpi->fp_motion_map); vpx_free(cpi->fp_motion_map);
cpi->fp_motion_map = 0; cpi->fp_motion_map = 0;
@ -388,23 +381,19 @@ void vp8_dealloc_compressor_data(VP8_COMP *cpi)
cpi->tok = 0; cpi->tok = 0;
// Structure used to monitor GF usage // Structure used to monitor GF usage
if (cpi->gf_active_flags != 0)
vpx_free(cpi->gf_active_flags); vpx_free(cpi->gf_active_flags);
cpi->gf_active_flags = 0; cpi->gf_active_flags = 0;
if(cpi->mb.pip)
vpx_free(cpi->mb.pip); vpx_free(cpi->mb.pip);
cpi->mb.pip = 0; cpi->mb.pip = 0;
#if !(CONFIG_REALTIME_ONLY) #if !(CONFIG_REALTIME_ONLY)
if(cpi->total_stats)
vpx_free(cpi->total_stats); vpx_free(cpi->total_stats);
cpi->total_stats = 0; cpi->total_stats = 0;
if(cpi->this_frame_stats)
vpx_free(cpi->this_frame_stats); vpx_free(cpi->this_frame_stats);
cpi->this_frame_stats = 0; cpi->this_frame_stats = 0;
@ -508,7 +497,6 @@ static void segmentation_test_function(VP8_PTR ptr)
set_segment_data(ptr, &feature_data[0][0], SEGMENT_DELTADATA); set_segment_data(ptr, &feature_data[0][0], SEGMENT_DELTADATA);
// Delete sementation map // Delete sementation map
if (seg_map != 0)
vpx_free(seg_map); vpx_free(seg_map);
seg_map = 0; seg_map = 0;
@ -602,7 +590,6 @@ static void cyclic_background_refresh(VP8_COMP *cpi, int Q, int lf_adjustment)
set_segment_data((VP8_PTR)cpi, &feature_data[0][0], SEGMENT_DELTADATA); set_segment_data((VP8_PTR)cpi, &feature_data[0][0], SEGMENT_DELTADATA);
// Delete sementation map // Delete sementation map
if (seg_map != 0)
vpx_free(seg_map); vpx_free(seg_map);
seg_map = 0; seg_map = 0;
@ -1376,7 +1363,6 @@ static void alloc_raw_frame_buffers(VP8_COMP *cpi)
static int vp8_alloc_partition_data(VP8_COMP *cpi) static int vp8_alloc_partition_data(VP8_COMP *cpi)
{ {
if(cpi->mb.pip)
vpx_free(cpi->mb.pip); vpx_free(cpi->mb.pip);
cpi->mb.pip = vpx_calloc((cpi->common.mb_cols + 1) * cpi->mb.pip = vpx_calloc((cpi->common.mb_cols + 1) *
@ -1423,7 +1409,6 @@ void vp8_alloc_compressor_data(VP8_COMP *cpi)
"Failed to allocate scaled source buffer"); "Failed to allocate scaled source buffer");
if (cpi->tok != 0)
vpx_free(cpi->tok); vpx_free(cpi->tok);
{ {
@ -1439,7 +1424,6 @@ void vp8_alloc_compressor_data(VP8_COMP *cpi)
// Structures used to minitor GF usage // Structures used to minitor GF usage
if (cpi->gf_active_flags != 0)
vpx_free(cpi->gf_active_flags); vpx_free(cpi->gf_active_flags);
CHECK_MEM_ERROR(cpi->gf_active_flags, vpx_calloc(1, cm->mb_rows * cm->mb_cols)); CHECK_MEM_ERROR(cpi->gf_active_flags, vpx_calloc(1, cm->mb_rows * cm->mb_cols));
@ -1447,12 +1431,10 @@ void vp8_alloc_compressor_data(VP8_COMP *cpi)
cpi->gf_active_count = cm->mb_rows * cm->mb_cols; cpi->gf_active_count = cm->mb_rows * cm->mb_cols;
#if !(CONFIG_REALTIME_ONLY) #if !(CONFIG_REALTIME_ONLY)
if(cpi->total_stats)
vpx_free(cpi->total_stats); vpx_free(cpi->total_stats);
cpi->total_stats = vpx_calloc(1, vp8_firstpass_stats_sz(cpi->common.MBs)); cpi->total_stats = vpx_calloc(1, vp8_firstpass_stats_sz(cpi->common.MBs));
if(cpi->this_frame_stats)
vpx_free(cpi->this_frame_stats); vpx_free(cpi->this_frame_stats);
cpi->this_frame_stats = vpx_calloc(1, vp8_firstpass_stats_sz(cpi->common.MBs)); cpi->this_frame_stats = vpx_calloc(1, vp8_firstpass_stats_sz(cpi->common.MBs));
@ -1473,7 +1455,6 @@ void vp8_alloc_compressor_data(VP8_COMP *cpi)
cpi->mt_sync_range = 16; cpi->mt_sync_range = 16;
#endif #endif
if(cpi->tplist);
vpx_free(cpi->tplist); vpx_free(cpi->tplist);
CHECK_MEM_ERROR(cpi->tplist, vpx_malloc(sizeof(TOKENLIST) * cpi->common.mb_rows)); CHECK_MEM_ERROR(cpi->tplist, vpx_malloc(sizeof(TOKENLIST) * cpi->common.mb_rows));

View File

@ -38,11 +38,8 @@ int
vp8_yv12_de_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf) vp8_yv12_de_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf)
{ {
if (ybf) if (ybf)
{
if (ybf->buffer_alloc)
{ {
duck_free(ybf->buffer_alloc); duck_free(ybf->buffer_alloc);
}
ybf->buffer_alloc = 0; ybf->buffer_alloc = 0;
} }

View File

@ -271,17 +271,17 @@ void bicubic_coefficient_destroy()
{ {
if (!g_first_time) if (!g_first_time)
{ {
if (g_b_scaler.l_w) vpx_free(g_b_scaler.l_w); vpx_free(g_b_scaler.l_w);
if (g_b_scaler.l_h) vpx_free(g_b_scaler.l_h); vpx_free(g_b_scaler.l_h);
if (g_b_scaler.l_h_uv) vpx_free(g_b_scaler.l_h_uv); vpx_free(g_b_scaler.l_h_uv);
if (g_b_scaler.c_w) vpx_free(g_b_scaler.c_w); vpx_free(g_b_scaler.c_w);
if (g_b_scaler.c_h) vpx_free(g_b_scaler.c_h); vpx_free(g_b_scaler.c_h);
if (g_b_scaler.c_h_uv) vpx_free(g_b_scaler.c_h_uv); vpx_free(g_b_scaler.c_h_uv);
vpx_memset(&g_b_scaler, 0, sizeof(BICUBIC_SCALER_STRUCT)); vpx_memset(&g_b_scaler, 0, sizeof(BICUBIC_SCALER_STRUCT));
} }
@ -342,21 +342,21 @@ int bicubic_coefficient_setup(int in_width, int in_height, int out_width, int ou
d_h_uv = (in_height / 2) / gcd_h_uv; d_h_uv = (in_height / 2) / gcd_h_uv;
// allocate memory for the coefficents // allocate memory for the coefficents
if (g_b_scaler.l_w) vpx_free(g_b_scaler.l_w); vpx_free(g_b_scaler.l_w);
if (g_b_scaler.l_h) vpx_free(g_b_scaler.l_h); vpx_free(g_b_scaler.l_h);
if (g_b_scaler.l_h_uv) vpx_free(g_b_scaler.l_h_uv); vpx_free(g_b_scaler.l_h_uv);
g_b_scaler.l_w = (short *)vpx_memalign(32, out_width * 2); g_b_scaler.l_w = (short *)vpx_memalign(32, out_width * 2);
g_b_scaler.l_h = (short *)vpx_memalign(32, out_height * 2); g_b_scaler.l_h = (short *)vpx_memalign(32, out_height * 2);
g_b_scaler.l_h_uv = (short *)vpx_memalign(32, out_height * 2); g_b_scaler.l_h_uv = (short *)vpx_memalign(32, out_height * 2);
if (g_b_scaler.c_w) vpx_free(g_b_scaler.c_w); vpx_free(g_b_scaler.c_w);
if (g_b_scaler.c_h) vpx_free(g_b_scaler.c_h); vpx_free(g_b_scaler.c_h);
if (g_b_scaler.c_h_uv) vpx_free(g_b_scaler.c_h_uv); vpx_free(g_b_scaler.c_h_uv);
g_b_scaler.c_w = (short *)vpx_memalign(32, g_b_scaler.nw * 4 * 2); g_b_scaler.c_w = (short *)vpx_memalign(32, g_b_scaler.nw * 4 * 2);
g_b_scaler.c_h = (short *)vpx_memalign(32, g_b_scaler.nh * 4 * 2); g_b_scaler.c_h = (short *)vpx_memalign(32, g_b_scaler.nh * 4 * 2);

View File

@ -23,11 +23,8 @@ int
vp8_yv12_de_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf) vp8_yv12_de_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf)
{ {
if (ybf) if (ybf)
{
if (ybf->buffer_alloc)
{ {
duck_free(ybf->buffer_alloc); duck_free(ybf->buffer_alloc);
}
ybf->buffer_alloc = 0; ybf->buffer_alloc = 0;
} }