summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-10-20 19:39:10 +0200
committerwm4 <wm4@nowhere>2019-10-20 19:41:18 +0200
commit631379bea9a6f490f221a1326b1fe674e2651203 (patch)
tree3c1121140439179d1d61f52111a3dfb81b8cc9ad
parent8f5979c5d8a8306ebf7e1092c614f26f2366db98 (diff)
downloadmpv-631379bea9a6f490f221a1326b1fe674e2651203.tar.bz2
mpv-631379bea9a6f490f221a1326b1fe674e2651203.tar.xz
zimg: move component order arrays to top of file
-rw-r--r--video/zimg.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/video/zimg.c b/video/zimg.c
index d9fde65f19..fcd1034cd0 100644
--- a/video/zimg.c
+++ b/video/zimg.c
@@ -51,6 +51,10 @@ const struct m_sub_options zimg_conf = {
},
};
+// Component ID (see struct mp_regular_imgfmt_plane.components) to plane index.
+static const int corder_gbrp[4] = {0, 2, 0, 1};
+static const int corder_yuv[4] = {0, 0, 1, 2};
+
struct mp_zimg_repack {
bool pack; // if false, this is for unpacking
struct mp_image_params fmt; // original mp format (possibly packed format)
@@ -339,12 +343,10 @@ static void setup_regular_rgb_packer(struct mp_zimg_repack *r)
enum mp_csp forced_csp = mp_imgfmt_get_forced_csp(r->zimgfmt);
if (forced_csp == MP_CSP_RGB || forced_csp == MP_CSP_XYZ) {
typeflag = MP_IMGFLAG_RGB_P;
- static const int gbrp[4] = {0, 2, 0, 1};
- corder = gbrp;
+ corder = corder_gbrp;
} else {
typeflag = MP_IMGFLAG_YUV_P;
- static const int yuv[4] = {0, 0, 1, 2};
- corder = yuv;
+ corder = corder_yuv;
}
// Find a compatible planar format (typically AV_PIX_FMT_GBRP).