28#define POS(x, y) src[(x) + stride * (y)]
31 const int w,
const int h,
const pixel* pdsy,
const int *
a,
const int *
b,
const int *k)
35 const int c_idx =
i + 1;
36 const int x = x0 >>
sps->hshift[c_idx];
37 const int y = y0 >>
sps->vshift[c_idx];
38 const ptrdiff_t
stride =
fc->frame->linesize[c_idx] /
sizeof(
pixel);
40 for (
int y = 0; y <
h; y++) {
41 for (
int x = 0; x <
w; x++) {
42 const int dsy = pdsy[y *
w + x];
43 const int pred = ((dsy *
a[
i]) >> k[
i]) +
b[
i];
56 for (
int i = 0;
i < 2;
i++) {
63 const int x,
const int y,
const int w,
const int h,
const int avail_t,
const int avail_l,
71 num_samp[
TOP] = avail_t ?
w : 0;
72 num_samp[
LEFT] = avail_l ?
h : 0;
77 if (!num_samp[
TOP] && !num_samp[
LEFT]) {
81 const int start = num_samp[
i] >> (2 + num_is4);
82 const int step =
FFMAX(1, num_samp[
i] >> (1 + num_is4)) ;
83 cnt[
i] =
FFMIN(num_samp[
i], (1 + num_is4) << 1);
84 for (
int c = 0;
c < cnt[
i];
c++)
85 pos[
i][
c] = start +
c * step;
93 for (
int i = 0;
i < cnt;
i++)
98 const int x0,
const int y0,
const int avail_t,
const int avail_l,
const int cnt[2],
const int pos[2][
MAX_PICK_POS],
104 const int hs =
sps->hshift[1];
105 const int vs =
sps->vshift[1];
106 const ptrdiff_t
stride =
fc->frame->linesize[0] /
sizeof(
pixel);
114 if (vs && !b_ctu_boundary) {
116 for (
int i = 0;
i < cnt[
TOP];
i++) {
117 const int x =
pos[
TOP][
i] << hs;
119 const int has_left = x || avail_l;
121 if (
sps->r->sps_chroma_vertical_collocated_flag) {
122 sel_luma[
i] = (
POS(0, -1) + l + 4 *
POS(0, 0) +
POS(1, 0) +
POS(0, 1) + 4) >> 3;
124 const pixel l1 = has_left ?
POS(-1, 1) :
POS(0, 1);
125 sel_luma[
i] = (l + l1 + 2 * (
POS(0, 0) +
POS(0, 1)) +
POS(1, 0) +
POS(1, 1) + 4) >> 3;
130 for (
int i = 0;
i < cnt[
TOP];
i++) {
131 const int x =
pos[
TOP][
i] << hs;
133 const int has_left = x || avail_l;
135 sel_luma[
i] = (l + 2 *
POS(0, 0) +
POS(1, 0) + 2) >> 2;
142 const pixel *source = (
pixel *)
fc->frame->data[0] + x0 + y0 *
stride - (1 + hs) * avail_l;
143 left = source - avail_l;
145 for (
int i = 0;
i < cnt[
LEFT];
i++) {
152 pred = (*l + 2 *
POS(0, 0) +
POS(1, 0) + 2) >> 2;
154 if (
sps->r->sps_chroma_vertical_collocated_flag) {
155 const int has_top = y || avail_t;
157 pred = (*l + t + 4 *
POS(0, 0) +
POS(1, 0) +
POS(0, 1) + 4) >> 3;
169 const int x,
const int y,
const int cnt[2],
const int pos[2][
MAX_PICK_POS],
173 const ptrdiff_t
stride =
fc->frame->linesize[c_idx] /
sizeof(
pixel);
177 for (
int i = 0;
i < cnt[
TOP];
i++) {
183 for (
int i = 0;
i < cnt[
LEFT];
i++) {
190 const int x0,
const int y0,
const int w,
const int h,
const int avail_t,
const int avail_l,
195 const int x = x0 >>
sps->hshift[1];
196 const int y = y0 >>
sps->vshift[1];
205 if (cnt[
TOP] + cnt[
LEFT] == 2) {
207 sel[c_idx][3] = sel[c_idx][0];
208 sel[c_idx][2] = sel[c_idx][1];
209 sel[c_idx][0] = sel[c_idx][1];
210 sel[c_idx][1] = sel[c_idx][3];
219 int min_grp_idx[] = { 0, 2 };
220 int max_grp_idx[] = { 1, 3 };
222 if (sel[
LUMA][min_grp_idx[0]] > sel[
LUMA][min_grp_idx[1]])
223 FFSWAP(
int, min_grp_idx[0], min_grp_idx[1]);
224 if (sel[
LUMA][max_grp_idx[0]] > sel[
LUMA][max_grp_idx[1]])
225 FFSWAP(
int, max_grp_idx[0], max_grp_idx[1]);
226 if (sel[
LUMA][min_grp_idx[0]] > sel[
LUMA][max_grp_idx[1]]) {
227 FFSWAP(
int, min_grp_idx[0], max_grp_idx[0]);
228 FFSWAP(
int, min_grp_idx[1], max_grp_idx[1]);
230 if (sel[
LUMA][min_grp_idx[1]] > sel[
LUMA][max_grp_idx[0]])
231 FFSWAP(
int, min_grp_idx[1], max_grp_idx[0]);
233 max[c_idx] = (sel[c_idx][max_grp_idx[0]] + sel[c_idx][max_grp_idx[1]] + 1) >> 1;
234 min[c_idx] = (sel[c_idx][min_grp_idx[0]] + sel[c_idx][min_grp_idx[1]] + 1) >> 1;
239 const int x0,
const int y0,
const int w,
const int h,
const int avail_t,
const int avail_l,
240 int *
a,
int *
b,
int *k)
255 for (
int i = 0;
i < 2;
i++) {
261 for (
int i = 0;
i < 2;
i++) {
262 const static int div_sig_table[] = {0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0};
263 const int diffc =
max[
i + 1] -
min[
i + 1];
267 x += (norm_diff) ? 1 : 0;
269 v = div_sig_table[norm_diff] | 8;
271 a[
i] = (diffc * v + add) >> y;
272 k[
i] =
FFMAX(1, 3 + x -y);
273 sign =
a[
i] < 0 ? -1 : (
a[
i] > 0);
274 a[
i] = ((3 + x - y) < 1) ? sign * 15 :
a[
i];
284 const int x0,
const int y0,
const int w,
const int h,
const int avail_t,
const int avail_l,
287 const int hs =
fc->ps.sps->hshift[1];
288 const int vs =
fc->ps.sps->vshift[1];
289 const ptrdiff_t
stride =
fc->frame->linesize[0] /
sizeof(
pixel);
296 for (
int i = 0;
i <
h;
i++)
300 for (
int i = 0;
i <
h;
i++) {
303 const pixel *t = top;
305 for (
int j = 0; j <
w; j++) {
313 if (
sps->r->sps_chroma_vertical_collocated_flag) {
314 for (
int j = 0; j <
w; j++) {
322 for (
int j = 0; j <
w; j++) {
338 const int x,
const int y,
const int w,
const int h,
const int avail_t,
const int avail_l)
341 const ptrdiff_t
stride =
fc->frame->linesize[c_idx] /
sizeof(
pixel);
343 for (
int i = 0;
i <
h;
i++) {
344 for (
int j = 0; j <
w; j++) {
360 const int hs =
sps->hshift[1];
361 const int vs =
sps->vshift[1];
362 const int x = x0 >> hs;
363 const int y = y0 >> vs;
364 const int w =
width >> hs;
366 int a[2],
b[2], k[2];
369 if (!avail_t && !avail_l) {
380 const int size =
FFMIN(avail, target_size);
382 for (
int i = 0;
i <
size;
i++) {
386 sum += *(start -
stride) * (target_size -
size);
395 const int size_y =
FFMIN(
fc->ps.sps->ctb_size_y, 64);
397 const int x = x0 & ~(size_y - 1);
398 const int y = y0 & ~(size_y - 1);
399 if (lc->lmcs.x_vpdu != x || lc->lmcs.y_vpdu != y) {
400 int cnt = 0, luma = 0,
i;
414 luma = (luma + (cnt >> 1)) >>
av_log2(cnt);
419 if (luma < lmcs->pivot[
i + 1])
428 return lc->lmcs.chroma_scale;
433 const int width,
const int height,
const int x0_cu,
const int y0_cu)
437 for (
int y = 0; y <
height; y++) {
438 for (
int x = 0; x <
width; x++) {
442 *coeff = (
c * chroma_scale + (1 << 10)) >> 11;
444 *coeff = -((-
c * chroma_scale + (1 << 10)) >> 11);
451 pixel *filtered_left,
pixel *filtered_top,
const int left_size,
const int top_size,
452 const int unfilter_last_one)
454 filtered_left[-1] = filtered_top[-1] = (
left[0] + 2 *
left[-1] + top[0] + 2 ) >> 2;
455 for (
int i = 0;
i < left_size - unfilter_last_one;
i++) {
458 for (
int i = 0;
i < top_size - unfilter_last_one;
i++) {
459 filtered_top[
i] = (top[
i-1] + 2 * top[
i] + top[
i + 1] + 2) >> 2;
461 if (unfilter_last_one) {
462 filtered_top[top_size - 1] = top[top_size - 1];
463 filtered_left[left_size - 1] =
left[left_size - 1];
469 const int x,
int y,
int w,
int h,
int c_idx,
const int is_intra_mip,
470 const int mode,
const int ref_idx,
const int need_pdpc)
472#define EXTEND(ptr, val, len) \
474 for (i = 0; i < (len); i++) \
479 const int filter_flag = !ref_idx &&
w *
h > 32 && !c_idx &&
481 int cand_up_left = lc->na.cand_up_left;
486 const int ref_line = ref_idx == 3 ? -4 : (-1 - ref_idx);
487 int left_size, top_size, unfilter_left_size, unfilter_top_size;
488 int left_available, top_available;
490 int intra_pred_angle, inv_angle;
496 unfilter_left_size = left_size + filter_flag;
497 unfilter_top_size = top_size + filter_flag;
499 unfilter_left_size = left_size =
h;
500 unfilter_top_size = top_size =
w;
503 unfilter_left_size = left_size = need_pdpc ?
h : 1;
504 unfilter_top_size = top_size =
w;
506 unfilter_left_size = left_size =
h;
508 unfilter_top_size = top_size = need_pdpc ?
w : 1;
519 unfilter_top_size = top_size = refw;
520 unfilter_left_size = left_size = refh;
524 for (
i = 0;
i < left_available;
i++)
528 memcpy(top,
src + ref_line *
stride, top_available *
sizeof(
pixel));
532 for (
int i = -1;
i >= ref_line;
i--) {
535 top[
i] =
POS(
i, ref_line);
536 }
else if (left_available) {
538 }
else if (top_available) {
539 left[
i] = top[
i] = top[0];
545 EXTEND(top + top_available, top[top_available-1], unfilter_top_size - top_available);
546 EXTEND(
left + left_available,
left[left_available-1], unfilter_left_size - left_available);
548 if (ref_filter_flag) {
550 const int unfilter_last_one = left_size == unfilter_left_size;
551 FUNC(
ref_filter)(
left, top, filtered_left, filtered_top, unfilter_left_size, unfilter_top_size, unfilter_last_one);
552 left = filtered_left;
558 edge->filter_flag = 0;
561 const int intra_hor_ver_dist_thres[] = {24, 14, 2, 0, 0};
563 edge->filter_flag = min_dist_ver_hor > intra_hor_ver_dist_thres[ntbs - 2];
568 if (intra_pred_angle < 0) {
569 pixel *p = top - (ref_idx + 1);
570 for (
int x = -
h; x < 0; x++) {
571 const int idx = -1 - ref_idx +
FFMIN((x*inv_angle + 256) >> 9,
h);
575 for (
int i = refw;
i <= refw +
FFMAX(1,
w/
h) * ref_idx + 1;
i++)
576 top[
i] = top[refw - 1];
579 if (intra_pred_angle < 0) {
581 for (
int x = -
w; x < 0; x++) {
582 const int idx = -1 - ref_idx +
FFMIN((x*inv_angle + 256) >> 9,
w);
586 for (
int i = refh;
i <= refh +
FFMAX(1,
h/
w) * ref_idx + 1;
i++)
592 edge->left = (uint8_t*)
left;
593 edge->top = (uint8_t*)top;
604 const int log2_min_cb_size =
sps->min_cb_log2_size_y;
605 const int min_cb_width =
pps->min_cb_width;
606 const int x_cb = x0 >> log2_min_cb_size;
607 const int y_cb = y0 >> log2_min_cb_size;
609 const int hshift =
fc->ps.sps->hshift[c_idx];
610 const int vshift =
fc->ps.sps->vshift[c_idx];
611 const int x = x0 >> hshift;
612 const int y = y0 >> vshift;
613 const int w =
width >> hshift;
614 const int h =
height >> vshift;
615 const ptrdiff_t
stride =
fc->frame->linesize[c_idx] /
sizeof(
pixel);
620 const int intra_mip_flag =
SAMPLE_CTB(
fc->tab.imf, x_cb, y_cb);
629 FUNC(
prepare_intra_edge_params)(lc, &edge,
src,
stride, x, y,
w,
h, c_idx, is_intra_mip,
mode, ref_idx, need_pdpc);
632 int intra_mip_transposed_flag;
634 unpack_mip_info(&intra_mip_transposed_flag, &intra_mip_mode, intra_mip_flag);
636 fc->vvcdsp.intra.pred_mip((uint8_t *)
src, edge.
top, edge.
left,
637 w,
h,
stride, intra_mip_mode, intra_mip_transposed_flag);
648 fc->vvcdsp.intra.pred_angular_v((uint8_t *)
src, edge.
top, edge.
left,
652 fc->vvcdsp.intra.pred_angular_h((uint8_t *)
src, edge.
top, edge.
left,
664 for (
int y = 0; y <
h; y++) {
665 for (
int x = 0; x <
w; x++) {
666 int l, t, wl, wt,
pred;
675 t = top[x] - top[-1] +
POS(x,y);
690 const uint8_t *_left,
const int w,
const int h,
const ptrdiff_t
stride)
699 const int shift = (logw + logh + 1);
700 for (y = 0; y <
h; y++) {
701 for (x = 0; x <
w; x++) {
702 const int pred_v = ((
h - 1 - y) * top[x] + (y + 1) *
left[
h]) << logw;
703 const int pred_h = ((
w - 1 - x) *
left[y] + (x + 1) * top[
w]) << logh;
714 const int b_dwn = n_tb_s / boundary_size;
717 if (boundary_size == n_tb_s) {
718 for (
int i = 0;
i < n_tb_s;
i++)
722 for (
int i = 0;
i < boundary_size;
i++) {
725 for (
int j = 1; j < b_dwn; j++)
732 const int up_hor,
const int up_ver,
const int pred_size,
const int *reduced,
const int reduced_size,
733 const int ow,
const int temp0,
const uint8_t *
matrix,
int is_transposed)
735 src = &
POS(up_hor - 1, up_ver - 1);
736 for (
int y = 0; y < pred_size; y++) {
737 for (
int x = 0; x < pred_size; x++) {
739 for (
int i = 0;
i < reduced_size;
i++)
745 POS(y * up_hor, x * up_ver) =
pred;
747 POS(x * up_hor, y * up_ver) =
pred;
753 const pixel *boundary,
const int boundary_step,
const int pred_size)
756 for (
int i = 0;
i < dst_height;
i++) {
757 const pixel *before = boundary;
758 const pixel *after =
dst - dst_step;
760 for (
int j = 0; j < pred_size; j++) {
761 after += dst_step *
factor;
762 for (
int k = 1; k <
factor; k++) {
763 int mid = (
factor - k) * (*before) + k * (*after);
770 boundary += boundary_step;
777 const uint8_t *_left,
const int w,
const int h,
const ptrdiff_t
stride,
778 int mode_id,
int is_transposed)
785 static const int boundary_sizes[] = {2, 4, 4};
786 static const int pred_sizes[] = {4, 4, 8};
787 const int boundary_size = boundary_sizes[size_id];
788 const int pred_size = pred_sizes[size_id];
789 const int in_size = 2 * boundary_size - ((size_id == 2) ? 1 : 0);
791 const int up_hor =
w / pred_size;
792 const int up_ver =
h / pred_size;
795 int *red_t = reduced;
796 int *red_l = reduced + boundary_size;
801 FFSWAP(
int*, red_t, red_l);
811 ow = reduced[1] - temp0;
814 for (
int i = 1;
i < in_size;
i++) {
815 reduced[
i] = reduced[
i + off] - temp0;
820 FUNC(
mip_reduced_pred)(
src,
stride, up_hor, up_ver, pred_size, reduced, in_size, ow, temp0,
matrix, is_transposed);
821 if (up_hor > 1 || up_ver > 1) {
830 const int w,
const int h)
838 for (
int i = 0;
i <
w;
i++)
842 for (
int i = 0;
i <
h;
i++)
851 const uint8_t *_left,
const int w,
const int h,
const ptrdiff_t
stride)
859 for (y = 0; y <
h; y++) {
861 for (x = 0; x <
w; x += 4) {
870 const int w,
const int h,
const ptrdiff_t
stride)
874 for (
int y = 0; y <
h; y++) {
885 for (
int y = 0; y <
h; y++) {
887 for (
int x = 0; x <
w; x += 4) {
893#define INTRA_LUMA_FILTER(p) CLIP((p[0] * f[0] + p[1] * f[1] + p[2] * f[2] + p[3] * f[3] + 32) >> 6)
894#define INTRA_CHROMA_FILTER(p) (((32 - fact) * p[1] + fact * p[2] + 16) >> 5)
898 const int w,
const int h,
const ptrdiff_t
stride,
const int c_idx,
const int mode,
899 const int ref_idx,
const int filter_flag,
const int need_pdpc)
903 const pixel *top = (
const pixel *)_top - (1 + ref_idx);
905 int pos = (1 + ref_idx) * intra_pred_angle;
906 const int dp = intra_pred_angle;
907 const int is_luma = !c_idx;
908 int nscale, inv_angle;
915 for (
int y = 0; y <
h; y++) {
916 const int idx = (
pos >> 5) + ref_idx;
918 if (!
fact && (!is_luma || !filter_flag)) {
919 for (
int x = 0; x <
w; x++) {
920 const pixel *p = top + x + idx + 1;
926 for (
int x = 0; x <
w; x++) {
927 const pixel *p = top + x + idx;
931 for (
int x = 0; x <
w; x++) {
932 const pixel *p = top + x + idx;
938 int inv_angle_sum = 256 + inv_angle;
939 for (
int x = 0; x <
FFMIN(
w, 3 << nscale); x++) {
940 const pixel l =
left[y + (inv_angle_sum >> 9)];
942 const int wl = 32 >> ((x << 1) >> nscale);
943 const int pred =
val + (((l -
val) * wl + 32) >> 6);
945 inv_angle_sum += inv_angle;
954 const int w,
const int h,
const ptrdiff_t
stride,
const int c_idx,
const int mode,
955 const int ref_idx,
const int filter_flag,
const int need_pdpc)
960 const int is_luma = !c_idx;
962 const int dp = intra_pred_angle;
963 int nscale = 0, inv_angle, inv_angle_sum;
967 inv_angle_sum = 256 + inv_angle;
971 for (
int y = 0; y <
h; y++) {
972 int pos = (1 + ref_idx) * intra_pred_angle;
975 wt = (32 >>
FFMIN(31, (y * 2) >> nscale));
977 for (
int x = 0; x <
w; x++) {
978 const int idx = (
pos >> 5) + ref_idx;
982 if (!
fact && (!is_luma || !filter_flag)) {
993 if (y < (3 << nscale)) {
994 const pixel t = top[x + (inv_angle_sum >> 9)];
1002 inv_angle_sum += inv_angle;
uint8_t ptrdiff_t const uint8_t * _src
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static double val(void *priv, double ch)
static double fact(double i)
simple assert() macros that are a bit more flexible than ISO C assert().
#define PIXEL_SPLAT_X4(x)
static int BS_FUNC left(const BSCTX *bc)
Return the number of the bits left in a buffer.
#define i(width, name, range_min, range_max)
static int FUNC sps(CodedBitstreamContext *ctx, RWContext *rw, H264RawSPS *current)
static const uint16_t fc[]
#define SAMPLE_CTB(tab, x, y)
static av_always_inline void scale(vec_s32 res[4], vec_s16 res_packed[2], const int shift)
static void lmcs_scale_chroma(VVCLocalContext *lc, TransformUnit *tu, TransformBlock *tb, const int target_ch_type)
int ff_vvc_intra_pred_angle_derive(int pred_mode)
int ff_vvc_nscale_derive(int w, int h, int mode)
int ff_vvc_get_top_available(const VVCLocalContext *lc, int x0, int y0, int target_size, int c_idx)
int ff_vvc_wide_angle_mode_mapping(const CodingUnit *cu, int tb_width, int tb_height, int c_idx, int pred_mode_intra)
int ff_vvc_get_left_available(const VVCLocalContext *lc, int x0, int y0, int target_size, int c_idx)
int ff_vvc_need_pdpc(int w, int h, uint8_t bdpcm_flag, int mode, int ref_idx)
int ff_vvc_ref_filter_flag_derive(int mode)
int ff_vvc_get_mip_size_id(int w, int h)
int ff_vvc_intra_inv_angle_derive(int pred_mode)
static av_always_inline void FUNC ref_filter(const pixel *left, const pixel *top, pixel *filtered_left, pixel *filtered_top, const int left_size, const int top_size, const int unfilter_last_one)
static void FUNC pred_angular_v(uint8_t *_src, const uint8_t *_top, const uint8_t *_left, const int w, const int h, const ptrdiff_t stride, const int c_idx, const int mode, const int ref_idx, const int filter_flag, const int need_pdpc)
static av_always_inline void FUNC cclm_get_params_default(int *a, int *b, int *k)
static av_always_inline void FUNC mip_upsampling_1d(pixel *dst, const int dst_step, const int dst_stride, const int dst_height, const int factor, const pixel *boundary, const int boundary_step, const int pred_size)
static av_always_inline void FUNC cclm_pred_default(VVCFrameContext *fc, const int x, const int y, const int w, const int h, const int avail_t, const int avail_l)
static av_always_inline pixel FUNC pred_dc_val(const pixel *top, const pixel *left, const int w, const int h)
#define EXTEND(ptr, val, len)
static av_always_inline void FUNC mip_reduced_pred(pixel *src, const ptrdiff_t stride, const int up_hor, const int up_ver, const int pred_size, const int *reduced, const int reduced_size, const int ow, const int temp0, const uint8_t *matrix, int is_transposed)
static av_always_inline void FUNC cclm_select_chroma(const VVCFrameContext *fc, const int x, const int y, const int cnt[2], const int pos[2][MAX_PICK_POS], pixel sel[][MAX_PICK_POS *2])
static av_always_inline void FUNC cclm_select_luma_444(const pixel *src, const int step, const int cnt, const int pos[MAX_PICK_POS], pixel *sel_luma)
static void FUNC pred_h(uint8_t *_src, const uint8_t *_left, const int w, const int h, const ptrdiff_t stride)
static av_always_inline int FUNC cclm_get_select_pos(const VVCLocalContext *lc, const int x, const int y, const int w, const int h, const int avail_t, const int avail_l, int cnt[2], int pos[2][MAX_PICK_POS])
static int FUNC lmcs_derive_chroma_scale(VVCLocalContext *lc, const int x0, const int y0)
static av_always_inline void FUNC mip_downsampling(int *reduced, const int boundary_size, const pixel *ref, const int n_tb_s)
static void FUNC pred_angular_h(uint8_t *_src, const uint8_t *_top, const uint8_t *_left, const int w, const int h, const ptrdiff_t stride, const int c_idx, const int mode, const int ref_idx, const int filter_flag, const int need_pdpc)
static void FUNC intra_cclm_pred(const VVCLocalContext *lc, const int x0, const int y0, const int width, const int height)
static av_always_inline int FUNC cclm_select_samples(const VVCLocalContext *lc, const int x0, const int y0, const int w, const int h, const int avail_t, const int avail_l, pixel sel[][MAX_PICK_POS *2])
static av_always_inline void FUNC cclm_linear_pred(VVCFrameContext *fc, const int x0, const int y0, const int w, const int h, const pixel *pdsy, const int *a, const int *b, const int *k)
static av_always_inline void FUNC cclm_select_luma(const VVCFrameContext *fc, const int x0, const int y0, const int avail_t, const int avail_l, const int cnt[2], const int pos[2][MAX_PICK_POS], pixel *sel_luma)
static av_always_inline void FUNC cclm_get_min_max(const pixel sel[][MAX_PICK_POS *2], int *min, int *max)
static void FUNC ff_vvc_intra_dsp_init(VVCIntraDSPContext *const intra)
static av_always_inline void FUNC pred_mip(uint8_t *_src, const uint8_t *_top, const uint8_t *_left, const int w, const int h, const ptrdiff_t stride, int mode_id, int is_transposed)
static av_always_inline void FUNC pred_v(uint8_t *_src, const uint8_t *_top, const int w, const int h, const ptrdiff_t stride)
static int FUNC lmcs_sum_samples(const pixel *start, ptrdiff_t stride, const int avail, const int target_size)
#define INTRA_CHROMA_FILTER(p)
static av_always_inline void FUNC prepare_intra_edge_params(const VVCLocalContext *lc, IntraEdgeParams *edge, const pixel *src, const ptrdiff_t stride, const int x, int y, int w, int h, int c_idx, const int is_intra_mip, const int mode, const int ref_idx, const int need_pdpc)
#define INTRA_LUMA_FILTER(p)
static av_always_inline void FUNC cclm_get_params(const VVCLocalContext *lc, const int x0, const int y0, const int w, const int h, const int avail_t, const int avail_l, int *a, int *b, int *k)
static av_always_inline void FUNC cclm_get_luma_rec_pixels(const VVCFrameContext *fc, const int x0, const int y0, const int w, const int h, const int avail_t, const int avail_l, pixel *pdsy)
static int shift(int a, int b)
static const int factor[16]
#define FFSWAP(type, a, b)
static av_always_inline void FUNC intra_pred(HEVCLocalContext *lc, const HEVCPPS *pps, int x0, int y0, int log2_size, int c_idx)
static void FUNC pred_dc(uint8_t *_src, const uint8_t *_top, const uint8_t *_left, ptrdiff_t stride, int log2_size, int c_idx)
static av_always_inline void FUNC pred_planar(uint8_t *_src, const uint8_t *_top, const uint8_t *_left, ptrdiff_t stride, int trafo_size)
static const float pred[4]
int mip_chroma_direct_flag
MipChromaDirectFlag.
int bdpcm_flag[VVC_MAX_SAMPLE_ARRAYS]
BdpcmFlag.
enum IspType isp_split_type
IntraSubPartitionsSplitType.
IntraPredMode intra_pred_mode_y
IntraPredModeY.
uint8_t intra_luma_ref_idx
IntraLumaRefLineIdx[][].
IntraPredMode intra_pred_mode_c
IntraPredModeC.
uint16_t chroma_scale_coeff[LMCS_MAX_BIN_SIZE]
static int ref[MAX_W *MAX_W]
static av_always_inline int diff(const struct color_info *a, const struct color_info *b, const int trans_thresh)
const int8_t ff_vvc_intra_luma_filter[VVC_INTRA_LUMA_TYPES][VVC_INTRA_LUMA_FACTS][VVC_INTRA_LUMA_TAPS]
const uint8_t * ff_vvc_get_mip_matrix(const int size_id, const int mode_id)
static av_always_inline void unpack_mip_info(int *intra_mip_transposed_flag, int *intra_mip_mode, const uint8_t mip_info)
#define LMCS_MAX_BIN_SIZE