Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mathis Rosenhauer
libaec
Commits
11ca2a7f
Commit
11ca2a7f
authored
Aug 15, 2016
by
Mathis Rosenhauer
Browse files
Add macro for used RSI
parent
92870774
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/decode.c
View file @
11ca2a7f
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
#endif
#endif
#define ROS 5
#define ROS 5
#define RSI_USED(state) ((size_t)(state->rsip - state->rsi_buffer))
#define BUFFERSPACE(strm) (strm->avail_in >= strm->state->in_blklen \
#define BUFFERSPACE(strm) (strm->avail_in >= strm->state->in_blklen \
&& strm->avail_out >= strm->state->out_blklen)
&& strm->avail_out >= strm->state->out_blklen)
...
@@ -203,7 +203,7 @@ static inline void check_rsi_end(struct aec_stream *strm)
...
@@ -203,7 +203,7 @@ static inline void check_rsi_end(struct aec_stream *strm)
*/
*/
struct
internal_state
*
state
=
strm
->
state
;
struct
internal_state
*
state
=
strm
->
state
;
if
(
state
->
rsi_size
==
(
size_t
)(
state
->
rsip
-
state
->
rsi_buffer
))
{
if
(
state
->
rsi_size
==
RSI_USED
(
state
))
{
state
->
flush_output
(
strm
);
state
->
flush_output
(
strm
);
state
->
flush_start
=
state
->
rsi_buffer
;
state
->
flush_start
=
state
->
rsi_buffer
;
state
->
rsip
=
state
->
rsi_buffer
;
state
->
rsip
=
state
->
rsi_buffer
;
...
@@ -523,7 +523,7 @@ static int m_zero_block(struct aec_stream *strm)
...
@@ -523,7 +523,7 @@ static int m_zero_block(struct aec_stream *strm)
fs_drop
(
strm
);
fs_drop
(
strm
);
if
(
zero_blocks
==
ROS
)
{
if
(
zero_blocks
==
ROS
)
{
b
=
(
int
)
(
state
->
rsip
-
state
->
rsi_buffer
)
/
strm
->
block_size
;
b
=
(
int
)
RSI_USED
(
state
)
/
strm
->
block_size
;
zero_blocks
=
MIN
(
strm
->
rsi
-
b
,
64
-
(
b
%
64
));
zero_blocks
=
MIN
(
strm
->
rsi
-
b
,
64
-
(
b
%
64
));
}
else
if
(
zero_blocks
>
ROS
)
{
}
else
if
(
zero_blocks
>
ROS
)
{
zero_blocks
--
;
zero_blocks
--
;
...
@@ -537,7 +537,7 @@ static int m_zero_block(struct aec_stream *strm)
...
@@ -537,7 +537,7 @@ static int m_zero_block(struct aec_stream *strm)
zero_bytes
=
i
*
state
->
bytes_per_sample
;
zero_bytes
=
i
*
state
->
bytes_per_sample
;
if
(
strm
->
avail_out
>=
zero_bytes
)
{
if
(
strm
->
avail_out
>=
zero_bytes
)
{
if
(
state
->
rsi_size
-
(
state
->
rsip
-
state
->
rsi_buffer
)
<
i
)
if
(
state
->
rsi_size
-
RSI_USED
(
state
)
<
i
)
return
M_ERROR
;
return
M_ERROR
;
memset
(
state
->
rsip
,
0
,
i
*
sizeof
(
uint32_t
));
memset
(
state
->
rsip
,
0
,
i
*
sizeof
(
uint32_t
));
...
...
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