Resolve unsigned/signed mismatch warnings.

- Working towards issue #11.
This commit is contained in:
Ari Koivula 2014-04-04 11:08:34 +03:00
parent c142cbba21
commit 46d33d3945
4 changed files with 9 additions and 9 deletions

View file

@ -353,7 +353,7 @@ int main(int argc, char *argv[])
// TODO: add more than one reference
// Remove the ref pic (if present)
if (encoder->ref->used_size == encoder->cfg->ref_frames) {
if (encoder->ref->used_size == (uint32_t)encoder->cfg->ref_frames) {
picture_list_rem(encoder->ref, encoder->ref->used_size-1, 1);
}
// Add current picture as reference

View file

@ -837,7 +837,7 @@ static void encode_scaling_list(encoder_control* encoder)
{
uint32_t size_id;
for (size_id = 0; size_id < SCALING_LIST_SIZE_NUM; size_id++) {
uint32_t list_id;
int32_t list_id;
for (list_id = 0; list_id < g_scaling_list_num[size_id]; list_id++) {
uint8_t scaling_list_pred_mode_flag = 1;
int32_t pred_list_idx;

View file

@ -140,8 +140,8 @@ typedef struct picture_struct
typedef struct
{
picture** pics; //!< \brief Pointer to array of picture pointers.
int32_t size; //!< \brief Array size.
int32_t used_size;
uint32_t size; //!< \brief Array size.
uint32_t used_size;
} picture_list;

View file

@ -132,7 +132,7 @@ static int calc_mvd_cost(int x, int y, const vector2d *pred,
y <<= 2;
// Check every candidate to find a match
for(merge_idx = 0; merge_idx < num_cand; merge_idx++) {
for(merge_idx = 0; merge_idx < (uint32_t)num_cand; merge_idx++) {
if (merge_cand[merge_idx][0] == x &&
merge_cand[merge_idx][1] == y &&
merge_cand[merge_idx][2] == ref_idx) {
@ -373,7 +373,7 @@ static unsigned search_mv_full(unsigned depth,
static int search_cu_inter(encoder_control *encoder, int x, int y, int depth, lcu_t *lcu)
{
picture *cur_pic = encoder->in.cur_pic;
int32_t ref_idx = 0;
uint32_t ref_idx = 0;
int x_local = (x&0x3f), y_local = (y&0x3f);
int x_cu = x>>3;
int y_cu = y>>3;
@ -427,7 +427,7 @@ static int search_cu_inter(encoder_control *encoder, int x, int y, int depth, lc
for(merge_idx = 0; merge_idx < num_cand; merge_idx++) {
if (merge_cand[merge_idx][0] == mv.x &&
merge_cand[merge_idx][1] == mv.y &&
merge_cand[merge_idx][2] == ref_idx) {
(uint32_t)merge_cand[merge_idx][2] == ref_idx) {
merged = 1;
break;
}
@ -699,9 +699,9 @@ static int search_cu_intra(encoder_control *encoder,
// Find best intra mode for 2Nx2N.
{
uint32_t cost = -1;
uint32_t cost = UINT32_MAX;
int16_t mode = -1;
uint32_t bitcost = -1;
uint32_t bitcost = UINT32_MAX;
pixel *ref_pixels = &lcu->ref.y[lcu_px.x + lcu_px.y * LCU_WIDTH];
unsigned pu_index = PU_INDEX(x_px >> 2, y_px >> 2);
mode = intra_prediction(ref_pixels, LCU_WIDTH,