diff options
author | Anton Khirnov <anton@khirnov.net> | 2024-04-10 11:27:51 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2024-05-31 19:26:06 +0200 |
commit | 9127819d514a3a82031f7448b40714f2880d7804 (patch) | |
tree | fb49e5cfa8d17c34c9a99bf9ef9435c4420c2ac2 /libavcodec/hevc_refs.c | |
parent | d8936678673d05410b3462c41dba190cc5e23705 (diff) | |
download | ffmpeg-9127819d514a3a82031f7448b40714f2880d7804.tar.gz |
lavc/hevc_ps: reduce the size of ShortTermRPS.used
It is currently an array of 32 uint8_t, each storing a single flag. A
single uint32_t is sufficient.
Reduces sizeof(HEVCSPS) by 1792 bytes.
Diffstat (limited to 'libavcodec/hevc_refs.c')
-rw-r--r-- | libavcodec/hevc_refs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/hevc_refs.c b/libavcodec/hevc_refs.c index 8da9ec982a..d6dc2f9e0a 100644 --- a/libavcodec/hevc_refs.c +++ b/libavcodec/hevc_refs.c @@ -497,7 +497,7 @@ int ff_hevc_frame_rps(HEVCContext *s) int poc = s->poc + short_rps->delta_poc[i]; int list; - if (!short_rps->used[i]) + if (!(short_rps->used & (1 << i))) list = ST_FOLL; else if (i < short_rps->num_negative_pics) list = ST_CURR_BEF; @@ -536,9 +536,9 @@ int ff_hevc_frame_nb_refs(const HEVCContext *s) if (rps) { for (i = 0; i < rps->num_negative_pics; i++) - ret += !!rps->used[i]; + ret += !!(rps->used & (1 << i)); for (; i < rps->num_delta_pocs; i++) - ret += !!rps->used[i]; + ret += !!(rps->used & (1 << i)); } if (long_rps) { |