summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-11-04 05:15:27 +0100
committerDudemanguy <random342@airmail.cc>2024-01-22 14:54:55 +0000
commit47be5ad4aaa20df4bb1577110198d5aab3c88925 (patch)
tree6829c9e597217dd2b928e3e5f474adcbf0eadc06 /video/out
parent0ac7a40dac2411cf9be429f611b8966560bb3f0c (diff)
downloadmpv-47be5ad4aaa20df4bb1577110198d5aab3c88925.tar.bz2
mpv-47be5ad4aaa20df4bb1577110198d5aab3c88925.tar.xz
csputils: replace mp_chroma_location with pl_chroma_location
Diffstat (limited to 'video/out')
-rw-r--r--video/out/gpu/video.c10
-rw-r--r--video/out/placebo/utils.c13
-rw-r--r--video/out/placebo/utils.h2
-rw-r--r--video/out/vo_gpu_next.c2
4 files changed, 6 insertions, 21 deletions
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c
index 6714ef04b1..5e0175366a 100644
--- a/video/out/gpu/video.c
+++ b/video/out/gpu/video.c
@@ -762,16 +762,16 @@ static void pass_get_images(struct gl_video *p, struct video_image *vimg,
struct gl_transform chroma = {{{ls_w, 0.0}, {0.0, ls_h}}};
- if (p->image_params.chroma_location != MP_CHROMA_CENTER) {
- int cx, cy;
- mp_get_chroma_location(p->image_params.chroma_location, &cx, &cy);
+ if (p->image_params.chroma_location != PL_CHROMA_CENTER) {
+ float cx, cy;
+ pl_chroma_location_offset(p->image_params.chroma_location, &cx, &cy);
// By default texture coordinates are such that chroma is centered with
// any chroma subsampling. If a specific direction is given, make it
// so that the luma and chroma sample line up exactly.
// For 4:4:4, setting chroma location should have no effect at all.
// luma sample size (in chroma coord. space)
- chroma.t[0] = ls_w < 1 ? ls_w * -cx / 2 : 0;
- chroma.t[1] = ls_h < 1 ? ls_h * -cy / 2 : 0;
+ chroma.t[0] = ls_w < 1 ? ls_w * -cx : 0;
+ chroma.t[1] = ls_h < 1 ? ls_h * -cy : 0;
}
memset(img, 0, 4 * sizeof(img[0]));
diff --git a/video/out/placebo/utils.c b/video/out/placebo/utils.c
index ffba30401f..e01c371039 100644
--- a/video/out/placebo/utils.c
+++ b/video/out/placebo/utils.c
@@ -72,19 +72,6 @@ void mppl_log_set_probing(pl_log log, bool probing)
pl_log_update(log, &params);
}
-enum pl_chroma_location mp_chroma_to_pl(enum mp_chroma_location chroma)
-{
- switch (chroma) {
- case MP_CHROMA_AUTO: return PL_CHROMA_UNKNOWN;
- case MP_CHROMA_TOPLEFT: return PL_CHROMA_TOP_LEFT;
- case MP_CHROMA_LEFT: return PL_CHROMA_LEFT;
- case MP_CHROMA_CENTER: return PL_CHROMA_CENTER;
- case MP_CHROMA_COUNT: return PL_CHROMA_COUNT;
- }
-
- MP_ASSERT_UNREACHABLE();
-}
-
void mp_map_dovi_metadata_to_pl(struct mp_image *mpi,
struct pl_frame *frame)
{
diff --git a/video/out/placebo/utils.h b/video/out/placebo/utils.h
index 84b2e0468e..d2fa619b4a 100644
--- a/video/out/placebo/utils.h
+++ b/video/out/placebo/utils.h
@@ -27,7 +27,5 @@ static inline struct pl_rect2d mp_rect2d_to_pl(struct mp_rect rc)
};
}
-enum pl_chroma_location mp_chroma_to_pl(enum mp_chroma_location chroma);
-
void mp_map_dovi_metadata_to_pl(struct mp_image *mpi,
struct pl_frame *frame);
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c
index fc9ccbe38d..06a9ce4a4f 100644
--- a/video/out/vo_gpu_next.c
+++ b/video/out/vo_gpu_next.c
@@ -664,7 +664,7 @@ static bool map_frame(pl_gpu gpu, pl_tex *tex, const struct pl_source_frame *src
}
// Update chroma location, must be done after initializing planes
- pl_frame_set_chroma_location(frame, mp_chroma_to_pl(par->chroma_location));
+ pl_frame_set_chroma_location(frame, par->chroma_location);
// Set the frame DOVI metadata
mp_map_dovi_metadata_to_pl(mpi, frame);