diff options
Diffstat (limited to 'video')
-rw-r--r-- | video/csputils.c | 8 | ||||
-rw-r--r-- | video/csputils.h | 9 | ||||
-rw-r--r-- | video/filter/vf_format.c | 4 | ||||
-rw-r--r-- | video/mp_image.c | 8 | ||||
-rw-r--r-- | video/mp_image.h | 1 | ||||
-rw-r--r-- | video/out/gpu/video.c | 2 | ||||
-rw-r--r-- | video/out/placebo/utils.c | 11 | ||||
-rw-r--r-- | video/out/placebo/utils.h | 1 | ||||
-rw-r--r-- | video/out/vo_gpu_next.c | 2 | ||||
-rw-r--r-- | video/zimg.c | 2 |
10 files changed, 13 insertions, 35 deletions
diff --git a/video/csputils.c b/video/csputils.c index 3b43ba9f5b..e1b7823b33 100644 --- a/video/csputils.c +++ b/video/csputils.c @@ -112,10 +112,10 @@ const struct m_opt_choice_alternatives mp_chroma_names[] = { {0} }; -const struct m_opt_choice_alternatives mp_alpha_names[] = { - {"auto", MP_ALPHA_AUTO}, - {"straight", MP_ALPHA_STRAIGHT}, - {"premul", MP_ALPHA_PREMUL}, +const struct m_opt_choice_alternatives pl_alpha_names[] = { + {"auto", PL_ALPHA_UNKNOWN}, + {"straight", PL_ALPHA_INDEPENDENT}, + {"premul", PL_ALPHA_PREMULTIPLIED}, {0} }; diff --git a/video/csputils.h b/video/csputils.h index 80901659cf..ac37e205ab 100644 --- a/video/csputils.h +++ b/video/csputils.h @@ -120,14 +120,7 @@ enum mp_chroma_location { }; extern const struct m_opt_choice_alternatives mp_chroma_names[]; - -enum mp_alpha_type { - MP_ALPHA_AUTO, - MP_ALPHA_STRAIGHT, - MP_ALPHA_PREMUL, -}; - -extern const struct m_opt_choice_alternatives mp_alpha_names[]; +extern const struct m_opt_choice_alternatives pl_alpha_names[]; extern const struct m_sub_options mp_csp_equalizer_conf; diff --git a/video/filter/vf_format.c b/video/filter/vf_format.c index 4a14fc9102..6a3e9fd390 100644 --- a/video/filter/vf_format.c +++ b/video/filter/vf_format.c @@ -92,7 +92,7 @@ static void set_params(struct vf_format_opts *p, struct mp_image_params *out, if (p->rotate >= 0) out->rotate = p->rotate; if (p->alpha) - out->alpha = p->alpha; + out->repr.alpha = p->alpha; if (p->w > 0 && set_size) out->w = p->w; @@ -213,7 +213,7 @@ static const m_option_t vf_opts_fields[] = { {"chroma-location", OPT_CHOICE_C(chroma_location, mp_chroma_names)}, {"stereo-in", OPT_CHOICE_C(stereo_in, mp_stereo3d_names)}, {"rotate", OPT_INT(rotate), M_RANGE(-1, 359)}, - {"alpha", OPT_CHOICE_C(alpha, mp_alpha_names)}, + {"alpha", OPT_CHOICE_C(alpha, pl_alpha_names)}, {"w", OPT_INT(w)}, {"h", OPT_INT(h)}, {"dw", OPT_INT(dw)}, diff --git a/video/mp_image.c b/video/mp_image.c index b499d89f97..44bd6feaa6 100644 --- a/video/mp_image.c +++ b/video/mp_image.c @@ -523,7 +523,6 @@ void mp_image_copy_attributes(struct mp_image *dst, struct mp_image *src) dst->params.repr = src->params.repr; dst->params.light = src->params.light; dst->params.chroma_location = src->params.chroma_location; - dst->params.alpha = src->params.alpha; dst->params.crop = src->params.crop; dst->nominal_fps = src->nominal_fps; @@ -790,9 +789,9 @@ char *mp_image_params_to_str_buf(char *b, size_t bs, mp_snprintf_cat(b, bs, " stereo=%s", MP_STEREO3D_NAME_DEF(p->stereo3d, "?")); } - if (p->alpha) { + if (p->repr.alpha) { mp_snprintf_cat(b, bs, " A=%s", - m_opt_choice_str(mp_alpha_names, p->alpha)); + m_opt_choice_str(pl_alpha_names, p->repr.alpha)); } } else { snprintf(b, bs, "???"); @@ -842,7 +841,6 @@ bool mp_image_params_equal(const struct mp_image_params *p1, p1->chroma_location == p2->chroma_location && p1->rotate == p2->rotate && p1->stereo3d == p2->stereo3d && - p1->alpha == p2->alpha && mp_rect_equals(&p1->crop, &p2->crop); } @@ -1052,7 +1050,7 @@ struct mp_image *mp_image_from_av_frame(struct AVFrame *src) dst->params.stereo3d = p->stereo3d; // Might be incorrect if colorspace changes. dst->params.light = p->light; - dst->params.alpha = p->alpha; + dst->params.repr.alpha = p->repr.alpha; } sd = av_frame_get_side_data(src, AV_FRAME_DATA_DISPLAYMATRIX); diff --git a/video/mp_image.h b/video/mp_image.h index c1ba89ee0a..443488c9e1 100644 --- a/video/mp_image.h +++ b/video/mp_image.h @@ -54,7 +54,6 @@ struct mp_image_params { // The image should be rotated clockwise (0-359 degrees). int rotate; enum mp_stereo3d_mode stereo3d; // image is encoded with this mode - enum mp_alpha_type alpha; // usually auto; only set if explicitly known struct mp_rect crop; // crop applied on image }; diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c index d685b978d2..6714ef04b1 100644 --- a/video/out/gpu/video.c +++ b/video/out/gpu/video.c @@ -2397,7 +2397,7 @@ static void pass_convert_yuv(struct gl_video *p) p->components = 3; if (!p->has_alpha || p->opts.alpha_mode == ALPHA_NO) { GLSL(color.a = 1.0;) - } else if (p->image_params.alpha == MP_ALPHA_PREMUL) { + } else if (p->image_params.repr.alpha == PL_ALPHA_PREMULTIPLIED) { p->components = 4; } else { p->components = 4; diff --git a/video/out/placebo/utils.c b/video/out/placebo/utils.c index b60e4ff5bc..ffba30401f 100644 --- a/video/out/placebo/utils.c +++ b/video/out/placebo/utils.c @@ -72,17 +72,6 @@ void mppl_log_set_probing(pl_log log, bool probing) pl_log_update(log, ¶ms); } -enum pl_alpha_mode mp_alpha_to_pl(enum mp_alpha_type alpha) -{ - switch (alpha) { - case MP_ALPHA_AUTO: return PL_ALPHA_UNKNOWN; - case MP_ALPHA_STRAIGHT: return PL_ALPHA_INDEPENDENT; - case MP_ALPHA_PREMUL: return PL_ALPHA_PREMULTIPLIED; - } - - MP_ASSERT_UNREACHABLE(); -} - enum pl_chroma_location mp_chroma_to_pl(enum mp_chroma_location chroma) { switch (chroma) { diff --git a/video/out/placebo/utils.h b/video/out/placebo/utils.h index 103fa4ce24..84b2e0468e 100644 --- a/video/out/placebo/utils.h +++ b/video/out/placebo/utils.h @@ -27,7 +27,6 @@ static inline struct pl_rect2d mp_rect2d_to_pl(struct mp_rect rc) }; } -enum pl_alpha_mode mp_alpha_to_pl(enum mp_alpha_type alpha); enum pl_chroma_location mp_chroma_to_pl(enum mp_chroma_location chroma); void mp_map_dovi_metadata_to_pl(struct mp_image *mpi, diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index dee8bc2301..fc9ccbe38d 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -575,7 +575,7 @@ static bool map_frame(pl_gpu gpu, pl_tex *tex, const struct pl_source_frame *src .repr = { .sys = par->repr.sys, .levels = par->repr.levels, - .alpha = mp_alpha_to_pl(par->alpha), + .alpha = par->repr.alpha, }, .profile = { .data = mpi->icc_profile ? mpi->icc_profile->data : NULL, diff --git a/video/zimg.c b/video/zimg.c index f744fe2c4b..4ea32af83a 100644 --- a/video/zimg.c +++ b/video/zimg.c @@ -375,7 +375,7 @@ static bool setup_format(zimg_image_format *zfmt, struct mp_zimg_repack *r, r->z_planes[3] = n; // alpha, always plane 4 in zimg #if HAVE_ZIMG_ALPHA - zfmt->alpha = fmt.alpha == MP_ALPHA_PREMUL + zfmt->alpha = fmt.repr.alpha == PL_ALPHA_PREMULTIPLIED ? ZIMG_ALPHA_PREMULTIPLIED : ZIMG_ALPHA_STRAIGHT; #else return false; |