Merge "postproc : fix function parameters for noise functions."
This commit is contained in:
commit
302e425453
@ -18,11 +18,12 @@
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
static const int kNoiseSize = 3072;
|
||||||
|
|
||||||
// TODO(jimbankoski): make width and height integers not unsigned.
|
// TODO(jimbankoski): make width and height integers not unsigned.
|
||||||
typedef void (*AddNoiseFunc)(unsigned char *start, char *noise,
|
typedef void (*AddNoiseFunc)(uint8_t *start, const int8_t *noise,
|
||||||
char blackclamp[16], char whiteclamp[16],
|
int blackclamp, int whiteclamp,
|
||||||
char bothclamp[16], unsigned int width,
|
int width, int height, int pitch);
|
||||||
unsigned int height, int pitch);
|
|
||||||
|
|
||||||
class AddNoiseTest
|
class AddNoiseTest
|
||||||
: public ::testing::TestWithParam<AddNoiseFunc> {
|
: public ::testing::TestWithParam<AddNoiseFunc> {
|
||||||
@ -42,26 +43,18 @@ double stddev6(char a, char b, char c, char d, char e, char f) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(AddNoiseTest, CheckNoiseAdded) {
|
TEST_P(AddNoiseTest, CheckNoiseAdded) {
|
||||||
DECLARE_ALIGNED(16, char, blackclamp[16]);
|
|
||||||
DECLARE_ALIGNED(16, char, whiteclamp[16]);
|
|
||||||
DECLARE_ALIGNED(16, char, bothclamp[16]);
|
|
||||||
const int width = 64;
|
const int width = 64;
|
||||||
const int height = 64;
|
const int height = 64;
|
||||||
const int image_size = width * height;
|
const int image_size = width * height;
|
||||||
char noise[3072];
|
int8_t noise[kNoiseSize];
|
||||||
const int clamp = vpx_setup_noise(4.4, sizeof(noise), noise);
|
const int clamp = vpx_setup_noise(4.4, noise, kNoiseSize);
|
||||||
|
uint8_t *const s = reinterpret_cast<uint8_t *>(vpx_calloc(image_size,
|
||||||
|
sizeof(*s)));
|
||||||
|
ASSERT_TRUE(s != NULL);
|
||||||
|
memset(s, 99, image_size * sizeof(*s));
|
||||||
|
|
||||||
for (int i = 0; i < 16; i++) {
|
ASM_REGISTER_STATE_CHECK(GetParam()(s, noise, clamp, clamp,
|
||||||
blackclamp[i] = clamp;
|
width, height, width));
|
||||||
whiteclamp[i] = clamp;
|
|
||||||
bothclamp[i] = 2 * clamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t *const s = reinterpret_cast<uint8_t *>(vpx_calloc(image_size, 1));
|
|
||||||
memset(s, 99, image_size);
|
|
||||||
|
|
||||||
ASM_REGISTER_STATE_CHECK(GetParam()(s, noise, blackclamp, whiteclamp,
|
|
||||||
bothclamp, width, height, width));
|
|
||||||
|
|
||||||
// Check to make sure we don't end up having either the same or no added
|
// Check to make sure we don't end up having either the same or no added
|
||||||
// noise either vertically or horizontally.
|
// noise either vertically or horizontally.
|
||||||
@ -79,8 +72,8 @@ TEST_P(AddNoiseTest, CheckNoiseAdded) {
|
|||||||
// Initialize pixels in the image to 255 and check for roll over.
|
// Initialize pixels in the image to 255 and check for roll over.
|
||||||
memset(s, 255, image_size);
|
memset(s, 255, image_size);
|
||||||
|
|
||||||
ASM_REGISTER_STATE_CHECK(GetParam()(s, noise, blackclamp, whiteclamp,
|
ASM_REGISTER_STATE_CHECK(GetParam()(s, noise, clamp, clamp,
|
||||||
bothclamp, width, height, width));
|
width, height, width));
|
||||||
|
|
||||||
// Check to make sure don't roll over.
|
// Check to make sure don't roll over.
|
||||||
for (int i = 0; i < image_size; ++i) {
|
for (int i = 0; i < image_size; ++i) {
|
||||||
@ -90,8 +83,8 @@ TEST_P(AddNoiseTest, CheckNoiseAdded) {
|
|||||||
// Initialize pixels in the image to 0 and check for roll under.
|
// Initialize pixels in the image to 0 and check for roll under.
|
||||||
memset(s, 0, image_size);
|
memset(s, 0, image_size);
|
||||||
|
|
||||||
ASM_REGISTER_STATE_CHECK(GetParam()(s, noise, blackclamp, whiteclamp,
|
ASM_REGISTER_STATE_CHECK(GetParam()(s, noise, clamp, clamp,
|
||||||
bothclamp, width, height, width));
|
width, height, width));
|
||||||
|
|
||||||
// Check to make sure don't roll under.
|
// Check to make sure don't roll under.
|
||||||
for (int i = 0; i < image_size; ++i) {
|
for (int i = 0; i < image_size; ++i) {
|
||||||
@ -102,35 +95,26 @@ TEST_P(AddNoiseTest, CheckNoiseAdded) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(AddNoiseTest, CheckCvsAssembly) {
|
TEST_P(AddNoiseTest, CheckCvsAssembly) {
|
||||||
DECLARE_ALIGNED(16, char, blackclamp[16]);
|
|
||||||
DECLARE_ALIGNED(16, char, whiteclamp[16]);
|
|
||||||
DECLARE_ALIGNED(16, char, bothclamp[16]);
|
|
||||||
const int width = 64;
|
const int width = 64;
|
||||||
const int height = 64;
|
const int height = 64;
|
||||||
const int image_size = width * height;
|
const int image_size = width * height;
|
||||||
char noise[3072];
|
int8_t noise[kNoiseSize];
|
||||||
|
const int clamp = vpx_setup_noise(4.4, noise, kNoiseSize);
|
||||||
const int clamp = vpx_setup_noise(4.4, sizeof(noise), noise);
|
|
||||||
|
|
||||||
for (int i = 0; i < 16; i++) {
|
|
||||||
blackclamp[i] = clamp;
|
|
||||||
whiteclamp[i] = clamp;
|
|
||||||
bothclamp[i] = 2 * clamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t *const s = reinterpret_cast<uint8_t *>(vpx_calloc(image_size, 1));
|
uint8_t *const s = reinterpret_cast<uint8_t *>(vpx_calloc(image_size, 1));
|
||||||
uint8_t *const d = reinterpret_cast<uint8_t *>(vpx_calloc(image_size, 1));
|
uint8_t *const d = reinterpret_cast<uint8_t *>(vpx_calloc(image_size, 1));
|
||||||
|
ASSERT_TRUE(s != NULL);
|
||||||
|
ASSERT_TRUE(d != NULL);
|
||||||
|
|
||||||
memset(s, 99, image_size);
|
memset(s, 99, image_size);
|
||||||
memset(d, 99, image_size);
|
memset(d, 99, image_size);
|
||||||
|
|
||||||
srand(0);
|
srand(0);
|
||||||
ASM_REGISTER_STATE_CHECK(GetParam()(s, noise, blackclamp, whiteclamp,
|
ASM_REGISTER_STATE_CHECK(
|
||||||
bothclamp, width, height, width));
|
GetParam()(s, noise, clamp, clamp, width, height, width));
|
||||||
srand(0);
|
srand(0);
|
||||||
ASM_REGISTER_STATE_CHECK(vpx_plane_add_noise_c(d, noise, blackclamp,
|
ASM_REGISTER_STATE_CHECK(
|
||||||
whiteclamp, bothclamp,
|
vpx_plane_add_noise_c(d, noise, clamp, clamp, width, height, width));
|
||||||
width, height, width));
|
|
||||||
|
|
||||||
for (int i = 0; i < image_size; ++i) {
|
for (int i = 0; i < image_size; ++i) {
|
||||||
EXPECT_EQ(static_cast<int>(s[i]), static_cast<int>(d[i])) << "i = " << i;
|
EXPECT_EQ(static_cast<int>(s[i]), static_cast<int>(d[i])) << "i = " << i;
|
||||||
|
@ -491,19 +491,12 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
|
|||||||
|| oci->postproc_state.last_noise != noise_level)
|
|| oci->postproc_state.last_noise != noise_level)
|
||||||
{
|
{
|
||||||
double sigma;
|
double sigma;
|
||||||
int clamp, i;
|
|
||||||
struct postproc_state *ppstate = &oci->postproc_state;
|
struct postproc_state *ppstate = &oci->postproc_state;
|
||||||
vp8_clear_system_state();
|
vp8_clear_system_state();
|
||||||
sigma = noise_level + .5 + .6 * q / 63.0;
|
sigma = noise_level + .5 + .6 * q / 63.0;
|
||||||
clamp = vpx_setup_noise(sigma, sizeof(ppstate->noise),
|
oci->postproc_state.clamp = vpx_setup_noise(sigma,
|
||||||
ppstate->noise);
|
ppstate->noise,
|
||||||
for (i = 0; i < 16; i++)
|
sizeof(ppstate->noise));
|
||||||
{
|
|
||||||
ppstate->blackclamp[i] = clamp;
|
|
||||||
ppstate->whiteclamp[i] = clamp;
|
|
||||||
ppstate->bothclamp[i] = 2 * clamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
ppstate->last_q = q;
|
ppstate->last_q = q;
|
||||||
ppstate->last_noise = noise_level;
|
ppstate->last_noise = noise_level;
|
||||||
}
|
}
|
||||||
@ -511,9 +504,8 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
|
|||||||
vpx_plane_add_noise
|
vpx_plane_add_noise
|
||||||
(oci->post_proc_buffer.y_buffer,
|
(oci->post_proc_buffer.y_buffer,
|
||||||
oci->postproc_state.noise,
|
oci->postproc_state.noise,
|
||||||
oci->postproc_state.blackclamp,
|
oci->postproc_state.clamp,
|
||||||
oci->postproc_state.whiteclamp,
|
oci->postproc_state.clamp,
|
||||||
oci->postproc_state.bothclamp,
|
|
||||||
oci->post_proc_buffer.y_width, oci->post_proc_buffer.y_height,
|
oci->post_proc_buffer.y_width, oci->post_proc_buffer.y_height,
|
||||||
oci->post_proc_buffer.y_stride);
|
oci->post_proc_buffer.y_stride);
|
||||||
}
|
}
|
||||||
|
@ -17,12 +17,10 @@ struct postproc_state
|
|||||||
{
|
{
|
||||||
int last_q;
|
int last_q;
|
||||||
int last_noise;
|
int last_noise;
|
||||||
char noise[3072];
|
int8_t noise[3072];
|
||||||
int last_base_qindex;
|
int last_base_qindex;
|
||||||
int last_frame_valid;
|
int last_frame_valid;
|
||||||
DECLARE_ALIGNED(16, char, blackclamp[16]);
|
int clamp;
|
||||||
DECLARE_ALIGNED(16, char, whiteclamp[16]);
|
|
||||||
DECLARE_ALIGNED(16, char, bothclamp[16]);
|
|
||||||
};
|
};
|
||||||
#include "onyxc_int.h"
|
#include "onyxc_int.h"
|
||||||
#include "ppflags.h"
|
#include "ppflags.h"
|
||||||
|
@ -412,29 +412,21 @@ int vp9_post_proc_frame(struct VP9Common *cm,
|
|||||||
|
|
||||||
ppstate->last_base_qindex = cm->base_qindex;
|
ppstate->last_base_qindex = cm->base_qindex;
|
||||||
ppstate->last_frame_valid = 1;
|
ppstate->last_frame_valid = 1;
|
||||||
|
|
||||||
if (flags & VP9D_ADDNOISE) {
|
if (flags & VP9D_ADDNOISE) {
|
||||||
const int noise_level = ppflags->noise_level;
|
const int noise_level = ppflags->noise_level;
|
||||||
if (ppstate->last_q != q ||
|
if (ppstate->last_q != q ||
|
||||||
ppstate->last_noise != noise_level) {
|
ppstate->last_noise != noise_level) {
|
||||||
double sigma;
|
double sigma;
|
||||||
int clamp, i;
|
|
||||||
vpx_clear_system_state();
|
vpx_clear_system_state();
|
||||||
sigma = noise_level + .5 + .6 * q / 63.0;
|
sigma = noise_level + .5 + .6 * q / 63.0;
|
||||||
clamp = vpx_setup_noise(sigma, sizeof(ppstate->noise),
|
ppstate->clamp = vpx_setup_noise(sigma, ppstate->noise,
|
||||||
ppstate->noise);
|
sizeof(ppstate->noise));
|
||||||
|
|
||||||
for (i = 0; i < 16; i++) {
|
|
||||||
ppstate->blackclamp[i] = clamp;
|
|
||||||
ppstate->whiteclamp[i] = clamp;
|
|
||||||
ppstate->bothclamp[i] = 2 * clamp;
|
|
||||||
}
|
|
||||||
ppstate->last_q = q;
|
ppstate->last_q = q;
|
||||||
ppstate->last_noise = noise_level;
|
ppstate->last_noise = noise_level;
|
||||||
}
|
}
|
||||||
vpx_plane_add_noise(ppbuf->y_buffer, ppstate->noise, ppstate->blackclamp,
|
vpx_plane_add_noise(ppbuf->y_buffer, ppstate->noise, ppstate->clamp,
|
||||||
ppstate->whiteclamp, ppstate->bothclamp,
|
ppstate->clamp, ppbuf->y_width, ppbuf->y_height,
|
||||||
ppbuf->y_width, ppbuf->y_height, ppbuf->y_stride);
|
ppbuf->y_stride);
|
||||||
}
|
}
|
||||||
|
|
||||||
*dest = *ppbuf;
|
*dest = *ppbuf;
|
||||||
|
@ -25,14 +25,12 @@ extern "C" {
|
|||||||
struct postproc_state {
|
struct postproc_state {
|
||||||
int last_q;
|
int last_q;
|
||||||
int last_noise;
|
int last_noise;
|
||||||
char noise[3072];
|
int8_t noise[3072];
|
||||||
int last_base_qindex;
|
int last_base_qindex;
|
||||||
int last_frame_valid;
|
int last_frame_valid;
|
||||||
MODE_INFO *prev_mip;
|
MODE_INFO *prev_mip;
|
||||||
MODE_INFO *prev_mi;
|
MODE_INFO *prev_mi;
|
||||||
DECLARE_ALIGNED(16, char, blackclamp[16]);
|
int clamp;
|
||||||
DECLARE_ALIGNED(16, char, whiteclamp[16]);
|
|
||||||
DECLARE_ALIGNED(16, char, bothclamp[16]);
|
|
||||||
uint8_t *limits;
|
uint8_t *limits;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,23 +17,20 @@
|
|||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
#include "vpx_ports/mem.h"
|
#include "vpx_ports/mem.h"
|
||||||
|
|
||||||
void vpx_plane_add_noise_c(uint8_t *start, char *noise,
|
void vpx_plane_add_noise_c(uint8_t *start, const int8_t *noise, int blackclamp,
|
||||||
char blackclamp[16],
|
int whiteclamp, int width, int height, int pitch) {
|
||||||
char whiteclamp[16],
|
|
||||||
char bothclamp[16],
|
|
||||||
unsigned int width, unsigned int height, int pitch) {
|
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
|
int bothclamp = blackclamp + whiteclamp;
|
||||||
for (i = 0; i < height; ++i) {
|
for (i = 0; i < height; ++i) {
|
||||||
uint8_t *pos = start + i * pitch;
|
uint8_t *pos = start + i * pitch;
|
||||||
char *ref = (char *)(noise + (rand() & 0xff)); // NOLINT
|
const int8_t *ref = (const int8_t *)(noise + (rand() & 0xff)); // NOLINT
|
||||||
|
|
||||||
for (j = 0; j < width; ++j) {
|
for (j = 0; j < width; ++j) {
|
||||||
int v = pos[j];
|
int v = pos[j];
|
||||||
|
|
||||||
v = clamp(v - blackclamp[0], 0, 255);
|
v = clamp(v - blackclamp, 0, 255);
|
||||||
v = clamp(v + bothclamp[0], 0, 255);
|
v = clamp(v + bothclamp, 0, 255);
|
||||||
v = clamp(v - whiteclamp[0], 0, 255);
|
v = clamp(v - whiteclamp, 0, 255);
|
||||||
|
|
||||||
pos[j] = v + ref[j];
|
pos[j] = v + ref[j];
|
||||||
}
|
}
|
||||||
@ -45,7 +42,7 @@ static double gaussian(double sigma, double mu, double x) {
|
|||||||
(exp(-(x - mu) * (x - mu) / (2 * sigma * sigma)));
|
(exp(-(x - mu) * (x - mu) / (2 * sigma * sigma)));
|
||||||
}
|
}
|
||||||
|
|
||||||
int vpx_setup_noise(double sigma, int size, char *noise) {
|
int vpx_setup_noise(double sigma, int8_t *noise, int size) {
|
||||||
char char_dist[256];
|
char char_dist[256];
|
||||||
int next = 0, i, j;
|
int next = 0, i, j;
|
||||||
|
|
||||||
|
@ -11,17 +11,16 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "./macros_msa.h"
|
#include "./macros_msa.h"
|
||||||
|
|
||||||
void vpx_plane_add_noise_msa(uint8_t *start_ptr, char *noise,
|
void vpx_plane_add_noise_msa(uint8_t *start_ptr, const int8_t *noise,
|
||||||
char blackclamp[16], char whiteclamp[16],
|
int blackclamp, int whiteclamp,
|
||||||
char bothclamp[16], uint32_t width,
|
int width, int height, int32_t pitch) {
|
||||||
uint32_t height, int32_t pitch) {
|
|
||||||
uint32_t i, j;
|
uint32_t i, j;
|
||||||
|
|
||||||
for (i = 0; i < height / 2; ++i) {
|
for (i = 0; i < height / 2; ++i) {
|
||||||
uint8_t *pos0_ptr = start_ptr + (2 * i) * pitch;
|
uint8_t *pos0_ptr = start_ptr + (2 * i) * pitch;
|
||||||
int8_t *ref0_ptr = (int8_t *)(noise + (rand() & 0xff));
|
const int8_t *ref0_ptr = noise + (rand() & 0xff);
|
||||||
uint8_t *pos1_ptr = start_ptr + (2 * i + 1) * pitch;
|
uint8_t *pos1_ptr = start_ptr + (2 * i + 1) * pitch;
|
||||||
int8_t *ref1_ptr = (int8_t *)(noise + (rand() & 0xff));
|
const int8_t *ref1_ptr = noise + (rand() & 0xff);
|
||||||
for (j = width / 16; j--;) {
|
for (j = width / 16; j--;) {
|
||||||
v16i8 temp00_s, temp01_s;
|
v16i8 temp00_s, temp01_s;
|
||||||
v16u8 temp00, temp01, black_clamp, white_clamp;
|
v16u8 temp00, temp01, black_clamp, white_clamp;
|
||||||
@ -32,8 +31,8 @@ void vpx_plane_add_noise_msa(uint8_t *start_ptr, char *noise,
|
|||||||
ref0 = LD_UB(ref0_ptr);
|
ref0 = LD_UB(ref0_ptr);
|
||||||
pos1 = LD_UB(pos1_ptr);
|
pos1 = LD_UB(pos1_ptr);
|
||||||
ref1 = LD_UB(ref1_ptr);
|
ref1 = LD_UB(ref1_ptr);
|
||||||
black_clamp = (v16u8)__msa_fill_b(blackclamp[0]);
|
black_clamp = (v16u8)__msa_fill_b(blackclamp);
|
||||||
white_clamp = (v16u8)__msa_fill_b(whiteclamp[0]);
|
white_clamp = (v16u8)__msa_fill_b(whiteclamp);
|
||||||
temp00 = (pos0 < black_clamp);
|
temp00 = (pos0 < black_clamp);
|
||||||
pos0 = __msa_bmnz_v(pos0, black_clamp, temp00);
|
pos0 = __msa_bmnz_v(pos0, black_clamp, temp00);
|
||||||
temp01 = (pos1 < black_clamp);
|
temp01 = (pos1 < black_clamp);
|
||||||
|
@ -16,7 +16,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Fills a noise buffer with gaussian noise strength determined by sigma.
|
// Fills a noise buffer with gaussian noise strength determined by sigma.
|
||||||
int vpx_setup_noise(double sigma, int size, char *noise);
|
int vpx_setup_noise(double sigma, int8_t *noise, int size);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -1892,7 +1892,7 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
|||||||
# Post Processing
|
# Post Processing
|
||||||
#
|
#
|
||||||
if (vpx_config("CONFIG_POSTPROC") eq "yes" || vpx_config("CONFIG_VP9_POSTPROC") eq "yes") {
|
if (vpx_config("CONFIG_POSTPROC") eq "yes" || vpx_config("CONFIG_VP9_POSTPROC") eq "yes") {
|
||||||
add_proto qw/void vpx_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";
|
add_proto qw/void vpx_plane_add_noise/, "uint8_t *start, const int8_t *noise, int blackclamp, int whiteclamp, int width, int height, int pitch";
|
||||||
specialize qw/vpx_plane_add_noise sse2 msa/;
|
specialize qw/vpx_plane_add_noise sse2 msa/;
|
||||||
|
|
||||||
add_proto qw/void vpx_mbpost_proc_down/, "unsigned char *dst, int pitch, int rows, int cols,int flimit";
|
add_proto qw/void vpx_mbpost_proc_down/, "unsigned char *dst, int pitch, int rows, int cols,int flimit";
|
||||||
|
@ -11,29 +11,32 @@
|
|||||||
|
|
||||||
%include "vpx_ports/x86_abi_support.asm"
|
%include "vpx_ports/x86_abi_support.asm"
|
||||||
|
|
||||||
;void vpx_plane_add_noise_sse2(unsigned char *start, unsigned char *noise,
|
;void vpx_plane_add_noise_sse2(uint8_t *start, const int8_t *noise,
|
||||||
; unsigned char blackclamp[16],
|
; int blackclamp, int whiteclamp,
|
||||||
; unsigned char whiteclamp[16],
|
; int width, int height, int pitch)
|
||||||
; unsigned char bothclamp[16],
|
|
||||||
; unsigned int width, unsigned int height,
|
|
||||||
; int pitch)
|
|
||||||
global sym(vpx_plane_add_noise_sse2) PRIVATE
|
global sym(vpx_plane_add_noise_sse2) PRIVATE
|
||||||
sym(vpx_plane_add_noise_sse2):
|
sym(vpx_plane_add_noise_sse2):
|
||||||
push rbp
|
push rbp
|
||||||
mov rbp, rsp
|
mov rbp, rsp
|
||||||
SHADOW_ARGS_TO_STACK 8
|
SHADOW_ARGS_TO_STACK 7
|
||||||
GET_GOT rbx
|
GET_GOT rbx
|
||||||
push rsi
|
push rsi
|
||||||
push rdi
|
push rdi
|
||||||
; end prolog
|
|
||||||
|
|
||||||
; get the clamps in registers
|
mov rdx, 0x01010101
|
||||||
mov rdx, arg(2) ; blackclamp
|
mov rax, arg(2)
|
||||||
movdqu xmm3, [rdx]
|
mul rdx
|
||||||
mov rdx, arg(3) ; whiteclamp
|
movd xmm3, rax
|
||||||
movdqu xmm4, [rdx]
|
pshufd xmm3, xmm3, 0 ; xmm3 is 16 copies of char in blackclamp
|
||||||
mov rdx, arg(4) ; bothclamp
|
|
||||||
movdqu xmm5, [rdx]
|
mov rdx, 0x01010101
|
||||||
|
mov rax, arg(3)
|
||||||
|
mul rdx
|
||||||
|
movd xmm4, rax
|
||||||
|
pshufd xmm4, xmm4, 0 ; xmm4 is 16 copies of char in whiteclamp
|
||||||
|
|
||||||
|
movdqu xmm5, xmm3 ; both clamp = black clamp + white clamp
|
||||||
|
paddusb xmm5, xmm4
|
||||||
|
|
||||||
.addnoise_loop:
|
.addnoise_loop:
|
||||||
call sym(LIBVPX_RAND) WRT_PLT
|
call sym(LIBVPX_RAND) WRT_PLT
|
||||||
@ -42,7 +45,7 @@ sym(vpx_plane_add_noise_sse2):
|
|||||||
add rcx, rax
|
add rcx, rax
|
||||||
|
|
||||||
mov rdi, rcx
|
mov rdi, rcx
|
||||||
movsxd rcx, dword arg(5) ;[Width]
|
movsxd rcx, dword arg(4) ;[Width]
|
||||||
mov rsi, arg(0) ;Pos
|
mov rsi, arg(0) ;Pos
|
||||||
xor rax, rax
|
xor rax, rax
|
||||||
|
|
||||||
@ -62,9 +65,9 @@ sym(vpx_plane_add_noise_sse2):
|
|||||||
cmp rax, rcx
|
cmp rax, rcx
|
||||||
jl .addnoise_nextset
|
jl .addnoise_nextset
|
||||||
|
|
||||||
movsxd rax, dword arg(7) ; Pitch
|
movsxd rax, dword arg(6) ; Pitch
|
||||||
add arg(0), rax ; Start += Pitch
|
add arg(0), rax ; Start += Pitch
|
||||||
sub dword arg(6), 1 ; Height -= 1
|
sub dword arg(5), 1 ; Height -= 1
|
||||||
jg .addnoise_loop
|
jg .addnoise_loop
|
||||||
|
|
||||||
; begin epilog
|
; begin epilog
|
||||||
|
Loading…
Reference in New Issue
Block a user