diff options
Diffstat (limited to 'vp10/common')
-rw-r--r-- | vp10/common/postproc.c | 29 | ||||
-rw-r--r-- | vp10/common/vp10_rtcd_defs.pl | 7 | ||||
-rw-r--r-- | vp10/common/x86/postproc_sse2.asm | 62 |
3 files changed, 2 insertions, 96 deletions
diff --git a/vp10/common/postproc.c b/vp10/common/postproc.c index a6ea9c0ef..e8a9f8131 100644 --- a/vp10/common/postproc.c +++ b/vp10/common/postproc.c @@ -13,6 +13,7 @@ #include <stdio.h> #include "./vpx_config.h" +#include "./vpx_dsp_rtcd.h" #include "./vpx_scale_rtcd.h" #include "./vp10_rtcd.h" @@ -587,32 +588,6 @@ static void fillrd(struct postproc_state *state, int q, int a) { state->last_noise = a; } -void vp10_plane_add_noise_c(uint8_t *start, char *noise, - char blackclamp[16], - char whiteclamp[16], - char bothclamp[16], - unsigned int width, unsigned int height, int pitch) { - unsigned int i, j; - - // TODO(jbb): why does simd code use both but c doesn't, normalize and - // fix.. - (void) bothclamp; - for (i = 0; i < height; i++) { - uint8_t *pos = start + i * pitch; - char *ref = (char *)(noise + (rand() & 0xff)); // NOLINT - - for (j = 0; j < width; j++) { - if (pos[j] < blackclamp[0]) - pos[j] = blackclamp[0]; - - if (pos[j] > 255 + whiteclamp[0]) - pos[j] = 255 + whiteclamp[0]; - - pos[j] += ref[j]; - } - } -} - static void swap_mi_and_prev_mi(VP10_COMMON *cm) { // Current mip will be the prev_mip for the next frame. MODE_INFO *temp = cm->postproc_state.prev_mip; @@ -727,7 +702,7 @@ int vp10_post_proc_frame(struct VP10Common *cm, fillrd(ppstate, 63 - q, noise_level); } - vp10_plane_add_noise(ppbuf->y_buffer, ppstate->noise, ppstate->blackclamp, + vpx_plane_add_noise(ppbuf->y_buffer, ppstate->noise, ppstate->blackclamp, ppstate->whiteclamp, ppstate->bothclamp, ppbuf->y_width, ppbuf->y_height, ppbuf->y_stride); } diff --git a/vp10/common/vp10_rtcd_defs.pl b/vp10/common/vp10_rtcd_defs.pl index 9860baedf..f2414f811 100644 --- a/vp10/common/vp10_rtcd_defs.pl +++ b/vp10/common/vp10_rtcd_defs.pl @@ -70,10 +70,6 @@ add_proto qw/void vp10_post_proc_down_and_across/, "const uint8_t *src_ptr, uint specialize qw/vp10_post_proc_down_and_across sse2/; $vp10_post_proc_down_and_across_sse2=vp10_post_proc_down_and_across_xmm; -add_proto qw/void vp10_plane_add_noise/, "uint8_t *Start, char *noise, char blackclamp[16], char whiteclamp[16], char bothclamp[16], unsigned int Width, unsigned int Height, int Pitch"; -specialize qw/vp10_plane_add_noise sse2/; -$vp10_plane_add_noise_sse2=vp10_plane_add_noise_wmt; - add_proto qw/void vp10_filter_by_weight16x16/, "const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, int src_weight"; specialize qw/vp10_filter_by_weight16x16 sse2 msa/; @@ -326,9 +322,6 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") { add_proto qw/void vp10_highbd_post_proc_down_and_across/, "const uint16_t *src_ptr, uint16_t *dst_ptr, int src_pixels_per_line, int dst_pixels_per_line, int rows, int cols, int flimit"; specialize qw/vp10_highbd_post_proc_down_and_across/; - - add_proto qw/void vp10_highbd_plane_add_noise/, "uint8_t *Start, char *noise, char blackclamp[16], char whiteclamp[16], char bothclamp[16], unsigned int Width, unsigned int Height, int Pitch"; - specialize qw/vp10_highbd_plane_add_noise/; } # diff --git a/vp10/common/x86/postproc_sse2.asm b/vp10/common/x86/postproc_sse2.asm index d5f8e927b..d477a65c2 100644 --- a/vp10/common/x86/postproc_sse2.asm +++ b/vp10/common/x86/postproc_sse2.asm @@ -624,68 +624,6 @@ sym(vp10_mbpost_proc_across_ip_xmm): %undef flimit4 -;void vp10_plane_add_noise_wmt (unsigned char *start, unsigned char *noise, -; unsigned char blackclamp[16], -; unsigned char whiteclamp[16], -; unsigned char bothclamp[16], -; unsigned int width, unsigned int height, int pitch) -global sym(vp10_plane_add_noise_wmt) PRIVATE -sym(vp10_plane_add_noise_wmt): - push rbp - mov rbp, rsp - SHADOW_ARGS_TO_STACK 8 - GET_GOT rbx - push rsi - push rdi - ; end prolog - -.addnoise_loop: - call sym(LIBVPX_RAND) WRT_PLT - mov rcx, arg(1) ;noise - and rax, 0xff - add rcx, rax - - ; we rely on the fact that the clamping vectors are stored contiguously - ; in black/white/both order. Note that we have to reload this here because - ; rdx could be trashed by rand() - mov rdx, arg(2) ; blackclamp - - - mov rdi, rcx - movsxd rcx, dword arg(5) ;[Width] - mov rsi, arg(0) ;Pos - xor rax,rax - -.addnoise_nextset: - movdqu xmm1,[rsi+rax] ; get the source - - psubusb xmm1, [rdx] ;blackclamp ; clamp both sides so we don't outrange adding noise - paddusb xmm1, [rdx+32] ;bothclamp - psubusb xmm1, [rdx+16] ;whiteclamp - - movdqu xmm2,[rdi+rax] ; get the noise for this line - paddb xmm1,xmm2 ; add it in - movdqu [rsi+rax],xmm1 ; store the result - - add rax,16 ; move to the next line - - cmp rax, rcx - jl .addnoise_nextset - - movsxd rax, dword arg(7) ; Pitch - add arg(0), rax ; Start += Pitch - sub dword arg(6), 1 ; Height -= 1 - jg .addnoise_loop - - ; begin epilog - pop rdi - pop rsi - RESTORE_GOT - UNSHADOW_ARGS - pop rbp - ret - - SECTION_RODATA align 16 rd42: |