summaryrefslogtreecommitdiff
path: root/libavcodec/h264data.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-31 20:19:56 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-31 20:25:23 +0200
commitb7d14883939e756cbda376c66552be9d843910a0 (patch)
tree8c7fdd52c3a487265a67e66f7fb4324c7ba3bdc5 /libavcodec/h264data.h
parent18b46a494ef3592d69f4638dac1ebb613c0f548d (diff)
h264: move q0 scan tables into context
This fixes out of global array reads. The alternative solutions of checking the index or modifying the VLC tables to prevent the index going outside are each about 1-2 cpu cyclces slower per coded 4x4 block. The alternative of padding the global tables directly is more ugly and moving them to the context should benefit cache locality. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264data.h')
-rw-r--r--libavcodec/h264data.h5
1 files changed, 0 insertions, 5 deletions
diff --git a/libavcodec/h264data.h b/libavcodec/h264data.h
index b665bca8c5..f3fc7f9425 100644
--- a/libavcodec/h264data.h
+++ b/libavcodec/h264data.h
@@ -57,7 +57,6 @@ static const uint8_t zigzag_scan[16+1] = {
1 + 1 * 4, 2 + 0 * 4, 3 + 0 * 4, 2 + 1 * 4,
1 + 2 * 4, 0 + 3 * 4, 1 + 3 * 4, 2 + 2 * 4,
3 + 1 * 4, 3 + 2 * 4, 2 + 3 * 4, 3 + 3 * 4,
- 0,
};
static const uint8_t field_scan[16+1] = {
@@ -65,7 +64,6 @@ static const uint8_t field_scan[16+1] = {
0 + 3 * 4, 1 + 1 * 4, 1 + 2 * 4, 1 + 3 * 4,
2 + 0 * 4, 2 + 1 * 4, 2 + 2 * 4, 2 + 3 * 4,
3 + 0 * 4, 3 + 1 * 4, 3 + 2 * 4, 3 + 3 * 4,
- 0,
};
static const uint8_t luma_dc_zigzag_scan[16] = {
@@ -112,7 +110,6 @@ static const uint8_t zigzag_scan8x8_cavlc[64+1] = {
1 + 4 * 8, 2 + 4 * 8, 6 + 0 * 8, 4 + 3 * 8,
0 + 7 * 8, 4 + 4 * 8, 7 + 2 * 8, 3 + 6 * 8,
5 + 5 * 8, 6 + 5 * 8, 6 + 6 * 8, 7 + 7 * 8,
- 0,
};
static const uint8_t field_scan8x8[64+1] = {
@@ -132,7 +129,6 @@ static const uint8_t field_scan8x8[64+1] = {
7 + 0 * 8, 7 + 1 * 8, 6 + 4 * 8, 6 + 5 * 8,
6 + 6 * 8, 6 + 7 * 8, 7 + 2 * 8, 7 + 3 * 8,
7 + 4 * 8, 7 + 5 * 8, 7 + 6 * 8, 7 + 7 * 8,
- 0,
};
static const uint8_t field_scan8x8_cavlc[64+1] = {
@@ -152,7 +148,6 @@ static const uint8_t field_scan8x8_cavlc[64+1] = {
1 + 7 * 8, 3 + 2 * 8, 2 + 7 * 8, 4 + 2 * 8,
3 + 7 * 8, 5 + 2 * 8, 4 + 7 * 8, 5 + 4 * 8,
6 + 3 * 8, 6 + 5 * 8, 7 + 3 * 8, 7 + 7 * 8,
- 0,
};
typedef struct IMbInfo {