This commit is contained in:
Ari Koivula 2015-06-03 17:36:49 +03:00 committed by Arttu Ylä-Outinen
parent 5c28745457
commit 4f4b62b13c
2 changed files with 5 additions and 3 deletions

View file

@ -323,7 +323,6 @@ int main(int argc, char *argv[])
int first_enc = current_encoder_state; int first_enc = current_encoder_state;
do { do {
double frame_psnr[3] = { 0.0, 0.0, 0.0 }; double frame_psnr[3] = { 0.0, 0.0, 0.0 };
current_encoder_state = (current_encoder_state + 1) % (encoder.owf + 1);
encoder_state_t *state = &encoder_states[current_encoder_state]; encoder_state_t *state = &encoder_states[current_encoder_state];
if (!state->stats_done) { if (!state->stats_done) {
@ -334,6 +333,8 @@ int main(int argc, char *argv[])
psnr_sum[1] += frame_psnr[1]; psnr_sum[1] += frame_psnr[1];
psnr_sum[2] += frame_psnr[2]; psnr_sum[2] += frame_psnr[2];
} }
current_encoder_state = (current_encoder_state + 1) % (encoder.owf + 1);
} while (current_encoder_state != first_enc); } while (current_encoder_state != first_enc);
} }

View file

@ -844,6 +844,7 @@ void encode_one_frame(encoder_state_t * const state)
char* job_description = NULL; char* job_description = NULL;
#endif #endif
state->stats_done = 0;
job = threadqueue_submit(state->encoder_control->threadqueue, encoder_state_worker_write_bitstream, (void*) state, 1, job_description); job = threadqueue_submit(state->encoder_control->threadqueue, encoder_state_worker_write_bitstream, (void*) state, 1, job_description);
_encode_one_frame_add_bitstream_deps(state, job); _encode_one_frame_add_bitstream_deps(state, job);
@ -1058,7 +1059,7 @@ void encoder_next_frame(encoder_state_t *state) {
//Blocking call //Blocking call
threadqueue_waitfor(encoder->threadqueue, state->tqj_bitstream_written); threadqueue_waitfor(encoder->threadqueue, state->tqj_bitstream_written);
state->stats_done = 0; state->stats_done = 1;
if (state->global->frame == -1) { if (state->global->frame == -1) {
//We're at the first frame, so don't care about all this stuff; //We're at the first frame, so don't care about all this stuff;