Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
dc857593
Commit
dc857593
authored
Feb 01, 2018
by
James Zern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
av1_txfm: inline range_check_value, clamp_value
Change-Id: I972d0304c6ff495f5f484fe77270c420a0dfe376
parent
ba575a09
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
+16
-16
av1/common/av1_inv_txfm1d.c
av1/common/av1_inv_txfm1d.c
+1
-15
av1/common/av1_txfm.h
av1/common/av1_txfm.h
+15
-0
av1/encoder/av1_fwd_txfm1d.c
av1/encoder/av1_fwd_txfm1d.c
+0
-1
No files found.
av1/common/av1_inv_txfm1d.c
View file @
dc857593
...
@@ -13,20 +13,6 @@
...
@@ -13,20 +13,6 @@
#include "aom_dsp/inv_txfm.h"
#include "aom_dsp/inv_txfm.h"
#include "av1/common/av1_inv_txfm1d.h"
#include "av1/common/av1_inv_txfm1d.h"
int32_t
range_check_value
(
int32_t
value
,
int8_t
bit
)
{
#if CONFIG_COEFFICIENT_RANGE_CHECKING
const
int64_t
maxValue
=
(
1LL
<<
(
bit
-
1
))
-
1
;
const
int64_t
minValue
=
-
(
1LL
<<
(
bit
-
1
));
if
(
value
<
minValue
||
value
>
maxValue
)
{
fprintf
(
stderr
,
"coeff out of bit range, value: %d bit %d
\n
"
,
value
,
bit
);
assert
(
0
);
}
#else
(
void
)
bit
;
#endif
return
value
;
}
#if CONFIG_COEFFICIENT_RANGE_CHECKING
#if CONFIG_COEFFICIENT_RANGE_CHECKING
void
range_check_func
(
int32_t
stage
,
const
int32_t
*
input
,
const
int32_t
*
buf
,
void
range_check_func
(
int32_t
stage
,
const
int32_t
*
input
,
const
int32_t
*
buf
,
int32_t
size
,
int8_t
bit
)
{
int32_t
size
,
int8_t
bit
)
{
...
@@ -86,7 +72,7 @@ static INLINE void clamp_buf(int32_t *buf, int32_t size, int8_t bit) {
...
@@ -86,7 +72,7 @@ static INLINE void clamp_buf(int32_t *buf, int32_t size, int8_t bit) {
}
}
#endif
#endif
int32_t
clamp_value
(
int32_t
value
,
int8_t
bit
)
{
static
INLINE
int32_t
clamp_value
(
int32_t
value
,
int8_t
bit
)
{
if
(
bit
<=
16
)
{
if
(
bit
<=
16
)
{
const
int32_t
maxValue
=
(
1
<<
15
)
-
1
;
const
int32_t
maxValue
=
(
1
<<
15
)
-
1
;
const
int32_t
minValue
=
-
(
1
<<
15
);
const
int32_t
minValue
=
-
(
1
<<
15
);
...
...
av1/common/av1_txfm.h
View file @
dc857593
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
#include <math.h>
#include <math.h>
#include <stdio.h>
#include <stdio.h>
#include "./aom_config.h"
#include "av1/common/enums.h"
#include "av1/common/enums.h"
#include "av1/common/blockd.h"
#include "av1/common/blockd.h"
#include "aom/aom_integer.h"
#include "aom/aom_integer.h"
...
@@ -92,6 +93,20 @@ static INLINE const int32_t *sinpi_arr(int n) {
...
@@ -92,6 +93,20 @@ static INLINE const int32_t *sinpi_arr(int n) {
return
sinpi_arr_data
[
n
-
cos_bit_min
];
return
sinpi_arr_data
[
n
-
cos_bit_min
];
}
}
static
INLINE
int32_t
range_check_value
(
int32_t
value
,
int8_t
bit
)
{
#if CONFIG_COEFFICIENT_RANGE_CHECKING
const
int64_t
maxValue
=
(
1LL
<<
(
bit
-
1
))
-
1
;
const
int64_t
minValue
=
-
(
1LL
<<
(
bit
-
1
));
if
(
value
<
minValue
||
value
>
maxValue
)
{
fprintf
(
stderr
,
"coeff out of bit range, value: %d bit %d
\n
"
,
value
,
bit
);
assert
(
0
);
}
#else
(
void
)
bit
;
#endif
return
value
;
}
static
INLINE
int32_t
round_shift
(
int32_t
value
,
int
bit
)
{
static
INLINE
int32_t
round_shift
(
int32_t
value
,
int
bit
)
{
assert
(
bit
>=
1
);
assert
(
bit
>=
1
);
return
(
int32_t
)(((
int64_t
)
value
+
(
1ll
<<
(
bit
-
1
)))
>>
bit
);
return
(
int32_t
)(((
int64_t
)
value
+
(
1ll
<<
(
bit
-
1
)))
>>
bit
);
...
...
av1/encoder/av1_fwd_txfm1d.c
View file @
dc857593
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
#include <stdlib.h>
#include <stdlib.h>
#include "aom_dsp/inv_txfm.h"
#include "aom_dsp/inv_txfm.h"
#include "av1/encoder/av1_fwd_txfm1d.h"
#include "av1/encoder/av1_fwd_txfm1d.h"
int32_t
range_check_value
(
int32_t
value
,
int8_t
bit
);
#if CONFIG_COEFFICIENT_RANGE_CHECKING
#if CONFIG_COEFFICIENT_RANGE_CHECKING
void
range_check_func
(
int32_t
stage
,
const
int32_t
*
input
,
const
int32_t
*
buf
,
void
range_check_func
(
int32_t
stage
,
const
int32_t
*
input
,
const
int32_t
*
buf
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment