This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new 7379539685 avcodec/prores_raw: use av_popcount instead of limited
lookup table
7379539685 is described below
commit 7379539685ec900b372d87ad25a23e82b8b45f17
Author: Timo Rothenpieler <[email protected]>
AuthorDate: Sun Jan 18 18:52:52 2026 +0100
Commit: Timo Rothenpieler <[email protected]>
CommitDate: Sun Jan 18 18:52:55 2026 +0100
avcodec/prores_raw: use av_popcount instead of limited lookup table
The calculation can yield bigger values than the lookup table provides.
So just use actual popcount instead.
Fixes #21503
---
libavcodec/prores_raw.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/libavcodec/prores_raw.c b/libavcodec/prores_raw.c
index 8be566ed36..eb1a9af14f 100644
--- a/libavcodec/prores_raw.c
+++ b/libavcodec/prores_raw.c
@@ -93,10 +93,6 @@ static uint16_t get_value(GetBitContext *gb, int16_t
codebook)
#define TODCCODEBOOK(x) ((x + 1) >> 1)
-static const uint8_t align_tile_w[16] = {
- 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,
-};
-
#define DC_CB_MAX 12
const uint8_t ff_prores_raw_dc_cb[DC_CB_MAX + 1] = {
0x010, 0x021, 0x032, 0x033, 0x033, 0x033, 0x044, 0x044, 0x044, 0x044,
0x044, 0x044, 0x076,
@@ -432,7 +428,7 @@ static int decode_frame(AVCodecContext *avctx,
s->nb_tw = (w + 15) >> 4;
s->nb_th = (h + 15) >> 4;
- s->nb_tw = (s->nb_tw >> align) + align_tile_w[~(-1 * (1 << align)) &
s->nb_tw];
+ s->nb_tw = (s->nb_tw >> align) + av_popcount(~(-1 * (1 << align)) &
s->nb_tw);
s->nb_tiles = s->nb_tw * s->nb_th;
av_log(avctx, AV_LOG_DEBUG, "%dx%d | nb_tiles: %d\n", s->nb_tw, s->nb_th,
s->nb_tiles);
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]