From 63bcbe0064a62019b8dc530530c1547bb08bf958 Mon Sep 17 00:00:00 2001 From: Mathis Rosenhauer Date: Mon, 10 Feb 2014 17:57:21 +0100 Subject: [PATCH] Make RSI padding for encoding compile time option as it affects performance --- src/decode.c | 12 ++++++------ src/encode.c | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/decode.c b/src/decode.c index 8e54b2b..1b184a6 100644 --- a/src/decode.c +++ b/src/decode.c @@ -358,14 +358,14 @@ static int m_id(struct aec_stream *strm) { struct internal_state *state = strm->state; - if (state->pp && state->rsip == state->rsi_buffer) { - state->ref = 1; - if (strm->flags & AEC_PAD_RSI) + if (state->rsip == state->rsi_buffer) { + if(strm->flags & AEC_PAD_RSI) state->bitp -= state->bitp % 8; - } - else + if (state->pp) + state->ref = 1; + } else { state->ref = 0; - + } if (bits_ask(strm, state->id_len) == 0) return M_EXIT; state->id = bits_get(strm, state->id_len); diff --git a/src/encode.c b/src/encode.c index d53b6db..4554867 100644 --- a/src/encode.c +++ b/src/encode.c @@ -511,11 +511,13 @@ static int m_flush_block(struct aec_stream *strm) int n; struct internal_state *state = strm->state; +#ifdef ENABLE_RSI_PADDING if (state->blocks_avail == 0 && strm->flags & AEC_PAD_RSI && state->block_nonzero == 0 ) emit(state, 0, state->bits % 8); +#endif if (state->direct_out) { n = state->cds - strm->next_out; -- 2.7.4