---
libavcodec/h264.h | 1 +
libavcodec/h264_cabac.c | 4 ++--
libavcodec/h264_cavlc.c | 6 ++++--
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index f6df198..b4741a5 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -584,6 +584,7 @@ typedef struct H264Context{
extern const uint8_t ff_h264_chroma_qp[3][QP_MAX_NUM+1]; ///< One chroma qp
table for each supported bit depth (8, 9, 10).
+extern const uint16_t ff_h264_mb_sizes[4];
/**
* Decode SEI
diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c
index 8b42f04..9e1cf1b 100644
--- a/libavcodec/h264_cabac.c
+++ b/libavcodec/h264_cabac.c
@@ -1983,8 +1983,8 @@ decode_intra_mb:
h->slice_table[ mb_xy ]= h->slice_num;
if(IS_INTRA_PCM(mb_type)) {
- static const uint16_t mb_sizes[4] = {256,384,512,768};
- const int mb_size =
mb_sizes[h->sps.chroma_format_idc]*h->sps.bit_depth_luma >> 3;
+ const int mb_size = ff_h264_mb_sizes[h->sps.chroma_format_idc] *
+ h->sps.bit_depth_luma >> 3;
const uint8_t *ptr;
// We assume these blocks are very rare so we do not optimize it.
diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c
index a5b6403..99736be 100644
--- a/libavcodec/h264_cavlc.c
+++ b/libavcodec/h264_cavlc.c
@@ -236,6 +236,8 @@ static const uint8_t run_bits[7][16]={
{7,6,5,4,3,2,1,1,1,1,1,1,1,1,1},
};
+const uint16_t ff_h264_mb_sizes[4] = { 256, 384, 512, 768 };
+
static VLC coeff_token_vlc[4];
static VLC_TYPE coeff_token_vlc_tables[520+332+280+256][2];
static const int coeff_token_vlc_tables_size[4]={520,332,280,256};
@@ -764,8 +766,8 @@ decode_intra_mb:
if(IS_INTRA_PCM(mb_type)){
unsigned int x;
- static const uint16_t mb_sizes[4] = {256,384,512,768};
- const int mb_size =
mb_sizes[h->sps.chroma_format_idc]*h->sps.bit_depth_luma >> 3;
+ const int mb_size = ff_h264_mb_sizes[h->sps.chroma_format_idc] *
+ h->sps.bit_depth_luma >> 3;
// We assume these blocks are very rare so we do not optimize it.
align_get_bits(&s->gb);
--
1.7.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel