avcodec: use the renamed av_zero_extend
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
4b57ea8fc7
commit
1b9af306da
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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))
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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)
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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++)
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user