summaryrefslogtreecommitdiff
path: root/vp8/encoder/onyx_if.c
diff options
context:
space:
mode:
Diffstat (limited to 'vp8/encoder/onyx_if.c')
-rw-r--r--vp8/encoder/onyx_if.c45
1 files changed, 14 insertions, 31 deletions
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c
index 3f787d6da..6ab1b39f7 100644
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -9,27 +9,27 @@
*/
-#include "onyxc_int.h"
+#include "vp8/common/onyxc_int.h"
#include "onyx_int.h"
-#include "systemdependent.h"
+#include "vp8/common/systemdependent.h"
#include "quantize.h"
-#include "alloccommon.h"
+#include "vp8/common/alloccommon.h"
#include "mcomp.h"
#include "firstpass.h"
#include "psnr.h"
#include "vpx_scale/vpxscale.h"
-#include "extend.h"
+#include "vp8/common/extend.h"
#include "ratectrl.h"
-#include "quant_common.h"
+#include "vp8/common/quant_common.h"
#include "segmentation.h"
-#include "g_common.h"
+#include "vp8/common/g_common.h"
#include "vpx_scale/yv12extend.h"
-#include "postproc.h"
+#include "vp8/common/postproc.h"
#include "vpx_mem/vpx_mem.h"
-#include "swapyv12buffer.h"
-#include "threading.h"
+#include "vp8/common/swapyv12buffer.h"
+#include "vp8/common/threading.h"
#include "vpx_ports/vpx_timer.h"
-#include "vpxerrors.h"
+#include "vp8/common/vpxerrors.h"
#include "temporal_filter.h"
#if ARCH_ARM
#include "vpx_ports/arm.h"
@@ -262,39 +262,32 @@ static void setup_features(VP8_COMP *cpi)
void vp8_dealloc_compressor_data(VP8_COMP *cpi)
{
- if(cpi->tplist!=0)
vpx_free(cpi->tplist);
cpi->tplist = NULL;
// Delete last frame MV storage buffers
- if (cpi->lfmv != 0)
vpx_free(cpi->lfmv);
cpi->lfmv = 0;
- if (cpi->lf_ref_frame_sign_bias != 0)
vpx_free(cpi->lf_ref_frame_sign_bias);
cpi->lf_ref_frame_sign_bias = 0;
- if (cpi->lf_ref_frame != 0)
vpx_free(cpi->lf_ref_frame);
cpi->lf_ref_frame = 0;
// Delete sementation map
- if (cpi->segmentation_map != 0)
vpx_free(cpi->segmentation_map);
cpi->segmentation_map = 0;
- if (cpi->active_map != 0)
vpx_free(cpi->active_map);
cpi->active_map = 0;
// Delete first pass motion map
- if (cpi->fp_motion_map != 0)
vpx_free(cpi->fp_motion_map);
cpi->fp_motion_map = 0;
@@ -319,23 +312,19 @@ void vp8_dealloc_compressor_data(VP8_COMP *cpi)
cpi->tok = 0;
// Structure used to monitor GF usage
- if (cpi->gf_active_flags != 0)
vpx_free(cpi->gf_active_flags);
cpi->gf_active_flags = 0;
- if(cpi->mb.pip)
vpx_free(cpi->mb.pip);
cpi->mb.pip = 0;
#if !(CONFIG_REALTIME_ONLY)
- if(cpi->total_stats)
vpx_free(cpi->total_stats);
cpi->total_stats = 0;
- if(cpi->this_frame_stats)
vpx_free(cpi->this_frame_stats);
cpi->this_frame_stats = 0;
@@ -442,7 +431,6 @@ static void segmentation_test_function(VP8_PTR ptr)
set_segment_data(ptr, &feature_data[0][0], SEGMENT_DELTADATA);
// Delete sementation map
- if (seg_map != 0)
vpx_free(seg_map);
seg_map = 0;
@@ -536,7 +524,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);
// Delete sementation map
- if (seg_map != 0)
vpx_free(seg_map);
seg_map = 0;
@@ -1280,6 +1267,8 @@ void vp8_set_speed_features(VP8_COMP *cpi)
static void alloc_raw_frame_buffers(VP8_COMP *cpi)
{
int i, buffers;
+ /* allocate source_buffer to be multiples of 16 */
+ int width = (cpi->oxcf.Width + 15) & ~15;
buffers = cpi->oxcf.lag_in_frames;
@@ -1291,7 +1280,7 @@ static void alloc_raw_frame_buffers(VP8_COMP *cpi)
for (i = 0; i < buffers; i++)
if (vp8_yv12_alloc_frame_buffer(&cpi->src_buffer[i].source_buffer,
- cpi->oxcf.Width, cpi->oxcf.Height,
+ width, cpi->oxcf.Height,
16))
vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
"Failed to allocate lag buffer");
@@ -1299,7 +1288,7 @@ static void alloc_raw_frame_buffers(VP8_COMP *cpi)
#if VP8_TEMPORAL_ALT_REF
if (vp8_yv12_alloc_frame_buffer(&cpi->alt_ref_buffer.source_buffer,
- cpi->oxcf.Width, cpi->oxcf.Height, 16))
+ width, cpi->oxcf.Height, 16))
vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
"Failed to allocate altref buffer");
@@ -1310,7 +1299,6 @@ static void alloc_raw_frame_buffers(VP8_COMP *cpi)
static int vp8_alloc_partition_data(VP8_COMP *cpi)
{
- if(cpi->mb.pip)
vpx_free(cpi->mb.pip);
cpi->mb.pip = vpx_calloc((cpi->common.mb_cols + 1) *
@@ -1357,7 +1345,6 @@ void vp8_alloc_compressor_data(VP8_COMP *cpi)
"Failed to allocate scaled source buffer");
- if (cpi->tok != 0)
vpx_free(cpi->tok);
{
@@ -1373,7 +1360,6 @@ void vp8_alloc_compressor_data(VP8_COMP *cpi)
// Structures used to minitor GF usage
- if (cpi->gf_active_flags != 0)
vpx_free(cpi->gf_active_flags);
CHECK_MEM_ERROR(cpi->gf_active_flags, vpx_calloc(1, cm->mb_rows * cm->mb_cols));
@@ -1381,12 +1367,10 @@ void vp8_alloc_compressor_data(VP8_COMP *cpi)
cpi->gf_active_count = cm->mb_rows * cm->mb_cols;
#if !(CONFIG_REALTIME_ONLY)
- if(cpi->total_stats)
vpx_free(cpi->total_stats);
cpi->total_stats = vpx_calloc(1, vp8_firstpass_stats_sz(cpi->common.MBs));
- if(cpi->this_frame_stats)
vpx_free(cpi->this_frame_stats);
cpi->this_frame_stats = vpx_calloc(1, vp8_firstpass_stats_sz(cpi->common.MBs));
@@ -1407,7 +1391,6 @@ void vp8_alloc_compressor_data(VP8_COMP *cpi)
cpi->mt_sync_range = 16;
#endif
- if(cpi->tplist);
vpx_free(cpi->tplist);
CHECK_MEM_ERROR(cpi->tplist, vpx_malloc(sizeof(TOKENLIST) * cpi->common.mb_rows));