aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2014-11-22 19:50:37 +0100
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2014-11-23 06:51:18 +0100
commitd0682b5eb0d9b6d2c1bc8d03e7ab87c29bb08abc (patch)
tree38069e8c3f8b92016d6eccc3be5060312c333941
parent458aadf8627c27c35cc29e7842c6f7fc9a5695ad (diff)
downloadffmpeg-d0682b5eb0d9b6d2c1bc8d03e7ab87c29bb08abc.tar.gz
svq1enc: reduce stack usage of recursively-called function.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
-rw-r--r--libavcodec/svq1enc.c2
-rw-r--r--libavcodec/svq1enc.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c
index 288da1ff78..2a0d78043a 100644
--- a/libavcodec/svq1enc.c
+++ b/libavcodec/svq1enc.c
@@ -96,7 +96,7 @@ static int encode_block(SVQ1EncContext *s, uint8_t *src, uint8_t *ref,
int w = 2 << (level + 2 >> 1);
int h = 2 << (level + 1 >> 1);
int size = w * h;
- DECLARE_ALIGNED(16, int16_t, block)[7][256];
+ int16_t (*block)[256] = s->encoded_block_levels[level];
const int8_t *codebook_sum, *codebook;
const uint16_t(*mean_vlc)[2];
const uint8_t(*multistage_vlc)[2];
diff --git a/libavcodec/svq1enc.h b/libavcodec/svq1enc.h
index 740d2ff61b..8e74885117 100644
--- a/libavcodec/svq1enc.h
+++ b/libavcodec/svq1enc.h
@@ -59,6 +59,8 @@ typedef struct SVQ1EncContext {
int c_block_width;
int c_block_height;
+ DECLARE_ALIGNED(16, int16_t, encoded_block_levels)[6][7][256];
+
uint16_t *mb_type;
uint32_t *dummy;
int16_t (*motion_val8[3])[2];