aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-03-29 17:15:42 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-03-29 17:15:42 +0000
commitfff60779172c21638e1c7276d5128770480c8f93 (patch)
tree736d6718c6f007955ca54a862492da2c60b44fee
parent4b086e7f2157baafcbae8f7b37120c1e8f721c29 (diff)
downloadffmpeg-fff60779172c21638e1c7276d5128770480c8f93.tar.gz
Make ipvideo_decode_block array constant, compile-time initialized instead
of initializing it each time the decoder is initialized. Originally committed as revision 18219 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/interplayvideo.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c
index 1ddbbee6b6..ba314767fe 100644
--- a/libavcodec/interplayvideo.c
+++ b/libavcodec/interplayvideo.c
@@ -778,7 +778,16 @@ static int ipvideo_decode_block_opcode_0xF(IpvideoContext *s)
return 0;
}
-static int (*ipvideo_decode_block[16])(IpvideoContext *s);
+static int (* const ipvideo_decode_block[])(IpvideoContext *s) = {
+ ipvideo_decode_block_opcode_0x0, ipvideo_decode_block_opcode_0x1,
+ ipvideo_decode_block_opcode_0x2, ipvideo_decode_block_opcode_0x3,
+ ipvideo_decode_block_opcode_0x4, ipvideo_decode_block_opcode_0x5,
+ ipvideo_decode_block_opcode_0x6, ipvideo_decode_block_opcode_0x7,
+ ipvideo_decode_block_opcode_0x8, ipvideo_decode_block_opcode_0x9,
+ ipvideo_decode_block_opcode_0xA, ipvideo_decode_block_opcode_0xB,
+ ipvideo_decode_block_opcode_0xC, ipvideo_decode_block_opcode_0xD,
+ ipvideo_decode_block_opcode_0xE, ipvideo_decode_block_opcode_0xF,
+};
static void ipvideo_decode_opcodes(IpvideoContext *s)
{
@@ -852,24 +861,6 @@ static av_cold int ipvideo_decode_init(AVCodecContext *avctx)
/* decoding map contains 4 bits of information per 8x8 block */
s->decoding_map_size = avctx->width * avctx->height / (8 * 8 * 2);
- /* assign block decode functions */
- ipvideo_decode_block[0x0] = ipvideo_decode_block_opcode_0x0;
- ipvideo_decode_block[0x1] = ipvideo_decode_block_opcode_0x1;
- ipvideo_decode_block[0x2] = ipvideo_decode_block_opcode_0x2;
- ipvideo_decode_block[0x3] = ipvideo_decode_block_opcode_0x3;
- ipvideo_decode_block[0x4] = ipvideo_decode_block_opcode_0x4;
- ipvideo_decode_block[0x5] = ipvideo_decode_block_opcode_0x5;
- ipvideo_decode_block[0x6] = ipvideo_decode_block_opcode_0x6;
- ipvideo_decode_block[0x7] = ipvideo_decode_block_opcode_0x7;
- ipvideo_decode_block[0x8] = ipvideo_decode_block_opcode_0x8;
- ipvideo_decode_block[0x9] = ipvideo_decode_block_opcode_0x9;
- ipvideo_decode_block[0xA] = ipvideo_decode_block_opcode_0xA;
- ipvideo_decode_block[0xB] = ipvideo_decode_block_opcode_0xB;
- ipvideo_decode_block[0xC] = ipvideo_decode_block_opcode_0xC;
- ipvideo_decode_block[0xD] = ipvideo_decode_block_opcode_0xD;
- ipvideo_decode_block[0xE] = ipvideo_decode_block_opcode_0xE;
- ipvideo_decode_block[0xF] = ipvideo_decode_block_opcode_0xF;
-
s->current_frame.data[0] = s->last_frame.data[0] =
s->second_last_frame.data[0] = NULL;