Commit 8c02c790 authored by Henrik Gramner's avatar Henrik Gramner Committed by Fiona Glaser

Shrink even more constant arrays

parent dfba665a
......@@ -112,8 +112,8 @@ static void (* const x264_mc_copy_wtab_neon[5])( uint8_t *, int, uint8_t *, int,
x264_mc_copy_w16_neon,
};
static const int hpel_ref0[16] = {0,1,1,1,0,1,1,1,2,3,3,3,0,1,1,1};
static const int hpel_ref1[16] = {0,0,0,0,2,2,3,2,2,2,3,2,2,2,3,2};
static const uint8_t hpel_ref0[16] = {0,1,1,1,0,1,1,1,2,3,3,3,0,1,1,1};
static const uint8_t hpel_ref1[16] = {0,0,0,0,2,2,3,2,2,2,3,2,2,2,3,2};
static void mc_luma_neon( uint8_t *dst, int i_dst_stride,
uint8_t *src[4], int i_src_stride,
......
......@@ -203,8 +203,8 @@ static void hpel_filter( uint8_t *dsth, uint8_t *dstv, uint8_t *dstc, uint8_t *s
}
}
static const int hpel_ref0[16] = {0,1,1,1,0,1,1,1,2,3,3,3,0,1,1,1};
static const int hpel_ref1[16] = {0,0,0,0,2,2,3,2,2,2,3,2,2,2,3,2};
static const uint8_t hpel_ref0[16] = {0,1,1,1,0,1,1,1,2,3,3,3,0,1,1,1};
static const uint8_t hpel_ref1[16] = {0,0,0,0,2,2,3,2,2,2,3,2,2,2,3,2};
static void mc_luma( uint8_t *dst, int i_dst_stride,
uint8_t *src[4], int i_src_stride,
......
......@@ -37,8 +37,8 @@ typedef void (*pf_mc_t)( uint8_t *src, int i_src,
uint8_t *dst, int i_dst, int i_height );
static const int hpel_ref0[16] = {0,1,1,1,0,1,1,1,2,3,3,3,0,1,1,1};
static const int hpel_ref1[16] = {0,0,0,0,2,2,3,2,2,2,3,2,2,2,3,2};
static const uint8_t hpel_ref0[16] = {0,1,1,1,0,1,1,1,2,3,3,3,0,1,1,1};
static const uint8_t hpel_ref1[16] = {0,0,0,0,2,2,3,2,2,2,3,2,2,2,3,2};
static inline int x264_tapfilter( uint8_t *pix, int i_pix_next )
......
......@@ -23,7 +23,7 @@
#define SHIFT(x,s) ((s)<=0 ? (x)<<-(s) : ((x)+(1<<((s)-1)))>>(s))
#define DIV(n,d) (((n) + ((d)>>1)) / (d))
static const int dequant4_scale[6][3] =
static const uint8_t dequant4_scale[6][3] =
{
{ 10, 13, 16 },
{ 11, 14, 18 },
......@@ -32,7 +32,7 @@ static const int dequant4_scale[6][3] =
{ 16, 20, 25 },
{ 18, 23, 29 }
};
static const int quant4_scale[6][3] =
static const uint16_t quant4_scale[6][3] =
{
{ 13107, 8066, 5243 },
{ 11916, 7490, 4660 },
......@@ -42,11 +42,11 @@ static const int quant4_scale[6][3] =
{ 7282, 4559, 2893 },
};
static const int quant8_scan[16] =
static const uint8_t quant8_scan[16] =
{
0,3,4,3, 3,1,5,1, 4,5,2,5, 3,1,5,1
};
static const int dequant8_scale[6][6] =
static const uint8_t dequant8_scale[6][6] =
{
{ 20, 18, 32, 19, 25, 24 },
{ 22, 19, 35, 21, 28, 26 },
......@@ -55,7 +55,7 @@ static const int dequant8_scale[6][6] =
{ 32, 28, 51, 30, 40, 38 },
{ 36, 32, 58, 34, 46, 43 },
};
static const int quant8_scale[6][6] =
static const uint16_t quant8_scale[6][6] =
{
{ 13107, 11428, 20972, 12222, 16777, 15481 },
{ 11916, 10826, 19174, 11058, 14980, 14290 },
......
......@@ -228,8 +228,8 @@ static void x264_weight_cache_ssse3( x264_t *h, x264_weight_t *w )
}
}
static const int hpel_ref0[16] = {0,1,1,1,0,1,1,1,2,3,3,3,0,1,1,1};
static const int hpel_ref1[16] = {0,0,0,0,2,2,3,2,2,2,3,2,2,2,3,2};
static const uint8_t hpel_ref0[16] = {0,1,1,1,0,1,1,1,2,3,3,3,0,1,1,1};
static const uint8_t hpel_ref1[16] = {0,0,0,0,2,2,3,2,2,2,3,2,2,2,3,2};
#define MC_LUMA(name,instr1,instr2)\
static void mc_luma_##name( uint8_t *dst, int i_dst_stride,\
......
......@@ -2816,8 +2816,8 @@ void x264_encoder_close ( x264_t *h )
/* Slices used and PSNR */
for( int i = 0; i < 5; i++ )
{
static const int slice_order[] = { SLICE_TYPE_I, SLICE_TYPE_SI, SLICE_TYPE_P, SLICE_TYPE_SP, SLICE_TYPE_B };
static const char *slice_name[] = { "P", "B", "I", "SP", "SI" };
static const uint8_t slice_order[] = { SLICE_TYPE_I, SLICE_TYPE_SI, SLICE_TYPE_P, SLICE_TYPE_SP, SLICE_TYPE_B };
static const char * const slice_name[] = { "P", "B", "I", "SP", "SI" };
int i_slice = slice_order[i];
if( h->stat.i_frame_count[i_slice] > 0 )
......
......@@ -484,7 +484,7 @@ void x264_me_search_ref( x264_t *h, x264_me_t *m, int16_t (*mvc)[2], int i_mvc,
int i = 1;
do
{
static const int hex4[16][2] = {
static const int8_t hex4[16][2] = {
{ 0,-4}, { 0, 4}, {-2,-3}, { 2,-3},
{-4,-2}, { 4,-2}, {-4,-1}, { 4,-1},
{-4, 0}, { 4, 0}, {-4, 1}, { 4, 1},
......
......@@ -315,26 +315,22 @@ void x264_sps_write( bs_t *s, x264_sps_t *sps )
if( sps->vui.b_aspect_ratio_info_present )
{
int i;
static const struct { int w, h; int sar; } sar[] =
static const struct { uint8_t w, h, sar; } sar[] =
{
{ 1, 1, 1 }, { 12, 11, 2 }, { 10, 11, 3 }, { 16, 11, 4 },
{ 40, 33, 5 }, { 24, 11, 6 }, { 20, 11, 7 }, { 32, 11, 8 },
{ 80, 33, 9 }, { 18, 11, 10}, { 15, 11, 11}, { 64, 33, 12},
{ 160,99, 13}, { 0, 0, -1 }
{ 160,99, 13}, { 0, 0, 255 }
};
for( i = 0; sar[i].sar != -1; i++ )
for( i = 0; sar[i].sar != 255; i++ )
{
if( sar[i].w == sps->vui.i_sar_width &&
sar[i].h == sps->vui.i_sar_height )
break;
}
if( sar[i].sar != -1 )
bs_write( s, 8, sar[i].sar );
if( sar[i].sar == 255 ) /* aspect_ratio_idc (extended) */
{
bs_write( s, 8, sar[i].sar );
}
else
{
bs_write( s, 8, 255); /* aspect_ratio_idc (extended) */
bs_write( s, 16, sps->vui.i_sar_width );
bs_write( s, 16, sps->vui.i_sar_height );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment