Created
June 9, 2025 18:05
-
-
Save MarsMSJ/fbbb571a523bf82de12530e5a2a71b94 to your computer and use it in GitHub Desktop.
HEVC / AVC Frame Slice Shenanigans
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct{ | |
uint64_t frame_slice_number; | |
uint64_t frame_number; | |
uint64_t slices_per_frame; | |
bool is_frame_first_slice; | |
} SlicePrintInfo; | |
typedef struct{ | |
uint64_t slices_decoded; | |
uint64_t slices_received; | |
uint64_t frames_submitted; | |
uint64_t slices_per_frame; | |
} InputStruct; | |
static void fill_slice_print_info(InputStruct *ptr_input_struct, SlicePrintInfo *ptr_slice_print_info) | |
{ | |
uint64_t slice_idx = ptr_input_struct->slices_decoded; | |
uint64_t slices_per_frame = ptr_input_struct->slices_per_frame; | |
ptr_slice_print_info->frame_number = ((slice_idx) / slices_per_frame)+ 1; | |
ptr_slice_print_info->frame_slice_number = (slice_idx % slices_per_frame) + 1; | |
ptr_slice_print_info->is_frame_first_slice = ptr_slice_print_info->frame_slice_number == 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment