summaryrefslogtreecommitdiff
path: root/libavutil/crc.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2013-06-01 01:36:38 -0300
committerMichael Niedermayer <michaelni@gmx.at>2013-06-01 10:53:39 +0200
commitc485c835fef46dea5dddf66243954275291dcdee (patch)
tree56b9773068323f60d0dcbc7f9563d4cc96bfe5cd /libavutil/crc.c
parent0c2f673ed28ab6d187b4ce41396623f9e9378785 (diff)
avutil/crc: Dont limit CRC32 standard tables
Currently, standard tables like AV_CRC_32_IEEE and such are being generated (or provided in case the user compiles with hardcoded tables) with only 257 elements. We're missing a considerable boost in performance by not making them with a size of 1024 elements instead. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/crc.c')
-rw-r--r--libavutil/crc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavutil/crc.c b/libavutil/crc.c
index 9ee5efe9db..51fc83b0b5 100644
--- a/libavutil/crc.c
+++ b/libavutil/crc.c
@@ -211,6 +211,11 @@ static const AVCRC av_crc_table[AV_CRC_MAX][257] = {
},
};
#else
+#if CONFIG_SMALL
+#define CRC_TABLE_SIZE 257
+#else
+#define CRC_TABLE_SIZE 1024
+#endif
static struct {
uint8_t le;
uint8_t bits;
@@ -222,7 +227,7 @@ static struct {
[AV_CRC_32_IEEE] = { 0, 32, 0x04C11DB7 },
[AV_CRC_32_IEEE_LE] = { 1, 32, 0xEDB88320 },
};
-static AVCRC av_crc_table[AV_CRC_MAX][257];
+static AVCRC av_crc_table[AV_CRC_MAX][CRC_TABLE_SIZE];
#endif
int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size)