Skip to content

Commit

Permalink
feat: removed atomicity requirements on processed frames
Browse files Browse the repository at this point in the history
Signed-off-by: k4yt3x <[email protected]>
  • Loading branch information
k4yt3x committed Oct 9, 2024
1 parent b230010 commit 60de0ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions include/libvideo2x.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef LIBVIDEO2X_H
#define LIBVIDEO2X_H

#include <stdatomic.h>
#include <stdbool.h>
#include <stdint.h>
#include <time.h>
Expand Down Expand Up @@ -66,7 +65,7 @@ struct EncoderConfig {

// Processing status
struct ProcessingStatus {
atomic_int_fast64_t processed_frames;
int64_t processed_frames;
int64_t total_frames;
time_t start_time;
bool completed;
Expand Down
4 changes: 2 additions & 2 deletions src/video2x.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ int main(int argc, char **argv) {
while (!status.completed) {
printf(
"\r[Video2X] Processing frame %ld/%ld (%.2f%%); time elapsed: %lds",
atomic_load(&status.processed_frames),
status.processed_frames,
status.total_frames,
status.processed_frames * 100.0 / status.total_frames,
time(NULL) - status.start_time
Expand All @@ -428,7 +428,7 @@ int main(int argc, char **argv) {

// Calculate statistics
time_t time_elapsed = time(NULL) - status.start_time;
float average_speed_fps = (float)atomic_load(&status.processed_frames) / time_elapsed;
float average_speed_fps = (float)status.processed_frames / time_elapsed;

// Print processing summary
if (arguments.benchmark) {
Expand Down

0 comments on commit 60de0ff

Please sign in to comment.