diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-31 20:19:56 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-05-31 20:25:23 +0200 |
commit | b7d14883939e756cbda376c66552be9d843910a0 (patch) | |
tree | 8c7fdd52c3a487265a67e66f7fb4324c7ba3bdc5 /libavcodec/h264.h | |
parent | 18b46a494ef3592d69f4638dac1ebb613c0f548d (diff) | |
download | ffmpeg-b7d14883939e756cbda376c66552be9d843910a0.tar.gz |
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/h264.h')
-rw-r--r-- | libavcodec/h264.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/h264.h b/libavcodec/h264.h index 0e11e304ee..a27f82f494 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -421,12 +421,12 @@ typedef struct H264Context { uint8_t field_scan[16]; uint8_t field_scan8x8[64]; uint8_t field_scan8x8_cavlc[64]; - const uint8_t *zigzag_scan_q0; - const uint8_t *zigzag_scan8x8_q0; - const uint8_t *zigzag_scan8x8_cavlc_q0; - const uint8_t *field_scan_q0; - const uint8_t *field_scan8x8_q0; - const uint8_t *field_scan8x8_cavlc_q0; + uint8_t zigzag_scan_q0[16]; + uint8_t zigzag_scan8x8_q0[64]; + uint8_t zigzag_scan8x8_cavlc_q0[64]; + uint8_t field_scan_q0[16]; + uint8_t field_scan8x8_q0[64]; + uint8_t field_scan8x8_cavlc_q0[64]; int x264_build; |