Bug 763495 - Update libvpx source to 1.2.0. r=cpearce,glandium

This updates our in-tree copy of libvpx to match the 1.2.0 git
tag. All but one of the patches we were carrying are in this
upstream version. Our update.sh script should copy the new
files needed but will not remove the old ones for you.

Runtime cpu detection was rewritten upstream. We now generate
per-platform headers for this and include the correct one from
a vpx_rtcd.h wrapper like we were already doing for vpx_config.h

This revision includes improved assembly optimizations and should
be faster on all platforms.

Includes work by Jan Gerber and Ralph Giles.

--HG--
rename : media/libvpx/vp8/common/arm/neon/save_neon_reg.asm => media/libvpx/vp8/common/arm/neon/save_reg_neon.asm
rename : media/libvpx/vp8/common/arm/armv6/vp8_mse16x16_armv6.asm => media/libvpx/vp8/encoder/arm/armv6/vp8_mse16x16_armv6.asm
rename : media/libvpx/vp8/common/arm/neon/vp8_mse16x16_neon.asm => media/libvpx/vp8/encoder/arm/neon/vp8_mse16x16_neon.asm
rename : media/libvpx/vp8/encoder/x86/x86_csystemdependent.c => media/libvpx/vp8/encoder/x86/vp8_enc_stubs_mmx.c
rename : media/libvpx/vpx_config_arm-linux-gcc.c => media/libvpx/vpx_config_armv7-android-gcc.c
rename : media/libvpx/vpx_config_arm-linux-gcc.h => media/libvpx/vpx_config_armv7-android-gcc.h
This commit is contained in:
Jan Gerber 2013-11-29 06:02:00 -08:00
Родитель 4829857b56
Коммит 0790622e42
287 изменённых файлов: 21686 добавлений и 22696 удалений

Просмотреть файл

@ -1,624 +0,0 @@
# HG changeset patch
# Parent 5a1a0398f8503451582602525c3e7b35def5d0b9
# User Timothy B. Terriberry <tterribe@vt.edu>
Fix variance overflow
Upstream Change-Id: I1bad27ea0720067def6d71a6da5f789508cec265
diff --git a/media/libvpx/vp8/encoder/arm/armv6/vp8_variance16x16_armv6.asm b/media/libvpx/vp8/encoder/arm/armv6/vp8_variance16x16_armv6.asm
--- a/media/libvpx/vp8/encoder/arm/armv6/vp8_variance16x16_armv6.asm
+++ b/media/libvpx/vp8/encoder/arm/armv6/vp8_variance16x16_armv6.asm
@@ -139,16 +139,16 @@ loop
subs r12, r12, #1
bne loop
; return stuff
ldr r6, [sp, #40] ; get address of sse
mul r0, r8, r8 ; sum * sum
str r11, [r6] ; store sse
- sub r0, r11, r0, asr #8 ; return (sse - ((sum * sum) >> 8))
+ sub r0, r11, r0, lsr #8 ; return (sse - ((sum * sum) >> 8))
ldmfd sp!, {r4-r12, pc}
ENDP
END
diff --git a/media/libvpx/vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm b/media/libvpx/vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm
--- a/media/libvpx/vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm
+++ b/media/libvpx/vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm
@@ -164,17 +164,17 @@ loop
subs r12, r12, #1
bne loop
; return stuff
ldr r6, [sp, #40] ; get address of sse
mul r0, r8, r8 ; sum * sum
str r11, [r6] ; store sse
- sub r0, r11, r0, asr #8 ; return (sse - ((sum * sum) >> 8))
+ sub r0, r11, r0, lsr #8 ; return (sse - ((sum * sum) >> 8))
ldmfd sp!, {r4-r12, pc}
ENDP
c80808080
DCD 0x80808080
diff --git a/media/libvpx/vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm b/media/libvpx/vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm
--- a/media/libvpx/vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm
+++ b/media/libvpx/vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm
@@ -205,17 +205,17 @@ loop
smlad r11, r7, r7, r11 ; dual signed multiply, add and accumulate (2)
bne loop
; return stuff
ldr r6, [sp, #40] ; get address of sse
mul r0, r8, r8 ; sum * sum
str r11, [r6] ; store sse
- sub r0, r11, r0, asr #8 ; return (sse - ((sum * sum) >> 8))
+ sub r0, r11, r0, lsr #8 ; return (sse - ((sum * sum) >> 8))
ldmfd sp!, {r4-r12, pc}
ENDP
c80808080
DCD 0x80808080
diff --git a/media/libvpx/vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm b/media/libvpx/vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm
--- a/media/libvpx/vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm
+++ b/media/libvpx/vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm
@@ -166,17 +166,17 @@ loop
subs r12, r12, #1
bne loop
; return stuff
ldr r6, [sp, #40] ; get address of sse
mul r0, r8, r8 ; sum * sum
str r11, [r6] ; store sse
- sub r0, r11, r0, asr #8 ; return (sse - ((sum * sum) >> 8))
+ sub r0, r11, r0, lsr #8 ; return (sse - ((sum * sum) >> 8))
ldmfd sp!, {r4-r12, pc}
ENDP
c80808080
DCD 0x80808080
diff --git a/media/libvpx/vp8/encoder/arm/neon/variance_neon.asm b/media/libvpx/vp8/encoder/arm/neon/variance_neon.asm
--- a/media/libvpx/vp8/encoder/arm/neon/variance_neon.asm
+++ b/media/libvpx/vp8/encoder/arm/neon/variance_neon.asm
@@ -72,24 +72,24 @@ variance16x16_neon_loop
vpaddl.u32 q1, q10
vadd.s64 d0, d0, d1
vadd.u64 d1, d2, d3
;vmov.32 r0, d0[0] ;this instruction costs a lot
;vmov.32 r1, d1[0]
;mul r0, r0, r0
;str r1, [r12]
- ;sub r0, r1, r0, asr #8
+ ;sub r0, r1, r0, lsr #8
- ;sum is in [-255x256, 255x256]. sumxsum is 32-bit. Shift to right should
- ;have sign-bit exension, which is vshr.s. Have to use s32 to make it right.
+ ; while sum is signed, sum * sum is always positive and must be treated as
+ ; unsigned to avoid propagating the sign bit.
vmull.s32 q5, d0, d0
vst1.32 {d1[0]}, [r12] ;store sse
- vshr.s32 d10, d10, #8
- vsub.s32 d0, d1, d10
+ vshr.u32 d10, d10, #8
+ vsub.u32 d0, d1, d10
vmov.32 r0, d0[0] ;return
bx lr
ENDP
;================================
;unsigned int vp8_variance16x8_c(
@@ -140,18 +140,18 @@ variance16x8_neon_loop
ldr r12, [sp] ;load *sse from stack
vpaddl.u32 q1, q10
vadd.s64 d0, d0, d1
vadd.u64 d1, d2, d3
vmull.s32 q5, d0, d0
vst1.32 {d1[0]}, [r12] ;store sse
- vshr.s32 d10, d10, #7
- vsub.s32 d0, d1, d10
+ vshr.u32 d10, d10, #7
+ vsub.u32 d0, d1, d10
vmov.32 r0, d0[0] ;return
bx lr
ENDP
;=================================
;unsigned int vp8_variance8x16_c(
@@ -195,18 +195,18 @@ variance8x16_neon_loop
ldr r12, [sp] ;load *sse from stack
vpaddl.u32 q1, q10
vadd.s64 d0, d0, d1
vadd.u64 d1, d2, d3
vmull.s32 q5, d0, d0
vst1.32 {d1[0]}, [r12] ;store sse
- vshr.s32 d10, d10, #7
- vsub.s32 d0, d1, d10
+ vshr.u32 d10, d10, #7
+ vsub.u32 d0, d1, d10
vmov.32 r0, d0[0] ;return
bx lr
ENDP
;==================================
; r0 unsigned char *src_ptr
@@ -260,17 +260,17 @@ variance8x8_neon_loop
ldr r12, [sp] ;load *sse from stack
vpaddl.u32 q1, q10
vadd.s64 d0, d0, d1
vadd.u64 d1, d2, d3
vmull.s32 q5, d0, d0
vst1.32 {d1[0]}, [r12] ;store sse
- vshr.s32 d10, d10, #6
- vsub.s32 d0, d1, d10
+ vshr.u32 d10, d10, #6
+ vsub.u32 d0, d1, d10
vmov.32 r0, d0[0] ;return
bx lr
ENDP
END
diff --git a/media/libvpx/vp8/encoder/arm/neon/vp8_subpixelvariance16x16_neon.asm b/media/libvpx/vp8/encoder/arm/neon/vp8_subpixelvariance16x16_neon.asm
--- a/media/libvpx/vp8/encoder/arm/neon/vp8_subpixelvariance16x16_neon.asm
+++ b/media/libvpx/vp8/encoder/arm/neon/vp8_subpixelvariance16x16_neon.asm
@@ -400,18 +400,18 @@ sub_pixel_variance16x16_neon_loop
vpaddl.s32 q0, q8 ;accumulate sum
vpaddl.u32 q1, q10
vadd.s64 d0, d0, d1
vadd.u64 d1, d2, d3
vmull.s32 q5, d0, d0
vst1.32 {d1[0]}, [r6] ;store sse
- vshr.s32 d10, d10, #8
- vsub.s32 d0, d1, d10
+ vshr.u32 d10, d10, #8
+ vsub.u32 d0, d1, d10
add sp, sp, #528
vmov.32 r0, d0[0] ;return
pop {r4-r6,pc}
ENDP
diff --git a/media/libvpx/vp8/encoder/arm/neon/vp8_subpixelvariance16x16s_neon.asm b/media/libvpx/vp8/encoder/arm/neon/vp8_subpixelvariance16x16s_neon.asm
--- a/media/libvpx/vp8/encoder/arm/neon/vp8_subpixelvariance16x16s_neon.asm
+++ b/media/libvpx/vp8/encoder/arm/neon/vp8_subpixelvariance16x16s_neon.asm
@@ -107,18 +107,18 @@ vp8_filt_fpo16x16s_4_0_loop_neon
vpaddl.s32 q0, q8 ;accumulate sum
vpaddl.u32 q1, q10
vadd.s64 d0, d0, d1
vadd.u64 d1, d2, d3
vmull.s32 q5, d0, d0
vst1.32 {d1[0]}, [lr] ;store sse
- vshr.s32 d10, d10, #8
- vsub.s32 d0, d1, d10
+ vshr.u32 d10, d10, #8
+ vsub.u32 d0, d1, d10
vmov.32 r0, d0[0] ;return
pop {pc}
ENDP
;================================================
;unsigned int vp8_variance_halfpixvar16x16_v_neon
;(
@@ -203,18 +203,18 @@ vp8_filt_spo16x16s_0_4_loop_neon
vpaddl.s32 q0, q8 ;accumulate sum
vpaddl.u32 q1, q10
vadd.s64 d0, d0, d1
vadd.u64 d1, d2, d3
vmull.s32 q5, d0, d0
vst1.32 {d1[0]}, [lr] ;store sse
- vshr.s32 d10, d10, #8
- vsub.s32 d0, d1, d10
+ vshr.u32 d10, d10, #8
+ vsub.u32 d0, d1, d10
vmov.32 r0, d0[0] ;return
pop {pc}
ENDP
;================================================
;unsigned int vp8_variance_halfpixvar16x16_hv_neon
;(
@@ -322,18 +322,18 @@ vp8_filt16x16s_4_4_loop_neon
vpaddl.s32 q0, q13 ;accumulate sum
vpaddl.u32 q1, q15
vadd.s64 d0, d0, d1
vadd.u64 d1, d2, d3
vmull.s32 q5, d0, d0
vst1.32 {d1[0]}, [lr] ;store sse
- vshr.s32 d10, d10, #8
- vsub.s32 d0, d1, d10
+ vshr.u32 d10, d10, #8
+ vsub.u32 d0, d1, d10
vmov.32 r0, d0[0] ;return
pop {pc}
ENDP
;==============================
; r0 unsigned char *src_ptr,
; r1 int src_pixels_per_line,
@@ -555,18 +555,18 @@ sub_pixel_variance16x16s_neon_loop
vpaddl.s32 q0, q8 ;accumulate sum
vpaddl.u32 q1, q10
vadd.s64 d0, d0, d1
vadd.u64 d1, d2, d3
vmull.s32 q5, d0, d0
vst1.32 {d1[0]}, [lr] ;store sse
- vshr.s32 d10, d10, #8
- vsub.s32 d0, d1, d10
+ vshr.u32 d10, d10, #8
+ vsub.u32 d0, d1, d10
add sp, sp, #256
vmov.32 r0, d0[0] ;return
pop {r4, pc}
ENDP
END
diff --git a/media/libvpx/vp8/encoder/arm/neon/vp8_subpixelvariance8x8_neon.asm b/media/libvpx/vp8/encoder/arm/neon/vp8_subpixelvariance8x8_neon.asm
--- a/media/libvpx/vp8/encoder/arm/neon/vp8_subpixelvariance8x8_neon.asm
+++ b/media/libvpx/vp8/encoder/arm/neon/vp8_subpixelvariance8x8_neon.asm
@@ -201,18 +201,18 @@ sub_pixel_variance8x8_neon_loop
vpaddl.s32 q0, q8 ;accumulate sum
vpaddl.u32 q1, q10
vadd.s64 d0, d0, d1
vadd.u64 d1, d2, d3
vmull.s32 q5, d0, d0
vst1.32 {d1[0]}, [lr] ;store sse
- vshr.s32 d10, d10, #6
- vsub.s32 d0, d1, d10
+ vshr.u32 d10, d10, #6
+ vsub.u32 d0, d1, d10
vmov.32 r0, d0[0] ;return
pop {r4-r5, pc}
ENDP
;-----------------
diff --git a/media/libvpx/vp8/encoder/variance_c.c b/media/libvpx/vp8/encoder/variance_c.c
--- a/media/libvpx/vp8/encoder/variance_c.c
+++ b/media/libvpx/vp8/encoder/variance_c.c
@@ -70,82 +70,82 @@ unsigned int vp8_variance16x16_c(
unsigned int *sse)
{
unsigned int var;
int avg;
variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 16, &var, &avg);
*sse = var;
- return (var - ((avg * avg) >> 8));
+ return (var - ((unsigned int)(avg * avg) >> 8));
}
unsigned int vp8_variance8x16_c(
const unsigned char *src_ptr,
int source_stride,
const unsigned char *ref_ptr,
int recon_stride,
unsigned int *sse)
{
unsigned int var;
int avg;
variance(src_ptr, source_stride, ref_ptr, recon_stride, 8, 16, &var, &avg);
*sse = var;
- return (var - ((avg * avg) >> 7));
+ return (var - ((unsigned int)(avg * avg) >> 7));
}
unsigned int vp8_variance16x8_c(
const unsigned char *src_ptr,
int source_stride,
const unsigned char *ref_ptr,
int recon_stride,
unsigned int *sse)
{
unsigned int var;
int avg;
variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 8, &var, &avg);
*sse = var;
- return (var - ((avg * avg) >> 7));
+ return (var - ((unsigned int)(avg * avg) >> 7));
}
unsigned int vp8_variance8x8_c(
const unsigned char *src_ptr,
int source_stride,
const unsigned char *ref_ptr,
int recon_stride,
unsigned int *sse)
{
unsigned int var;
int avg;
variance(src_ptr, source_stride, ref_ptr, recon_stride, 8, 8, &var, &avg);
*sse = var;
- return (var - ((avg * avg) >> 6));
+ return (var - ((unsigned int)(avg * avg) >> 6));
}
unsigned int vp8_variance4x4_c(
const unsigned char *src_ptr,
int source_stride,
const unsigned char *ref_ptr,
int recon_stride,
unsigned int *sse)
{
unsigned int var;
int avg;
variance(src_ptr, source_stride, ref_ptr, recon_stride, 4, 4, &var, &avg);
*sse = var;
- return (var - ((avg * avg) >> 4));
+ return (var - ((unsigned int)(avg * avg) >> 4));
}
unsigned int vp8_mse16x16_c(
const unsigned char *src_ptr,
int source_stride,
const unsigned char *ref_ptr,
int recon_stride,
diff --git a/media/libvpx/vp8/encoder/x86/variance_mmx.c b/media/libvpx/vp8/encoder/x86/variance_mmx.c
--- a/media/libvpx/vp8/encoder/x86/variance_mmx.c
+++ b/media/libvpx/vp8/encoder/x86/variance_mmx.c
@@ -86,34 +86,34 @@ unsigned int vp8_variance4x4_mmx(
int recon_stride,
unsigned int *sse)
{
unsigned int var;
int avg;
vp8_get4x4var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg) ;
*sse = var;
- return (var - ((avg * avg) >> 4));
+ return (var - ((unsigned int)(avg * avg) >> 4));
}
unsigned int vp8_variance8x8_mmx(
const unsigned char *src_ptr,
int source_stride,
const unsigned char *ref_ptr,
int recon_stride,
unsigned int *sse)
{
unsigned int var;
int avg;
vp8_get8x8var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg) ;
*sse = var;
- return (var - ((avg * avg) >> 6));
+ return (var - ((unsigned int)(avg * avg) >> 6));
}
unsigned int vp8_mse16x16_mmx(
const unsigned char *src_ptr,
int source_stride,
const unsigned char *ref_ptr,
int recon_stride,
@@ -148,17 +148,17 @@ unsigned int vp8_variance16x16_mmx(
vp8_get8x8var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0) ;
vp8_get8x8var_mmx(src_ptr + 8, source_stride, ref_ptr + 8, recon_stride, &sse1, &sum1);
vp8_get8x8var_mmx(src_ptr + 8 * source_stride, source_stride, ref_ptr + 8 * recon_stride, recon_stride, &sse2, &sum2) ;
vp8_get8x8var_mmx(src_ptr + 8 * source_stride + 8, source_stride, ref_ptr + 8 * recon_stride + 8, recon_stride, &sse3, &sum3);
var = sse0 + sse1 + sse2 + sse3;
avg = sum0 + sum1 + sum2 + sum3;
*sse = var;
- return (var - ((avg * avg) >> 8));
+ return (var - ((unsigned int)(avg * avg) >> 8));
}
unsigned int vp8_variance16x8_mmx(
const unsigned char *src_ptr,
int source_stride,
const unsigned char *ref_ptr,
int recon_stride,
unsigned int *sse)
@@ -167,17 +167,17 @@ unsigned int vp8_variance16x8_mmx(
int sum0, sum1, avg;
vp8_get8x8var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0) ;
vp8_get8x8var_mmx(src_ptr + 8, source_stride, ref_ptr + 8, recon_stride, &sse1, &sum1);
var = sse0 + sse1;
avg = sum0 + sum1;
*sse = var;
- return (var - ((avg * avg) >> 7));
+ return (var - ((unsigned int)(avg * avg) >> 7));
}
unsigned int vp8_variance8x16_mmx(
const unsigned char *src_ptr,
int source_stride,
const unsigned char *ref_ptr,
@@ -189,17 +189,17 @@ unsigned int vp8_variance8x16_mmx(
vp8_get8x8var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0) ;
vp8_get8x8var_mmx(src_ptr + 8 * source_stride, source_stride, ref_ptr + 8 * recon_stride, recon_stride, &sse1, &sum1) ;
var = sse0 + sse1;
avg = sum0 + sum1;
*sse = var;
- return (var - ((avg * avg) >> 7));
+ return (var - ((unsigned int)(avg * avg) >> 7));
}
unsigned int vp8_sub_pixel_variance4x4_mmx
(
const unsigned char *src_ptr,
int src_pixels_per_line,
diff --git a/media/libvpx/vp8/encoder/x86/variance_sse2.c b/media/libvpx/vp8/encoder/x86/variance_sse2.c
--- a/media/libvpx/vp8/encoder/x86/variance_sse2.c
+++ b/media/libvpx/vp8/encoder/x86/variance_sse2.c
@@ -143,34 +143,34 @@ unsigned int vp8_variance4x4_wmt(
int recon_stride,
unsigned int *sse)
{
unsigned int var;
int avg;
vp8_get4x4var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg) ;
*sse = var;
- return (var - ((avg * avg) >> 4));
+ return (var - ((unsigned int)(avg * avg) >> 4));
}
unsigned int vp8_variance8x8_wmt
(
const unsigned char *src_ptr,
int source_stride,
const unsigned char *ref_ptr,
int recon_stride,
unsigned int *sse)
{
unsigned int var;
int avg;
vp8_get8x8var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg) ;
*sse = var;
- return (var - ((avg * avg) >> 6));
+ return (var - ((unsigned int)(avg * avg) >> 6));
}
unsigned int vp8_variance16x16_wmt
(
const unsigned char *src_ptr,
int source_stride,
@@ -215,17 +215,17 @@ unsigned int vp8_variance16x8_wmt
int sum0, sum1, avg;
vp8_get8x8var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0) ;
vp8_get8x8var_sse2(src_ptr + 8, source_stride, ref_ptr + 8, recon_stride, &sse1, &sum1);
var = sse0 + sse1;
avg = sum0 + sum1;
*sse = var;
- return (var - ((avg * avg) >> 7));
+ return (var - ((unsigned int)(avg * avg) >> 7));
}
unsigned int vp8_variance8x16_wmt
(
const unsigned char *src_ptr,
int source_stride,
const unsigned char *ref_ptr,
@@ -236,17 +236,17 @@ unsigned int vp8_variance8x16_wmt
int sum0, sum1, avg;
vp8_get8x8var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0) ;
vp8_get8x8var_sse2(src_ptr + 8 * source_stride, source_stride, ref_ptr + 8 * recon_stride, recon_stride, &sse1, &sum1) ;
var = sse0 + sse1;
avg = sum0 + sum1;
*sse = var;
- return (var - ((avg * avg) >> 7));
+ return (var - ((unsigned int)(avg * avg) >> 7));
}
unsigned int vp8_sub_pixel_variance4x4_wmt
(
const unsigned char *src_ptr,
int src_pixels_per_line,
int xoffset,
diff --git a/media/libvpx/vp8/encoder/x86/variance_ssse3.c b/media/libvpx/vp8/encoder/x86/variance_ssse3.c
--- a/media/libvpx/vp8/encoder/x86/variance_ssse3.c
+++ b/media/libvpx/vp8/encoder/x86/variance_ssse3.c
@@ -107,17 +107,17 @@ unsigned int vp8_sub_pixel_variance16x16
vp8_filter_block2d_bil_var_ssse3(
src_ptr, src_pixels_per_line,
dst_ptr, dst_pixels_per_line, 16,
xoffset, yoffset,
&xsum0, &xxsum0);
}
*sse = xxsum0;
- return (xxsum0 - ((xsum0 * xsum0) >> 8));
+ return (xxsum0 - ((unsigned int)(xsum0 * xsum0) >> 8));
}
unsigned int vp8_sub_pixel_variance16x8_ssse3
(
const unsigned char *src_ptr,
int src_pixels_per_line,
int xoffset,
int yoffset,
@@ -156,10 +156,10 @@ unsigned int vp8_sub_pixel_variance16x8_
vp8_filter_block2d_bil_var_ssse3(
src_ptr, src_pixels_per_line,
dst_ptr, dst_pixels_per_line, 8,
xoffset, yoffset,
&xsum0, &xxsum0);
}
*sse = xxsum0;
- return (xxsum0 - ((xsum0 * xsum0) >> 7));
+ return (xxsum0 - ((unsigned int)(xsum0 * xsum0) >> 7));
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,41 +0,0 @@
# HG changeset patch
# Parent 0d104ba08fe98d5024014fbf45af06100ef7b6f9
# User Timothy B. Terriberry <tterribe@vt.edu>
Align internal mfqe framebuffer dimensions
Upstream Change-Id: I3915d597cd66886a24f4ef39752751ebe6425066
diff --git a/media/libvpx/vp8/common/postproc.c b/media/libvpx/vp8/common/postproc.c
--- a/media/libvpx/vp8/common/postproc.c
+++ b/media/libvpx/vp8/common/postproc.c
@@ -938,20 +938,26 @@ int vp8_post_proc_frame(VP8_COMMON *oci,
return 0;
}
/* Allocate post_proc_buffer_int if needed */
if ((flags & VP8D_MFQE) && !oci->post_proc_buffer_int_used)
{
if ((flags & VP8D_DEBLOCK) || (flags & VP8D_DEMACROBLOCK))
{
- if (vp8_yv12_alloc_frame_buffer(&oci->post_proc_buffer_int, oci->Width, oci->Height, VP8BORDERINPIXELS) >= 0)
- {
- oci->post_proc_buffer_int_used = 1;
- }
+ int width = (oci->Width + 15) & ~15;
+ int height = (oci->Height + 15) & ~15;
+
+ if (vp8_yv12_alloc_frame_buffer(&oci->post_proc_buffer_int,
+ width, height, VP8BORDERINPIXELS))
+ vpx_internal_error(&oci->error, VPX_CODEC_MEM_ERROR,
+ "Failed to allocate MFQE framebuffer");
+
+ oci->post_proc_buffer_int_used = 1;
+
// insure that postproc is set to all 0's so that post proc
// doesn't pull random data in from edge
vpx_memset((&oci->post_proc_buffer_int)->buffer_alloc,126,(&oci->post_proc_buffer)->frame_size);
}
}
#if ARCH_X86||ARCH_X86_64

Просмотреть файл

@ -1,33 +0,0 @@
# HG changeset patch
# Parent 5668c50552abba043eff64ffc5d8abde43d7964a
# User Timothy B. Terriberry <tterribe@vt.edu>
Support Android x86 NDK build
Upstream Change-Id: I42ab00e3255208ba95d7f9b9a8a3605ff58da8e1
diff --git a/media/libvpx/vp8/common/x86/postproc_x86.c b/media/libvpx/vp8/common/x86/postproc_x86.c
new file mode 100644
--- /dev/null
+++ b/media/libvpx/vp8/common/x86/postproc_x86.c
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2012 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.
+ */
+
+/* On Android NDK, rand is inlined function, but postproc needs rand symbol */
+#if defined(__ANDROID__)
+#define rand __rand
+#include <stdlib.h>
+#undef rand
+
+extern int rand(void)
+{
+ return __rand();
+}
+#endif

Просмотреть файл

@ -1,348 +0,0 @@
# HG changeset patch
# Parent d02aa133060bcdfd44634038c8c28654c718c2ff
# User Timothy B. Terriberry <tterribe@vt.edu>
remove __inline for compiler compatibility
Upstream Change-Id: I6f2b218dfc808b73212bbb90c69e2b6cc1fa90ce
diff --git a/media/libvpx/vp8/common/loopfilter_filters.c b/media/libvpx/vp8/common/loopfilter_filters.c
--- a/media/libvpx/vp8/common/loopfilter_filters.c
+++ b/media/libvpx/vp8/common/loopfilter_filters.c
@@ -10,50 +10,50 @@
#include <stdlib.h>
#include "loopfilter.h"
#include "onyxc_int.h"
typedef unsigned char uc;
-static __inline signed char vp8_signed_char_clamp(int t)
+static signed char vp8_signed_char_clamp(int t)
{
t = (t < -128 ? -128 : t);
t = (t > 127 ? 127 : t);
return (signed char) t;
}
/* should we apply any filter at all ( 11111111 yes, 00000000 no) */
-static __inline signed char vp8_filter_mask(uc limit, uc blimit,
- uc p3, uc p2, uc p1, uc p0,
- uc q0, uc q1, uc q2, uc q3)
+static signed char vp8_filter_mask(uc limit, uc blimit,
+ uc p3, uc p2, uc p1, uc p0,
+ uc q0, uc q1, uc q2, uc q3)
{
signed char mask = 0;
mask |= (abs(p3 - p2) > limit);
mask |= (abs(p2 - p1) > limit);
mask |= (abs(p1 - p0) > limit);
mask |= (abs(q1 - q0) > limit);
mask |= (abs(q2 - q1) > limit);
mask |= (abs(q3 - q2) > limit);
mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 > blimit);
return mask - 1;
}
/* is there high variance internal edge ( 11111111 yes, 00000000 no) */
-static __inline signed char vp8_hevmask(uc thresh, uc p1, uc p0, uc q0, uc q1)
+static signed char vp8_hevmask(uc thresh, uc p1, uc p0, uc q0, uc q1)
{
signed char hev = 0;
hev |= (abs(p1 - p0) > thresh) * -1;
hev |= (abs(q1 - q0) > thresh) * -1;
return hev;
}
-static __inline void vp8_filter(signed char mask, uc hev, uc *op1,
+static void vp8_filter(signed char mask, uc hev, uc *op1,
uc *op0, uc *oq0, uc *oq1)
{
signed char ps0, qs0;
signed char ps1, qs1;
signed char vp8_filter, Filter1, Filter2;
signed char u;
@@ -153,17 +153,17 @@ void vp8_loop_filter_vertical_edge_c
vp8_filter(mask, hev, s - 2, s - 1, s, s + 1);
s += p;
}
while (++i < count * 8);
}
-static __inline void vp8_mbfilter(signed char mask, uc hev,
+static void vp8_mbfilter(signed char mask, uc hev,
uc *op2, uc *op1, uc *op0, uc *oq0, uc *oq1, uc *oq2)
{
signed char s, u;
signed char vp8_filter, Filter1, Filter2;
signed char ps2 = (signed char) * op2 ^ 0x80;
signed char ps1 = (signed char) * op1 ^ 0x80;
signed char ps0 = (signed char) * op0 ^ 0x80;
signed char qs0 = (signed char) * oq0 ^ 0x80;
@@ -274,27 +274,27 @@ void vp8_mbloop_filter_vertical_edge_c
s += p;
}
while (++i < count * 8);
}
/* should we apply any filter at all ( 11111111 yes, 00000000 no) */
-static __inline signed char vp8_simple_filter_mask(uc blimit, uc p1, uc p0, uc q0, uc q1)
+static signed char vp8_simple_filter_mask(uc blimit, uc p1, uc p0, uc q0, uc q1)
{
/* Why does this cause problems for win32?
* error C2143: syntax error : missing ';' before 'type'
* (void) limit;
*/
signed char mask = (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 <= blimit) * -1;
return mask;
}
-static __inline void vp8_simple_filter(signed char mask, uc *op1, uc *op0, uc *oq0, uc *oq1)
+static void vp8_simple_filter(signed char mask, uc *op1, uc *op0, uc *oq0, uc *oq1)
{
signed char vp8_filter, Filter1, Filter2;
signed char p1 = (signed char) * op1 ^ 0x80;
signed char p0 = (signed char) * op0 ^ 0x80;
signed char q0 = (signed char) * oq0 ^ 0x80;
signed char q1 = (signed char) * oq1 ^ 0x80;
signed char u;
diff --git a/media/libvpx/vp8/common/onyx.h b/media/libvpx/vp8/common/onyx.h
--- a/media/libvpx/vp8/common/onyx.h
+++ b/media/libvpx/vp8/common/onyx.h
@@ -67,17 +67,17 @@ extern "C"
{
FRAMEFLAGS_KEY = 1,
FRAMEFLAGS_GOLDEN = 2,
FRAMEFLAGS_ALTREF = 4,
} FRAMETYPE_FLAGS;
#include <assert.h>
- static __inline void Scale2Ratio(int mode, int *hr, int *hs)
+ static void Scale2Ratio(int mode, int *hr, int *hs)
{
switch (mode)
{
case NORMAL:
*hr = 1;
*hs = 1;
break;
case FOURFIVE:
diff --git a/media/libvpx/vp8/encoder/encodemv.c b/media/libvpx/vp8/encoder/encodemv.c
--- a/media/libvpx/vp8/encoder/encodemv.c
+++ b/media/libvpx/vp8/encoder/encodemv.c
@@ -181,17 +181,17 @@ void vp8_build_component_cost_table(int
// Motion vector probability table update depends on benefit.
// Small correction allows for the fact that an update to an MV probability
// may have benefit in subsequent frames as well as the current one.
#define MV_PROB_UPDATE_CORRECTION -1
-__inline static void calc_prob(vp8_prob *p, const unsigned int ct[2])
+static void calc_prob(vp8_prob *p, const unsigned int ct[2])
{
const unsigned int tot = ct[0] + ct[1];
if (tot)
{
const vp8_prob x = ((ct[0] * 255) / tot) & -2;
*p = x ? x : 1;
}
diff --git a/media/libvpx/vp8/encoder/rdopt.c b/media/libvpx/vp8/encoder/rdopt.c
--- a/media/libvpx/vp8/encoder/rdopt.c
+++ b/media/libvpx/vp8/encoder/rdopt.c
@@ -1326,17 +1326,17 @@ static void rd_check_segment(VP8_COMP *c
{
bsi->mvs[i].as_mv = x->partition_info->bmi[i].mv.as_mv;
bsi->modes[i] = x->partition_info->bmi[i].mode;
bsi->eobs[i] = x->e_mbd.eobs[i];
}
}
}
-static __inline
+static
void vp8_cal_step_param(int sr, int *sp)
{
int step = 0;
if (sr > MAX_FIRST_STEP) sr = MAX_FIRST_STEP;
else if (sr < 1) sr = 1;
while (sr>>=1)
diff --git a/media/libvpx/vp8/encoder/sad_c.c b/media/libvpx/vp8/encoder/sad_c.c
--- a/media/libvpx/vp8/encoder/sad_c.c
+++ b/media/libvpx/vp8/encoder/sad_c.c
@@ -34,17 +34,17 @@ unsigned int vp8_sad16x16_c(
src_ptr += src_stride;
ref_ptr += ref_stride;
}
return sad;
}
-static __inline
+static
unsigned int sad_mx_n_c(
const unsigned char *src_ptr,
int src_stride,
const unsigned char *ref_ptr,
int ref_stride,
int m,
int n)
{
diff --git a/media/libvpx/vp8/encoder/tokenize.c b/media/libvpx/vp8/encoder/tokenize.c
--- a/media/libvpx/vp8/encoder/tokenize.c
+++ b/media/libvpx/vp8/encoder/tokenize.c
@@ -480,17 +480,17 @@ void print_context_counters()
void vp8_tokenize_initialize()
{
fill_value_tokens();
}
-static __inline void stuff2nd_order_b
+static void stuff2nd_order_b
(
TOKENEXTRA **tp,
ENTROPY_CONTEXT *a,
ENTROPY_CONTEXT *l,
VP8_COMP *cpi
)
{
int pt; /* near block/prev token context index */
@@ -504,17 +504,17 @@ static __inline void stuff2nd_order_b
++t;
*tp = t;
pt = 0;
*a = *l = pt;
}
-static __inline void stuff1st_order_b
+static void stuff1st_order_b
(
TOKENEXTRA **tp,
ENTROPY_CONTEXT *a,
ENTROPY_CONTEXT *l,
int type,
VP8_COMP *cpi
)
{
@@ -528,17 +528,17 @@ static __inline void stuff1st_order_b
t->skip_eob_node = 0;
++cpi->coef_counts [type] [band] [pt] [DCT_EOB_TOKEN];
++t;
*tp = t;
pt = 0; /* 0 <-> all coeff data is zero */
*a = *l = pt;
}
-static __inline
+static
void stuff1st_order_buv
(
TOKENEXTRA **tp,
ENTROPY_CONTEXT *a,
ENTROPY_CONTEXT *l,
VP8_COMP *cpi
)
{
diff --git a/media/libvpx/vp8/encoder/treewriter.h b/media/libvpx/vp8/encoder/treewriter.h
--- a/media/libvpx/vp8/encoder/treewriter.h
+++ b/media/libvpx/vp8/encoder/treewriter.h
@@ -37,28 +37,28 @@ typedef BOOL_CODER vp8_writer;
#define vp8_cost_bit( x, b) vp8_cost_zero( (b)? vp8_complement(x) : (x) )
/* VP8BC version is scaled by 2^20 rather than 2^8; see bool_coder.h */
/* Both of these return bits, not scaled bits. */
-static __inline unsigned int vp8_cost_branch(const unsigned int ct[2], vp8_prob p)
+static unsigned int vp8_cost_branch(const unsigned int ct[2], vp8_prob p)
{
/* Imitate existing calculation */
return ((ct[0] * vp8_cost_zero(p))
+ (ct[1] * vp8_cost_one(p))) >> 8;
}
/* Small functions to write explicit values and tokens, as well as
estimate their lengths. */
-static __inline void vp8_treed_write
+static void vp8_treed_write
(
vp8_writer *const w,
vp8_tree t,
const vp8_prob *const p,
int v,
int n /* number of bits in v, assumed nonzero */
)
{
@@ -67,28 +67,28 @@ static __inline void vp8_treed_write
do
{
const int b = (v >> --n) & 1;
vp8_write(w, b, p[i>>1]);
i = t[i+b];
}
while (n);
}
-static __inline void vp8_write_token
+static void vp8_write_token
(
vp8_writer *const w,
vp8_tree t,
const vp8_prob *const p,
vp8_token *const x
)
{
vp8_treed_write(w, t, p, x->value, x->Len);
}
-static __inline int vp8_treed_cost(
+static int vp8_treed_cost(
vp8_tree t,
const vp8_prob *const p,
int v,
int n /* number of bits in v, assumed nonzero */
)
{
int c = 0;
vp8_tree_index i = 0;
@@ -98,17 +98,17 @@ static __inline int vp8_treed_cost(
const int b = (v >> --n) & 1;
c += vp8_cost_bit(p[i>>1], b);
i = t[i+b];
}
while (n);
return c;
}
-static __inline int vp8_cost_token
+static int vp8_cost_token
(
vp8_tree t,
const vp8_prob *const p,
vp8_token *const x
)
{
return vp8_treed_cost(t, p, x->value, x->Len);
}

Просмотреть файл

@ -1,29 +0,0 @@
# HG changeset patch
# Parent 919fe109d4a2e1768470d78c59d5b8ecc1a34a53
# User Timothy B. Terriberry <tterribe@vt.edu>
fix potential use of uninitialized rate_y
Upstream Change-Id: I8a35831e8f08b549806d0c2c6900d42af883f78f
diff --git a/media/libvpx/vp8/encoder/rdopt.c b/media/libvpx/vp8/encoder/rdopt.c
--- a/media/libvpx/vp8/encoder/rdopt.c
+++ b/media/libvpx/vp8/encoder/rdopt.c
@@ -742,17 +742,17 @@ static int rd_pick_intra4x4mby_modes(VP8
if(total_rd >= (int64_t)best_rd)
break;
}
if(total_rd >= (int64_t)best_rd)
return INT_MAX;
*Rate = cost;
- *rate_y += tot_rate_y;
+ *rate_y = tot_rate_y;
*Distortion = distortion;
return RDCOST(mb->rdmult, mb->rddiv, cost, distortion);
}
static int rd_pick_intra16x16mby_mode(VP8_COMP *cpi,
MACROBLOCK *x,

Просмотреть файл

@ -1,33 +0,0 @@
# HG changeset patch
# Parent d0bb669a2e26f138d416333b21f55151503dcdf9
# User Timothy B. Terriberry <tterribe@vt.edu>
decoder: reset segmentation map on keyframes
Upstream Change-Id: I9713c9f070eb37b31b3b029d9ef96be9b6ea2def
diff --git a/media/libvpx/vp8/decoder/decodframe.c b/media/libvpx/vp8/decoder/decodframe.c
--- a/media/libvpx/vp8/decoder/decodframe.c
+++ b/media/libvpx/vp8/decoder/decodframe.c
@@ -830,16 +830,22 @@ int vp8_decode_frame(VP8D_COMP *pbi)
for (i = 0; i < MB_FEATURE_TREE_PROBS; i++)
{
/* If not explicitly set value is defaulted to 255 by memset above */
if (vp8_read_bit(bc))
xd->mb_segment_tree_probs[i] = (vp8_prob)vp8_read_literal(bc, 8);
}
}
}
+ else
+ {
+ /* No segmentation updates on this frame */
+ xd->update_mb_segmentation_map = 0;
+ xd->update_mb_segmentation_data = 0;
+ }
/* Read the loop filter level and type */
pc->filter_type = (LOOPFILTERTYPE) vp8_read_bit(bc);
pc->filter_level = vp8_read_literal(bc, 6);
pc->sharpness_level = vp8_read_literal(bc, 3);
/* Read in loop filter deltas applied at the MB level based on mode or ref frame. */
xd->mode_ref_lf_delta_update = 0;

Просмотреть файл

@ -2,181 +2,12 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
LOCAL_INCLUDES += \
-I. \
-I$(topsrcdir)/media/libvpx \
-I$(topsrcdir)/media/libvpx/vp8/ \
-I$(topsrcdir)/media/libvpx/vp8/common/ \
-I$(topsrcdir)/media/libvpx/vp8/common/arm \
-I$(topsrcdir)/media/libvpx/vp8/common/x86 \
-I$(topsrcdir)/media/libvpx/vp8/decoder \
-I$(topsrcdir)/media/libvpx/vp8/decoder/arm \
-I$(topsrcdir)/media/libvpx/vp8/decoder/x86 \
-I$(topsrcdir)/media/libvpx/vpx_codec \
-I$(topsrcdir)/media/libvpx/vpx_mem/ \
-I$(topsrcdir)/media/libvpx/vpx_mem/include \
-I$(topsrcdir)/media/libvpx/vpx_ports/ \
-I$(topsrcdir)/media/libvpx/vpx_scale/ \
$(NULL)
VPATH += \
$(srcdir)/build/make \
$(srcdir)/vpx \
$(srcdir)/vpx/src \
$(srcdir)/vpx_mem \
$(srcdir)/vpx_mem/include \
$(srcdir)/vpx_ports \
$(srcdir)/vpx_scale \
$(srcdir)/vpx_scale/arm \
$(srcdir)/vpx_scale/arm/neon \
$(srcdir)/vpx_scale/generic \
$(srcdir)/vp8 \
$(srcdir)/vp8/common \
$(srcdir)/vp8/common/arm \
$(srcdir)/vp8/common/arm/armv6 \
$(srcdir)/vp8/common/arm/neon \
$(srcdir)/vp8/common/generic \
$(srcdir)/vp8/common/x86 \
$(srcdir)/vp8/decoder \
$(srcdir)/vp8/decoder/arm \
$(srcdir)/vp8/decoder/arm/armv6 \
$(srcdir)/vp8/decoder/arm/neon \
$(srcdir)/vp8/decoder/generic \
$(srcdir)/vp8/decoder/x86 \
$(NULL)
#Setup the libvpx assembler config.
AS=$(VPX_AS)
ASFLAGS=$(VPX_ASFLAGS) -I. -I$(topsrcdir)/media/libvpx/ -I$(topsrcdir)/media/libvpx/vpx_ports/
AS_DASH_C_FLAG=$(VPX_DASH_C_FLAG)
ASM_SUFFIX=$(VPX_ASM_SUFFIX)
ifdef MOZ_VP8_ERROR_CONCEALMENT
CSRCS += \
error_concealment.c \
$(NULL)
endif
ifdef MOZ_VP8_ENCODER
VPATH += \
$(srcdir)/vp8/encoder \
$(srcdir)/vp8/encoder/arm \
$(srcdir)/vp8/encoder/arm/armv5te \
$(srcdir)/vp8/encoder/arm/armv6 \
$(srcdir)/vp8/encoder/arm/neon \
$(srcdir)/vp8/encoder/generic \
$(srcdir)/vp8/encoder/x86 \
$(srcdir)/vpx_scale/arm \
$(srcdir)/vpx_scale/arm/neon \
$(NULL)
CSRCS += \
vp8_cx_iface.c \
bitstream.c \
dct.c \
encodeframe.c \
encodeintra.c \
encodemb.c \
encodemv.c \
ethreading.c \
firstpass.c \
lookahead.c \
mcomp.c \
modecosts.c \
mr_dissim.c \
onyx_if.c \
pickinter.c \
picklpf.c \
psnr.c \
quantize.c \
ratectrl.c \
rdopt.c \
segmentation.c \
temporal_filter.c \
tokenize.c \
treewriter.c \
csystemdependent.c \
$(NULL)
endif
ifdef VPX_X86_ASM
# Building on an x86 platform with a supported assembler, include
# the optimized assembly in the build.
CSRCS += \
filter_x86.c \
idct_blk_mmx.c \
idct_blk_sse2.c \
loopfilter_x86.c \
postproc_x86.c \
recon_wrapper_sse2.c \
variance_mmx.c \
variance_sse2.c \
variance_ssse3.c \
vp8_asm_stubs.c \
x86_systemdependent.c \
x86_dsystemdependent.c \
$(NULL)
ASFILES += \
dequantize_mmx.asm \
idctllm_mmx.asm \
idctllm_sse2.asm \
iwalsh_mmx.asm \
iwalsh_sse2.asm \
loopfilter_mmx.asm \
loopfilter_sse2.asm \
postproc_mmx.asm \
postproc_sse2.asm \
recon_mmx.asm \
recon_sse2.asm \
sad_mmx.asm \
sad_sse2.asm \
sad_sse3.asm \
sad_sse4.asm \
sad_ssse3.asm \
subpixel_mmx.asm \
subpixel_sse2.asm \
subpixel_ssse3.asm \
variance_impl_mmx.asm \
variance_impl_sse2.asm \
variance_impl_ssse3.asm \
emms.asm \
$(NULL)
ifeq (64,$(findstring 64,$(OS_TEST)))
ASFILES += loopfilter_block_sse2.asm
endif
ifdef MOZ_VP8_ENCODER
CSRCS += \
x86_csystemdependent.c \
$(NULL)
# Files which depend on asm_enc_offsets.asm
VPX_ASM_ENC_OFFSETS_SRCS = \
quantize_sse2.asm \
quantize_sse4.asm \
quantize_ssse3.asm \
$(NULL)
ASFILES += \
dct_mmx.asm \
dct_sse2.asm \
encodeopt.asm \
fwalsh_sse2.asm \
quantize_mmx.asm \
subtract_mmx.asm \
subtract_sse2.asm \
temporal_filter_apply_sse2.asm \
$(VPX_ASM_ENC_OFFSETS_SRCS) \
$(NULL)
endif
endif
ifdef VPX_ARM_ASM
# Building on an ARM platform with a supported assembler, include
# the optimized assembly in the build.
@ -191,135 +22,21 @@ CSRCS += cpu-features.c
endif
endif
CSRCS += \
arm_cpudetect.c \
arm_systemdependent.c \
bilinearfilter_arm.c \
dequantize_arm.c \
filter_arm.c \
loopfilter_arm.c \
reconintra_arm.c \
variance_arm.c \
idct_blk_v6.c \
idct_blk_neon.c \
arm_dsystemdependent.c \
arm_scalesystemdependent.c \
yv12extend_arm.c \
$(NULL)
# Files which depend on asm_com_offsets.asm
VPX_ASM_COM_OFFSETS_SRCS = \
vp8_vpxyv12_copy_y_neon.asm \
vp8_vpxyv12_copyframe_func_neon.asm \
vp8_vpxyv12_extendframeborders_neon.asm \
$(NULL)
VPX_ASFILES = \
bilinearfilter_v6.asm \
copymem16x16_v6.asm \
copymem8x4_v6.asm \
copymem8x8_v6.asm \
dc_only_idct_add_v6.asm \
dequant_idct_v6.asm \
dequantize_v6.asm \
filter_v6.asm \
idct_v6.asm \
intra4x4_predict_v6.asm \
iwalsh_v6.asm \
loopfilter_v6.asm \
simpleloopfilter_v6.asm \
sixtappredict8x4_v6.asm \
bilinearpredict16x16_neon.asm \
bilinearpredict4x4_neon.asm \
bilinearpredict8x4_neon.asm \
bilinearpredict8x8_neon.asm \
buildintrapredictorsmby_neon.asm \
copymem16x16_neon.asm \
copymem8x4_neon.asm \
copymem8x8_neon.asm \
dc_only_idct_add_neon.asm \
dequant_idct_neon.asm \
dequantizeb_neon.asm \
idct_dequant_0_2x_neon.asm \
idct_dequant_full_2x_neon.asm \
iwalsh_neon.asm \
loopfilter_neon.asm \
loopfiltersimplehorizontaledge_neon.asm \
loopfiltersimpleverticaledge_neon.asm \
mbloopfilter_neon.asm \
save_neon_reg.asm \
vp8_mse16x16_armv6.asm \
vp8_sad16x16_armv6.asm \
vp8_variance16x16_armv6.asm \
vp8_variance8x8_armv6.asm \
vp8_variance_halfpixvar16x16_h_armv6.asm \
vp8_variance_halfpixvar16x16_hv_armv6.asm \
vp8_variance_halfpixvar16x16_v_armv6.asm \
shortidct4x4llm_neon.asm \
sad16_neon.asm \
sad8_neon.asm \
sixtappredict16x16_neon.asm \
sixtappredict4x4_neon.asm \
sixtappredict8x4_neon.asm \
sixtappredict8x8_neon.asm \
variance_neon.asm \
vp8_mse16x16_neon.asm \
vp8_subpixelvariance8x8_neon.asm \
vp8_subpixelvariance16x16_neon.asm \
vp8_subpixelvariance16x16s_neon.asm \
$(VPX_ASM_COM_OFFSETS_SRCS) \
$(NULL)
ASM_OFFSETS = asm_com_offsets.asm
ifdef MOZ_VP8_ENCODER
CSRCS += \
arm_csystemdependent.c \
boolhuff_arm.c \
dct_arm.c \
picklpf_arm.c \
$(NULL)
# Files which depend on asm_enc_offsets.asm
VPX_ASM_ENC_OFFSETS_SRCS = \
boolhuff_armv5te.asm \
vp8_packtokens_armv5.asm \
vp8_packtokens_mbrow_armv5.asm \
vp8_packtokens_partitions_armv5.asm \
vp8_fast_quantize_b_armv6.asm \
vp8_subtract_armv6.asm \
fastquantizeb_neon.asm \
subtract_neon.asm \
$(NULL)
VPX_ASFILES += \
vp8_short_fdct4x4_armv6.asm \
walsh_v6.asm \
shortfdct_neon.asm \
vp8_memcpy_neon.asm \
vp8_shortwalsh4x4_neon.asm \
$(VPX_ASM_ENC_OFFSETS_SRCS) \
$(NULL)
ASM_OFFSETS += asm_enc_offsets.asm
endif
ifdef VPX_AS_CONVERSION
# The ARM asm is written in ARM RVCT syntax, but we actually build it with
# gas using GNU syntax. Add some rules to perform the conversion.
VPX_CONVERTED_ASFILES = $(addsuffix .$(ASM_SUFFIX), $(VPX_ASFILES))
ASFILES += $(VPX_CONVERTED_ASFILES)
GARBAGE += $(VPX_CONVERTED_ASFILES)
GENERATED_DIRS += $(dir $(ASFILES))
%.asm.$(ASM_SUFFIX): %.asm
%.asm.$(ASM_SUFFIX): %.asm $(ASM_OFFSETS)
$(VPX_AS_CONVERSION) < $< > $@
else
ASFILES += $(VPX_ASFILES)
endif
else
ifdef MOZ_VP8_ENCODER
# boolhuff_armv5te.asm defines the same functions as boolhuff.c instead of
# using RTCD, so we have to make sure we only add one of the two.
CSRCS += boolhuff.c
endif
endif
@ -336,12 +53,9 @@ else
VPX_OIE_FORMAT := gas
endif
CSRCS += asm_com_offsets.c
GARBAGE += asm_com_offsets.$(OBJ_SUFFIX) asm_com_offsets.asm
ifdef MOZ_VP8_ENCODER
CSRCS += asm_enc_offsets.c
GARBAGE += asm_enc_offsets.$(OBJ_SUFFIX) asm_enc_offsets.asm
endif
@ -358,7 +72,7 @@ OFFSET_PATTERN := '^[a-zA-Z0-9_]* EQU'
# This rule, as well as the rule for asm_enc_offsets.s further below are here
# because the generic rule in rules.mk was made to not be implicit, and we
# can't put the C files in CSRCS.
asm_com_offsets.s: asm_com_offsets.c
asm_com_offsets.s: $(srcdir)/vp8/common/asm_com_offsets.c
$(REPORT_BUILD)
$(CC) -S $(COMPILE_CFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
@ -372,7 +86,7 @@ ifdef MOZ_VP8_ENCODER
asm_enc_offsets.s: CFLAGS += -DINLINE_ASM
asm_enc_offsets.s: asm_enc_offsets.c
asm_enc_offsets.s: $(srcdir)/vp8/encoder/asm_enc_offsets.c
$(REPORT_BUILD)
$(CC) -S $(COMPILE_CFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
@ -382,6 +96,7 @@ asm_enc_offsets.asm: asm_enc_offsets.s
GARBAGE += asm_enc_offsets.s asm_enc_offsets.asm
endif
endif
@ -392,6 +107,15 @@ include $(topsrcdir)/config/rules.mk
# This must be after rules.mk in order to use $(OBJ_SUFFIX) outside a
# recursively-expanded variable.
ifndef _MSC_VER
%_sse2.$(OBJ_SUFFIX): CFLAGS += -msse2
endif
quantize_sse2.$(OBJ_SUFFIX): asm_enc_offsets.asm
quantize_sse4.$(OBJ_SUFFIX): asm_enc_offsets.asm
quantize_ssse3.$(OBJ_SUFFIX): asm_enc_offsets.asm
ifdef VPX_NEED_OBJ_INT_EXTRACT
# only for MSVC
@ -424,19 +148,6 @@ OBJS := $(filter-out asm_enc_offsets.$(OBJ_SUFFIX),$(OBJS))
endif
endif
# These dependencies are not generated automatically, so do it manually.
ifdef VPX_AS_CONVERSION
$(addsuffix .$(OBJ_SUFFIX), $(VPX_ASM_COM_OFFSETS_SRCS)): asm_com_offsets.asm
ifdef MOZ_VP8_ENCODER
$(addsuffix .$(OBJ_SUFFIX), $(VPX_ASM_ENC_OFFSETS_SRCS)): asm_enc_offsets.asm
endif
else
$(patsubst %.$(ASM_SUFFIX),%.$(OBJ_SUFFIX), $(VPX_ASM_COM_OFFSETS_SRCS)): asm_com_offsets.asm
ifdef MOZ_VP8_ENCODER
$(patsubst %.$(ASM_SUFFIX),%.$(OBJ_SUFFIX), $(VPX_ASM_ENC_OFFSETS_SRCS)): asm_enc_offsets.asm
endif
endif
# Workaround a bug of Sun Studio (CR 6963410)
ifdef SOLARIS_SUNPRO_CC
ifeq (86,$(findstring 86,$(OS_TEST)))

Просмотреть файл

@ -1,2 +1,2 @@
Using the v0.9.5 release pulled from
http://webm.googlecode.com/files/libvpx-v0.9.5.zip
Using the v1.2.0 release pulled from
http://webm.googlecode.com/files/libvpx-v1.2.0.zip

Просмотреть файл

@ -1,317 +0,0 @@
diff --git a/media/libvpx/vp8/common/arm/arm_systemdependent.c b/media/libvpx/vp8/common/arm/arm_systemdependent.c
--- a/media/libvpx/vp8/common/arm/arm_systemdependent.c
+++ b/media/libvpx/vp8/common/arm/arm_systemdependent.c
@@ -14,24 +14,16 @@
#include "g_common.h"
#include "pragmas.h"
#include "subpixel.h"
#include "loopfilter.h"
#include "recon.h"
#include "idct.h"
#include "onyxc_int.h"
-extern void (*vp8_build_intra_predictors_mby_ptr)(MACROBLOCKD *x);
-extern void vp8_build_intra_predictors_mby(MACROBLOCKD *x);
-extern void vp8_build_intra_predictors_mby_neon(MACROBLOCKD *x);
-
-extern void (*vp8_build_intra_predictors_mby_s_ptr)(MACROBLOCKD *x);
-extern void vp8_build_intra_predictors_mby_s(MACROBLOCKD *x);
-extern void vp8_build_intra_predictors_mby_s_neon(MACROBLOCKD *x);
-
void vp8_arch_arm_common_init(VP8_COMMON *ctx)
{
#if CONFIG_RUNTIME_CPU_DETECT
VP8_COMMON_RTCD *rtcd = &ctx->rtcd;
int flags = arm_cpu_caps();
int has_edsp = flags & HAS_EDSP;
int has_media = flags & HAS_MEDIA;
int has_neon = flags & HAS_NEON;
@@ -101,36 +93,17 @@ void vp8_arch_arm_common_init(VP8_COMMON
rtcd->recon.copy16x16 = vp8_copy_mem16x16_neon;
rtcd->recon.copy8x8 = vp8_copy_mem8x8_neon;
rtcd->recon.copy8x4 = vp8_copy_mem8x4_neon;
rtcd->recon.recon = vp8_recon_b_neon;
rtcd->recon.recon2 = vp8_recon2b_neon;
rtcd->recon.recon4 = vp8_recon4b_neon;
rtcd->recon.recon_mb = vp8_recon_mb_neon;
-
+ rtcd->recon.build_intra_predictors_mby =
+ vp8_build_intra_predictors_mby_neon;
+ rtcd->recon.build_intra_predictors_mby_s =
+ vp8_build_intra_predictors_mby_s_neon;
}
#endif
#endif
-
-#if HAVE_ARMV6
-#if CONFIG_RUNTIME_CPU_DETECT
- if (has_media)
-#endif
- {
- vp8_build_intra_predictors_mby_ptr = vp8_build_intra_predictors_mby;
- vp8_build_intra_predictors_mby_s_ptr = vp8_build_intra_predictors_mby_s;
- }
-#endif
-
-#if HAVE_ARMV7
-#if CONFIG_RUNTIME_CPU_DETECT
- if (has_neon)
-#endif
- {
- vp8_build_intra_predictors_mby_ptr =
- vp8_build_intra_predictors_mby_neon;
- vp8_build_intra_predictors_mby_s_ptr =
- vp8_build_intra_predictors_mby_s_neon;
- }
-#endif
}
diff --git a/media/libvpx/vp8/common/arm/recon_arm.h b/media/libvpx/vp8/common/arm/recon_arm.h
--- a/media/libvpx/vp8/common/arm/recon_arm.h
+++ b/media/libvpx/vp8/common/arm/recon_arm.h
@@ -48,16 +48,19 @@ extern prototype_recon_block(vp8_recon2b
extern prototype_recon_block(vp8_recon4b_neon);
extern prototype_copy_block(vp8_copy_mem8x8_neon);
extern prototype_copy_block(vp8_copy_mem8x4_neon);
extern prototype_copy_block(vp8_copy_mem16x16_neon);
extern prototype_recon_macroblock(vp8_recon_mb_neon);
+extern prototype_build_intra_predictors(vp8_build_intra_predictors_mby_neon);
+extern prototype_build_intra_predictors(vp8_build_intra_predictors_mby_s_neon);
+
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_recon_recon
#define vp8_recon_recon vp8_recon_b_neon
#undef vp8_recon_recon2
#define vp8_recon_recon2 vp8_recon2b_neon
#undef vp8_recon_recon4
@@ -69,12 +72,19 @@ extern prototype_recon_macroblock(vp8_re
#undef vp8_recon_copy8x4
#define vp8_recon_copy8x4 vp8_copy_mem8x4_neon
#undef vp8_recon_copy16x16
#define vp8_recon_copy16x16 vp8_copy_mem16x16_neon
#undef vp8_recon_recon_mb
#define vp8_recon_recon_mb vp8_recon_mb_neon
+
+#undef vp8_recon_build_intra_predictors_mby
+#define vp8_recon_build_intra_predictors_mby vp8_build_intra_predictors_mby_neon
+
+#undef vp8_recon_build_intra_predictors_mby_s
+#define vp8_recon_build_intra_predictors_mby_s vp8_build_intra_predictors_mby_s_neon
+
#endif
#endif
#endif
diff --git a/media/libvpx/vp8/common/generic/systemdependent.c b/media/libvpx/vp8/common/generic/systemdependent.c
--- a/media/libvpx/vp8/common/generic/systemdependent.c
+++ b/media/libvpx/vp8/common/generic/systemdependent.c
@@ -15,22 +15,16 @@
#include "loopfilter.h"
#include "recon.h"
#include "idct.h"
#include "onyxc_int.h"
extern void vp8_arch_x86_common_init(VP8_COMMON *ctx);
extern void vp8_arch_arm_common_init(VP8_COMMON *ctx);
-void (*vp8_build_intra_predictors_mby_ptr)(MACROBLOCKD *x);
-extern void vp8_build_intra_predictors_mby(MACROBLOCKD *x);
-
-void (*vp8_build_intra_predictors_mby_s_ptr)(MACROBLOCKD *x);
-extern void vp8_build_intra_predictors_mby_s(MACROBLOCKD *x);
-
void vp8_machine_specific_config(VP8_COMMON *ctx)
{
#if CONFIG_RUNTIME_CPU_DETECT
VP8_COMMON_RTCD *rtcd = &ctx->rtcd;
rtcd->idct.idct1 = vp8_short_idct4x4llm_1_c;
rtcd->idct.idct16 = vp8_short_idct4x4llm_c;
rtcd->idct.idct1_scalar_add = vp8_dc_only_idct_add_c;
@@ -40,16 +34,20 @@ void vp8_machine_specific_config(VP8_COM
rtcd->recon.copy16x16 = vp8_copy_mem16x16_c;
rtcd->recon.copy8x8 = vp8_copy_mem8x8_c;
rtcd->recon.copy8x4 = vp8_copy_mem8x4_c;
rtcd->recon.recon = vp8_recon_b_c;
rtcd->recon.recon2 = vp8_recon2b_c;
rtcd->recon.recon4 = vp8_recon4b_c;
rtcd->recon.recon_mb = vp8_recon_mb_c;
rtcd->recon.recon_mby = vp8_recon_mby_c;
+ rtcd->recon.build_intra_predictors_mby =
+ vp8_build_intra_predictors_mby;
+ rtcd->recon.build_intra_predictors_mby_s =
+ vp8_build_intra_predictors_mby_s;
rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_c;
rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_c;
rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_c;
rtcd->subpix.sixtap4x4 = vp8_sixtap_predict_c;
rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_c;
rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_c;
rtcd->subpix.bilinear8x4 = vp8_bilinear_predict8x4_c;
@@ -68,19 +66,16 @@ void vp8_machine_specific_config(VP8_COM
rtcd->postproc.down = vp8_mbpost_proc_down_c;
rtcd->postproc.across = vp8_mbpost_proc_across_ip_c;
rtcd->postproc.downacross = vp8_post_proc_down_and_across_c;
rtcd->postproc.addnoise = vp8_plane_add_noise_c;
rtcd->postproc.blend_mb = vp8_blend_mb_c;
#endif
#endif
- /* Pure C: */
- vp8_build_intra_predictors_mby_ptr = vp8_build_intra_predictors_mby;
- vp8_build_intra_predictors_mby_s_ptr = vp8_build_intra_predictors_mby_s;
#if ARCH_X86 || ARCH_X86_64
vp8_arch_x86_common_init(ctx);
#endif
#if ARCH_ARM
vp8_arch_arm_common_init(ctx);
#endif
diff --git a/media/libvpx/vp8/common/recon.h b/media/libvpx/vp8/common/recon.h
--- a/media/libvpx/vp8/common/recon.h
+++ b/media/libvpx/vp8/common/recon.h
@@ -18,16 +18,19 @@
void sym(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch)
#define prototype_recon_block(sym) \
void sym(unsigned char *pred, short *diff, unsigned char *dst, int pitch)
#define prototype_recon_macroblock(sym) \
void sym(const struct vp8_recon_rtcd_vtable *rtcd, MACROBLOCKD *x)
+#define prototype_build_intra_predictors(sym) \
+ void sym(MACROBLOCKD *x)
+
struct vp8_recon_rtcd_vtable;
#if ARCH_X86 || ARCH_X86_64
#include "x86/recon_x86.h"
#endif
#if ARCH_ARM
#include "arm/recon_arm.h"
@@ -68,29 +71,45 @@ extern prototype_recon_block(vp8_recon_r
#endif
extern prototype_recon_macroblock(vp8_recon_recon_mb);
#ifndef vp8_recon_recon_mby
#define vp8_recon_recon_mby vp8_recon_mby_c
#endif
extern prototype_recon_macroblock(vp8_recon_recon_mby);
+#ifndef vp8_recon_build_intra_predictors_mby
+#define vp8_recon_build_intra_predictors_mby vp8_build_intra_predictors_mby
+#endif
+extern prototype_build_intra_predictors\
+ (vp8_recon_build_intra_predictors_mby);
+
+#ifndef vp8_recon_build_intra_predictors_mby_s
+#define vp8_recon_build_intra_predictors_mby_s vp8_build_intra_predictors_mby_s
+#endif
+extern prototype_build_intra_predictors\
+ (vp8_recon_build_intra_predictors_mby_s);
+
+
typedef prototype_copy_block((*vp8_copy_block_fn_t));
typedef prototype_recon_block((*vp8_recon_fn_t));
typedef prototype_recon_macroblock((*vp8_recon_mb_fn_t));
+typedef prototype_build_intra_predictors((*vp8_build_intra_pred_fn_t));
typedef struct vp8_recon_rtcd_vtable
{
vp8_copy_block_fn_t copy16x16;
vp8_copy_block_fn_t copy8x8;
vp8_copy_block_fn_t copy8x4;
vp8_recon_fn_t recon;
vp8_recon_fn_t recon2;
vp8_recon_fn_t recon4;
vp8_recon_mb_fn_t recon_mb;
vp8_recon_mb_fn_t recon_mby;
+ vp8_build_intra_pred_fn_t build_intra_predictors_mby_s;
+ vp8_build_intra_pred_fn_t build_intra_predictors_mby;
} vp8_recon_rtcd_vtable_t;
#if CONFIG_RUNTIME_CPU_DETECT
#define RECON_INVOKE(ctx,fn) (ctx)->fn
#else
#define RECON_INVOKE(ctx,fn) vp8_recon_##fn
#endif
diff --git a/media/libvpx/vp8/common/reconintra.h b/media/libvpx/vp8/common/reconintra.h
--- a/media/libvpx/vp8/common/reconintra.h
+++ b/media/libvpx/vp8/common/reconintra.h
@@ -9,21 +9,14 @@
*/
#ifndef __INC_RECONINTRA_H
#define __INC_RECONINTRA_H
extern void init_intra_left_above_pixels(MACROBLOCKD *x);
-extern void (*vp8_build_intra_predictors_mby_ptr)(MACROBLOCKD *x);
-extern void vp8_build_intra_predictors_mby(MACROBLOCKD *x);
-extern void vp8_build_intra_predictors_mby_neon(MACROBLOCKD *x);
-extern void (*vp8_build_intra_predictors_mby_s_ptr)(MACROBLOCKD *x);
-extern void vp8_build_intra_predictors_mby_s(MACROBLOCKD *x);
-extern void vp8_build_intra_predictors_mby_s_neon(MACROBLOCKD *x);
-
extern void vp8_build_intra_predictors_mbuv(MACROBLOCKD *x);
extern void vp8_build_intra_predictors_mbuv_s(MACROBLOCKD *x);
extern void vp8_predict_intra4x4(BLOCKD *x, int b_mode, unsigned char *Predictor);
#endif
diff --git a/media/libvpx/vp8/decoder/decodframe.c b/media/libvpx/vp8/decoder/decodframe.c
--- a/media/libvpx/vp8/decoder/decodframe.c
+++ b/media/libvpx/vp8/decoder/decodframe.c
@@ -111,18 +111,18 @@ void mb_init_dequantizer(VP8D_COMP *pbi,
* to dst buffer, we can write the result directly to dst buffer. This eliminates unnecessary copy.
*/
static void skip_recon_mb(VP8D_COMP *pbi, MACROBLOCKD *xd)
{
if (xd->frame_type == KEY_FRAME || xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME)
{
vp8_build_intra_predictors_mbuv_s(xd);
- vp8_build_intra_predictors_mby_s_ptr(xd);
-
+ RECON_INVOKE(&pbi->common.rtcd.recon,
+ build_intra_predictors_mby_s)(xd);
}
else
{
vp8_build_inter_predictors_mb_s(xd);
}
}
static void clamp_mv_to_umv_border(MV *mv, const MACROBLOCKD *xd)
@@ -210,17 +210,18 @@ void vp8_decode_macroblock(VP8D_COMP *pb
/* do prediction */
if (xd->frame_type == KEY_FRAME || xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME)
{
vp8_build_intra_predictors_mbuv(xd);
if (xd->mode_info_context->mbmi.mode != B_PRED)
{
- vp8_build_intra_predictors_mby_ptr(xd);
+ RECON_INVOKE(&pbi->common.rtcd.recon,
+ build_intra_predictors_mby)(xd);
} else {
vp8_intra_prediction_down_copy(xd);
}
}
else
{
vp8_build_inter_predictors_mb(xd);
}

Просмотреть файл

@ -1,683 +0,0 @@
diff --git a/media/libvpx/vp8/common/arm/armv6/sixtappredict8x4_v6.asm b/media/libvpx/vp8/common/arm/armv6/sixtappredict8x4_v6.asm
--- a/media/libvpx/vp8/common/arm/armv6/sixtappredict8x4_v6.asm
+++ b/media/libvpx/vp8/common/arm/armv6/sixtappredict8x4_v6.asm
@@ -27,17 +27,17 @@
stmdb sp!, {r4 - r11, lr}
str r3, [sp, #-184]! ;reserve space on stack for temporary storage, store yoffset
cmp r2, #0 ;skip first_pass filter if xoffset=0
add lr, sp, #4 ;point to temporary buffer
beq skip_firstpass_filter
;first-pass filter
- ldr r12, _filter8_coeff_
+ adr r12, filter8_coeff
sub r0, r0, r1, lsl #1
add r2, r12, r2, lsl #4 ;calculate filter location
add r0, r0, #3 ;adjust src only for loading convinience
ldr r3, [r2] ; load up packed filter coefficients
ldr r4, [r2, #4]
ldr r5, [r2, #8]
@@ -116,17 +116,17 @@
secondpass_filter
ldr r3, [sp], #4 ; load back yoffset
ldr r0, [sp, #216] ; load dst address from stack 180+36
ldr r1, [sp, #220] ; load dst stride from stack 180+40
cmp r3, #0
beq skip_secondpass_filter
- ldr r12, _filter8_coeff_
+ adr r12, filter8_coeff
add lr, r12, r3, lsl #4 ;calculate filter location
mov r2, #0x00080000
ldr r3, [lr] ; load up packed filter coefficients
ldr r4, [lr, #4]
ldr r5, [lr, #8]
@@ -242,18 +242,16 @@ skip_secondpass_hloop
ENDP
;-----------------
AREA subpelfilters8_dat, DATA, READWRITE ;read/write by default
;Data section with name data_area is specified. DCD reserves space in memory for 48 data.
;One word each is reserved. Label filter_coeff can be used to access the data.
;Data address: filter_coeff, filter_coeff+4, filter_coeff+8 ...
-_filter8_coeff_
- DCD filter8_coeff
filter8_coeff
DCD 0x00000000, 0x00000080, 0x00000000, 0x00000000
DCD 0xfffa0000, 0x000c007b, 0x0000ffff, 0x00000000
DCD 0xfff50002, 0x0024006c, 0x0001fff8, 0x00000000
DCD 0xfff70000, 0x0032005d, 0x0000fffa, 0x00000000
DCD 0xfff00003, 0x004d004d, 0x0003fff0, 0x00000000
DCD 0xfffa0000, 0x005d0032, 0x0000fff7, 0x00000000
DCD 0xfff80001, 0x006c0024, 0x0002fff5, 0x00000000
diff --git a/media/libvpx/vp8/common/arm/neon/bilinearpredict16x16_neon.asm b/media/libvpx/vp8/common/arm/neon/bilinearpredict16x16_neon.asm
--- a/media/libvpx/vp8/common/arm/neon/bilinearpredict16x16_neon.asm
+++ b/media/libvpx/vp8/common/arm/neon/bilinearpredict16x16_neon.asm
@@ -20,17 +20,17 @@
; r2 int xoffset,
; r3 int yoffset,
; r4 unsigned char *dst_ptr,
; stack(r5) int dst_pitch
|vp8_bilinear_predict16x16_neon| PROC
push {r4-r5, lr}
- ldr r12, _bifilter16_coeff_
+ adr r12, bifilter16_coeff
ldr r4, [sp, #12] ;load parameters from stack
ldr r5, [sp, #16] ;load parameters from stack
cmp r2, #0 ;skip first_pass filter if xoffset=0
beq secondpass_bfilter16x16_only
add r2, r12, r2, lsl #3 ;calculate filter location
@@ -349,14 +349,12 @@ filt_blk2d_spo16x16_loop_neon
ENDP
;-----------------
AREA bifilters16_dat, DATA, READWRITE ;read/write by default
;Data section with name data_area is specified. DCD reserves space in memory for 48 data.
;One word each is reserved. Label filter_coeff can be used to access the data.
;Data address: filter_coeff, filter_coeff+4, filter_coeff+8 ...
-_bifilter16_coeff_
- DCD bifilter16_coeff
bifilter16_coeff
DCD 128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
END
diff --git a/media/libvpx/vp8/common/arm/neon/bilinearpredict4x4_neon.asm b/media/libvpx/vp8/common/arm/neon/bilinearpredict4x4_neon.asm
--- a/media/libvpx/vp8/common/arm/neon/bilinearpredict4x4_neon.asm
+++ b/media/libvpx/vp8/common/arm/neon/bilinearpredict4x4_neon.asm
@@ -20,17 +20,17 @@
; r2 int xoffset,
; r3 int yoffset,
; r4 unsigned char *dst_ptr,
; stack(lr) int dst_pitch
|vp8_bilinear_predict4x4_neon| PROC
push {r4, lr}
- ldr r12, _bifilter4_coeff_
+ adr r12, bifilter4_coeff
ldr r4, [sp, #8] ;load parameters from stack
ldr lr, [sp, #12] ;load parameters from stack
cmp r2, #0 ;skip first_pass filter if xoffset=0
beq skip_firstpass_filter
;First pass: output_height lines x output_width columns (5x4)
vld1.u8 {d2}, [r0], r1 ;load src data
@@ -122,14 +122,12 @@ skip_secondpass_filter
ENDP
;-----------------
AREA bilinearfilters4_dat, DATA, READWRITE ;read/write by default
;Data section with name data_area is specified. DCD reserves space in memory for 48 data.
;One word each is reserved. Label filter_coeff can be used to access the data.
;Data address: filter_coeff, filter_coeff+4, filter_coeff+8 ...
-_bifilter4_coeff_
- DCD bifilter4_coeff
bifilter4_coeff
DCD 128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
END
diff --git a/media/libvpx/vp8/common/arm/neon/bilinearpredict8x4_neon.asm b/media/libvpx/vp8/common/arm/neon/bilinearpredict8x4_neon.asm
--- a/media/libvpx/vp8/common/arm/neon/bilinearpredict8x4_neon.asm
+++ b/media/libvpx/vp8/common/arm/neon/bilinearpredict8x4_neon.asm
@@ -20,17 +20,17 @@
; r2 int xoffset,
; r3 int yoffset,
; r4 unsigned char *dst_ptr,
; stack(lr) int dst_pitch
|vp8_bilinear_predict8x4_neon| PROC
push {r4, lr}
- ldr r12, _bifilter8x4_coeff_
+ adr r12, bifilter8x4_coeff
ldr r4, [sp, #8] ;load parameters from stack
ldr lr, [sp, #12] ;load parameters from stack
cmp r2, #0 ;skip first_pass filter if xoffset=0
beq skip_firstpass_filter
;First pass: output_height lines x output_width columns (5x8)
add r2, r12, r2, lsl #3 ;calculate filter location
@@ -127,14 +127,12 @@ skip_secondpass_filter
ENDP
;-----------------
AREA bifilters8x4_dat, DATA, READWRITE ;read/write by default
;Data section with name data_area is specified. DCD reserves space in memory for 48 data.
;One word each is reserved. Label filter_coeff can be used to access the data.
;Data address: filter_coeff, filter_coeff+4, filter_coeff+8 ...
-_bifilter8x4_coeff_
- DCD bifilter8x4_coeff
bifilter8x4_coeff
DCD 128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
END
diff --git a/media/libvpx/vp8/common/arm/neon/bilinearpredict8x8_neon.asm b/media/libvpx/vp8/common/arm/neon/bilinearpredict8x8_neon.asm
--- a/media/libvpx/vp8/common/arm/neon/bilinearpredict8x8_neon.asm
+++ b/media/libvpx/vp8/common/arm/neon/bilinearpredict8x8_neon.asm
@@ -20,17 +20,17 @@
; r2 int xoffset,
; r3 int yoffset,
; r4 unsigned char *dst_ptr,
; stack(lr) int dst_pitch
|vp8_bilinear_predict8x8_neon| PROC
push {r4, lr}
- ldr r12, _bifilter8_coeff_
+ adr r12, bifilter8_coeff
ldr r4, [sp, #8] ;load parameters from stack
ldr lr, [sp, #12] ;load parameters from stack
cmp r2, #0 ;skip first_pass filter if xoffset=0
beq skip_firstpass_filter
;First pass: output_height lines x output_width columns (9x8)
add r2, r12, r2, lsl #3 ;calculate filter location
@@ -175,14 +175,12 @@ skip_secondpass_filter
ENDP
;-----------------
AREA bifilters8_dat, DATA, READWRITE ;read/write by default
;Data section with name data_area is specified. DCD reserves space in memory for 48 data.
;One word each is reserved. Label filter_coeff can be used to access the data.
;Data address: filter_coeff, filter_coeff+4, filter_coeff+8 ...
-_bifilter8_coeff_
- DCD bifilter8_coeff
bifilter8_coeff
DCD 128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
END
diff --git a/media/libvpx/vp8/common/arm/neon/loopfilter_neon.asm b/media/libvpx/vp8/common/arm/neon/loopfilter_neon.asm
--- a/media/libvpx/vp8/common/arm/neon/loopfilter_neon.asm
+++ b/media/libvpx/vp8/common/arm/neon/loopfilter_neon.asm
@@ -303,17 +303,17 @@
; q4 p2
; q5 p1
; q6 p0
; q7 q0
; q8 q1
; q9 q2
; q10 q3
|vp8_loop_filter_neon| PROC
- ldr r12, _lf_coeff_
+ adr r12, lf_coeff
; vp8_filter_mask
vabd.u8 q11, q3, q4 ; abs(p3 - p2)
vabd.u8 q12, q4, q5 ; abs(p2 - p1)
vabd.u8 q13, q5, q6 ; abs(p1 - p0)
vabd.u8 q14, q8, q7 ; abs(q1 - q0)
vabd.u8 q3, q9, q8 ; abs(q2 - q1)
vabd.u8 q4, q10, q9 ; abs(q3 - q2)
@@ -393,17 +393,15 @@
veor q6, q11, q0 ; *op0 = u^0x80
veor q7, q10, q0 ; *oq0 = u^0x80
veor q8, q12, q0 ; *oq1 = u^0x80
bx lr
ENDP ; |vp8_loop_filter_horizontal_edge_y_neon|
AREA loopfilter_dat, DATA, READONLY
-_lf_coeff_
- DCD lf_coeff
lf_coeff
DCD 0x80808080, 0x80808080, 0x80808080, 0x80808080
DCD 0x03030303, 0x03030303, 0x03030303, 0x03030303
DCD 0x04040404, 0x04040404, 0x04040404, 0x04040404
DCD 0x01010101, 0x01010101, 0x01010101, 0x01010101
END
diff --git a/media/libvpx/vp8/common/arm/neon/loopfiltersimplehorizontaledge_neon.asm b/media/libvpx/vp8/common/arm/neon/loopfiltersimplehorizontaledge_neon.asm
--- a/media/libvpx/vp8/common/arm/neon/loopfiltersimplehorizontaledge_neon.asm
+++ b/media/libvpx/vp8/common/arm/neon/loopfiltersimplehorizontaledge_neon.asm
@@ -23,17 +23,17 @@
; r2 const signed char *flimit,
; r3 const signed char *limit,
; stack(r4) const signed char *thresh,
; //stack(r5) int count --unused
|vp8_loop_filter_simple_horizontal_edge_neon| PROC
sub r0, r0, r1, lsl #1 ; move src pointer down by 2 lines
- ldr r12, _lfhy_coeff_
+ adr r12, lfhy_coeff
vld1.u8 {q5}, [r0], r1 ; p1
vld1.s8 {d2[], d3[]}, [r2] ; flimit
vld1.s8 {d26[], d27[]}, [r3] ; limit -> q13
vld1.u8 {q6}, [r0], r1 ; p0
vld1.u8 {q0}, [r12]! ; 0x80
vld1.u8 {q7}, [r0], r1 ; q0
vld1.u8 {q10}, [r12]! ; 0x03
vld1.u8 {q8}, [r0] ; q1
@@ -103,16 +103,14 @@
bx lr
ENDP ; |vp8_loop_filter_simple_horizontal_edge_neon|
;-----------------
AREA hloopfiltery_dat, DATA, READWRITE ;read/write by default
;Data section with name data_area is specified. DCD reserves space in memory for 16 data.
;One word each is reserved. Label filter_coeff can be used to access the data.
;Data address: filter_coeff, filter_coeff+4, filter_coeff+8 ...
-_lfhy_coeff_
- DCD lfhy_coeff
lfhy_coeff
DCD 0x80808080, 0x80808080, 0x80808080, 0x80808080
DCD 0x03030303, 0x03030303, 0x03030303, 0x03030303
DCD 0x04040404, 0x04040404, 0x04040404, 0x04040404
END
diff --git a/media/libvpx/vp8/common/arm/neon/loopfiltersimpleverticaledge_neon.asm b/media/libvpx/vp8/common/arm/neon/loopfiltersimpleverticaledge_neon.asm
--- a/media/libvpx/vp8/common/arm/neon/loopfiltersimpleverticaledge_neon.asm
+++ b/media/libvpx/vp8/common/arm/neon/loopfiltersimpleverticaledge_neon.asm
@@ -27,17 +27,17 @@
|vp8_loop_filter_simple_vertical_edge_neon| PROC
sub r0, r0, #2 ; move src pointer down by 2 columns
vld4.8 {d6[0], d7[0], d8[0], d9[0]}, [r0], r1
vld1.s8 {d2[], d3[]}, [r2] ; flimit
vld1.s8 {d26[], d27[]}, [r3] ; limit -> q13
vld4.8 {d6[1], d7[1], d8[1], d9[1]}, [r0], r1
- ldr r12, _vlfy_coeff_
+ adr r12, vlfy_coeff
vld4.8 {d6[2], d7[2], d8[2], d9[2]}, [r0], r1
vld4.8 {d6[3], d7[3], d8[3], d9[3]}, [r0], r1
vld4.8 {d6[4], d7[4], d8[4], d9[4]}, [r0], r1
vld4.8 {d6[5], d7[5], d8[5], d9[5]}, [r0], r1
vld4.8 {d6[6], d7[6], d8[6], d9[6]}, [r0], r1
vld4.8 {d6[7], d7[7], d8[7], d9[7]}, [r0], r1
vld4.8 {d10[0], d11[0], d12[0], d13[0]}, [r0], r1
@@ -144,16 +144,14 @@
bx lr
ENDP ; |vp8_loop_filter_simple_vertical_edge_neon|
;-----------------
AREA vloopfiltery_dat, DATA, READWRITE ;read/write by default
;Data section with name data_area is specified. DCD reserves space in memory for 16 data.
;One word each is reserved. Label filter_coeff can be used to access the data.
;Data address: filter_coeff, filter_coeff+4, filter_coeff+8 ...
-_vlfy_coeff_
- DCD vlfy_coeff
vlfy_coeff
DCD 0x80808080, 0x80808080, 0x80808080, 0x80808080
DCD 0x03030303, 0x03030303, 0x03030303, 0x03030303
DCD 0x04040404, 0x04040404, 0x04040404, 0x04040404
END
diff --git a/media/libvpx/vp8/common/arm/neon/mbloopfilter_neon.asm b/media/libvpx/vp8/common/arm/neon/mbloopfilter_neon.asm
--- a/media/libvpx/vp8/common/arm/neon/mbloopfilter_neon.asm
+++ b/media/libvpx/vp8/common/arm/neon/mbloopfilter_neon.asm
@@ -367,17 +367,17 @@
; q5 p1
; q6 p0
; q7 q0
; q8 q1
; q9 q2
; q10 q3
|vp8_mbloop_filter_neon| PROC
- ldr r12, _mblf_coeff_
+ adr r12, mblf_coeff
; vp8_filter_mask
vabd.u8 q11, q3, q4 ; abs(p3 - p2)
vabd.u8 q12, q4, q5 ; abs(p2 - p1)
vabd.u8 q13, q5, q6 ; abs(p1 - p0)
vabd.u8 q14, q8, q7 ; abs(q1 - q0)
vabd.u8 q3, q9, q8 ; abs(q2 - q1)
vabd.u8 q0, q10, q9 ; abs(q3 - q2)
@@ -501,18 +501,16 @@
veor q5, q12, q0 ; *op2 = s^0x80
veor q7, q15, q0 ; *oq0 = s^0x80
veor q6, q14, q0 ; *op0 = s^0x80
bx lr
ENDP ; |vp8_mbloop_filter_neon|
AREA mbloopfilter_dat, DATA, READONLY
-_mblf_coeff_
- DCD mblf_coeff
mblf_coeff
DCD 0x80808080, 0x80808080, 0x80808080, 0x80808080
DCD 0x03030303, 0x03030303, 0x03030303, 0x03030303
DCD 0x04040404, 0x04040404, 0x04040404, 0x04040404
DCD 0x003f003f, 0x003f003f, 0x003f003f, 0x003f003f
DCD 0x09090909, 0x09090909, 0x12121212, 0x12121212
DCD 0x1b1b1b1b, 0x1b1b1b1b
diff --git a/media/libvpx/vp8/common/arm/neon/shortidct4x4llm_neon.asm b/media/libvpx/vp8/common/arm/neon/shortidct4x4llm_neon.asm
--- a/media/libvpx/vp8/common/arm/neon/shortidct4x4llm_neon.asm
+++ b/media/libvpx/vp8/common/arm/neon/shortidct4x4llm_neon.asm
@@ -26,17 +26,17 @@
;static const int sinpi8sqrt2 =35468;
;static const int rounding = 0;
;Optimization note: The resulted data from dequantization are signed 13-bit data that is
;in the range of [-4096, 4095]. This allows to use "vqdmulh"(neon) instruction since
;it won't go out of range (13+16+1=30bits<32bits). This instruction gives the high half
;result of the multiplication that is needed in IDCT.
|vp8_short_idct4x4llm_neon| PROC
- ldr r12, _idct_coeff_
+ adr r12, idct_coeff
vld1.16 {q1, q2}, [r0]
vld1.16 {d0}, [r12]
vswp d3, d4 ;q2(vp[4] vp[12])
vqdmulh.s16 q3, q2, d0[2]
vqdmulh.s16 q4, q2, d0[0]
@@ -112,16 +112,14 @@
ENDP
;-----------------
AREA idct4x4_dat, DATA, READWRITE ;read/write by default
;Data section with name data_area is specified. DCD reserves space in memory for 48 data.
;One word each is reserved. Label filter_coeff can be used to access the data.
;Data address: filter_coeff, filter_coeff+4, filter_coeff+8 ...
-_idct_coeff_
- DCD idct_coeff
idct_coeff
DCD 0x4e7b4e7b, 0x8a8c8a8c
;20091, 20091, 35468, 35468
END
diff --git a/media/libvpx/vp8/common/arm/neon/sixtappredict16x16_neon.asm b/media/libvpx/vp8/common/arm/neon/sixtappredict16x16_neon.asm
--- a/media/libvpx/vp8/common/arm/neon/sixtappredict16x16_neon.asm
+++ b/media/libvpx/vp8/common/arm/neon/sixtappredict16x16_neon.asm
@@ -28,17 +28,17 @@
; that the result can be a large positive number (> 2^15-1), which could be confused as a
; negtive number. To avoid that error, apply filter coeffs in the order of 0, 1, 4 ,5 ,2,
; which ensures that the result stays in s16 range. Finally, saturated add the result by
; applying 3rd filter coeff. Same applys to other filter functions.
|vp8_sixtap_predict16x16_neon| PROC
push {r4-r5, lr}
- ldr r12, _filter16_coeff_
+ adrl r12, filter16_coeff
ldr r4, [sp, #12] ;load parameters from stack
ldr r5, [sp, #16] ;load parameters from stack
cmp r2, #0 ;skip first_pass filter if xoffset=0
beq secondpass_filter16x16_only
add r2, r12, r2, lsl #5 ;calculate filter location
@@ -475,18 +475,16 @@ secondpass_only_inner_loop_neon
ENDP
;-----------------
AREA subpelfilters16_dat, DATA, READWRITE ;read/write by default
;Data section with name data_area is specified. DCD reserves space in memory for 48 data.
;One word each is reserved. Label filter_coeff can be used to access the data.
;Data address: filter_coeff, filter_coeff+4, filter_coeff+8 ...
-_filter16_coeff_
- DCD filter16_coeff
filter16_coeff
DCD 0, 0, 128, 0, 0, 0, 0, 0
DCD 0, -6, 123, 12, -1, 0, 0, 0
DCD 2, -11, 108, 36, -8, 1, 0, 0
DCD 0, -9, 93, 50, -6, 0, 0, 0
DCD 3, -16, 77, 77, -16, 3, 0, 0
DCD 0, -6, 50, 93, -9, 0, 0, 0
DCD 1, -8, 36, 108, -11, 2, 0, 0
diff --git a/media/libvpx/vp8/common/arm/neon/sixtappredict4x4_neon.asm b/media/libvpx/vp8/common/arm/neon/sixtappredict4x4_neon.asm
--- a/media/libvpx/vp8/common/arm/neon/sixtappredict4x4_neon.asm
+++ b/media/libvpx/vp8/common/arm/neon/sixtappredict4x4_neon.asm
@@ -20,17 +20,17 @@
; r2 int xoffset,
; r3 int yoffset,
; stack(r4) unsigned char *dst_ptr,
; stack(lr) int dst_pitch
|vp8_sixtap_predict_neon| PROC
push {r4, lr}
- ldr r12, _filter4_coeff_
+ adrl r12, filter4_coeff
ldr r4, [sp, #8] ;load parameters from stack
ldr lr, [sp, #12] ;load parameters from stack
cmp r2, #0 ;skip first_pass filter if xoffset=0
beq secondpass_filter4x4_only
add r2, r12, r2, lsl #5 ;calculate filter location
@@ -406,18 +406,16 @@ secondpass_filter4x4_only
ENDP
;-----------------
AREA subpelfilters4_dat, DATA, READWRITE ;read/write by default
;Data section with name data_area is specified. DCD reserves space in memory for 48 data.
;One word each is reserved. Label filter_coeff can be used to access the data.
;Data address: filter_coeff, filter_coeff+4, filter_coeff+8 ...
-_filter4_coeff_
- DCD filter4_coeff
filter4_coeff
DCD 0, 0, 128, 0, 0, 0, 0, 0
DCD 0, -6, 123, 12, -1, 0, 0, 0
DCD 2, -11, 108, 36, -8, 1, 0, 0
DCD 0, -9, 93, 50, -6, 0, 0, 0
DCD 3, -16, 77, 77, -16, 3, 0, 0
DCD 0, -6, 50, 93, -9, 0, 0, 0
DCD 1, -8, 36, 108, -11, 2, 0, 0
diff --git a/media/libvpx/vp8/common/arm/neon/sixtappredict8x4_neon.asm b/media/libvpx/vp8/common/arm/neon/sixtappredict8x4_neon.asm
--- a/media/libvpx/vp8/common/arm/neon/sixtappredict8x4_neon.asm
+++ b/media/libvpx/vp8/common/arm/neon/sixtappredict8x4_neon.asm
@@ -20,17 +20,17 @@
; r2 int xoffset,
; r3 int yoffset,
; r4 unsigned char *dst_ptr,
; stack(r5) int dst_pitch
|vp8_sixtap_predict8x4_neon| PROC
push {r4-r5, lr}
- ldr r12, _filter8_coeff_
+ adrl r12, filter8_coeff
ldr r4, [sp, #12] ;load parameters from stack
ldr r5, [sp, #16] ;load parameters from stack
cmp r2, #0 ;skip first_pass filter if xoffset=0
beq secondpass_filter8x4_only
add r2, r12, r2, lsl #5 ;calculate filter location
@@ -457,18 +457,16 @@ secondpass_filter8x4_only
ENDP
;-----------------
AREA subpelfilters8_dat, DATA, READWRITE ;read/write by default
;Data section with name data_area is specified. DCD reserves space in memory for 48 data.
;One word each is reserved. Label filter_coeff can be used to access the data.
;Data address: filter_coeff, filter_coeff+4, filter_coeff+8 ...
-_filter8_coeff_
- DCD filter8_coeff
filter8_coeff
DCD 0, 0, 128, 0, 0, 0, 0, 0
DCD 0, -6, 123, 12, -1, 0, 0, 0
DCD 2, -11, 108, 36, -8, 1, 0, 0
DCD 0, -9, 93, 50, -6, 0, 0, 0
DCD 3, -16, 77, 77, -16, 3, 0, 0
DCD 0, -6, 50, 93, -9, 0, 0, 0
DCD 1, -8, 36, 108, -11, 2, 0, 0
diff --git a/media/libvpx/vp8/common/arm/neon/sixtappredict8x8_neon.asm b/media/libvpx/vp8/common/arm/neon/sixtappredict8x8_neon.asm
--- a/media/libvpx/vp8/common/arm/neon/sixtappredict8x8_neon.asm
+++ b/media/libvpx/vp8/common/arm/neon/sixtappredict8x8_neon.asm
@@ -20,17 +20,17 @@
; r2 int xoffset,
; r3 int yoffset,
; stack(r4) unsigned char *dst_ptr,
; stack(r5) int dst_pitch
|vp8_sixtap_predict8x8_neon| PROC
push {r4-r5, lr}
- ldr r12, _filter8_coeff_
+ adrl r12, filter8_coeff
ldr r4, [sp, #12] ;load parameters from stack
ldr r5, [sp, #16] ;load parameters from stack
cmp r2, #0 ;skip first_pass filter if xoffset=0
beq secondpass_filter8x8_only
add r2, r12, r2, lsl #5 ;calculate filter location
@@ -508,18 +508,16 @@ filt_blk2d_spo8x8_loop_neon
ENDP
;-----------------
AREA subpelfilters8_dat, DATA, READWRITE ;read/write by default
;Data section with name data_area is specified. DCD reserves space in memory for 48 data.
;One word each is reserved. Label filter_coeff can be used to access the data.
;Data address: filter_coeff, filter_coeff+4, filter_coeff+8 ...
-_filter8_coeff_
- DCD filter8_coeff
filter8_coeff
DCD 0, 0, 128, 0, 0, 0, 0, 0
DCD 0, -6, 123, 12, -1, 0, 0, 0
DCD 2, -11, 108, 36, -8, 1, 0, 0
DCD 0, -9, 93, 50, -6, 0, 0, 0
DCD 3, -16, 77, 77, -16, 3, 0, 0
DCD 0, -6, 50, 93, -9, 0, 0, 0
DCD 1, -8, 36, 108, -11, 2, 0, 0
diff --git a/media/libvpx/vp8/decoder/arm/neon/dequant_idct_neon.asm b/media/libvpx/vp8/decoder/arm/neon/dequant_idct_neon.asm
--- a/media/libvpx/vp8/decoder/arm/neon/dequant_idct_neon.asm
+++ b/media/libvpx/vp8/decoder/arm/neon/dequant_idct_neon.asm
@@ -30,17 +30,17 @@
ldr r1, [sp] ; pitch
vld1.32 {d14[0]}, [r2], r1
vld1.32 {d14[1]}, [r2], r1
vld1.32 {d15[0]}, [r2], r1
vld1.32 {d15[1]}, [r2]
ldr r1, [sp, #4] ; stride
- ldr r12, _CONSTANTS_
+ adr r12, _CONSTANTS_
vmul.i16 q1, q3, q5 ;input for short_idct4x4llm_neon
vmul.i16 q2, q4, q6
;|short_idct4x4llm_neon| PROC
vld1.16 {d0}, [r12]
vswp d3, d4 ;q2(vp[4] vp[12])
@@ -118,13 +118,13 @@
vst1.32 {d1[0]}, [r3], r1
vst1.32 {d1[1]}, [r3]
bx lr
ENDP ; |vp8_dequant_idct_add_neon|
; Constant Pool
-_CONSTANTS_ DCD cospi8sqrt2minus1
+_CONSTANTS_ EQU cospi8sqrt2minus1
cospi8sqrt2minus1 DCD 0x4e7b4e7b
sinpi8sqrt2 DCD 0x8a8c8a8c
END
diff --git a/media/libvpx/vp8/decoder/arm/neon/idct_dequant_dc_full_2x_neon.asm b/media/libvpx/vp8/decoder/arm/neon/idct_dequant_dc_full_2x_neon.asm
--- a/media/libvpx/vp8/decoder/arm/neon/idct_dequant_dc_full_2x_neon.asm
+++ b/media/libvpx/vp8/decoder/arm/neon/idct_dequant_dc_full_2x_neon.asm
@@ -36,17 +36,17 @@
vld1.32 {d29[0]}, [r2], r1
vld1.32 {d29[1]}, [r12], r1
vld1.32 {d30[0]}, [r2], r1
vld1.32 {d30[1]}, [r12], r1
vld1.32 {d31[0]}, [r2]
ldr r1, [sp, #4]
vld1.32 {d31[1]}, [r12]
- ldr r2, _CONSTANTS_
+ adr r2, _CONSTANTS_
ldrh r12, [r1], #2 ; lo *dc
ldrh r1, [r1] ; hi *dc
; dequant: q[i] = q[i] * dq[i]
vmul.i16 q2, q2, q0
vmul.i16 q3, q3, q1
vmul.i16 q4, q4, q0
@@ -193,14 +193,14 @@
vst1.32 {d3[0]}, [r3]
vst1.32 {d3[1]}, [r2]
bx lr
ENDP ; |idct_dequant_dc_full_2x_neon|
; Constant Pool
-_CONSTANTS_ DCD cospi8sqrt2minus1
+_CONSTANTS_ EQU cospi8sqrt2minus1
cospi8sqrt2minus1 DCD 0x4e7b
; because the lowest bit in 0x8a8c is 0, we can pre-shift this
sinpi8sqrt2 DCD 0x4546
END
diff --git a/media/libvpx/vp8/decoder/arm/neon/idct_dequant_full_2x_neon.asm b/media/libvpx/vp8/decoder/arm/neon/idct_dequant_full_2x_neon.asm
--- a/media/libvpx/vp8/decoder/arm/neon/idct_dequant_full_2x_neon.asm
+++ b/media/libvpx/vp8/decoder/arm/neon/idct_dequant_full_2x_neon.asm
@@ -35,17 +35,17 @@
vld1.32 {d28[1]}, [r12], r1 ; r pre
vld1.32 {d29[0]}, [r2], r1
vld1.32 {d29[1]}, [r12], r1
vld1.32 {d30[0]}, [r2], r1
vld1.32 {d30[1]}, [r12], r1
vld1.32 {d31[0]}, [r2]
vld1.32 {d31[1]}, [r12]
- ldr r2, _CONSTANTS_
+ adr r2, _CONSTANTS_
; dequant: q[i] = q[i] * dq[i]
vmul.i16 q2, q2, q0
vmul.i16 q3, q3, q1
vmul.i16 q4, q4, q0
vmul.i16 q5, q5, q1
vld1.16 {d0}, [r2]
@@ -185,14 +185,14 @@
vst1.32 {d3[0]}, [r3]
vst1.32 {d3[1]}, [r2]
bx lr
ENDP ; |idct_dequant_full_2x_neon|
; Constant Pool
-_CONSTANTS_ DCD cospi8sqrt2minus1
+_CONSTANTS_ EQU cospi8sqrt2minus1
cospi8sqrt2minus1 DCD 0x4e7b
; because the lowest bit in 0x8a8c is 0, we can pre-shift this
sinpi8sqrt2 DCD 0x4546
END

Просмотреть файл

@ -1,25 +0,0 @@
diff --git a/media/libvpx/build/make/ads2gas.pl b/media/libvpx/build/make/ads2gas.pl
--- a/media/libvpx/build/make/ads2gas.pl
+++ b/media/libvpx/build/make/ads2gas.pl
@@ -74,17 +74,20 @@ while (<STDIN>)
# Convert INCLUDE to .INCLUDE "file"
s/INCLUDE(\s*)(.*)$/.include $1\"$2\"/;
# Code directive (ARM vs Thumb)
s/CODE([0-9][0-9])/.code $1/;
# No AREA required
- s/^\s*AREA.*$/.text/;
+ # But ALIGNs in AREA must be obeyed
+ s/^\s*AREA.*ALIGN=([0-9])$/.text\n.p2align $1/;
+ # If no ALIGN, strip the AREA and align to 4 bytes
+ s/^\s*AREA.*$/.text\n.p2align 2/;
# DCD to .word
# This one is for incoming symbols
s/DCD\s+\|(\w*)\|/.long $1/;
# DCW to .short
s/DCW\s+\|(\w*)\|/.short $1/;
s/DCW(.*)/.short $1/;

Просмотреть файл

@ -1,162 +0,0 @@
diff --git a/media/libvpx/vp8/vp8_dx_iface.c b/media/libvpx/vp8/vp8_dx_iface.c
--- a/media/libvpx/vp8/vp8_dx_iface.c
+++ b/media/libvpx/vp8/vp8_dx_iface.c
@@ -315,16 +315,46 @@ update_error_state(vpx_codec_alg_priv_t
if ((res = error->error_code))
ctx->base.err_detail = error->has_detail
? error->detail
: NULL;
return res;
}
+static void yuvconfig2image(vpx_image_t *img,
+ const YV12_BUFFER_CONFIG *yv12,
+ void *user_priv)
+{
+ /** vpx_img_wrap() doesn't allow specifying independent strides for
+ * the Y, U, and V planes, nor other alignment adjustments that
+ * might be representable by a YV12_BUFFER_CONFIG, so we just
+ * initialize all the fields.*/
+ img->fmt = yv12->clrtype == REG_YUV ?
+ VPX_IMG_FMT_I420 : VPX_IMG_FMT_VPXI420;
+ img->w = yv12->y_stride;
+ img->h = (yv12->y_height + 2 * VP8BORDERINPIXELS + 15) & ~15;
+ img->d_w = yv12->y_width;
+ img->d_h = yv12->y_height;
+ img->x_chroma_shift = 1;
+ img->y_chroma_shift = 1;
+ img->planes[VPX_PLANE_Y] = yv12->y_buffer;
+ img->planes[VPX_PLANE_U] = yv12->u_buffer;
+ img->planes[VPX_PLANE_V] = yv12->v_buffer;
+ img->planes[VPX_PLANE_ALPHA] = NULL;
+ img->stride[VPX_PLANE_Y] = yv12->y_stride;
+ img->stride[VPX_PLANE_U] = yv12->uv_stride;
+ img->stride[VPX_PLANE_V] = yv12->uv_stride;
+ img->stride[VPX_PLANE_ALPHA] = yv12->y_stride;
+ img->bps = 12;
+ img->user_priv = user_priv;
+ img->img_data = yv12->buffer_alloc;
+ img->img_data_owner = 0;
+ img->self_allocd = 0;
+}
static vpx_codec_err_t vp8_decode(vpx_codec_alg_priv_t *ctx,
const uint8_t *data,
unsigned int data_sz,
void *user_priv,
long deadline)
{
vpx_codec_err_t res = VPX_CODEC_OK;
@@ -424,30 +454,18 @@ static vpx_codec_err_t vp8_decode(vpx_co
if (vp8dx_receive_compressed_data(ctx->pbi, data_sz, data, deadline))
{
VP8D_COMP *pbi = (VP8D_COMP *)ctx->pbi;
res = update_error_state(ctx, &pbi->common.error);
}
if (!res && 0 == vp8dx_get_raw_frame(ctx->pbi, &sd, &time_stamp, &time_end_stamp, ppdeblocking, ppnoise, ppflag))
{
- /* Align width/height */
- unsigned int a_w = (sd.y_width + 15) & ~15;
- unsigned int a_h = (sd.y_height + 15) & ~15;
-
- vpx_img_wrap(&ctx->img, VPX_IMG_FMT_I420,
- a_w + 2 * VP8BORDERINPIXELS,
- a_h + 2 * VP8BORDERINPIXELS,
- 1,
- sd.buffer_alloc);
- vpx_img_set_rect(&ctx->img,
- VP8BORDERINPIXELS, VP8BORDERINPIXELS,
- sd.y_width, sd.y_height);
+ yuvconfig2image(&ctx->img, &sd, user_priv);
ctx->img_avail = 1;
-
}
}
return res;
}
static vpx_image_t *vp8_get_frame(vpx_codec_alg_priv_t *ctx,
vpx_codec_iter_t *iter)
diff --git a/media/libvpx/vpx_scale/generic/yv12config.c b/media/libvpx/vpx_scale/generic/yv12config.c
--- a/media/libvpx/vpx_scale/generic/yv12config.c
+++ b/media/libvpx/vpx_scale/generic/yv12config.c
@@ -42,50 +42,61 @@ vp8_yv12_de_alloc_frame_buffer(YV12_BUFF
/****************************************************************************
*
****************************************************************************/
int
vp8_yv12_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height, int border)
{
/*NOTE:*/
- int yplane_size = (height + 2 * border) * (width + 2 * border);
- int uvplane_size = ((1 + height) / 2 + border) * ((1 + width) / 2 + border);
-
if (ybf)
{
+ int y_stride = ((width + 2 * border) + 31) & ~31;
+ int yplane_size = (height + 2 * border) * y_stride;
+ /** There is currently a bunch of code which assumes
+ * uv_stride == y_stride/2, so enforce this here. */
+ int uv_width = width >> 1;
+ int uv_height = height >> 1;
+ int uv_stride = y_stride >> 1;
+ int uvplane_size = ((1 + height) / 2 + border) * uv_stride;
+
vp8_yv12_de_alloc_frame_buffer(ybf);
+ /** Only support allocating buffers that have a height and width that
+ * are multiples of 16, and a border that's a multiple of 32.
+ * The border restriction is required to get 16-byte alignment of the
+ * start of the chroma rows without intoducing an arbitrary gap
+ * between planes, which would break the semantics of things like
+ * vpx_img_set_rect(). */
+ if ((width & 0xf) | (height & 0xf) | (border & 0x1f))
+ return -3;
+
ybf->y_width = width;
ybf->y_height = height;
- ybf->y_stride = width + 2 * border;
+ ybf->y_stride = y_stride;
- ybf->uv_width = (1 + width) / 2;
- ybf->uv_height = (1 + height) / 2;
- ybf->uv_stride = ybf->uv_width + border;
+ ybf->uv_width = uv_width;
+ ybf->uv_height = uv_height;
+ ybf->uv_stride = uv_stride;
ybf->border = border;
ybf->frame_size = yplane_size + 2 * uvplane_size;
/* Added 2 extra lines to framebuffer so that copy12x12 doesn't fail
* when we have a large motion vector in V on the last v block.
* Note : We never use these pixels anyway so this doesn't hurt.
*/
- ybf->buffer_alloc = (unsigned char *) duck_memalign(32, ybf->frame_size + (ybf->y_stride * 2) + 32, 0);
+ ybf->buffer_alloc = (unsigned char *) vpx_memalign(32, ybf->frame_size);
if (ybf->buffer_alloc == NULL)
return -1;
- ybf->y_buffer = ybf->buffer_alloc + (border * ybf->y_stride) + border;
-
- if (yplane_size & 0xf)
- yplane_size += 16 - (yplane_size & 0xf);
-
- ybf->u_buffer = ybf->buffer_alloc + yplane_size + (border / 2 * ybf->uv_stride) + border / 2;
- ybf->v_buffer = ybf->buffer_alloc + yplane_size + uvplane_size + (border / 2 * ybf->uv_stride) + border / 2;
+ ybf->y_buffer = ybf->buffer_alloc + (border * y_stride) + border;
+ ybf->u_buffer = ybf->buffer_alloc + yplane_size + (border / 2 * uv_stride) + border / 2;
+ ybf->v_buffer = ybf->buffer_alloc + yplane_size + uvplane_size + (border / 2 * uv_stride) + border / 2;
}
else
{
return -2;
}
return 0;
}

Просмотреть файл

@ -1,22 +0,0 @@
diff --git a/media/libvpx/vp8/decoder/decodemv.c b/media/libvpx/vp8/decoder/decodemv.c
--- a/media/libvpx/vp8/decoder/decodemv.c
+++ b/media/libvpx/vp8/decoder/decodemv.c
@@ -361,17 +361,17 @@ static void read_mb_modes_mv(VP8D_COMP *
#ifdef VPX_MODE_COUNT
vp8_mv_cont_count[mv_contz][2]++;
#endif
break;
default:
break;
}
- mbmi->need_to_clamp_mvs = vp8_check_mv_bounds(&blockmv,
+ mbmi->need_to_clamp_mvs |= vp8_check_mv_bounds(&blockmv,
mb_to_left_edge,
mb_to_right_edge,
mb_to_top_edge,
mb_to_bottom_edge);
{
/* Fill (uniform) modes, mvs of jth subset.
Must do it here because ensuing subsets can

Просмотреть файл

@ -26,12 +26,22 @@ print "\t.equ DO1STROUNDING, 0\n";
while (<STDIN>)
{
undef $comment;
undef $line;
$comment_char = ";";
$comment_sub = "@";
# Handle comments.
if (/$comment_char/)
{
$comment = "";
($line, $comment) = /(.*?)$comment_char(.*)/;
$_ = $line;
}
# Load and store alignment
s/@/,:/g;
# Comment character
s/;/@/g;
# Hexadecimal constants prefaced by 0x
s/#&/#0x/g;
@ -51,16 +61,27 @@ while (<STDIN>)
s/:SHR:/ >> /g;
# Convert ELSE to .else
s/ELSE/.else/g;
s/\bELSE\b/.else/g;
# Convert ENDIF to .endif
s/ENDIF/.endif/g;
s/\bENDIF\b/.endif/g;
# Convert ELSEIF to .elseif
s/ELSEIF/.elseif/g;
s/\bELSEIF\b/.elseif/g;
# Convert LTORG to .ltorg
s/LTORG/.ltorg/g;
s/\bLTORG\b/.ltorg/g;
# Convert endfunc to nothing.
s/\bendfunc\b//ig;
# Convert FUNCTION to nothing.
s/\bFUNCTION\b//g;
s/\bfunction\b//g;
s/\bENTRY\b//g;
s/\bMSARMASM\b/0/g;
s/^\s+end\s+$//g;
# Convert IF :DEF:to .if
# gcc doesn't have the ability to do a conditional
@ -106,6 +127,7 @@ while (<STDIN>)
if (s/RN\s+([Rr]\d+|lr)/.req $1/)
{
print;
print "$comment_sub$comment\n" if defined $comment;
next;
}
@ -114,6 +136,9 @@ while (<STDIN>)
s/EXPORT\s+\|([\$\w]*)\|/.global $1 \n\t.type $1, function/;
s/IMPORT\s+\|([\$\w]*)\|/.global $1/;
s/EXPORT\s+([\$\w]*)/.global $1/;
s/export\s+([\$\w]*)/.global $1/;
# No vertical bars required; make additional symbol with prepended
# underscore
s/^\|(\$?\w+)\|/_$1\n\t$1:/g;
@ -124,11 +149,19 @@ while (<STDIN>)
s/^([a-zA-Z_0-9\$]+)/$1:/ if !/EQU/;
# ALIGN directive
s/ALIGN/.balign/g;
s/\bALIGN\b/.balign/g;
# ARM code
s/\sARM/.arm/g;
# push/pop
s/(push\s+)(r\d+)/stmdb sp\!, \{$2\}/g;
s/(pop\s+)(r\d+)/ldmia sp\!, \{$2\}/g;
# NEON code
s/(vld1.\d+\s+)(q\d+)/$1\{$2\}/g;
s/(vtbl.\d+\s+[^,]+),([^,]+)/$1,\{$2\}/g;
# eabi_attributes numerical equivalents can be found in the
# "ARM IHI 0045C" document.
@ -157,10 +190,10 @@ while (<STDIN>)
}
# EQU directive
s/(.*)EQU(.*)/.equ $1, $2/;
s/(\S+\s+)EQU(\s+\S+)/.equ $1, $2/;
# Begin macro definition
if (/MACRO/) {
if (/\bMACRO\b/) {
$_ = <STDIN>;
s/^/.macro/;
s/\$//g; # remove formal param reference
@ -169,9 +202,10 @@ while (<STDIN>)
# For macros, use \ to reference formal params
s/\$/\\/g; # End macro definition
s/MEND/.endm/; # No need to tell it where to stop assembling
s/\bMEND\b/.endm/; # No need to tell it where to stop assembling
next if /^\s*END\s*$/;
print;
print "$comment_sub$comment\n" if defined $comment;
}
# Mark that this object doesn't need an executable stack.

Просмотреть файл

@ -680,7 +680,7 @@ int parse_coff(uint8_t *buf, size_t sz)
uint32_t symoffset;
char **sectionlist; //this array holds all section names in their correct order.
//it is used to check if the symbol is in .bss or .data section.
//it is used to check if the symbol is in .bss or .rdata section.
nsections = get_le16(buf + 2);
symtab_ptr = get_le32(buf + 8);
@ -725,15 +725,15 @@ int parse_coff(uint8_t *buf, size_t sz)
}
strcpy(sectionlist[i], sectionname);
if (!strcmp(sectionname, ".data")) sectionrawdata_ptr = get_le32(ptr + 20);
if (!strcmp(sectionname, ".rdata")) sectionrawdata_ptr = get_le32(ptr + 20);
ptr += 40;
}
//log_msg("COFF: Symbol table at offset %u\n", symtab_ptr);
//log_msg("COFF: raw data pointer ofset for section .data is %u\n", sectionrawdata_ptr);
//log_msg("COFF: raw data pointer ofset for section .rdata is %u\n", sectionrawdata_ptr);
/* The compiler puts the data with non-zero offset in .data section, but puts the data with
/* The compiler puts the data with non-zero offset in .rdata section, but puts the data with
zero offset in .bss section. So, if the data in in .bss section, set offset=0.
Note from Wiki: In an object module compiled from C, the bss section contains
the local variables (but not functions) that were declared with the static keyword,

Просмотреть файл

@ -1,138 +0,0 @@
# HG changeset patch
# Parent f73b7e96c0735448035ec4786f37dcf7d7644e00
# User Timothy B. Terriberry <tterribe@vt.edu>
Patch to fix errors including C headers in C++
diff --git a/media/libvpx/vp8/common/onyx.h b/media/libvpx/vp8/common/onyx.h
--- a/media/libvpx/vp8/common/onyx.h
+++ b/media/libvpx/vp8/common/onyx.h
@@ -55,24 +55,24 @@ extern "C"
typedef enum
{
MODE_REALTIME = 0x0,
MODE_GOODQUALITY = 0x1,
MODE_BESTQUALITY = 0x2,
MODE_FIRSTPASS = 0x3,
MODE_SECONDPASS = 0x4,
- MODE_SECONDPASS_BEST = 0x5,
+ MODE_SECONDPASS_BEST = 0x5
} MODE;
typedef enum
{
FRAMEFLAGS_KEY = 1,
FRAMEFLAGS_GOLDEN = 2,
- FRAMEFLAGS_ALTREF = 4,
+ FRAMEFLAGS_ALTREF = 4
} FRAMETYPE_FLAGS;
#include <assert.h>
static void Scale2Ratio(int mode, int *hr, int *hs)
{
switch (mode)
{
diff --git a/media/libvpx/vp8/encoder/onyx_int.h b/media/libvpx/vp8/encoder/onyx_int.h
--- a/media/libvpx/vp8/encoder/onyx_int.h
+++ b/media/libvpx/vp8/encoder/onyx_int.h
@@ -158,17 +158,17 @@ typedef enum
THR_NEW1 = 13,
THR_NEW2 = 14,
THR_NEW3 = 15,
THR_SPLIT1 = 16,
THR_SPLIT2 = 17,
THR_SPLIT3 = 18,
- THR_B_PRED = 19,
+ THR_B_PRED = 19
}
THR_MODES;
typedef enum
{
DIAMOND = 0,
NSTEP = 1,
HEX = 2
diff --git a/media/libvpx/vpx/vp8.h b/media/libvpx/vpx/vp8.h
--- a/media/libvpx/vpx/vp8.h
+++ b/media/libvpx/vpx/vp8.h
@@ -41,34 +41,34 @@ enum vp8_com_control_id
VP8_SET_REFERENCE = 1, /**< pass in an external frame into decoder to be used as reference frame */
VP8_COPY_REFERENCE = 2, /**< get a copy of reference frame from the decoder */
VP8_SET_POSTPROC = 3, /**< set the decoder's post processing settings */
VP8_SET_DBG_COLOR_REF_FRAME = 4, /**< set the reference frames to color for each macroblock */
VP8_SET_DBG_COLOR_MB_MODES = 5, /**< set which macro block modes to color */
VP8_SET_DBG_COLOR_B_MODES = 6, /**< set which blocks modes to color */
VP8_SET_DBG_DISPLAY_MV = 7, /**< set which motion vector modes to draw */
VP8_COMMON_CTRL_ID_MAX,
- VP8_DECODER_CTRL_ID_START = 256,
+ VP8_DECODER_CTRL_ID_START = 256
};
/*!\brief post process flags
*
* The set of macros define VP8 decoder post processing flags
*/
enum vp8_postproc_level
{
VP8_NOFILTERING = 0,
VP8_DEBLOCK = 1<<0,
VP8_DEMACROBLOCK = 1<<1,
VP8_ADDNOISE = 1<<2,
VP8_DEBUG_TXT_FRAME_INFO = 1<<3, /**< print frame information */
VP8_DEBUG_TXT_MBLK_MODES = 1<<4, /**< print macro block modes over each macro block */
VP8_DEBUG_TXT_DC_DIFF = 1<<5, /**< print dc diff for each macro block */
VP8_DEBUG_TXT_RATE_INFO = 1<<6, /**< print video rate info (encoder only) */
- VP8_MFQE = 1<<10,
+ VP8_MFQE = 1<<10
};
/*!\brief post process flags
*
* This define a structure that describe the post processing settings. For
* the best objective measure (using the PSNR metric) set post_proc_flag
* to VP8_DEBLOCK and deblocking_level to 1.
*/
diff --git a/media/libvpx/vpx/vp8cx.h b/media/libvpx/vpx/vp8cx.h
--- a/media/libvpx/vpx/vp8cx.h
+++ b/media/libvpx/vpx/vp8cx.h
@@ -172,17 +172,17 @@ enum vp8e_enc_control_id
* per-frame bitrate, with the special (and default) value 0 meaning
* unlimited, or no additional clamping beyond the codec's built-in
* algorithm.
*
* For example, to allocate no more than 4.5 frames worth of bitrate
* to a keyframe, set this to 450.
*
*/
- VP8E_SET_MAX_INTRA_BITRATE_PCT,
+ VP8E_SET_MAX_INTRA_BITRATE_PCT
};
/*!\brief vpx 1-D scaling mode
*
* This set of constants define 1-D vpx scaling modes
*/
typedef enum vpx_scaling_mode_1d
{
@@ -253,17 +253,17 @@ typedef enum
*
*/
typedef enum
{
VP8_ONE_TOKENPARTITION = 0,
VP8_TWO_TOKENPARTITION = 1,
VP8_FOUR_TOKENPARTITION = 2,
- VP8_EIGHT_TOKENPARTITION = 3,
+ VP8_EIGHT_TOKENPARTITION = 3
} vp8e_token_partitions;
/*!\brief VP8 model tuning parameters
*
* Changes the encoder to tune for certain types of input material.
*
*/

Просмотреть файл

@ -8,12 +8,10 @@ EXPORTS.vpx += [
'vpx/vp8.h',
'vpx/vp8cx.h',
'vpx/vp8dx.h',
'vpx/vp8e.h',
'vpx/vpx_codec.h',
'vpx/vpx_codec_impl_bottom.h',
'vpx/vpx_codec_impl_top.h',
'vpx/vpx_decoder.h',
'vpx/vpx_decoder_compat.h',
'vpx/vpx_encoder.h',
'vpx/vpx_image.h',
'vpx/vpx_integer.h',
@ -26,7 +24,6 @@ EXPORTS.vpx += [
'vpx_scale/scale_mode.h',
'vpx_scale/vpxscale.h',
'vpx_scale/yv12config.h',
'vpx_scale/yv12extend.h',
]
if CONFIG['VPX_NEED_OBJ_INT_EXTRACT']:
@ -54,40 +51,271 @@ SOURCES += [
'vp8/common/loopfilter_filters.c',
'vp8/common/mbpitch.c',
'vp8/common/modecont.c',
'vp8/common/modecontext.c',
'vp8/common/postproc.c',
'vp8/common/quant_common.c',
'vp8/common/reconinter.c',
'vp8/common/reconintra.c',
'vp8/common/reconintra4x4.c',
'vp8/common/rtcd.c',
'vp8/common/sad_c.c',
'vp8/common/setupintrarecon.c',
'vp8/common/swapyv12buffer.c',
'vp8/common/treecoder.c',
'vp8/common/variance_c.c',
'vp8/decoder/asm_dec_offsets.c',
'vp8/decoder/dboolhuff.c',
'vp8/decoder/decodemv.c',
'vp8/decoder/decodframe.c',
'vp8/decoder/detokenize.c',
'vp8/decoder/generic/dsystemdependent.c',
'vp8/decoder/onyxd_if.c',
'vp8/decoder/reconintra_mt.c',
'vp8/decoder/threading.c',
'vp8/vp8_dx_iface.c',
'vpx/src/vpx_codec.c',
'vpx/src/vpx_decoder.c',
'vpx/src/vpx_decoder_compat.c',
'vpx/src/vpx_encoder.c',
'vpx/src/vpx_image.c',
'vpx_config_c.c',
'vpx_mem/vpx_mem.c',
'vpx_scale/generic/gen_scalers.c',
'vpx_scale/generic/scalesystemdependent.c',
'vpx_scale/generic/vpxscale.c',
'vpx_scale/generic/yv12config.c',
'vpx_scale/generic/yv12extend.c',
]
if CONFIG['MOZ_VP8_ERROR_CONCEALMENT']:
SOURCES += [
'vp8/decoder/error_concealment.c'
]
if CONFIG['MOZ_VP8_ENCODER']:
SOURCES += [
'vp8/encoder/bitstream.c',
'vp8/encoder/dct.c',
'vp8/encoder/encodeframe.c',
'vp8/encoder/encodeintra.c',
'vp8/encoder/encodemb.c',
'vp8/encoder/encodemv.c',
'vp8/encoder/ethreading.c',
'vp8/encoder/firstpass.c',
'vp8/encoder/lookahead.c',
'vp8/encoder/mcomp.c',
'vp8/encoder/modecosts.c',
'vp8/encoder/mr_dissim.c',
'vp8/encoder/onyx_if.c',
'vp8/encoder/pickinter.c',
'vp8/encoder/picklpf.c',
'vp8/encoder/psnr.c',
'vp8/encoder/quantize.c',
'vp8/encoder/ratectrl.c',
'vp8/encoder/rdopt.c',
'vp8/encoder/segmentation.c',
'vp8/encoder/tokenize.c',
'vp8/encoder/treewriter.c',
'vp8/vp8_cx_iface.c',
]
#postproc is only enabled on x86 with asm
if CONFIG['VPX_X86_ASM']:
SOURCES += [
'vp8/common/mfqe.c',
'vp8/common/postproc.c',
'vp8/encoder/temporal_filter.c',
]
if CONFIG['VPX_X86_ASM'] and CONFIG['OS_TARGET'] == 'WINNT':
SOURCES += [
'vp8/common/asm_com_offsets.c',
]
if CONFIG['MOZ_VP8_ENCODER']:
SOURCES += [
'vp8/encoder/asm_enc_offsets.c',
]
if CONFIG['VPX_X86_ASM']:
SOURCES += [
'vp8/common/x86/filter_x86.c',
'vp8/common/x86/idct_blk_mmx.c',
'vp8/common/x86/idct_blk_sse2.c',
'vp8/common/x86/loopfilter_x86.c',
'vp8/common/x86/postproc_x86.c',
'vp8/common/x86/recon_wrapper_sse2.c',
'vp8/common/x86/variance_mmx.c',
'vp8/common/x86/variance_sse2.c',
'vp8/common/x86/variance_ssse3.c',
'vp8/common/x86/vp8_asm_stubs.c',
'vpx_ports/x86_cpuid.c',
]
SOURCES += [
'vp8/common/x86/dequantize_mmx.asm',
'vp8/common/x86/idctllm_mmx.asm',
'vp8/common/x86/idctllm_sse2.asm',
'vp8/common/x86/iwalsh_mmx.asm',
'vp8/common/x86/iwalsh_sse2.asm',
'vp8/common/x86/loopfilter_mmx.asm',
'vp8/common/x86/loopfilter_sse2.asm',
'vp8/common/x86/mfqe_sse2.asm',
'vp8/common/x86/postproc_mmx.asm',
'vp8/common/x86/postproc_sse2.asm',
'vp8/common/x86/recon_mmx.asm',
'vp8/common/x86/recon_sse2.asm',
'vp8/common/x86/sad_mmx.asm',
'vp8/common/x86/sad_sse2.asm',
'vp8/common/x86/sad_sse3.asm',
'vp8/common/x86/sad_sse4.asm',
'vp8/common/x86/sad_ssse3.asm',
'vp8/common/x86/subpixel_mmx.asm',
'vp8/common/x86/subpixel_sse2.asm',
'vp8/common/x86/subpixel_ssse3.asm',
'vp8/common/x86/variance_impl_mmx.asm',
'vp8/common/x86/variance_impl_sse2.asm',
'vp8/common/x86/variance_impl_ssse3.asm',
'vpx_ports/emms.asm',
]
if '64' in CONFIG['OS_TEST']:
SOURCES += [
'vp8/common/x86/loopfilter_block_sse2.asm',
]
if CONFIG['VPX_X86_ASM'] and CONFIG['MOZ_VP8_ENCODER']:
SOURCES += [
'vp8/encoder/x86/vp8_enc_stubs_mmx.c',
'vp8/encoder/x86/vp8_enc_stubs_sse2.c',
]
SOURCES += [
'vp8/encoder/x86/dct_mmx.asm',
'vp8/encoder/x86/dct_sse2.asm',
'vp8/encoder/x86/encodeopt.asm',
'vp8/encoder/x86/fwalsh_sse2.asm',
'vp8/encoder/x86/quantize_mmx.asm',
'vp8/encoder/x86/quantize_sse2.asm',
'vp8/encoder/x86/quantize_sse4.asm',
'vp8/encoder/x86/quantize_ssse3.asm',
'vp8/encoder/x86/subtract_mmx.asm',
'vp8/encoder/x86/subtract_sse2.asm',
'vp8/encoder/x86/temporal_filter_apply_sse2.asm',
]
if CONFIG['MOZ_VP8_ENCODER']:
SOURCES += [
'vp8/encoder/denoising.c',
]
if CONFIG['VPX_X86_ASM']:
SOURCES += [
'vp8/encoder/x86/denoising_sse2.c',
]
arm_asm_files = []
if CONFIG['VPX_ARM_ASM']:
SOURCES += [
'vp8/common/arm/armv6/idct_blk_v6.c',
'vp8/common/arm/bilinearfilter_arm.c',
'vp8/common/arm/dequantize_arm.c',
'vp8/common/arm/filter_arm.c',
'vp8/common/arm/loopfilter_arm.c',
'vp8/common/arm/neon/idct_blk_neon.c',
'vp8/common/arm/reconintra_arm.c',
'vp8/common/arm/variance_arm.c',
'vpx_ports/arm_cpudetect.c',
'vpx_scale/arm/neon/yv12extend_arm.c',
]
arm_asm_files += [
'vp8/common/arm/armv6/bilinearfilter_v6.asm',
'vp8/common/arm/armv6/copymem16x16_v6.asm',
'vp8/common/arm/armv6/copymem8x4_v6.asm',
'vp8/common/arm/armv6/copymem8x8_v6.asm',
'vp8/common/arm/armv6/dc_only_idct_add_v6.asm',
'vp8/common/arm/armv6/dequant_idct_v6.asm',
'vp8/common/arm/armv6/dequantize_v6.asm',
'vp8/common/arm/armv6/filter_v6.asm',
'vp8/common/arm/armv6/idct_v6.asm',
'vp8/common/arm/armv6/intra4x4_predict_v6.asm',
'vp8/common/arm/armv6/iwalsh_v6.asm',
'vp8/common/arm/armv6/loopfilter_v6.asm',
'vp8/common/arm/armv6/simpleloopfilter_v6.asm',
'vp8/common/arm/armv6/sixtappredict8x4_v6.asm',
'vp8/common/arm/armv6/vp8_sad16x16_armv6.asm',
'vp8/common/arm/armv6/vp8_variance16x16_armv6.asm',
'vp8/common/arm/armv6/vp8_variance8x8_armv6.asm',
'vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm',
'vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm',
'vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm',
'vp8/common/arm/neon/bilinearpredict16x16_neon.asm',
'vp8/common/arm/neon/bilinearpredict4x4_neon.asm',
'vp8/common/arm/neon/bilinearpredict8x4_neon.asm',
'vp8/common/arm/neon/bilinearpredict8x8_neon.asm',
'vp8/common/arm/neon/buildintrapredictorsmby_neon.asm',
'vp8/common/arm/neon/copymem16x16_neon.asm',
'vp8/common/arm/neon/copymem8x4_neon.asm',
'vp8/common/arm/neon/copymem8x8_neon.asm',
'vp8/common/arm/neon/dc_only_idct_add_neon.asm',
'vp8/common/arm/neon/dequant_idct_neon.asm',
'vp8/common/arm/neon/dequantizeb_neon.asm',
'vp8/common/arm/neon/idct_dequant_0_2x_neon.asm',
'vp8/common/arm/neon/idct_dequant_full_2x_neon.asm',
'vp8/common/arm/neon/iwalsh_neon.asm',
'vp8/common/arm/neon/loopfilter_neon.asm',
'vp8/common/arm/neon/loopfiltersimplehorizontaledge_neon.asm',
'vp8/common/arm/neon/loopfiltersimpleverticaledge_neon.asm',
'vp8/common/arm/neon/mbloopfilter_neon.asm',
'vp8/common/arm/neon/sad16_neon.asm',
'vp8/common/arm/neon/sad8_neon.asm',
'vp8/common/arm/neon/save_reg_neon.asm',
'vp8/common/arm/neon/shortidct4x4llm_neon.asm',
'vp8/common/arm/neon/sixtappredict16x16_neon.asm',
'vp8/common/arm/neon/sixtappredict4x4_neon.asm',
'vp8/common/arm/neon/sixtappredict8x4_neon.asm',
'vp8/common/arm/neon/sixtappredict8x8_neon.asm',
'vp8/common/arm/neon/variance_neon.asm',
'vp8/common/arm/neon/vp8_subpixelvariance16x16_neon.asm',
'vp8/common/arm/neon/vp8_subpixelvariance16x16s_neon.asm',
'vp8/common/arm/neon/vp8_subpixelvariance8x8_neon.asm',
'vp8/encoder/arm/armv6/vp8_mse16x16_armv6.asm',
'vp8/encoder/arm/neon/vp8_mse16x16_neon.asm',
'vpx_scale/arm/neon/vp8_vpxyv12_copy_y_neon.asm',
'vpx_scale/arm/neon/vp8_vpxyv12_copyframe_func_neon.asm',
'vpx_scale/arm/neon/vp8_vpxyv12_copysrcframe_func_neon.asm',
'vpx_scale/arm/neon/vp8_vpxyv12_extendframeborders_neon.asm',
]
if CONFIG['VPX_ARM_ASM'] and CONFIG['MOZ_VP8_ENCODER']:
SOURCES += [
'vp8/encoder/arm/boolhuff_arm.c',
'vp8/encoder/arm/dct_arm.c',
'vp8/encoder/arm/neon/picklpf_arm.c',
'vp8/encoder/arm/quantize_arm.c',
]
arm_asm_files += [
'vp8/encoder/arm/armv5te/boolhuff_armv5te.asm',
'vp8/encoder/arm/armv5te/vp8_packtokens_armv5.asm',
'vp8/encoder/arm/armv5te/vp8_packtokens_mbrow_armv5.asm',
'vp8/encoder/arm/armv5te/vp8_packtokens_partitions_armv5.asm',
'vp8/encoder/arm/armv6/vp8_fast_quantize_b_armv6.asm',
'vp8/encoder/arm/armv6/vp8_short_fdct4x4_armv6.asm',
'vp8/encoder/arm/armv6/vp8_subtract_armv6.asm',
'vp8/encoder/arm/armv6/walsh_v6.asm',
'vp8/encoder/arm/neon/fastquantizeb_neon.asm',
'vp8/encoder/arm/neon/shortfdct_neon.asm',
'vp8/encoder/arm/neon/subtract_neon.asm',
'vp8/encoder/arm/neon/vp8_memcpy_neon.asm',
'vp8/encoder/arm/neon/vp8_shortwalsh4x4_neon.asm',
]
if arm_asm_files:
if CONFIG['VPX_AS_CONVERSION']:
GENERATED_SOURCES += [ "%s.%s" % (f, CONFIG['VPX_ASM_SUFFIX'])
for f in sorted(arm_asm_files)]
else:
SOURCES += sorted(arm_asm_files)
# boolhuff_armv5te.asm defines the same functions as boolhuff.c instead of
# using RTCD, so we have to make sure we only add one of the two.
if CONFIG['MOZ_VP8_ENCODER'] \
and 'vp8/encoder/arm/armv5te/boolhuff_armv5te.asm' not in arm_asm_files:
SOURCES += [
'vp8/encoder/boolhuff.c',
]
MSVC_ENABLE_PGO = True
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:

Просмотреть файл

@ -1,129 +0,0 @@
diff --git a/media/libvpx/vpx_ports/mem.h b/media/libvpx/vpx_ports/mem.h
--- a/media/libvpx/vpx_ports/mem.h
+++ b/media/libvpx/vpx_ports/mem.h
@@ -9,17 +9,17 @@
*/
#ifndef VPX_PORTS_MEM_H
#define VPX_PORTS_MEM_H
#include "vpx_config.h"
#include "vpx/vpx_integer.h"
-#if defined(__GNUC__) && __GNUC__
+#if (defined(__GNUC__) && __GNUC__) || defined(__SUNPRO_C)
#define DECLARE_ALIGNED(n,typ,val) typ val __attribute__ ((aligned (n)))
#elif defined(_MSC_VER)
#define DECLARE_ALIGNED(n,typ,val) __declspec(align(n)) typ val
#else
#warning No alignment directives known for this compiler.
#define DECLARE_ALIGNED(n,typ,val) typ val
#endif
#endif
diff --git a/media/libvpx/vpx_ports/x86.h b/media/libvpx/vpx_ports/x86.h
--- a/media/libvpx/vpx_ports/x86.h
+++ b/media/libvpx/vpx_ports/x86.h
@@ -45,16 +45,36 @@ typedef enum
#define cpuid(func,ax,bx,cx,dx)\
__asm__ __volatile__ (\
"mov %%ebx, %%edi \n\t" \
"cpuid \n\t" \
"xchg %%edi, %%ebx \n\t" \
: "=a" (ax), "=D" (bx), "=c" (cx), "=d" (dx) \
: "a" (func));
#endif
+#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+#if ARCH_X86_64
+#define cpuid(func,ax,bx,cx,dx)\
+ asm volatile (\
+ "xchg %rsi, %rbx \n\t" \
+ "cpuid \n\t" \
+ "movl %ebx, %edi \n\t" \
+ "xchg %rsi, %rbx \n\t" \
+ : "=a" (ax), "=D" (bx), "=c" (cx), "=d" (dx) \
+ : "a" (func));
+#else
+#define cpuid(func,ax,bx,cx,dx)\
+ asm volatile (\
+ "pushl %ebx \n\t" \
+ "cpuid \n\t" \
+ "movl %ebx, %edi \n\t" \
+ "popl %ebx \n\t" \
+ : "=a" (ax), "=D" (bx), "=c" (cx), "=d" (dx) \
+ : "a" (func));
+#endif
#else
#if ARCH_X86_64
void __cpuid(int CPUInfo[4], int info_type);
#pragma intrinsic(__cpuid)
#define cpuid(func,a,b,c,d) do{\
int regs[4];\
__cpuid(regs,func); a=regs[0]; b=regs[1]; c=regs[2]; d=regs[3];\
} while(0)
@@ -131,29 +151,36 @@ unsigned __int64 __rdtsc(void);
#endif
static unsigned int
x86_readtsc(void)
{
#if defined(__GNUC__) && __GNUC__
unsigned int tsc;
__asm__ __volatile__("rdtsc\n\t":"=a"(tsc):);
return tsc;
+#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+ unsigned int tsc;
+ asm volatile("rdtsc\n\t":"=a"(tsc):);
+ return tsc;
#else
#if ARCH_X86_64
return __rdtsc();
#else
__asm rdtsc;
#endif
#endif
}
#if defined(__GNUC__) && __GNUC__
#define x86_pause_hint()\
__asm__ __volatile__ ("pause \n\t")
+#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+#define x86_pause_hint()\
+ asm volatile ("pause \n\t")
#else
#if ARCH_X86_64
#define x86_pause_hint()\
_mm_pause();
#else
#define x86_pause_hint()\
__asm pause
#endif
@@ -167,16 +194,29 @@ x87_set_control_word(unsigned short mode
}
static unsigned short
x87_get_control_word(void)
{
unsigned short mode;
__asm__ __volatile__("fstcw %0\n\t":"=m"(*&mode):);
return mode;
}
+#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+static void
+x87_set_control_word(unsigned short mode)
+{
+ asm volatile("fldcw %0" : : "m"(*&mode));
+}
+static unsigned short
+x87_get_control_word(void)
+{
+ unsigned short mode;
+ asm volatile("fstcw %0\n\t":"=m"(*&mode):);
+ return mode;
+}
#elif ARCH_X86_64
/* No fldcw intrinsics on Windows x64, punt to external asm */
extern void vpx_winx64_fldcw(unsigned short mode);
extern unsigned short vpx_winx64_fstcw(void);
#define x87_set_control_word vpx_winx64_fldcw
#define x87_get_control_word vpx_winx64_fstcw
#else
static void

Просмотреть файл

@ -1,5 +1,3 @@
diff --git a/media/libvpx/stdint.patch b/media/libvpx/stdint.patch
new file mode 100644
diff --git a/media/libvpx/vpx/vpx_integer.h b/media/libvpx/vpx/vpx_integer.h
--- a/media/libvpx/vpx/vpx_integer.h
+++ b/media/libvpx/vpx/vpx_integer.h

Просмотреть файл

@ -1,164 +0,0 @@
# HG changeset patch
# Parent f7a8c8a419870421138438970a0514e79353ae34
# User Timothy B. Terriberry <tterribe@vt.edu>
Bug 730903 - Fix text relocations in libvpx variance functions.
diff --git a/media/libvpx/vp8/common/arm/neon/vp8_subpixelvariance16x16_neon.asm b/media/libvpx/vp8/common/arm/neon/vp8_subpixelvariance16x16_neon.asm
--- a/media/libvpx/vp8/common/arm/neon/vp8_subpixelvariance16x16_neon.asm
+++ b/media/libvpx/vp8/common/arm/neon/vp8_subpixelvariance16x16_neon.asm
@@ -4,16 +4,21 @@
; 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.
;
+bilinear_taps_coeff
+ DCD 128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
+
+;-----------------
+
EXPORT |vp8_sub_pixel_variance16x16_neon_func|
ARM
REQUIRE8
PRESERVE8
AREA ||.text||, CODE, READONLY, ALIGN=2
; r0 unsigned char *src_ptr,
; r1 int src_pixels_per_line,
@@ -22,17 +27,17 @@
; stack(r4) unsigned char *dst_ptr,
; stack(r5) int dst_pixels_per_line,
; stack(r6) unsigned int *sse
;note: most of the code is copied from bilinear_predict16x16_neon and vp8_variance16x16_neon.
|vp8_sub_pixel_variance16x16_neon_func| PROC
push {r4-r6, lr}
- ldr r12, _BilinearTaps_coeff_
+ adr r12, bilinear_taps_coeff
ldr r4, [sp, #16] ;load *dst_ptr from stack
ldr r5, [sp, #20] ;load dst_pixels_per_line from stack
ldr r6, [sp, #24] ;load *sse from stack
cmp r2, #0 ;skip first_pass filter if xoffset=0
beq secondpass_bfilter16x16_only
add r2, r12, r2, lsl #3 ;calculate filter location
@@ -410,16 +415,9 @@ sub_pixel_variance16x16_neon_loop
add sp, sp, #528
vmov.32 r0, d0[0] ;return
pop {r4-r6,pc}
ENDP
-;-----------------
-
-_BilinearTaps_coeff_
- DCD bilinear_taps_coeff
-bilinear_taps_coeff
- DCD 128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
-
END
diff --git a/media/libvpx/vp8/common/arm/neon/vp8_subpixelvariance8x8_neon.asm b/media/libvpx/vp8/common/arm/neon/vp8_subpixelvariance8x8_neon.asm
--- a/media/libvpx/vp8/common/arm/neon/vp8_subpixelvariance8x8_neon.asm
+++ b/media/libvpx/vp8/common/arm/neon/vp8_subpixelvariance8x8_neon.asm
@@ -22,17 +22,17 @@
; stack(r4) unsigned char *dst_ptr,
; stack(r5) int dst_pixels_per_line,
; stack(r6) unsigned int *sse
;note: most of the code is copied from bilinear_predict8x8_neon and vp8_variance8x8_neon.
|vp8_sub_pixel_variance8x8_neon| PROC
push {r4-r5, lr}
- ldr r12, _BilinearTaps_coeff_
+ adr r12, bilinear_taps_coeff
ldr r4, [sp, #12] ;load *dst_ptr from stack
ldr r5, [sp, #16] ;load dst_pixels_per_line from stack
ldr lr, [sp, #20] ;load *sse from stack
cmp r2, #0 ;skip first_pass filter if xoffset=0
beq skip_firstpass_filter
;First pass: output_height lines x output_width columns (9x8)
@@ -211,14 +211,12 @@ sub_pixel_variance8x8_neon_loop
vmov.32 r0, d0[0] ;return
pop {r4-r5, pc}
ENDP
;-----------------
-_BilinearTaps_coeff_
- DCD bilinear_taps_coeff
bilinear_taps_coeff
DCD 128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
END
diff --git a/media/libvpx/vp8/encoder/arm/neon/fastquantizeb_neon.asm b/media/libvpx/vp8/encoder/arm/neon/fastquantizeb_neon.asm
--- a/media/libvpx/vp8/encoder/arm/neon/fastquantizeb_neon.asm
+++ b/media/libvpx/vp8/encoder/arm/neon/fastquantizeb_neon.asm
@@ -93,17 +93,17 @@
vsub.s16 q10, q12 ; x2=(y^sz)-sz = (y^sz)-(-1) (2's complement)
vsub.s16 q11, q13
ldr r6, [r3, #vp8_blockd_qcoeff]
vmul.s16 q2, q6, q4 ; x * Dequant
vmul.s16 q3, q7, q5
- ldr r0, _inv_zig_zag_ ; load ptr of inverse zigzag table
+ adr r0, inv_zig_zag ; load ptr of inverse zigzag table
vceq.s16 q8, q8 ; set q8 to all 1
vst1.s16 {q10, q11}, [r6] ; store: qcoeff = x2
vmul.s16 q12, q6, q10 ; x2 * Dequant
vmul.s16 q13, q7, q11
@@ -176,17 +176,17 @@
vshr.s16 q3, q1, #15
vld1.s16 {q14, q15}, [r5@128]; load round_ptr [0-15]
vld1.s16 {q8, q9}, [r4@128] ; load quant_ptr [0-15]
vadd.s16 q12, q14 ; x + Round
vadd.s16 q13, q15
- ldr r0, _inv_zig_zag_ ; load ptr of inverse zigzag table
+ adr r0, inv_zig_zag ; load ptr of inverse zigzag table
vqdmulh.s16 q12, q8 ; y = ((Round+abs(z)) * Quant) >> 16
vqdmulh.s16 q13, q9
vld1.16 {q10, q11}, [r0@128]; load inverse scan order
vceq.s16 q8, q8 ; set q8 to all 1
@@ -242,19 +242,16 @@ zero_output
vst1.s16 {q0, q1}, [r7@128] ; dqcoeff = 0
ldmfd sp!, {r4-r7}
bx lr
ENDP
; default inverse zigzag table is defined in vp8/common/entropy.c
-_inv_zig_zag_
- DCD inv_zig_zag
-
ALIGN 16 ; enable use of @128 bit aligned loads
inv_zig_zag
DCW 0x0001, 0x0002, 0x0006, 0x0007
DCW 0x0003, 0x0005, 0x0008, 0x000d
DCW 0x0004, 0x0009, 0x000c, 0x000e
DCW 0x000a, 0x000b, 0x000f, 0x0010
END

Просмотреть файл

@ -2,248 +2,40 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
set -e
PLATFORMS='
x86-win32-vs8
x86_64-win64-vs8
x86-linux-gcc
x86_64-linux-gcc
generic-gnu
x86-darwin9-gcc
x86_64-darwin9-gcc
armv7-android-gcc
'
if [ $# -lt 1 ]; then
echo Usage: update.sh /path/to/libvpx/
echo The libvpx dir must contain a directory "objdir" with the following directories configured in it:
echo * objdir/x86-win32-vs8
echo * objdir/x86-linux-gcc
echo * objdir/generic-gnu
echo * objdir/x86-darwin9-gcc
echo * objdir/x86_64-darwin9-gcc
echo * objdir/armv7-linux-gcc
echo You can configure these from objdir/$target with the following command:
echo $ ../../configure --target=$target --disable-vp8-encoder --disable-examples --disable-install-docs
echo On Mac, you also need --enable-pic
for target in ${PLATFORMS}; do
echo -e " * objdir/${target}"
done
echo You can configure these from objdir/\$target with the following command:
echo $ ../../configure --target=\$target --disable-examples --disable-install-docs
echo For Android you need --sdk-path=/path/to/android-ndk-r\$REV
echo For Mac, you also need --enable-pic
exit -1
fi
# These are relative to SDK source dir.
commonFiles=(
vp8/vp8_cx_iface.c
vp8/vp8_dx_iface.c
LICENSE
PATENTS
build/make/ads2gas.pl
build/make/obj_int_extract.c
vp8/common/alloccommon.c
vp8/common/asm_com_offsets.c
vp8/common/blockd.c
vp8/common/debugmodes.c
vp8/common/dequantize.c
vp8/common/entropy.c
vp8/common/entropymode.c
vp8/common/entropymv.c
vp8/common/extend.c
vp8/common/filter.c
vp8/common/findnearmv.c
vp8/common/idct_blk.c
vp8/common/idctllm.c
vp8/common/loopfilter.c
vp8/common/loopfilter_filters.c
vp8/common/mbpitch.c
vp8/common/modecont.c
vp8/common/modecontext.c
vp8/common/postproc.c
vp8/common/quant_common.c
vp8/common/reconinter.c
vp8/common/reconintra.c
vp8/common/reconintra4x4.c
vp8/common/setupintrarecon.c
vp8/common/swapyv12buffer.c
vp8/common/treecoder.c
vp8/common/arm/arm_systemdependent.c
vp8/common/arm/bilinearfilter_arm.c
vp8/common/arm/dequantize_arm.c
vp8/common/arm/filter_arm.c
vp8/common/arm/loopfilter_arm.c
vp8/common/arm/reconintra_arm.c
vp8/common/arm/armv6/idct_blk_v6.c
vp8/common/arm/neon/idct_blk_neon.c
vp8/common/generic/systemdependent.c
vp8/common/x86/filter_x86.c
vp8/common/x86/idct_blk_mmx.c
vp8/common/x86/idct_blk_sse2.c
vp8/common/x86/loopfilter_x86.c
vp8/common/x86/recon_wrapper_sse2.c
vp8/common/x86/vp8_asm_stubs.c
vp8/common/x86/x86_systemdependent.c
vp8/decoder/asm_dec_offsets.c
vp8/decoder/dboolhuff.c
vp8/decoder/decodemv.c
vp8/decoder/decodframe.c
vp8/decoder/detokenize.c
vp8/decoder/error_concealment.c
vp8/decoder/onyxd_if.c
vp8/decoder/reconintra_mt.c
vp8/decoder/threading.c
vp8/decoder/arm/arm_dsystemdependent.c
vp8/decoder/generic/dsystemdependent.c
vp8/decoder/x86/x86_dsystemdependent.c
vp8/encoder/asm_enc_offsets.c
vp8/encoder/bitstream.c
vp8/encoder/boolhuff.c
vp8/encoder/dct.c
vp8/encoder/encodeframe.c
vp8/encoder/encodeintra.c
vp8/encoder/encodemb.c
vp8/encoder/encodemv.c
vp8/encoder/ethreading.c
vp8/encoder/firstpass.c
vp8/encoder/lookahead.c
vp8/encoder/mcomp.c
vp8/encoder/modecosts.c
vp8/encoder/mr_dissim.c
vp8/encoder/onyx_if.c
vp8/encoder/pickinter.c
vp8/encoder/picklpf.c
vp8/encoder/psnr.c
vp8/encoder/quantize.c
vp8/encoder/ratectrl.c
vp8/encoder/rdopt.c
vp8/encoder/sad_c.c
vp8/encoder/segmentation.c
vp8/encoder/temporal_filter.c
vp8/encoder/tokenize.c
vp8/encoder/treewriter.c
vp8/encoder/variance_c.c
vp8/encoder/arm/arm_csystemdependent.c
vp8/encoder/arm/boolhuff_arm.c
vp8/encoder/arm/dct_arm.c
vp8/encoder/arm/quantize_arm.c
vp8/encoder/arm/variance_arm.c
vp8/encoder/arm/neon/picklpf_arm.c
vp8/encoder/generic/csystemdependent.c
vp8/encoder/x86/variance_mmx.c
vp8/encoder/x86/variance_sse2.c
vp8/encoder/x86/variance_ssse3.c
vp8/encoder/x86/x86_csystemdependent.c
vpx/src/vpx_codec.c
vpx/src/vpx_decoder.c
vpx/src/vpx_decoder_compat.c
vpx/src/vpx_encoder.c
vpx/src/vpx_image.c
vpx_mem/vpx_mem.c
vpx_ports/arm_cpudetect.c
vpx_scale/arm/neon/yv12extend_arm.c
vpx_scale/generic/gen_scalers.c
vpx_scale/generic/scalesystemdependent.c
vpx_scale/generic/vpxscale.c
vpx_scale/generic/yv12config.c
vpx_scale/generic/yv12extend.c
vp8/common/alloccommon.h
vp8/common/blockd.h
vp8/common/coefupdateprobs.h
vp8/common/common.h
vp8/common/default_coef_probs.h
vp8/common/dequantize.h
vp8/common/entropy.h
vp8/common/entropymode.h
vp8/common/entropymv.h
vp8/common/extend.h
vp8/common/filter.h
vp8/common/findnearmv.h
vp8/common/header.h
vp8/common/idct.h
vp8/common/invtrans.h
vp8/common/loopfilter.h
vp8/common/modecont.h
vp8/common/mv.h
vp8/common/onyx.h
vp8/common/onyxc_int.h
vp8/common/onyxd.h
vp8/common/postproc.h
vp8/common/ppflags.h
vp8/common/pragmas.h
vp8/common/quant_common.h
vp8/common/recon.h
vp8/common/reconinter.h
vp8/common/reconintra.h
vp8/common/reconintra4x4.h
vp8/common/setupintrarecon.h
vp8/common/subpixel.h
vp8/common/swapyv12buffer.h
vp8/common/systemdependent.h
vp8/common/threading.h
vp8/common/treecoder.h
vp8/common/arm/bilinearfilter_arm.h
vp8/common/arm/dequantize_arm.h
vp8/common/arm/idct_arm.h
vp8/common/arm/loopfilter_arm.h
vp8/common/arm/recon_arm.h
vp8/common/arm/subpixel_arm.h
vp8/common/x86/dequantize_x86.h
vp8/common/x86/filter_x86.h
vp8/common/x86/idct_x86.h
vp8/common/x86/loopfilter_x86.h
vp8/common/x86/postproc_x86.h
vp8/common/x86/recon_x86.h
vp8/common/x86/subpixel_x86.h
vp8/decoder/dboolhuff.h
vp8/decoder/decodemv.h
vp8/decoder/decoderthreading.h
vp8/decoder/detokenize.h
vp8/decoder/ec_types.h
vp8/decoder/error_concealment.h
vp8/decoder/onyxd_int.h
vp8/decoder/reconintra_mt.h
vp8/decoder/treereader.h
vp8/encoder/bitstream.h
vp8/encoder/block.h
vp8/encoder/boolhuff.h
vp8/encoder/dct.h
vp8/encoder/defaultcoefcounts.h
vp8/encoder/encodeintra.h
vp8/encoder/encodemb.h
vp8/encoder/encodemv.h
vp8/encoder/firstpass.h
vp8/encoder/lookahead.h
vp8/encoder/mcomp.h
vp8/encoder/modecosts.h
vp8/encoder/mr_dissim.h
vp8/encoder/onyx_int.h
vp8/encoder/pickinter.h
vp8/encoder/psnr.h
vp8/encoder/quantize.h
vp8/encoder/ratectrl.h
vp8/encoder/rdopt.h
vp8/encoder/segmentation.h
vp8/encoder/temporal_filter.h
vp8/encoder/tokenize.h
vp8/encoder/treewriter.h
vp8/encoder/variance.h
vp8/encoder/arm/dct_arm.h
vp8/encoder/arm/encodemb_arm.h
vp8/encoder/arm/quantize_arm.h
vp8/encoder/arm/variance_arm.h
vp8/encoder/x86/dct_x86.h
vp8/encoder/x86/encodemb_x86.h
vp8/encoder/x86/mcomp_x86.h
vp8/encoder/x86/quantize_x86.h
vp8/encoder/x86/temporal_filter_x86.h
vp8/encoder/x86/variance_x86.h
vpx/internal/vpx_codec_internal.h
vpx/vp8cx.h
vpx/vp8dx.h
vpx/vp8e.h
vpx/vp8.h
vpx/vpx_codec.h
vpx/vpx_codec_impl_bottom.h
vpx/vpx_codec_impl_top.h
vpx/vpx_decoder_compat.h
vpx/vpx_decoder.h
vpx/vpx_encoder.h
vpx/vpx_image.h
vpx/vpx_integer.h
vpx_mem/include/vpx_mem_intrnl.h
vpx_mem/vpx_mem.h
vpx_ports/arm.h
vpx_ports/asm_offsets.h
vpx_ports/mem.h
vpx_ports/vpx_timer.h
vpx_ports/x86.h
vpx_scale/scale_mode.h
vpx_scale/vpxscale.h
vpx_scale/yv12config.h
vpx_scale/yv12extend.h
vpx_scale/arm/yv12extend_arm.h
vpx_scale/generic/yv12extend_generic.h
vp8/common/arm/armv6/bilinearfilter_v6.asm
vp8/common/arm/armv6/copymem16x16_v6.asm
vp8/common/arm/armv6/copymem8x4_v6.asm
@ -251,14 +43,25 @@ commonFiles=(
vp8/common/arm/armv6/dc_only_idct_add_v6.asm
vp8/common/arm/armv6/dequant_idct_v6.asm
vp8/common/arm/armv6/dequantize_v6.asm
vp8/common/arm/armv6/iwalsh_v6.asm
vp8/common/arm/armv6/filter_v6.asm
vp8/common/arm/armv6/idct_blk_v6.c
vp8/common/arm/armv6/idct_v6.asm
vp8/common/arm/armv6/intra4x4_predict_v6.asm
vp8/common/arm/armv6/iwalsh_v6.asm
vp8/common/arm/armv6/loopfilter_v6.asm
vp8/common/arm/armv6/simpleloopfilter_v6.asm
vp8/common/arm/armv6/sixtappredict8x4_v6.asm
vp8/common/arm/armv6/vp8_sad16x16_armv6.asm
vp8/common/arm/armv6/vp8_variance16x16_armv6.asm
vp8/common/arm/armv6/vp8_variance8x8_armv6.asm
vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm
vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm
vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm
vp8/common/arm/bilinearfilter_arm.c
vp8/common/arm/bilinearfilter_arm.h
vp8/common/arm/dequantize_arm.c
vp8/common/arm/filter_arm.c
vp8/common/arm/loopfilter_arm.c
vp8/common/arm/neon/bilinearpredict16x16_neon.asm
vp8/common/arm/neon/bilinearpredict4x4_neon.asm
vp8/common/arm/neon/bilinearpredict8x4_neon.asm
@ -270,6 +73,7 @@ commonFiles=(
vp8/common/arm/neon/dc_only_idct_add_neon.asm
vp8/common/arm/neon/dequant_idct_neon.asm
vp8/common/arm/neon/dequantizeb_neon.asm
vp8/common/arm/neon/idct_blk_neon.c
vp8/common/arm/neon/idct_dequant_0_2x_neon.asm
vp8/common/arm/neon/idct_dequant_full_2x_neon.asm
vp8/common/arm/neon/iwalsh_neon.asm
@ -277,13 +81,85 @@ commonFiles=(
vp8/common/arm/neon/loopfiltersimplehorizontaledge_neon.asm
vp8/common/arm/neon/loopfiltersimpleverticaledge_neon.asm
vp8/common/arm/neon/mbloopfilter_neon.asm
vp8/common/arm/neon/save_neon_reg.asm
vp8/common/arm/neon/sad16_neon.asm
vp8/common/arm/neon/sad8_neon.asm
vp8/common/arm/neon/save_reg_neon.asm
vp8/common/arm/neon/shortidct4x4llm_neon.asm
vp8/common/arm/neon/sixtappredict16x16_neon.asm
vp8/common/arm/neon/sixtappredict4x4_neon.asm
vp8/common/arm/neon/sixtappredict8x4_neon.asm
vp8/common/arm/neon/sixtappredict8x8_neon.asm
vp8/common/arm/neon/variance_neon.asm
vp8/common/arm/neon/vp8_subpixelvariance16x16_neon.asm
vp8/common/arm/neon/vp8_subpixelvariance16x16s_neon.asm
vp8/common/arm/neon/vp8_subpixelvariance8x8_neon.asm
vp8/common/arm/reconintra_arm.c
vp8/common/arm/variance_arm.c
vp8/common/asm_com_offsets.c
vp8/common/blockd.c
vp8/common/blockd.h
vp8/common/coefupdateprobs.h
vp8/common/common.h
vp8/common/debugmodes.c
vp8/common/default_coef_probs.h
vp8/common/dequantize.c
vp8/common/entropy.c
vp8/common/entropy.h
vp8/common/entropymode.c
vp8/common/entropymode.h
vp8/common/entropymv.c
vp8/common/entropymv.h
vp8/common/extend.c
vp8/common/extend.h
vp8/common/filter.c
vp8/common/filter.h
vp8/common/findnearmv.c
vp8/common/findnearmv.h
vp8/common/generic/systemdependent.c
vp8/common/header.h
vp8/common/idct_blk.c
vp8/common/idctllm.c
vp8/common/invtrans.h
vp8/common/loopfilter.c
vp8/common/loopfilter.h
vp8/common/loopfilter_filters.c
vp8/common/mbpitch.c
vp8/common/mfqe.c
vp8/common/modecont.c
vp8/common/modecont.h
vp8/common/mv.h
vp8/common/onyx.h
vp8/common/onyxc_int.h
vp8/common/onyxd.h
vp8/common/postproc.c
vp8/common/postproc.h
vp8/common/ppflags.h
vp8/common/pragmas.h
vp8/common/quant_common.c
vp8/common/quant_common.h
vp8/common/reconinter.c
vp8/common/reconinter.h
vp8/common/reconintra.c
vp8/common/reconintra4x4.c
vp8/common/reconintra4x4.h
vp8/common/rtcd.c
vp8/common/sad_c.c
vp8/common/setupintrarecon.c
vp8/common/setupintrarecon.h
vp8/common/swapyv12buffer.c
vp8/common/swapyv12buffer.h
vp8/common/systemdependent.h
vp8/common/threading.h
vp8/common/treecoder.c
vp8/common/treecoder.h
vp8/common/variance.h
vp8/common/variance_c.c
vp8/common/vp8_entropymodedata.h
vp8/common/x86/dequantize_mmx.asm
vp8/common/x86/filter_x86.c
vp8/common/x86/filter_x86.h
vp8/common/x86/idct_blk_mmx.c
vp8/common/x86/idct_blk_sse2.c
vp8/common/x86/idctllm_mmx.asm
vp8/common/x86/idctllm_sse2.asm
vp8/common/x86/iwalsh_mmx.asm
@ -291,105 +167,189 @@ commonFiles=(
vp8/common/x86/loopfilter_block_sse2.asm
vp8/common/x86/loopfilter_mmx.asm
vp8/common/x86/loopfilter_sse2.asm
vp8/common/x86/loopfilter_x86.c
vp8/common/x86/mfqe_sse2.asm
vp8/common/x86/postproc_mmx.asm
vp8/common/x86/postproc_sse2.asm
vp8/common/x86/postproc_x86.c
vp8/common/x86/recon_mmx.asm
vp8/common/x86/recon_sse2.asm
vp8/common/x86/recon_wrapper_sse2.c
vp8/common/x86/sad_mmx.asm
vp8/common/x86/sad_sse2.asm
vp8/common/x86/sad_sse3.asm
vp8/common/x86/sad_sse4.asm
vp8/common/x86/sad_ssse3.asm
vp8/common/x86/subpixel_mmx.asm
vp8/common/x86/subpixel_sse2.asm
vp8/common/x86/subpixel_ssse3.asm
vp8/common/x86/variance_impl_mmx.asm
vp8/common/x86/variance_impl_sse2.asm
vp8/common/x86/variance_impl_ssse3.asm
vp8/common/x86/variance_mmx.c
vp8/common/x86/variance_sse2.c
vp8/common/x86/variance_ssse3.c
vp8/common/x86/vp8_asm_stubs.c
vp8/decoder/asm_dec_offsets.c
vp8/decoder/dboolhuff.c
vp8/decoder/dboolhuff.h
vp8/decoder/decodemv.c
vp8/decoder/decodemv.h
vp8/decoder/decoderthreading.h
vp8/decoder/decodframe.c
vp8/decoder/detokenize.c
vp8/decoder/detokenize.h
vp8/decoder/ec_types.h
vp8/decoder/error_concealment.c
vp8/decoder/error_concealment.h
vp8/decoder/onyxd_if.c
vp8/decoder/onyxd_int.h
vp8/decoder/threading.c
vp8/decoder/treereader.h
vp8/encoder/arm/armv5te/boolhuff_armv5te.asm
vp8/encoder/arm/armv5te/vp8_packtokens_armv5.asm
vp8/encoder/arm/armv5te/vp8_packtokens_mbrow_armv5.asm
vp8/encoder/arm/armv5te/vp8_packtokens_partitions_armv5.asm
vp8/encoder/arm/armv6/vp8_fast_quantize_b_armv6.asm
vp8/encoder/arm/armv6/vp8_mse16x16_armv6.asm
vp8/encoder/arm/armv6/vp8_sad16x16_armv6.asm
vp8/encoder/arm/armv6/vp8_short_fdct4x4_armv6.asm
vp8/encoder/arm/armv6/vp8_subtract_armv6.asm
vp8/encoder/arm/armv6/vp8_variance16x16_armv6.asm
vp8/encoder/arm/armv6/vp8_variance8x8_armv6.asm
vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm
vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm
vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm
vp8/encoder/arm/armv6/walsh_v6.asm
vp8/encoder/arm/boolhuff_arm.c
vp8/encoder/arm/dct_arm.c
vp8/encoder/arm/neon/fastquantizeb_neon.asm
vp8/encoder/arm/neon/sad16_neon.asm
vp8/encoder/arm/neon/sad8_neon.asm
vp8/encoder/arm/neon/picklpf_arm.c
vp8/encoder/arm/neon/shortfdct_neon.asm
vp8/encoder/arm/neon/subtract_neon.asm
vp8/encoder/arm/neon/variance_neon.asm
vp8/encoder/arm/neon/vp8_memcpy_neon.asm
vp8/encoder/arm/neon/vp8_mse16x16_neon.asm
vp8/encoder/arm/neon/vp8_shortwalsh4x4_neon.asm
vp8/encoder/arm/neon/vp8_subpixelvariance16x16_neon.asm
vp8/encoder/arm/neon/vp8_subpixelvariance16x16s_neon.asm
vp8/encoder/arm/neon/vp8_subpixelvariance8x8_neon.asm
vp8/encoder/arm/quantize_arm.c
vp8/encoder/asm_enc_offsets.c
vp8/encoder/bitstream.c
vp8/encoder/bitstream.h
vp8/encoder/block.h
vp8/encoder/boolhuff.c
vp8/encoder/boolhuff.h
vp8/encoder/dct.c
vp8/encoder/dct_value_cost.h
vp8/encoder/dct_value_tokens.h
vp8/encoder/defaultcoefcounts.h
vp8/encoder/denoising.c
vp8/encoder/denoising.h
vp8/encoder/encodeframe.c
vp8/encoder/encodeframe.h
vp8/encoder/encodeintra.c
vp8/encoder/encodeintra.h
vp8/encoder/encodemb.c
vp8/encoder/encodemb.h
vp8/encoder/encodemv.c
vp8/encoder/encodemv.h
vp8/encoder/ethreading.c
vp8/encoder/firstpass.c
vp8/encoder/firstpass.h
vp8/encoder/lookahead.c
vp8/encoder/lookahead.h
vp8/encoder/mcomp.c
vp8/encoder/mcomp.h
vp8/encoder/modecosts.c
vp8/encoder/modecosts.h
vp8/encoder/mr_dissim.c
vp8/encoder/mr_dissim.h
vp8/encoder/onyx_if.c
vp8/encoder/onyx_int.h
vp8/encoder/pickinter.c
vp8/encoder/pickinter.h
vp8/encoder/picklpf.c
vp8/encoder/psnr.c
vp8/encoder/psnr.h
vp8/encoder/quantize.c
vp8/encoder/quantize.h
vp8/encoder/ratectrl.c
vp8/encoder/ratectrl.h
vp8/encoder/rdopt.c
vp8/encoder/rdopt.h
vp8/encoder/segmentation.c
vp8/encoder/segmentation.h
vp8/encoder/temporal_filter.c
vp8/encoder/tokenize.c
vp8/encoder/tokenize.h
vp8/encoder/treewriter.c
vp8/encoder/treewriter.h
vp8/encoder/x86/dct_mmx.asm
vp8/encoder/x86/dct_sse2.asm
vp8/encoder/x86/denoising_sse2.c
vp8/encoder/x86/encodeopt.asm
vp8/encoder/x86/fwalsh_sse2.asm
vp8/encoder/x86/quantize_mmx.asm
vp8/encoder/x86/quantize_sse2.asm
vp8/encoder/x86/quantize_ssse3.asm
vp8/encoder/x86/quantize_sse4.asm
vp8/encoder/x86/sad_mmx.asm
vp8/encoder/x86/sad_sse2.asm
vp8/encoder/x86/sad_sse3.asm
vp8/encoder/x86/sad_ssse3.asm
vp8/encoder/x86/sad_sse4.asm
vp8/encoder/x86/quantize_ssse3.asm
vp8/encoder/x86/ssim_opt.asm
vp8/encoder/x86/subtract_mmx.asm
vp8/encoder/x86/subtract_sse2.asm
vp8/encoder/x86/temporal_filter_apply_sse2.asm
vp8/encoder/x86/variance_impl_mmx.asm
vp8/encoder/x86/variance_impl_sse2.asm
vp8/encoder/x86/variance_impl_ssse3.asm
vp8/encoder/x86/vp8_enc_stubs_mmx.c
vp8/encoder/x86/vp8_enc_stubs_sse2.c
vp8/vp8_cx_iface.c
vp8/vp8_dx_iface.c
vpx/internal/vpx_codec_internal.h
vpx/src/vpx_codec.c
vpx/src/vpx_decoder.c
vpx/src/vpx_encoder.c
vpx/src/vpx_image.c
vpx/vp8.h
vpx/vp8cx.h
vpx/vp8dx.h
vpx/vpx_codec.h
vpx/vpx_codec_impl_bottom.h
vpx/vpx_codec_impl_top.h
vpx/vpx_decoder.h
vpx/vpx_encoder.h
vpx/vpx_image.h
vpx/vpx_integer.h
vpx_mem/include/vpx_mem_intrnl.h
vpx_mem/include/vpx_mem_tracker.h
vpx_mem/vpx_mem.c
vpx_mem/vpx_mem.h
vpx_ports/arm.h
vpx_ports/arm_cpudetect.c
vpx_ports/asm_offsets.h
vpx_ports/emms.asm
vpx_ports/mem.h
vpx_ports/mem_ops.h
vpx_ports/mem_ops_aligned.h
vpx_ports/vpx_timer.h
vpx_ports/vpxtypes.h
vpx_ports/x86.h
vpx_ports/x86_abi_support.asm
vpx_ports/x86_cpuid.c
vpx_scale/arm/neon/vp8_vpxyv12_copy_y_neon.asm
vpx_scale/arm/neon/vp8_vpxyv12_copyframe_func_neon.asm
vpx_scale/arm/neon/vp8_vpxyv12_copysrcframe_func_neon.asm
vpx_scale/arm/neon/vp8_vpxyv12_extendframeborders_neon.asm
build/make/ads2gas.pl
build/make/obj_int_extract.c
LICENSE
PATENTS
vpx_scale/arm/neon/yv12extend_arm.c
vpx_scale/generic/gen_scalers.c
vpx_scale/generic/vpxscale.c
vpx_scale/generic/yv12config.c
vpx_scale/generic/yv12extend.c
vpx_scale/generic/yv12extend_generic.h
vpx_scale/include/generic/vpxscale_arbitrary.h
vpx_scale/include/generic/vpxscale_depricated.h
vpx_scale/scale_mode.h
vpx_scale/vpxscale.h
vpx_scale/yv12config.h
)
# configure files specific to x86-win32-vs8
cp $1/objdir/x86-win32-vs8/vpx_config.c vpx_config_x86-win32-vs8.c
cp $1/objdir/x86-win32-vs8/vpx_config.asm vpx_config_x86-win32-vs8.asm
cp $1/objdir/x86-win32-vs8/vpx_config.h vpx_config_x86-win32-vs8.h
# Copy configuration files for each platform
for target in ${PLATFORMS}; do
cp ${1}/objdir/${target}/vpx_config.h vpx_config_${target}.h
cp ${1}/objdir/${target}/vpx_config.c vpx_config_${target}.c
cp ${1}/objdir/${target}/vpx_rtcd.h vpx_rtcd_${target}.h
done
# Should be same for all platforms...
cp $1/objdir/x86-win32-vs8/vpx_version.h vpx_version.h
# Config files for x86-linux-gcc and other x86 elf platforms
cp $1/objdir/x86-linux-gcc/vpx_config.c vpx_config_x86-linux-gcc.c
cp $1/objdir/x86-linux-gcc/vpx_config.asm vpx_config_x86-linux-gcc.asm
cp $1/objdir/x86-linux-gcc/vpx_config.h vpx_config_x86-linux-gcc.h
# Config files for x86_64-linux-gcc and other x86_64 elf platforms
cp $1/objdir/x86_64-linux-gcc/vpx_config.c vpx_config_x86_64-linux-gcc.c
cp $1/objdir/x86_64-linux-gcc/vpx_config.asm vpx_config_x86_64-linux-gcc.asm
cp $1/objdir/x86_64-linux-gcc/vpx_config.h vpx_config_x86_64-linux-gcc.h
# Copy config files for mac...
cp $1/objdir/x86-darwin9-gcc/vpx_config.c vpx_config_x86-darwin9-gcc.c
cp $1/objdir/x86-darwin9-gcc/vpx_config.asm vpx_config_x86-darwin9-gcc.asm
cp $1/objdir/x86-darwin9-gcc/vpx_config.h vpx_config_x86-darwin9-gcc.h
# Copy config files for Mac64
cp $1/objdir/x86_64-darwin9-gcc/vpx_config.c vpx_config_x86_64-darwin9-gcc.c
cp $1/objdir/x86_64-darwin9-gcc/vpx_config.asm vpx_config_x86_64-darwin9-gcc.asm
cp $1/objdir/x86_64-darwin9-gcc/vpx_config.h vpx_config_x86_64-darwin9-gcc.h
# Config files for arm-linux-gcc
cp $1/objdir/armv7-linux-gcc/vpx_config.c vpx_config_arm-linux-gcc.c
cp $1/objdir/armv7-linux-gcc/vpx_config.h vpx_config_arm-linux-gcc.h
# Config files for generic-gnu
cp $1/objdir/generic-gnu/vpx_config.c vpx_config_generic-gnu.c
cp $1/objdir/generic-gnu/vpx_config.h vpx_config_generic-gnu.h
# Copy vpx_version.h from one of the build targets
cp ${1}/objdir/x86-linux-gcc/vpx_version.h vpx_version.h
# Copy common source files into mozilla tree.
for f in ${commonFiles[@]}
@ -398,86 +358,5 @@ do
cp -v $1/$f $f
done
# This has to be renamed because there's already a scalesystemdependent.c in
# vpx_scale/generic/
cp -v $1/vpx_scale/arm/scalesystemdependent.c \
vpx_scale/arm/arm_scalesystemdependent.c
# Upstream patch to fix variance overflow.
patch -p3 < I1bad27ea.patch
# Upstream patch to remove __inline for compiler compatibility.
patch -p3 < I6f2b218d.patch
# Patch to move SAD and variance functions to common (based on an upstream
# patch).
patch -p3 < I256a37c6.patch
# These get moved by I256a37c6.patch above, but patch won't do the actual move
# for us.
encoderMovedFiles=(
vp8/encoder/sad_c.c
vp8/encoder/variance_c.c
vp8/encoder/arm/variance_arm.c
vp8/encoder/x86/variance_mmx.c
vp8/encoder/x86/variance_sse2.c
vp8/encoder/x86/variance_ssse3.c
vp8/encoder/variance.h
vp8/encoder/arm/variance_arm.h
vp8/encoder/x86/variance_x86.h
vp8/encoder/arm/armv6/vp8_mse16x16_armv6.asm
vp8/encoder/arm/armv6/vp8_sad16x16_armv6.asm
vp8/encoder/arm/armv6/vp8_variance16x16_armv6.asm
vp8/encoder/arm/armv6/vp8_variance8x8_armv6.asm
vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm
vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm
vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm
vp8/encoder/arm/neon/sad16_neon.asm
vp8/encoder/arm/neon/sad8_neon.asm
vp8/encoder/arm/neon/variance_neon.asm
vp8/encoder/arm/neon/vp8_mse16x16_neon.asm
vp8/encoder/arm/neon/vp8_subpixelvariance16x16_neon.asm
vp8/encoder/arm/neon/vp8_subpixelvariance16x16s_neon.asm
vp8/encoder/arm/neon/vp8_subpixelvariance8x8_neon.asm
vp8/encoder/x86/sad_mmx.asm
vp8/encoder/x86/sad_sse2.asm
vp8/encoder/x86/sad_sse3.asm
vp8/encoder/x86/sad_ssse3.asm
vp8/encoder/x86/sad_sse4.asm
vp8/encoder/x86/variance_impl_mmx.asm
vp8/encoder/x86/variance_impl_sse2.asm
vp8/encoder/x86/variance_impl_ssse3.asm
)
# Move encoder source files into the common tree.
for f in ${encoderMovedFiles[@]}
do
mv -v $f ${f/encoder/common}
done
# Patch to fix text relocations in the variance functions.
patch -p3 < textrels.patch
# Patch to use VARIANCE_INVOKE in multiframe_quality_enhance_block().
patch -p3 < variance-invoke.patch
# Upstream patch to fix potential use of uninitialized rate_y.
patch -p3 < I8a35831e.patch
# Upstream patch to reset segmentation map on keyframes.
patch -p3 < I9713c9f0.patch
# Upstream patch to support Android x86 NDK build.
patch -p3 < I42ab00e3.patch
# Upstream patch to align internal mfqe framebuffer dimensions.
patch -p3 < I3915d597.patch
# Patch to compile with Sun Studio on Solaris
patch -p3 < solaris.patch
# Patch to fix errors including C headers in C++
patch -p3 < compile_errors.patch
# Patch to permit vpx users to specify their own <stdint.h> types.
patch -p3 < stdint.patch

Просмотреть файл

@ -1,144 +0,0 @@
# HG changeset patch
# Parent 4c655dd10f74c0782893d34f660e50b36494c88b
# User Timothy B. Terriberry <tterribe@vt.edu>
Bug 730907 - Use VARIANCE_INVOKE in multiframe_quality_enhance_block()
diff -r 4c655dd10f74 media/libvpx/vp8/common/postproc.c
--- a/media/libvpx/vp8/common/postproc.c Mon Jul 09 05:46:16 2012 -0700
+++ b/media/libvpx/vp8/common/postproc.c Mon Jul 09 06:23:11 2012 -0700
@@ -706,17 +706,18 @@ static void multiframe_quality_enhance_b
unsigned char *u,
unsigned char *v,
int y_stride,
int uv_stride,
unsigned char *yd,
unsigned char *ud,
unsigned char *vd,
int yd_stride,
- int uvd_stride
+ int uvd_stride,
+ vp8_variance_rtcd_vtable_t *rtcd
)
{
static const unsigned char VP8_ZEROS[16]=
{
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
};
int blksizeby2 = blksize >> 1;
int qdiff = qcurr - qprev;
@@ -727,28 +728,28 @@ static void multiframe_quality_enhance_b
unsigned char *up;
unsigned char *udp;
unsigned char *vp;
unsigned char *vdp;
unsigned int act, sse, sad, thr;
if (blksize == 16)
{
- act = (vp8_variance_var16x16(yd, yd_stride, VP8_ZEROS, 0, &sse)+128)>>8;
- sad = (vp8_variance_sad16x16(y, y_stride, yd, yd_stride, 0)+128)>>8;
+ act = (VARIANCE_INVOKE(rtcd, var16x16)(yd, yd_stride, VP8_ZEROS, 0, &sse)+128)>>8;
+ sad = (VARIANCE_INVOKE(rtcd, sad16x16)(y, y_stride, yd, yd_stride, 0)+128)>>8;
}
else if (blksize == 8)
{
- act = (vp8_variance_var8x8(yd, yd_stride, VP8_ZEROS, 0, &sse)+32)>>6;
- sad = (vp8_variance_sad8x8(y, y_stride, yd, yd_stride, 0)+32)>>6;
+ act = (VARIANCE_INVOKE(rtcd, var8x8)(yd, yd_stride, VP8_ZEROS, 0, &sse)+32)>>6;
+ sad = (VARIANCE_INVOKE(rtcd, sad8x8)(y, y_stride, yd, yd_stride, 0)+32)>>6;
}
else
{
- act = (vp8_variance_var4x4(yd, yd_stride, VP8_ZEROS, 0, &sse)+8)>>4;
- sad = (vp8_variance_sad4x4(y, y_stride, yd, yd_stride, 0)+8)>>4;
+ act = (VARIANCE_INVOKE(rtcd, var4x4)(yd, yd_stride, VP8_ZEROS, 0, &sse)+8)>>4;
+ sad = (VARIANCE_INVOKE(rtcd, sad4x4)(y, y_stride, yd, yd_stride, 0)+8)>>4;
}
/* thr = qdiff/8 + log2(act) + log4(qprev) */
thr = (qdiff>>3);
while (act>>=1) thr++;
while (qprev>>=2) thr++;
if (sad < thr)
{
static const int roundoff = (1 << (MFQE_PRECISION - 1));
@@ -800,18 +801,20 @@ static void multiframe_quality_enhance_b
for (vp = v, vdp = vd, i = 0; i < blksizeby2; ++i, vp += uv_stride, vdp += uvd_stride)
vpx_memcpy(vdp, vp, blksizeby2);
}
}
}
#if CONFIG_RUNTIME_CPU_DETECT
#define RTCD_VTABLE(oci) (&(oci)->rtcd.postproc)
+#define RTCD_VARIANCE(oci) (&(oci)->rtcd.variance)
#else
#define RTCD_VTABLE(oci) NULL
+#define RTCD_VARIANCE(oci) NULL
#endif
void vp8_multiframe_quality_enhance
(
VP8_COMMON *cm
)
{
YV12_BUFFER_CONFIG *show = cm->frame_to_show;
@@ -859,33 +862,35 @@ void vp8_multiframe_quality_enhance
u_ptr + 4*(i*show->uv_stride+j),
v_ptr + 4*(i*show->uv_stride+j),
show->y_stride,
show->uv_stride,
yd_ptr + 8*(i*dest->y_stride+j),
ud_ptr + 4*(i*dest->uv_stride+j),
vd_ptr + 4*(i*dest->uv_stride+j),
dest->y_stride,
- dest->uv_stride);
+ dest->uv_stride,
+ RTCD_VARIANCE(cm));
}
else
{
multiframe_quality_enhance_block(16,
qcurr,
qprev,
y_ptr,
u_ptr,
v_ptr,
show->y_stride,
show->uv_stride,
yd_ptr,
ud_ptr,
vd_ptr,
dest->y_stride,
- dest->uv_stride);
+ dest->uv_stride,
+ RTCD_VARIANCE(cm));
}
}
else
{
vp8_recon_copy16x16(y_ptr, show->y_stride, yd_ptr, dest->y_stride);
vp8_recon_copy8x8(u_ptr, show->uv_stride, ud_ptr, dest->uv_stride);
vp8_recon_copy8x8(v_ptr, show->uv_stride, vd_ptr, dest->uv_stride);
diff -r 4c655dd10f74 media/libvpx/vp8/encoder/pickinter.c
--- a/media/libvpx/vp8/encoder/pickinter.c Mon Jul 09 05:46:16 2012 -0700
+++ b/media/libvpx/vp8/encoder/pickinter.c Mon Jul 09 06:23:11 2012 -0700
@@ -127,17 +127,17 @@ static int pick_intra4x4block(
for (mode = B_DC_PRED; mode <= B_HE_PRED /*B_HU_PRED*/; mode++)
{
int this_rd;
rate = mode_costs[mode];
RECON_INVOKE(&rtcd->common->recon, intra4x4_predict)
(*(b->base_dst) + b->dst, b->dst_stride,
mode, b->predictor, 16);
- distortion = get_prediction_error(be, b, &rtcd->common->variance);
+ distortion = get_prediction_error(be, b, IF_RTCD(&rtcd->common->variance));
this_rd = RDCOST(x->rdmult, x->rddiv, rate, distortion);
if (this_rd < best_rd)
{
*bestrate = rate;
*bestdistortion = distortion;
best_rd = this_rd;
*best_mode = mode;

Просмотреть файл

@ -17,43 +17,31 @@
#include "entropymode.h"
#include "systemdependent.h"
extern void vp8_init_scan_order_mask();
static void update_mode_info_border(MODE_INFO *mi, int rows, int cols)
{
int i;
vpx_memset(mi - cols - 2, 0, sizeof(MODE_INFO) * (cols + 1));
for (i = 0; i < rows; i++)
{
/* TODO(holmer): Bug? This updates the last element of each row
* rather than the border element!
*/
vpx_memset(&mi[i*cols-1], 0, sizeof(MODE_INFO));
}
}
void vp8_de_alloc_frame_buffers(VP8_COMMON *oci)
{
int i;
for (i = 0; i < NUM_YV12_BUFFERS; i++)
vp8_yv12_de_alloc_frame_buffer(&oci->yv12_fb[i]);
vp8_yv12_de_alloc_frame_buffer(&oci->temp_scale_frame);
#if CONFIG_POSTPROC
vp8_yv12_de_alloc_frame_buffer(&oci->post_proc_buffer);
if (oci->post_proc_buffer_int_used)
vp8_yv12_de_alloc_frame_buffer(&oci->post_proc_buffer_int);
vpx_free(oci->pp_limits_buffer);
oci->pp_limits_buffer = NULL;
#endif
vpx_free(oci->above_context);
vpx_free(oci->mip);
#if CONFIG_ERROR_CONCEALMENT
vpx_free(oci->prev_mip);
oci->prev_mip = NULL;
#endif
oci->above_context = 0;
oci->mip = 0;
oci->prev_mip = 0;
oci->above_context = NULL;
oci->mip = NULL;
}
int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height)
@ -75,10 +63,7 @@ int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height)
oci->fb_idx_ref_cnt[i] = 0;
oci->yv12_fb[i].flags = 0;
if (vp8_yv12_alloc_frame_buffer(&oci->yv12_fb[i], width, height, VP8BORDERINPIXELS) < 0)
{
vp8_de_alloc_frame_buffers(oci);
return 1;
}
goto allocation_fail;
}
oci->new_fb_idx = 0;
@ -92,18 +77,7 @@ int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height)
oci->fb_idx_ref_cnt[3] = 1;
if (vp8_yv12_alloc_frame_buffer(&oci->temp_scale_frame, width, 16, VP8BORDERINPIXELS) < 0)
{
vp8_de_alloc_frame_buffers(oci);
return 1;
}
if (vp8_yv12_alloc_frame_buffer(&oci->post_proc_buffer, width, height, VP8BORDERINPIXELS) < 0)
{
vp8_de_alloc_frame_buffers(oci);
return 1;
}
oci->post_proc_buffer_int_used = 0;
goto allocation_fail;
oci->mb_rows = height >> 4;
oci->mb_cols = width >> 4;
@ -112,44 +86,43 @@ int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height)
oci->mip = vpx_calloc((oci->mb_cols + 1) * (oci->mb_rows + 1), sizeof(MODE_INFO));
if (!oci->mip)
{
vp8_de_alloc_frame_buffers(oci);
return 1;
}
goto allocation_fail;
oci->mi = oci->mip + oci->mode_info_stride + 1;
/* allocate memory for last frame MODE_INFO array */
#if CONFIG_ERROR_CONCEALMENT
oci->prev_mip = vpx_calloc((oci->mb_cols + 1) * (oci->mb_rows + 1), sizeof(MODE_INFO));
if (!oci->prev_mip)
{
vp8_de_alloc_frame_buffers(oci);
return 1;
}
oci->prev_mi = oci->prev_mip + oci->mode_info_stride + 1;
#else
oci->prev_mip = NULL;
oci->prev_mi = NULL;
#endif
/* Allocation of previous mode info will be done in vp8_decode_frame()
* as it is a decoder only data */
oci->above_context = vpx_calloc(sizeof(ENTROPY_CONTEXT_PLANES) * oci->mb_cols, 1);
if (!oci->above_context)
{
vp8_de_alloc_frame_buffers(oci);
return 1;
}
goto allocation_fail;
update_mode_info_border(oci->mi, oci->mb_rows, oci->mb_cols);
#if CONFIG_ERROR_CONCEALMENT
update_mode_info_border(oci->prev_mi, oci->mb_rows, oci->mb_cols);
#if CONFIG_POSTPROC
if (vp8_yv12_alloc_frame_buffer(&oci->post_proc_buffer, width, height, VP8BORDERINPIXELS) < 0)
goto allocation_fail;
oci->post_proc_buffer_int_used = 0;
vpx_memset(&oci->postproc_state, 0, sizeof(oci->postproc_state));
vpx_memset(oci->post_proc_buffer.buffer_alloc, 128,
oci->post_proc_buffer.frame_size);
/* Allocate buffer to store post-processing filter coefficients.
*
* Note: Round up mb_cols to support SIMD reads
*/
oci->pp_limits_buffer = vpx_memalign(16, 24 * ((oci->mb_cols + 1) & ~1));
if (!oci->pp_limits_buffer)
goto allocation_fail;
#endif
return 0;
allocation_fail:
vp8_de_alloc_frame_buffers(oci);
return 1;
}
void vp8_setup_version(VP8_COMMON *cm)
{
switch (cm->version)
@ -203,7 +176,7 @@ void vp8_create_common(VP8_COMMON *oci)
oci->clr_type = REG_YUV;
oci->clamp_type = RECON_CLAMP_REQUIRED;
/* Initialise reference frame sign bias structure to defaults */
/* Initialize reference frame sign bias structure to defaults */
vpx_memset(oci->ref_frame_sign_bias, 0, sizeof(oci->ref_frame_sign_bias));
/* Default disable buffer to buffer copying */
@ -215,13 +188,3 @@ void vp8_remove_common(VP8_COMMON *oci)
{
vp8_de_alloc_frame_buffers(oci);
}
void vp8_initialize_common()
{
vp8_coef_tree_initialize();
vp8_entropy_mode_init();
vp8_init_scan_order_mask();
}

Просмотреть файл

@ -1,166 +0,0 @@
/*
* Copyright (c) 2010 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.
*/
#include "vpx_config.h"
#include "vpx_ports/arm.h"
#include "vp8/common/pragmas.h"
#include "vp8/common/subpixel.h"
#include "vp8/common/loopfilter.h"
#include "vp8/common/recon.h"
#include "vp8/common/idct.h"
#include "vp8/common/variance.h"
#include "vp8/common/onyxc_int.h"
void vp8_arch_arm_common_init(VP8_COMMON *ctx)
{
#if CONFIG_RUNTIME_CPU_DETECT
VP8_COMMON_RTCD *rtcd = &ctx->rtcd;
int flags = arm_cpu_caps();
rtcd->flags = flags;
/* Override default functions with fastest ones for this CPU. */
#if HAVE_ARMV5TE
if (flags & HAS_EDSP)
{
}
#endif
#if HAVE_ARMV6
if (flags & HAS_MEDIA)
{
rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_armv6;
rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_armv6;
rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_armv6;
rtcd->subpix.sixtap4x4 = vp8_sixtap_predict_armv6;
rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_armv6;
rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_armv6;
rtcd->subpix.bilinear8x4 = vp8_bilinear_predict8x4_armv6;
rtcd->subpix.bilinear4x4 = vp8_bilinear_predict4x4_armv6;
rtcd->idct.idct16 = vp8_short_idct4x4llm_v6_dual;
rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_v6;
rtcd->loopfilter.normal_mb_v = vp8_loop_filter_mbv_armv6;
rtcd->loopfilter.normal_b_v = vp8_loop_filter_bv_armv6;
rtcd->loopfilter.normal_mb_h = vp8_loop_filter_mbh_armv6;
rtcd->loopfilter.normal_b_h = vp8_loop_filter_bh_armv6;
rtcd->loopfilter.simple_mb_v =
vp8_loop_filter_simple_vertical_edge_armv6;
rtcd->loopfilter.simple_b_v = vp8_loop_filter_bvs_armv6;
rtcd->loopfilter.simple_mb_h =
vp8_loop_filter_simple_horizontal_edge_armv6;
rtcd->loopfilter.simple_b_h = vp8_loop_filter_bhs_armv6;
rtcd->recon.copy16x16 = vp8_copy_mem16x16_v6;
rtcd->recon.copy8x8 = vp8_copy_mem8x8_v6;
rtcd->recon.copy8x4 = vp8_copy_mem8x4_v6;
rtcd->recon.intra4x4_predict = vp8_intra4x4_predict_armv6;
rtcd->dequant.block = vp8_dequantize_b_v6;
rtcd->dequant.idct_add = vp8_dequant_idct_add_v6;
rtcd->dequant.idct_add_y_block = vp8_dequant_idct_add_y_block_v6;
rtcd->dequant.idct_add_uv_block = vp8_dequant_idct_add_uv_block_v6;
rtcd->variance.sad16x16 = vp8_sad16x16_armv6;
/*rtcd->variance.sad16x8 = vp8_sad16x8_c;
rtcd->variance.sad8x16 = vp8_sad8x16_c;
rtcd->variance.sad8x8 = vp8_sad8x8_c;
rtcd->variance.sad4x4 = vp8_sad4x4_c;*/
/*rtcd->variance.var4x4 = vp8_variance4x4_c;*/
rtcd->variance.var8x8 = vp8_variance8x8_armv6;
/*rtcd->variance.var8x16 = vp8_variance8x16_c;
rtcd->variance.var16x8 = vp8_variance16x8_c;*/
rtcd->variance.var16x16 = vp8_variance16x16_armv6;
/*rtcd->variance.subpixvar4x4 = vp8_sub_pixel_variance4x4_c;*/
rtcd->variance.subpixvar8x8 = vp8_sub_pixel_variance8x8_armv6;
/*rtcd->variance.subpixvar8x16 = vp8_sub_pixel_variance8x16_c;
rtcd->variance.subpixvar16x8 = vp8_sub_pixel_variance16x8_c;*/
rtcd->variance.subpixvar16x16 = vp8_sub_pixel_variance16x16_armv6;
rtcd->variance.halfpixvar16x16_h = vp8_variance_halfpixvar16x16_h_armv6;
rtcd->variance.halfpixvar16x16_v = vp8_variance_halfpixvar16x16_v_armv6;
rtcd->variance.halfpixvar16x16_hv = vp8_variance_halfpixvar16x16_hv_armv6;
rtcd->variance.mse16x16 = vp8_mse16x16_armv6;
/*rtcd->variance.getmbss = vp8_get_mb_ss_c;*/
/*rtcd->variance.get4x4sse_cs = vp8_get4x4sse_cs_c;*/
}
#endif
#if HAVE_ARMV7
if (flags & HAS_NEON)
{
rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_neon;
rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_neon;
rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_neon;
rtcd->subpix.sixtap4x4 = vp8_sixtap_predict_neon;
rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_neon;
rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_neon;
rtcd->subpix.bilinear8x4 = vp8_bilinear_predict8x4_neon;
rtcd->subpix.bilinear4x4 = vp8_bilinear_predict4x4_neon;
rtcd->idct.idct16 = vp8_short_idct4x4llm_neon;
rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_neon;
rtcd->loopfilter.normal_mb_v = vp8_loop_filter_mbv_neon;
rtcd->loopfilter.normal_b_v = vp8_loop_filter_bv_neon;
rtcd->loopfilter.normal_mb_h = vp8_loop_filter_mbh_neon;
rtcd->loopfilter.normal_b_h = vp8_loop_filter_bh_neon;
rtcd->loopfilter.simple_mb_v = vp8_loop_filter_mbvs_neon;
rtcd->loopfilter.simple_b_v = vp8_loop_filter_bvs_neon;
rtcd->loopfilter.simple_mb_h = vp8_loop_filter_mbhs_neon;
rtcd->loopfilter.simple_b_h = vp8_loop_filter_bhs_neon;
rtcd->recon.copy16x16 = vp8_copy_mem16x16_neon;
rtcd->recon.copy8x8 = vp8_copy_mem8x8_neon;
rtcd->recon.copy8x4 = vp8_copy_mem8x4_neon;
rtcd->recon.build_intra_predictors_mby =
vp8_build_intra_predictors_mby_neon;
rtcd->recon.build_intra_predictors_mby_s =
vp8_build_intra_predictors_mby_s_neon;
rtcd->dequant.block = vp8_dequantize_b_neon;
rtcd->dequant.idct_add = vp8_dequant_idct_add_neon;
rtcd->dequant.idct_add_y_block = vp8_dequant_idct_add_y_block_neon;
rtcd->dequant.idct_add_uv_block = vp8_dequant_idct_add_uv_block_neon;
rtcd->variance.sad16x16 = vp8_sad16x16_neon;
rtcd->variance.sad16x8 = vp8_sad16x8_neon;
rtcd->variance.sad8x16 = vp8_sad8x16_neon;
rtcd->variance.sad8x8 = vp8_sad8x8_neon;
rtcd->variance.sad4x4 = vp8_sad4x4_neon;
/*rtcd->variance.var4x4 = vp8_variance4x4_c;*/
rtcd->variance.var8x8 = vp8_variance8x8_neon;
rtcd->variance.var8x16 = vp8_variance8x16_neon;
rtcd->variance.var16x8 = vp8_variance16x8_neon;
rtcd->variance.var16x16 = vp8_variance16x16_neon;
/*rtcd->variance.subpixvar4x4 = vp8_sub_pixel_variance4x4_c;*/
rtcd->variance.subpixvar8x8 = vp8_sub_pixel_variance8x8_neon;
/*rtcd->variance.subpixvar8x16 = vp8_sub_pixel_variance8x16_c;
rtcd->variance.subpixvar16x8 = vp8_sub_pixel_variance16x8_c;*/
rtcd->variance.subpixvar16x16 = vp8_sub_pixel_variance16x16_neon;
rtcd->variance.halfpixvar16x16_h = vp8_variance_halfpixvar16x16_h_neon;
rtcd->variance.halfpixvar16x16_v = vp8_variance_halfpixvar16x16_v_neon;
rtcd->variance.halfpixvar16x16_hv = vp8_variance_halfpixvar16x16_hv_neon;
rtcd->variance.mse16x16 = vp8_mse16x16_neon;
/*rtcd->variance.getmbss = vp8_get_mb_ss_c;*/
rtcd->variance.get4x4sse_cs = vp8_get4x4sse_cs_neon;
}
#endif
#endif
}

Просмотреть файл

@ -9,8 +9,7 @@
*/
#include "vpx_config.h"
#include "vp8/common/idct.h"
#include "vp8/common/dequantize.h"
#include "vpx_rtcd.h"
void vp8_dequant_idct_add_y_block_v6(short *q, short *dq,

Просмотреть файл

@ -18,15 +18,23 @@
AREA ||.text||, CODE, READONLY, ALIGN=2
;void vp8_intra4x4_predict(unsigned char *src, int src_stride, int b_mode,
; unsigned char *dst, int dst_stride)
;void vp8_intra4x4_predict_armv6(unsigned char *Above, unsigned char *yleft,
; B_PREDICTION_MODE left_stride, int b_mode,
; unsigned char *dst, int dst_stride,
; unsigned char top_left)
; r0: *Above
; r1: *yleft
; r2: left_stride
; r3: b_mode
; sp + #40: dst
; sp + #44: dst_stride
; sp + #48: top_left
|vp8_intra4x4_predict_armv6| PROC
push {r4-r12, lr}
cmp r2, #10
addlt pc, pc, r2, lsl #2 ; position independent switch
cmp r3, #10
addlt pc, pc, r3, lsl #2 ; position independent switch
pop {r4-r12, pc} ; default
b b_dc_pred
b b_tm_pred
@ -41,13 +49,13 @@
b_dc_pred
; load values
ldr r8, [r0, -r1] ; Above
ldrb r4, [r0, #-1]! ; Left[0]
ldr r8, [r0] ; Above
ldrb r4, [r1], r2 ; Left[0]
mov r9, #0
ldrb r5, [r0, r1] ; Left[1]
ldrb r6, [r0, r1, lsl #1]! ; Left[2]
ldrb r5, [r1], r2 ; Left[1]
ldrb r6, [r1], r2 ; Left[2]
usad8 r12, r8, r9
ldrb r7, [r0, r1] ; Left[3]
ldrb r7, [r1] ; Left[3]
; calculate dc
add r4, r4, r5
@ -55,31 +63,30 @@ b_dc_pred
add r4, r4, r7
add r4, r4, r12
add r4, r4, #4
ldr r0, [sp, #40] ; load stride
ldr r0, [sp, #44] ; dst_stride
mov r12, r4, asr #3 ; (expected_dc + 4) >> 3
add r12, r12, r12, lsl #8
add r3, r3, r0
ldr r3, [sp, #40] ; dst
add r12, r12, r12, lsl #16
; store values
str r12, [r3, -r0]
str r12, [r3], r0
str r12, [r3], r0
str r12, [r3], r0
str r12, [r3]
str r12, [r3, r0]
str r12, [r3, r0, lsl #1]
pop {r4-r12, pc}
b_tm_pred
sub r10, r0, #1 ; Left
ldr r8, [r0, -r1] ; Above
ldrb r9, [r10, -r1] ; top_left
ldrb r4, [r0, #-1]! ; Left[0]
ldrb r5, [r10, r1]! ; Left[1]
ldrb r6, [r0, r1, lsl #1] ; Left[2]
ldrb r7, [r10, r1, lsl #1] ; Left[3]
ldr r0, [sp, #40] ; load stride
ldr r8, [r0] ; Above
ldrb r9, [sp, #48] ; top_left
ldrb r4, [r1], r2 ; Left[0]
ldrb r5, [r1], r2 ; Left[1]
ldrb r6, [r1], r2 ; Left[2]
ldrb r7, [r1] ; Left[3]
ldr r0, [sp, #44] ; dst_stride
ldr r3, [sp, #40] ; dst
add r9, r9, r9, lsl #16 ; [tl|tl]
uxtb16 r10, r8 ; a[2|0]
@ -126,25 +133,26 @@ b_tm_pred
str r12, [r3], r0
add r12, r4, r5, lsl #8 ; [3|2|1|0]
str r12, [r3], r0
str r12, [r3]
pop {r4-r12, pc}
b_ve_pred
ldr r8, [r0, -r1]! ; a[3|2|1|0]
ldr r8, [r0] ; a[3|2|1|0]
ldr r11, c00FF00FF
ldrb r9, [r0, #-1] ; top_left
ldrb r9, [sp, #48] ; top_left
ldrb r10, [r0, #4] ; a[4]
ldr r0, c00020002
uxtb16 r4, r8 ; a[2|0]
uxtb16 r5, r8, ror #8 ; a[3|1]
ldr r2, [sp, #40] ; stride
ldr r2, [sp, #44] ; dst_stride
pkhbt r9, r9, r5, lsl #16 ; a[1|-1]
add r9, r9, r4, lsl #1 ;[a[1]+2*a[2] | tl+2*a[0] ]
uxtab16 r9, r9, r5 ;[a[1]+2*a[2]+a[3] | tl+2*a[0]+a[1] ]
ldr r3, [sp, #40] ; dst
uxtab16 r9, r9, r0 ;[a[1]+2*a[2]+a[3]+2| tl+2*a[0]+a[1]+2]
add r0, r0, r10, lsl #16 ;[a[4]+2 | 2]
@ -154,25 +162,23 @@ b_ve_pred
and r9, r11, r9, asr #2
and r4, r11, r4, asr #2
add r3, r3, r2 ; dst + dst_stride
add r9, r9, r4, lsl #8
; store values
str r9, [r3, -r2]
str r9, [r3], r2
str r9, [r3], r2
str r9, [r3], r2
str r9, [r3]
str r9, [r3, r2]
str r9, [r3, r2, lsl #1]
pop {r4-r12, pc}
b_he_pred
sub r10, r0, #1 ; Left
ldrb r4, [r0, #-1]! ; Left[0]
ldrb r8, [r10, -r1] ; top_left
ldrb r5, [r10, r1]! ; Left[1]
ldrb r6, [r0, r1, lsl #1] ; Left[2]
ldrb r7, [r10, r1, lsl #1] ; Left[3]
ldrb r4, [r1], r2 ; Left[0]
ldrb r8, [sp, #48] ; top_left
ldrb r5, [r1], r2 ; Left[1]
ldrb r6, [r1], r2 ; Left[2]
ldrb r7, [r1] ; Left[3]
add r8, r8, r4 ; tl + l[0]
add r9, r4, r5 ; l[0] + l[1]
@ -197,7 +203,8 @@ b_he_pred
pkhtb r10, r10, r10, asr #16 ; l[-|2|-|2]
pkhtb r11, r11, r11, asr #16 ; l[-|3|-|3]
ldr r0, [sp, #40] ; stride
ldr r0, [sp, #44] ; dst_stride
ldr r3, [sp, #40] ; dst
add r8, r8, r8, lsl #8 ; l[0|0|0|0]
add r9, r9, r9, lsl #8 ; l[1|1|1|1]
@ -206,16 +213,16 @@ b_he_pred
; store values
str r8, [r3], r0
str r9, [r3]
str r10, [r3, r0]
str r11, [r3, r0, lsl #1]
str r9, [r3], r0
str r10, [r3], r0
str r11, [r3]
pop {r4-r12, pc}
b_ld_pred
ldr r4, [r0, -r1]! ; Above
ldr r4, [r0] ; Above[0-3]
ldr r12, c00020002
ldr r5, [r0, #4]
ldr r5, [r0, #4] ; Above[4-7]
ldr lr, c00FF00FF
uxtb16 r6, r4 ; a[2|0]
@ -225,7 +232,6 @@ b_ld_pred
pkhtb r10, r6, r8 ; a[2|4]
pkhtb r11, r7, r9 ; a[3|5]
add r4, r6, r7, lsl #1 ; [a2+2*a3 | a0+2*a1]
add r4, r4, r10, ror #16 ; [a2+2*a3+a4 | a0+2*a1+a2]
uxtab16 r4, r4, r12 ; [a2+2*a3+a4+2 | a0+2*a1+a2+2]
@ -244,7 +250,8 @@ b_ld_pred
add r7, r7, r9, asr #16 ; [ a5+2*a6+a7]
uxtah r7, r7, r12 ; [ a5+2*a6+a7+2]
ldr r0, [sp, #40] ; stride
ldr r0, [sp, #44] ; dst_stride
ldr r3, [sp, #40] ; dst
; scale down
and r4, lr, r4, asr #2
@ -266,18 +273,17 @@ b_ld_pred
mov r6, r6, lsr #16
mov r11, r10, lsr #8
add r11, r11, r6, lsl #24 ; [6|5|4|3]
str r11, [r3], r0
str r11, [r3]
pop {r4-r12, pc}
b_rd_pred
sub r12, r0, r1 ; Above = src - src_stride
ldrb r7, [r0, #-1]! ; l[0] = pp[3]
ldr lr, [r12] ; Above = pp[8|7|6|5]
ldrb r8, [r12, #-1]! ; tl = pp[4]
ldrb r6, [r12, r1, lsl #1] ; l[1] = pp[2]
ldrb r5, [r0, r1, lsl #1] ; l[2] = pp[1]
ldrb r4, [r12, r1, lsl #2] ; l[3] = pp[0]
ldrb r7, [r1], r2 ; l[0] = pp[3]
ldr lr, [r0] ; Above = pp[8|7|6|5]
ldrb r8, [sp, #48] ; tl = pp[4]
ldrb r6, [r1], r2 ; l[1] = pp[2]
ldrb r5, [r1], r2 ; l[2] = pp[1]
ldrb r4, [r1], r2 ; l[3] = pp[0]
uxtb16 r9, lr ; p[7|5]
@ -307,7 +313,8 @@ b_rd_pred
add r7, r7, r10 ; [p6+2*p7+p8 | p4+2*p5+p6]
uxtab16 r7, r7, r12 ; [p6+2*p7+p8+2 | p4+2*p5+p6+2]
ldr r0, [sp, #40] ; stride
ldr r0, [sp, #44] ; dst_stride
ldr r3, [sp, #40] ; dst
; scale down
and r7, lr, r7, asr #2
@ -328,18 +335,17 @@ b_rd_pred
mov r11, r10, lsl #8 ; [3|2|1|-]
uxtab r11, r11, r4 ; [3|2|1|0]
str r11, [r3], r0
str r11, [r3]
pop {r4-r12, pc}
b_vr_pred
sub r12, r0, r1 ; Above = src - src_stride
ldrb r7, [r0, #-1]! ; l[0] = pp[3]
ldr lr, [r12] ; Above = pp[8|7|6|5]
ldrb r8, [r12, #-1]! ; tl = pp[4]
ldrb r6, [r12, r1, lsl #1] ; l[1] = pp[2]
ldrb r5, [r0, r1, lsl #1] ; l[2] = pp[1]
ldrb r4, [r12, r1, lsl #2] ; l[3] = pp[0]
ldrb r7, [r1], r2 ; l[0] = pp[3]
ldr lr, [r0] ; Above = pp[8|7|6|5]
ldrb r8, [sp, #48] ; tl = pp[4]
ldrb r6, [r1], r2 ; l[1] = pp[2]
ldrb r5, [r1], r2 ; l[2] = pp[1]
ldrb r4, [r1] ; l[3] = pp[0]
add r5, r5, r7, lsl #16 ; p[3|1]
add r6, r6, r8, lsl #16 ; p[4|2]
@ -376,7 +382,8 @@ b_vr_pred
add r8, r8, r10 ; [p6+2*p7+p8 | p4+2*p5+p6]
uxtab16 r8, r8, r12 ; [p6+2*p7+p8+2 | p4+2*p5+p6+2]
ldr r0, [sp, #40] ; stride
ldr r0, [sp, #44] ; dst_stride
ldr r3, [sp, #40] ; dst
; scale down
and r5, lr, r5, asr #2 ; [B|A]
@ -397,14 +404,14 @@ b_vr_pred
pkhtb r10, r7, r5, asr #16 ; [-|H|-|B]
str r2, [r3], r0
add r12, r12, r10, lsl #8 ; [H|D|B|A]
str r12, [r3], r0
str r12, [r3]
pop {r4-r12, pc}
b_vl_pred
ldr r4, [r0, -r1]! ; [3|2|1|0]
ldr r4, [r0] ; [3|2|1|0] = Above[0-3]
ldr r12, c00020002
ldr r5, [r0, #4] ; [7|6|5|4]
ldr r5, [r0, #4] ; [7|6|5|4] = Above[4-7]
ldr lr, c00FF00FF
ldr r2, c00010001
@ -441,7 +448,8 @@ b_vl_pred
add r9, r9, r11 ; [p5+2*p6+p7 | p3+2*p4+p5]
uxtab16 r9, r9, r12 ; [p5+2*p6+p7+2 | p3+2*p4+p5+2]
ldr r0, [sp, #40] ; stride
ldr r0, [sp, #44] ; dst_stride
ldr r3, [sp, #40] ; dst
; scale down
and r5, lr, r5, asr #2 ; [D|C]
@ -449,7 +457,6 @@ b_vl_pred
and r8, lr, r8, asr #2 ; [I|D]
and r9, lr, r9, asr #2 ; [J|H]
add r10, r4, r6, lsl #8 ; [F|B|E|A]
str r10, [r3], r0
@ -463,18 +470,17 @@ b_vl_pred
str r12, [r3], r0
add r10, r7, r10, lsl #8 ; [J|H|D|G]
str r10, [r3], r0
str r10, [r3]
pop {r4-r12, pc}
b_hd_pred
sub r12, r0, r1 ; Above = src - src_stride
ldrb r7, [r0, #-1]! ; l[0] = pp[3]
ldr lr, [r12] ; Above = pp[8|7|6|5]
ldrb r8, [r12, #-1]! ; tl = pp[4]
ldrb r6, [r0, r1] ; l[1] = pp[2]
ldrb r5, [r0, r1, lsl #1] ; l[2] = pp[1]
ldrb r4, [r12, r1, lsl #2] ; l[3] = pp[0]
ldrb r7, [r1], r2 ; l[0] = pp[3]
ldr lr, [r0] ; Above = pp[8|7|6|5]
ldrb r8, [sp, #48] ; tl = pp[4]
ldrb r6, [r1], r2 ; l[1] = pp[2]
ldrb r5, [r1], r2 ; l[2] = pp[1]
ldrb r4, [r1] ; l[3] = pp[0]
uxtb16 r9, lr ; p[7|5]
uxtb16 r10, lr, ror #8 ; p[8|6]
@ -492,7 +498,6 @@ b_hd_pred
pkhtb r1, r9, r10 ; p[7|6]
pkhbt r10, r8, r10, lsl #16 ; p[6|5]
uadd16 r11, r4, r5 ; [p1+p2 | p0+p1]
uhadd16 r11, r11, r2 ; [(p1+p2+1)>>1 | (p0+p1+1)>>1]
; [B|A]
@ -518,7 +523,8 @@ b_hd_pred
and r5, lr, r5, asr #2 ; [H|G]
and r6, lr, r6, asr #2 ; [J|I]
ldr lr, [sp, #40] ; stride
ldr lr, [sp, #44] ; dst_stride
ldr r3, [sp, #40] ; dst
pkhtb r2, r0, r6 ; [-|F|-|I]
pkhtb r12, r6, r5, asr #16 ; [-|J|-|H]
@ -527,7 +533,6 @@ b_hd_pred
mov r12, r12, ror #24 ; [J|I|H|F]
str r12, [r3], lr
mov r7, r11, asr #16 ; [-|-|-|B]
str r2, [r3], lr
add r7, r7, r0, lsl #16 ; [-|E|-|B]
@ -536,21 +541,20 @@ b_hd_pred
str r7, [r3], lr
add r5, r11, r4, lsl #8 ; [D|B|C|A]
str r5, [r3], lr
str r5, [r3]
pop {r4-r12, pc}
b_hu_pred
ldrb r4, [r0, #-1]! ; Left[0]
ldrb r4, [r1], r2 ; Left[0]
ldr r12, c00020002
ldrb r5, [r0, r1]! ; Left[1]
ldrb r5, [r1], r2 ; Left[1]
ldr lr, c00FF00FF
ldrb r6, [r0, r1]! ; Left[2]
ldrb r6, [r1], r2 ; Left[2]
ldr r2, c00010001
ldrb r7, [r0, r1] ; Left[3]
ldrb r7, [r1] ; Left[3]
add r4, r4, r5, lsl #16 ; [1|0]
add r5, r5, r6, lsl #16 ; [2|1]
@ -563,7 +567,8 @@ b_hu_pred
add r4, r4, r5, lsl #1 ; [p1+2*p2 | p0+2*p1]
add r4, r4, r9 ; [p1+2*p2+p3 | p0+2*p1+p2]
uxtab16 r4, r4, r12 ; [p1+2*p2+p3+2 | p0+2*p1+p2+2]
ldr r2, [sp, #40] ; stride
ldr r2, [sp, #44] ; dst_stride
ldr r3, [sp, #40] ; dst
and r4, lr, r4, asr #2 ; [D|C]
add r10, r6, r7 ; [p2+p3]
@ -587,9 +592,9 @@ b_hu_pred
add r10, r11, lsl #8 ; [-|-|F|E]
add r10, r10, r9, lsl #16 ; [G|G|F|E]
str r10, [r3]
str r10, [r3], r2
str r7, [r3, r2]
str r7, [r3]
pop {r4-r12, pc}

Просмотреть файл

@ -8,10 +8,10 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include <math.h>
#include "vp8/common/filter.h"
#include "vp8/common/subpixel.h"
#include "bilinearfilter_arm.h"
void vp8_filter_block2d_bil_armv6

Просмотреть файл

@ -10,18 +10,17 @@
#include "vpx_config.h"
#include "vp8/common/dequantize.h"
#include "vp8/common/idct.h"
#include "vp8/common/blockd.h"
#if HAVE_ARMV7
#if HAVE_NEON
extern void vp8_dequantize_b_loop_neon(short *Q, short *DQC, short *DQ);
#endif
#if HAVE_ARMV6
#if HAVE_MEDIA
extern void vp8_dequantize_b_loop_v6(short *Q, short *DQC, short *DQ);
#endif
#if HAVE_ARMV7
#if HAVE_NEON
void vp8_dequantize_b_neon(BLOCKD *d, short *DQC)
{
@ -32,7 +31,7 @@ void vp8_dequantize_b_neon(BLOCKD *d, short *DQC)
}
#endif
#if HAVE_ARMV6
#if HAVE_MEDIA
void vp8_dequantize_b_v6(BLOCKD *d, short *DQC)
{
short *DQ = d->dqcoeff;

Просмотреть файл

@ -1,59 +0,0 @@
/*
* Copyright (c) 2010 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.
*/
#ifndef DEQUANTIZE_ARM_H
#define DEQUANTIZE_ARM_H
#if HAVE_ARMV6
extern prototype_dequant_block(vp8_dequantize_b_v6);
extern prototype_dequant_idct_add(vp8_dequant_idct_add_v6);
extern prototype_dequant_idct_add_y_block(vp8_dequant_idct_add_y_block_v6);
extern prototype_dequant_idct_add_uv_block(vp8_dequant_idct_add_uv_block_v6);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_dequant_block
#define vp8_dequant_block vp8_dequantize_b_v6
#undef vp8_dequant_idct_add
#define vp8_dequant_idct_add vp8_dequant_idct_add_v6
#undef vp8_dequant_idct_add_y_block
#define vp8_dequant_idct_add_y_block vp8_dequant_idct_add_y_block_v6
#undef vp8_dequant_idct_add_uv_block
#define vp8_dequant_idct_add_uv_block vp8_dequant_idct_add_uv_block_v6
#endif
#endif
#if HAVE_ARMV7
extern prototype_dequant_block(vp8_dequantize_b_neon);
extern prototype_dequant_idct_add(vp8_dequant_idct_add_neon);
extern prototype_dequant_idct_add_y_block(vp8_dequant_idct_add_y_block_neon);
extern prototype_dequant_idct_add_uv_block(vp8_dequant_idct_add_uv_block_neon);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_dequant_block
#define vp8_dequant_block vp8_dequantize_b_neon
#undef vp8_dequant_idct_add
#define vp8_dequant_idct_add vp8_dequant_idct_add_neon
#undef vp8_dequant_idct_add_y_block
#define vp8_dequant_idct_add_y_block vp8_dequant_idct_add_y_block_neon
#undef vp8_dequant_idct_add_uv_block
#define vp8_dequant_idct_add_uv_block vp8_dequant_idct_add_uv_block_neon
#endif
#endif
#endif

Просмотреть файл

@ -10,9 +10,9 @@
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include <math.h>
#include "vp8/common/filter.h"
#include "vp8/common/subpixel.h"
#include "vpx_ports/mem.h"
extern void vp8_filter_block2d_first_pass_armv6
@ -86,8 +86,8 @@ extern void vp8_filter_block2d_second_pass_only_armv6
const short *vp8_filter
);
#if HAVE_ARMV6
void vp8_sixtap_predict_armv6
#if HAVE_MEDIA
void vp8_sixtap_predict4x4_armv6
(
unsigned char *src_ptr,
int src_pixels_per_line,

Просмотреть файл

@ -1,51 +0,0 @@
/*
* Copyright (c) 2010 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.
*/
#ifndef IDCT_ARM_H
#define IDCT_ARM_H
#if HAVE_ARMV6
extern prototype_idct(vp8_short_idct4x4llm_v6_dual);
extern prototype_idct_scalar_add(vp8_dc_only_idct_add_v6);
extern prototype_second_order(vp8_short_inv_walsh4x4_1_v6);
extern prototype_second_order(vp8_short_inv_walsh4x4_v6);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_idct_idct16
#define vp8_idct_idct16 vp8_short_idct4x4llm_v6_dual
#undef vp8_idct_idct1_scalar_add
#define vp8_idct_idct1_scalar_add vp8_dc_only_idct_add_v6
#undef vp8_idct_iwalsh16
#define vp8_idct_iwalsh16 vp8_short_inv_walsh4x4_v6
#endif
#endif
#if HAVE_ARMV7
extern prototype_idct(vp8_short_idct4x4llm_neon);
extern prototype_idct_scalar_add(vp8_dc_only_idct_add_neon);
extern prototype_second_order(vp8_short_inv_walsh4x4_1_neon);
extern prototype_second_order(vp8_short_inv_walsh4x4_neon);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_idct_idct16
#define vp8_idct_idct16 vp8_short_idct4x4llm_neon
#undef vp8_idct_idct1_scalar_add
#define vp8_idct_idct1_scalar_add vp8_dc_only_idct_add_neon
#undef vp8_idct_iwalsh16
#define vp8_idct_iwalsh16 vp8_short_inv_walsh4x4_neon
#endif
#endif
#endif

Просмотреть файл

@ -10,17 +10,22 @@
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8/common/loopfilter.h"
#include "vp8/common/onyxc_int.h"
#if HAVE_ARMV6
#define prototype_loopfilter(sym) \
void sym(unsigned char *src, int pitch, const unsigned char *blimit,\
const unsigned char *limit, const unsigned char *thresh, int count)
#if HAVE_MEDIA
extern prototype_loopfilter(vp8_loop_filter_horizontal_edge_armv6);
extern prototype_loopfilter(vp8_loop_filter_vertical_edge_armv6);
extern prototype_loopfilter(vp8_mbloop_filter_horizontal_edge_armv6);
extern prototype_loopfilter(vp8_mbloop_filter_vertical_edge_armv6);
#endif
#if HAVE_ARMV7
#if HAVE_NEON
typedef void loopfilter_y_neon(unsigned char *src, int pitch,
unsigned char blimit, unsigned char limit, unsigned char thresh);
typedef void loopfilter_uv_neon(unsigned char *u, int pitch,
@ -38,8 +43,8 @@ extern loopfilter_uv_neon vp8_mbloop_filter_horizontal_edge_uv_neon;
extern loopfilter_uv_neon vp8_mbloop_filter_vertical_edge_uv_neon;
#endif
#if HAVE_ARMV6
/*ARMV6 loopfilter functions*/
#if HAVE_MEDIA
/* ARMV6/MEDIA loopfilter functions*/
/* Horizontal MB filtering */
void vp8_loop_filter_mbh_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi)
@ -113,7 +118,7 @@ void vp8_loop_filter_bvs_armv6(unsigned char *y_ptr, int y_stride,
}
#endif
#if HAVE_ARMV7
#if HAVE_NEON
/* NEON loopfilter functions */
/* Horizontal MB filtering */
void vp8_loop_filter_mbh_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,

Просмотреть файл

@ -1,93 +0,0 @@
/*
* Copyright (c) 2010 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.
*/
#ifndef LOOPFILTER_ARM_H
#define LOOPFILTER_ARM_H
#include "vpx_config.h"
#if HAVE_ARMV6
extern prototype_loopfilter_block(vp8_loop_filter_mbv_armv6);
extern prototype_loopfilter_block(vp8_loop_filter_bv_armv6);
extern prototype_loopfilter_block(vp8_loop_filter_mbh_armv6);
extern prototype_loopfilter_block(vp8_loop_filter_bh_armv6);
extern prototype_simple_loopfilter(vp8_loop_filter_bvs_armv6);
extern prototype_simple_loopfilter(vp8_loop_filter_bhs_armv6);
extern prototype_simple_loopfilter(vp8_loop_filter_simple_horizontal_edge_armv6);
extern prototype_simple_loopfilter(vp8_loop_filter_simple_vertical_edge_armv6);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_lf_normal_mb_v
#define vp8_lf_normal_mb_v vp8_loop_filter_mbv_armv6
#undef vp8_lf_normal_b_v
#define vp8_lf_normal_b_v vp8_loop_filter_bv_armv6
#undef vp8_lf_normal_mb_h
#define vp8_lf_normal_mb_h vp8_loop_filter_mbh_armv6
#undef vp8_lf_normal_b_h
#define vp8_lf_normal_b_h vp8_loop_filter_bh_armv6
#undef vp8_lf_simple_mb_v
#define vp8_lf_simple_mb_v vp8_loop_filter_simple_vertical_edge_armv6
#undef vp8_lf_simple_b_v
#define vp8_lf_simple_b_v vp8_loop_filter_bvs_armv6
#undef vp8_lf_simple_mb_h
#define vp8_lf_simple_mb_h vp8_loop_filter_simple_horizontal_edge_armv6
#undef vp8_lf_simple_b_h
#define vp8_lf_simple_b_h vp8_loop_filter_bhs_armv6
#endif /* !CONFIG_RUNTIME_CPU_DETECT */
#endif /* HAVE_ARMV6 */
#if HAVE_ARMV7
extern prototype_loopfilter_block(vp8_loop_filter_mbv_neon);
extern prototype_loopfilter_block(vp8_loop_filter_bv_neon);
extern prototype_loopfilter_block(vp8_loop_filter_mbh_neon);
extern prototype_loopfilter_block(vp8_loop_filter_bh_neon);
extern prototype_simple_loopfilter(vp8_loop_filter_mbvs_neon);
extern prototype_simple_loopfilter(vp8_loop_filter_bvs_neon);
extern prototype_simple_loopfilter(vp8_loop_filter_mbhs_neon);
extern prototype_simple_loopfilter(vp8_loop_filter_bhs_neon);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_lf_normal_mb_v
#define vp8_lf_normal_mb_v vp8_loop_filter_mbv_neon
#undef vp8_lf_normal_b_v
#define vp8_lf_normal_b_v vp8_loop_filter_bv_neon
#undef vp8_lf_normal_mb_h
#define vp8_lf_normal_mb_h vp8_loop_filter_mbh_neon
#undef vp8_lf_normal_b_h
#define vp8_lf_normal_b_h vp8_loop_filter_bh_neon
#undef vp8_lf_simple_mb_v
#define vp8_lf_simple_mb_v vp8_loop_filter_mbvs_neon
#undef vp8_lf_simple_b_v
#define vp8_lf_simple_b_v vp8_loop_filter_bvs_neon
#undef vp8_lf_simple_mb_h
#define vp8_lf_simple_mb_h vp8_loop_filter_mbhs_neon
#undef vp8_lf_simple_b_h
#define vp8_lf_simple_b_h vp8_loop_filter_bhs_neon
#endif /* !CONFIG_RUNTIME_CPU_DETECT */
#endif /* HAVE_ARMV7 */
#endif /* LOOPFILTER_ARM_H */

Просмотреть файл

@ -46,7 +46,7 @@
vst1.32 {d2[1]}, [r3], r12
vst1.32 {d4[0]}, [r3], r12
vst1.32 {d4[1]}, [r3]
bx lr
ENDP

Просмотреть файл

@ -9,8 +9,7 @@
*/
#include "vpx_config.h"
#include "vp8/common/idct.h"
#include "vp8/common/dequantize.h"
#include "vpx_rtcd.h"
/* place these declarations here because we don't want to maintain them
* outside of this scope

Просмотреть файл

@ -9,7 +9,7 @@
;
EXPORT |vp8_sixtap_predict_neon|
EXPORT |vp8_sixtap_predict4x4_neon|
ARM
REQUIRE8
PRESERVE8
@ -33,7 +33,7 @@ filter4_coeff
; stack(r4) unsigned char *dst_ptr,
; stack(lr) int dst_pitch
|vp8_sixtap_predict_neon| PROC
|vp8_sixtap_predict4x4_neon| PROC
push {r4, lr}
adr r12, filter4_coeff

Просмотреть файл

@ -1,65 +0,0 @@
/*
* Copyright (c) 2010 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.
*/
#ifndef RECON_ARM_H
#define RECON_ARM_H
#if HAVE_ARMV6
extern prototype_copy_block(vp8_copy_mem8x8_v6);
extern prototype_copy_block(vp8_copy_mem8x4_v6);
extern prototype_copy_block(vp8_copy_mem16x16_v6);
extern prototype_intra4x4_predict(vp8_intra4x4_predict_armv6);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_recon_copy8x8
#define vp8_recon_copy8x8 vp8_copy_mem8x8_v6
#undef vp8_recon_copy8x4
#define vp8_recon_copy8x4 vp8_copy_mem8x4_v6
#undef vp8_recon_copy16x16
#define vp8_recon_copy16x16 vp8_copy_mem16x16_v6
#undef vp8_recon_intra4x4_predict
#define vp8_recon_intra4x4_predict vp8_intra4x4_predict_armv6
#endif
#endif
#if HAVE_ARMV7
extern prototype_copy_block(vp8_copy_mem8x8_neon);
extern prototype_copy_block(vp8_copy_mem8x4_neon);
extern prototype_copy_block(vp8_copy_mem16x16_neon);
extern prototype_build_intra_predictors(vp8_build_intra_predictors_mby_neon);
extern prototype_build_intra_predictors(vp8_build_intra_predictors_mby_s_neon);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_recon_copy8x8
#define vp8_recon_copy8x8 vp8_copy_mem8x8_neon
#undef vp8_recon_copy8x4
#define vp8_recon_copy8x4 vp8_copy_mem8x4_neon
#undef vp8_recon_copy16x16
#define vp8_recon_copy16x16 vp8_copy_mem16x16_neon
#undef vp8_recon_build_intra_predictors_mby
#define vp8_recon_build_intra_predictors_mby vp8_build_intra_predictors_mby_neon
#undef vp8_recon_build_intra_predictors_mby_s
#define vp8_recon_build_intra_predictors_mby_s vp8_build_intra_predictors_mby_s_neon
#endif
#endif
#endif

Просмотреть файл

@ -10,12 +10,11 @@
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8/common/blockd.h"
#include "vp8/common/reconintra.h"
#include "vpx_mem/vpx_mem.h"
#include "vp8/common/recon.h"
#if HAVE_ARMV7
#if HAVE_NEON
extern void vp8_build_intra_predictors_mby_neon_func(
unsigned char *y_buffer,
unsigned char *ypred_ptr,
@ -35,10 +34,7 @@ void vp8_build_intra_predictors_mby_neon(MACROBLOCKD *x)
vp8_build_intra_predictors_mby_neon_func(y_buffer, ypred_ptr, y_stride, mode, Up, Left);
}
#endif
#if HAVE_ARMV7
extern void vp8_build_intra_predictors_mby_s_neon_func(
unsigned char *y_buffer,
unsigned char *ypred_ptr,

Просмотреть файл

@ -1,89 +0,0 @@
/*
* Copyright (c) 2010 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.
*/
#ifndef SUBPIXEL_ARM_H
#define SUBPIXEL_ARM_H
#if HAVE_ARMV6
extern prototype_subpixel_predict(vp8_sixtap_predict16x16_armv6);
extern prototype_subpixel_predict(vp8_sixtap_predict8x8_armv6);
extern prototype_subpixel_predict(vp8_sixtap_predict8x4_armv6);
extern prototype_subpixel_predict(vp8_sixtap_predict_armv6);
extern prototype_subpixel_predict(vp8_bilinear_predict16x16_armv6);
extern prototype_subpixel_predict(vp8_bilinear_predict8x8_armv6);
extern prototype_subpixel_predict(vp8_bilinear_predict8x4_armv6);
extern prototype_subpixel_predict(vp8_bilinear_predict4x4_armv6);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_subpix_sixtap16x16
#define vp8_subpix_sixtap16x16 vp8_sixtap_predict16x16_armv6
#undef vp8_subpix_sixtap8x8
#define vp8_subpix_sixtap8x8 vp8_sixtap_predict8x8_armv6
#undef vp8_subpix_sixtap8x4
#define vp8_subpix_sixtap8x4 vp8_sixtap_predict8x4_armv6
#undef vp8_subpix_sixtap4x4
#define vp8_subpix_sixtap4x4 vp8_sixtap_predict_armv6
#undef vp8_subpix_bilinear16x16
#define vp8_subpix_bilinear16x16 vp8_bilinear_predict16x16_armv6
#undef vp8_subpix_bilinear8x8
#define vp8_subpix_bilinear8x8 vp8_bilinear_predict8x8_armv6
#undef vp8_subpix_bilinear8x4
#define vp8_subpix_bilinear8x4 vp8_bilinear_predict8x4_armv6
#undef vp8_subpix_bilinear4x4
#define vp8_subpix_bilinear4x4 vp8_bilinear_predict4x4_armv6
#endif
#endif
#if HAVE_ARMV7
extern prototype_subpixel_predict(vp8_sixtap_predict16x16_neon);
extern prototype_subpixel_predict(vp8_sixtap_predict8x8_neon);
extern prototype_subpixel_predict(vp8_sixtap_predict8x4_neon);
extern prototype_subpixel_predict(vp8_sixtap_predict_neon);
extern prototype_subpixel_predict(vp8_bilinear_predict16x16_neon);
extern prototype_subpixel_predict(vp8_bilinear_predict8x8_neon);
extern prototype_subpixel_predict(vp8_bilinear_predict8x4_neon);
extern prototype_subpixel_predict(vp8_bilinear_predict4x4_neon);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_subpix_sixtap16x16
#define vp8_subpix_sixtap16x16 vp8_sixtap_predict16x16_neon
#undef vp8_subpix_sixtap8x8
#define vp8_subpix_sixtap8x8 vp8_sixtap_predict8x8_neon
#undef vp8_subpix_sixtap8x4
#define vp8_subpix_sixtap8x4 vp8_sixtap_predict8x4_neon
#undef vp8_subpix_sixtap4x4
#define vp8_subpix_sixtap4x4 vp8_sixtap_predict_neon
#undef vp8_subpix_bilinear16x16
#define vp8_subpix_bilinear16x16 vp8_bilinear_predict16x16_neon
#undef vp8_subpix_bilinear8x8
#define vp8_subpix_bilinear8x8 vp8_bilinear_predict8x8_neon
#undef vp8_subpix_bilinear8x4
#define vp8_subpix_bilinear8x4 vp8_bilinear_predict8x4_neon
#undef vp8_subpix_bilinear4x4
#define vp8_subpix_bilinear4x4 vp8_bilinear_predict4x4_neon
#endif
#endif
#endif

Просмотреть файл

@ -9,10 +9,11 @@
*/
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8/common/variance.h"
#include "vp8/common/filter.h"
#if HAVE_ARMV6
#if HAVE_MEDIA
#include "vp8/common/arm/bilinearfilter_arm.h"
unsigned int vp8_sub_pixel_variance8x8_armv6
@ -91,10 +92,21 @@ unsigned int vp8_sub_pixel_variance16x16_armv6
return var;
}
#endif /* HAVE_ARMV6 */
#endif /* HAVE_MEDIA */
#if HAVE_ARMV7
#if HAVE_NEON
extern unsigned int vp8_sub_pixel_variance16x16_neon_func
(
const unsigned char *src_ptr,
int src_pixels_per_line,
int xoffset,
int yoffset,
const unsigned char *dst_ptr,
int dst_pixels_per_line,
unsigned int *sse
);
unsigned int vp8_sub_pixel_variance16x16_neon
(

Просмотреть файл

@ -1,155 +0,0 @@
/*
* Copyright (c) 2010 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.
*/
#ifndef VARIANCE_ARM_H
#define VARIANCE_ARM_H
#if HAVE_ARMV6
extern prototype_sad(vp8_sad16x16_armv6);
extern prototype_variance(vp8_variance16x16_armv6);
extern prototype_variance(vp8_variance8x8_armv6);
extern prototype_subpixvariance(vp8_sub_pixel_variance16x16_armv6);
extern prototype_subpixvariance(vp8_sub_pixel_variance8x8_armv6);
extern prototype_variance(vp8_variance_halfpixvar16x16_h_armv6);
extern prototype_variance(vp8_variance_halfpixvar16x16_v_armv6);
extern prototype_variance(vp8_variance_halfpixvar16x16_hv_armv6);
extern prototype_variance(vp8_mse16x16_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
#undef vp8_variance_subpixvar8x8
#define vp8_variance_subpixvar8x8 vp8_sub_pixel_variance8x8_armv6
#undef vp8_variance_var16x16
#define vp8_variance_var16x16 vp8_variance16x16_armv6
#undef vp8_variance_mse16x16
#define vp8_variance_mse16x16 vp8_mse16x16_armv6
#undef vp8_variance_var8x8
#define vp8_variance_var8x8 vp8_variance8x8_armv6
#undef vp8_variance_halfpixvar16x16_h
#define vp8_variance_halfpixvar16x16_h vp8_variance_halfpixvar16x16_h_armv6
#undef vp8_variance_halfpixvar16x16_v
#define vp8_variance_halfpixvar16x16_v vp8_variance_halfpixvar16x16_v_armv6
#undef vp8_variance_halfpixvar16x16_hv
#define vp8_variance_halfpixvar16x16_hv vp8_variance_halfpixvar16x16_hv_armv6
#endif /* !CONFIG_RUNTIME_CPU_DETECT */
#endif /* HAVE_ARMV6 */
#if HAVE_ARMV7
extern prototype_sad(vp8_sad4x4_neon);
extern prototype_sad(vp8_sad8x8_neon);
extern prototype_sad(vp8_sad8x16_neon);
extern prototype_sad(vp8_sad16x8_neon);
extern prototype_sad(vp8_sad16x16_neon);
//extern prototype_variance(vp8_variance4x4_c);
extern prototype_variance(vp8_variance8x8_neon);
extern prototype_variance(vp8_variance8x16_neon);
extern prototype_variance(vp8_variance16x8_neon);
extern prototype_variance(vp8_variance16x16_neon);
//extern prototype_subpixvariance(vp8_sub_pixel_variance4x4_c);
extern prototype_subpixvariance(vp8_sub_pixel_variance8x8_neon);
//extern prototype_subpixvariance(vp8_sub_pixel_variance8x16_c);
//extern prototype_subpixvariance(vp8_sub_pixel_variance16x8_c);
extern prototype_subpixvariance(vp8_sub_pixel_variance16x16_neon);
extern prototype_subpixvariance(vp8_sub_pixel_variance16x16_neon_func);
extern prototype_variance(vp8_variance_halfpixvar16x16_h_neon);
extern prototype_variance(vp8_variance_halfpixvar16x16_v_neon);
extern prototype_variance(vp8_variance_halfpixvar16x16_hv_neon);
//extern prototype_getmbss(vp8_get_mb_ss_c);
extern prototype_variance(vp8_mse16x16_neon);
extern prototype_get16x16prederror(vp8_get4x4sse_cs_neon);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_variance_sad4x4
#define vp8_variance_sad4x4 vp8_sad4x4_neon
#undef vp8_variance_sad8x8
#define vp8_variance_sad8x8 vp8_sad8x8_neon
#undef vp8_variance_sad8x16
#define vp8_variance_sad8x16 vp8_sad8x16_neon
#undef vp8_variance_sad16x8
#define vp8_variance_sad16x8 vp8_sad16x8_neon
#undef vp8_variance_sad16x16
#define vp8_variance_sad16x16 vp8_sad16x16_neon
//#undef vp8_variance_var4x4
//#define vp8_variance_var4x4 vp8_variance4x4_c
#undef vp8_variance_var8x8
#define vp8_variance_var8x8 vp8_variance8x8_neon
#undef vp8_variance_var8x16
#define vp8_variance_var8x16 vp8_variance8x16_neon
#undef vp8_variance_var16x8
#define vp8_variance_var16x8 vp8_variance16x8_neon
#undef vp8_variance_var16x16
#define vp8_variance_var16x16 vp8_variance16x16_neon
//#undef vp8_variance_subpixvar4x4
//#define vp8_variance_subpixvar4x4 vp8_sub_pixel_variance4x4_c
#undef vp8_variance_subpixvar8x8
#define vp8_variance_subpixvar8x8 vp8_sub_pixel_variance8x8_neon
//#undef vp8_variance_subpixvar8x16
//#define vp8_variance_subpixvar8x16 vp8_sub_pixel_variance8x16_c
//#undef vp8_variance_subpixvar16x8
//#define vp8_variance_subpixvar16x8 vp8_sub_pixel_variance16x8_c
#undef vp8_variance_subpixvar16x16
#define vp8_variance_subpixvar16x16 vp8_sub_pixel_variance16x16_neon
#undef vp8_variance_halfpixvar16x16_h
#define vp8_variance_halfpixvar16x16_h vp8_variance_halfpixvar16x16_h_neon
#undef vp8_variance_halfpixvar16x16_v
#define vp8_variance_halfpixvar16x16_v vp8_variance_halfpixvar16x16_v_neon
#undef vp8_variance_halfpixvar16x16_hv
#define vp8_variance_halfpixvar16x16_hv vp8_variance_halfpixvar16x16_hv_neon
//#undef vp8_variance_getmbss
//#define vp8_variance_getmbss vp8_get_mb_ss_c
#undef vp8_variance_mse16x16
#define vp8_variance_mse16x16 vp8_mse16x16_neon
#undef vp8_variance_get4x4sse_cs
#define vp8_variance_get4x4sse_cs vp8_get4x4sse_cs_neon
#endif
#endif
#endif

Просмотреть файл

@ -15,6 +15,10 @@
#include "vpx_scale/yv12config.h"
#include "vp8/common/blockd.h"
#if CONFIG_POSTPROC
#include "postproc.h"
#endif /* CONFIG_POSTPROC */
BEGIN
/* vpx_scale */
@ -30,12 +34,17 @@ DEFINE(yv12_buffer_config_v_buffer, offsetof(YV12_BUFFER_CONFIG, v_b
DEFINE(yv12_buffer_config_border, offsetof(YV12_BUFFER_CONFIG, border));
DEFINE(VP8BORDERINPIXELS_VAL, VP8BORDERINPIXELS);
#if CONFIG_POSTPROC
/* mfqe.c / filter_by_weight */
DEFINE(MFQE_PRECISION_VAL, MFQE_PRECISION);
#endif /* CONFIG_POSTPROC */
END
/* add asserts for any offset that is not supported by assembly code */
/* add asserts for any size that is not supported by assembly code */
#if HAVE_ARMV6
#if HAVE_MEDIA
/* switch case in vp8_intra4x4_predict_armv6 is based on these enumerated values */
ct_assert(B_DC_PRED, B_DC_PRED == 0);
ct_assert(B_TM_PRED, B_TM_PRED == 1);
@ -49,7 +58,14 @@ ct_assert(B_HD_PRED, B_HD_PRED == 8);
ct_assert(B_HU_PRED, B_HU_PRED == 9);
#endif
#if HAVE_ARMV7
#if HAVE_NEON
/* vp8_yv12_extend_frame_borders_neon makes several assumptions based on this */
ct_assert(VP8BORDERINPIXELS_VAL, VP8BORDERINPIXELS == 32)
#endif
#if HAVE_SSE2
#if CONFIG_POSTPROC
/* vp8_filter_by_weight16x16 and 8x8 */
ct_assert(MFQE_PRECISION_VAL, MFQE_PRECISION == 4)
#endif /* CONFIG_POSTPROC */
#endif /* HAVE_SSE2 */

Просмотреть файл

@ -18,7 +18,6 @@ void vpx_log(const char *format, ...);
#include "vpx_scale/yv12config.h"
#include "mv.h"
#include "treecoder.h"
#include "subpixel.h"
#include "vpx_ports/mem.h"
/*#define DCPRED 1*/
@ -151,56 +150,61 @@ typedef enum
typedef struct
{
MB_PREDICTION_MODE mode, uv_mode;
MV_REFERENCE_FRAME ref_frame;
uint8_t mode, uv_mode;
uint8_t ref_frame;
uint8_t is_4x4;
int_mv mv;
unsigned char partitioning;
unsigned char mb_skip_coeff; /* does this mb has coefficients at all, 1=no coefficients, 0=need decode tokens */
unsigned char need_to_clamp_mvs;
unsigned char segment_id; /* Which set of segmentation parameters should be used for this MB */
uint8_t partitioning;
uint8_t mb_skip_coeff; /* does this mb has coefficients at all, 1=no coefficients, 0=need decode tokens */
uint8_t need_to_clamp_mvs;
uint8_t segment_id; /* Which set of segmentation parameters should be used for this MB */
} MB_MODE_INFO;
typedef struct
typedef struct modeinfo
{
MB_MODE_INFO mbmi;
union b_mode_info bmi[16];
} MODE_INFO;
#if CONFIG_MULTI_RES_ENCODING
/* The information needed to be stored for higher-resolution encoder */
/* The mb-level information needed to be stored for higher-resolution encoder */
typedef struct
{
MB_PREDICTION_MODE mode;
MV_REFERENCE_FRAME ref_frame;
int_mv mv;
//union b_mode_info bmi[16];
int dissim; // dissimilarity level of the macroblock
} LOWER_RES_INFO;
int dissim; /* dissimilarity level of the macroblock */
} LOWER_RES_MB_INFO;
/* The frame-level information needed to be stored for higher-resolution
* encoder */
typedef struct
{
FRAME_TYPE frame_type;
int is_frame_dropped;
/* The frame number of each reference frames */
unsigned int low_res_ref_frames[MAX_REF_FRAMES];
LOWER_RES_MB_INFO *mb_info;
} LOWER_RES_FRAME_INFO;
#endif
typedef struct
typedef struct blockd
{
short *qcoeff;
short *dqcoeff;
unsigned char *predictor;
short *dequant;
/* 16 Y blocks, 4 U blocks, 4 V blocks each with 16 entries */
unsigned char **base_pre;
int pre;
int pre_stride;
unsigned char **base_dst;
int dst;
int dst_stride;
int offset;
char *eob;
union b_mode_info bmi;
} BLOCKD;
typedef struct MacroBlockD
typedef void (*vp8_subpix_fn_t)(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch);
typedef struct macroblockd
{
DECLARE_ALIGNED(16, unsigned char, predictor[384]);
DECLARE_ALIGNED(16, short, qcoeff[400]);
@ -227,6 +231,10 @@ typedef struct MacroBlockD
int up_available;
int left_available;
unsigned char *recon_above[3];
unsigned char *recon_left[3];
int recon_left_stride[2];
/* Y,U,V,Y2 */
ENTROPY_CONTEXT_PLANES *above_context;
ENTROPY_CONTEXT_PLANES *left_context;
@ -265,11 +273,8 @@ typedef struct MacroBlockD
int mb_to_top_edge;
int mb_to_bottom_edge;
int ref_frame_cost[MAX_REF_FRAMES];
unsigned int frames_since_golden;
unsigned int frames_till_alt_ref_frame;
vp8_subpix_fn_t subpixel_predict;
vp8_subpix_fn_t subpixel_predict8x4;
vp8_subpix_fn_t subpixel_predict8x8;
@ -286,10 +291,6 @@ typedef struct MacroBlockD
*/
DECLARE_ALIGNED(32, unsigned char, y_buf[22*32]);
#endif
#if CONFIG_RUNTIME_CPU_DETECT
struct VP8_COMMON_RTCD *rtcd;
#endif
} MACROBLOCKD;

Просмотреть файл

@ -10,8 +10,8 @@
#include "vpx_config.h"
#include "dequantize.h"
#include "vp8/common/idct.h"
#include "vpx_rtcd.h"
#include "vp8/common/blockd.h"
#include "vpx_mem/vpx_mem.h"
void vp8_dequantize_b_c(BLOCKD *d, short *DQC)

Просмотреть файл

@ -1,85 +0,0 @@
/*
* Copyright (c) 2010 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.
*/
#ifndef DEQUANTIZE_H
#define DEQUANTIZE_H
#include "vp8/common/blockd.h"
#define prototype_dequant_block(sym) \
void sym(BLOCKD *x, short *DQC)
#define prototype_dequant_idct_add(sym) \
void sym(short *input, short *dq, \
unsigned char *output, \
int stride)
#define prototype_dequant_idct_add_y_block(sym) \
void sym(short *q, short *dq, \
unsigned char *dst, \
int stride, char *eobs)
#define prototype_dequant_idct_add_uv_block(sym) \
void sym(short *q, short *dq, \
unsigned char *dst_u, \
unsigned char *dst_v, int stride, char *eobs)
#if ARCH_X86 || ARCH_X86_64
#include "x86/dequantize_x86.h"
#endif
#if ARCH_ARM
#include "arm/dequantize_arm.h"
#endif
#ifndef vp8_dequant_block
#define vp8_dequant_block vp8_dequantize_b_c
#endif
extern prototype_dequant_block(vp8_dequant_block);
#ifndef vp8_dequant_idct_add
#define vp8_dequant_idct_add vp8_dequant_idct_add_c
#endif
extern prototype_dequant_idct_add(vp8_dequant_idct_add);
#ifndef vp8_dequant_idct_add_y_block
#define vp8_dequant_idct_add_y_block vp8_dequant_idct_add_y_block_c
#endif
extern prototype_dequant_idct_add_y_block(vp8_dequant_idct_add_y_block);
#ifndef vp8_dequant_idct_add_uv_block
#define vp8_dequant_idct_add_uv_block vp8_dequant_idct_add_uv_block_c
#endif
extern prototype_dequant_idct_add_uv_block(vp8_dequant_idct_add_uv_block);
typedef prototype_dequant_block((*vp8_dequant_block_fn_t));
typedef prototype_dequant_idct_add((*vp8_dequant_idct_add_fn_t));
typedef prototype_dequant_idct_add_y_block((*vp8_dequant_idct_add_y_block_fn_t));
typedef prototype_dequant_idct_add_uv_block((*vp8_dequant_idct_add_uv_block_fn_t));
typedef struct
{
vp8_dequant_block_fn_t block;
vp8_dequant_idct_add_fn_t idct_add;
vp8_dequant_idct_add_y_block_fn_t idct_add_y_block;
vp8_dequant_idct_add_uv_block_fn_t idct_add_uv_block;
} vp8_dequant_rtcd_vtable_t;
#if CONFIG_RUNTIME_CPU_DETECT
#define DEQUANT_INVOKE(ctx,fn) (ctx)->fn
#else
#define DEQUANT_INVOKE(ctx,fn) vp8_dequant_##fn
#endif
#endif

Просмотреть файл

@ -8,23 +8,11 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include <stdio.h>
#include "entropy.h"
#include "string.h"
#include "blockd.h"
#include "onyxc_int.h"
#include "vpx_mem/vpx_mem.h"
#define uchar unsigned char /* typedefs can clash */
#define uint unsigned int
typedef const uchar cuchar;
typedef const uint cuint;
typedef vp8_prob Prob;
#include "coefupdateprobs.h"
DECLARE_ALIGNED(16, const unsigned char, vp8_norm[256]) =
@ -47,10 +35,11 @@ DECLARE_ALIGNED(16, const unsigned char, vp8_norm[256]) =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
DECLARE_ALIGNED(16, cuchar, vp8_coef_bands[16]) =
DECLARE_ALIGNED(16, const unsigned char, vp8_coef_bands[16]) =
{ 0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7};
DECLARE_ALIGNED(16, cuchar, vp8_prev_token_class[MAX_ENTROPY_TOKENS]) =
DECLARE_ALIGNED(16, const unsigned char,
vp8_prev_token_class[MAX_ENTROPY_TOKENS]) =
{ 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0};
DECLARE_ALIGNED(16, const int, vp8_default_zig_zag1d[16]) =
@ -69,7 +58,26 @@ DECLARE_ALIGNED(16, const short, vp8_default_inv_zig_zag[16]) =
10, 11, 15, 16
};
DECLARE_ALIGNED(16, short, vp8_default_zig_zag_mask[16]);
/* vp8_default_zig_zag_mask generated with:
void vp8_init_scan_order_mask()
{
int i;
for (i = 0; i < 16; i++)
{
vp8_default_zig_zag_mask[vp8_default_zig_zag1d[i]] = 1 << i;
}
}
*/
DECLARE_ALIGNED(16, const short, vp8_default_zig_zag_mask[16]) =
{
1, 2, 32, 64,
4, 16, 128, 4096,
8, 256, 2048, 8192,
512, 1024, 16384, -32768
};
const int vp8_mb_feature_data_bits[MB_LVL_MAX] = {7, 6};
@ -90,56 +98,72 @@ const vp8_tree_index vp8_coef_tree[ 22] = /* corresponding _CONTEXT_NODEs */
-DCT_VAL_CATEGORY5, -DCT_VAL_CATEGORY6 /* 10 = CAT_FIVE */
};
struct vp8_token_struct vp8_coef_encodings[MAX_ENTROPY_TOKENS];
/* vp8_coef_encodings generated with:
vp8_tokens_from_tree(vp8_coef_encodings, vp8_coef_tree);
*/
vp8_token vp8_coef_encodings[MAX_ENTROPY_TOKENS] =
{
{2, 2},
{6, 3},
{28, 5},
{58, 6},
{59, 6},
{60, 6},
{61, 6},
{124, 7},
{125, 7},
{126, 7},
{127, 7},
{0, 1}
};
/* Trees for extra bits. Probabilities are constant and
do not depend on previously encoded bits */
static const Prob Pcat1[] = { 159};
static const Prob Pcat2[] = { 165, 145};
static const Prob Pcat3[] = { 173, 148, 140};
static const Prob Pcat4[] = { 176, 155, 140, 135};
static const Prob Pcat5[] = { 180, 157, 141, 134, 130};
static const Prob Pcat6[] =
static const vp8_prob Pcat1[] = { 159};
static const vp8_prob Pcat2[] = { 165, 145};
static const vp8_prob Pcat3[] = { 173, 148, 140};
static const vp8_prob Pcat4[] = { 176, 155, 140, 135};
static const vp8_prob Pcat5[] = { 180, 157, 141, 134, 130};
static const vp8_prob Pcat6[] =
{ 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129};
static vp8_tree_index cat1[2], cat2[4], cat3[6], cat4[8], cat5[10], cat6[22];
void vp8_init_scan_order_mask()
{
int i;
/* tree index tables generated with:
for (i = 0; i < 16; i++)
void init_bit_tree(vp8_tree_index *p, int n)
{
vp8_default_zig_zag_mask[vp8_default_zig_zag1d[i]] = 1 << i;
int i = 0;
while (++i < n)
{
p[0] = p[1] = i << 1;
p += 2;
}
p[0] = p[1] = 0;
}
}
static void init_bit_tree(vp8_tree_index *p, int n)
{
int i = 0;
while (++i < n)
void init_bit_trees()
{
p[0] = p[1] = i << 1;
p += 2;
init_bit_tree(cat1, 1);
init_bit_tree(cat2, 2);
init_bit_tree(cat3, 3);
init_bit_tree(cat4, 4);
init_bit_tree(cat5, 5);
init_bit_tree(cat6, 11);
}
*/
p[0] = p[1] = 0;
}
static const vp8_tree_index cat1[2] = { 0, 0 };
static const vp8_tree_index cat2[4] = { 2, 2, 0, 0 };
static const vp8_tree_index cat3[6] = { 2, 2, 4, 4, 0, 0 };
static const vp8_tree_index cat4[8] = { 2, 2, 4, 4, 6, 6, 0, 0 };
static const vp8_tree_index cat5[10] = { 2, 2, 4, 4, 6, 6, 8, 8, 0, 0 };
static const vp8_tree_index cat6[22] = { 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12,
14, 14, 16, 16, 18, 18, 20, 20, 0, 0 };
static void init_bit_trees()
{
init_bit_tree(cat1, 1);
init_bit_tree(cat2, 2);
init_bit_tree(cat3, 3);
init_bit_tree(cat4, 4);
init_bit_tree(cat5, 5);
init_bit_tree(cat6, 11);
}
vp8_extra_bit_struct vp8_extra_bits[12] =
const vp8_extra_bit_struct vp8_extra_bits[12] =
{
{ 0, 0, 0, 0},
{ 0, 0, 0, 1},
@ -163,8 +187,3 @@ void vp8_default_coef_probs(VP8_COMMON *pc)
sizeof(default_coef_probs));
}
void vp8_coef_tree_initialize()
{
init_bit_trees();
vp8_tokens_from_tree(vp8_coef_encodings, vp8_coef_tree);
}

Просмотреть файл

@ -35,7 +35,7 @@
extern const vp8_tree_index vp8_coef_tree[];
extern struct vp8_token_struct vp8_coef_encodings[MAX_ENTROPY_TOKENS];
extern const struct vp8_token_struct vp8_coef_encodings[MAX_ENTROPY_TOKENS];
typedef struct
{
@ -45,7 +45,7 @@ typedef struct
int base_val;
} vp8_extra_bit_struct;
extern vp8_extra_bit_struct vp8_extra_bits[12]; /* indexed by token value */
extern const vp8_extra_bit_struct vp8_extra_bits[12]; /* indexed by token value */
#define PROB_UPDATE_BASELINE_COST 7
@ -94,7 +94,7 @@ void vp8_default_coef_probs(struct VP8Common *);
extern DECLARE_ALIGNED(16, const int, vp8_default_zig_zag1d[16]);
extern DECLARE_ALIGNED(16, const short, vp8_default_inv_zig_zag[16]);
extern short vp8_default_zig_zag_mask[16];
extern DECLARE_ALIGNED(16, const short, vp8_default_zig_zag_mask[16]);
extern const int vp8_mb_feature_data_bits[MB_LVL_MAX];
void vp8_coef_tree_initialize(void);

Просмотреть файл

@ -8,22 +8,13 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#define USE_PREBUILT_TABLES
#include "entropymode.h"
#include "entropy.h"
#include "vpx_mem/vpx_mem.h"
static const unsigned int kf_y_mode_cts[VP8_YMODES] = { 1607, 915, 812, 811, 5455};
static const unsigned int y_mode_cts [VP8_YMODES] = { 8080, 1908, 1582, 1007, 5874};
static const unsigned int uv_mode_cts [VP8_UV_MODES] = { 59483, 13605, 16492, 4230};
static const unsigned int kf_uv_mode_cts[VP8_UV_MODES] = { 5319, 1904, 1703, 674};
static const unsigned int bmode_cts[VP8_BINTRAMODES] =
{
43891, 17694, 10036, 3920, 3363, 2546, 5119, 3221, 2471, 1723
};
#include "vp8_entropymodedata.h"
int vp8_mv_cont(const int_mv *l, const int_mv *a)
{
@ -59,7 +50,7 @@ const vp8_prob vp8_sub_mv_ref_prob2 [SUBMVREF_COUNT][VP8_SUBMVREFS-1] =
vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS] =
const vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS] =
{
{
0, 0, 0, 0,
@ -84,7 +75,7 @@ vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS] =
4, 5, 6, 7,
8, 9, 10, 11,
12, 13, 14, 15,
},
}
};
const int vp8_mbsplit_count [VP8_NUMMBSPLITS] = { 2, 2, 4, 16};
@ -155,17 +146,6 @@ const vp8_tree_index vp8_sub_mv_ref_tree[6] =
-ZERO4X4, -NEW4X4
};
struct vp8_token_struct vp8_bmode_encodings [VP8_BINTRAMODES];
struct vp8_token_struct vp8_ymode_encodings [VP8_YMODES];
struct vp8_token_struct vp8_kf_ymode_encodings [VP8_YMODES];
struct vp8_token_struct vp8_uv_mode_encodings [VP8_UV_MODES];
struct vp8_token_struct vp8_mbsplit_encodings [VP8_NUMMBSPLITS];
struct vp8_token_struct vp8_mv_ref_encoding_array [VP8_MVREFS];
struct vp8_token_struct vp8_sub_mv_ref_encoding_array [VP8_SUBMVREFS];
const vp8_tree_index vp8_small_mvtree [14] =
{
2, 8,
@ -177,89 +157,15 @@ const vp8_tree_index vp8_small_mvtree [14] =
-6, -7
};
struct vp8_token_struct vp8_small_mvencodings [8];
void vp8_init_mbmode_probs(VP8_COMMON *x)
{
unsigned int bct [VP8_YMODES] [2]; /* num Ymodes > num UV modes */
vp8_tree_probs_from_distribution(
VP8_YMODES, vp8_ymode_encodings, vp8_ymode_tree,
x->fc.ymode_prob, bct, y_mode_cts,
256, 1
);
vp8_tree_probs_from_distribution(
VP8_YMODES, vp8_kf_ymode_encodings, vp8_kf_ymode_tree,
x->kf_ymode_prob, bct, kf_y_mode_cts,
256, 1
);
vp8_tree_probs_from_distribution(
VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree,
x->fc.uv_mode_prob, bct, uv_mode_cts,
256, 1
);
vp8_tree_probs_from_distribution(
VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree,
x->kf_uv_mode_prob, bct, kf_uv_mode_cts,
256, 1
);
vpx_memcpy(x->fc.ymode_prob, vp8_ymode_prob, sizeof(vp8_ymode_prob));
vpx_memcpy(x->fc.uv_mode_prob, vp8_uv_mode_prob, sizeof(vp8_uv_mode_prob));
vpx_memcpy(x->fc.sub_mv_ref_prob, sub_mv_ref_prob, sizeof(sub_mv_ref_prob));
}
static void intra_bmode_probs_from_distribution(
vp8_prob p [VP8_BINTRAMODES-1],
unsigned int branch_ct [VP8_BINTRAMODES-1] [2],
const unsigned int events [VP8_BINTRAMODES]
)
{
vp8_tree_probs_from_distribution(
VP8_BINTRAMODES, vp8_bmode_encodings, vp8_bmode_tree,
p, branch_ct, events,
256, 1
);
}
void vp8_default_bmode_probs(vp8_prob p [VP8_BINTRAMODES-1])
{
unsigned int branch_ct [VP8_BINTRAMODES-1] [2];
intra_bmode_probs_from_distribution(p, branch_ct, bmode_cts);
vpx_memcpy(p, vp8_bmode_prob, sizeof(vp8_bmode_prob));
}
void vp8_kf_default_bmode_probs(vp8_prob p [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES-1])
{
unsigned int branch_ct [VP8_BINTRAMODES-1] [2];
int i = 0;
do
{
int j = 0;
do
{
intra_bmode_probs_from_distribution(
p[i][j], branch_ct, vp8_kf_default_bmode_counts[i][j]);
}
while (++j < VP8_BINTRAMODES);
}
while (++i < VP8_BINTRAMODES);
}
void vp8_entropy_mode_init()
{
vp8_tokens_from_tree(vp8_bmode_encodings, vp8_bmode_tree);
vp8_tokens_from_tree(vp8_ymode_encodings, vp8_ymode_tree);
vp8_tokens_from_tree(vp8_kf_ymode_encodings, vp8_kf_ymode_tree);
vp8_tokens_from_tree(vp8_uv_mode_encodings, vp8_uv_mode_tree);
vp8_tokens_from_tree(vp8_mbsplit_encodings, vp8_mbsplit_tree);
vp8_tokens_from_tree_offset(vp8_mv_ref_encoding_array,
vp8_mv_ref_tree, NEARESTMV);
vp8_tokens_from_tree_offset(vp8_sub_mv_ref_encoding_array,
vp8_sub_mv_ref_tree, LEFT4X4);
vp8_tokens_from_tree(vp8_small_mvencodings, vp8_small_mvtree);
}

Просмотреть файл

@ -24,11 +24,11 @@ typedef enum
SUBMVREF_LEFT_ABOVE_ZED
} sumvfref_t;
typedef const int vp8_mbsplit[16];
typedef int vp8_mbsplit[16];
#define VP8_NUMMBSPLITS 4
extern vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS];
extern const vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS];
extern const int vp8_mbsplit_count [VP8_NUMMBSPLITS]; /* # of subsets */
@ -52,26 +52,29 @@ extern const vp8_tree_index vp8_mbsplit_tree[];
extern const vp8_tree_index vp8_mv_ref_tree[];
extern const vp8_tree_index vp8_sub_mv_ref_tree[];
extern struct vp8_token_struct vp8_bmode_encodings [VP8_BINTRAMODES];
extern struct vp8_token_struct vp8_ymode_encodings [VP8_YMODES];
extern struct vp8_token_struct vp8_kf_ymode_encodings [VP8_YMODES];
extern struct vp8_token_struct vp8_uv_mode_encodings [VP8_UV_MODES];
extern struct vp8_token_struct vp8_mbsplit_encodings [VP8_NUMMBSPLITS];
extern const struct vp8_token_struct vp8_bmode_encodings[VP8_BINTRAMODES];
extern const struct vp8_token_struct vp8_ymode_encodings[VP8_YMODES];
extern const struct vp8_token_struct vp8_kf_ymode_encodings[VP8_YMODES];
extern const struct vp8_token_struct vp8_uv_mode_encodings[VP8_UV_MODES];
extern const struct vp8_token_struct vp8_mbsplit_encodings[VP8_NUMMBSPLITS];
/* Inter mode values do not start at zero */
extern struct vp8_token_struct vp8_mv_ref_encoding_array [VP8_MVREFS];
extern struct vp8_token_struct vp8_sub_mv_ref_encoding_array [VP8_SUBMVREFS];
extern const struct vp8_token_struct vp8_mv_ref_encoding_array[VP8_MVREFS];
extern const struct vp8_token_struct vp8_sub_mv_ref_encoding_array[VP8_SUBMVREFS];
extern const vp8_tree_index vp8_small_mvtree[];
extern struct vp8_token_struct vp8_small_mvencodings [8];
extern const struct vp8_token_struct vp8_small_mvencodings[8];
void vp8_entropy_mode_init(void);
/* Key frame default mode probs */
extern const vp8_prob vp8_kf_bmode_prob[VP8_BINTRAMODES][VP8_BINTRAMODES]
[VP8_BINTRAMODES-1];
extern const vp8_prob vp8_kf_uv_mode_prob[VP8_UV_MODES-1];
extern const vp8_prob vp8_kf_ymode_prob[VP8_YMODES-1];
void vp8_init_mbmode_probs(VP8_COMMON *x);
void vp8_default_bmode_probs(vp8_prob dest [VP8_BINTRAMODES-1]);
void vp8_default_bmode_probs(vp8_prob dest [VP8_BINTRAMODES-1]);
void vp8_kf_default_bmode_probs(vp8_prob dest [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES-1]);
#endif

Просмотреть файл

@ -116,7 +116,7 @@ void vp8_copy_and_extend_frame_with_rect(YV12_BUFFER_CONFIG *src,
int src_uv_offset = ((srcy * src->uv_stride) >> 1) + (srcx >> 1);
int dst_uv_offset = ((srcy * dst->uv_stride) >> 1) + (srcx >> 1);
// If the side is not touching the bounder then don't extend.
/* If the side is not touching the bounder then don't extend. */
if (srcy)
et = 0;
if (srcx)
@ -157,7 +157,10 @@ void vp8_copy_and_extend_frame_with_rect(YV12_BUFFER_CONFIG *src,
/* note the extension is only for the last row, for intra prediction purpose */
void vp8_extend_mb_row(YV12_BUFFER_CONFIG *ybf, unsigned char *YPtr, unsigned char *UPtr, unsigned char *VPtr)
void vp8_extend_mb_row(YV12_BUFFER_CONFIG *ybf,
unsigned char *YPtr,
unsigned char *UPtr,
unsigned char *VPtr)
{
int i;

Просмотреть файл

@ -149,7 +149,7 @@ static void filter_block2d
}
void vp8_sixtap_predict_c
void vp8_sixtap_predict4x4_c
(
unsigned char *src_ptr,
int src_pixels_per_line,

Просмотреть файл

@ -19,4 +19,4 @@
extern const short vp8_bilinear_filters[8][2];
extern const short vp8_sub_pel_filters[8][6];
#endif //FILTER_H
#endif

Просмотреть файл

@ -10,31 +10,33 @@
#include "vpx_config.h"
#include "vp8/common/subpixel.h"
#include "vp8/common/loopfilter.h"
#include "vp8/common/recon.h"
#include "vp8/common/idct.h"
#include "vp8/common/variance.h"
#include "vpx_rtcd.h"
#if ARCH_ARM
#include "vpx_ports/arm.h"
#elif ARCH_X86 || ARCH_X86_64
#include "vpx_ports/x86.h"
#endif
#include "vp8/common/onyxc_int.h"
#if CONFIG_MULTITHREAD
#if HAVE_UNISTD_H
#if HAVE_UNISTD_H && !defined(__OS2__)
#include <unistd.h>
#elif defined(_WIN32)
#include <windows.h>
typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
#elif defined(__OS2__)
#define INCL_DOS
#define INCL_DOSSPINLOCK
#include <os2.h>
#endif
#endif
extern void vp8_arch_x86_common_init(VP8_COMMON *ctx);
extern void vp8_arch_arm_common_init(VP8_COMMON *ctx);
#if CONFIG_MULTITHREAD
static int get_cpu_count()
{
int core_count = 16;
#if HAVE_UNISTD_H
#if HAVE_UNISTD_H && !defined(__OS2__)
#if defined(_SC_NPROCESSORS_ONLN)
core_count = sysconf(_SC_NPROCESSORS_ONLN);
#elif defined(_SC_NPROC_ONLN)
@ -57,6 +59,21 @@ static int get_cpu_count()
core_count = sysinfo.dwNumberOfProcessors;
}
#elif defined(__OS2__)
{
ULONG proc_id;
ULONG status;
core_count = 0;
for (proc_id = 1; ; proc_id++)
{
if (DosGetProcessorStatus(proc_id, &status))
break;
if (status == PROC_ONLINE)
core_count++;
}
}
#else
/* other platforms */
#endif
@ -65,129 +82,16 @@ static int get_cpu_count()
}
#endif
void vp8_machine_specific_config(VP8_COMMON *ctx)
{
#if CONFIG_RUNTIME_CPU_DETECT
VP8_COMMON_RTCD *rtcd = &ctx->rtcd;
rtcd->dequant.block = vp8_dequantize_b_c;
rtcd->dequant.idct_add = vp8_dequant_idct_add_c;
rtcd->dequant.idct_add_y_block = vp8_dequant_idct_add_y_block_c;
rtcd->dequant.idct_add_uv_block =
vp8_dequant_idct_add_uv_block_c;
rtcd->idct.idct16 = vp8_short_idct4x4llm_c;
rtcd->idct.idct1_scalar_add = vp8_dc_only_idct_add_c;
rtcd->idct.iwalsh1 = vp8_short_inv_walsh4x4_1_c;
rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_c;
rtcd->recon.copy16x16 = vp8_copy_mem16x16_c;
rtcd->recon.copy8x8 = vp8_copy_mem8x8_c;
rtcd->recon.copy8x4 = vp8_copy_mem8x4_c;
rtcd->recon.build_intra_predictors_mby =
vp8_build_intra_predictors_mby;
rtcd->recon.build_intra_predictors_mby_s =
vp8_build_intra_predictors_mby_s;
rtcd->recon.build_intra_predictors_mbuv =
vp8_build_intra_predictors_mbuv;
rtcd->recon.build_intra_predictors_mbuv_s =
vp8_build_intra_predictors_mbuv_s;
rtcd->recon.intra4x4_predict =
vp8_intra4x4_predict_c;
rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_c;
rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_c;
rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_c;
rtcd->subpix.sixtap4x4 = vp8_sixtap_predict_c;
rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_c;
rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_c;
rtcd->subpix.bilinear8x4 = vp8_bilinear_predict8x4_c;
rtcd->subpix.bilinear4x4 = vp8_bilinear_predict4x4_c;
rtcd->loopfilter.normal_mb_v = vp8_loop_filter_mbv_c;
rtcd->loopfilter.normal_b_v = vp8_loop_filter_bv_c;
rtcd->loopfilter.normal_mb_h = vp8_loop_filter_mbh_c;
rtcd->loopfilter.normal_b_h = vp8_loop_filter_bh_c;
rtcd->loopfilter.simple_mb_v = vp8_loop_filter_simple_vertical_edge_c;
rtcd->loopfilter.simple_b_v = vp8_loop_filter_bvs_c;
rtcd->loopfilter.simple_mb_h = vp8_loop_filter_simple_horizontal_edge_c;
rtcd->loopfilter.simple_b_h = vp8_loop_filter_bhs_c;
rtcd->variance.sad16x16 = vp8_sad16x16_c;
rtcd->variance.sad16x8 = vp8_sad16x8_c;
rtcd->variance.sad8x16 = vp8_sad8x16_c;
rtcd->variance.sad8x8 = vp8_sad8x8_c;
rtcd->variance.sad4x4 = vp8_sad4x4_c;
rtcd->variance.sad16x16x3 = vp8_sad16x16x3_c;
rtcd->variance.sad16x8x3 = vp8_sad16x8x3_c;
rtcd->variance.sad8x16x3 = vp8_sad8x16x3_c;
rtcd->variance.sad8x8x3 = vp8_sad8x8x3_c;
rtcd->variance.sad4x4x3 = vp8_sad4x4x3_c;
rtcd->variance.sad16x16x8 = vp8_sad16x16x8_c;
rtcd->variance.sad16x8x8 = vp8_sad16x8x8_c;
rtcd->variance.sad8x16x8 = vp8_sad8x16x8_c;
rtcd->variance.sad8x8x8 = vp8_sad8x8x8_c;
rtcd->variance.sad4x4x8 = vp8_sad4x4x8_c;
rtcd->variance.sad16x16x4d = vp8_sad16x16x4d_c;
rtcd->variance.sad16x8x4d = vp8_sad16x8x4d_c;
rtcd->variance.sad8x16x4d = vp8_sad8x16x4d_c;
rtcd->variance.sad8x8x4d = vp8_sad8x8x4d_c;
rtcd->variance.sad4x4x4d = vp8_sad4x4x4d_c;
#if ARCH_X86 || ARCH_X86_64
rtcd->variance.copy32xn = vp8_copy32xn_c;
#endif
rtcd->variance.var4x4 = vp8_variance4x4_c;
rtcd->variance.var8x8 = vp8_variance8x8_c;
rtcd->variance.var8x16 = vp8_variance8x16_c;
rtcd->variance.var16x8 = vp8_variance16x8_c;
rtcd->variance.var16x16 = vp8_variance16x16_c;
rtcd->variance.subpixvar4x4 = vp8_sub_pixel_variance4x4_c;
rtcd->variance.subpixvar8x8 = vp8_sub_pixel_variance8x8_c;
rtcd->variance.subpixvar8x16 = vp8_sub_pixel_variance8x16_c;
rtcd->variance.subpixvar16x8 = vp8_sub_pixel_variance16x8_c;
rtcd->variance.subpixvar16x16 = vp8_sub_pixel_variance16x16_c;
rtcd->variance.halfpixvar16x16_h = vp8_variance_halfpixvar16x16_h_c;
rtcd->variance.halfpixvar16x16_v = vp8_variance_halfpixvar16x16_v_c;
rtcd->variance.halfpixvar16x16_hv = vp8_variance_halfpixvar16x16_hv_c;
rtcd->variance.subpixmse16x16 = vp8_sub_pixel_mse16x16_c;
rtcd->variance.mse16x16 = vp8_mse16x16_c;
rtcd->variance.getmbss = vp8_get_mb_ss_c;
rtcd->variance.get4x4sse_cs = vp8_get4x4sse_cs_c;
#if CONFIG_INTERNAL_STATS
rtcd->variance.ssimpf_8x8 = vp8_ssim_parms_8x8_c;
rtcd->variance.ssimpf_16x16 = vp8_ssim_parms_16x16_c;
#endif
#if CONFIG_POSTPROC || (CONFIG_VP8_ENCODER && CONFIG_INTERNAL_STATS)
rtcd->postproc.down = vp8_mbpost_proc_down_c;
rtcd->postproc.across = vp8_mbpost_proc_across_ip_c;
rtcd->postproc.downacross = vp8_post_proc_down_and_across_c;
rtcd->postproc.addnoise = vp8_plane_add_noise_c;
rtcd->postproc.blend_mb_inner = vp8_blend_mb_inner_c;
rtcd->postproc.blend_mb_outer = vp8_blend_mb_outer_c;
rtcd->postproc.blend_b = vp8_blend_b_c;
#endif
#endif
#if ARCH_X86 || ARCH_X86_64
vp8_arch_x86_common_init(ctx);
#endif
#if ARCH_ARM
vp8_arch_arm_common_init(ctx);
#endif
#if CONFIG_MULTITHREAD
ctx->processor_core_count = get_cpu_count();
#endif /* CONFIG_MULTITHREAD */
#if ARCH_ARM
ctx->cpu_caps = arm_cpu_caps();
#elif ARCH_X86 || ARCH_X86_64
ctx->cpu_caps = x86_simd_caps();
#endif
}

Просмотреть файл

@ -1,80 +0,0 @@
/*
* Copyright (c) 2010 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.
*/
#ifndef __INC_IDCT_H
#define __INC_IDCT_H
#define prototype_second_order(sym) \
void sym(short *input, short *output)
#define prototype_idct(sym) \
void sym(short *input, unsigned char *pred, int pitch, unsigned char *dst, \
int dst_stride)
#define prototype_idct_scalar_add(sym) \
void sym(short input, \
unsigned char *pred, int pred_stride, \
unsigned char *dst, \
int dst_stride)
#if ARCH_X86 || ARCH_X86_64
#include "x86/idct_x86.h"
#endif
#if ARCH_ARM
#include "arm/idct_arm.h"
#endif
#ifndef vp8_idct_idct16
#define vp8_idct_idct16 vp8_short_idct4x4llm_c
#endif
extern prototype_idct(vp8_idct_idct16);
/* add this prototype to prevent compiler warning about implicit
* declaration of vp8_short_idct4x4llm_c function in dequantize.c
* when building, for example, neon optimized version */
extern prototype_idct(vp8_short_idct4x4llm_c);
#ifndef vp8_idct_idct1_scalar_add
#define vp8_idct_idct1_scalar_add vp8_dc_only_idct_add_c
#endif
extern prototype_idct_scalar_add(vp8_idct_idct1_scalar_add);
#ifndef vp8_idct_iwalsh1
#define vp8_idct_iwalsh1 vp8_short_inv_walsh4x4_1_c
#endif
extern prototype_second_order(vp8_idct_iwalsh1);
#ifndef vp8_idct_iwalsh16
#define vp8_idct_iwalsh16 vp8_short_inv_walsh4x4_c
#endif
extern prototype_second_order(vp8_idct_iwalsh16);
typedef prototype_idct((*vp8_idct_fn_t));
typedef prototype_idct_scalar_add((*vp8_idct_scalar_add_fn_t));
typedef prototype_second_order((*vp8_second_order_fn_t));
typedef struct
{
vp8_idct_fn_t idct16;
vp8_idct_scalar_add_fn_t idct1_scalar_add;
vp8_second_order_fn_t iwalsh1;
vp8_second_order_fn_t iwalsh16;
} vp8_idct_rtcd_vtable_t;
#if CONFIG_RUNTIME_CPU_DETECT
#define IDCT_INVOKE(ctx,fn) (ctx)->fn
#else
#define IDCT_INVOKE(ctx,fn) vp8_idct_##fn
#endif
#endif

Просмотреть файл

@ -9,8 +9,7 @@
*/
#include "vpx_config.h"
#include "vp8/common/idct.h"
#include "dequantize.h"
#include "vpx_rtcd.h"
void vp8_dequant_idct_add_c(short *input, short *dq,
unsigned char *dest, int stride);

Просмотреть файл

@ -13,7 +13,7 @@
#define __INC_INVTRANS_H
#include "vpx_config.h"
#include "idct.h"
#include "vpx_rtcd.h"
#include "blockd.h"
#include "onyxc_int.h"
@ -33,8 +33,7 @@ static void eob_adjust(char *eobs, short *diff)
}
}
static void vp8_inverse_transform_mby(MACROBLOCKD *xd,
const VP8_COMMON_RTCD *rtcd)
static void vp8_inverse_transform_mby(MACROBLOCKD *xd)
{
short *DQC = xd->dequant_y1;
@ -43,19 +42,19 @@ static void vp8_inverse_transform_mby(MACROBLOCKD *xd,
/* do 2nd order transform on the dc block */
if (xd->eobs[24] > 1)
{
IDCT_INVOKE(&rtcd->idct, iwalsh16)
vp8_short_inv_walsh4x4
(&xd->block[24].dqcoeff[0], xd->qcoeff);
}
else
{
IDCT_INVOKE(&rtcd->idct, iwalsh1)
vp8_short_inv_walsh4x4_1
(&xd->block[24].dqcoeff[0], xd->qcoeff);
}
eob_adjust(xd->eobs, xd->qcoeff);
DQC = xd->dequant_y1_dc;
}
DEQUANT_INVOKE (&rtcd->dequant, idct_add_y_block)
vp8_dequant_idct_add_y_block
(xd->qcoeff, DQC,
xd->dst.y_buffer,
xd->dst.y_stride, xd->eobs);

Просмотреть файл

@ -10,96 +10,13 @@
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "loopfilter.h"
#include "onyxc_int.h"
#include "vpx_mem/vpx_mem.h"
typedef unsigned char uc;
prototype_loopfilter(vp8_loop_filter_horizontal_edge_c);
prototype_loopfilter(vp8_loop_filter_vertical_edge_c);
prototype_loopfilter(vp8_mbloop_filter_horizontal_edge_c);
prototype_loopfilter(vp8_mbloop_filter_vertical_edge_c);
prototype_simple_loopfilter(vp8_loop_filter_simple_horizontal_edge_c);
prototype_simple_loopfilter(vp8_loop_filter_simple_vertical_edge_c);
/* Horizontal MB filtering */
void vp8_loop_filter_mbh_c(unsigned char *y_ptr, unsigned char *u_ptr,
unsigned char *v_ptr, int y_stride, int uv_stride,
loop_filter_info *lfi)
{
vp8_mbloop_filter_horizontal_edge_c(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2);
if (u_ptr)
vp8_mbloop_filter_horizontal_edge_c(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1);
if (v_ptr)
vp8_mbloop_filter_horizontal_edge_c(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1);
}
/* Vertical MB Filtering */
void vp8_loop_filter_mbv_c(unsigned char *y_ptr, unsigned char *u_ptr,
unsigned char *v_ptr, int y_stride, int uv_stride,
loop_filter_info *lfi)
{
vp8_mbloop_filter_vertical_edge_c(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2);
if (u_ptr)
vp8_mbloop_filter_vertical_edge_c(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1);
if (v_ptr)
vp8_mbloop_filter_vertical_edge_c(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1);
}
/* Horizontal B Filtering */
void vp8_loop_filter_bh_c(unsigned char *y_ptr, unsigned char *u_ptr,
unsigned char *v_ptr, int y_stride, int uv_stride,
loop_filter_info *lfi)
{
vp8_loop_filter_horizontal_edge_c(y_ptr + 4 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
vp8_loop_filter_horizontal_edge_c(y_ptr + 8 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
vp8_loop_filter_horizontal_edge_c(y_ptr + 12 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
if (u_ptr)
vp8_loop_filter_horizontal_edge_c(u_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1);
if (v_ptr)
vp8_loop_filter_horizontal_edge_c(v_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1);
}
void vp8_loop_filter_bhs_c(unsigned char *y_ptr, int y_stride,
const unsigned char *blimit)
{
vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 4 * y_stride, y_stride, blimit);
vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 8 * y_stride, y_stride, blimit);
vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 12 * y_stride, y_stride, blimit);
}
/* Vertical B Filtering */
void vp8_loop_filter_bv_c(unsigned char *y_ptr, unsigned char *u_ptr,
unsigned char *v_ptr, int y_stride, int uv_stride,
loop_filter_info *lfi)
{
vp8_loop_filter_vertical_edge_c(y_ptr + 4, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
vp8_loop_filter_vertical_edge_c(y_ptr + 8, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
vp8_loop_filter_vertical_edge_c(y_ptr + 12, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
if (u_ptr)
vp8_loop_filter_vertical_edge_c(u_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1);
if (v_ptr)
vp8_loop_filter_vertical_edge_c(v_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1);
}
void vp8_loop_filter_bvs_c(unsigned char *y_ptr, int y_stride,
const unsigned char *blimit)
{
vp8_loop_filter_simple_vertical_edge_c(y_ptr + 4, y_stride, blimit);
vp8_loop_filter_simple_vertical_edge_c(y_ptr + 8, y_stride, blimit);
vp8_loop_filter_simple_vertical_edge_c(y_ptr + 12, y_stride, blimit);
}
static void lf_init_lut(loop_filter_info_n *lfi)
{
int filt_lvl;
@ -279,20 +196,126 @@ void vp8_loop_filter_frame_init(VP8_COMMON *cm,
}
}
void vp8_loop_filter_frame
(
VP8_COMMON *cm,
MACROBLOCKD *mbd
)
void vp8_loop_filter_row_normal(VP8_COMMON *cm, MODE_INFO *mode_info_context,
int mb_row, int post_ystride, int post_uvstride,
unsigned char *y_ptr, unsigned char *u_ptr,
unsigned char *v_ptr)
{
int mb_col;
int filter_level;
loop_filter_info_n *lfi_n = &cm->lf_info;
loop_filter_info lfi;
FRAME_TYPE frame_type = cm->frame_type;
for (mb_col = 0; mb_col < cm->mb_cols; mb_col++)
{
int skip_lf = (mode_info_context->mbmi.mode != B_PRED &&
mode_info_context->mbmi.mode != SPLITMV &&
mode_info_context->mbmi.mb_skip_coeff);
const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi.mode];
const int seg = mode_info_context->mbmi.segment_id;
const int ref_frame = mode_info_context->mbmi.ref_frame;
filter_level = lfi_n->lvl[seg][ref_frame][mode_index];
if (filter_level)
{
const int hev_index = lfi_n->hev_thr_lut[frame_type][filter_level];
lfi.mblim = lfi_n->mblim[filter_level];
lfi.blim = lfi_n->blim[filter_level];
lfi.lim = lfi_n->lim[filter_level];
lfi.hev_thr = lfi_n->hev_thr[hev_index];
if (mb_col > 0)
vp8_loop_filter_mbv
(y_ptr, u_ptr, v_ptr, post_ystride, post_uvstride, &lfi);
if (!skip_lf)
vp8_loop_filter_bv
(y_ptr, u_ptr, v_ptr, post_ystride, post_uvstride, &lfi);
/* don't apply across umv border */
if (mb_row > 0)
vp8_loop_filter_mbh
(y_ptr, u_ptr, v_ptr, post_ystride, post_uvstride, &lfi);
if (!skip_lf)
vp8_loop_filter_bh
(y_ptr, u_ptr, v_ptr, post_ystride, post_uvstride, &lfi);
}
y_ptr += 16;
u_ptr += 8;
v_ptr += 8;
mode_info_context++; /* step to next MB */
}
}
void vp8_loop_filter_row_simple(VP8_COMMON *cm, MODE_INFO *mode_info_context,
int mb_row, int post_ystride, int post_uvstride,
unsigned char *y_ptr, unsigned char *u_ptr,
unsigned char *v_ptr)
{
int mb_col;
int filter_level;
loop_filter_info_n *lfi_n = &cm->lf_info;
for (mb_col = 0; mb_col < cm->mb_cols; mb_col++)
{
int skip_lf = (mode_info_context->mbmi.mode != B_PRED &&
mode_info_context->mbmi.mode != SPLITMV &&
mode_info_context->mbmi.mb_skip_coeff);
const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi.mode];
const int seg = mode_info_context->mbmi.segment_id;
const int ref_frame = mode_info_context->mbmi.ref_frame;
filter_level = lfi_n->lvl[seg][ref_frame][mode_index];
if (filter_level)
{
if (mb_col > 0)
vp8_loop_filter_simple_mbv
(y_ptr, post_ystride, lfi_n->mblim[filter_level]);
if (!skip_lf)
vp8_loop_filter_simple_bv
(y_ptr, post_ystride, lfi_n->blim[filter_level]);
/* don't apply across umv border */
if (mb_row > 0)
vp8_loop_filter_simple_mbh
(y_ptr, post_ystride, lfi_n->mblim[filter_level]);
if (!skip_lf)
vp8_loop_filter_simple_bh
(y_ptr, post_ystride, lfi_n->blim[filter_level]);
}
y_ptr += 16;
u_ptr += 8;
v_ptr += 8;
mode_info_context++; /* step to next MB */
}
}
void vp8_loop_filter_frame(VP8_COMMON *cm,
MACROBLOCKD *mbd,
int frame_type)
{
YV12_BUFFER_CONFIG *post = cm->frame_to_show;
loop_filter_info_n *lfi_n = &cm->lf_info;
loop_filter_info lfi;
FRAME_TYPE frame_type = cm->frame_type;
int mb_row;
int mb_col;
int mb_rows = cm->mb_rows;
int mb_cols = cm->mb_cols;
int filter_level;
@ -300,6 +323,8 @@ void vp8_loop_filter_frame
/* Point at base of Mb MODE_INFO list */
const MODE_INFO *mode_info_context = cm->mi;
int post_y_stride = post->y_stride;
int post_uv_stride = post->uv_stride;
/* Initialize the loop filter for this frame. */
vp8_loop_filter_frame_init(cm, mbd, cm->filter_level);
@ -310,23 +335,23 @@ void vp8_loop_filter_frame
v_ptr = post->v_buffer;
/* vp8_filter each macro block */
for (mb_row = 0; mb_row < cm->mb_rows; mb_row++)
if (cm->filter_type == NORMAL_LOOPFILTER)
{
for (mb_col = 0; mb_col < cm->mb_cols; mb_col++)
for (mb_row = 0; mb_row < mb_rows; mb_row++)
{
int skip_lf = (mode_info_context->mbmi.mode != B_PRED &&
mode_info_context->mbmi.mode != SPLITMV &&
mode_info_context->mbmi.mb_skip_coeff);
const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi.mode];
const int seg = mode_info_context->mbmi.segment_id;
const int ref_frame = mode_info_context->mbmi.ref_frame;
filter_level = lfi_n->lvl[seg][ref_frame][mode_index];
if (filter_level)
for (mb_col = 0; mb_col < mb_cols; mb_col++)
{
if (cm->filter_type == NORMAL_LOOPFILTER)
int skip_lf = (mode_info_context->mbmi.mode != B_PRED &&
mode_info_context->mbmi.mode != SPLITMV &&
mode_info_context->mbmi.mb_skip_coeff);
const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi.mode];
const int seg = mode_info_context->mbmi.segment_id;
const int ref_frame = mode_info_context->mbmi.ref_frame;
filter_level = lfi_n->lvl[seg][ref_frame][mode_index];
if (filter_level)
{
const int hev_index = lfi_n->hev_thr_lut[frame_type][filter_level];
lfi.mblim = lfi_n->mblim[filter_level];
@ -335,55 +360,88 @@ void vp8_loop_filter_frame
lfi.hev_thr = lfi_n->hev_thr[hev_index];
if (mb_col > 0)
LF_INVOKE(&cm->rtcd.loopfilter, normal_mb_v)
(y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi);
vp8_loop_filter_mbv
(y_ptr, u_ptr, v_ptr, post_y_stride, post_uv_stride, &lfi);
if (!skip_lf)
LF_INVOKE(&cm->rtcd.loopfilter, normal_b_v)
(y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi);
vp8_loop_filter_bv
(y_ptr, u_ptr, v_ptr, post_y_stride, post_uv_stride, &lfi);
/* don't apply across umv border */
if (mb_row > 0)
LF_INVOKE(&cm->rtcd.loopfilter, normal_mb_h)
(y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi);
vp8_loop_filter_mbh
(y_ptr, u_ptr, v_ptr, post_y_stride, post_uv_stride, &lfi);
if (!skip_lf)
LF_INVOKE(&cm->rtcd.loopfilter, normal_b_h)
(y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi);
vp8_loop_filter_bh
(y_ptr, u_ptr, v_ptr, post_y_stride, post_uv_stride, &lfi);
}
else
{
if (mb_col > 0)
LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_v)
(y_ptr, post->y_stride, lfi_n->mblim[filter_level]);
if (!skip_lf)
LF_INVOKE(&cm->rtcd.loopfilter, simple_b_v)
(y_ptr, post->y_stride, lfi_n->blim[filter_level]);
y_ptr += 16;
u_ptr += 8;
v_ptr += 8;
/* don't apply across umv border */
if (mb_row > 0)
LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_h)
(y_ptr, post->y_stride, lfi_n->mblim[filter_level]);
if (!skip_lf)
LF_INVOKE(&cm->rtcd.loopfilter, simple_b_h)
(y_ptr, post->y_stride, lfi_n->blim[filter_level]);
}
mode_info_context++; /* step to next MB */
}
y_ptr += post_y_stride * 16 - post->y_width;
u_ptr += post_uv_stride * 8 - post->uv_width;
v_ptr += post_uv_stride * 8 - post->uv_width;
y_ptr += 16;
u_ptr += 8;
v_ptr += 8;
mode_info_context++; /* Skip border mb */
mode_info_context++; /* step to next MB */
}
}
else /* SIMPLE_LOOPFILTER */
{
for (mb_row = 0; mb_row < mb_rows; mb_row++)
{
for (mb_col = 0; mb_col < mb_cols; mb_col++)
{
int skip_lf = (mode_info_context->mbmi.mode != B_PRED &&
mode_info_context->mbmi.mode != SPLITMV &&
mode_info_context->mbmi.mb_skip_coeff);
y_ptr += post->y_stride * 16 - post->y_width;
u_ptr += post->uv_stride * 8 - post->uv_width;
v_ptr += post->uv_stride * 8 - post->uv_width;
const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi.mode];
const int seg = mode_info_context->mbmi.segment_id;
const int ref_frame = mode_info_context->mbmi.ref_frame;
mode_info_context++; /* Skip border mb */
filter_level = lfi_n->lvl[seg][ref_frame][mode_index];
if (filter_level)
{
const unsigned char * mblim = lfi_n->mblim[filter_level];
const unsigned char * blim = lfi_n->blim[filter_level];
if (mb_col > 0)
vp8_loop_filter_simple_mbv
(y_ptr, post_y_stride, mblim);
if (!skip_lf)
vp8_loop_filter_simple_bv
(y_ptr, post_y_stride, blim);
/* don't apply across umv border */
if (mb_row > 0)
vp8_loop_filter_simple_mbh
(y_ptr, post_y_stride, mblim);
if (!skip_lf)
vp8_loop_filter_simple_bh
(y_ptr, post_y_stride, blim);
}
y_ptr += 16;
u_ptr += 8;
v_ptr += 8;
mode_info_context++; /* step to next MB */
}
y_ptr += post_y_stride * 16 - post->y_width;
u_ptr += post_uv_stride * 8 - post->uv_width;
v_ptr += post_uv_stride * 8 - post->uv_width;
mode_info_context++; /* Skip border mb */
}
}
}
@ -446,39 +504,39 @@ void vp8_loop_filter_frame_yonly
lfi.hev_thr = lfi_n->hev_thr[hev_index];
if (mb_col > 0)
LF_INVOKE(&cm->rtcd.loopfilter, normal_mb_v)
vp8_loop_filter_mbv
(y_ptr, 0, 0, post->y_stride, 0, &lfi);
if (!skip_lf)
LF_INVOKE(&cm->rtcd.loopfilter, normal_b_v)
vp8_loop_filter_bv
(y_ptr, 0, 0, post->y_stride, 0, &lfi);
/* don't apply across umv border */
if (mb_row > 0)
LF_INVOKE(&cm->rtcd.loopfilter, normal_mb_h)
vp8_loop_filter_mbh
(y_ptr, 0, 0, post->y_stride, 0, &lfi);
if (!skip_lf)
LF_INVOKE(&cm->rtcd.loopfilter, normal_b_h)
vp8_loop_filter_bh
(y_ptr, 0, 0, post->y_stride, 0, &lfi);
}
else
{
if (mb_col > 0)
LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_v)
vp8_loop_filter_simple_mbv
(y_ptr, post->y_stride, lfi_n->mblim[filter_level]);
if (!skip_lf)
LF_INVOKE(&cm->rtcd.loopfilter, simple_b_v)
vp8_loop_filter_simple_bv
(y_ptr, post->y_stride, lfi_n->blim[filter_level]);
/* don't apply across umv border */
if (mb_row > 0)
LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_h)
vp8_loop_filter_simple_mbh
(y_ptr, post->y_stride, lfi_n->mblim[filter_level]);
if (!skip_lf)
LF_INVOKE(&cm->rtcd.loopfilter, simple_b_h)
vp8_loop_filter_simple_bh
(y_ptr, post->y_stride, lfi_n->blim[filter_level]);
}
}
@ -578,35 +636,35 @@ void vp8_loop_filter_partial_frame
lfi.hev_thr = lfi_n->hev_thr[hev_index];
if (mb_col > 0)
LF_INVOKE(&cm->rtcd.loopfilter, normal_mb_v)
vp8_loop_filter_mbv
(y_ptr, 0, 0, post->y_stride, 0, &lfi);
if (!skip_lf)
LF_INVOKE(&cm->rtcd.loopfilter, normal_b_v)
vp8_loop_filter_bv
(y_ptr, 0, 0, post->y_stride, 0, &lfi);
LF_INVOKE(&cm->rtcd.loopfilter, normal_mb_h)
vp8_loop_filter_mbh
(y_ptr, 0, 0, post->y_stride, 0, &lfi);
if (!skip_lf)
LF_INVOKE(&cm->rtcd.loopfilter, normal_b_h)
vp8_loop_filter_bh
(y_ptr, 0, 0, post->y_stride, 0, &lfi);
}
else
{
if (mb_col > 0)
LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_v)
vp8_loop_filter_simple_mbv
(y_ptr, post->y_stride, lfi_n->mblim[filter_level]);
if (!skip_lf)
LF_INVOKE(&cm->rtcd.loopfilter, simple_b_v)
vp8_loop_filter_simple_bv
(y_ptr, post->y_stride, lfi_n->blim[filter_level]);
LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_h)
vp8_loop_filter_simple_mbh
(y_ptr, post->y_stride, lfi_n->mblim[filter_level]);
if (!skip_lf)
LF_INVOKE(&cm->rtcd.loopfilter, simple_b_h)
vp8_loop_filter_simple_bh
(y_ptr, post->y_stride, lfi_n->blim[filter_level]);
}
}

Просмотреть файл

@ -14,6 +14,7 @@
#include "vpx_ports/mem.h"
#include "vpx_config.h"
#include "vpx_rtcd.h"
#define MAX_LOOP_FILTER 63
/* fraction of total macroblock rows to be used in fast filter level picking */
@ -46,7 +47,7 @@ typedef struct
unsigned char mode_lf_lut[10];
} loop_filter_info_n;
typedef struct
typedef struct loop_filter_info
{
const unsigned char * mblim;
const unsigned char * blim;
@ -55,86 +56,6 @@ typedef struct
} loop_filter_info;
#define prototype_loopfilter(sym) \
void sym(unsigned char *src, int pitch, const unsigned char *blimit,\
const unsigned char *limit, const unsigned char *thresh, int count)
#define prototype_loopfilter_block(sym) \
void sym(unsigned char *y, unsigned char *u, unsigned char *v, \
int ystride, int uv_stride, loop_filter_info *lfi)
#define prototype_simple_loopfilter(sym) \
void sym(unsigned char *y, int ystride, const unsigned char *blimit)
#if ARCH_X86 || ARCH_X86_64
#include "x86/loopfilter_x86.h"
#endif
#if ARCH_ARM
#include "arm/loopfilter_arm.h"
#endif
#ifndef vp8_lf_normal_mb_v
#define vp8_lf_normal_mb_v vp8_loop_filter_mbv_c
#endif
extern prototype_loopfilter_block(vp8_lf_normal_mb_v);
#ifndef vp8_lf_normal_b_v
#define vp8_lf_normal_b_v vp8_loop_filter_bv_c
#endif
extern prototype_loopfilter_block(vp8_lf_normal_b_v);
#ifndef vp8_lf_normal_mb_h
#define vp8_lf_normal_mb_h vp8_loop_filter_mbh_c
#endif
extern prototype_loopfilter_block(vp8_lf_normal_mb_h);
#ifndef vp8_lf_normal_b_h
#define vp8_lf_normal_b_h vp8_loop_filter_bh_c
#endif
extern prototype_loopfilter_block(vp8_lf_normal_b_h);
#ifndef vp8_lf_simple_mb_v
#define vp8_lf_simple_mb_v vp8_loop_filter_simple_vertical_edge_c
#endif
extern prototype_simple_loopfilter(vp8_lf_simple_mb_v);
#ifndef vp8_lf_simple_b_v
#define vp8_lf_simple_b_v vp8_loop_filter_bvs_c
#endif
extern prototype_simple_loopfilter(vp8_lf_simple_b_v);
#ifndef vp8_lf_simple_mb_h
#define vp8_lf_simple_mb_h vp8_loop_filter_simple_horizontal_edge_c
#endif
extern prototype_simple_loopfilter(vp8_lf_simple_mb_h);
#ifndef vp8_lf_simple_b_h
#define vp8_lf_simple_b_h vp8_loop_filter_bhs_c
#endif
extern prototype_simple_loopfilter(vp8_lf_simple_b_h);
typedef prototype_loopfilter_block((*vp8_lf_block_fn_t));
typedef prototype_simple_loopfilter((*vp8_slf_block_fn_t));
typedef struct
{
vp8_lf_block_fn_t normal_mb_v;
vp8_lf_block_fn_t normal_b_v;
vp8_lf_block_fn_t normal_mb_h;
vp8_lf_block_fn_t normal_b_h;
vp8_slf_block_fn_t simple_mb_v;
vp8_slf_block_fn_t simple_b_v;
vp8_slf_block_fn_t simple_mb_h;
vp8_slf_block_fn_t simple_b_h;
} vp8_loopfilter_rtcd_vtable_t;
#if CONFIG_RUNTIME_CPU_DETECT
#define LF_INVOKE(ctx,fn) (ctx)->fn
#else
#define LF_INVOKE(ctx,fn) vp8_lf_##fn
#endif
typedef void loop_filter_uvfunction
(
unsigned char *u, /* source pointer */
@ -147,25 +68,38 @@ typedef void loop_filter_uvfunction
/* assorted loopfilter functions which get used elsewhere */
struct VP8Common;
struct MacroBlockD;
struct macroblockd;
struct modeinfo;
void vp8_loop_filter_init(struct VP8Common *cm);
void vp8_loop_filter_frame_init(struct VP8Common *cm,
struct MacroBlockD *mbd,
struct macroblockd *mbd,
int default_filt_lvl);
void vp8_loop_filter_frame(struct VP8Common *cm, struct MacroBlockD *mbd);
void vp8_loop_filter_frame(struct VP8Common *cm, struct macroblockd *mbd,
int frame_type);
void vp8_loop_filter_partial_frame(struct VP8Common *cm,
struct MacroBlockD *mbd,
struct macroblockd *mbd,
int default_filt_lvl);
void vp8_loop_filter_frame_yonly(struct VP8Common *cm,
struct MacroBlockD *mbd,
struct macroblockd *mbd,
int default_filt_lvl);
void vp8_loop_filter_update_sharpness(loop_filter_info_n *lfi,
int sharpness_lvl);
void vp8_loop_filter_row_normal(struct VP8Common *cm,
struct modeinfo *mode_info_context,
int mb_row, int post_ystride, int post_uvstride,
unsigned char *y_ptr, unsigned char *u_ptr,
unsigned char *v_ptr);
void vp8_loop_filter_row_simple(struct VP8Common *cm,
struct modeinfo *mode_info_context,
int mb_row, int post_ystride, int post_uvstride,
unsigned char *y_ptr, unsigned char *u_ptr,
unsigned char *v_ptr);
#endif

Просмотреть файл

@ -352,3 +352,79 @@ void vp8_loop_filter_simple_vertical_edge_c
while (++i < 16);
}
/* Horizontal MB filtering */
void vp8_loop_filter_mbh_c(unsigned char *y_ptr, unsigned char *u_ptr,
unsigned char *v_ptr, int y_stride, int uv_stride,
loop_filter_info *lfi)
{
vp8_mbloop_filter_horizontal_edge_c(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2);
if (u_ptr)
vp8_mbloop_filter_horizontal_edge_c(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1);
if (v_ptr)
vp8_mbloop_filter_horizontal_edge_c(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1);
}
/* Vertical MB Filtering */
void vp8_loop_filter_mbv_c(unsigned char *y_ptr, unsigned char *u_ptr,
unsigned char *v_ptr, int y_stride, int uv_stride,
loop_filter_info *lfi)
{
vp8_mbloop_filter_vertical_edge_c(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2);
if (u_ptr)
vp8_mbloop_filter_vertical_edge_c(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1);
if (v_ptr)
vp8_mbloop_filter_vertical_edge_c(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1);
}
/* Horizontal B Filtering */
void vp8_loop_filter_bh_c(unsigned char *y_ptr, unsigned char *u_ptr,
unsigned char *v_ptr, int y_stride, int uv_stride,
loop_filter_info *lfi)
{
vp8_loop_filter_horizontal_edge_c(y_ptr + 4 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
vp8_loop_filter_horizontal_edge_c(y_ptr + 8 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
vp8_loop_filter_horizontal_edge_c(y_ptr + 12 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
if (u_ptr)
vp8_loop_filter_horizontal_edge_c(u_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1);
if (v_ptr)
vp8_loop_filter_horizontal_edge_c(v_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1);
}
void vp8_loop_filter_bhs_c(unsigned char *y_ptr, int y_stride,
const unsigned char *blimit)
{
vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 4 * y_stride, y_stride, blimit);
vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 8 * y_stride, y_stride, blimit);
vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 12 * y_stride, y_stride, blimit);
}
/* Vertical B Filtering */
void vp8_loop_filter_bv_c(unsigned char *y_ptr, unsigned char *u_ptr,
unsigned char *v_ptr, int y_stride, int uv_stride,
loop_filter_info *lfi)
{
vp8_loop_filter_vertical_edge_c(y_ptr + 4, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
vp8_loop_filter_vertical_edge_c(y_ptr + 8, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
vp8_loop_filter_vertical_edge_c(y_ptr + 12, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
if (u_ptr)
vp8_loop_filter_vertical_edge_c(u_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1);
if (v_ptr)
vp8_loop_filter_vertical_edge_c(v_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1);
}
void vp8_loop_filter_bvs_c(unsigned char *y_ptr, int y_stride,
const unsigned char *blimit)
{
vp8_loop_filter_simple_vertical_edge_c(y_ptr + 4, y_stride, blimit);
vp8_loop_filter_simple_vertical_edge_c(y_ptr + 8, y_stride, blimit);
vp8_loop_filter_simple_vertical_edge_c(y_ptr + 12, y_stride, blimit);
}

Просмотреть файл

@ -11,74 +11,6 @@
#include "blockd.h"
typedef enum
{
PRED = 0,
DEST = 1
} BLOCKSET;
static void setup_block
(
BLOCKD *b,
int mv_stride,
unsigned char **base,
int Stride,
int offset,
BLOCKSET bs
)
{
if (bs == DEST)
{
b->dst_stride = Stride;
b->dst = offset;
b->base_dst = base;
}
else
{
b->pre_stride = Stride;
b->pre = offset;
b->base_pre = base;
}
}
static void setup_macroblock(MACROBLOCKD *x, BLOCKSET bs)
{
int block;
unsigned char **y, **u, **v;
if (bs == DEST)
{
y = &x->dst.y_buffer;
u = &x->dst.u_buffer;
v = &x->dst.v_buffer;
}
else
{
y = &x->pre.y_buffer;
u = &x->pre.u_buffer;
v = &x->pre.v_buffer;
}
for (block = 0; block < 16; block++) /* y blocks */
{
setup_block(&x->block[block], x->dst.y_stride, y, x->dst.y_stride,
(block >> 2) * 4 * x->dst.y_stride + (block & 3) * 4, bs);
}
for (block = 16; block < 20; block++) /* U and V blocks */
{
setup_block(&x->block[block], x->dst.uv_stride, u, x->dst.uv_stride,
((block - 16) >> 1) * 4 * x->dst.uv_stride + (block & 1) * 4, bs);
setup_block(&x->block[block+4], x->dst.uv_stride, v, x->dst.uv_stride,
((block - 16) >> 1) * 4 * x->dst.uv_stride + (block & 1) * 4, bs);
}
}
void vp8_setup_block_dptrs(MACROBLOCKD *x)
{
int r, c;
@ -119,8 +51,18 @@ void vp8_setup_block_dptrs(MACROBLOCKD *x)
void vp8_build_block_doffsets(MACROBLOCKD *x)
{
int block;
/* handle the destination pitch features */
setup_macroblock(x, DEST);
setup_macroblock(x, PRED);
for (block = 0; block < 16; block++) /* y blocks */
{
x->block[block].offset =
(block >> 2) * 4 * x->dst.y_stride + (block & 3) * 4;
}
for (block = 16; block < 20; block++) /* U and V blocks */
{
x->block[block+4].offset =
x->block[block].offset =
((block - 16) >> 1) * 4 * x->dst.uv_stride + (block & 1) * 4;
}
}

Просмотреть файл

@ -0,0 +1,385 @@
/*
* Copyright (c) 2012 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.
*/
/* MFQE: Multiframe Quality Enhancement
* In rate limited situations keyframes may cause significant visual artifacts
* commonly referred to as "popping." This file implements a postproccesing
* algorithm which blends data from the preceeding frame when there is no
* motion and the q from the previous frame is lower which indicates that it is
* higher quality.
*/
#include "postproc.h"
#include "variance.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_rtcd.h"
#include "vpx_scale/yv12config.h"
#include <limits.h>
#include <stdlib.h>
static void filter_by_weight(unsigned char *src, int src_stride,
unsigned char *dst, int dst_stride,
int block_size, int src_weight)
{
int dst_weight = (1 << MFQE_PRECISION) - src_weight;
int rounding_bit = 1 << (MFQE_PRECISION - 1);
int r, c;
for (r = 0; r < block_size; r++)
{
for (c = 0; c < block_size; c++)
{
dst[c] = (src[c] * src_weight +
dst[c] * dst_weight +
rounding_bit) >> MFQE_PRECISION;
}
src += src_stride;
dst += dst_stride;
}
}
void vp8_filter_by_weight16x16_c(unsigned char *src, int src_stride,
unsigned char *dst, int dst_stride,
int src_weight)
{
filter_by_weight(src, src_stride, dst, dst_stride, 16, src_weight);
}
void vp8_filter_by_weight8x8_c(unsigned char *src, int src_stride,
unsigned char *dst, int dst_stride,
int src_weight)
{
filter_by_weight(src, src_stride, dst, dst_stride, 8, src_weight);
}
void vp8_filter_by_weight4x4_c(unsigned char *src, int src_stride,
unsigned char *dst, int dst_stride,
int src_weight)
{
filter_by_weight(src, src_stride, dst, dst_stride, 4, src_weight);
}
static void apply_ifactor(unsigned char *y_src,
int y_src_stride,
unsigned char *y_dst,
int y_dst_stride,
unsigned char *u_src,
unsigned char *v_src,
int uv_src_stride,
unsigned char *u_dst,
unsigned char *v_dst,
int uv_dst_stride,
int block_size,
int src_weight)
{
if (block_size == 16)
{
vp8_filter_by_weight16x16(y_src, y_src_stride, y_dst, y_dst_stride, src_weight);
vp8_filter_by_weight8x8(u_src, uv_src_stride, u_dst, uv_dst_stride, src_weight);
vp8_filter_by_weight8x8(v_src, uv_src_stride, v_dst, uv_dst_stride, src_weight);
}
else /* if (block_size == 8) */
{
vp8_filter_by_weight8x8(y_src, y_src_stride, y_dst, y_dst_stride, src_weight);
vp8_filter_by_weight4x4(u_src, uv_src_stride, u_dst, uv_dst_stride, src_weight);
vp8_filter_by_weight4x4(v_src, uv_src_stride, v_dst, uv_dst_stride, src_weight);
}
}
static unsigned int int_sqrt(unsigned int x)
{
unsigned int y = x;
unsigned int guess;
int p = 1;
while (y>>=1) p++;
p>>=1;
guess=0;
while (p>=0)
{
guess |= (1<<p);
if (x<guess*guess)
guess -= (1<<p);
p--;
}
/* choose between guess or guess+1 */
return guess+(guess*guess+guess+1<=x);
}
#define USE_SSD
static void multiframe_quality_enhance_block
(
int blksize, /* Currently only values supported are 16, 8 */
int qcurr,
int qprev,
unsigned char *y,
unsigned char *u,
unsigned char *v,
int y_stride,
int uv_stride,
unsigned char *yd,
unsigned char *ud,
unsigned char *vd,
int yd_stride,
int uvd_stride
)
{
static const unsigned char VP8_ZEROS[16]=
{
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
};
int uvblksize = blksize >> 1;
int qdiff = qcurr - qprev;
int i;
unsigned char *up;
unsigned char *udp;
unsigned char *vp;
unsigned char *vdp;
unsigned int act, actd, sad, usad, vsad, sse, thr, thrsq, actrisk;
if (blksize == 16)
{
actd = (vp8_variance16x16(yd, yd_stride, VP8_ZEROS, 0, &sse)+128)>>8;
act = (vp8_variance16x16(y, y_stride, VP8_ZEROS, 0, &sse)+128)>>8;
#ifdef USE_SSD
sad = (vp8_variance16x16(y, y_stride, yd, yd_stride, &sse));
sad = (sse + 128)>>8;
usad = (vp8_variance8x8(u, uv_stride, ud, uvd_stride, &sse));
usad = (sse + 32)>>6;
vsad = (vp8_variance8x8(v, uv_stride, vd, uvd_stride, &sse));
vsad = (sse + 32)>>6;
#else
sad = (vp8_sad16x16(y, y_stride, yd, yd_stride, UINT_MAX) + 128) >> 8;
usad = (vp8_sad8x8(u, uv_stride, ud, uvd_stride, UINT_MAX) + 32) >> 6;
vsad = (vp8_sad8x8(v, uv_stride, vd, uvd_stride, UINT_MAX)+ 32) >> 6;
#endif
}
else /* if (blksize == 8) */
{
actd = (vp8_variance8x8(yd, yd_stride, VP8_ZEROS, 0, &sse)+32)>>6;
act = (vp8_variance8x8(y, y_stride, VP8_ZEROS, 0, &sse)+32)>>6;
#ifdef USE_SSD
sad = (vp8_variance8x8(y, y_stride, yd, yd_stride, &sse));
sad = (sse + 32)>>6;
usad = (vp8_variance4x4(u, uv_stride, ud, uvd_stride, &sse));
usad = (sse + 8)>>4;
vsad = (vp8_variance4x4(v, uv_stride, vd, uvd_stride, &sse));
vsad = (sse + 8)>>4;
#else
sad = (vp8_sad8x8(y, y_stride, yd, yd_stride, UINT_MAX) + 32) >> 6;
usad = (vp8_sad4x4(u, uv_stride, ud, uvd_stride, UINT_MAX) + 8) >> 4;
vsad = (vp8_sad4x4(v, uv_stride, vd, uvd_stride, UINT_MAX) + 8) >> 4;
#endif
}
actrisk = (actd > act * 5);
/* thr = qdiff/16 + log2(act) + log4(qprev) */
thr = (qdiff >> 4);
while (actd >>= 1) thr++;
while (qprev >>= 2) thr++;
#ifdef USE_SSD
thrsq = thr * thr;
if (sad < thrsq &&
/* additional checks for color mismatch and excessive addition of
* high-frequencies */
4 * usad < thrsq && 4 * vsad < thrsq && !actrisk)
#else
if (sad < thr &&
/* additional checks for color mismatch and excessive addition of
* high-frequencies */
2 * usad < thr && 2 * vsad < thr && !actrisk)
#endif
{
int ifactor;
#ifdef USE_SSD
/* TODO: optimize this later to not need sqr root */
sad = int_sqrt(sad);
#endif
ifactor = (sad << MFQE_PRECISION) / thr;
ifactor >>= (qdiff >> 5);
if (ifactor)
{
apply_ifactor(y, y_stride, yd, yd_stride,
u, v, uv_stride,
ud, vd, uvd_stride,
blksize, ifactor);
}
}
else /* else implicitly copy from previous frame */
{
if (blksize == 16)
{
vp8_copy_mem16x16(y, y_stride, yd, yd_stride);
vp8_copy_mem8x8(u, uv_stride, ud, uvd_stride);
vp8_copy_mem8x8(v, uv_stride, vd, uvd_stride);
}
else /* if (blksize == 8) */
{
vp8_copy_mem8x8(y, y_stride, yd, yd_stride);
for (up = u, udp = ud, i = 0; i < uvblksize; ++i, up += uv_stride, udp += uvd_stride)
vpx_memcpy(udp, up, uvblksize);
for (vp = v, vdp = vd, i = 0; i < uvblksize; ++i, vp += uv_stride, vdp += uvd_stride)
vpx_memcpy(vdp, vp, uvblksize);
}
}
}
static int qualify_inter_mb(const MODE_INFO *mode_info_context, int *map)
{
if (mode_info_context->mbmi.mb_skip_coeff)
map[0] = map[1] = map[2] = map[3] = 1;
else if (mode_info_context->mbmi.mode==SPLITMV)
{
static int ndx[4][4] =
{
{0, 1, 4, 5},
{2, 3, 6, 7},
{8, 9, 12, 13},
{10, 11, 14, 15}
};
int i, j;
for (i=0; i<4; ++i)
{
map[i] = 1;
for (j=0; j<4 && map[j]; ++j)
map[i] &= (mode_info_context->bmi[ndx[i][j]].mv.as_mv.row <= 2 &&
mode_info_context->bmi[ndx[i][j]].mv.as_mv.col <= 2);
}
}
else
{
map[0] = map[1] = map[2] = map[3] =
(mode_info_context->mbmi.mode > B_PRED &&
abs(mode_info_context->mbmi.mv.as_mv.row) <= 2 &&
abs(mode_info_context->mbmi.mv.as_mv.col) <= 2);
}
return (map[0]+map[1]+map[2]+map[3]);
}
void vp8_multiframe_quality_enhance
(
VP8_COMMON *cm
)
{
YV12_BUFFER_CONFIG *show = cm->frame_to_show;
YV12_BUFFER_CONFIG *dest = &cm->post_proc_buffer;
FRAME_TYPE frame_type = cm->frame_type;
/* Point at base of Mb MODE_INFO list has motion vectors etc */
const MODE_INFO *mode_info_context = cm->mi;
int mb_row;
int mb_col;
int totmap, map[4];
int qcurr = cm->base_qindex;
int qprev = cm->postproc_state.last_base_qindex;
unsigned char *y_ptr, *u_ptr, *v_ptr;
unsigned char *yd_ptr, *ud_ptr, *vd_ptr;
/* Set up the buffer pointers */
y_ptr = show->y_buffer;
u_ptr = show->u_buffer;
v_ptr = show->v_buffer;
yd_ptr = dest->y_buffer;
ud_ptr = dest->u_buffer;
vd_ptr = dest->v_buffer;
/* postprocess each macro block */
for (mb_row = 0; mb_row < cm->mb_rows; mb_row++)
{
for (mb_col = 0; mb_col < cm->mb_cols; mb_col++)
{
/* if motion is high there will likely be no benefit */
if (frame_type == INTER_FRAME) totmap = qualify_inter_mb(mode_info_context, map);
else totmap = (frame_type == KEY_FRAME ? 4 : 0);
if (totmap)
{
if (totmap < 4)
{
int i, j;
for (i=0; i<2; ++i)
for (j=0; j<2; ++j)
{
if (map[i*2+j])
{
multiframe_quality_enhance_block(8, qcurr, qprev,
y_ptr + 8*(i*show->y_stride+j),
u_ptr + 4*(i*show->uv_stride+j),
v_ptr + 4*(i*show->uv_stride+j),
show->y_stride,
show->uv_stride,
yd_ptr + 8*(i*dest->y_stride+j),
ud_ptr + 4*(i*dest->uv_stride+j),
vd_ptr + 4*(i*dest->uv_stride+j),
dest->y_stride,
dest->uv_stride);
}
else
{
/* copy a 8x8 block */
int k;
unsigned char *up = u_ptr + 4*(i*show->uv_stride+j);
unsigned char *udp = ud_ptr + 4*(i*dest->uv_stride+j);
unsigned char *vp = v_ptr + 4*(i*show->uv_stride+j);
unsigned char *vdp = vd_ptr + 4*(i*dest->uv_stride+j);
vp8_copy_mem8x8(y_ptr + 8*(i*show->y_stride+j), show->y_stride,
yd_ptr + 8*(i*dest->y_stride+j), dest->y_stride);
for (k = 0; k < 4; ++k, up += show->uv_stride, udp += dest->uv_stride,
vp += show->uv_stride, vdp += dest->uv_stride)
{
vpx_memcpy(udp, up, 4);
vpx_memcpy(vdp, vp, 4);
}
}
}
}
else /* totmap = 4 */
{
multiframe_quality_enhance_block(16, qcurr, qprev, y_ptr,
u_ptr, v_ptr,
show->y_stride,
show->uv_stride,
yd_ptr, ud_ptr, vd_ptr,
dest->y_stride,
dest->uv_stride);
}
}
else
{
vp8_copy_mem16x16(y_ptr, show->y_stride, yd_ptr, dest->y_stride);
vp8_copy_mem8x8(u_ptr, show->uv_stride, ud_ptr, dest->uv_stride);
vp8_copy_mem8x8(v_ptr, show->uv_stride, vd_ptr, dest->uv_stride);
}
y_ptr += 16;
u_ptr += 8;
v_ptr += 8;
yd_ptr += 16;
ud_ptr += 8;
vd_ptr += 8;
mode_info_context++; /* step to next MB */
}
y_ptr += show->y_stride * 16 - 16 * cm->mb_cols;
u_ptr += show->uv_stride * 8 - 8 * cm->mb_cols;
v_ptr += show->uv_stride * 8 - 8 * cm->mb_cols;
yd_ptr += dest->y_stride * 16 - 16 * cm->mb_cols;
ud_ptr += dest->uv_stride * 8 - 8 * cm->mb_cols;
vd_ptr += dest->uv_stride * 8 - 8 * cm->mb_cols;
mode_info_context++; /* Skip border mb */
}
}

Просмотреть файл

@ -1,146 +0,0 @@
/*
* Copyright (c) 2010 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.
*/
#include "entropymode.h"
const unsigned int vp8_kf_default_bmode_counts [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES] =
{
{
/*Above Mode : 0*/
{ 43438, 2195, 470, 316, 615, 171, 217, 412, 124, 160, }, /* left_mode 0 */
{ 5722, 2751, 296, 291, 81, 68, 80, 101, 100, 170, }, /* left_mode 1 */
{ 1629, 201, 307, 25, 47, 16, 34, 72, 19, 28, }, /* left_mode 2 */
{ 332, 266, 36, 500, 20, 65, 23, 14, 154, 106, }, /* left_mode 3 */
{ 450, 97, 10, 24, 117, 10, 2, 12, 8, 71, }, /* left_mode 4 */
{ 384, 49, 29, 44, 12, 162, 51, 5, 87, 42, }, /* left_mode 5 */
{ 495, 53, 157, 27, 14, 57, 180, 17, 17, 34, }, /* left_mode 6 */
{ 695, 64, 62, 9, 27, 5, 3, 147, 10, 26, }, /* left_mode 7 */
{ 230, 54, 20, 124, 16, 125, 29, 12, 283, 37, }, /* left_mode 8 */
{ 260, 87, 21, 120, 32, 16, 33, 16, 33, 203, }, /* left_mode 9 */
},
{
/*Above Mode : 1*/
{ 3934, 2573, 355, 137, 128, 87, 133, 117, 37, 27, }, /* left_mode 0 */
{ 1036, 1929, 278, 135, 27, 37, 48, 55, 41, 91, }, /* left_mode 1 */
{ 223, 256, 253, 15, 13, 9, 28, 64, 3, 3, }, /* left_mode 2 */
{ 120, 129, 17, 316, 15, 11, 9, 4, 53, 74, }, /* left_mode 3 */
{ 129, 58, 6, 11, 38, 2, 0, 5, 2, 67, }, /* left_mode 4 */
{ 53, 22, 11, 16, 8, 26, 14, 3, 19, 12, }, /* left_mode 5 */
{ 59, 26, 61, 11, 4, 9, 35, 13, 8, 8, }, /* left_mode 6 */
{ 101, 52, 40, 8, 5, 2, 8, 59, 2, 20, }, /* left_mode 7 */
{ 48, 34, 10, 52, 8, 15, 6, 6, 63, 20, }, /* left_mode 8 */
{ 96, 48, 22, 63, 11, 14, 5, 8, 9, 96, }, /* left_mode 9 */
},
{
/*Above Mode : 2*/
{ 709, 461, 506, 36, 27, 33, 151, 98, 24, 6, }, /* left_mode 0 */
{ 201, 375, 442, 27, 13, 8, 46, 58, 6, 19, }, /* left_mode 1 */
{ 122, 140, 417, 4, 13, 3, 33, 59, 4, 2, }, /* left_mode 2 */
{ 36, 17, 22, 16, 6, 8, 12, 17, 9, 21, }, /* left_mode 3 */
{ 51, 15, 7, 1, 14, 0, 4, 5, 3, 22, }, /* left_mode 4 */
{ 18, 11, 30, 9, 7, 20, 11, 5, 2, 6, }, /* left_mode 5 */
{ 38, 21, 103, 9, 4, 12, 79, 13, 2, 5, }, /* left_mode 6 */
{ 64, 17, 66, 2, 12, 4, 2, 65, 4, 5, }, /* left_mode 7 */
{ 14, 7, 7, 16, 3, 11, 4, 13, 15, 16, }, /* left_mode 8 */
{ 36, 8, 32, 9, 9, 4, 14, 7, 6, 24, }, /* left_mode 9 */
},
{
/*Above Mode : 3*/
{ 1340, 173, 36, 119, 30, 10, 13, 10, 20, 26, }, /* left_mode 0 */
{ 156, 293, 26, 108, 5, 16, 2, 4, 23, 30, }, /* left_mode 1 */
{ 60, 34, 13, 7, 3, 3, 0, 8, 4, 5, }, /* left_mode 2 */
{ 72, 64, 1, 235, 3, 9, 2, 7, 28, 38, }, /* left_mode 3 */
{ 29, 14, 1, 3, 5, 0, 2, 2, 5, 13, }, /* left_mode 4 */
{ 22, 7, 4, 11, 2, 5, 1, 2, 6, 4, }, /* left_mode 5 */
{ 18, 14, 5, 6, 4, 3, 14, 0, 9, 2, }, /* left_mode 6 */
{ 41, 10, 7, 1, 2, 0, 0, 10, 2, 1, }, /* left_mode 7 */
{ 23, 19, 2, 33, 1, 5, 2, 0, 51, 8, }, /* left_mode 8 */
{ 33, 26, 7, 53, 3, 9, 3, 3, 9, 19, }, /* left_mode 9 */
},
{
/*Above Mode : 4*/
{ 410, 165, 43, 31, 66, 15, 30, 54, 8, 17, }, /* left_mode 0 */
{ 115, 64, 27, 18, 30, 7, 11, 15, 4, 19, }, /* left_mode 1 */
{ 31, 23, 25, 1, 7, 2, 2, 10, 0, 5, }, /* left_mode 2 */
{ 17, 4, 1, 6, 8, 2, 7, 5, 5, 21, }, /* left_mode 3 */
{ 120, 12, 1, 2, 83, 3, 0, 4, 1, 40, }, /* left_mode 4 */
{ 4, 3, 1, 2, 1, 2, 5, 0, 3, 6, }, /* left_mode 5 */
{ 10, 2, 13, 6, 6, 6, 8, 2, 4, 5, }, /* left_mode 6 */
{ 58, 10, 5, 1, 28, 1, 1, 33, 1, 9, }, /* left_mode 7 */
{ 8, 2, 1, 4, 2, 5, 1, 1, 2, 10, }, /* left_mode 8 */
{ 76, 7, 5, 7, 18, 2, 2, 0, 5, 45, }, /* left_mode 9 */
},
{
/*Above Mode : 5*/
{ 444, 46, 47, 20, 14, 110, 60, 14, 60, 7, }, /* left_mode 0 */
{ 59, 57, 25, 18, 3, 17, 21, 6, 14, 6, }, /* left_mode 1 */
{ 24, 17, 20, 6, 4, 13, 7, 2, 3, 2, }, /* left_mode 2 */
{ 13, 11, 5, 14, 4, 9, 2, 4, 15, 7, }, /* left_mode 3 */
{ 8, 5, 2, 1, 4, 0, 1, 1, 2, 12, }, /* left_mode 4 */
{ 19, 5, 5, 7, 4, 40, 6, 3, 10, 4, }, /* left_mode 5 */
{ 16, 5, 9, 1, 1, 16, 26, 2, 10, 4, }, /* left_mode 6 */
{ 11, 4, 8, 1, 1, 4, 4, 5, 4, 1, }, /* left_mode 7 */
{ 15, 1, 3, 7, 3, 21, 7, 1, 34, 5, }, /* left_mode 8 */
{ 18, 5, 1, 3, 4, 3, 7, 1, 2, 9, }, /* left_mode 9 */
},
{
/*Above Mode : 6*/
{ 476, 149, 94, 13, 14, 77, 291, 27, 23, 3, }, /* left_mode 0 */
{ 79, 83, 42, 14, 2, 12, 63, 2, 4, 14, }, /* left_mode 1 */
{ 43, 36, 55, 1, 3, 8, 42, 11, 5, 1, }, /* left_mode 2 */
{ 9, 9, 6, 16, 1, 5, 6, 3, 11, 10, }, /* left_mode 3 */
{ 10, 3, 1, 3, 10, 1, 0, 1, 1, 4, }, /* left_mode 4 */
{ 14, 6, 15, 5, 1, 20, 25, 2, 5, 0, }, /* left_mode 5 */
{ 28, 7, 51, 1, 0, 8, 127, 6, 2, 5, }, /* left_mode 6 */
{ 13, 3, 3, 2, 3, 1, 2, 8, 1, 2, }, /* left_mode 7 */
{ 10, 3, 3, 3, 3, 8, 2, 2, 9, 3, }, /* left_mode 8 */
{ 13, 7, 11, 4, 0, 4, 6, 2, 5, 8, }, /* left_mode 9 */
},
{
/*Above Mode : 7*/
{ 376, 135, 119, 6, 32, 8, 31, 224, 9, 3, }, /* left_mode 0 */
{ 93, 60, 54, 6, 13, 7, 8, 92, 2, 12, }, /* left_mode 1 */
{ 74, 36, 84, 0, 3, 2, 9, 67, 2, 1, }, /* left_mode 2 */
{ 19, 4, 4, 8, 8, 2, 4, 7, 6, 16, }, /* left_mode 3 */
{ 51, 7, 4, 1, 77, 3, 0, 14, 1, 15, }, /* left_mode 4 */
{ 7, 7, 5, 7, 4, 7, 4, 5, 0, 3, }, /* left_mode 5 */
{ 18, 2, 19, 2, 2, 4, 12, 11, 1, 2, }, /* left_mode 6 */
{ 129, 6, 27, 1, 21, 3, 0, 189, 0, 6, }, /* left_mode 7 */
{ 9, 1, 2, 8, 3, 7, 0, 5, 3, 3, }, /* left_mode 8 */
{ 20, 4, 5, 10, 4, 2, 7, 17, 3, 16, }, /* left_mode 9 */
},
{
/*Above Mode : 8*/
{ 617, 68, 34, 79, 11, 27, 25, 14, 75, 13, }, /* left_mode 0 */
{ 51, 82, 21, 26, 6, 12, 13, 1, 26, 16, }, /* left_mode 1 */
{ 29, 9, 12, 11, 3, 7, 1, 10, 2, 2, }, /* left_mode 2 */
{ 17, 19, 11, 74, 4, 3, 2, 0, 58, 13, }, /* left_mode 3 */
{ 10, 1, 1, 3, 4, 1, 0, 2, 1, 8, }, /* left_mode 4 */
{ 14, 4, 5, 5, 1, 13, 2, 0, 27, 8, }, /* left_mode 5 */
{ 10, 3, 5, 4, 1, 7, 6, 4, 5, 1, }, /* left_mode 6 */
{ 10, 2, 6, 2, 1, 1, 1, 4, 2, 1, }, /* left_mode 7 */
{ 14, 8, 5, 23, 2, 12, 6, 2, 117, 5, }, /* left_mode 8 */
{ 9, 6, 2, 19, 1, 6, 3, 2, 9, 9, }, /* left_mode 9 */
},
{
/*Above Mode : 9*/
{ 680, 73, 22, 38, 42, 5, 11, 9, 6, 28, }, /* left_mode 0 */
{ 113, 112, 21, 22, 10, 2, 8, 4, 6, 42, }, /* left_mode 1 */
{ 44, 20, 24, 6, 5, 4, 3, 3, 1, 2, }, /* left_mode 2 */
{ 40, 23, 7, 71, 5, 2, 4, 1, 7, 22, }, /* left_mode 3 */
{ 85, 9, 4, 4, 17, 2, 0, 3, 2, 23, }, /* left_mode 4 */
{ 13, 4, 2, 6, 1, 7, 0, 1, 7, 6, }, /* left_mode 5 */
{ 26, 6, 8, 3, 2, 3, 8, 1, 5, 4, }, /* left_mode 6 */
{ 54, 8, 9, 6, 7, 0, 1, 11, 1, 3, }, /* left_mode 7 */
{ 9, 10, 4, 13, 2, 5, 4, 2, 14, 8, }, /* left_mode 8 */
{ 92, 9, 5, 19, 15, 3, 3, 1, 6, 58, }, /* left_mode 9 */
},
};

Просмотреть файл

@ -19,7 +19,7 @@ typedef struct
short col;
} MV;
typedef union
typedef union int_mv
{
uint32_t as_int;
MV as_mv;

Просмотреть файл

@ -37,14 +37,6 @@ extern "C"
} VPX_SCALING;
typedef enum
{
VP8_LAST_FLAG = 1,
VP8_GOLD_FLAG = 2,
VP8_ALT_FLAG = 4
} VP8_REFFRAME;
typedef enum
{
USAGE_STREAM_FROM_SERVER = 0x0,
@ -102,83 +94,101 @@ extern "C"
typedef struct
{
int Version; // 4 versions of bitstream defined 0 best quality/slowest decode, 3 lowest quality/fastest decode
int Width; // width of data passed to the compressor
int Height; // height of data passed to the compressor
/* 4 versions of bitstream defined:
* 0 best quality/slowest decode, 3 lowest quality/fastest decode
*/
int Version;
int Width;
int Height;
struct vpx_rational timebase;
int target_bandwidth; // bandwidth to be used in kilobits per second
unsigned int target_bandwidth; /* kilobits per second */
int noise_sensitivity; // parameter used for applying pre processing blur: recommendation 0
int Sharpness; // parameter used for sharpening output: recommendation 0:
/* parameter used for applying pre processing blur: recommendation 0 */
int noise_sensitivity;
/* parameter used for sharpening output: recommendation 0: */
int Sharpness;
int cpu_used;
unsigned int rc_max_intra_bitrate_pct;
// mode ->
//(0)=Realtime/Live Encoding. This mode is optimized for realtim encoding (for example, capturing
// a television signal or feed from a live camera). ( speed setting controls how fast )
//(1)=Good Quality Fast Encoding. The encoder balances quality with the amount of time it takes to
// encode the output. ( speed setting controls how fast )
//(2)=One Pass - Best Quality. The encoder places priority on the quality of the output over encoding
// speed. The output is compressed at the highest possible quality. This option takes the longest
// amount of time to encode. ( speed setting ignored )
//(3)=Two Pass - First Pass. The encoder generates a file of statistics for use in the second encoding
// pass. ( speed setting controls how fast )
//(4)=Two Pass - Second Pass. The encoder uses the statistics that were generated in the first encoding
// pass to create the compressed output. ( speed setting controls how fast )
//(5)=Two Pass - Second Pass Best. The encoder uses the statistics that were generated in the first
// encoding pass to create the compressed output using the highest possible quality, and taking a
// longer amount of time to encode.. ( speed setting ignored )
int Mode; //
/* mode ->
*(0)=Realtime/Live Encoding. This mode is optimized for realtim
* encoding (for example, capturing a television signal or feed
* from a live camera). ( speed setting controls how fast )
*(1)=Good Quality Fast Encoding. The encoder balances quality with
* the amount of time it takes to encode the output. ( speed
* setting controls how fast )
*(2)=One Pass - Best Quality. The encoder places priority on the
* quality of the output over encoding speed. The output is
* compressed at the highest possible quality. This option takes
* the longest amount of time to encode. ( speed setting ignored
* )
*(3)=Two Pass - First Pass. The encoder generates a file of
* statistics for use in the second encoding pass. ( speed
* setting controls how fast )
*(4)=Two Pass - Second Pass. The encoder uses the statistics that
* were generated in the first encoding pass to create the
* compressed output. ( speed setting controls how fast )
*(5)=Two Pass - Second Pass Best. The encoder uses the statistics
* that were generated in the first encoding pass to create the
* compressed output using the highest possible quality, and
* taking a longer amount of time to encode.. ( speed setting
* ignored )
*/
int Mode;
// Key Framing Operations
int auto_key; // automatically detect cut scenes and set the keyframes
int key_freq; // maximum distance to key frame.
/* Key Framing Operations */
int auto_key; /* automatically detect cut scenes */
int key_freq; /* maximum distance to key frame. */
int allow_lag; // allow lagged compression (if 0 lagin frames is ignored)
int lag_in_frames; // how many frames lag before we start encoding
/* lagged compression (if allow_lag == 0 lag_in_frames is ignored) */
int allow_lag;
int lag_in_frames; /* how many frames lag before we start encoding */
//----------------------------------------------------------------
// DATARATE CONTROL OPTIONS
/*
* DATARATE CONTROL OPTIONS
*/
int end_usage; // vbr or cbr
int end_usage; /* vbr or cbr */
// buffer targeting aggressiveness
/* buffer targeting aggressiveness */
int under_shoot_pct;
int over_shoot_pct;
// buffering parameters
int64_t starting_buffer_level; // in bytes
/* buffering parameters */
int64_t starting_buffer_level;
int64_t optimal_buffer_level;
int64_t maximum_buffer_size;
int64_t starting_buffer_level_in_ms; // in milli-seconds
int64_t starting_buffer_level_in_ms;
int64_t optimal_buffer_level_in_ms;
int64_t maximum_buffer_size_in_ms;
// controlling quality
/* controlling quality */
int fixed_q;
int worst_allowed_q;
int best_allowed_q;
int cq_level;
// allow internal resizing ( currently disabled in the build !!!!!)
/* allow internal resizing */
int allow_spatial_resampling;
int resample_down_water_mark;
int resample_up_water_mark;
// allow internal frame rate alterations
/* allow internal frame rate alterations */
int allow_df;
int drop_frames_water_mark;
// two pass datarate control
int two_pass_vbrbias; // two pass datarate control tweaks
/* two pass datarate control */
int two_pass_vbrbias;
int two_pass_vbrmin_section;
int two_pass_vbrmax_section;
// END DATARATE CONTROL OPTIONS
//----------------------------------------------------------------
/*
* END DATARATE CONTROL OPTIONS
*/
// these parameters aren't to be used in final build don't use!!!
/* these parameters aren't to be used in final build don't use!!! */
int play_alternate;
int alt_freq;
int alt_q;
@ -186,31 +196,33 @@ extern "C"
int gold_q;
int multi_threaded; // how many threads to run the encoder on
int token_partitions; // how many token partitions to create for multi core decoding
int encode_breakout; // early breakout encode threshold : for video conf recommend 800
int multi_threaded; /* how many threads to run the encoder on */
int token_partitions; /* how many token partitions to create */
unsigned int error_resilient_mode; // Bitfield defining the error
// resiliency features to enable. Can provide
// decodable frames after losses in previous
// frames and decodable partitions after
// losses in the same frame.
/* early breakout threshold: for video conf recommend 800 */
int encode_breakout;
/* Bitfield defining the error resiliency features to enable.
* Can provide decodable frames after losses in previous
* frames and decodable partitions after losses in the same frame.
*/
unsigned int error_resilient_mode;
int arnr_max_frames;
int arnr_strength ;
int arnr_type ;
int arnr_strength;
int arnr_type;
struct vpx_fixed_buf two_pass_stats_in;
struct vpx_fixed_buf two_pass_stats_in;
struct vpx_codec_pkt_list *output_pkt_list;
vp8e_tuning tuning;
// Temporal scaling parameters
/* Temporal scaling parameters */
unsigned int number_of_layers;
unsigned int target_bitrate[MAX_PERIODICITY];
unsigned int rate_decimator[MAX_PERIODICITY];
unsigned int target_bitrate[VPX_TS_MAX_PERIODICITY];
unsigned int rate_decimator[VPX_TS_MAX_PERIODICITY];
unsigned int periodicity;
unsigned int layer_id[MAX_PERIODICITY];
unsigned int layer_id[VPX_TS_MAX_PERIODICITY];
#if CONFIG_MULTI_RES_ENCODING
/* Number of total resolutions encoded */
@ -236,16 +248,14 @@ extern "C"
void vp8_init_config(struct VP8_COMP* onyx, VP8_CONFIG *oxcf);
void vp8_change_config(struct VP8_COMP* onyx, VP8_CONFIG *oxcf);
// receive a frames worth of data caller can assume that a copy of this frame is made
// and not just a copy of the pointer..
int vp8_receive_raw_frame(struct VP8_COMP* comp, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, int64_t time_stamp, int64_t end_time_stamp);
int vp8_get_compressed_data(struct VP8_COMP* comp, unsigned int *frame_flags, unsigned long *size, unsigned char *dest, unsigned char *dest_end, int64_t *time_stamp, int64_t *time_end, int flush);
int vp8_get_preview_raw_frame(struct VP8_COMP* comp, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *flags);
int vp8_use_as_reference(struct VP8_COMP* comp, int ref_frame_flags);
int vp8_update_reference(struct VP8_COMP* comp, int ref_frame_flags);
int vp8_get_reference(struct VP8_COMP* comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd);
int vp8_set_reference(struct VP8_COMP* comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd);
int vp8_get_reference(struct VP8_COMP* comp, enum vpx_ref_frame_type ref_frame_flag, YV12_BUFFER_CONFIG *sd);
int vp8_set_reference(struct VP8_COMP* comp, enum vpx_ref_frame_type ref_frame_flag, YV12_BUFFER_CONFIG *sd);
int vp8_update_entropy(struct VP8_COMP* comp, int update);
int vp8_set_roimap(struct VP8_COMP* comp, unsigned char *map, unsigned int rows, unsigned int cols, int delta_q[4], int delta_lf[4], unsigned int threshold[4]);
int vp8_set_active_map(struct VP8_COMP* comp, unsigned char *map, unsigned int rows, unsigned int cols);

Просмотреть файл

@ -13,26 +13,19 @@
#define __INC_VP8C_INT_H
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vpx/internal/vpx_codec_internal.h"
#include "loopfilter.h"
#include "entropymv.h"
#include "entropy.h"
#include "idct.h"
#include "recon.h"
#include "variance.h"
#if CONFIG_POSTPROC
#include "postproc.h"
#endif
#include "dequantize.h"
/*#ifdef PACKET_TESTING*/
#include "header.h"
/*#endif*/
/* Create/destroy static data structures. */
void vp8_initialize_common(void);
#define MINQ 0
#define MAXQ 127
#define QINDEX_RANGE (MAXQ + 1)
@ -49,7 +42,6 @@ typedef struct frame_contexts
vp8_prob sub_mv_ref_prob [VP8_SUBMVREFS-1];
vp8_prob coef_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES];
MV_CONTEXT mvc[2];
MV_CONTEXT pre_mvc[2]; /* not to caculate the mvcost for the frame if mvc doesn't change. */
} FRAME_CONTEXT;
typedef enum
@ -66,30 +58,6 @@ typedef enum
RECON_CLAMP_NOTREQUIRED = 1
} CLAMP_TYPE;
typedef enum
{
SIXTAP = 0,
BILINEAR = 1
} INTERPOLATIONFILTERTYPE;
typedef struct VP8_COMMON_RTCD
{
#if CONFIG_RUNTIME_CPU_DETECT
vp8_dequant_rtcd_vtable_t dequant;
vp8_idct_rtcd_vtable_t idct;
vp8_recon_rtcd_vtable_t recon;
vp8_subpix_rtcd_vtable_t subpix;
vp8_loopfilter_rtcd_vtable_t loopfilter;
vp8_variance_rtcd_vtable_t variance;
#if CONFIG_POSTPROC
vp8_postproc_rtcd_vtable_t postproc;
#endif
int flags;
#else
int unused;
#endif
} VP8_COMMON_RTCD;
typedef struct VP8Common
{
@ -113,11 +81,14 @@ typedef struct VP8Common
int fb_idx_ref_cnt[NUM_YV12_BUFFERS];
int new_fb_idx, lst_fb_idx, gld_fb_idx, alt_fb_idx;
YV12_BUFFER_CONFIG post_proc_buffer;
YV12_BUFFER_CONFIG temp_scale_frame;
#if CONFIG_POSTPROC
YV12_BUFFER_CONFIG post_proc_buffer;
YV12_BUFFER_CONFIG post_proc_buffer_int;
int post_proc_buffer_int_used;
unsigned char *pp_limits_buffer; /* post-processing filter coefficients */
#endif
FRAME_TYPE last_frame_type; /* Save last frame's frame type for motion search. */
FRAME_TYPE frame_type;
@ -137,7 +108,6 @@ typedef struct VP8Common
int full_pixel;
int base_qindex;
int last_kf_gf_q; /* Q used on the last GF or KF */
int y1dc_delta_q;
int y2dc_delta_q;
@ -153,11 +123,11 @@ typedef struct VP8Common
MODE_INFO *mip; /* Base of allocated array */
MODE_INFO *mi; /* Corresponds to upper left visible macroblock */
#if CONFIG_ERROR_CONCEALMENT
MODE_INFO *prev_mip; /* MODE_INFO array 'mip' from last decoded frame */
MODE_INFO *prev_mi; /* 'mi' from last frame (points into prev_mip) */
#endif
INTERPOLATIONFILTERTYPE mcomp_filter_type;
LOOPFILTERTYPE filter_type;
loop_filter_info_n lf_info;
@ -181,14 +151,6 @@ typedef struct VP8Common
ENTROPY_CONTEXT_PLANES *above_context; /* row of context for each plane */
ENTROPY_CONTEXT_PLANES left_context; /* (up to) 4 contexts "" */
/* keyframe block modes are predicted by their above, left neighbors */
vp8_prob kf_bmode_prob [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES-1];
vp8_prob kf_ymode_prob [VP8_YMODES-1]; /* keyframe "" */
vp8_prob kf_uv_mode_prob [VP8_UV_MODES-1];
FRAME_CONTEXT lfc; /* last frame entropy */
FRAME_CONTEXT fc; /* this frame entropy */
@ -205,15 +167,13 @@ typedef struct VP8Common
double bitrate;
double framerate;
#if CONFIG_RUNTIME_CPU_DETECT
VP8_COMMON_RTCD rtcd;
#endif
#if CONFIG_MULTITHREAD
int processor_core_count;
#endif
#if CONFIG_POSTPROC
struct postproc_state postproc_state;
#endif
int cpu_caps;
} VP8_COMMON;
#endif

Просмотреть файл

@ -22,6 +22,7 @@ extern "C"
#include "ppflags.h"
#include "vpx_ports/mem.h"
#include "vpx/vpx_codec.h"
#include "vpx/vp8.h"
struct VP8D_COMP;
@ -35,12 +36,6 @@ extern "C"
int error_concealment;
int input_fragments;
} VP8D_CONFIG;
typedef enum
{
VP8_LAST_FLAG = 1,
VP8_GOLD_FLAG = 2,
VP8_ALT_FLAG = 4
} VP8_REFFRAME;
typedef enum
{
@ -53,11 +48,13 @@ extern "C"
int vp8dx_get_setting(struct VP8D_COMP* comp, VP8D_SETTING oxst);
int vp8dx_receive_compressed_data(struct VP8D_COMP* comp, unsigned long size, const unsigned char *dest, int64_t time_stamp);
int vp8dx_receive_compressed_data(struct VP8D_COMP* comp,
size_t size, const uint8_t *dest,
int64_t time_stamp);
int vp8dx_get_raw_frame(struct VP8D_COMP* comp, YV12_BUFFER_CONFIG *sd, int64_t *time_stamp, int64_t *time_end_stamp, vp8_ppflags_t *flags);
vpx_codec_err_t vp8dx_get_reference(struct VP8D_COMP* comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd);
vpx_codec_err_t vp8dx_set_reference(struct VP8D_COMP* comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd);
vpx_codec_err_t vp8dx_get_reference(struct VP8D_COMP* comp, enum vpx_ref_frame_type ref_frame_flag, YV12_BUFFER_CONFIG *sd);
vpx_codec_err_t vp8dx_set_reference(struct VP8D_COMP* comp, enum vpx_ref_frame_type ref_frame_flag, YV12_BUFFER_CONFIG *sd);
struct VP8D_COMP* vp8dx_create_decompressor(VP8D_CONFIG *oxcf);

Просмотреть файл

@ -10,15 +10,14 @@
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vpx_scale/yv12config.h"
#include "postproc.h"
#include "common.h"
#include "recon.h"
#include "vpx_scale/yv12extend.h"
#include "vpx_scale/vpxscale.h"
#include "systemdependent.h"
#include "variance.h"
#include <limits.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
@ -29,7 +28,6 @@
( (0.439*(float)(t>>16)) - (0.368*(float)(t>>8&0xff)) - (0.071*(float)(t&0xff)) + 128)
/* global constants */
#define MFQE_PRECISION 4
#if CONFIG_POSTPROC_VISUALIZER
static const unsigned char MB_PREDICTION_MODE_colors[MB_MODE_COUNT][3] =
{
@ -129,27 +127,24 @@ extern void vp8_blit_text(const char *msg, unsigned char *address, const int pit
extern void vp8_blit_line(int x0, int x1, int y0, int y1, unsigned char *image, const int pitch);
/***********************************************************************************************************
*/
void vp8_post_proc_down_and_across_c
void vp8_post_proc_down_and_across_mb_row_c
(
unsigned char *src_ptr,
unsigned char *dst_ptr,
int src_pixels_per_line,
int dst_pixels_per_line,
int rows,
int cols,
int flimit
unsigned char *f,
int size
)
{
unsigned char *p_src, *p_dst;
int row;
int col;
int i;
int v;
int pitch = src_pixels_per_line;
unsigned char d[8];
(void)dst_pixels_per_line;
unsigned char v;
unsigned char d[4];
for (row = 0; row < rows; row++)
for (row = 0; row < size; row++)
{
/* post_proc_down for one row */
p_src = src_ptr;
@ -157,20 +152,23 @@ void vp8_post_proc_down_and_across_c
for (col = 0; col < cols; col++)
{
unsigned char p_above2 = p_src[col - 2 * src_pixels_per_line];
unsigned char p_above1 = p_src[col - src_pixels_per_line];
unsigned char p_below1 = p_src[col + src_pixels_per_line];
unsigned char p_below2 = p_src[col + 2 * src_pixels_per_line];
int kernel = 4;
int v = p_src[col];
v = p_src[col];
for (i = -2; i <= 2; i++)
if ((abs(v - p_above2) < f[col]) && (abs(v - p_above1) < f[col])
&& (abs(v - p_below1) < f[col]) && (abs(v - p_below2) < f[col]))
{
if (abs(v - p_src[col+i*pitch]) > flimit)
goto down_skip_convolve;
kernel += kernel5[2+i] * p_src[col+i*pitch];
unsigned char k1, k2, k3;
k1 = (p_above2 + p_above1 + 1) >> 1;
k2 = (p_below2 + p_below1 + 1) >> 1;
k3 = (k1 + k2 + 1) >> 1;
v = (k3 + v + 1) >> 1;
}
v = (kernel >> 3);
down_skip_convolve:
p_dst[col] = v;
}
@ -178,45 +176,38 @@ void vp8_post_proc_down_and_across_c
p_src = dst_ptr;
p_dst = dst_ptr;
for (i = -8; i<0; i++)
p_src[i]=p_src[0];
for (i = cols; i<cols+8; i++)
p_src[i]=p_src[cols-1];
for (i = 0; i < 8; i++)
d[i] = p_src[i];
p_src[-2] = p_src[-1] = p_src[0];
p_src[cols] = p_src[cols + 1] = p_src[cols - 1];
for (col = 0; col < cols; col++)
{
int kernel = 4;
v = p_src[col];
d[col&7] = v;
for (i = -2; i <= 2; i++)
if ((abs(v - p_src[col - 2]) < f[col])
&& (abs(v - p_src[col - 1]) < f[col])
&& (abs(v - p_src[col + 1]) < f[col])
&& (abs(v - p_src[col + 2]) < f[col]))
{
if (abs(v - p_src[col+i]) > flimit)
goto across_skip_convolve;
kernel += kernel5[2+i] * p_src[col+i];
unsigned char k1, k2, k3;
k1 = (p_src[col - 2] + p_src[col - 1] + 1) >> 1;
k2 = (p_src[col + 2] + p_src[col + 1] + 1) >> 1;
k3 = (k1 + k2 + 1) >> 1;
v = (k3 + v + 1) >> 1;
}
d[col&7] = (kernel >> 3);
across_skip_convolve:
d[col & 3] = v;
if (col >= 2)
p_dst[col-2] = d[(col-2)&7];
p_dst[col - 2] = d[(col - 2) & 3];
}
/* handle the last two pixels */
p_dst[col-2] = d[(col-2)&7];
p_dst[col-1] = d[(col-1)&7];
p_dst[col - 2] = d[(col - 2) & 3];
p_dst[col - 1] = d[(col - 1) & 3];
/* next row */
src_ptr += pitch;
dst_ptr += pitch;
src_ptr += src_pixels_per_line;
dst_ptr += dst_pixels_per_line;
}
}
@ -242,8 +233,9 @@ void vp8_mbpost_proc_across_ip_c(unsigned char *src, int pitch, int rows, int co
for (i = -8; i<0; i++)
s[i]=s[0];
// 17 avoids valgrind warning - we buffer values in c in d
// and only write them when we've read 8 ahead...
/* 17 avoids valgrind warning - we buffer values in c in d
* and only write them when we've read 8 ahead...
*/
for (i = cols; i<cols+17; i++)
s[i]=s[cols-1];
@ -277,9 +269,6 @@ void vp8_mbpost_proc_across_ip_c(unsigned char *src, int pitch, int rows, int co
}
void vp8_mbpost_proc_down_c(unsigned char *dst, int pitch, int rows, int cols, int flimit)
{
int r, c, i;
@ -296,8 +285,9 @@ void vp8_mbpost_proc_down_c(unsigned char *dst, int pitch, int rows, int cols, i
for (i = -8; i < 0; i++)
s[i*pitch]=s[0];
// 17 avoids valgrind warning - we buffer values in c in d
// and only write them when we've read 8 ahead...
/* 17 avoids valgrind warning - we buffer values in c in d
* and only write them when we've read 8 ahead...
*/
for (i = rows; i < rows+17; i++)
s[i*pitch]=s[(rows-1)*pitch];
@ -324,83 +314,118 @@ void vp8_mbpost_proc_down_c(unsigned char *dst, int pitch, int rows, int cols, i
}
}
static void vp8_deblock_and_de_macro_block(YV12_BUFFER_CONFIG *source,
YV12_BUFFER_CONFIG *post,
int q,
int low_var_thresh,
int flag,
vp8_postproc_rtcd_vtable_t *rtcd)
static void vp8_de_mblock(YV12_BUFFER_CONFIG *post,
int q)
{
double level = 6.0e-05 * q * q * q - .0067 * q * q + .306 * q + .0065;
int ppl = (int)(level + .5);
(void) low_var_thresh;
(void) flag;
POSTPROC_INVOKE(rtcd, downacross)(source->y_buffer, post->y_buffer, source->y_stride, post->y_stride, source->y_height, source->y_width, ppl);
POSTPROC_INVOKE(rtcd, across)(post->y_buffer, post->y_stride, post->y_height, post->y_width, q2mbl(q));
POSTPROC_INVOKE(rtcd, down)(post->y_buffer, post->y_stride, post->y_height, post->y_width, q2mbl(q));
POSTPROC_INVOKE(rtcd, downacross)(source->u_buffer, post->u_buffer, source->uv_stride, post->uv_stride, source->uv_height, source->uv_width, ppl);
POSTPROC_INVOKE(rtcd, downacross)(source->v_buffer, post->v_buffer, source->uv_stride, post->uv_stride, source->uv_height, source->uv_width, ppl);
vp8_mbpost_proc_across_ip(post->y_buffer, post->y_stride, post->y_height,
post->y_width, q2mbl(q));
vp8_mbpost_proc_down(post->y_buffer, post->y_stride, post->y_height,
post->y_width, q2mbl(q));
}
void vp8_deblock(YV12_BUFFER_CONFIG *source,
void vp8_deblock(VP8_COMMON *cm,
YV12_BUFFER_CONFIG *source,
YV12_BUFFER_CONFIG *post,
int q,
int low_var_thresh,
int flag,
vp8_postproc_rtcd_vtable_t *rtcd)
int flag)
{
double level = 6.0e-05 * q * q * q - .0067 * q * q + .306 * q + .0065;
int ppl = (int)(level + .5);
const MODE_INFO *mode_info_context = cm->mi;
int mbr, mbc;
/* The pixel thresholds are adjusted according to if or not the macroblock
* is a skipped block. */
unsigned char *ylimits = cm->pp_limits_buffer;
unsigned char *uvlimits = cm->pp_limits_buffer + 16 * cm->mb_cols;
(void) low_var_thresh;
(void) flag;
POSTPROC_INVOKE(rtcd, downacross)(source->y_buffer, post->y_buffer, source->y_stride, post->y_stride, source->y_height, source->y_width, ppl);
POSTPROC_INVOKE(rtcd, downacross)(source->u_buffer, post->u_buffer, source->uv_stride, post->uv_stride, source->uv_height, source->uv_width, ppl);
POSTPROC_INVOKE(rtcd, downacross)(source->v_buffer, post->v_buffer, source->uv_stride, post->uv_stride, source->uv_height, source->uv_width, ppl);
if (ppl > 0)
{
for (mbr = 0; mbr < cm->mb_rows; mbr++)
{
unsigned char *ylptr = ylimits;
unsigned char *uvlptr = uvlimits;
for (mbc = 0; mbc < cm->mb_cols; mbc++)
{
unsigned char mb_ppl;
if (mode_info_context->mbmi.mb_skip_coeff)
mb_ppl = (unsigned char)ppl >> 1;
else
mb_ppl = (unsigned char)ppl;
vpx_memset(ylptr, mb_ppl, 16);
vpx_memset(uvlptr, mb_ppl, 8);
ylptr += 16;
uvlptr += 8;
mode_info_context++;
}
mode_info_context++;
vp8_post_proc_down_and_across_mb_row(
source->y_buffer + 16 * mbr * source->y_stride,
post->y_buffer + 16 * mbr * post->y_stride, source->y_stride,
post->y_stride, source->y_width, ylimits, 16);
vp8_post_proc_down_and_across_mb_row(
source->u_buffer + 8 * mbr * source->uv_stride,
post->u_buffer + 8 * mbr * post->uv_stride, source->uv_stride,
post->uv_stride, source->uv_width, uvlimits, 8);
vp8_post_proc_down_and_across_mb_row(
source->v_buffer + 8 * mbr * source->uv_stride,
post->v_buffer + 8 * mbr * post->uv_stride, source->uv_stride,
post->uv_stride, source->uv_width, uvlimits, 8);
}
} else
{
vp8_yv12_copy_frame(source, post);
}
}
void vp8_de_noise(YV12_BUFFER_CONFIG *source,
#if !(CONFIG_TEMPORAL_DENOISING)
void vp8_de_noise(VP8_COMMON *cm,
YV12_BUFFER_CONFIG *source,
YV12_BUFFER_CONFIG *post,
int q,
int low_var_thresh,
int flag,
vp8_postproc_rtcd_vtable_t *rtcd)
int flag)
{
double level = 6.0e-05 * q * q * q - .0067 * q * q + .306 * q + .0065;
int ppl = (int)(level + .5);
int mb_rows = source->y_width >> 4;
int mb_cols = source->y_height >> 4;
unsigned char *limits = cm->pp_limits_buffer;;
int mbr, mbc;
(void) post;
(void) low_var_thresh;
(void) flag;
POSTPROC_INVOKE(rtcd, downacross)(
source->y_buffer + 2 * source->y_stride + 2,
source->y_buffer + 2 * source->y_stride + 2,
source->y_stride,
source->y_stride,
source->y_height - 4,
source->y_width - 4,
ppl);
POSTPROC_INVOKE(rtcd, downacross)(
source->u_buffer + 2 * source->uv_stride + 2,
source->u_buffer + 2 * source->uv_stride + 2,
source->uv_stride,
source->uv_stride,
source->uv_height - 4,
source->uv_width - 4, ppl);
POSTPROC_INVOKE(rtcd, downacross)(
source->v_buffer + 2 * source->uv_stride + 2,
source->v_buffer + 2 * source->uv_stride + 2,
source->uv_stride,
source->uv_stride,
source->uv_height - 4,
source->uv_width - 4, ppl);
vpx_memset(limits, (unsigned char)ppl, 16 * mb_cols);
/* TODO: The original code don't filter the 2 outer rows and columns. */
for (mbr = 0; mbr < mb_rows; mbr++)
{
vp8_post_proc_down_and_across_mb_row(
source->y_buffer + 16 * mbr * source->y_stride,
source->y_buffer + 16 * mbr * source->y_stride,
source->y_stride, source->y_stride, source->y_width, limits, 16);
vp8_post_proc_down_and_across_mb_row(
source->u_buffer + 8 * mbr * source->uv_stride,
source->u_buffer + 8 * mbr * source->uv_stride,
source->uv_stride, source->uv_stride, source->uv_width, limits, 8);
vp8_post_proc_down_and_across_mb_row(
source->v_buffer + 8 * mbr * source->uv_stride,
source->v_buffer + 8 * mbr * source->uv_stride,
source->uv_stride, source->uv_stride, source->uv_width, limits, 8);
}
}
#endif
double vp8_gaussian(double sigma, double mu, double x)
{
@ -408,9 +433,6 @@ double vp8_gaussian(double sigma, double mu, double x)
(exp(-(x - mu) * (x - mu) / (2 * sigma * sigma)));
}
extern void (*vp8_clear_system_state)(void);
static void fillrd(struct postproc_state *state, int q, int a)
{
char char_dist[300];
@ -448,7 +470,7 @@ static void fillrd(struct postproc_state *state, int q, int a)
}
for (next = next; next < 256; next++)
for (; next < 256; next++)
char_dist[next] = 0;
}
@ -696,225 +718,7 @@ static void constrain_line (int x0, int *x1, int y0, int *y1, int width, int hei
}
}
static void multiframe_quality_enhance_block
(
int blksize, /* Currently only values supported are 16, 8, 4 */
int qcurr,
int qprev,
unsigned char *y,
unsigned char *u,
unsigned char *v,
int y_stride,
int uv_stride,
unsigned char *yd,
unsigned char *ud,
unsigned char *vd,
int yd_stride,
int uvd_stride,
vp8_variance_rtcd_vtable_t *rtcd
)
{
static const unsigned char VP8_ZEROS[16]=
{
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
};
int blksizeby2 = blksize >> 1;
int qdiff = qcurr - qprev;
int i, j;
unsigned char *yp;
unsigned char *ydp;
unsigned char *up;
unsigned char *udp;
unsigned char *vp;
unsigned char *vdp;
unsigned int act, sse, sad, thr;
if (blksize == 16)
{
act = (VARIANCE_INVOKE(rtcd, var16x16)(yd, yd_stride, VP8_ZEROS, 0, &sse)+128)>>8;
sad = (VARIANCE_INVOKE(rtcd, sad16x16)(y, y_stride, yd, yd_stride, 0)+128)>>8;
}
else if (blksize == 8)
{
act = (VARIANCE_INVOKE(rtcd, var8x8)(yd, yd_stride, VP8_ZEROS, 0, &sse)+32)>>6;
sad = (VARIANCE_INVOKE(rtcd, sad8x8)(y, y_stride, yd, yd_stride, 0)+32)>>6;
}
else
{
act = (VARIANCE_INVOKE(rtcd, var4x4)(yd, yd_stride, VP8_ZEROS, 0, &sse)+8)>>4;
sad = (VARIANCE_INVOKE(rtcd, sad4x4)(y, y_stride, yd, yd_stride, 0)+8)>>4;
}
/* thr = qdiff/8 + log2(act) + log4(qprev) */
thr = (qdiff>>3);
while (act>>=1) thr++;
while (qprev>>=2) thr++;
if (sad < thr)
{
static const int roundoff = (1 << (MFQE_PRECISION - 1));
int ifactor = (sad << MFQE_PRECISION) / thr;
ifactor >>= (qdiff >> 5);
// TODO: SIMD optimize this section
if (ifactor)
{
int icfactor = (1 << MFQE_PRECISION) - ifactor;
for (yp = y, ydp = yd, i = 0; i < blksize; ++i, yp += y_stride, ydp += yd_stride)
{
for (j = 0; j < blksize; ++j)
ydp[j] = (int)((yp[j] * ifactor + ydp[j] * icfactor + roundoff) >> MFQE_PRECISION);
}
for (up = u, udp = ud, i = 0; i < blksizeby2; ++i, up += uv_stride, udp += uvd_stride)
{
for (j = 0; j < blksizeby2; ++j)
udp[j] = (int)((up[j] * ifactor + udp[j] * icfactor + roundoff) >> MFQE_PRECISION);
}
for (vp = v, vdp = vd, i = 0; i < blksizeby2; ++i, vp += uv_stride, vdp += uvd_stride)
{
for (j = 0; j < blksizeby2; ++j)
vdp[j] = (int)((vp[j] * ifactor + vdp[j] * icfactor + roundoff) >> MFQE_PRECISION);
}
}
}
else
{
if (blksize == 16)
{
vp8_recon_copy16x16(y, y_stride, yd, yd_stride);
vp8_recon_copy8x8(u, uv_stride, ud, uvd_stride);
vp8_recon_copy8x8(v, uv_stride, vd, uvd_stride);
}
else if (blksize == 8)
{
vp8_recon_copy8x8(y, y_stride, yd, yd_stride);
for (up = u, udp = ud, i = 0; i < blksizeby2; ++i, up += uv_stride, udp += uvd_stride)
vpx_memcpy(udp, up, blksizeby2);
for (vp = v, vdp = vd, i = 0; i < blksizeby2; ++i, vp += uv_stride, vdp += uvd_stride)
vpx_memcpy(vdp, vp, blksizeby2);
}
else
{
for (yp = y, ydp = yd, i = 0; i < blksize; ++i, yp += y_stride, ydp += yd_stride)
vpx_memcpy(ydp, yp, blksize);
for (up = u, udp = ud, i = 0; i < blksizeby2; ++i, up += uv_stride, udp += uvd_stride)
vpx_memcpy(udp, up, blksizeby2);
for (vp = v, vdp = vd, i = 0; i < blksizeby2; ++i, vp += uv_stride, vdp += uvd_stride)
vpx_memcpy(vdp, vp, blksizeby2);
}
}
}
#if CONFIG_RUNTIME_CPU_DETECT
#define RTCD_VTABLE(oci) (&(oci)->rtcd.postproc)
#define RTCD_VARIANCE(oci) (&(oci)->rtcd.variance)
#else
#define RTCD_VTABLE(oci) NULL
#define RTCD_VARIANCE(oci) NULL
#endif
void vp8_multiframe_quality_enhance
(
VP8_COMMON *cm
)
{
YV12_BUFFER_CONFIG *show = cm->frame_to_show;
YV12_BUFFER_CONFIG *dest = &cm->post_proc_buffer;
FRAME_TYPE frame_type = cm->frame_type;
/* Point at base of Mb MODE_INFO list has motion vectors etc */
const MODE_INFO *mode_info_context = cm->mi;
int mb_row;
int mb_col;
int qcurr = cm->base_qindex;
int qprev = cm->postproc_state.last_base_qindex;
unsigned char *y_ptr, *u_ptr, *v_ptr;
unsigned char *yd_ptr, *ud_ptr, *vd_ptr;
/* Set up the buffer pointers */
y_ptr = show->y_buffer;
u_ptr = show->u_buffer;
v_ptr = show->v_buffer;
yd_ptr = dest->y_buffer;
ud_ptr = dest->u_buffer;
vd_ptr = dest->v_buffer;
/* postprocess each macro block */
for (mb_row = 0; mb_row < cm->mb_rows; mb_row++)
{
for (mb_col = 0; mb_col < cm->mb_cols; mb_col++)
{
/* if motion is high there will likely be no benefit */
if (((frame_type == INTER_FRAME &&
abs(mode_info_context->mbmi.mv.as_mv.row) <= 10 &&
abs(mode_info_context->mbmi.mv.as_mv.col) <= 10) ||
(frame_type == KEY_FRAME)))
{
if (mode_info_context->mbmi.mode == B_PRED || mode_info_context->mbmi.mode == SPLITMV)
{
int i, j;
for (i=0; i<2; ++i)
for (j=0; j<2; ++j)
multiframe_quality_enhance_block(8,
qcurr,
qprev,
y_ptr + 8*(i*show->y_stride+j),
u_ptr + 4*(i*show->uv_stride+j),
v_ptr + 4*(i*show->uv_stride+j),
show->y_stride,
show->uv_stride,
yd_ptr + 8*(i*dest->y_stride+j),
ud_ptr + 4*(i*dest->uv_stride+j),
vd_ptr + 4*(i*dest->uv_stride+j),
dest->y_stride,
dest->uv_stride,
RTCD_VARIANCE(cm));
}
else
{
multiframe_quality_enhance_block(16,
qcurr,
qprev,
y_ptr,
u_ptr,
v_ptr,
show->y_stride,
show->uv_stride,
yd_ptr,
ud_ptr,
vd_ptr,
dest->y_stride,
dest->uv_stride,
RTCD_VARIANCE(cm));
}
}
else
{
vp8_recon_copy16x16(y_ptr, show->y_stride, yd_ptr, dest->y_stride);
vp8_recon_copy8x8(u_ptr, show->uv_stride, ud_ptr, dest->uv_stride);
vp8_recon_copy8x8(v_ptr, show->uv_stride, vd_ptr, dest->uv_stride);
}
y_ptr += 16;
u_ptr += 8;
v_ptr += 8;
yd_ptr += 16;
ud_ptr += 8;
vd_ptr += 8;
mode_info_context++; /* step to next MB */
}
y_ptr += show->y_stride * 16 - 16 * cm->mb_cols;
u_ptr += show->uv_stride * 8 - 8 * cm->mb_cols;
v_ptr += show->uv_stride * 8 - 8 * cm->mb_cols;
yd_ptr += dest->y_stride * 16 - 16 * cm->mb_cols;
ud_ptr += dest->uv_stride * 8 - 8 * cm->mb_cols;
vd_ptr += dest->uv_stride * 8 - 8 * cm->mb_cols;
mode_info_context++; /* Skip border mb */
}
}
#if CONFIG_POSTPROC
int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *ppflags)
{
int q = oci->filter_level * 10 / 6;
@ -937,6 +741,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
dest->y_height = oci->Height;
dest->uv_height = dest->y_height / 2;
oci->postproc_state.last_base_qindex = oci->base_qindex;
oci->postproc_state.last_frame_valid = 1;
return 0;
}
@ -955,35 +760,38 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
oci->post_proc_buffer_int_used = 1;
// insure that postproc is set to all 0's so that post proc
// doesn't pull random data in from edge
vpx_memset((&oci->post_proc_buffer_int)->buffer_alloc,126,(&oci->post_proc_buffer)->frame_size);
/* insure that postproc is set to all 0's so that post proc
* doesn't pull random data in from edge
*/
vpx_memset((&oci->post_proc_buffer_int)->buffer_alloc,128,(&oci->post_proc_buffer)->frame_size);
}
}
#if ARCH_X86||ARCH_X86_64
vpx_reset_mmx_state();
#endif
vp8_clear_system_state();
if ((flags & VP8D_MFQE) &&
oci->postproc_state.last_frame_valid &&
oci->current_video_frame >= 2 &&
oci->base_qindex - oci->postproc_state.last_base_qindex >= 10)
oci->postproc_state.last_base_qindex < 60 &&
oci->base_qindex - oci->postproc_state.last_base_qindex >= 20)
{
vp8_multiframe_quality_enhance(oci);
if (((flags & VP8D_DEBLOCK) || (flags & VP8D_DEMACROBLOCK)) &&
oci->post_proc_buffer_int_used)
{
vp8_yv12_copy_frame_ptr(&oci->post_proc_buffer, &oci->post_proc_buffer_int);
vp8_yv12_copy_frame(&oci->post_proc_buffer, &oci->post_proc_buffer_int);
if (flags & VP8D_DEMACROBLOCK)
{
vp8_deblock_and_de_macro_block(&oci->post_proc_buffer_int, &oci->post_proc_buffer,
q + (deblock_level - 5) * 10, 1, 0, RTCD_VTABLE(oci));
vp8_deblock(oci, &oci->post_proc_buffer_int, &oci->post_proc_buffer,
q + (deblock_level - 5) * 10, 1, 0);
vp8_de_mblock(&oci->post_proc_buffer,
q + (deblock_level - 5) * 10);
}
else if (flags & VP8D_DEBLOCK)
{
vp8_deblock(&oci->post_proc_buffer_int, &oci->post_proc_buffer,
q, 1, 0, RTCD_VTABLE(oci));
vp8_deblock(oci, &oci->post_proc_buffer_int, &oci->post_proc_buffer,
q, 1, 0);
}
}
/* Move partially towards the base q of the previous frame */
@ -991,21 +799,24 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
}
else if (flags & VP8D_DEMACROBLOCK)
{
vp8_deblock_and_de_macro_block(oci->frame_to_show, &oci->post_proc_buffer,
q + (deblock_level - 5) * 10, 1, 0, RTCD_VTABLE(oci));
vp8_deblock(oci, oci->frame_to_show, &oci->post_proc_buffer,
q + (deblock_level - 5) * 10, 1, 0);
vp8_de_mblock(&oci->post_proc_buffer, q + (deblock_level - 5) * 10);
oci->postproc_state.last_base_qindex = oci->base_qindex;
}
else if (flags & VP8D_DEBLOCK)
{
vp8_deblock(oci->frame_to_show, &oci->post_proc_buffer,
q, 1, 0, RTCD_VTABLE(oci));
vp8_deblock(oci, oci->frame_to_show, &oci->post_proc_buffer,
q, 1, 0);
oci->postproc_state.last_base_qindex = oci->base_qindex;
}
else
{
vp8_yv12_copy_frame_ptr(oci->frame_to_show, &oci->post_proc_buffer);
vp8_yv12_copy_frame(oci->frame_to_show, &oci->post_proc_buffer);
oci->postproc_state.last_base_qindex = oci->base_qindex;
}
oci->postproc_state.last_frame_valid = 1;
if (flags & VP8D_ADDNOISE)
{
@ -1015,7 +826,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
fillrd(&oci->postproc_state, 63 - q, noise_level);
}
POSTPROC_INVOKE(RTCD_VTABLE(oci), addnoise)
vp8_plane_add_noise
(oci->post_proc_buffer.y_buffer,
oci->postproc_state.noise,
oci->postproc_state.blackclamp,
@ -1313,7 +1124,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
U = B_PREDICTION_MODE_colors[bmi->as_mode][1];
V = B_PREDICTION_MODE_colors[bmi->as_mode][2];
POSTPROC_INVOKE(RTCD_VTABLE(oci), blend_b)
vp8_blend_b
(yl+bx, ul+(bx>>1), vl+(bx>>1), Y, U, V, 0xc000, y_stride);
}
bmi++;
@ -1330,7 +1141,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
U = MB_PREDICTION_MODE_colors[mi->mbmi.mode][1];
V = MB_PREDICTION_MODE_colors[mi->mbmi.mode][2];
POSTPROC_INVOKE(RTCD_VTABLE(oci), blend_mb_inner)
vp8_blend_mb_inner
(y_ptr+x, u_ptr+(x>>1), v_ptr+(x>>1), Y, U, V, 0xc000, y_stride);
}
@ -1369,7 +1180,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
U = MV_REFERENCE_FRAME_colors[mi->mbmi.ref_frame][1];
V = MV_REFERENCE_FRAME_colors[mi->mbmi.ref_frame][2];
POSTPROC_INVOKE(RTCD_VTABLE(oci), blend_mb_outer)
vp8_blend_mb_outer
(y_ptr+x, u_ptr+(x>>1), v_ptr+(x>>1), Y, U, V, 0xc000, y_stride);
}
@ -1392,3 +1203,4 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
dest->uv_height = dest->y_height / 2;
return 0;
}
#endif

Просмотреть файл

@ -12,92 +12,6 @@
#ifndef POSTPROC_H
#define POSTPROC_H
#define prototype_postproc_inplace(sym)\
void sym (unsigned char *dst, int pitch, int rows, int cols,int flimit)
#define prototype_postproc(sym)\
void sym (unsigned char *src, unsigned char *dst, int src_pitch,\
int dst_pitch, int rows, int cols, int flimit)
#define prototype_postproc_addnoise(sym) \
void sym (unsigned char *s, char *noise, char blackclamp[16],\
char whiteclamp[16], char bothclamp[16],\
unsigned int w, unsigned int h, int pitch)
#define prototype_postproc_blend_mb_inner(sym)\
void sym (unsigned char *y, unsigned char *u, unsigned char *v,\
int y1, int u1, int v1, int alpha, int stride)
#define prototype_postproc_blend_mb_outer(sym)\
void sym (unsigned char *y, unsigned char *u, unsigned char *v,\
int y1, int u1, int v1, int alpha, int stride)
#define prototype_postproc_blend_b(sym)\
void sym (unsigned char *y, unsigned char *u, unsigned char *v,\
int y1, int u1, int v1, int alpha, int stride)
#if ARCH_X86 || ARCH_X86_64
#include "x86/postproc_x86.h"
#endif
#ifndef vp8_postproc_down
#define vp8_postproc_down vp8_mbpost_proc_down_c
#endif
extern prototype_postproc_inplace(vp8_postproc_down);
#ifndef vp8_postproc_across
#define vp8_postproc_across vp8_mbpost_proc_across_ip_c
#endif
extern prototype_postproc_inplace(vp8_postproc_across);
#ifndef vp8_postproc_downacross
#define vp8_postproc_downacross vp8_post_proc_down_and_across_c
#endif
extern prototype_postproc(vp8_postproc_downacross);
#ifndef vp8_postproc_addnoise
#define vp8_postproc_addnoise vp8_plane_add_noise_c
#endif
extern prototype_postproc_addnoise(vp8_postproc_addnoise);
#ifndef vp8_postproc_blend_mb_inner
#define vp8_postproc_blend_mb_inner vp8_blend_mb_inner_c
#endif
extern prototype_postproc_blend_mb_inner(vp8_postproc_blend_mb_inner);
#ifndef vp8_postproc_blend_mb_outer
#define vp8_postproc_blend_mb_outer vp8_blend_mb_outer_c
#endif
extern prototype_postproc_blend_mb_outer(vp8_postproc_blend_mb_outer);
#ifndef vp8_postproc_blend_b
#define vp8_postproc_blend_b vp8_blend_b_c
#endif
extern prototype_postproc_blend_b(vp8_postproc_blend_b);
typedef prototype_postproc((*vp8_postproc_fn_t));
typedef prototype_postproc_inplace((*vp8_postproc_inplace_fn_t));
typedef prototype_postproc_addnoise((*vp8_postproc_addnoise_fn_t));
typedef prototype_postproc_blend_mb_inner((*vp8_postproc_blend_mb_inner_fn_t));
typedef prototype_postproc_blend_mb_outer((*vp8_postproc_blend_mb_outer_fn_t));
typedef prototype_postproc_blend_b((*vp8_postproc_blend_b_fn_t));
typedef struct
{
vp8_postproc_inplace_fn_t down;
vp8_postproc_inplace_fn_t across;
vp8_postproc_fn_t downacross;
vp8_postproc_addnoise_fn_t addnoise;
vp8_postproc_blend_mb_inner_fn_t blend_mb_inner;
vp8_postproc_blend_mb_outer_fn_t blend_mb_outer;
vp8_postproc_blend_b_fn_t blend_b;
} vp8_postproc_rtcd_vtable_t;
#if CONFIG_RUNTIME_CPU_DETECT
#define POSTPROC_INVOKE(ctx,fn) (ctx)->fn
#else
#define POSTPROC_INVOKE(ctx,fn) vp8_postproc_##fn
#endif
#include "vpx_ports/mem.h"
struct postproc_state
{
@ -105,6 +19,7 @@ struct postproc_state
int last_noise;
char noise[3072];
int last_base_qindex;
int last_frame_valid;
DECLARE_ALIGNED(16, char, blackclamp[16]);
DECLARE_ALIGNED(16, char, whiteclamp[16]);
DECLARE_ALIGNED(16, char, bothclamp[16]);
@ -115,17 +30,21 @@ int vp8_post_proc_frame(struct VP8Common *oci, YV12_BUFFER_CONFIG *dest,
vp8_ppflags_t *flags);
void vp8_de_noise(YV12_BUFFER_CONFIG *source,
void vp8_de_noise(struct VP8Common *oci,
YV12_BUFFER_CONFIG *source,
YV12_BUFFER_CONFIG *post,
int q,
int low_var_thresh,
int flag,
vp8_postproc_rtcd_vtable_t *rtcd);
int flag);
void vp8_deblock(YV12_BUFFER_CONFIG *source,
void vp8_deblock(struct VP8Common *oci,
YV12_BUFFER_CONFIG *source,
YV12_BUFFER_CONFIG *post,
int q,
int low_var_thresh,
int flag,
vp8_postproc_rtcd_vtable_t *rtcd);
int flag);
#define MFQE_PRECISION 4
void vp8_multiframe_quality_enhance(struct VP8Common *cm);
#endif

Просмотреть файл

@ -109,7 +109,10 @@ int vp8_ac2quant(int QIndex, int Delta)
else if (QIndex < 0)
QIndex = 0;
retval = (ac_qlookup[ QIndex ] * 155) / 100;
/* For all x in [0..284], x*155/100 is bitwise equal to (x*101581) >> 16.
* The smallest precision for that is '(x*6349) >> 12' but 16 is a good
* word size. */
retval = (ac_qlookup[ QIndex ] * 101581) >> 16;
if (retval < 8)
retval = 8;

Просмотреть файл

@ -1,111 +0,0 @@
/*
* Copyright (c) 2010 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.
*/
#ifndef __INC_RECON_H
#define __INC_RECON_H
#include "blockd.h"
#define prototype_copy_block(sym) \
void sym(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch)
#define prototype_recon_block(sym) \
void sym(unsigned char *pred, short *diff, int diff_stride, unsigned char *dst, int pitch)
#define prototype_recon_macroblock(sym) \
void sym(const struct vp8_recon_rtcd_vtable *rtcd, MACROBLOCKD *x)
#define prototype_build_intra_predictors(sym) \
void sym(MACROBLOCKD *x)
#define prototype_intra4x4_predict(sym) \
void sym(unsigned char *src, int src_stride, int b_mode, \
unsigned char *dst, int dst_stride)
struct vp8_recon_rtcd_vtable;
#if ARCH_X86 || ARCH_X86_64
#include "x86/recon_x86.h"
#endif
#if ARCH_ARM
#include "arm/recon_arm.h"
#endif
#ifndef vp8_recon_copy16x16
#define vp8_recon_copy16x16 vp8_copy_mem16x16_c
#endif
extern prototype_copy_block(vp8_recon_copy16x16);
#ifndef vp8_recon_copy8x8
#define vp8_recon_copy8x8 vp8_copy_mem8x8_c
#endif
extern prototype_copy_block(vp8_recon_copy8x8);
#ifndef vp8_recon_copy8x4
#define vp8_recon_copy8x4 vp8_copy_mem8x4_c
#endif
extern prototype_copy_block(vp8_recon_copy8x4);
#ifndef vp8_recon_build_intra_predictors_mby
#define vp8_recon_build_intra_predictors_mby vp8_build_intra_predictors_mby
#endif
extern prototype_build_intra_predictors\
(vp8_recon_build_intra_predictors_mby);
#ifndef vp8_recon_build_intra_predictors_mby_s
#define vp8_recon_build_intra_predictors_mby_s vp8_build_intra_predictors_mby_s
#endif
extern prototype_build_intra_predictors\
(vp8_recon_build_intra_predictors_mby_s);
#ifndef vp8_recon_build_intra_predictors_mbuv
#define vp8_recon_build_intra_predictors_mbuv vp8_build_intra_predictors_mbuv
#endif
extern prototype_build_intra_predictors\
(vp8_recon_build_intra_predictors_mbuv);
#ifndef vp8_recon_build_intra_predictors_mbuv_s
#define vp8_recon_build_intra_predictors_mbuv_s vp8_build_intra_predictors_mbuv_s
#endif
extern prototype_build_intra_predictors\
(vp8_recon_build_intra_predictors_mbuv_s);
#ifndef vp8_recon_intra4x4_predict
#define vp8_recon_intra4x4_predict vp8_intra4x4_predict_c
#endif
extern prototype_intra4x4_predict\
(vp8_recon_intra4x4_predict);
typedef prototype_copy_block((*vp8_copy_block_fn_t));
typedef prototype_build_intra_predictors((*vp8_build_intra_pred_fn_t));
typedef prototype_intra4x4_predict((*vp8_intra4x4_pred_fn_t));
typedef struct vp8_recon_rtcd_vtable
{
vp8_copy_block_fn_t copy16x16;
vp8_copy_block_fn_t copy8x8;
vp8_copy_block_fn_t copy8x4;
vp8_build_intra_pred_fn_t build_intra_predictors_mby_s;
vp8_build_intra_pred_fn_t build_intra_predictors_mby;
vp8_build_intra_pred_fn_t build_intra_predictors_mbuv_s;
vp8_build_intra_pred_fn_t build_intra_predictors_mbuv;
vp8_intra4x4_pred_fn_t intra4x4_predict;
} vp8_recon_rtcd_vtable_t;
#if CONFIG_RUNTIME_CPU_DETECT
#define RECON_INVOKE(ctx,fn) (ctx)->fn
#else
#define RECON_INVOKE(ctx,fn) vp8_recon_##fn
#endif
#endif

Просмотреть файл

@ -9,10 +9,10 @@
*/
#include <limits.h>
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vpx/vpx_integer.h"
#include "recon.h"
#include "subpixel.h"
#include "blockd.h"
#include "reconinter.h"
#if CONFIG_RUNTIME_CPU_DETECT
@ -123,25 +123,19 @@ void vp8_copy_mem8x4_c(
}
void vp8_build_inter_predictors_b(BLOCKD *d, int pitch, vp8_subpix_fn_t sppf)
void vp8_build_inter_predictors_b(BLOCKD *d, int pitch, unsigned char *base_pre, int pre_stride, vp8_subpix_fn_t sppf)
{
int r;
unsigned char *ptr_base;
unsigned char *ptr;
unsigned char *pred_ptr = d->predictor;
ptr_base = *(d->base_pre);
unsigned char *ptr;
ptr = base_pre + d->offset + (d->bmi.mv.as_mv.row >> 3) * pre_stride + (d->bmi.mv.as_mv.col >> 3);
if (d->bmi.mv.as_mv.row & 7 || d->bmi.mv.as_mv.col & 7)
{
ptr = ptr_base + d->pre + (d->bmi.mv.as_mv.row >> 3) * d->pre_stride + (d->bmi.mv.as_mv.col >> 3);
sppf(ptr, d->pre_stride, d->bmi.mv.as_mv.col & 7, d->bmi.mv.as_mv.row & 7, pred_ptr, pitch);
sppf(ptr, pre_stride, d->bmi.mv.as_mv.col & 7, d->bmi.mv.as_mv.row & 7, pred_ptr, pitch);
}
else
{
ptr_base += d->pre + (d->bmi.mv.as_mv.row >> 3) * d->pre_stride + (d->bmi.mv.as_mv.col >> 3);
ptr = ptr_base;
for (r = 0; r < 4; r++)
{
#if !(CONFIG_FAST_UNALIGNED)
@ -153,65 +147,53 @@ void vp8_build_inter_predictors_b(BLOCKD *d, int pitch, vp8_subpix_fn_t sppf)
*(uint32_t *)pred_ptr = *(uint32_t *)ptr ;
#endif
pred_ptr += pitch;
ptr += d->pre_stride;
ptr += pre_stride;
}
}
}
static void build_inter_predictors4b(MACROBLOCKD *x, BLOCKD *d, unsigned char *dst, int dst_stride)
static void build_inter_predictors4b(MACROBLOCKD *x, BLOCKD *d, unsigned char *dst, int dst_stride, unsigned char *base_pre, int pre_stride)
{
unsigned char *ptr_base;
unsigned char *ptr;
ptr_base = *(d->base_pre);
ptr = ptr_base + d->pre + (d->bmi.mv.as_mv.row >> 3) * d->pre_stride + (d->bmi.mv.as_mv.col >> 3);
ptr = base_pre + d->offset + (d->bmi.mv.as_mv.row >> 3) * pre_stride + (d->bmi.mv.as_mv.col >> 3);
if (d->bmi.mv.as_mv.row & 7 || d->bmi.mv.as_mv.col & 7)
{
x->subpixel_predict8x8(ptr, d->pre_stride, d->bmi.mv.as_mv.col & 7, d->bmi.mv.as_mv.row & 7, dst, dst_stride);
x->subpixel_predict8x8(ptr, pre_stride, d->bmi.mv.as_mv.col & 7, d->bmi.mv.as_mv.row & 7, dst, dst_stride);
}
else
{
RECON_INVOKE(&x->rtcd->recon, copy8x8)(ptr, d->pre_stride, dst, dst_stride);
vp8_copy_mem8x8(ptr, pre_stride, dst, dst_stride);
}
}
static void build_inter_predictors2b(MACROBLOCKD *x, BLOCKD *d, unsigned char *dst, int dst_stride)
static void build_inter_predictors2b(MACROBLOCKD *x, BLOCKD *d, unsigned char *dst, int dst_stride, unsigned char *base_pre, int pre_stride)
{
unsigned char *ptr_base;
unsigned char *ptr;
ptr_base = *(d->base_pre);
ptr = ptr_base + d->pre + (d->bmi.mv.as_mv.row >> 3) * d->pre_stride + (d->bmi.mv.as_mv.col >> 3);
ptr = base_pre + d->offset + (d->bmi.mv.as_mv.row >> 3) * pre_stride + (d->bmi.mv.as_mv.col >> 3);
if (d->bmi.mv.as_mv.row & 7 || d->bmi.mv.as_mv.col & 7)
{
x->subpixel_predict8x4(ptr, d->pre_stride, d->bmi.mv.as_mv.col & 7, d->bmi.mv.as_mv.row & 7, dst, dst_stride);
x->subpixel_predict8x4(ptr, pre_stride, d->bmi.mv.as_mv.col & 7, d->bmi.mv.as_mv.row & 7, dst, dst_stride);
}
else
{
RECON_INVOKE(&x->rtcd->recon, copy8x4)(ptr, d->pre_stride, dst, dst_stride);
vp8_copy_mem8x4(ptr, pre_stride, dst, dst_stride);
}
}
static void build_inter_predictors_b(BLOCKD *d, unsigned char *dst, int dst_stride, vp8_subpix_fn_t sppf)
static void build_inter_predictors_b(BLOCKD *d, unsigned char *dst, int dst_stride, unsigned char *base_pre, int pre_stride, vp8_subpix_fn_t sppf)
{
int r;
unsigned char *ptr_base;
unsigned char *ptr;
ptr_base = *(d->base_pre);
ptr = base_pre + d->offset + (d->bmi.mv.as_mv.row >> 3) * pre_stride + (d->bmi.mv.as_mv.col >> 3);
if (d->bmi.mv.as_mv.row & 7 || d->bmi.mv.as_mv.col & 7)
{
ptr = ptr_base + d->pre + (d->bmi.mv.as_mv.row >> 3) * d->pre_stride + (d->bmi.mv.as_mv.col >> 3);
sppf(ptr, d->pre_stride, d->bmi.mv.as_mv.col & 7, d->bmi.mv.as_mv.row & 7, dst, dst_stride);
sppf(ptr, pre_stride, d->bmi.mv.as_mv.col & 7, d->bmi.mv.as_mv.row & 7, dst, dst_stride);
}
else
{
ptr_base += d->pre + (d->bmi.mv.as_mv.row >> 3) * d->pre_stride + (d->bmi.mv.as_mv.col >> 3);
ptr = ptr_base;
for (r = 0; r < 4; r++)
{
#if !(CONFIG_FAST_UNALIGNED)
@ -223,7 +205,7 @@ static void build_inter_predictors_b(BLOCKD *d, unsigned char *dst, int dst_stri
*(uint32_t *)dst = *(uint32_t *)ptr ;
#endif
dst += dst_stride;
ptr += d->pre_stride;
ptr += pre_stride;
}
}
}
@ -239,22 +221,13 @@ void vp8_build_inter16x16_predictors_mbuv(MACROBLOCKD *x)
int mv_row = x->mode_info_context->mbmi.mv.as_mv.row;
int mv_col = x->mode_info_context->mbmi.mv.as_mv.col;
int offset;
int pre_stride = x->block[16].pre_stride;
int pre_stride = x->pre.uv_stride;
/* calc uv motion vectors */
if (mv_row < 0)
mv_row -= 1;
else
mv_row += 1;
if (mv_col < 0)
mv_col -= 1;
else
mv_col += 1;
mv_row += 1 | (mv_row >> (sizeof(int) * CHAR_BIT - 1));
mv_col += 1 | (mv_col >> (sizeof(int) * CHAR_BIT - 1));
mv_row /= 2;
mv_col /= 2;
mv_row &= x->fullpixel_mask;
mv_col &= x->fullpixel_mask;
@ -269,8 +242,8 @@ void vp8_build_inter16x16_predictors_mbuv(MACROBLOCKD *x)
}
else
{
RECON_INVOKE(&x->rtcd->recon, copy8x8)(uptr, pre_stride, upred_ptr, 8);
RECON_INVOKE(&x->rtcd->recon, copy8x8)(vptr, pre_stride, vpred_ptr, 8);
vp8_copy_mem8x8(uptr, pre_stride, upred_ptr, 8);
vp8_copy_mem8x8(vptr, pre_stride, vpred_ptr, 8);
}
}
@ -278,6 +251,8 @@ void vp8_build_inter16x16_predictors_mbuv(MACROBLOCKD *x)
void vp8_build_inter4x4_predictors_mbuv(MACROBLOCKD *x)
{
int i, j;
int pre_stride = x->pre.uv_stride;
unsigned char *base_pre;
/* build uv mvs */
for (i = 0; i < 2; i++)
@ -295,8 +270,7 @@ void vp8_build_inter4x4_predictors_mbuv(MACROBLOCKD *x)
+ x->block[yoffset+4].bmi.mv.as_mv.row
+ x->block[yoffset+5].bmi.mv.as_mv.row;
if (temp < 0) temp -= 4;
else temp += 4;
temp += 4 + ((temp >> (sizeof(int) * CHAR_BIT - 1)) << 3);
x->block[uoffset].bmi.mv.as_mv.row = (temp / 8) & x->fullpixel_mask;
@ -305,29 +279,41 @@ void vp8_build_inter4x4_predictors_mbuv(MACROBLOCKD *x)
+ x->block[yoffset+4].bmi.mv.as_mv.col
+ x->block[yoffset+5].bmi.mv.as_mv.col;
if (temp < 0) temp -= 4;
else temp += 4;
temp += 4 + ((temp >> (sizeof(int) * CHAR_BIT - 1)) << 3);
x->block[uoffset].bmi.mv.as_mv.col = (temp / 8) & x->fullpixel_mask;
x->block[voffset].bmi.mv.as_mv.row =
x->block[uoffset].bmi.mv.as_mv.row ;
x->block[voffset].bmi.mv.as_mv.col =
x->block[uoffset].bmi.mv.as_mv.col ;
x->block[voffset].bmi.mv.as_int = x->block[uoffset].bmi.mv.as_int;
}
}
for (i = 16; i < 24; i += 2)
base_pre = x->pre.u_buffer;
for (i = 16; i < 20; i += 2)
{
BLOCKD *d0 = &x->block[i];
BLOCKD *d1 = &x->block[i+1];
if (d0->bmi.mv.as_int == d1->bmi.mv.as_int)
build_inter_predictors2b(x, d0, d0->predictor, 8);
build_inter_predictors2b(x, d0, d0->predictor, 8, base_pre, pre_stride);
else
{
vp8_build_inter_predictors_b(d0, 8, x->subpixel_predict);
vp8_build_inter_predictors_b(d1, 8, x->subpixel_predict);
vp8_build_inter_predictors_b(d0, 8, base_pre, pre_stride, x->subpixel_predict);
vp8_build_inter_predictors_b(d1, 8, base_pre, pre_stride, x->subpixel_predict);
}
}
base_pre = x->pre.v_buffer;
for (i = 20; i < 24; i += 2)
{
BLOCKD *d0 = &x->block[i];
BLOCKD *d1 = &x->block[i+1];
if (d0->bmi.mv.as_int == d1->bmi.mv.as_int)
build_inter_predictors2b(x, d0, d0->predictor, 8, base_pre, pre_stride);
else
{
vp8_build_inter_predictors_b(d0, 8, base_pre, pre_stride, x->subpixel_predict);
vp8_build_inter_predictors_b(d1, 8, base_pre, pre_stride, x->subpixel_predict);
}
}
}
@ -342,7 +328,7 @@ void vp8_build_inter16x16_predictors_mby(MACROBLOCKD *x,
unsigned char *ptr;
int mv_row = x->mode_info_context->mbmi.mv.as_mv.row;
int mv_col = x->mode_info_context->mbmi.mv.as_mv.col;
int pre_stride = x->block[0].pre_stride;
int pre_stride = x->pre.y_stride;
ptr_base = x->pre.y_buffer;
ptr = ptr_base + (mv_row >> 3) * pre_stride + (mv_col >> 3);
@ -354,7 +340,7 @@ void vp8_build_inter16x16_predictors_mby(MACROBLOCKD *x,
}
else
{
RECON_INVOKE(&x->rtcd->recon, copy16x16)(ptr, pre_stride, dst_y,
vp8_copy_mem16x16(ptr, pre_stride, dst_y,
dst_ystride);
}
}
@ -409,7 +395,7 @@ void vp8_build_inter16x16_predictors_mb(MACROBLOCKD *x,
int_mv _16x16mv;
unsigned char *ptr_base = x->pre.y_buffer;
int pre_stride = x->block[0].pre_stride;
int pre_stride = x->pre.y_stride;
_16x16mv.as_int = x->mode_info_context->mbmi.mv.as_int;
@ -426,23 +412,14 @@ void vp8_build_inter16x16_predictors_mb(MACROBLOCKD *x,
}
else
{
RECON_INVOKE(&x->rtcd->recon, copy16x16)(ptr, pre_stride, dst_y, dst_ystride);
vp8_copy_mem16x16(ptr, pre_stride, dst_y, dst_ystride);
}
/* calc uv motion vectors */
if ( _16x16mv.as_mv.row < 0)
_16x16mv.as_mv.row -= 1;
else
_16x16mv.as_mv.row += 1;
if (_16x16mv.as_mv.col < 0)
_16x16mv.as_mv.col -= 1;
else
_16x16mv.as_mv.col += 1;
_16x16mv.as_mv.row += 1 | (_16x16mv.as_mv.row >> (sizeof(int) * CHAR_BIT - 1));
_16x16mv.as_mv.col += 1 | (_16x16mv.as_mv.col >> (sizeof(int) * CHAR_BIT - 1));
_16x16mv.as_mv.row /= 2;
_16x16mv.as_mv.col /= 2;
_16x16mv.as_mv.row &= x->fullpixel_mask;
_16x16mv.as_mv.col &= x->fullpixel_mask;
@ -458,19 +435,21 @@ void vp8_build_inter16x16_predictors_mb(MACROBLOCKD *x,
}
else
{
RECON_INVOKE(&x->rtcd->recon, copy8x8)(uptr, pre_stride, dst_u, dst_uvstride);
RECON_INVOKE(&x->rtcd->recon, copy8x8)(vptr, pre_stride, dst_v, dst_uvstride);
vp8_copy_mem8x8(uptr, pre_stride, dst_u, dst_uvstride);
vp8_copy_mem8x8(vptr, pre_stride, dst_v, dst_uvstride);
}
}
static void build_inter4x4_predictors_mb(MACROBLOCKD *x)
{
int i;
unsigned char *base_dst = x->dst.y_buffer;
unsigned char *base_pre = x->pre.y_buffer;
if (x->mode_info_context->mbmi.partitioning < 3)
{
BLOCKD *b;
int dst_stride = x->block[ 0].dst_stride;
int dst_stride = x->dst.y_stride;
x->block[ 0].bmi = x->mode_info_context->bmi[ 0];
x->block[ 2].bmi = x->mode_info_context->bmi[ 2];
@ -485,13 +464,13 @@ static void build_inter4x4_predictors_mb(MACROBLOCKD *x)
}
b = &x->block[ 0];
build_inter_predictors4b(x, b, *(b->base_dst) + b->dst, dst_stride);
build_inter_predictors4b(x, b, base_dst + b->offset, dst_stride, base_pre, dst_stride);
b = &x->block[ 2];
build_inter_predictors4b(x, b, *(b->base_dst) + b->dst, dst_stride);
build_inter_predictors4b(x, b, base_dst + b->offset, dst_stride, base_pre, dst_stride);
b = &x->block[ 8];
build_inter_predictors4b(x, b, *(b->base_dst) + b->dst, dst_stride);
build_inter_predictors4b(x, b, base_dst + b->offset, dst_stride, base_pre, dst_stride);
b = &x->block[10];
build_inter_predictors4b(x, b, *(b->base_dst) + b->dst, dst_stride);
build_inter_predictors4b(x, b, base_dst + b->offset, dst_stride, base_pre, dst_stride);
}
else
{
@ -499,7 +478,7 @@ static void build_inter4x4_predictors_mb(MACROBLOCKD *x)
{
BLOCKD *d0 = &x->block[i];
BLOCKD *d1 = &x->block[i+1];
int dst_stride = x->block[ 0].dst_stride;
int dst_stride = x->dst.y_stride;
x->block[i+0].bmi = x->mode_info_context->bmi[i+0];
x->block[i+1].bmi = x->mode_info_context->bmi[i+1];
@ -510,31 +489,51 @@ static void build_inter4x4_predictors_mb(MACROBLOCKD *x)
}
if (d0->bmi.mv.as_int == d1->bmi.mv.as_int)
build_inter_predictors2b(x, d0, *(d0->base_dst) + d0->dst, dst_stride);
build_inter_predictors2b(x, d0, base_dst + d0->offset, dst_stride, base_pre, dst_stride);
else
{
build_inter_predictors_b(d0, *(d0->base_dst) + d0->dst, dst_stride, x->subpixel_predict);
build_inter_predictors_b(d1, *(d1->base_dst) + d1->dst, dst_stride, x->subpixel_predict);
build_inter_predictors_b(d0, base_dst + d0->offset, dst_stride, base_pre, dst_stride, x->subpixel_predict);
build_inter_predictors_b(d1, base_dst + d1->offset, dst_stride, base_pre, dst_stride, x->subpixel_predict);
}
}
}
for (i = 16; i < 24; i += 2)
base_dst = x->dst.u_buffer;
base_pre = x->pre.u_buffer;
for (i = 16; i < 20; i += 2)
{
BLOCKD *d0 = &x->block[i];
BLOCKD *d1 = &x->block[i+1];
int dst_stride = x->block[ 16].dst_stride;
int dst_stride = x->dst.uv_stride;
/* Note: uv mvs already clamped in build_4x4uvmvs() */
if (d0->bmi.mv.as_int == d1->bmi.mv.as_int)
build_inter_predictors2b(x, d0, *(d0->base_dst) + d0->dst, dst_stride);
build_inter_predictors2b(x, d0, base_dst + d0->offset, dst_stride, base_pre, dst_stride);
else
{
build_inter_predictors_b(d0, *(d0->base_dst) + d0->dst, dst_stride, x->subpixel_predict);
build_inter_predictors_b(d1, *(d1->base_dst) + d1->dst, dst_stride, x->subpixel_predict);
build_inter_predictors_b(d0, base_dst + d0->offset, dst_stride, base_pre, dst_stride, x->subpixel_predict);
build_inter_predictors_b(d1, base_dst + d1->offset, dst_stride, base_pre, dst_stride, x->subpixel_predict);
}
}
base_dst = x->dst.v_buffer;
base_pre = x->pre.v_buffer;
for (i = 20; i < 24; i += 2)
{
BLOCKD *d0 = &x->block[i];
BLOCKD *d1 = &x->block[i+1];
int dst_stride = x->dst.uv_stride;
/* Note: uv mvs already clamped in build_4x4uvmvs() */
if (d0->bmi.mv.as_int == d1->bmi.mv.as_int)
build_inter_predictors2b(x, d0, base_dst + d0->offset, dst_stride, base_pre, dst_stride);
else
{
build_inter_predictors_b(d0, base_dst + d0->offset, dst_stride, base_pre, dst_stride, x->subpixel_predict);
build_inter_predictors_b(d1, base_dst + d1->offset, dst_stride, base_pre, dst_stride, x->subpixel_predict);
}
}
}
@ -559,8 +558,7 @@ void build_4x4uvmvs(MACROBLOCKD *x)
+ x->mode_info_context->bmi[yoffset + 4].mv.as_mv.row
+ x->mode_info_context->bmi[yoffset + 5].mv.as_mv.row;
if (temp < 0) temp -= 4;
else temp += 4;
temp += 4 + ((temp >> (sizeof(int) * CHAR_BIT - 1)) << 3);
x->block[uoffset].bmi.mv.as_mv.row = (temp / 8) & x->fullpixel_mask;
@ -569,18 +567,14 @@ void build_4x4uvmvs(MACROBLOCKD *x)
+ x->mode_info_context->bmi[yoffset + 4].mv.as_mv.col
+ x->mode_info_context->bmi[yoffset + 5].mv.as_mv.col;
if (temp < 0) temp -= 4;
else temp += 4;
temp += 4 + ((temp >> (sizeof(int) * CHAR_BIT - 1)) << 3);
x->block[uoffset].bmi.mv.as_mv.col = (temp / 8) & x->fullpixel_mask;
if (x->mode_info_context->mbmi.need_to_clamp_mvs)
clamp_uvmv_to_umv_border(&x->block[uoffset].bmi.mv.as_mv, x);
x->block[voffset].bmi.mv.as_mv.row =
x->block[uoffset].bmi.mv.as_mv.row ;
x->block[voffset].bmi.mv.as_mv.col =
x->block[uoffset].bmi.mv.as_mv.col ;
x->block[voffset].bmi.mv.as_int = x->block[uoffset].bmi.mv.as_int;
}
}
}

Просмотреть файл

@ -25,6 +25,8 @@ extern void vp8_build_inter16x16_predictors_mby(MACROBLOCKD *x,
unsigned char *dst_y,
int dst_ystride);
extern void vp8_build_inter_predictors_b(BLOCKD *d, int pitch,
unsigned char *base_pre,
int pre_stride,
vp8_subpix_fn_t sppf);
extern void vp8_build_inter16x16_predictors_mbuv(MACROBLOCKD *x);

Просмотреть файл

@ -10,147 +10,24 @@
#include "vpx_config.h"
#include "recon.h"
#include "reconintra.h"
#include "vpx_rtcd.h"
#include "vpx_mem/vpx_mem.h"
#include "blockd.h"
/* For skip_recon_mb(), add vp8_build_intra_predictors_mby_s(MACROBLOCKD *x) and
* vp8_build_intra_predictors_mbuv_s(MACROBLOCKD *x).
*/
void vp8_build_intra_predictors_mby(MACROBLOCKD *x)
void vp8_build_intra_predictors_mby_s_c(MACROBLOCKD *x,
unsigned char * yabove_row,
unsigned char * yleft,
int left_stride,
unsigned char * ypred_ptr,
int y_stride)
{
unsigned char *yabove_row = x->dst.y_buffer - x->dst.y_stride;
unsigned char yleft_col[16];
unsigned char ytop_left = yabove_row[-1];
unsigned char *ypred_ptr = x->predictor;
int r, c, i;
for (i = 0; i < 16; i++)
{
yleft_col[i] = x->dst.y_buffer [i* x->dst.y_stride -1];
}
/* for Y */
switch (x->mode_info_context->mbmi.mode)
{
case DC_PRED:
{
int expected_dc;
int i;
int shift;
int average = 0;
if (x->up_available || x->left_available)
{
if (x->up_available)
{
for (i = 0; i < 16; i++)
{
average += yabove_row[i];
}
}
if (x->left_available)
{
for (i = 0; i < 16; i++)
{
average += yleft_col[i];
}
}
shift = 3 + x->up_available + x->left_available;
expected_dc = (average + (1 << (shift - 1))) >> shift;
}
else
{
expected_dc = 128;
}
vpx_memset(ypred_ptr, expected_dc, 256);
}
break;
case V_PRED:
{
for (r = 0; r < 16; r++)
{
((int *)ypred_ptr)[0] = ((int *)yabove_row)[0];
((int *)ypred_ptr)[1] = ((int *)yabove_row)[1];
((int *)ypred_ptr)[2] = ((int *)yabove_row)[2];
((int *)ypred_ptr)[3] = ((int *)yabove_row)[3];
ypred_ptr += 16;
}
}
break;
case H_PRED:
{
for (r = 0; r < 16; r++)
{
vpx_memset(ypred_ptr, yleft_col[r], 16);
ypred_ptr += 16;
}
}
break;
case TM_PRED:
{
for (r = 0; r < 16; r++)
{
for (c = 0; c < 16; c++)
{
int pred = yleft_col[r] + yabove_row[ c] - ytop_left;
if (pred < 0)
pred = 0;
if (pred > 255)
pred = 255;
ypred_ptr[c] = pred;
}
ypred_ptr += 16;
}
}
break;
case B_PRED:
case NEARESTMV:
case NEARMV:
case ZEROMV:
case NEWMV:
case SPLITMV:
case MB_MODE_COUNT:
break;
}
}
void vp8_build_intra_predictors_mby_s(MACROBLOCKD *x)
{
unsigned char *yabove_row = x->dst.y_buffer - x->dst.y_stride;
unsigned char yleft_col[16];
unsigned char ytop_left = yabove_row[-1];
unsigned char *ypred_ptr = x->predictor;
int r, c, i;
int y_stride = x->dst.y_stride;
ypred_ptr = x->dst.y_buffer; /*x->predictor;*/
for (i = 0; i < 16; i++)
{
yleft_col[i] = x->dst.y_buffer [i* x->dst.y_stride -1];
yleft_col[i] = yleft[i* left_stride];
}
/* for Y */
@ -198,7 +75,7 @@ void vp8_build_intra_predictors_mby_s(MACROBLOCKD *x)
for (r = 0; r < 16; r++)
{
vpx_memset(ypred_ptr, expected_dc, 16);
ypred_ptr += y_stride; /*16;*/
ypred_ptr += y_stride;
}
}
break;
@ -212,7 +89,7 @@ void vp8_build_intra_predictors_mby_s(MACROBLOCKD *x)
((int *)ypred_ptr)[1] = ((int *)yabove_row)[1];
((int *)ypred_ptr)[2] = ((int *)yabove_row)[2];
((int *)ypred_ptr)[3] = ((int *)yabove_row)[3];
ypred_ptr += y_stride; /*16;*/
ypred_ptr += y_stride;
}
}
break;
@ -223,7 +100,7 @@ void vp8_build_intra_predictors_mby_s(MACROBLOCKD *x)
{
vpx_memset(ypred_ptr, yleft_col[r], 16);
ypred_ptr += y_stride; /*16;*/
ypred_ptr += y_stride;
}
}
@ -246,7 +123,7 @@ void vp8_build_intra_predictors_mby_s(MACROBLOCKD *x)
ypred_ptr[c] = pred;
}
ypred_ptr += y_stride; /*16;*/
ypred_ptr += y_stride;
}
}
@ -262,162 +139,27 @@ void vp8_build_intra_predictors_mby_s(MACROBLOCKD *x)
}
}
void vp8_build_intra_predictors_mbuv(MACROBLOCKD *x)
void vp8_build_intra_predictors_mbuv_s_c(MACROBLOCKD *x,
unsigned char * uabove_row,
unsigned char * vabove_row,
unsigned char * uleft,
unsigned char * vleft,
int left_stride,
unsigned char * upred_ptr,
unsigned char * vpred_ptr,
int pred_stride)
{
unsigned char *uabove_row = x->dst.u_buffer - x->dst.uv_stride;
unsigned char uleft_col[16];
unsigned char uleft_col[8];
unsigned char utop_left = uabove_row[-1];
unsigned char *vabove_row = x->dst.v_buffer - x->dst.uv_stride;
unsigned char vleft_col[20];
unsigned char vleft_col[8];
unsigned char vtop_left = vabove_row[-1];
unsigned char *upred_ptr = &x->predictor[256];
unsigned char *vpred_ptr = &x->predictor[320];
int i, j;
for (i = 0; i < 8; i++)
{
uleft_col[i] = x->dst.u_buffer [i* x->dst.uv_stride -1];
vleft_col[i] = x->dst.v_buffer [i* x->dst.uv_stride -1];
}
switch (x->mode_info_context->mbmi.uv_mode)
{
case DC_PRED:
{
int expected_udc;
int expected_vdc;
int i;
int shift;
int Uaverage = 0;
int Vaverage = 0;
if (x->up_available)
{
for (i = 0; i < 8; i++)
{
Uaverage += uabove_row[i];
Vaverage += vabove_row[i];
}
}
if (x->left_available)
{
for (i = 0; i < 8; i++)
{
Uaverage += uleft_col[i];
Vaverage += vleft_col[i];
}
}
if (!x->up_available && !x->left_available)
{
expected_udc = 128;
expected_vdc = 128;
}
else
{
shift = 2 + x->up_available + x->left_available;
expected_udc = (Uaverage + (1 << (shift - 1))) >> shift;
expected_vdc = (Vaverage + (1 << (shift - 1))) >> shift;
}
vpx_memset(upred_ptr, expected_udc, 64);
vpx_memset(vpred_ptr, expected_vdc, 64);
}
break;
case V_PRED:
{
int i;
for (i = 0; i < 8; i++)
{
vpx_memcpy(upred_ptr, uabove_row, 8);
vpx_memcpy(vpred_ptr, vabove_row, 8);
upred_ptr += 8;
vpred_ptr += 8;
}
}
break;
case H_PRED:
{
int i;
for (i = 0; i < 8; i++)
{
vpx_memset(upred_ptr, uleft_col[i], 8);
vpx_memset(vpred_ptr, vleft_col[i], 8);
upred_ptr += 8;
vpred_ptr += 8;
}
}
break;
case TM_PRED:
{
int i;
for (i = 0; i < 8; i++)
{
for (j = 0; j < 8; j++)
{
int predu = uleft_col[i] + uabove_row[j] - utop_left;
int predv = vleft_col[i] + vabove_row[j] - vtop_left;
if (predu < 0)
predu = 0;
if (predu > 255)
predu = 255;
if (predv < 0)
predv = 0;
if (predv > 255)
predv = 255;
upred_ptr[j] = predu;
vpred_ptr[j] = predv;
}
upred_ptr += 8;
vpred_ptr += 8;
}
}
break;
case B_PRED:
case NEARESTMV:
case NEARMV:
case ZEROMV:
case NEWMV:
case SPLITMV:
case MB_MODE_COUNT:
break;
}
}
void vp8_build_intra_predictors_mbuv_s(MACROBLOCKD *x)
{
unsigned char *uabove_row = x->dst.u_buffer - x->dst.uv_stride;
unsigned char uleft_col[16];
unsigned char utop_left = uabove_row[-1];
unsigned char *vabove_row = x->dst.v_buffer - x->dst.uv_stride;
unsigned char vleft_col[20];
unsigned char vtop_left = vabove_row[-1];
unsigned char *upred_ptr = x->dst.u_buffer; /*&x->predictor[256];*/
unsigned char *vpred_ptr = x->dst.v_buffer; /*&x->predictor[320];*/
int uv_stride = x->dst.uv_stride;
int i, j;
for (i = 0; i < 8; i++)
{
uleft_col[i] = x->dst.u_buffer [i* x->dst.uv_stride -1];
vleft_col[i] = x->dst.v_buffer [i* x->dst.uv_stride -1];
uleft_col[i] = uleft [i* left_stride];
vleft_col[i] = vleft [i* left_stride];
}
switch (x->mode_info_context->mbmi.uv_mode)
@ -468,8 +210,8 @@ void vp8_build_intra_predictors_mbuv_s(MACROBLOCKD *x)
{
vpx_memset(upred_ptr, expected_udc, 8);
vpx_memset(vpred_ptr, expected_vdc, 8);
upred_ptr += uv_stride; /*8;*/
vpred_ptr += uv_stride; /*8;*/
upred_ptr += pred_stride;
vpred_ptr += pred_stride;
}
}
break;
@ -481,8 +223,8 @@ void vp8_build_intra_predictors_mbuv_s(MACROBLOCKD *x)
{
vpx_memcpy(upred_ptr, uabove_row, 8);
vpx_memcpy(vpred_ptr, vabove_row, 8);
upred_ptr += uv_stride; /*8;*/
vpred_ptr += uv_stride; /*8;*/
upred_ptr += pred_stride;
vpred_ptr += pred_stride;
}
}
@ -495,8 +237,8 @@ void vp8_build_intra_predictors_mbuv_s(MACROBLOCKD *x)
{
vpx_memset(upred_ptr, uleft_col[i], 8);
vpx_memset(vpred_ptr, vleft_col[i], 8);
upred_ptr += uv_stride; /*8;*/
vpred_ptr += uv_stride; /*8;*/
upred_ptr += pred_stride;
vpred_ptr += pred_stride;
}
}
@ -528,8 +270,8 @@ void vp8_build_intra_predictors_mbuv_s(MACROBLOCKD *x)
vpred_ptr[j] = predv;
}
upred_ptr += uv_stride; /*8;*/
vpred_ptr += uv_stride; /*8;*/
upred_ptr += pred_stride;
vpred_ptr += pred_stride;
}
}

Просмотреть файл

@ -1,17 +0,0 @@
/*
* Copyright (c) 2010 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.
*/
#ifndef __INC_RECONINTRA_H
#define __INC_RECONINTRA_H
extern void init_intra_left_above_pixels(MACROBLOCKD *x);
#endif

Просмотреть файл

@ -9,22 +9,23 @@
*/
#include "recon.h"
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "blockd.h"
void vp8_intra4x4_predict_c(unsigned char *src, int src_stride,
int b_mode,
unsigned char *dst, int dst_stride)
void vp8_intra4x4_predict_c(unsigned char *Above,
unsigned char *yleft, int left_stride,
B_PREDICTION_MODE b_mode,
unsigned char *dst, int dst_stride,
unsigned char top_left)
{
int i, r, c;
unsigned char *Above = src - src_stride;
unsigned char Left[4];
unsigned char top_left = Above[-1];
Left[0] = src[-1];
Left[1] = src[-1 + src_stride];
Left[2] = src[-1 + 2 * src_stride];
Left[3] = src[-1 + 3 * src_stride];
Left[0] = yleft[0];
Left[1] = yleft[left_stride];
Left[2] = yleft[2 * left_stride];
Left[3] = yleft[3 * left_stride];
switch (b_mode)
{
@ -289,27 +290,8 @@ void vp8_intra4x4_predict_c(unsigned char *src, int src_stride,
}
break;
default:
break;
}
}
/* copy 4 bytes from the above right down so that the 4x4 prediction modes using pixels above and
* to the right prediction have filled in pixels to use.
*/
void vp8_intra_prediction_down_copy(MACROBLOCKD *x)
{
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 *)above_right;
unsigned int *dst_ptr0 = (unsigned int *)(above_right + 4 * x->block[0].dst_stride);
unsigned int *dst_ptr1 = (unsigned int *)(above_right + 8 * x->block[0].dst_stride);
unsigned int *dst_ptr2 = (unsigned int *)(above_right + 12 * x->block[0].dst_stride);
*dst_ptr0 = *src_ptr;
*dst_ptr1 = *src_ptr;
*dst_ptr2 = *src_ptr;
}

Просмотреть файл

@ -11,7 +11,22 @@
#ifndef __INC_RECONINTRA4x4_H
#define __INC_RECONINTRA4x4_H
#include "vp8/common/blockd.h"
extern void vp8_intra_prediction_down_copy(MACROBLOCKD *x);
static void intra_prediction_down_copy(MACROBLOCKD *xd,
unsigned char *above_right_src)
{
int dst_stride = xd->dst.y_stride;
unsigned char *above_right_dst = xd->dst.y_buffer - dst_stride + 16;
unsigned int *src_ptr = (unsigned int *)above_right_src;
unsigned int *dst_ptr0 = (unsigned int *)(above_right_dst + 4 * dst_stride);
unsigned int *dst_ptr1 = (unsigned int *)(above_right_dst + 8 * dst_stride);
unsigned int *dst_ptr2 = (unsigned int *)(above_right_dst + 12 * dst_stride);
*dst_ptr0 = *src_ptr;
*dst_ptr1 = *src_ptr;
*dst_ptr2 = *src_ptr;
}
#endif

Просмотреть файл

@ -0,0 +1,105 @@
/*
* 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.
*/
#include "vpx_config.h"
#define RTCD_C
#include "vpx_rtcd.h"
#if CONFIG_MULTITHREAD && defined(_WIN32)
#include <windows.h>
#include <stdlib.h>
static void once(void (*func)(void))
{
static CRITICAL_SECTION *lock;
static LONG waiters;
static int done;
void *lock_ptr = &lock;
/* If the initialization is complete, return early. This isn't just an
* optimization, it prevents races on the destruction of the global
* lock.
*/
if(done)
return;
InterlockedIncrement(&waiters);
/* Get a lock. We create one and try to make it the one-true-lock,
* throwing it away if we lost the race.
*/
{
/* Scope to protect access to new_lock */
CRITICAL_SECTION *new_lock = malloc(sizeof(CRITICAL_SECTION));
InitializeCriticalSection(new_lock);
if (InterlockedCompareExchangePointer(lock_ptr, new_lock, NULL) != NULL)
{
DeleteCriticalSection(new_lock);
free(new_lock);
}
}
/* At this point, we have a lock that can be synchronized on. We don't
* care which thread actually performed the allocation.
*/
EnterCriticalSection(lock);
if (!done)
{
func();
done = 1;
}
LeaveCriticalSection(lock);
/* Last one out should free resources. The destructed objects are
* protected by checking if(done) above.
*/
if(!InterlockedDecrement(&waiters))
{
DeleteCriticalSection(lock);
free(lock);
lock = NULL;
}
}
#elif CONFIG_MULTITHREAD && HAVE_PTHREAD_H
#include <pthread.h>
static void once(void (*func)(void))
{
static pthread_once_t lock = PTHREAD_ONCE_INIT;
pthread_once(&lock, func);
}
#else
/* No-op version that performs no synchronization. vpx_rtcd() is idempotent,
* so as long as your platform provides atomic loads/stores of pointers
* no synchronization is strictly necessary.
*/
static void once(void (*func)(void))
{
static int done;
if(!done)
{
func();
done = 1;
}
}
#endif
void vpx_rtcd()
{
once(setup_rtcd_internal);
}

Просмотреть файл

@ -9,46 +9,15 @@
*/
#include <limits.h>
#include <stdlib.h>
#include "vpx_config.h"
#include "vpx/vpx_integer.h"
unsigned int vp8_sad16x16_c(
const unsigned char *src_ptr,
int src_stride,
const unsigned char *ref_ptr,
int ref_stride,
int max_sad)
static unsigned int sad_mx_n_c(const unsigned char *src_ptr, int src_stride,
const unsigned char *ref_ptr, int ref_stride,
unsigned int max_sad, int m, int n)
{
int r, c;
unsigned int sad = 0;
for (r = 0; r < 16; r++)
{
for (c = 0; c < 16; c++)
{
sad += abs(src_ptr[c] - ref_ptr[c]);
}
src_ptr += src_stride;
ref_ptr += ref_stride;
}
return sad;
}
static
unsigned int sad_mx_n_c(
const unsigned char *src_ptr,
int src_stride,
const unsigned char *ref_ptr,
int ref_stride,
int m,
int n)
{
int r, c;
unsigned int sad = 0;
@ -59,6 +28,9 @@ unsigned int sad_mx_n_c(
sad += abs(src_ptr[c] - ref_ptr[c]);
}
if (sad > max_sad)
break;
src_ptr += src_stride;
ref_ptr += ref_stride;
}
@ -66,287 +38,215 @@ unsigned int sad_mx_n_c(
return sad;
}
/* max_sad is provided as an optional optimization point. Alternative
* implementations of these functions are not required to check it.
*/
unsigned int vp8_sad8x8_c(
const unsigned char *src_ptr,
int src_stride,
const unsigned char *ref_ptr,
int ref_stride,
int max_sad)
unsigned int vp8_sad16x16_c(const unsigned char *src_ptr, int src_stride,
const unsigned char *ref_ptr, int ref_stride,
unsigned int max_sad)
{
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 8, 8);
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 16, 16);
}
unsigned int vp8_sad16x8_c(
const unsigned char *src_ptr,
int src_stride,
const unsigned char *ref_ptr,
int ref_stride,
int max_sad)
unsigned int vp8_sad8x8_c(const unsigned char *src_ptr, int src_stride,
const unsigned char *ref_ptr, int ref_stride,
unsigned int max_sad)
{
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 8, 8);
}
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 16, 8);
unsigned int vp8_sad16x8_c(const unsigned char *src_ptr, int src_stride,
const unsigned char *ref_ptr, int ref_stride,
unsigned int max_sad)
{
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 16, 8);
}
unsigned int vp8_sad8x16_c(
const unsigned char *src_ptr,
int src_stride,
const unsigned char *ref_ptr,
int ref_stride,
int max_sad)
unsigned int vp8_sad8x16_c(const unsigned char *src_ptr, int src_stride,
const unsigned char *ref_ptr, int ref_stride,
unsigned int max_sad)
{
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 8, 16);
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 8, 16);
}
unsigned int vp8_sad4x4_c(
const unsigned char *src_ptr,
int src_stride,
const unsigned char *ref_ptr,
int ref_stride,
int max_sad)
unsigned int vp8_sad4x4_c(const unsigned char *src_ptr, int src_stride,
const unsigned char *ref_ptr, int ref_stride,
unsigned int max_sad)
{
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 4, 4);
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 4, 4);
}
void vp8_sad16x16x3_c(
const unsigned char *src_ptr,
int src_stride,
const unsigned char *ref_ptr,
int ref_stride,
unsigned int *sad_array
)
void vp8_sad16x16x3_c(const unsigned char *src_ptr, int src_stride,
const unsigned char *ref_ptr, int ref_stride,
unsigned int *sad_array)
{
sad_array[0] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr , ref_stride, 0x7fffffff);
sad_array[1] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, 0x7fffffff);
sad_array[2] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, 0x7fffffff);
sad_array[0] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 0, ref_stride, UINT_MAX);
sad_array[1] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, UINT_MAX);
sad_array[2] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, UINT_MAX);
}
void vp8_sad16x16x8_c(
const unsigned char *src_ptr,
int src_stride,
const unsigned char *ref_ptr,
int ref_stride,
unsigned short *sad_array
)
void vp8_sad16x16x8_c(const unsigned char *src_ptr, int src_stride,
const unsigned char *ref_ptr, int ref_stride,
unsigned short *sad_array)
{
sad_array[0] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr , ref_stride, 0x7fffffff);
sad_array[1] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, 0x7fffffff);
sad_array[2] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, 0x7fffffff);
sad_array[3] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 3 , ref_stride, 0x7fffffff);
sad_array[4] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 4, ref_stride, 0x7fffffff);
sad_array[5] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 5, ref_stride, 0x7fffffff);
sad_array[6] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 6 , ref_stride, 0x7fffffff);
sad_array[7] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 7, ref_stride, 0x7fffffff);
sad_array[0] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 0, ref_stride, UINT_MAX);
sad_array[1] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, UINT_MAX);
sad_array[2] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, UINT_MAX);
sad_array[3] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 3, ref_stride, UINT_MAX);
sad_array[4] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 4, ref_stride, UINT_MAX);
sad_array[5] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 5, ref_stride, UINT_MAX);
sad_array[6] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 6, ref_stride, UINT_MAX);
sad_array[7] = (unsigned short)vp8_sad16x16_c(src_ptr, src_stride, ref_ptr + 7, ref_stride, UINT_MAX);
}
void vp8_sad16x8x3_c(
const unsigned char *src_ptr,
int src_stride,
const unsigned char *ref_ptr,
int ref_stride,
unsigned int *sad_array
)
void vp8_sad16x8x3_c(const unsigned char *src_ptr, int src_stride,
const unsigned char *ref_ptr, int ref_stride,
unsigned int *sad_array)
{
sad_array[0] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr , ref_stride, 0x7fffffff);
sad_array[1] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, 0x7fffffff);
sad_array[2] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, 0x7fffffff);
sad_array[0] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 0, ref_stride, UINT_MAX);
sad_array[1] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, UINT_MAX);
sad_array[2] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, UINT_MAX);
}
void vp8_sad16x8x8_c(
const unsigned char *src_ptr,
int src_stride,
const unsigned char *ref_ptr,
int ref_stride,
unsigned short *sad_array
)
void vp8_sad16x8x8_c(const unsigned char *src_ptr, int src_stride,
const unsigned char *ref_ptr, int ref_stride,
unsigned short *sad_array)
{
sad_array[0] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr , ref_stride, 0x7fffffff);
sad_array[1] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, 0x7fffffff);
sad_array[2] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, 0x7fffffff);
sad_array[3] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 3 , ref_stride, 0x7fffffff);
sad_array[4] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 4, ref_stride, 0x7fffffff);
sad_array[5] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 5, ref_stride, 0x7fffffff);
sad_array[6] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 6 , ref_stride, 0x7fffffff);
sad_array[7] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 7, ref_stride, 0x7fffffff);
sad_array[0] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 0, ref_stride, UINT_MAX);
sad_array[1] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, UINT_MAX);
sad_array[2] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, UINT_MAX);
sad_array[3] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 3, ref_stride, UINT_MAX);
sad_array[4] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 4, ref_stride, UINT_MAX);
sad_array[5] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 5, ref_stride, UINT_MAX);
sad_array[6] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 6, ref_stride, UINT_MAX);
sad_array[7] = (unsigned short)vp8_sad16x8_c(src_ptr, src_stride, ref_ptr + 7, ref_stride, UINT_MAX);
}
void vp8_sad8x8x3_c(
const unsigned char *src_ptr,
int src_stride,
const unsigned char *ref_ptr,
int ref_stride,
unsigned int *sad_array
)
void vp8_sad8x8x3_c(const unsigned char *src_ptr, int src_stride,
const unsigned char *ref_ptr, int ref_stride,
unsigned int *sad_array)
{
sad_array[0] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr , ref_stride, 0x7fffffff);
sad_array[1] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, 0x7fffffff);
sad_array[2] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, 0x7fffffff);
sad_array[0] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 0, ref_stride, UINT_MAX);
sad_array[1] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, UINT_MAX);
sad_array[2] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, UINT_MAX);
}
void vp8_sad8x8x8_c(
const unsigned char *src_ptr,
int src_stride,
const unsigned char *ref_ptr,
int ref_stride,
unsigned short *sad_array
)
void vp8_sad8x8x8_c(const unsigned char *src_ptr, int src_stride,
const unsigned char *ref_ptr, int ref_stride,
unsigned short *sad_array)
{
sad_array[0] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr , ref_stride, 0x7fffffff);
sad_array[1] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, 0x7fffffff);
sad_array[2] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, 0x7fffffff);
sad_array[3] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 3 , ref_stride, 0x7fffffff);
sad_array[4] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 4, ref_stride, 0x7fffffff);
sad_array[5] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 5, ref_stride, 0x7fffffff);
sad_array[6] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 6 , ref_stride, 0x7fffffff);
sad_array[7] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 7, ref_stride, 0x7fffffff);
sad_array[0] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 0, ref_stride, UINT_MAX);
sad_array[1] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, UINT_MAX);
sad_array[2] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, UINT_MAX);
sad_array[3] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 3, ref_stride, UINT_MAX);
sad_array[4] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 4, ref_stride, UINT_MAX);
sad_array[5] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 5, ref_stride, UINT_MAX);
sad_array[6] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 6, ref_stride, UINT_MAX);
sad_array[7] = (unsigned short)vp8_sad8x8_c(src_ptr, src_stride, ref_ptr + 7, ref_stride, UINT_MAX);
}
void vp8_sad8x16x3_c(
const unsigned char *src_ptr,
int src_stride,
const unsigned char *ref_ptr,
int ref_stride,
unsigned int *sad_array
)
void vp8_sad8x16x3_c(const unsigned char *src_ptr, int src_stride,
const unsigned char *ref_ptr, int ref_stride,
unsigned int *sad_array)
{
sad_array[0] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr , ref_stride, 0x7fffffff);
sad_array[1] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, 0x7fffffff);
sad_array[2] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, 0x7fffffff);
sad_array[0] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 0, ref_stride, UINT_MAX);
sad_array[1] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, UINT_MAX);
sad_array[2] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, UINT_MAX);
}
void vp8_sad8x16x8_c(
const unsigned char *src_ptr,
int src_stride,
const unsigned char *ref_ptr,
int ref_stride,
unsigned short *sad_array
)
void vp8_sad8x16x8_c(const unsigned char *src_ptr, int src_stride,
const unsigned char *ref_ptr, int ref_stride,
unsigned short *sad_array)
{
sad_array[0] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr , ref_stride, 0x7fffffff);
sad_array[1] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, 0x7fffffff);
sad_array[2] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, 0x7fffffff);
sad_array[3] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 3 , ref_stride, 0x7fffffff);
sad_array[4] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 4, ref_stride, 0x7fffffff);
sad_array[5] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 5, ref_stride, 0x7fffffff);
sad_array[6] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 6 , ref_stride, 0x7fffffff);
sad_array[7] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 7, ref_stride, 0x7fffffff);
sad_array[0] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 0, ref_stride, UINT_MAX);
sad_array[1] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, UINT_MAX);
sad_array[2] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, UINT_MAX);
sad_array[3] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 3, ref_stride, UINT_MAX);
sad_array[4] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 4, ref_stride, UINT_MAX);
sad_array[5] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 5, ref_stride, UINT_MAX);
sad_array[6] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 6, ref_stride, UINT_MAX);
sad_array[7] = (unsigned short)vp8_sad8x16_c(src_ptr, src_stride, ref_ptr + 7, ref_stride, UINT_MAX);
}
void vp8_sad4x4x3_c(
const unsigned char *src_ptr,
int src_stride,
const unsigned char *ref_ptr,
int ref_stride,
unsigned int *sad_array
)
void vp8_sad4x4x3_c(const unsigned char *src_ptr, int src_stride,
const unsigned char *ref_ptr, int ref_stride,
unsigned int *sad_array)
{
sad_array[0] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr , ref_stride, 0x7fffffff);
sad_array[1] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, 0x7fffffff);
sad_array[2] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, 0x7fffffff);
sad_array[0] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 0, ref_stride, UINT_MAX);
sad_array[1] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, UINT_MAX);
sad_array[2] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, UINT_MAX);
}
void vp8_sad4x4x8_c(
const unsigned char *src_ptr,
int src_stride,
const unsigned char *ref_ptr,
int ref_stride,
unsigned short *sad_array
)
void vp8_sad4x4x8_c(const unsigned char *src_ptr, int src_stride,
const unsigned char *ref_ptr, int ref_stride,
unsigned short *sad_array)
{
sad_array[0] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr , ref_stride, 0x7fffffff);
sad_array[1] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, 0x7fffffff);
sad_array[2] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, 0x7fffffff);
sad_array[3] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 3 , ref_stride, 0x7fffffff);
sad_array[4] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 4, ref_stride, 0x7fffffff);
sad_array[5] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 5, ref_stride, 0x7fffffff);
sad_array[6] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 6 , ref_stride, 0x7fffffff);
sad_array[7] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 7, ref_stride, 0x7fffffff);
sad_array[0] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 0, ref_stride, UINT_MAX);
sad_array[1] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 1, ref_stride, UINT_MAX);
sad_array[2] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 2, ref_stride, UINT_MAX);
sad_array[3] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 3, ref_stride, UINT_MAX);
sad_array[4] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 4, ref_stride, UINT_MAX);
sad_array[5] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 5, ref_stride, UINT_MAX);
sad_array[6] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 6, ref_stride, UINT_MAX);
sad_array[7] = (unsigned short)vp8_sad4x4_c(src_ptr, src_stride, ref_ptr + 7, ref_stride, UINT_MAX);
}
void vp8_sad16x16x4d_c(
const unsigned char *src_ptr,
int src_stride,
unsigned char *ref_ptr[],
int ref_stride,
unsigned int *sad_array
)
void vp8_sad16x16x4d_c(const unsigned char *src_ptr, int src_stride,
const unsigned char * const ref_ptr[], int ref_stride,
unsigned int *sad_array)
{
sad_array[0] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr[0], ref_stride, 0x7fffffff);
sad_array[1] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr[1], ref_stride, 0x7fffffff);
sad_array[2] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr[2], ref_stride, 0x7fffffff);
sad_array[3] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr[3], ref_stride, 0x7fffffff);
sad_array[0] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr[0], ref_stride, UINT_MAX);
sad_array[1] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr[1], ref_stride, UINT_MAX);
sad_array[2] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr[2], ref_stride, UINT_MAX);
sad_array[3] = vp8_sad16x16_c(src_ptr, src_stride, ref_ptr[3], ref_stride, UINT_MAX);
}
void vp8_sad16x8x4d_c(
const unsigned char *src_ptr,
int src_stride,
unsigned char *ref_ptr[],
int ref_stride,
unsigned int *sad_array
)
void vp8_sad16x8x4d_c(const unsigned char *src_ptr, int src_stride,
const unsigned char * const ref_ptr[], int ref_stride,
unsigned int *sad_array)
{
sad_array[0] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr[0], ref_stride, 0x7fffffff);
sad_array[1] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr[1], ref_stride, 0x7fffffff);
sad_array[2] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr[2], ref_stride, 0x7fffffff);
sad_array[3] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr[3], ref_stride, 0x7fffffff);
sad_array[0] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr[0], ref_stride, UINT_MAX);
sad_array[1] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr[1], ref_stride, UINT_MAX);
sad_array[2] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr[2], ref_stride, UINT_MAX);
sad_array[3] = vp8_sad16x8_c(src_ptr, src_stride, ref_ptr[3], ref_stride, UINT_MAX);
}
void vp8_sad8x8x4d_c(
const unsigned char *src_ptr,
int src_stride,
unsigned char *ref_ptr[],
int ref_stride,
unsigned int *sad_array
)
void vp8_sad8x8x4d_c(const unsigned char *src_ptr, int src_stride,
const unsigned char * const ref_ptr[], int ref_stride,
unsigned int *sad_array)
{
sad_array[0] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr[0], ref_stride, 0x7fffffff);
sad_array[1] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr[1], ref_stride, 0x7fffffff);
sad_array[2] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr[2], ref_stride, 0x7fffffff);
sad_array[3] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr[3], ref_stride, 0x7fffffff);
sad_array[0] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr[0], ref_stride, UINT_MAX);
sad_array[1] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr[1], ref_stride, UINT_MAX);
sad_array[2] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr[2], ref_stride, UINT_MAX);
sad_array[3] = vp8_sad8x8_c(src_ptr, src_stride, ref_ptr[3], ref_stride, UINT_MAX);
}
void vp8_sad8x16x4d_c(
const unsigned char *src_ptr,
int src_stride,
unsigned char *ref_ptr[],
int ref_stride,
unsigned int *sad_array
)
void vp8_sad8x16x4d_c(const unsigned char *src_ptr, int src_stride,
const unsigned char * const ref_ptr[], int ref_stride,
unsigned int *sad_array)
{
sad_array[0] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr[0], ref_stride, 0x7fffffff);
sad_array[1] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr[1], ref_stride, 0x7fffffff);
sad_array[2] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr[2], ref_stride, 0x7fffffff);
sad_array[3] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr[3], ref_stride, 0x7fffffff);
sad_array[0] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr[0], ref_stride, UINT_MAX);
sad_array[1] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr[1], ref_stride, UINT_MAX);
sad_array[2] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr[2], ref_stride, UINT_MAX);
sad_array[3] = vp8_sad8x16_c(src_ptr, src_stride, ref_ptr[3], ref_stride, UINT_MAX);
}
void vp8_sad4x4x4d_c(
const unsigned char *src_ptr,
int src_stride,
unsigned char *ref_ptr[],
int ref_stride,
unsigned int *sad_array
)
void vp8_sad4x4x4d_c(const unsigned char *src_ptr, int src_stride,
const unsigned char * const ref_ptr[], int ref_stride,
unsigned int *sad_array)
{
sad_array[0] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr[0], ref_stride, 0x7fffffff);
sad_array[1] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr[1], ref_stride, 0x7fffffff);
sad_array[2] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr[2], ref_stride, 0x7fffffff);
sad_array[3] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr[3], ref_stride, 0x7fffffff);
sad_array[0] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr[0], ref_stride, UINT_MAX);
sad_array[1] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr[1], ref_stride, UINT_MAX);
sad_array[2] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr[2], ref_stride, UINT_MAX);
sad_array[3] = vp8_sad4x4_c(src_ptr, src_stride, ref_ptr[3], ref_stride, UINT_MAX);
}
/* Copy 2 macroblocks to a buffer */
void vp8_copy32xn_c(
unsigned char *src_ptr,
int src_stride,
unsigned char *dst_ptr,
int dst_stride,
int height)
void vp8_copy32xn_c(unsigned char *src_ptr, int src_stride,
unsigned char *dst_ptr, int dst_stride,
int height)
{
int r;

Просмотреть файл

@ -30,3 +30,10 @@ void vp8_setup_intra_recon(YV12_BUFFER_CONFIG *ybf)
ybf->v_buffer[ybf->uv_stride *i - 1] = (unsigned char) 129;
}
void vp8_setup_intra_recon_top_line(YV12_BUFFER_CONFIG *ybf)
{
vpx_memset(ybf->y_buffer - 1 - ybf->y_stride, 127, ybf->y_width + 5);
vpx_memset(ybf->u_buffer - 1 - ybf->uv_stride, 127, ybf->uv_width + 5);
vpx_memset(ybf->v_buffer - 1 - ybf->uv_stride, 127, ybf->uv_width + 5);
}

Просмотреть файл

@ -11,3 +11,23 @@
#include "vpx_scale/yv12config.h"
extern void vp8_setup_intra_recon(YV12_BUFFER_CONFIG *ybf);
extern void vp8_setup_intra_recon_top_line(YV12_BUFFER_CONFIG *ybf);
static
void setup_intra_recon_left(unsigned char *y_buffer,
unsigned char *u_buffer,
unsigned char *v_buffer,
int y_stride,
int uv_stride)
{
int i;
for (i = 0; i < 16; i++)
y_buffer[y_stride *i] = (unsigned char) 129;
for (i = 0; i < 8; i++)
u_buffer[uv_stride *i] = (unsigned char) 129;
for (i = 0; i < 8; i++)
v_buffer[uv_stride *i] = (unsigned char) 129;
}

Просмотреть файл

@ -1,86 +0,0 @@
/*
* Copyright (c) 2010 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.
*/
#ifndef SUBPIXEL_H
#define SUBPIXEL_H
#define prototype_subpixel_predict(sym) \
void sym(unsigned char *src, int src_pitch, int xofst, int yofst, \
unsigned char *dst, int dst_pitch)
#if ARCH_X86 || ARCH_X86_64
#include "x86/subpixel_x86.h"
#endif
#if ARCH_ARM
#include "arm/subpixel_arm.h"
#endif
#ifndef vp8_subpix_sixtap16x16
#define vp8_subpix_sixtap16x16 vp8_sixtap_predict16x16_c
#endif
extern prototype_subpixel_predict(vp8_subpix_sixtap16x16);
#ifndef vp8_subpix_sixtap8x8
#define vp8_subpix_sixtap8x8 vp8_sixtap_predict8x8_c
#endif
extern prototype_subpixel_predict(vp8_subpix_sixtap8x8);
#ifndef vp8_subpix_sixtap8x4
#define vp8_subpix_sixtap8x4 vp8_sixtap_predict8x4_c
#endif
extern prototype_subpixel_predict(vp8_subpix_sixtap8x4);
#ifndef vp8_subpix_sixtap4x4
#define vp8_subpix_sixtap4x4 vp8_sixtap_predict_c
#endif
extern prototype_subpixel_predict(vp8_subpix_sixtap4x4);
#ifndef vp8_subpix_bilinear16x16
#define vp8_subpix_bilinear16x16 vp8_bilinear_predict16x16_c
#endif
extern prototype_subpixel_predict(vp8_subpix_bilinear16x16);
#ifndef vp8_subpix_bilinear8x8
#define vp8_subpix_bilinear8x8 vp8_bilinear_predict8x8_c
#endif
extern prototype_subpixel_predict(vp8_subpix_bilinear8x8);
#ifndef vp8_subpix_bilinear8x4
#define vp8_subpix_bilinear8x4 vp8_bilinear_predict8x4_c
#endif
extern prototype_subpixel_predict(vp8_subpix_bilinear8x4);
#ifndef vp8_subpix_bilinear4x4
#define vp8_subpix_bilinear4x4 vp8_bilinear_predict4x4_c
#endif
extern prototype_subpixel_predict(vp8_subpix_bilinear4x4);
typedef prototype_subpixel_predict((*vp8_subpix_fn_t));
typedef struct
{
vp8_subpix_fn_t sixtap16x16;
vp8_subpix_fn_t sixtap8x8;
vp8_subpix_fn_t sixtap8x4;
vp8_subpix_fn_t sixtap4x4;
vp8_subpix_fn_t bilinear16x16;
vp8_subpix_fn_t bilinear8x8;
vp8_subpix_fn_t bilinear8x4;
vp8_subpix_fn_t bilinear4x4;
} vp8_subpix_rtcd_vtable_t;
#if CONFIG_RUNTIME_CPU_DETECT
#define SUBPIX_INVOKE(ctx,fn) (ctx)->fn
#else
#define SUBPIX_INVOKE(ctx,fn) vp8_subpix_##fn
#endif
#endif

Просмотреть файл

@ -33,6 +33,29 @@
#define pthread_getspecific(ts_key) TlsGetValue(ts_key)
#define pthread_setspecific(ts_key, value) TlsSetValue(ts_key, (void *)value)
#define pthread_self() GetCurrentThreadId()
#elif defined(__OS2__)
/* OS/2 */
#define INCL_DOS
#include <os2.h>
#include <stdlib.h>
#define THREAD_FUNCTION void
#define THREAD_FUNCTION_RETURN void
#define THREAD_SPECIFIC_INDEX PULONG
#define pthread_t TID
#define pthread_attr_t ULONG
#define pthread_create(thhandle,attr,thfunc,tharg) \
((int)((*(thhandle)=_beginthread(thfunc,NULL,1024*1024,tharg))==-1))
#define pthread_join(thread, result) ((int)DosWaitThread(&(thread),0))
#define pthread_detach(thread) 0
#define thread_sleep(nms) DosSleep(nms)
#define pthread_cancel(thread) DosKillThread(thread)
#define ts_key_create(ts_key, destructor) \
DosAllocThreadLocalMemory(1, &(ts_key));
#define pthread_getspecific(ts_key) ((void *)(*(ts_key)))
#define pthread_setspecific(ts_key, value) (*(ts_key)=(ULONG)(value))
#define pthread_self() _gettid()
#else
#ifdef __APPLE__
#include <mach/mach_init.h>
@ -64,6 +87,76 @@
#define sem_destroy(sem) if(*sem)((int)(CloseHandle(*sem))==TRUE)
#define thread_sleep(nms) Sleep(nms)
#elif defined(__OS2__)
typedef struct
{
HEV event;
HMTX wait_mutex;
HMTX count_mutex;
int count;
} sem_t;
static inline int sem_init(sem_t *sem, int pshared, unsigned int value)
{
DosCreateEventSem(NULL, &sem->event, pshared ? DC_SEM_SHARED : 0,
value > 0 ? TRUE : FALSE);
DosCreateMutexSem(NULL, &sem->wait_mutex, 0, FALSE);
DosCreateMutexSem(NULL, &sem->count_mutex, 0, FALSE);
sem->count = value;
return 0;
}
static inline int sem_wait(sem_t * sem)
{
DosRequestMutexSem(sem->wait_mutex, -1);
DosWaitEventSem(sem->event, -1);
DosRequestMutexSem(sem->count_mutex, -1);
sem->count--;
if (sem->count == 0)
{
ULONG post_count;
DosResetEventSem(sem->event, &post_count);
}
DosReleaseMutexSem(sem->count_mutex);
DosReleaseMutexSem(sem->wait_mutex);
return 0;
}
static inline int sem_post(sem_t * sem)
{
DosRequestMutexSem(sem->count_mutex, -1);
if (sem->count < 32768)
{
sem->count++;
DosPostEventSem(sem->event);
}
DosReleaseMutexSem(sem->count_mutex);
return 0;
}
static inline int sem_destroy(sem_t * sem)
{
DosCloseEventSem(sem->event);
DosCloseMutexSem(sem->wait_mutex);
DosCloseMutexSem(sem->count_mutex);
return 0;
}
#define thread_sleep(nms) DosSleep(nms)
#else
#ifdef __APPLE__

Просмотреть файл

@ -12,394 +12,91 @@
#ifndef VARIANCE_H
#define VARIANCE_H
#define prototype_sad(sym)\
unsigned int (sym)\
(\
const unsigned char *src_ptr, \
int source_stride, \
const unsigned char *ref_ptr, \
int ref_stride, \
int max_sad\
)
#define prototype_sad_multi_same_address(sym)\
void (sym)\
(\
const unsigned char *src_ptr, \
int source_stride, \
const unsigned char *ref_ptr, \
int ref_stride, \
unsigned int *sad_array\
)
#define prototype_sad_multi_same_address_1(sym)\
void (sym)\
(\
const unsigned char *src_ptr, \
int source_stride, \
const unsigned char *ref_ptr, \
int ref_stride, \
unsigned short *sad_array\
)
#define prototype_sad_multi_dif_address(sym)\
void (sym)\
(\
const unsigned char *src_ptr, \
int source_stride, \
unsigned char *ref_ptr[4], \
int ref_stride, \
unsigned int *sad_array\
)
#define prototype_variance(sym) \
unsigned int (sym) \
(\
const unsigned char *src_ptr, \
int source_stride, \
const unsigned char *ref_ptr, \
int ref_stride, \
unsigned int *sse\
)
#define prototype_variance2(sym) \
unsigned int (sym) \
(\
const unsigned char *src_ptr, \
int source_stride, \
const unsigned char *ref_ptr, \
int ref_stride, \
unsigned int *sse,\
int *sum\
)
#define prototype_subpixvariance(sym) \
unsigned int (sym) \
( \
const unsigned char *src_ptr, \
int source_stride, \
int xoffset, \
int yoffset, \
const unsigned char *ref_ptr, \
int Refstride, \
unsigned int *sse \
)
#define prototype_ssimpf(sym) \
void (sym) \
( \
unsigned char *s, \
int sp, \
unsigned char *r, \
int rp, \
unsigned long *sum_s, \
unsigned long *sum_r, \
unsigned long *sum_sq_s, \
unsigned long *sum_sq_r, \
unsigned long *sum_sxr \
)
#define prototype_getmbss(sym) unsigned int (sym)(const short *)
#define prototype_get16x16prederror(sym)\
unsigned int (sym)\
(\
const unsigned char *src_ptr, \
int source_stride, \
const unsigned char *ref_ptr, \
int ref_stride \
)
#if ARCH_X86 || ARCH_X86_64
#include "x86/variance_x86.h"
#endif
#if ARCH_ARM
#include "arm/variance_arm.h"
#endif
#ifndef vp8_variance_sad4x4
#define vp8_variance_sad4x4 vp8_sad4x4_c
#endif
extern prototype_sad(vp8_variance_sad4x4);
#ifndef vp8_variance_sad8x8
#define vp8_variance_sad8x8 vp8_sad8x8_c
#endif
extern prototype_sad(vp8_variance_sad8x8);
#ifndef vp8_variance_sad8x16
#define vp8_variance_sad8x16 vp8_sad8x16_c
#endif
extern prototype_sad(vp8_variance_sad8x16);
#ifndef vp8_variance_sad16x8
#define vp8_variance_sad16x8 vp8_sad16x8_c
#endif
extern prototype_sad(vp8_variance_sad16x8);
#ifndef vp8_variance_sad16x16
#define vp8_variance_sad16x16 vp8_sad16x16_c
#endif
extern prototype_sad(vp8_variance_sad16x16);
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#ifndef vp8_variance_sad16x16x3
#define vp8_variance_sad16x16x3 vp8_sad16x16x3_c
#endif
extern prototype_sad_multi_same_address(vp8_variance_sad16x16x3);
#ifndef vp8_variance_sad16x8x3
#define vp8_variance_sad16x8x3 vp8_sad16x8x3_c
#endif
extern prototype_sad_multi_same_address(vp8_variance_sad16x8x3);
#ifndef vp8_variance_sad8x8x3
#define vp8_variance_sad8x8x3 vp8_sad8x8x3_c
#endif
extern prototype_sad_multi_same_address(vp8_variance_sad8x8x3);
#ifndef vp8_variance_sad8x16x3
#define vp8_variance_sad8x16x3 vp8_sad8x16x3_c
#endif
extern prototype_sad_multi_same_address(vp8_variance_sad8x16x3);
#ifndef vp8_variance_sad4x4x3
#define vp8_variance_sad4x4x3 vp8_sad4x4x3_c
#endif
extern prototype_sad_multi_same_address(vp8_variance_sad4x4x3);
#ifndef vp8_variance_sad16x16x8
#define vp8_variance_sad16x16x8 vp8_sad16x16x8_c
#endif
extern prototype_sad_multi_same_address_1(vp8_variance_sad16x16x8);
#ifndef vp8_variance_sad16x8x8
#define vp8_variance_sad16x8x8 vp8_sad16x8x8_c
#endif
extern prototype_sad_multi_same_address_1(vp8_variance_sad16x8x8);
#ifndef vp8_variance_sad8x8x8
#define vp8_variance_sad8x8x8 vp8_sad8x8x8_c
#endif
extern prototype_sad_multi_same_address_1(vp8_variance_sad8x8x8);
#ifndef vp8_variance_sad8x16x8
#define vp8_variance_sad8x16x8 vp8_sad8x16x8_c
#endif
extern prototype_sad_multi_same_address_1(vp8_variance_sad8x16x8);
#ifndef vp8_variance_sad4x4x8
#define vp8_variance_sad4x4x8 vp8_sad4x4x8_c
#endif
extern prototype_sad_multi_same_address_1(vp8_variance_sad4x4x8);
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#ifndef vp8_variance_sad16x16x4d
#define vp8_variance_sad16x16x4d vp8_sad16x16x4d_c
#endif
extern prototype_sad_multi_dif_address(vp8_variance_sad16x16x4d);
#ifndef vp8_variance_sad16x8x4d
#define vp8_variance_sad16x8x4d vp8_sad16x8x4d_c
#endif
extern prototype_sad_multi_dif_address(vp8_variance_sad16x8x4d);
#ifndef vp8_variance_sad8x8x4d
#define vp8_variance_sad8x8x4d vp8_sad8x8x4d_c
#endif
extern prototype_sad_multi_dif_address(vp8_variance_sad8x8x4d);
#ifndef vp8_variance_sad8x16x4d
#define vp8_variance_sad8x16x4d vp8_sad8x16x4d_c
#endif
extern prototype_sad_multi_dif_address(vp8_variance_sad8x16x4d);
#ifndef vp8_variance_sad4x4x4d
#define vp8_variance_sad4x4x4d vp8_sad4x4x4d_c
#endif
extern prototype_sad_multi_dif_address(vp8_variance_sad4x4x4d);
#if ARCH_X86 || ARCH_X86_64
#ifndef vp8_variance_copy32xn
#define vp8_variance_copy32xn vp8_copy32xn_c
#endif
extern prototype_sad(vp8_variance_copy32xn);
#endif
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#ifndef vp8_variance_var4x4
#define vp8_variance_var4x4 vp8_variance4x4_c
#endif
extern prototype_variance(vp8_variance_var4x4);
#ifndef vp8_variance_var8x8
#define vp8_variance_var8x8 vp8_variance8x8_c
#endif
extern prototype_variance(vp8_variance_var8x8);
#ifndef vp8_variance_var8x16
#define vp8_variance_var8x16 vp8_variance8x16_c
#endif
extern prototype_variance(vp8_variance_var8x16);
#ifndef vp8_variance_var16x8
#define vp8_variance_var16x8 vp8_variance16x8_c
#endif
extern prototype_variance(vp8_variance_var16x8);
#ifndef vp8_variance_var16x16
#define vp8_variance_var16x16 vp8_variance16x16_c
#endif
extern prototype_variance(vp8_variance_var16x16);
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#ifndef vp8_variance_subpixvar4x4
#define vp8_variance_subpixvar4x4 vp8_sub_pixel_variance4x4_c
#endif
extern prototype_subpixvariance(vp8_variance_subpixvar4x4);
#ifndef vp8_variance_subpixvar8x8
#define vp8_variance_subpixvar8x8 vp8_sub_pixel_variance8x8_c
#endif
extern prototype_subpixvariance(vp8_variance_subpixvar8x8);
#ifndef vp8_variance_subpixvar8x16
#define vp8_variance_subpixvar8x16 vp8_sub_pixel_variance8x16_c
#endif
extern prototype_subpixvariance(vp8_variance_subpixvar8x16);
#ifndef vp8_variance_subpixvar16x8
#define vp8_variance_subpixvar16x8 vp8_sub_pixel_variance16x8_c
#endif
extern prototype_subpixvariance(vp8_variance_subpixvar16x8);
#ifndef vp8_variance_subpixvar16x16
#define vp8_variance_subpixvar16x16 vp8_sub_pixel_variance16x16_c
#endif
extern prototype_subpixvariance(vp8_variance_subpixvar16x16);
#ifndef vp8_variance_halfpixvar16x16_h
#define vp8_variance_halfpixvar16x16_h vp8_variance_halfpixvar16x16_h_c
#endif
extern prototype_variance(vp8_variance_halfpixvar16x16_h);
#ifndef vp8_variance_halfpixvar16x16_v
#define vp8_variance_halfpixvar16x16_v vp8_variance_halfpixvar16x16_v_c
#endif
extern prototype_variance(vp8_variance_halfpixvar16x16_v);
#ifndef vp8_variance_halfpixvar16x16_hv
#define vp8_variance_halfpixvar16x16_hv vp8_variance_halfpixvar16x16_hv_c
#endif
extern prototype_variance(vp8_variance_halfpixvar16x16_hv);
#ifndef vp8_variance_subpixmse16x16
#define vp8_variance_subpixmse16x16 vp8_sub_pixel_mse16x16_c
#endif
extern prototype_subpixvariance(vp8_variance_subpixmse16x16);
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#ifndef vp8_variance_getmbss
#define vp8_variance_getmbss vp8_get_mb_ss_c
#endif
extern prototype_getmbss(vp8_variance_getmbss);
#ifndef vp8_variance_mse16x16
#define vp8_variance_mse16x16 vp8_mse16x16_c
#endif
extern prototype_variance(vp8_variance_mse16x16);
#ifndef vp8_variance_get4x4sse_cs
#define vp8_variance_get4x4sse_cs vp8_get4x4sse_cs_c
#endif
extern prototype_get16x16prederror(vp8_variance_get4x4sse_cs);
#ifndef vp8_ssimpf_8x8
#define vp8_ssimpf_8x8 vp8_ssim_parms_8x8_c
#endif
extern prototype_ssimpf(vp8_ssimpf_8x8);
#ifndef vp8_ssimpf_16x16
#define vp8_ssimpf_16x16 vp8_ssim_parms_16x16_c
#endif
extern prototype_ssimpf(vp8_ssimpf_16x16);
typedef prototype_sad(*vp8_sad_fn_t);
typedef prototype_sad_multi_same_address(*vp8_sad_multi_fn_t);
typedef prototype_sad_multi_same_address_1(*vp8_sad_multi1_fn_t);
typedef prototype_sad_multi_dif_address(*vp8_sad_multi_d_fn_t);
typedef prototype_variance(*vp8_variance_fn_t);
typedef prototype_variance2(*vp8_variance2_fn_t);
typedef prototype_subpixvariance(*vp8_subpixvariance_fn_t);
typedef prototype_getmbss(*vp8_getmbss_fn_t);
typedef prototype_ssimpf(*vp8_ssimpf_fn_t);
typedef prototype_get16x16prederror(*vp8_get16x16prederror_fn_t);
typedef struct
{
vp8_sad_fn_t sad4x4;
vp8_sad_fn_t sad8x8;
vp8_sad_fn_t sad8x16;
vp8_sad_fn_t sad16x8;
vp8_sad_fn_t sad16x16;
vp8_variance_fn_t var4x4;
vp8_variance_fn_t var8x8;
vp8_variance_fn_t var8x16;
vp8_variance_fn_t var16x8;
vp8_variance_fn_t var16x16;
vp8_subpixvariance_fn_t subpixvar4x4;
vp8_subpixvariance_fn_t subpixvar8x8;
vp8_subpixvariance_fn_t subpixvar8x16;
vp8_subpixvariance_fn_t subpixvar16x8;
vp8_subpixvariance_fn_t subpixvar16x16;
vp8_variance_fn_t halfpixvar16x16_h;
vp8_variance_fn_t halfpixvar16x16_v;
vp8_variance_fn_t halfpixvar16x16_hv;
vp8_subpixvariance_fn_t subpixmse16x16;
vp8_getmbss_fn_t getmbss;
vp8_variance_fn_t mse16x16;
vp8_get16x16prederror_fn_t get4x4sse_cs;
vp8_sad_multi_fn_t sad16x16x3;
vp8_sad_multi_fn_t sad16x8x3;
vp8_sad_multi_fn_t sad8x16x3;
vp8_sad_multi_fn_t sad8x8x3;
vp8_sad_multi_fn_t sad4x4x3;
vp8_sad_multi1_fn_t sad16x16x8;
vp8_sad_multi1_fn_t sad16x8x8;
vp8_sad_multi1_fn_t sad8x16x8;
vp8_sad_multi1_fn_t sad8x8x8;
vp8_sad_multi1_fn_t sad4x4x8;
vp8_sad_multi_d_fn_t sad16x16x4d;
vp8_sad_multi_d_fn_t sad16x8x4d;
vp8_sad_multi_d_fn_t sad8x16x4d;
vp8_sad_multi_d_fn_t sad8x8x4d;
vp8_sad_multi_d_fn_t sad4x4x4d;
#if ARCH_X86 || ARCH_X86_64
vp8_sad_fn_t copy32xn;
#endif
#if CONFIG_INTERNAL_STATS
vp8_ssimpf_fn_t ssimpf_8x8;
vp8_ssimpf_fn_t ssimpf_16x16;
#endif
} vp8_variance_rtcd_vtable_t;
typedef struct
#include "vpx_config.h"
typedef unsigned int(*vp8_sad_fn_t)(
const unsigned char *src_ptr,
int source_stride,
const unsigned char *ref_ptr,
int ref_stride,
unsigned int max_sad);
typedef void (*vp8_copy32xn_fn_t)(
const unsigned char *src_ptr,
int source_stride,
const unsigned char *ref_ptr,
int ref_stride,
int n);
typedef void (*vp8_sad_multi_fn_t)(
const unsigned char *src_ptr,
int source_stride,
const unsigned char *ref_ptr,
int ref_stride,
unsigned int *sad_array);
typedef void (*vp8_sad_multi1_fn_t)
(
const unsigned char *src_ptr,
int source_stride,
const unsigned char *ref_ptr,
int ref_stride,
unsigned short *sad_array
);
typedef void (*vp8_sad_multi_d_fn_t)
(
const unsigned char *src_ptr,
int source_stride,
const unsigned char * const ref_ptr[],
int ref_stride,
unsigned int *sad_array
);
typedef unsigned int (*vp8_variance_fn_t)
(
const unsigned char *src_ptr,
int source_stride,
const unsigned char *ref_ptr,
int ref_stride,
unsigned int *sse
);
typedef unsigned int (*vp8_subpixvariance_fn_t)
(
const unsigned char *src_ptr,
int source_stride,
int xoffset,
int yoffset,
const unsigned char *ref_ptr,
int Refstride,
unsigned int *sse
);
typedef void (*vp8_ssimpf_fn_t)
(
unsigned char *s,
int sp,
unsigned char *r,
int rp,
unsigned long *sum_s,
unsigned long *sum_r,
unsigned long *sum_sq_s,
unsigned long *sum_sq_r,
unsigned long *sum_sxr
);
typedef unsigned int (*vp8_getmbss_fn_t)(const short *);
typedef unsigned int (*vp8_get16x16prederror_fn_t)
(
const unsigned char *src_ptr,
int source_stride,
const unsigned char *ref_ptr,
int ref_stride
);
typedef struct variance_vtable
{
vp8_sad_fn_t sdf;
vp8_variance_fn_t vf;
@ -411,16 +108,8 @@ typedef struct
vp8_sad_multi1_fn_t sdx8f;
vp8_sad_multi_d_fn_t sdx4df;
#if ARCH_X86 || ARCH_X86_64
vp8_sad_fn_t copymem;
vp8_copy32xn_fn_t copymem;
#endif
} vp8_variance_fn_ptr_t;
#if CONFIG_RUNTIME_CPU_DETECT
#define VARIANCE_INVOKE(ctx,fn) (ctx)->fn
#define SSIMPF_INVOKE(ctx,fn) (ctx)->ssimpf_##fn
#else
#define VARIANCE_INVOKE(ctx,fn) vp8_variance_##fn
#define SSIMPF_INVOKE(ctx,fn) vp8_ssimpf_##fn
#endif
#endif

Просмотреть файл

@ -205,14 +205,14 @@ static void var_filter_block2d_bil_first_pass
{
for (j = 0; j < output_width; j++)
{
// Apply bilinear filter
/* Apply bilinear filter */
output_ptr[j] = (((int)src_ptr[0] * vp8_filter[0]) +
((int)src_ptr[pixel_step] * vp8_filter[1]) +
(VP8_FILTER_WEIGHT / 2)) >> VP8_FILTER_SHIFT;
src_ptr++;
}
// Next row...
/* Next row... */
src_ptr += src_pixels_per_line - output_width;
output_ptr += output_width;
}
@ -264,15 +264,15 @@ static void var_filter_block2d_bil_second_pass
{
for (j = 0; j < output_width; j++)
{
// Apply filter
Temp = ((int)src_ptr[0] * vp8_filter[0]) +
/* Apply filter */
Temp = ((int)src_ptr[0] * vp8_filter[0]) +
((int)src_ptr[pixel_step] * vp8_filter[1]) +
(VP8_FILTER_WEIGHT / 2);
output_ptr[j] = (unsigned int)(Temp >> VP8_FILTER_SHIFT);
src_ptr++;
}
// Next row...
/* Next row... */
src_ptr += src_pixels_per_line - output_width;
output_ptr += output_width;
}
@ -292,15 +292,15 @@ unsigned int vp8_sub_pixel_variance4x4_c
{
unsigned char temp2[20*16];
const short *HFilter, *VFilter;
unsigned short FData3[5*4]; // Temp data bufffer used in filtering
unsigned short FData3[5*4]; /* Temp data bufffer used in filtering */
HFilter = vp8_bilinear_filters[xoffset];
VFilter = vp8_bilinear_filters[yoffset];
// First filter 1d Horizontal
/* First filter 1d Horizontal */
var_filter_block2d_bil_first_pass(src_ptr, FData3, src_pixels_per_line, 1, 5, 4, HFilter);
// Now filter Verticaly
/* Now filter Verticaly */
var_filter_block2d_bil_second_pass(FData3, temp2, 4, 4, 4, 4, VFilter);
return vp8_variance4x4_c(temp2, 4, dst_ptr, dst_pixels_per_line, sse);
@ -318,7 +318,7 @@ unsigned int vp8_sub_pixel_variance8x8_c
unsigned int *sse
)
{
unsigned short FData3[9*8]; // Temp data bufffer used in filtering
unsigned short FData3[9*8]; /* Temp data bufffer used in filtering */
unsigned char temp2[20*16];
const short *HFilter, *VFilter;
@ -342,7 +342,7 @@ unsigned int vp8_sub_pixel_variance16x16_c
unsigned int *sse
)
{
unsigned short FData3[17*16]; // Temp data bufffer used in filtering
unsigned short FData3[17*16]; /* Temp data bufffer used in filtering */
unsigned char temp2[20*16];
const short *HFilter, *VFilter;
@ -418,7 +418,7 @@ unsigned int vp8_sub_pixel_variance16x8_c
unsigned int *sse
)
{
unsigned short FData3[16*9]; // Temp data bufffer used in filtering
unsigned short FData3[16*9]; /* Temp data bufffer used in filtering */
unsigned char temp2[20*16];
const short *HFilter, *VFilter;
@ -442,7 +442,7 @@ unsigned int vp8_sub_pixel_variance8x16_c
unsigned int *sse
)
{
unsigned short FData3[9*16]; // Temp data bufffer used in filtering
unsigned short FData3[9*16]; /* Temp data bufffer used in filtering */
unsigned char temp2[20*16];
const short *HFilter, *VFilter;
@ -456,29 +456,3 @@ unsigned int vp8_sub_pixel_variance8x16_c
return vp8_variance8x16_c(temp2, 8, dst_ptr, dst_pixels_per_line, sse);
}
unsigned int vp8_get4x4sse_cs_c
(
const unsigned char *src_ptr,
int source_stride,
const unsigned char *ref_ptr,
int recon_stride
)
{
int distortion = 0;
int r, c;
for (r = 0; r < 4; r++)
{
for (c = 0; c < 4; c++)
{
int diff = src_ptr[c] - ref_ptr[c];
distortion += diff * diff;
}
src_ptr += source_stride;
ref_ptr += recon_stride;
}
return distortion;
}

Просмотреть файл

@ -0,0 +1,242 @@
/*
* Copyright (c) 2010 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.
*/
/*Generated file, included by entropymode.c*/
const struct vp8_token_struct vp8_bmode_encodings[VP8_BINTRAMODES] =
{
{ 0, 1 },
{ 2, 2 },
{ 6, 3 },
{ 28, 5 },
{ 30, 5 },
{ 58, 6 },
{ 59, 6 },
{ 62, 6 },
{ 126, 7 },
{ 127, 7 }
};
const struct vp8_token_struct vp8_ymode_encodings[VP8_YMODES] =
{
{ 0, 1 },
{ 4, 3 },
{ 5, 3 },
{ 6, 3 },
{ 7, 3 }
};
const struct vp8_token_struct vp8_kf_ymode_encodings[VP8_YMODES] =
{
{ 4, 3 },
{ 5, 3 },
{ 6, 3 },
{ 7, 3 },
{ 0, 1 }
};
const struct vp8_token_struct vp8_uv_mode_encodings[VP8_UV_MODES] =
{
{ 0, 1 },
{ 2, 2 },
{ 6, 3 },
{ 7, 3 }
};
const struct vp8_token_struct vp8_mbsplit_encodings[VP8_NUMMBSPLITS] =
{
{ 6, 3 },
{ 7, 3 },
{ 2, 2 },
{ 0, 1 }
};
const struct vp8_token_struct vp8_mv_ref_encoding_array[VP8_MVREFS] =
{
{ 2, 2 },
{ 6, 3 },
{ 0, 1 },
{ 14, 4 },
{ 15, 4 }
};
const struct vp8_token_struct vp8_sub_mv_ref_encoding_array[VP8_SUBMVREFS] =
{
{ 0, 1 },
{ 2, 2 },
{ 6, 3 },
{ 7, 3 }
};
const struct vp8_token_struct vp8_small_mvencodings[8] =
{
{ 0, 3 },
{ 1, 3 },
{ 2, 3 },
{ 3, 3 },
{ 4, 3 },
{ 5, 3 },
{ 6, 3 },
{ 7, 3 }
};
const vp8_prob vp8_ymode_prob[VP8_YMODES-1] =
{
112, 86, 140, 37
};
const vp8_prob vp8_kf_ymode_prob[VP8_YMODES-1] =
{
145, 156, 163, 128
};
const vp8_prob vp8_uv_mode_prob[VP8_UV_MODES-1] =
{
162, 101, 204
};
const vp8_prob vp8_kf_uv_mode_prob[VP8_UV_MODES-1] =
{
142, 114, 183
};
const vp8_prob vp8_bmode_prob[VP8_BINTRAMODES-1] =
{
120, 90, 79, 133, 87, 85, 80, 111, 151
};
const vp8_prob vp8_kf_bmode_prob
[VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES-1] =
{
{
{ 231, 120, 48, 89, 115, 113, 120, 152, 112 },
{ 152, 179, 64, 126, 170, 118, 46, 70, 95 },
{ 175, 69, 143, 80, 85, 82, 72, 155, 103 },
{ 56, 58, 10, 171, 218, 189, 17, 13, 152 },
{ 144, 71, 10, 38, 171, 213, 144, 34, 26 },
{ 114, 26, 17, 163, 44, 195, 21, 10, 173 },
{ 121, 24, 80, 195, 26, 62, 44, 64, 85 },
{ 170, 46, 55, 19, 136, 160, 33, 206, 71 },
{ 63, 20, 8, 114, 114, 208, 12, 9, 226 },
{ 81, 40, 11, 96, 182, 84, 29, 16, 36 }
},
{
{ 134, 183, 89, 137, 98, 101, 106, 165, 148 },
{ 72, 187, 100, 130, 157, 111, 32, 75, 80 },
{ 66, 102, 167, 99, 74, 62, 40, 234, 128 },
{ 41, 53, 9, 178, 241, 141, 26, 8, 107 },
{ 104, 79, 12, 27, 217, 255, 87, 17, 7 },
{ 74, 43, 26, 146, 73, 166, 49, 23, 157 },
{ 65, 38, 105, 160, 51, 52, 31, 115, 128 },
{ 87, 68, 71, 44, 114, 51, 15, 186, 23 },
{ 47, 41, 14, 110, 182, 183, 21, 17, 194 },
{ 66, 45, 25, 102, 197, 189, 23, 18, 22 }
},
{
{ 88, 88, 147, 150, 42, 46, 45, 196, 205 },
{ 43, 97, 183, 117, 85, 38, 35, 179, 61 },
{ 39, 53, 200, 87, 26, 21, 43, 232, 171 },
{ 56, 34, 51, 104, 114, 102, 29, 93, 77 },
{ 107, 54, 32, 26, 51, 1, 81, 43, 31 },
{ 39, 28, 85, 171, 58, 165, 90, 98, 64 },
{ 34, 22, 116, 206, 23, 34, 43, 166, 73 },
{ 68, 25, 106, 22, 64, 171, 36, 225, 114 },
{ 34, 19, 21, 102, 132, 188, 16, 76, 124 },
{ 62, 18, 78, 95, 85, 57, 50, 48, 51 }
},
{
{ 193, 101, 35, 159, 215, 111, 89, 46, 111 },
{ 60, 148, 31, 172, 219, 228, 21, 18, 111 },
{ 112, 113, 77, 85, 179, 255, 38, 120, 114 },
{ 40, 42, 1, 196, 245, 209, 10, 25, 109 },
{ 100, 80, 8, 43, 154, 1, 51, 26, 71 },
{ 88, 43, 29, 140, 166, 213, 37, 43, 154 },
{ 61, 63, 30, 155, 67, 45, 68, 1, 209 },
{ 142, 78, 78, 16, 255, 128, 34, 197, 171 },
{ 41, 40, 5, 102, 211, 183, 4, 1, 221 },
{ 51, 50, 17, 168, 209, 192, 23, 25, 82 }
},
{
{ 125, 98, 42, 88, 104, 85, 117, 175, 82 },
{ 95, 84, 53, 89, 128, 100, 113, 101, 45 },
{ 75, 79, 123, 47, 51, 128, 81, 171, 1 },
{ 57, 17, 5, 71, 102, 57, 53, 41, 49 },
{ 115, 21, 2, 10, 102, 255, 166, 23, 6 },
{ 38, 33, 13, 121, 57, 73, 26, 1, 85 },
{ 41, 10, 67, 138, 77, 110, 90, 47, 114 },
{ 101, 29, 16, 10, 85, 128, 101, 196, 26 },
{ 57, 18, 10, 102, 102, 213, 34, 20, 43 },
{ 117, 20, 15, 36, 163, 128, 68, 1, 26 }
},
{
{ 138, 31, 36, 171, 27, 166, 38, 44, 229 },
{ 67, 87, 58, 169, 82, 115, 26, 59, 179 },
{ 63, 59, 90, 180, 59, 166, 93, 73, 154 },
{ 40, 40, 21, 116, 143, 209, 34, 39, 175 },
{ 57, 46, 22, 24, 128, 1, 54, 17, 37 },
{ 47, 15, 16, 183, 34, 223, 49, 45, 183 },
{ 46, 17, 33, 183, 6, 98, 15, 32, 183 },
{ 65, 32, 73, 115, 28, 128, 23, 128, 205 },
{ 40, 3, 9, 115, 51, 192, 18, 6, 223 },
{ 87, 37, 9, 115, 59, 77, 64, 21, 47 }
},
{
{ 104, 55, 44, 218, 9, 54, 53, 130, 226 },
{ 64, 90, 70, 205, 40, 41, 23, 26, 57 },
{ 54, 57, 112, 184, 5, 41, 38, 166, 213 },
{ 30, 34, 26, 133, 152, 116, 10, 32, 134 },
{ 75, 32, 12, 51, 192, 255, 160, 43, 51 },
{ 39, 19, 53, 221, 26, 114, 32, 73, 255 },
{ 31, 9, 65, 234, 2, 15, 1, 118, 73 },
{ 88, 31, 35, 67, 102, 85, 55, 186, 85 },
{ 56, 21, 23, 111, 59, 205, 45, 37, 192 },
{ 55, 38, 70, 124, 73, 102, 1, 34, 98 }
},
{
{ 102, 61, 71, 37, 34, 53, 31, 243, 192 },
{ 69, 60, 71, 38, 73, 119, 28, 222, 37 },
{ 68, 45, 128, 34, 1, 47, 11, 245, 171 },
{ 62, 17, 19, 70, 146, 85, 55, 62, 70 },
{ 75, 15, 9, 9, 64, 255, 184, 119, 16 },
{ 37, 43, 37, 154, 100, 163, 85, 160, 1 },
{ 63, 9, 92, 136, 28, 64, 32, 201, 85 },
{ 86, 6, 28, 5, 64, 255, 25, 248, 1 },
{ 56, 8, 17, 132, 137, 255, 55, 116, 128 },
{ 58, 15, 20, 82, 135, 57, 26, 121, 40 }
},
{
{ 164, 50, 31, 137, 154, 133, 25, 35, 218 },
{ 51, 103, 44, 131, 131, 123, 31, 6, 158 },
{ 86, 40, 64, 135, 148, 224, 45, 183, 128 },
{ 22, 26, 17, 131, 240, 154, 14, 1, 209 },
{ 83, 12, 13, 54, 192, 255, 68, 47, 28 },
{ 45, 16, 21, 91, 64, 222, 7, 1, 197 },
{ 56, 21, 39, 155, 60, 138, 23, 102, 213 },
{ 85, 26, 85, 85, 128, 128, 32, 146, 171 },
{ 18, 11, 7, 63, 144, 171, 4, 4, 246 },
{ 35, 27, 10, 146, 174, 171, 12, 26, 128 }
},
{
{ 190, 80, 35, 99, 180, 80, 126, 54, 45 },
{ 85, 126, 47, 87, 176, 51, 41, 20, 32 },
{ 101, 75, 128, 139, 118, 146, 116, 128, 85 },
{ 56, 41, 15, 176, 236, 85, 37, 9, 62 },
{ 146, 36, 19, 30, 171, 255, 97, 27, 20 },
{ 71, 30, 17, 119, 118, 255, 17, 18, 138 },
{ 101, 38, 60, 138, 55, 70, 43, 26, 142 },
{ 138, 45, 61, 62, 219, 1, 81, 188, 64 },
{ 32, 41, 20, 117, 151, 142, 20, 21, 163 },
{ 112, 19, 12, 61, 195, 128, 48, 4, 24 }
}
};

Просмотреть файл

@ -13,7 +13,7 @@
;void vp8_dequantize_b_impl_mmx(short *sq, short *dq, short *q)
global sym(vp8_dequantize_b_impl_mmx)
global sym(vp8_dequantize_b_impl_mmx) PRIVATE
sym(vp8_dequantize_b_impl_mmx):
push rbp
mov rbp, rsp
@ -55,7 +55,7 @@ sym(vp8_dequantize_b_impl_mmx):
;short *dq, 1
;unsigned char *dest, 2
;int stride) 3
global sym(vp8_dequant_idct_add_mmx)
global sym(vp8_dequant_idct_add_mmx) PRIVATE
sym(vp8_dequant_idct_add_mmx):
push rbp
mov rbp, rsp

Просмотреть файл

@ -1,58 +0,0 @@
/*
* Copyright (c) 2010 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.
*/
#ifndef DEQUANTIZE_X86_H
#define DEQUANTIZE_X86_H
/* Note:
*
* This platform is commonly built for runtime CPU detection. If you modify
* any of the function mappings present in this file, be sure to also update
* them in the function pointer initialization code
*/
#if HAVE_MMX
extern prototype_dequant_block(vp8_dequantize_b_mmx);
extern prototype_dequant_idct_add(vp8_dequant_idct_add_mmx);
extern prototype_dequant_idct_add_y_block(vp8_dequant_idct_add_y_block_mmx);
extern prototype_dequant_idct_add_uv_block(vp8_dequant_idct_add_uv_block_mmx);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_dequant_block
#define vp8_dequant_block vp8_dequantize_b_mmx
#undef vp8_dequant_idct_add
#define vp8_dequant_idct_add vp8_dequant_idct_add_mmx
#undef vp8_dequant_idct_add_y_block
#define vp8_dequant_idct_add_y_block vp8_dequant_idct_add_y_block_mmx
#undef vp8_dequant_idct_add_uv_block
#define vp8_dequant_idct_add_uv_block vp8_dequant_idct_add_uv_block_mmx
#endif
#endif
#if HAVE_SSE2
extern prototype_dequant_idct_add_y_block(vp8_dequant_idct_add_y_block_sse2);
extern prototype_dequant_idct_add_uv_block(vp8_dequant_idct_add_uv_block_sse2);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_dequant_idct_add_y_block
#define vp8_dequant_idct_add_y_block vp8_dequant_idct_add_y_block_sse2
#undef vp8_dequant_idct_add_uv_block
#define vp8_dequant_idct_add_uv_block vp8_dequant_idct_add_uv_block_sse2
#endif
#endif
#endif

Просмотреть файл

@ -9,8 +9,8 @@
*/
#include "vpx_config.h"
#include "vp8/common/idct.h"
#include "vp8/common/dequantize.h"
#include "vpx_rtcd.h"
#include "vp8/common/blockd.h"
extern void vp8_dequantize_b_impl_mmx(short *sq, short *dq, short *q);

Просмотреть файл

@ -9,8 +9,7 @@
*/
#include "vpx_config.h"
#include "vp8/common/idct.h"
#include "vp8/common/dequantize.h"
#include "vpx_rtcd.h"
void vp8_idct_dequant_0_2x_sse2
(short *q, short *dq ,

Просмотреть файл

@ -1,56 +0,0 @@
/*
* Copyright (c) 2010 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.
*/
#ifndef IDCT_X86_H
#define IDCT_X86_H
/* Note:
*
* This platform is commonly built for runtime CPU detection. If you modify
* any of the function mappings present in this file, be sure to also update
* them in the function pointer initialization code
*/
#if HAVE_MMX
extern prototype_idct(vp8_short_idct4x4llm_mmx);
extern prototype_idct_scalar_add(vp8_dc_only_idct_add_mmx);
extern prototype_second_order(vp8_short_inv_walsh4x4_mmx);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_idct_idct16
#define vp8_idct_idct16 vp8_short_idct4x4llm_mmx
#undef vp8_idct_idct1_scalar_add
#define vp8_idct_idct1_scalar_add vp8_dc_only_idct_add_mmx
#undef vp8_idct_iwalsh16
#define vp8_idct_iwalsh16 vp8_short_inv_walsh4x4_mmx
#endif
#endif
#if HAVE_SSE2
extern prototype_second_order(vp8_short_inv_walsh4x4_sse2);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_idct_iwalsh16
#define vp8_idct_iwalsh16 vp8_short_inv_walsh4x4_sse2
#endif
#endif
#endif

Просмотреть файл

@ -34,7 +34,7 @@
;void vp8_short_idct4x4llm_mmx(short *input, unsigned char *pred,
;int pitch, unsigned char *dest,int stride)
global sym(vp8_short_idct4x4llm_mmx)
global sym(vp8_short_idct4x4llm_mmx) PRIVATE
sym(vp8_short_idct4x4llm_mmx):
push rbp
mov rbp, rsp
@ -224,7 +224,7 @@ sym(vp8_short_idct4x4llm_mmx):
;int pred_stride,
;unsigned char *dst_ptr,
;int stride)
global sym(vp8_dc_only_idct_add_mmx)
global sym(vp8_dc_only_idct_add_mmx) PRIVATE
sym(vp8_dc_only_idct_add_mmx):
push rbp
mov rbp, rsp

Просмотреть файл

@ -19,7 +19,7 @@
; int dst_stride - 3
; )
global sym(vp8_idct_dequant_0_2x_sse2)
global sym(vp8_idct_dequant_0_2x_sse2) PRIVATE
sym(vp8_idct_dequant_0_2x_sse2):
push rbp
mov rbp, rsp
@ -101,7 +101,7 @@ sym(vp8_idct_dequant_0_2x_sse2):
; unsigned char *dst - 2
; int dst_stride - 3
; )
global sym(vp8_idct_dequant_full_2x_sse2)
global sym(vp8_idct_dequant_full_2x_sse2) PRIVATE
sym(vp8_idct_dequant_full_2x_sse2):
push rbp
mov rbp, rsp
@ -358,7 +358,7 @@ sym(vp8_idct_dequant_full_2x_sse2):
; int dst_stride - 3
; short *dc - 4
; )
global sym(vp8_idct_dequant_dc_0_2x_sse2)
global sym(vp8_idct_dequant_dc_0_2x_sse2) PRIVATE
sym(vp8_idct_dequant_dc_0_2x_sse2):
push rbp
mov rbp, rsp
@ -434,7 +434,7 @@ sym(vp8_idct_dequant_dc_0_2x_sse2):
; int dst_stride - 3
; short *dc - 4
; )
global sym(vp8_idct_dequant_dc_full_2x_sse2)
global sym(vp8_idct_dequant_dc_full_2x_sse2) PRIVATE
sym(vp8_idct_dequant_dc_full_2x_sse2):
push rbp
mov rbp, rsp

Просмотреть файл

@ -12,7 +12,7 @@
%include "vpx_ports/x86_abi_support.asm"
;void vp8_short_inv_walsh4x4_mmx(short *input, short *output)
global sym(vp8_short_inv_walsh4x4_mmx)
global sym(vp8_short_inv_walsh4x4_mmx) PRIVATE
sym(vp8_short_inv_walsh4x4_mmx):
push rbp
mov rbp, rsp

Просмотреть файл

@ -12,7 +12,7 @@
%include "vpx_ports/x86_abi_support.asm"
;void vp8_short_inv_walsh4x4_sse2(short *input, short *output)
global sym(vp8_short_inv_walsh4x4_sse2)
global sym(vp8_short_inv_walsh4x4_sse2) PRIVATE
sym(vp8_short_inv_walsh4x4_sse2):
push rbp
mov rbp, rsp

Просмотреть файл

@ -133,7 +133,7 @@
; const char *limit,
; const char *thresh
;)
global sym(vp8_loop_filter_bh_y_sse2)
global sym(vp8_loop_filter_bh_y_sse2) PRIVATE
sym(vp8_loop_filter_bh_y_sse2):
%ifidn __OUTPUT_FORMAT__,x64
@ -150,6 +150,7 @@ sym(vp8_loop_filter_bh_y_sse2):
push rbp
mov rbp, rsp
SAVE_XMM 11
push r12
push r13
mov thresh, arg(4)
@ -258,6 +259,7 @@ LF_FILTER xmm0, xmm1, xmm3, xmm8, xmm4, xmm2
%ifidn __OUTPUT_FORMAT__,x64
pop r13
pop r12
RESTORE_XMM
pop rbp
%endif
@ -273,7 +275,7 @@ LF_FILTER xmm0, xmm1, xmm3, xmm8, xmm4, xmm2
; const char *thresh
;)
global sym(vp8_loop_filter_bv_y_sse2)
global sym(vp8_loop_filter_bv_y_sse2) PRIVATE
sym(vp8_loop_filter_bv_y_sse2):
%ifidn __OUTPUT_FORMAT__,x64

Просмотреть файл

@ -21,7 +21,7 @@
; const char *thresh,
; int count
;)
global sym(vp8_loop_filter_horizontal_edge_mmx)
global sym(vp8_loop_filter_horizontal_edge_mmx) PRIVATE
sym(vp8_loop_filter_horizontal_edge_mmx):
push rbp
mov rbp, rsp
@ -233,7 +233,7 @@ sym(vp8_loop_filter_horizontal_edge_mmx):
; const char *thresh,
; int count
;)
global sym(vp8_loop_filter_vertical_edge_mmx)
global sym(vp8_loop_filter_vertical_edge_mmx) PRIVATE
sym(vp8_loop_filter_vertical_edge_mmx):
push rbp
mov rbp, rsp
@ -603,7 +603,7 @@ sym(vp8_loop_filter_vertical_edge_mmx):
; const char *thresh,
; int count
;)
global sym(vp8_mbloop_filter_horizontal_edge_mmx)
global sym(vp8_mbloop_filter_horizontal_edge_mmx) PRIVATE
sym(vp8_mbloop_filter_horizontal_edge_mmx):
push rbp
mov rbp, rsp
@ -920,7 +920,7 @@ sym(vp8_mbloop_filter_horizontal_edge_mmx):
; const char *thresh,
; int count
;)
global sym(vp8_mbloop_filter_vertical_edge_mmx)
global sym(vp8_mbloop_filter_vertical_edge_mmx) PRIVATE
sym(vp8_mbloop_filter_vertical_edge_mmx):
push rbp
mov rbp, rsp
@ -1384,7 +1384,7 @@ sym(vp8_mbloop_filter_vertical_edge_mmx):
; int src_pixel_step,
; const char *blimit
;)
global sym(vp8_loop_filter_simple_horizontal_edge_mmx)
global sym(vp8_loop_filter_simple_horizontal_edge_mmx) PRIVATE
sym(vp8_loop_filter_simple_horizontal_edge_mmx):
push rbp
mov rbp, rsp
@ -1500,7 +1500,7 @@ sym(vp8_loop_filter_simple_horizontal_edge_mmx):
; int src_pixel_step,
; const char *blimit
;)
global sym(vp8_loop_filter_simple_vertical_edge_mmx)
global sym(vp8_loop_filter_simple_vertical_edge_mmx) PRIVATE
sym(vp8_loop_filter_simple_vertical_edge_mmx):
push rbp
mov rbp, rsp

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -12,20 +12,33 @@
#include "vpx_config.h"
#include "vp8/common/loopfilter.h"
#define prototype_loopfilter(sym) \
void sym(unsigned char *src, int pitch, const unsigned char *blimit,\
const unsigned char *limit, const unsigned char *thresh, int count)
#define prototype_loopfilter_nc(sym) \
void sym(unsigned char *src, int pitch, const unsigned char *blimit,\
const unsigned char *limit, const unsigned char *thresh)
#define prototype_simple_loopfilter(sym) \
void sym(unsigned char *y, int ystride, const unsigned char *blimit)
prototype_loopfilter(vp8_mbloop_filter_vertical_edge_mmx);
prototype_loopfilter(vp8_mbloop_filter_horizontal_edge_mmx);
prototype_loopfilter(vp8_loop_filter_vertical_edge_mmx);
prototype_loopfilter(vp8_loop_filter_horizontal_edge_mmx);
prototype_simple_loopfilter(vp8_loop_filter_simple_horizontal_edge_mmx);
prototype_simple_loopfilter(vp8_loop_filter_simple_vertical_edge_mmx);
#if HAVE_SSE2 && ARCH_X86_64
prototype_loopfilter(vp8_loop_filter_bv_y_sse2);
prototype_loopfilter(vp8_loop_filter_bh_y_sse2);
#else
prototype_loopfilter(vp8_loop_filter_vertical_edge_sse2);
prototype_loopfilter(vp8_loop_filter_horizontal_edge_sse2);
prototype_loopfilter_nc(vp8_loop_filter_vertical_edge_sse2);
prototype_loopfilter_nc(vp8_loop_filter_horizontal_edge_sse2);
#endif
prototype_loopfilter(vp8_mbloop_filter_vertical_edge_sse2);
prototype_loopfilter(vp8_mbloop_filter_horizontal_edge_sse2);
prototype_loopfilter_nc(vp8_mbloop_filter_vertical_edge_sse2);
prototype_loopfilter_nc(vp8_mbloop_filter_horizontal_edge_sse2);
extern loop_filter_uvfunction vp8_loop_filter_horizontal_edge_uv_sse2;
extern loop_filter_uvfunction vp8_loop_filter_vertical_edge_uv_sse2;
@ -115,7 +128,7 @@ void vp8_loop_filter_bvs_mmx(unsigned char *y_ptr, int y_stride, const unsigned
void vp8_loop_filter_mbh_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi)
{
vp8_mbloop_filter_horizontal_edge_sse2(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2);
vp8_mbloop_filter_horizontal_edge_sse2(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr);
if (u_ptr)
vp8_mbloop_filter_horizontal_edge_uv_sse2(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, v_ptr);
@ -126,7 +139,7 @@ void vp8_loop_filter_mbh_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsign
void vp8_loop_filter_mbv_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi)
{
vp8_mbloop_filter_vertical_edge_sse2(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2);
vp8_mbloop_filter_vertical_edge_sse2(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr);
if (u_ptr)
vp8_mbloop_filter_vertical_edge_uv_sse2(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, v_ptr);
@ -140,9 +153,9 @@ void vp8_loop_filter_bh_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigne
#if ARCH_X86_64
vp8_loop_filter_bh_y_sse2(y_ptr, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
#else
vp8_loop_filter_horizontal_edge_sse2(y_ptr + 4 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
vp8_loop_filter_horizontal_edge_sse2(y_ptr + 8 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
vp8_loop_filter_horizontal_edge_sse2(y_ptr + 12 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
vp8_loop_filter_horizontal_edge_sse2(y_ptr + 4 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr);
vp8_loop_filter_horizontal_edge_sse2(y_ptr + 8 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr);
vp8_loop_filter_horizontal_edge_sse2(y_ptr + 12 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr);
#endif
if (u_ptr)
@ -165,9 +178,9 @@ void vp8_loop_filter_bv_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigne
#if ARCH_X86_64
vp8_loop_filter_bv_y_sse2(y_ptr, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
#else
vp8_loop_filter_vertical_edge_sse2(y_ptr + 4, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
vp8_loop_filter_vertical_edge_sse2(y_ptr + 8, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
vp8_loop_filter_vertical_edge_sse2(y_ptr + 12, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
vp8_loop_filter_vertical_edge_sse2(y_ptr + 4, y_stride, lfi->blim, lfi->lim, lfi->hev_thr);
vp8_loop_filter_vertical_edge_sse2(y_ptr + 8, y_stride, lfi->blim, lfi->lim, lfi->hev_thr);
vp8_loop_filter_vertical_edge_sse2(y_ptr + 12, y_stride, lfi->blim, lfi->lim, lfi->hev_thr);
#endif
if (u_ptr)

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше