[FFmpeg-cvslog] avcodec: use the renamed av_zero_extend
James Almer
git at videolan.org
Fri Jun 14 02:38:23 EEST 2024
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue Jun 11 13:50:07 2024 -0300| [1b9af306da36a9e5b2e786b07cad50c5ba8c203f] | committer: James Almer
avcodec: use the renamed av_zero_extend
Signed-off-by: James Almer <jamrial at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1b9af306da36a9e5b2e786b07cad50c5ba8c203f
---
libavcodec/adpcm.c | 2 +-
libavcodec/amrwbdec.c | 2 +-
libavcodec/atrac3plus.c | 2 +-
libavcodec/dnxhdenc.c | 2 +-
libavcodec/dvenc.c | 2 +-
libavcodec/ffv1dec_template.c | 2 +-
libavcodec/g726.c | 2 +-
libavcodec/g729dec.c | 2 +-
libavcodec/h264_refs.c | 2 +-
libavcodec/h264_slice.c | 4 ++--
libavcodec/hevc/cabac.c | 4 ++--
libavcodec/hevc/hevcdec.c | 20 ++++++++++----------
libavcodec/hevc/mvs.c | 4 ++--
libavcodec/hevc/pred_template.c | 4 ++--
libavcodec/hevc/ps.c | 4 ++--
libavcodec/mpeg12enc.c | 8 ++++----
libavcodec/opus_pvq.c | 4 ++--
libavcodec/opus_rc.c | 6 +++---
libavcodec/pixlet.c | 4 ++--
libavcodec/pngdec.c | 2 +-
libavcodec/proresenc_anatoliy.c | 2 +-
libavcodec/proresenc_kostya.c | 4 ++--
libavcodec/put_bits.h | 2 +-
libavcodec/put_golomb.h | 2 +-
libavcodec/speedhqenc.c | 8 ++++----
libavcodec/vulkan_hevc.c | 2 +-
libavcodec/vvc/cabac.c | 8 ++++----
libavcodec/vvc/ctu.c | 8 ++++----
libavcodec/vvc/inter.c | 18 +++++++++---------
libavcodec/vvc/inter_template.c | 8 ++++----
libavcodec/vvc/intra_template.c | 2 +-
libavcodec/vvc/intra_utils.c | 4 ++--
libavcodec/vvc/mvs.c | 2 +-
33 files changed, 76 insertions(+), 76 deletions(-)
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 59b9ef3497..f63afefd63 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -493,7 +493,7 @@ static inline int16_t adpcm_ima_wav_expand_nibble(ADPCMChannelStatus *c, GetBitC
step_index = av_clip(step_index, 0, 88);
sign = nibble & (1 << shift);
- delta = av_mod_uintp2(nibble, shift);
+ delta = av_zero_extend(nibble, shift);
diff = ((2 * delta + 1) * step) >> shift;
predictor = c->predictor;
if (sign) predictor -= diff;
diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
index 21a730b835..bb0864587a 100644
--- a/libavcodec/amrwbdec.c
+++ b/libavcodec/amrwbdec.c
@@ -370,7 +370,7 @@ static void decode_pitch_vector(AMRWBContext *ctx,
}
/** Get x bits in the index interval [lsb,lsb+len-1] inclusive */
-#define BIT_STR(x,lsb,len) av_mod_uintp2((x) >> (lsb), (len))
+#define BIT_STR(x,lsb,len) av_zero_extend((x) >> (lsb), (len))
/** Get the bit at specified position */
#define BIT_POS(x, p) (((x) >> (p)) & 1)
diff --git a/libavcodec/atrac3plus.c b/libavcodec/atrac3plus.c
index 61753af73e..f17ed0cbb5 100644
--- a/libavcodec/atrac3plus.c
+++ b/libavcodec/atrac3plus.c
@@ -734,7 +734,7 @@ static void decode_qu_spectra(GetBitContext *gb, const Atrac3pSpecCodeTab *tab,
val = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
for (i = 0; i < num_coeffs; i++) {
- cf = av_mod_uintp2(val, bits);
+ cf = av_zero_extend(val, bits);
if (is_signed)
cf = sign_extend(cf, bits);
else if (cf && get_bits1(gb))
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index 8b67becbe2..62612ef6d2 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -567,7 +567,7 @@ static av_always_inline void dnxhd_encode_dc(PutBitContext *pb, DNXHDEncContext
}
put_bits(pb, ctx->cid_table->dc_bits[nbits] + nbits,
(ctx->cid_table->dc_codes[nbits] << nbits) +
- av_mod_uintp2(diff, nbits));
+ av_zero_extend(diff, nbits));
}
static av_always_inline
diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c
index 3afeedbb87..71f9b71c7b 100644
--- a/libavcodec/dvenc.c
+++ b/libavcodec/dvenc.c
@@ -215,7 +215,7 @@ static av_always_inline PutBitContext *dv_encode_ac(EncBlockInfo *bi,
if (bits_left) {
size -= bits_left;
put_bits(pb, bits_left, vlc >> size);
- vlc = av_mod_uintp2(vlc, size);
+ vlc = av_zero_extend(vlc, size);
}
if (pb + 1 >= pb_end) {
bi->partial_bit_count = size;
diff --git a/libavcodec/ffv1dec_template.c b/libavcodec/ffv1dec_template.c
index 590ccac022..a90c28cd0e 100644
--- a/libavcodec/ffv1dec_template.c
+++ b/libavcodec/ffv1dec_template.c
@@ -121,7 +121,7 @@ static av_always_inline int RENAME(decode_line)(FFV1Context *s, int w,
if (sign)
diff = -(unsigned)diff;
- sample[1][x] = av_mod_uintp2(RENAME(predict)(sample[1] + x, sample[0] + x) + (SUINT)diff, bits);
+ sample[1][x] = av_zero_extend(RENAME(predict)(sample[1] + x, sample[0] + x) + (SUINT)diff, bits);
}
s->run_index = run_index;
return 0;
diff --git a/libavcodec/g726.c b/libavcodec/g726.c
index 6c5638760d..e048cd973e 100644
--- a/libavcodec/g726.c
+++ b/libavcodec/g726.c
@@ -302,7 +302,7 @@ static int16_t g726_encode(G726Context* c, int16_t sig)
{
uint8_t i;
- i = av_mod_uintp2(quant(c, sig/4 - c->se), c->code_size);
+ i = av_zero_extend(quant(c, sig/4 - c->se), c->code_size);
g726_decode(c, i);
return i;
}
diff --git a/libavcodec/g729dec.c b/libavcodec/g729dec.c
index 3e1be326d0..bf10a6dd33 100644
--- a/libavcodec/g729dec.c
+++ b/libavcodec/g729dec.c
@@ -536,7 +536,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
if (frame_erasure) {
ctx->rand_value = g729_prng(ctx->rand_value);
- fc_indexes = av_mod_uintp2(ctx->rand_value, format->fc_indexes_bits);
+ fc_indexes = av_zero_extend(ctx->rand_value, format->fc_indexes_bits);
ctx->rand_value = g729_prng(ctx->rand_value);
pulses_signs = ctx->rand_value;
diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c
index 99820142b9..5eb2855065 100644
--- a/libavcodec/h264_refs.c
+++ b/libavcodec/h264_refs.c
@@ -791,7 +791,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h)
for (int i = 0; i < h->short_ref_count; i++) {
H264Picture *pic = h->short_ref[i];
if (pic->invalid_gap) {
- int d = av_mod_uintp2(h->cur_pic_ptr->frame_num - pic->frame_num, h->ps.sps->log2_max_frame_num);
+ int d = av_zero_extend(h->cur_pic_ptr->frame_num - pic->frame_num, h->ps.sps->log2_max_frame_num);
if (d > h->ps.sps->ref_frame_count)
remove_short(h, pic->frame_num, 0);
}
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index ce2c4caca1..a66b75ca80 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1637,8 +1637,8 @@ static int h264_field_start(H264Context *h, const H264SliceContext *sl,
h->valid_recovery_point = 1;
if ( h->recovery_frame < 0
- || av_mod_uintp2(h->recovery_frame - h->poc.frame_num, h->ps.sps->log2_max_frame_num) > sei_recovery_frame_cnt) {
- h->recovery_frame = av_mod_uintp2(h->poc.frame_num + sei_recovery_frame_cnt, h->ps.sps->log2_max_frame_num);
+ || av_zero_extend(h->recovery_frame - h->poc.frame_num, h->ps.sps->log2_max_frame_num) > sei_recovery_frame_cnt) {
+ h->recovery_frame = av_zero_extend(h->poc.frame_num + sei_recovery_frame_cnt, h->ps.sps->log2_max_frame_num);
if (!h->valid_recovery_point)
h->recovery_frame = h->poc.frame_num;
diff --git a/libavcodec/hevc/cabac.c b/libavcodec/hevc/cabac.c
index 39ca7c0135..33f8241bb3 100644
--- a/libavcodec/hevc/cabac.c
+++ b/libavcodec/hevc/cabac.c
@@ -642,8 +642,8 @@ int ff_hevc_split_coding_unit_flag_decode(HEVCLocalContext *lc, const HEVCSPS *s
{
const HEVCContext *const s = lc->parent;
int inc = 0, depth_left = 0, depth_top = 0;
- int x0b = av_mod_uintp2(x0, sps->log2_ctb_size);
- int y0b = av_mod_uintp2(y0, sps->log2_ctb_size);
+ int x0b = av_zero_extend(x0, sps->log2_ctb_size);
+ int y0b = av_zero_extend(y0, sps->log2_ctb_size);
int x_cb = x0 >> sps->log2_min_cb_size;
int y_cb = y0 >> sps->log2_min_cb_size;
diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index 4b95358b95..1d2e53afc3 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -1679,8 +1679,8 @@ static void chroma_mc_uni(HEVCLocalContext *lc,
int idx = hevc_pel_weight[block_w];
int hshift = sps->hshift[1];
int vshift = sps->vshift[1];
- intptr_t mx = av_mod_uintp2(mv->x, 2 + hshift);
- intptr_t my = av_mod_uintp2(mv->y, 2 + vshift);
+ intptr_t mx = av_zero_extend(mv->x, 2 + hshift);
+ intptr_t my = av_zero_extend(mv->y, 2 + vshift);
intptr_t _mx = mx << (1 - hshift);
intptr_t _my = my << (1 - vshift);
int emu = src0 == s->cur_frame->f->data[1] || src0 == s->cur_frame->f->data[2];
@@ -1753,10 +1753,10 @@ static void chroma_mc_bi(HEVCLocalContext *lc,
int hshift = sps->hshift[1];
int vshift = sps->vshift[1];
- intptr_t mx0 = av_mod_uintp2(mv0->x, 2 + hshift);
- intptr_t my0 = av_mod_uintp2(mv0->y, 2 + vshift);
- intptr_t mx1 = av_mod_uintp2(mv1->x, 2 + hshift);
- intptr_t my1 = av_mod_uintp2(mv1->y, 2 + vshift);
+ intptr_t mx0 = av_zero_extend(mv0->x, 2 + hshift);
+ intptr_t my0 = av_zero_extend(mv0->y, 2 + vshift);
+ intptr_t mx1 = av_zero_extend(mv1->x, 2 + hshift);
+ intptr_t my1 = av_zero_extend(mv1->y, 2 + vshift);
intptr_t _mx0 = mx0 << (1 - hshift);
intptr_t _my0 = my0 << (1 - vshift);
intptr_t _mx1 = mx1 << (1 - hshift);
@@ -2020,8 +2020,8 @@ static int luma_intra_pred_mode(HEVCLocalContext *lc, const HEVCSPS *sps,
int y_pu = y0 >> sps->log2_min_pu_size;
int min_pu_width = sps->min_pu_width;
int size_in_pus = pu_size >> sps->log2_min_pu_size;
- int x0b = av_mod_uintp2(x0, sps->log2_ctb_size);
- int y0b = av_mod_uintp2(y0, sps->log2_ctb_size);
+ int x0b = av_zero_extend(x0, sps->log2_ctb_size);
+ int y0b = av_zero_extend(y0, sps->log2_ctb_size);
int cand_up = (lc->ctb_up_flag || y0b) ?
s->tab_ipm[(y_pu - 1) * min_pu_width + x_pu] : INTRA_DC;
@@ -2233,8 +2233,8 @@ static int hls_coding_unit(HEVCLocalContext *lc, const HEVCContext *s,
lc->cu.cu_transquant_bypass_flag = 0;
if (s->sh.slice_type != HEVC_SLICE_I) {
- const int x0b = av_mod_uintp2(x0, sps->log2_ctb_size);
- const int y0b = av_mod_uintp2(y0, sps->log2_ctb_size);
+ const int x0b = av_zero_extend(x0, sps->log2_ctb_size);
+ const int y0b = av_zero_extend(y0, sps->log2_ctb_size);
uint8_t skip_flag = ff_hevc_skip_flag_decode(lc, x0b, y0b, x_cb, y_cb,
min_cb_width);
diff --git a/libavcodec/hevc/mvs.c b/libavcodec/hevc/mvs.c
index 772fedceeb..96d8d58f39 100644
--- a/libavcodec/hevc/mvs.c
+++ b/libavcodec/hevc/mvs.c
@@ -43,8 +43,8 @@ static const uint8_t l0_l1_cand_idx[12][2] = {
void ff_hevc_set_neighbour_available(HEVCLocalContext *lc, int x0, int y0,
int nPbW, int nPbH, int log2_ctb_size)
{
- int x0b = av_mod_uintp2(x0, log2_ctb_size);
- int y0b = av_mod_uintp2(y0, log2_ctb_size);
+ int x0b = av_zero_extend(x0, log2_ctb_size);
+ int y0b = av_zero_extend(y0, log2_ctb_size);
lc->na.cand_up = (lc->ctb_up_flag || y0b);
lc->na.cand_left = (lc->ctb_left_flag || x0b);
diff --git a/libavcodec/hevc/pred_template.c b/libavcodec/hevc/pred_template.c
index ca21774f75..b4c2fcf506 100644
--- a/libavcodec/hevc/pred_template.c
+++ b/libavcodec/hevc/pred_template.c
@@ -121,8 +121,8 @@ do { \
if (pps->constrained_intra_pred_flag == 1) {
int size_in_luma_pu_v = PU(size_in_luma_v);
int size_in_luma_pu_h = PU(size_in_luma_h);
- int on_pu_edge_x = !av_mod_uintp2(x0, sps->log2_min_pu_size);
- int on_pu_edge_y = !av_mod_uintp2(y0, sps->log2_min_pu_size);
+ int on_pu_edge_x = !av_zero_extend(x0, sps->log2_min_pu_size);
+ int on_pu_edge_y = !av_zero_extend(y0, sps->log2_min_pu_size);
if (!size_in_luma_pu_h)
size_in_luma_pu_h++;
if (cand_bottom_left == 1 && on_pu_edge_x) {
diff --git a/libavcodec/hevc/ps.c b/libavcodec/hevc/ps.c
index c02fc8b6c3..80ac35a7db 100644
--- a/libavcodec/hevc/ps.c
+++ b/libavcodec/hevc/ps.c
@@ -1258,8 +1258,8 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
sps->qp_bd_offset = 6 * (sps->bit_depth - 8);
- if (av_mod_uintp2(sps->width, sps->log2_min_cb_size) ||
- av_mod_uintp2(sps->height, sps->log2_min_cb_size)) {
+ if (av_zero_extend(sps->width, sps->log2_min_cb_size) ||
+ av_zero_extend(sps->height, sps->log2_min_cb_size)) {
av_log(avctx, AV_LOG_ERROR, "Invalid coded frame dimensions.\n");
return AVERROR_INVALIDDATA;
}
diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c
index ba56f0c37a..140fda4bc2 100644
--- a/libavcodec/mpeg12enc.c
+++ b/libavcodec/mpeg12enc.c
@@ -692,12 +692,12 @@ static inline void encode_dc(MpegEncContext *s, int diff, int component)
put_bits(&s->pb,
ff_mpeg12_vlc_dc_lum_bits[index] + index,
(ff_mpeg12_vlc_dc_lum_code[index] << index) +
- av_mod_uintp2(diff, index));
+ av_zero_extend(diff, index));
else
put_bits(&s->pb,
ff_mpeg12_vlc_dc_chroma_bits[index] + index,
(ff_mpeg12_vlc_dc_chroma_code[index] << index) +
- av_mod_uintp2(diff, index));
+ av_zero_extend(diff, index));
} else {
if (component == 0)
put_bits(&s->pb,
@@ -1098,12 +1098,12 @@ static av_cold void mpeg12_encode_init_static(void)
bits = ff_mpeg12_vlc_dc_lum_bits[index] + index;
code = (ff_mpeg12_vlc_dc_lum_code[index] << index) +
- av_mod_uintp2(diff, index);
+ av_zero_extend(diff, index);
mpeg1_lum_dc_uni[i + 255] = bits + (code << 8);
bits = ff_mpeg12_vlc_dc_chroma_bits[index] + index;
code = (ff_mpeg12_vlc_dc_chroma_code[index] << index) +
- av_mod_uintp2(diff, index);
+ av_zero_extend(diff, index);
mpeg1_chr_dc_uni[i + 255] = bits + (code << 8);
}
diff --git a/libavcodec/opus_pvq.c b/libavcodec/opus_pvq.c
index 554a72609f..b16916fbfb 100644
--- a/libavcodec/opus_pvq.c
+++ b/libavcodec/opus_pvq.c
@@ -663,7 +663,7 @@ static av_always_inline uint32_t quant_band_template(CeltPVQ *pvq, CeltFrame *f,
if (itheta == 0) {
imid = 32767;
iside = 0;
- fill = av_mod_uintp2(fill, blocks);
+ fill = av_zero_extend(fill, blocks);
delta = -16384;
} else if (itheta == 16384) {
imid = 0;
@@ -878,7 +878,7 @@ static av_always_inline uint32_t quant_band_template(CeltPVQ *pvq, CeltFrame *f,
for (i = 0; i < N0; i++)
lowband_out[i] = n * X[i];
}
- cm = av_mod_uintp2(cm, blocks);
+ cm = av_zero_extend(cm, blocks);
}
return cm;
diff --git a/libavcodec/opus_rc.c b/libavcodec/opus_rc.c
index 031332c9ce..0687e9e779 100644
--- a/libavcodec/opus_rc.c
+++ b/libavcodec/opus_rc.c
@@ -147,7 +147,7 @@ uint32_t ff_opus_rc_get_raw(OpusRangeCoder *rc, uint32_t count)
rc->rb.bytes--;
}
- value = av_mod_uintp2(rc->rb.cacheval, count);
+ value = av_zero_extend(rc->rb.cacheval, count);
rc->rb.cacheval >>= count;
rc->rb.cachelen -= count;
rc->total_bits += count;
@@ -163,7 +163,7 @@ void ff_opus_rc_put_raw(OpusRangeCoder *rc, uint32_t val, uint32_t count)
const int to_write = FFMIN(32 - rc->rb.cachelen, count);
rc->total_bits += count;
- rc->rb.cacheval |= av_mod_uintp2(val, to_write) << rc->rb.cachelen;
+ rc->rb.cacheval |= av_zero_extend(val, to_write) << rc->rb.cachelen;
rc->rb.cachelen = (rc->rb.cachelen + to_write) % 32;
if (!rc->rb.cachelen && count) {
@@ -171,7 +171,7 @@ void ff_opus_rc_put_raw(OpusRangeCoder *rc, uint32_t val, uint32_t count)
rc->rb.bytes += 4;
rc->rb.position -= 4;
rc->rb.cachelen = count - to_write;
- rc->rb.cacheval = av_mod_uintp2(val >> to_write, rc->rb.cachelen);
+ rc->rb.cacheval = av_zero_extend(val >> to_write, rc->rb.cachelen);
av_assert0(rc->rng_cur < rc->rb.position);
}
}
diff --git a/libavcodec/pixlet.c b/libavcodec/pixlet.c
index b3baaf6260..6b6e39f275 100644
--- a/libavcodec/pixlet.c
+++ b/libavcodec/pixlet.c
@@ -162,7 +162,7 @@ static int read_low_coeffs(AVCodecContext *avctx, int16_t *dst, int size,
continue;
nbits = ((state + 8) >> 5) + (state ? ff_clz(state) : 32) - 24;
- escape = av_mod_uintp2(16383, nbits);
+ escape = av_zero_extend(16383, nbits);
cnt1 = get_unary(bc, 0, 8);
if (cnt1 > 7) {
rlen = get_bits(bc, 16);
@@ -269,7 +269,7 @@ static int read_high_coeffs(AVCodecContext *avctx, const uint8_t *src, int16_t *
continue;
pfx = ((state + 8) >> 5) + (state ? ff_clz(state) : 32) - 24;
- escape = av_mod_uintp2(16383, pfx);
+ escape = av_zero_extend(16383, pfx);
cnt1 = get_unary(bc, 0, 8);
if (cnt1 < 8) {
if (pfx < 1 || pfx > 25)
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 8934a95a7f..1c910e6a5b 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -1018,7 +1018,7 @@ static int decode_trns_chunk(AVCodecContext *avctx, PNGDecContext *s,
for (i = 0; i < length / 2; i++) {
/* only use the least significant bits */
- v = av_mod_uintp2(bytestream2_get_be16(gb), s->bit_depth);
+ v = av_zero_extend(bytestream2_get_be16(gb), s->bit_depth);
if (s->bit_depth > 8)
AV_WB16(&s->transparent_color_be[2 * i], v);
diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index 8709f400d0..2300301af9 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -415,7 +415,7 @@ static void put_alpha_diff(PutBitContext *pb, int cur, int prev)
const int dsize = 1 << dbits - 1;
int diff = cur - prev;
- diff = av_mod_uintp2(diff, abits);
+ diff = av_zero_extend(diff, abits);
if (diff >= (1 << abits) - dsize)
diff -= 1 << abits;
if (diff < -dsize || diff > dsize || !diff) {
diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c
index b2b5f880ae..8b91ca1a98 100644
--- a/libavcodec/proresenc_kostya.c
+++ b/libavcodec/proresenc_kostya.c
@@ -477,7 +477,7 @@ static void put_alpha_diff(PutBitContext *pb, int cur, int prev, int abits)
const int dsize = 1 << dbits - 1;
int diff = cur - prev;
- diff = av_mod_uintp2(diff, abits);
+ diff = av_zero_extend(diff, abits);
if (diff >= (1 << abits) - dsize)
diff -= 1 << abits;
if (diff < -dsize || diff > dsize || !diff) {
@@ -721,7 +721,7 @@ static int est_alpha_diff(int cur, int prev, int abits)
const int dsize = 1 << dbits - 1;
int diff = cur - prev;
- diff = av_mod_uintp2(diff, abits);
+ diff = av_zero_extend(diff, abits);
if (diff >= (1 << abits) - dsize)
diff -= 1 << abits;
if (diff < -dsize || diff > dsize || !diff)
diff --git a/libavcodec/put_bits.h b/libavcodec/put_bits.h
index 4561dc131a..0caaa6b338 100644
--- a/libavcodec/put_bits.h
+++ b/libavcodec/put_bits.h
@@ -282,7 +282,7 @@ static inline void put_sbits(PutBitContext *pb, int n, int32_t value)
{
av_assert2(n >= 0 && n <= 31);
- put_bits(pb, n, av_mod_uintp2(value, n));
+ put_bits(pb, n, av_zero_extend(value, n));
}
/**
diff --git a/libavcodec/put_golomb.h b/libavcodec/put_golomb.h
index df47fd2c0a..43c1233fdb 100644
--- a/libavcodec/put_golomb.h
+++ b/libavcodec/put_golomb.h
@@ -103,7 +103,7 @@ static inline void set_ur_golomb(PutBitContext *pb, int i, int k, int limit,
e = i >> k;
if (e < limit)
- put_bits(pb, e + k + 1, (1 << k) + av_mod_uintp2(i, k));
+ put_bits(pb, e + k + 1, (1 << k) + av_zero_extend(i, k));
else
put_bits(pb, limit + esc_len, i - limit + 1);
}
diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c
index 39ed244bca..4995b19f3b 100644
--- a/libavcodec/speedhqenc.c
+++ b/libavcodec/speedhqenc.c
@@ -82,12 +82,12 @@ static av_cold void speedhq_init_static_data(void)
bits = ff_mpeg12_vlc_dc_lum_bits[index] + index;
code = mpeg12_vlc_dc_lum_code_reversed[index] +
- (av_mod_uintp2(diff, index) << ff_mpeg12_vlc_dc_lum_bits[index]);
+ (av_zero_extend(diff, index) << ff_mpeg12_vlc_dc_lum_bits[index]);
speedhq_lum_dc_uni[i + 255] = bits + (code << 8);
bits = ff_mpeg12_vlc_dc_chroma_bits[index] + index;
code = mpeg12_vlc_dc_chroma_code_reversed[index] +
- (av_mod_uintp2(diff, index) << ff_mpeg12_vlc_dc_chroma_bits[index]);
+ (av_zero_extend(diff, index) << ff_mpeg12_vlc_dc_chroma_bits[index]);
speedhq_chr_dc_uni[i + 255] = bits + (code << 8);
}
@@ -182,12 +182,12 @@ static inline void encode_dc(PutBitContext *pb, int diff, int component)
put_bits_le(pb,
ff_mpeg12_vlc_dc_lum_bits[index] + index,
mpeg12_vlc_dc_lum_code_reversed[index] +
- (av_mod_uintp2(diff, index) << ff_mpeg12_vlc_dc_lum_bits[index]));
+ (av_zero_extend(diff, index) << ff_mpeg12_vlc_dc_lum_bits[index]));
else
put_bits_le(pb,
ff_mpeg12_vlc_dc_chroma_bits[index] + index,
mpeg12_vlc_dc_chroma_code_reversed[index] +
- (av_mod_uintp2(diff, index) << ff_mpeg12_vlc_dc_chroma_bits[index]));
+ (av_zero_extend(diff, index) << ff_mpeg12_vlc_dc_chroma_bits[index]));
} else {
if (component == 0)
put_bits_le(pb,
diff --git a/libavcodec/vulkan_hevc.c b/libavcodec/vulkan_hevc.c
index 33a6326297..5228e41ad5 100644
--- a/libavcodec/vulkan_hevc.c
+++ b/libavcodec/vulkan_hevc.c
@@ -374,7 +374,7 @@ static void set_sps(const HEVCSPS *sps, int sps_idx,
/* NOTE: This is the predicted, and *reordered* version.
* Probably incorrect, but the spec doesn't say which version to use. */
str[i].used_by_curr_pic_flag = st_rps->used;
- str[i].used_by_curr_pic_s0_flag = av_mod_uintp2(st_rps->used, str[i].num_negative_pics);
+ str[i].used_by_curr_pic_s0_flag = av_zero_extend(st_rps->used, str[i].num_negative_pics);
str[i].used_by_curr_pic_s1_flag = st_rps->used >> str[i].num_negative_pics;
for (int j = 0; j < str[i].num_negative_pics; j++)
diff --git a/libavcodec/vvc/cabac.c b/libavcodec/vvc/cabac.c
index a5ccccd1c0..0d45eec751 100644
--- a/libavcodec/vvc/cabac.c
+++ b/libavcodec/vvc/cabac.c
@@ -954,8 +954,8 @@ void get_left_top(const VVCLocalContext *lc, uint8_t *left, uint8_t *top,
const VVCFrameContext *fc = lc->fc;
const VVCSPS *sps = fc->ps.sps;
const int min_cb_width = fc->ps.pps->min_cb_width;
- const int x0b = av_mod_uintp2(x0, sps->ctb_log2_size_y);
- const int y0b = av_mod_uintp2(y0, sps->ctb_log2_size_y);
+ const int x0b = av_zero_extend(x0, sps->ctb_log2_size_y);
+ const int y0b = av_zero_extend(y0, sps->ctb_log2_size_y);
const int x_cb = x0 >> sps->min_cb_log2_size_y;
const int y_cb = y0 >> sps->min_cb_log2_size_y;
@@ -1132,8 +1132,8 @@ static int mtt_split_cu_vertical_flag_decode(VVCLocalContext *lc, const int x0,
const VVCFrameContext *fc = lc->fc;
const VVCSPS *sps = fc->ps.sps;
const int min_cb_width = fc->ps.pps->min_cb_width;
- const int x0b = av_mod_uintp2(x0, sps->ctb_log2_size_y);
- const int y0b = av_mod_uintp2(y0, sps->ctb_log2_size_y);
+ const int x0b = av_zero_extend(x0, sps->ctb_log2_size_y);
+ const int y0b = av_zero_extend(y0, sps->ctb_log2_size_y);
const int x_cb = x0 >> sps->min_cb_log2_size_y;
const int y_cb = y0 >> sps->min_cb_log2_size_y;
const int available_a = lc->ctb_up_flag || y0b;
diff --git a/libavcodec/vvc/ctu.c b/libavcodec/vvc/ctu.c
index 809510b93d..ce79f14288 100644
--- a/libavcodec/vvc/ctu.c
+++ b/libavcodec/vvc/ctu.c
@@ -713,8 +713,8 @@ static enum IntraPredMode luma_intra_pred_mode(VVCLocalContext* lc, const int in
const int x_b = (x0 + cu->cb_width - 1) >> sps->min_cb_log2_size_y;
const int y_b = (y0 - 1) >> sps->min_cb_log2_size_y;
int min_cb_width = fc->ps.pps->min_cb_width;
- int x0b = av_mod_uintp2(x0, sps->ctb_log2_size_y);
- int y0b = av_mod_uintp2(y0, sps->ctb_log2_size_y);
+ int x0b = av_zero_extend(x0, sps->ctb_log2_size_y);
+ int y0b = av_zero_extend(y0, sps->ctb_log2_size_y);
const int available_l = lc->ctb_left_flag || x0b;
const int available_u = lc->ctb_up_flag || y0b;
@@ -2508,8 +2508,8 @@ void ff_vvc_set_neighbour_available(VVCLocalContext *lc,
const int x0, const int y0, const int w, const int h)
{
const int log2_ctb_size = lc->fc->ps.sps->ctb_log2_size_y;
- const int x0b = av_mod_uintp2(x0, log2_ctb_size);
- const int y0b = av_mod_uintp2(y0, log2_ctb_size);
+ const int x0b = av_zero_extend(x0, log2_ctb_size);
+ const int y0b = av_zero_extend(y0, log2_ctb_size);
lc->na.cand_up = (lc->ctb_up_flag || y0b);
lc->na.cand_left = (lc->ctb_left_flag || x0b);
diff --git a/libavcodec/vvc/inter.c b/libavcodec/vvc/inter.c
index aaf3230c1e..344a0a8c13 100644
--- a/libavcodec/vvc/inter.c
+++ b/libavcodec/vvc/inter.c
@@ -267,8 +267,8 @@ static void mc(VVCLocalContext *lc, int16_t *dst, const VVCFrame *ref, const Mv
const int hs = fc->ps.sps->hshift[c_idx];
const int vs = fc->ps.sps->vshift[c_idx];
const int idx = av_log2(block_w) - 1;
- const intptr_t mx = av_mod_uintp2(mv->x, 4 + hs) << (is_chroma - hs);
- const intptr_t my = av_mod_uintp2(mv->y, 4 + vs) << (is_chroma - vs);
+ const intptr_t mx = av_zero_extend(mv->x, 4 + hs) << (is_chroma - hs);
+ const intptr_t my = av_zero_extend(mv->y, 4 + vs) << (is_chroma - vs);
const int hpel_if_idx = (is_chroma || pu->merge_gpm_flag) ? 0 : pu->mi.hpel_if_idx;
const int8_t *hf = INTER_FILTER(hpel_if_idx, mx);
const int8_t *vf = INTER_FILTER(hpel_if_idx, my);
@@ -295,8 +295,8 @@ static void mc_uni(VVCLocalContext *lc, uint8_t *dst, const ptrdiff_t dst_stride
const int idx = av_log2(block_w) - 1;
const Mv *mv = &mvf->mv[lx];
const int is_chroma = !!c_idx;
- const intptr_t mx = av_mod_uintp2(mv->x, 4 + hs) << (is_chroma - hs);
- const intptr_t my = av_mod_uintp2(mv->y, 4 + vs) << (is_chroma - vs);
+ const intptr_t mx = av_zero_extend(mv->x, 4 + hs) << (is_chroma - hs);
+ const intptr_t my = av_zero_extend(mv->y, 4 + vs) << (is_chroma - vs);
const int hpel_if_idx = is_chroma ? 0 : pu->mi.hpel_if_idx;
const int8_t *hf = INTER_FILTER(hpel_if_idx, mx);
const int8_t *vf = INTER_FILTER(hpel_if_idx, my);
@@ -335,8 +335,8 @@ static void mc_bi(VVCLocalContext *lc, uint8_t *dst, const ptrdiff_t dst_stride,
for (int i = L0; i <= L1; i++) {
const Mv *mv = mvf->mv + i;
- const int mx = av_mod_uintp2(mv->x, 4 + hs) << (is_chroma - hs);
- const int my = av_mod_uintp2(mv->y, 4 + vs) << (is_chroma - vs);
+ const int mx = av_zero_extend(mv->x, 4 + hs) << (is_chroma - hs);
+ const int my = av_zero_extend(mv->y, 4 + vs) << (is_chroma - vs);
const int ox = x_off + (mv->x >> (4 + hs));
const int oy = y_off + (mv->y >> (4 + vs));
const VVCFrame *ref = refs[i];
@@ -672,8 +672,8 @@ static int ciip_derive_intra_weight(const VVCLocalContext *lc, const int x0, con
{
const VVCFrameContext *fc = lc->fc;
const VVCSPS *sps = fc->ps.sps;
- const int x0b = av_mod_uintp2(x0, sps->ctb_log2_size_y);
- const int y0b = av_mod_uintp2(y0, sps->ctb_log2_size_y);
+ const int x0b = av_zero_extend(x0, sps->ctb_log2_size_y);
+ const int y0b = av_zero_extend(y0, sps->ctb_log2_size_y);
const int available_l = lc->ctb_left_flag || x0b;
const int available_u = lc->ctb_up_flag || y0b;
const int min_pu_width = fc->ps.pps->min_pu_width;
@@ -971,7 +971,7 @@ static void pred_affine_blk(VVCLocalContext *lc)
luma_prof_bi(lc, dst0, dst_stride, refp[L0], refp[L1], mv, x, y, sbw, sbh);
}
if (fc->ps.sps->r->sps_chroma_format_idc) {
- if (!av_mod_uintp2(sby, vs) && !av_mod_uintp2(sbx, hs)) {
+ if (!av_zero_extend(sby, vs) && !av_zero_extend(sbx, hs)) {
MvField mvc;
derive_affine_mvc(&mvc, fc, mv, x, y, sbw, sbh);
diff --git a/libavcodec/vvc/inter_template.c b/libavcodec/vvc/inter_template.c
index a8068f4ba8..89effffb8f 100644
--- a/libavcodec/vvc/inter_template.c
+++ b/libavcodec/vvc/inter_template.c
@@ -47,7 +47,7 @@ static void av_always_inline FUNC(put_scaled)(uint8_t *_dst, const ptrdiff_t _ds
for (int i = 0; i < width; i++) {
const int tx = _x + dx * i;
const int x = SCALED_INT(tx) - x0;
- const int mx = av_mod_uintp2(tx >> shift1, shift2);
+ const int mx = av_zero_extend(tx >> shift1, shift2);
const int8_t *filter = hf + mx * taps;
const pixel *src = (pixel*)_src - extra_before * src_stride;
@@ -61,7 +61,7 @@ static void av_always_inline FUNC(put_scaled)(uint8_t *_dst, const ptrdiff_t _ds
for (int i = 0; i < height; i++) {
const int ty = _y + dy * i;
const int x = SCALED_INT(ty) - y0;
- const int mx = av_mod_uintp2(ty >> shift1, shift2);
+ const int mx = av_zero_extend(ty >> shift1, shift2);
const int8_t *filter = vf + mx * taps;
tmp = tmp_array + extra_before;
@@ -136,7 +136,7 @@ static void av_always_inline FUNC(put_uni_w_scaled)(uint8_t *_dst, const ptrdiff
for (int i = 0; i < width; i++) {
const int tx = _x + dx * i;
const int x = SCALED_INT(tx) - x0;
- const int mx = av_mod_uintp2(tx >> shift1, shift2);
+ const int mx = av_zero_extend(tx >> shift1, shift2);
const int8_t *filter = hf + mx * taps;
const pixel *src = (pixel*)_src - extra_before * src_stride;
@@ -150,7 +150,7 @@ static void av_always_inline FUNC(put_uni_w_scaled)(uint8_t *_dst, const ptrdiff
for (int i = 0; i < height; i++) {
const int ty = _y + dy * i;
const int x = SCALED_INT(ty) - y0;
- const int mx = av_mod_uintp2(ty >> shift1, shift2);
+ const int mx = av_zero_extend(ty >> shift1, shift2);
const int8_t *filter = vf + mx * taps;
tmp = tmp_array + extra_before;
diff --git a/libavcodec/vvc/intra_template.c b/libavcodec/vvc/intra_template.c
index 1a4d5f6f93..62342c8142 100644
--- a/libavcodec/vvc/intra_template.c
+++ b/libavcodec/vvc/intra_template.c
@@ -99,7 +99,7 @@ static av_always_inline void FUNC(cclm_select_luma)(const VVCFrameContext *fc,
{
const VVCSPS *sps = fc->ps.sps;
- const int b_ctu_boundary = !av_mod_uintp2(y0, sps->ctb_log2_size_y);
+ const int b_ctu_boundary = !av_zero_extend(y0, sps->ctb_log2_size_y);
const int hs = sps->hshift[1];
const int vs = sps->vshift[1];
const ptrdiff_t stride = fc->frame->linesize[0] / sizeof(pixel);
diff --git a/libavcodec/vvc/intra_utils.c b/libavcodec/vvc/intra_utils.c
index 040aacdffe..8c40eb1b16 100644
--- a/libavcodec/vvc/intra_utils.c
+++ b/libavcodec/vvc/intra_utils.c
@@ -100,7 +100,7 @@ int ff_vvc_get_top_available(const VVCLocalContext *lc, const int x, const int y
const int vs = sps->vshift[c_idx];
const int log2_ctb_size_v = sps->ctb_log2_size_y - vs;
const int end_of_ctb_x = ((lc->cu->x0 >> sps->ctb_log2_size_y) + 1) << sps->ctb_log2_size_y;
- const int y0b = av_mod_uintp2(y, log2_ctb_size_v);
+ const int y0b = av_zero_extend(y, log2_ctb_size_v);
const int max_x = FFMIN(fc->ps.pps->width, end_of_ctb_x) >> hs;
const ReconstructedArea *a;
int px = x;
@@ -130,7 +130,7 @@ int ff_vvc_get_left_available(const VVCLocalContext *lc, const int x, const int
const int hs = sps->hshift[c_idx];
const int vs = sps->vshift[c_idx];
const int log2_ctb_size_h = sps->ctb_log2_size_y - hs;
- const int x0b = av_mod_uintp2(x, log2_ctb_size_h);
+ const int x0b = av_zero_extend(x, log2_ctb_size_h);
const int end_of_ctb_y = ((lc->cu->y0 >> sps->ctb_log2_size_y) + 1) << sps->ctb_log2_size_y;
const int max_y = FFMIN(fc->ps.pps->height, end_of_ctb_y) >> vs;
const ReconstructedArea *a;
diff --git a/libavcodec/vvc/mvs.c b/libavcodec/vvc/mvs.c
index b96e750272..42564b3e6f 100644
--- a/libavcodec/vvc/mvs.c
+++ b/libavcodec/vvc/mvs.c
@@ -549,7 +549,7 @@ static int is_a0_available(const VVCLocalContext *lc, const CodingUnit *cu)
{
const VVCFrameContext *fc = lc->fc;
const VVCSPS *sps = fc->ps.sps;
- const int x0b = av_mod_uintp2(cu->x0, sps->ctb_log2_size_y);
+ const int x0b = av_zero_extend(cu->x0, sps->ctb_log2_size_y);
int cand_bottom_left;
if (!x0b && !lc->ctb_left_flag) {
More information about the ffmpeg-cvslog
mailing list