Moved reference list printing to encoder_compute_stats()

This commit is contained in:
Marko Viitanen 2015-03-26 14:38:39 +02:00
parent 2243d139bf
commit 815e0b8897
2 changed files with 27 additions and 7 deletions

View file

@ -604,7 +604,6 @@ void encoder_state_write_bitstream_slice_header(encoder_state_t * const state)
WRITE_U(stream, 0, 1, "short_term_ref_pic_set_sps_flag");
WRITE_UE(stream, ref_negative, "num_negative_pics");
WRITE_UE(stream, ref_positive, "num_positive_pics");
fprintf(stderr, "\nPOC: %d [L0 ", state->global->poc);
for (j = 0; j < ref_negative; j++) {
int8_t delta_poc = 0;
@ -629,9 +628,7 @@ void encoder_state_write_bitstream_slice_header(encoder_state_t * const state)
WRITE_UE(stream, state->encoder_control->cfg->gop_len?delta_poc - last_poc - 1:0, "delta_poc_s0_minus1");
last_poc = delta_poc;
WRITE_U(stream,1,1, "used_by_curr_pic_s0_flag");
fprintf(stderr, "%d ", state->global->poc - (delta_poc));
}
fprintf(stderr, "] [L1 ");
last_poc = 0;
poc_shift = 0;
for (j = 0; j < ref_positive; j++) {
@ -654,14 +651,11 @@ void encoder_state_write_bitstream_slice_header(encoder_state_t * const state)
}
} while (!found);
}
fprintf(stderr, "%d ", state->global->poc + delta_poc);
WRITE_UE(stream, state->encoder_control->cfg->gop_len ? delta_poc - last_poc - 1 : 0, "delta_poc_s1_minus1");
last_poc = delta_poc;
WRITE_U(stream, 1, 1, "used_by_curr_pic_s1_flag");
}
fprintf(stderr, "]\n");
//WRITE_UE(stream, 0, "short_term_ref_pic_set_idx");
}

View file

@ -1080,11 +1080,37 @@ void encoder_compute_stats(encoder_state_t *state, FILE * const recout, uint32_t
videoframe_compute_psnr(state->tile->frame, temp_psnr);
fprintf(stderr, "POC %4d QP %2d (%c-frame) %10d bits PSNR: %2.4f %2.4f %2.4f\n", state->global->poc,
fprintf(stderr, "POC %4d QP %2d (%c-frame) %10d bits PSNR: %2.4f %2.4f %2.4f", state->global->poc,
state->global->QP,
"BPI"[state->global->slicetype%3], state->stats_bitstream_length<<3,
temp_psnr[0], temp_psnr[1], temp_psnr[2]);
// Print reference picture lists
if (state->global->slicetype != SLICE_I) {
int j, ref_list[2] = { 0, 0 }, ref_list_poc[2][16];
// List all pocs of lists
for (j = 0; j < state->global->ref->used_size; j++) {
if (state->global->ref->images[j]->poc < state->global->poc) {
ref_list_poc[0][ref_list[0]] = state->global->ref->images[j]->poc;
ref_list[0]++;
} else {
ref_list_poc[1][ref_list[1]] = state->global->ref->images[j]->poc;
ref_list[1]++;
}
}
encoder_ref_insertion_sort(ref_list_poc[0], ref_list[0]);
encoder_ref_insertion_sort(ref_list_poc[1], ref_list[1]);
fprintf(stderr, " [L0 ");
for (j = ref_list[0]-1; j >= 0; j--) {
fprintf(stderr, "%d ", ref_list_poc[0][j]);
}
fprintf(stderr, "] [L1 ");
for (j = 0; j < ref_list[1]; j++) {
fprintf(stderr, "%d ", ref_list_poc[1][j]);
}
fprintf(stderr, "]");
}
fprintf(stderr, "\n");
// Increment total PSNR
psnr[0] += temp_psnr[0];
psnr[1] += temp_psnr[1];