Commit 36967373 authored by Sebastien Alaiwan's avatar Sebastien Alaiwan

Remove dead function 'clamp_block'

And reduce scope of 'get_max_bit',
which is only used by the test code.

Change-Id: I9af7be426f7bec6958419ca02957db87e7963f50
parent 3e22da3d
......@@ -117,27 +117,6 @@ static INLINE int32_t half_btf(int32_t w0, int32_t in0, int32_t w1, int32_t in1,
return round_shift(result_32, bit);
}
static INLINE int get_max_bit(int x) {
int max_bit = -1;
while (x) {
x = x >> 1;
max_bit++;
}
return max_bit;
}
// TODO(angiebird): implement SSE
static INLINE void clamp_block(int16_t *block, int block_size_row,
int block_size_col, int stride, int low,
int high) {
int i, j;
for (i = 0; i < block_size_row; ++i) {
for (j = 0; j < block_size_col; ++j) {
block[i * stride + j] = clamp(block[i * stride + j], low, high);
}
}
}
typedef void (*TxfmFunc)(const int32_t *input, int32_t *output,
const int8_t *cos_bit, const int8_t *stage_range);
......
......@@ -51,11 +51,6 @@ TEST(av1_fwd_txfm1d, round_shift) {
EXPECT_EQ(round_shift(-8, 2), -2);
}
TEST(av1_fwd_txfm1d, get_max_bit) {
int max_bit = get_max_bit(8);
EXPECT_EQ(max_bit, 3);
}
TEST(av1_fwd_txfm1d, cospi_arr_data) {
for (int i = 0; i < 7; i++) {
for (int j = 0; j < 64; j++) {
......@@ -65,31 +60,6 @@ TEST(av1_fwd_txfm1d, cospi_arr_data) {
}
}
TEST(av1_fwd_txfm1d, clamp_block) {
int16_t block[5][5] = { { 7, -5, 6, -3, 9 },
{ 7, -5, 6, -3, 9 },
{ 7, -5, 6, -3, 9 },
{ 7, -5, 6, -3, 9 },
{ 7, -5, 6, -3, 9 } };
int16_t ref_block[5][5] = { { 7, -5, 6, -3, 9 },
{ 7, -5, 6, -3, 9 },
{ 7, -4, 2, -3, 9 },
{ 7, -4, 2, -3, 9 },
{ 7, -4, 2, -3, 9 } };
int row = 2;
int col = 1;
int block_size = 3;
int stride = 5;
clamp_block(block[row] + col, block_size, block_size, stride, -4, 2);
for (int r = 0; r < stride; r++) {
for (int c = 0; c < stride; c++) {
EXPECT_EQ(block[r][c], ref_block[r][c]);
}
}
}
TEST(av1_fwd_txfm1d, accuracy) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
for (int si = 0; si < txfm_size_num; ++si) {
......
......@@ -95,6 +95,20 @@ TEST(av1_inv_txfm1d, InvAccuracyCheck) {
}
}
static INLINE int get_max_bit(int x) {
int max_bit = -1;
while (x) {
x = x >> 1;
max_bit++;
}
return max_bit;
}
TEST(av1_inv_txfm1d, get_max_bit) {
int max_bit = get_max_bit(8);
EXPECT_EQ(max_bit, 3);
}
TEST(av1_inv_txfm1d, round_trip) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
for (int si = 0; si < NELEMENTS(fwd_txfm_func_ls); ++si) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment