Also get rid of a few instances of variable shadowing.
static uint64_t x264_pixel_hadamard_ac_16x16_altivec( uint8_t *pix, int stride )
{
- int index = ((uintptr_t)pix & 8) >> 3;
- vec_u8_t permh = hadamard_permtab[index];
- vec_u8_t perml = hadamard_permtab[!index];
+ int idx = ((uintptr_t)pix & 8) >> 3;
+ vec_u8_t permh = hadamard_permtab[idx];
+ vec_u8_t perml = hadamard_permtab[!idx];
uint64_t sum = pixel_hadamard_ac_altivec( pix, stride, permh );
sum += pixel_hadamard_ac_altivec( pix+8, stride, perml );
sum += pixel_hadamard_ac_altivec( pix+8*stride, stride, permh );
static uint64_t x264_pixel_hadamard_ac_16x8_altivec( uint8_t *pix, int stride )
{
- int index = ((uintptr_t)pix & 8) >> 3;
- vec_u8_t permh = hadamard_permtab[index];
- vec_u8_t perml = hadamard_permtab[!index];
+ int idx = ((uintptr_t)pix & 8) >> 3;
+ vec_u8_t permh = hadamard_permtab[idx];
+ vec_u8_t perml = hadamard_permtab[!idx];
uint64_t sum = pixel_hadamard_ac_altivec( pix, stride, permh );
sum += pixel_hadamard_ac_altivec( pix+8, stride, perml );
return ((sum>>34)<<32) + ((uint32_t)sum>>1);
define ftell ftello64
fi
+if cc_check '' -Wshadow ; then
+ CFLAGS="-Wshadow $CFLAGS"
+fi
+
rm -f conftest*
# generate config files
* FIXME: while they're written in 5 significant digits, they're only tuned to 2. */
float strength;
float avg_adj = 0.f;
- int width = h->mb.i_mb_width;
- int height = h->mb.i_mb_height;
/* Initialize frame stats */
for( int i = 0; i < 3; i++ )
{
/* Need variance data for weighted prediction */
if( h->param.analyse.i_weighted_pred == X264_WEIGHTP_FAKE || h->param.analyse.i_weighted_pred == X264_WEIGHTP_SMART )
{
- for( int mb_y = 0; mb_y < height; mb_y++ )
- for( int mb_x = 0; mb_x < width; mb_x++ )
+ for( int mb_y = 0; mb_y < h->mb.i_mb_height; mb_y++ )
+ for( int mb_x = 0; mb_x < h->mb.i_mb_width; mb_x++ )
x264_ac_energy_mb( h, mb_x, mb_y, frame );
}
else
if( h->param.rc.i_aq_mode == X264_AQ_AUTOVARIANCE )
{
float avg_adj_pow2 = 0.f;
- for( int mb_y = 0; mb_y < height; mb_y++ )
- for( int mb_x = 0; mb_x < width; mb_x++ )
+ for( int mb_y = 0; mb_y < h->mb.i_mb_height; mb_y++ )
+ for( int mb_x = 0; mb_x < h->mb.i_mb_width; mb_x++ )
{
uint32_t energy = x264_ac_energy_mb( h, mb_x, mb_y, frame );
float qp_adj = powf( energy + 1, 0.125f );
else
strength = h->param.rc.f_aq_strength * 1.0397f;
- for( int mb_y = 0; mb_y < height; mb_y++ )
- for( int mb_x = 0; mb_x < width; mb_x++ )
+ for( int mb_y = 0; mb_y < h->mb.i_mb_height; mb_y++ )
+ for( int mb_x = 0; mb_x < h->mb.i_mb_width; mb_x++ )
{
float qp_adj;
int mb_xy = mb_x + mb_y*h->mb.i_mb_stride;
{
uint64_t ssd = frame->i_pixel_ssd[i];
uint64_t sum = frame->i_pixel_sum[i];
- int w = width*16>>!!i;
- int h = height*16>>!!i;
- frame->i_pixel_ssd[i] = ssd - (sum * sum + w * h / 2) / (w * h);
+ int width = h->mb.i_mb_width*16>>!!i;
+ int height = h->mb.i_mb_height*16>>!!i;
+ frame->i_pixel_ssd[i] = ssd - (sum * sum + width * height / 2) / (width * height);
}
}
for( int j = 0; j < filter_size; j++ )
{
- int index = i+j-filter_size/2;
- double d = index-i;
+ int idx = i+j-filter_size/2;
+ double d = idx-i;
double coeff = qblur==0 ? 1.0 : exp( -d*d/(qblur*qblur) );
- if( index < 0 || index >= rcc->num_entries )
+ if( idx < 0 || idx >= rcc->num_entries )
continue;
- if( rce->pict_type != rcc->entry[index].pict_type )
+ if( rce->pict_type != rcc->entry[idx].pict_type )
continue;
- q += qscale[index] * coeff;
+ q += qscale[idx] * coeff;
sum += coeff;
}
blurred_qscale[i] = q/sum;
int i_coded = h->lookahead->next.list[0]->i_frame;
if( bframes )
{
- int index[] = { brefs+1, 1 };
+ int idx_list[] = { brefs+1, 1 };
for( int i = 0; i < bframes; i++ )
{
- int idx = index[h->lookahead->next.list[i]->i_type == X264_TYPE_BREF]++;
+ int idx = idx_list[h->lookahead->next.list[i]->i_type == X264_TYPE_BREF]++;
frames[idx] = h->lookahead->next.list[i];
frames[idx]->i_reordered_pts = h->lookahead->next.list[idx]->i_pts;
}
e.BufferSize = 0;
int seekmode = opt->seek ? FFMS_SEEK_NORMAL : FFMS_SEEK_LINEAR_NO_RW;
- FFMS_Index *index = NULL;
- if( opt->index )
+ FFMS_Index *idx = NULL;
+ if( opt->index_file )
{
struct stat index_s, input_s;
- if( !stat( opt->index, &index_s ) && !stat( psz_filename, &input_s ) &&
+ if( !stat( opt->index_file, &index_s ) && !stat( psz_filename, &input_s ) &&
input_s.st_mtime < index_s.st_mtime )
- index = FFMS_ReadIndex( opt->index, &e );
+ idx = FFMS_ReadIndex( opt->index_file, &e );
}
- if( !index )
+ if( !idx )
{
- index = FFMS_MakeIndex( psz_filename, 0, 0, NULL, NULL, 0, update_progress, NULL, &e );
+ idx = FFMS_MakeIndex( psz_filename, 0, 0, NULL, NULL, 0, update_progress, NULL, &e );
fprintf( stderr, " \r" );
- if( !index )
+ if( !idx )
{
fprintf( stderr, "ffms [error]: could not create index\n" );
return -1;
}
- if( opt->index && FFMS_WriteIndex( opt->index, index, &e ) )
+ if( opt->index_file && FFMS_WriteIndex( opt->index_file, idx, &e ) )
fprintf( stderr, "ffms [warning]: could not write index file\n" );
}
- int trackno = FFMS_GetFirstTrackOfType( index, FFMS_TYPE_VIDEO, &e );
+ int trackno = FFMS_GetFirstTrackOfType( idx, FFMS_TYPE_VIDEO, &e );
if( trackno < 0 )
{
fprintf( stderr, "ffms [error]: could not find video track\n" );
return -1;
}
- h->video_source = FFMS_CreateVideoSource( psz_filename, trackno, index, 1, seekmode, &e );
+ h->video_source = FFMS_CreateVideoSource( psz_filename, trackno, idx, 1, seekmode, &e );
if( !h->video_source )
{
fprintf( stderr, "ffms [error]: could not create video source\n" );
h->track = FFMS_GetTrackFromVideo( h->video_source );
- FFMS_DestroyIndex( index );
+ FFMS_DestroyIndex( idx );
const FFMS_VideoProperties *videop = FFMS_GetVideoProperties( h->video_source );
h->total_frames = videop->NumFrames;
info->sar_height = videop->SARDen;
/* options that are used by only some demuxers */
typedef struct
{
- char *index;
+ char *index_file;
char *resolution; /* resolution string parsed by raw yuv input */
char *timebase;
int seek;
return ret;
}
-static char const *strtable_lookup( const char * const table[], int index )
+static char const *strtable_lookup( const char * const table[], int idx )
{
int i = 0; while( table[i] ) i++;
- return ( ( index >= 0 && index < i ) ? table[ index ] : "???" );
+ return ( ( idx >= 0 && idx < i ) ? table[ idx ] : "???" );
}
static char *stringify_names( char *buf, const char * const names[] )
}
break;
case OPT_INDEX:
- input_opt.index = optarg;
+ input_opt.index_file = optarg;
break;
case OPT_QPFILE:
opt->qpfile = fopen( optarg, "rb" );