37 if ((
w == 4 ||
h == 4) || (
w == 8 &&
h == 8))
44 int side_size, nscale;
64 if ((
w >= 4 &&
h >= 4) && !ref_idx && !bdpcm_flag) {
80 const int ch_type = c_idx > 0;
81 for (
int i = lc->
num_ras[ch_type] - 1;
i >= 0;
i--) {
83 const int r = (
a->x +
a->w);
84 const int b = (
a->y +
a->h);
85 if (
a->x <= x && x < r && a->y <= y && y <
b)
99 const int hs =
sps->hshift[c_idx];
100 const int vs =
sps->vshift[c_idx];
101 const int log2_ctb_size_v =
sps->ctb_log2_size_y - vs;
102 const int end_of_ctb_x = ((lc->
cu->
x0 >>
sps->ctb_log2_size_y) + 1) <<
sps->ctb_log2_size_y;
104 const int max_x =
FFMIN(
fc->ps.pps->width, end_of_ctb_x) >> hs;
112 if (
sps->r->sps_entropy_coding_sync_enabled_flag)
113 target_size =
FFMIN(target_size, (end_of_ctb_x >> hs) - x);
117 target_size =
FFMAX(0,
FFMIN(target_size, max_x - x));
119 const int sz =
FFMIN(target_size,
a->x +
a->w - px);
130 const int hs =
sps->hshift[c_idx];
131 const int vs =
sps->vshift[c_idx];
132 const int log2_ctb_size_h =
sps->ctb_log2_size_y - hs;
134 const int end_of_ctb_y = ((lc->
cu->
y0 >>
sps->ctb_log2_size_y) + 1) <<
sps->ctb_log2_size_y;
135 const int max_y =
FFMIN(
fc->ps.pps->height, end_of_ctb_y) >> vs;
142 target_size =
FFMAX(0,
FFMIN(target_size, max_y - y));
147 const int sz =
FFMIN(target_size,
a->y +
a->h - py);
154static int less(
const void *
a,
const void *
b)
156 return *(
const int*)
a - *(
const int*)
b;
161 static const int modes[] = { -14, -12, -10, -6,
INTRA_PLANAR, 2, 34, 66, 72, 76, 78, 80};
167 static const int angles[] = {
168 0, 1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 23, 26, 29,
169 32, 35, 39, 45, 51, 57, 64, 73, 86, 102, 128, 171, 256, 341, 512
171 int sign = 1, idx, intra_pred_angle;
174 }
else if (pred_mode > 0) {
183 intra_pred_angle = sign * angles[idx];
184 return intra_pred_angle;
190 if (intra_pred_angle > 0)
198 const int tb_width,
const int tb_height,
const int c_idx,
int pred_mode_intra)
200 int nw, nh, wh_ratio,
min,
max;
210 max = (wh_ratio > 1) ? (8 + 2 * wh_ratio) : 8;
211 min = (wh_ratio > 1) ? (60 - 2 * wh_ratio) : 60;
213 if (nw > nh && pred_mode_intra >=2 && pred_mode_intra <
max)
214 pred_mode_intra += 65;
215 else if (nh > nw && pred_mode_intra <= 66 && pred_mode_intra >
min)
216 pred_mode_intra -= 67;
217 return pred_mode_intra;
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define i(width, name, range_min, range_max)
static int FUNC sps(CodedBitstreamContext *ctx, RWContext *rw, H264RawSPS *current)
common internal and external API header
#define ROUNDED_DIV(a, b)
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
static int less(const void *a, const void *b)
static const uint16_t fc[]
int ff_vvc_need_pdpc(const int w, const int h, const uint8_t bdpcm_flag, const int mode, const int ref_idx)
int ff_vvc_intra_inv_angle_derive(const int intra_pred_angle)
int ff_vvc_get_mip_size_id(const int w, const int h)
int ff_vvc_intra_pred_angle_derive(const int pred_mode)
int ff_vvc_get_left_available(const VVCLocalContext *lc, const int x, const int y, int target_size, const int c_idx)
int ff_vvc_wide_angle_mode_mapping(const CodingUnit *cu, const int tb_width, const int tb_height, const int c_idx, int pred_mode_intra)
int ff_vvc_nscale_derive(const int w, const int h, const int mode)
static int less(const void *a, const void *b)
int ff_vvc_get_top_available(const VVCLocalContext *lc, const int x, const int y, int target_size, const int c_idx)
static const ReconstructedArea * get_reconstructed_area(const VVCLocalContext *lc, const int x, const int y, const int c_idx)
int ff_vvc_ref_filter_flag_derive(const int mode)
Utility Preprocessor macros.
#define FF_ARRAY_ELEMS(a)
static const SiprModeParam modes[MODE_COUNT]
enum IspType isp_split_type
IntraSubPartitionsSplitType.
ReconstructedArea ras[2][MAX_PARTS_IN_CTU]