summaryrefslogtreecommitdiff
path: root/libavcodec/h264_cavlc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-06-13 23:02:57 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-06-17 16:47:29 +0200
commit2d764069be3b4092dc986467660607d922023332 (patch)
tree1504ef9e286b8df559635e97d31ebe767a9e6426 /libavcodec/h264_cavlc.c
parent97141ffeec803c448d81ee4a53cfa2355f79f7ec (diff)
avcodec/vlc: Use structure instead of VLC_TYPE array as VLC element
In C, qualifiers for arrays are broken: const VLC_TYPE (*foo)[2] is a pointer to an array of two const VLC_TYPE elements and unfortunately this is not compatible with a pointer to a const array of two VLC_TYPE, because the latter does not exist as array types are never qualified (the qualifier applies to the base type instead). This is the reason why get_vlc2() doesn't accept a const VLC table despite not modifying the table at all, as there is no automatic conversion from VLC_TYPE (*)[2] to const VLC_TYPE (*)[2]. Fix this by using a structure VLCElem for the VLC table. This also has the advantage of making it clear which element is which. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/h264_cavlc.c')
-rw-r--r--libavcodec/h264_cavlc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c
index 9191df0303..d061a5953b 100644
--- a/libavcodec/h264_cavlc.c
+++ b/libavcodec/h264_cavlc.c
@@ -235,35 +235,35 @@ static const uint8_t run_bits[7][16]={
};
static VLC coeff_token_vlc[4];
-static VLC_TYPE coeff_token_vlc_tables[520+332+280+256][2];
+static VLCElem coeff_token_vlc_tables[520+332+280+256];
static const int coeff_token_vlc_tables_size[4]={520,332,280,256};
static VLC chroma_dc_coeff_token_vlc;
-static VLC_TYPE chroma_dc_coeff_token_vlc_table[256][2];
+static VLCElem chroma_dc_coeff_token_vlc_table[256];
static const int chroma_dc_coeff_token_vlc_table_size = 256;
static VLC chroma422_dc_coeff_token_vlc;
-static VLC_TYPE chroma422_dc_coeff_token_vlc_table[8192][2];
+static VLCElem chroma422_dc_coeff_token_vlc_table[8192];
static const int chroma422_dc_coeff_token_vlc_table_size = 8192;
static VLC total_zeros_vlc[15+1];
-static VLC_TYPE total_zeros_vlc_tables[15][512][2];
+static VLCElem total_zeros_vlc_tables[15][512];
static const int total_zeros_vlc_tables_size = 512;
static VLC chroma_dc_total_zeros_vlc[3+1];
-static VLC_TYPE chroma_dc_total_zeros_vlc_tables[3][8][2];
+static VLCElem chroma_dc_total_zeros_vlc_tables[3][8];
static const int chroma_dc_total_zeros_vlc_tables_size = 8;
static VLC chroma422_dc_total_zeros_vlc[7+1];
-static VLC_TYPE chroma422_dc_total_zeros_vlc_tables[7][32][2];
+static VLCElem chroma422_dc_total_zeros_vlc_tables[7][32];
static const int chroma422_dc_total_zeros_vlc_tables_size = 32;
static VLC run_vlc[6+1];
-static VLC_TYPE run_vlc_tables[6][8][2];
+static VLCElem run_vlc_tables[6][8];
static const int run_vlc_tables_size = 8;
static VLC run7_vlc;
-static VLC_TYPE run7_vlc_table[96][2];
+static VLCElem run7_vlc_table[96];
static const int run7_vlc_table_size = 96;
#define LEVEL_TAB_BITS 8