From 0c19ed296badeaac152b9f922295afc76884e728 Mon Sep 17 00:00:00 2001
From: Niklas Haas <git@haasn.xyz>
Date: Tue, 26 May 2020 17:32:43 +0200
Subject: [PATCH] colorspace: fix default chroma location

Simple oversight. This should be PL_CHROMA_LEFT, not PL_CHROMA_TOP_LEFT.
Our own documentation gets it right, I just had the wrong name in my
head when writing the code.
---
 src/colorspace.c                    | 2 +-
 src/include/libplacebo/colorspace.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/colorspace.c b/src/colorspace.c
index a605d67f4..e6bcce55d 100644
--- a/src/colorspace.c
+++ b/src/colorspace.c
@@ -372,7 +372,7 @@ void pl_chroma_location_offset(enum pl_chroma_location loc, float *x, float *y)
     *x = *y = 0;
 
     // This is the majority of subsampled chroma content out there
-    loc = PL_DEF(loc, PL_CHROMA_TOP_LEFT);
+    loc = PL_DEF(loc, PL_CHROMA_LEFT);
 
     switch (loc) {
     case PL_CHROMA_LEFT:
diff --git a/src/include/libplacebo/colorspace.h b/src/include/libplacebo/colorspace.h
index 471399350..49671f577 100644
--- a/src/include/libplacebo/colorspace.h
+++ b/src/include/libplacebo/colorspace.h
@@ -343,7 +343,7 @@ enum pl_chroma_location {
 // Fills *x and *y with the offset in luma pixels corresponding to a given
 // chroma location.
 //
-// Note: PL_CHROMA_UNKNOWN defaults to PL_CHROMA_TOP_LEFT
+// Note: PL_CHROMA_UNKNOWN defaults to PL_CHROMA_LEFT
 void pl_chroma_location_offset(enum pl_chroma_location loc, float *x, float *y);
 
 // Represents a single CIE xy coordinate (e.g. CIE Yxy with Y = 1.0)
-- 
GitLab