summaryrefslogtreecommitdiff
path: root/vp8
diff options
context:
space:
mode:
Diffstat (limited to 'vp8')
-rw-r--r--vp8/decoder/threading.c33
-rw-r--r--vp8/encoder/arm/arm_csystemdependent.c4
-rw-r--r--vp8/encoder/arm/armv6/vp8_sad16x16_armv6.asm84
-rw-r--r--vp8/encoder/arm/variance_arm.h4
-rw-r--r--vp8/encoder/onyx_if.c19
-rw-r--r--vp8/vp8cx_arm.mk1
6 files changed, 91 insertions, 54 deletions
diff --git a/vp8/decoder/threading.c b/vp8/decoder/threading.c
index 271249a8d..2388909a1 100644
--- a/vp8/decoder/threading.c
+++ b/vp8/decoder/threading.c
@@ -473,22 +473,16 @@ void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows)
if (pbi->b_multithreaded_rd)
{
- if (pbi->mt_current_mb_col)
- {
vpx_free(pbi->mt_current_mb_col);
pbi->mt_current_mb_col = NULL ;
- }
/* Free above_row buffers. */
if (pbi->mt_yabove_row)
{
for (i=0; i< mb_rows; i++)
{
- if (pbi->mt_yabove_row[i])
- {
vpx_free(pbi->mt_yabove_row[i]);
pbi->mt_yabove_row[i] = NULL ;
- }
}
vpx_free(pbi->mt_yabove_row);
pbi->mt_yabove_row = NULL ;
@@ -498,11 +492,8 @@ void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows)
{
for (i=0; i< mb_rows; i++)
{
- if (pbi->mt_uabove_row[i])
- {
vpx_free(pbi->mt_uabove_row[i]);
pbi->mt_uabove_row[i] = NULL ;
- }
}
vpx_free(pbi->mt_uabove_row);
pbi->mt_uabove_row = NULL ;
@@ -512,11 +503,8 @@ void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows)
{
for (i=0; i< mb_rows; i++)
{
- if (pbi->mt_vabove_row[i])
- {
vpx_free(pbi->mt_vabove_row[i]);
pbi->mt_vabove_row[i] = NULL ;
- }
}
vpx_free(pbi->mt_vabove_row);
pbi->mt_vabove_row = NULL ;
@@ -527,11 +515,8 @@ void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows)
{
for (i=0; i< mb_rows; i++)
{
- if (pbi->mt_yleft_col[i])
- {
vpx_free(pbi->mt_yleft_col[i]);
pbi->mt_yleft_col[i] = NULL ;
- }
}
vpx_free(pbi->mt_yleft_col);
pbi->mt_yleft_col = NULL ;
@@ -541,11 +526,8 @@ void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows)
{
for (i=0; i< mb_rows; i++)
{
- if (pbi->mt_uleft_col[i])
- {
vpx_free(pbi->mt_uleft_col[i]);
pbi->mt_uleft_col[i] = NULL ;
- }
}
vpx_free(pbi->mt_uleft_col);
pbi->mt_uleft_col = NULL ;
@@ -555,11 +537,8 @@ void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows)
{
for (i=0; i< mb_rows; i++)
{
- if (pbi->mt_vleft_col[i])
- {
vpx_free(pbi->mt_vleft_col[i]);
pbi->mt_vleft_col[i] = NULL ;
- }
}
vpx_free(pbi->mt_vleft_col);
pbi->mt_vleft_col = NULL ;
@@ -644,29 +623,17 @@ void vp8_decoder_remove_threads(VP8D_COMP *pbi)
sem_destroy(&pbi->h_event_end_decoding);
- if (pbi->h_decoding_thread)
- {
vpx_free(pbi->h_decoding_thread);
pbi->h_decoding_thread = NULL;
- }
- if (pbi->h_event_start_decoding)
- {
vpx_free(pbi->h_event_start_decoding);
pbi->h_event_start_decoding = NULL;
- }
- if (pbi->mb_row_di)
- {
vpx_free(pbi->mb_row_di);
pbi->mb_row_di = NULL ;
- }
- if (pbi->de_thread_data)
- {
vpx_free(pbi->de_thread_data);
pbi->de_thread_data = NULL;
- }
}
}
diff --git a/vp8/encoder/arm/arm_csystemdependent.c b/vp8/encoder/arm/arm_csystemdependent.c
index 6c17a7984..cec35d548 100644
--- a/vp8/encoder/arm/arm_csystemdependent.c
+++ b/vp8/encoder/arm/arm_csystemdependent.c
@@ -29,8 +29,8 @@ void vp8_arch_arm_encoder_init(VP8_COMP *cpi)
#if HAVE_ARMV6
if (has_media)
{
- /*cpi->rtcd.variance.sad16x16 = vp8_sad16x16_c;
- cpi->rtcd.variance.sad16x8 = vp8_sad16x8_c;
+ cpi->rtcd.variance.sad16x16 = vp8_sad16x16_armv6;
+ /*cpi->rtcd.variance.sad16x8 = vp8_sad16x8_c;
cpi->rtcd.variance.sad8x16 = vp8_sad8x16_c;
cpi->rtcd.variance.sad8x8 = vp8_sad8x8_c;
cpi->rtcd.variance.sad4x4 = vp8_sad4x4_c;*/
diff --git a/vp8/encoder/arm/armv6/vp8_sad16x16_armv6.asm b/vp8/encoder/arm/armv6/vp8_sad16x16_armv6.asm
new file mode 100644
index 000000000..c759f7c65
--- /dev/null
+++ b/vp8/encoder/arm/armv6/vp8_sad16x16_armv6.asm
@@ -0,0 +1,84 @@
+;
+; Copyright (c) 2011 The WebM project authors. All Rights Reserved.
+;
+; Use of this source code is governed by a BSD-style license
+; that can be found in the LICENSE file in the root of the source
+; tree. An additional intellectual property rights grant can be found
+; in the file PATENTS. All contributing project authors may
+; be found in the AUTHORS file in the root of the source tree.
+;
+
+
+ EXPORT |vp8_sad16x16_armv6|
+
+ ARM
+ REQUIRE8
+ PRESERVE8
+
+ AREA ||.text||, CODE, READONLY, ALIGN=2
+
+; r0 const unsigned char *src_ptr
+; r1 int src_stride
+; r2 const unsigned char *ref_ptr
+; r3 int ref_stride
+; stack max_sad (not used)
+|vp8_sad16x16_armv6| PROC
+ stmfd sp!, {r4-r12, lr}
+ mov r4, #0 ; sad = 0;
+ mov r5, #8 ; loop count
+
+loop
+ ; 1st row
+ ldr r6, [r0, #0x0] ; load 4 src pixels (1A)
+ ldr r8, [r2, #0x0] ; load 4 ref pixels (1A)
+ ldr r7, [r0, #0x4] ; load 4 src pixels (1A)
+ ldr r9, [r2, #0x4] ; load 4 ref pixels (1A)
+ ldr r10, [r0, #0x8] ; load 4 src pixels (1B)
+ ldr r11, [r0, #0xC] ; load 4 src pixels (1B)
+
+ usada8 r4, r8, r6, r4 ; calculate sad for 4 pixels
+ usad8 r8, r7, r9 ; calculate sad for 4 pixels
+
+ ldr r12, [r2, #0x8] ; load 4 ref pixels (1B)
+ ldr lr, [r2, #0xC] ; load 4 ref pixels (1B)
+
+ add r0, r0, r1 ; set src pointer to next row
+ add r2, r2, r3 ; set dst pointer to next row
+
+ usada8 r4, r10, r12, r4 ; calculate sad for 4 pixels
+ usada8 r8, r11, lr, r8 ; calculate sad for 4 pixels
+
+ ldr r6, [r0, #0x0] ; load 4 src pixels (2A)
+ ldr r7, [r0, #0x4] ; load 4 src pixels (2A)
+ add r4, r4, r8 ; add partial sad values
+
+ ; 2nd row
+ ldr r8, [r2, #0x0] ; load 4 ref pixels (2A)
+ ldr r9, [r2, #0x4] ; load 4 ref pixels (2A)
+ ldr r10, [r0, #0x8] ; load 4 src pixels (2B)
+ ldr r11, [r0, #0xC] ; load 4 src pixels (2B)
+
+ usada8 r4, r6, r8, r4 ; calculate sad for 4 pixels
+ usad8 r8, r7, r9 ; calculate sad for 4 pixels
+
+ ldr r12, [r2, #0x8] ; load 4 ref pixels (2B)
+ ldr lr, [r2, #0xC] ; load 4 ref pixels (2B)
+
+ add r0, r0, r1 ; set src pointer to next row
+ add r2, r2, r3 ; set dst pointer to next row
+
+ usada8 r4, r10, r12, r4 ; calculate sad for 4 pixels
+ usada8 r8, r11, lr, r8 ; calculate sad for 4 pixels
+
+ subs r5, r5, #1 ; decrement loop counter
+ add r4, r4, r8 ; add partial sad values
+
+ bne loop
+
+ mov r0, r4 ; return sad
+ ldmfd sp!, {r4-r12, pc}
+
+ ENDP
+
+ END
+
diff --git a/vp8/encoder/arm/variance_arm.h b/vp8/encoder/arm/variance_arm.h
index 06d72873e..c807e29c0 100644
--- a/vp8/encoder/arm/variance_arm.h
+++ b/vp8/encoder/arm/variance_arm.h
@@ -14,11 +14,15 @@
#if HAVE_ARMV6
+extern prototype_sad(vp8_sad16x16_armv6);
extern prototype_variance(vp8_variance16x16_armv6);
extern prototype_subpixvariance(vp8_sub_pixel_variance16x16_armv6);
#if !CONFIG_RUNTIME_CPU_DETECT
+#undef vp8_variance_sad16x16
+#define vp8_variance_sad16x16 vp8_sad16x16_armv6
+
#undef vp8_variance_subpixvar16x16
#define vp8_variance_subpixvar16x16 vp8_sub_pixel_variance16x16_armv6
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c
index 47c46cae8..8baa00187 100644
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -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;
@@ -1312,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) *
@@ -1359,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);
{
@@ -1375,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));
@@ -1383,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));
@@ -1409,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));
diff --git a/vp8/vp8cx_arm.mk b/vp8/vp8cx_arm.mk
index abc5dc800..7980a0f75 100644
--- a/vp8/vp8cx_arm.mk
+++ b/vp8/vp8cx_arm.mk
@@ -34,6 +34,7 @@ VP8_CX_SRCS-$(HAVE_ARMV5TE) += encoder/arm/armv5te/vp8_packtokens_partitions_ar
#File list for armv6
# encoder
+VP8_CX_SRCS-$(HAVE_ARMV6) += encoder/arm/armv6/vp8_sad16x16_armv6$(ASM)
VP8_CX_SRCS-$(HAVE_ARMV6) += encoder/arm/armv6/vp8_variance16x16_armv6$(ASM)
VP8_CX_SRCS-$(HAVE_ARMV6) += encoder/arm/armv6/walsh_v6$(ASM)