[FFmpeg-devel] [PATCH v2 1/5] swscale/rgb2xyz: minor style fixes

Niklas Haas ffmpeg at haasn.xyz
Mon Oct 7 20:52:59 EEST 2024


From: Niklas Haas <git at haasn.dev>

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git at haasn.dev>
---
 libswscale/swscale.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 0abc84d33b..fa8eed10d9 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -640,11 +640,10 @@ static int check_image_pointers(const uint8_t * const data[4], enum AVPixelForma
 static void xyz12Torgb48(struct SwsContext *c, uint16_t *dst,
                          const uint16_t *src, int stride, int h)
 {
-    int xp,yp;
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat);
 
-    for (yp=0; yp<h; yp++) {
-        for (xp=0; xp+2<stride; xp+=3) {
+    for (int yp = 0; yp < h; yp++) {
+        for (int xp = 0; xp + 2 < stride; xp += 3) {
             int x, y, z, r, g, b;
 
             if (desc->flags & AV_PIX_FMT_FLAG_BE) {
@@ -657,9 +656,9 @@ static void xyz12Torgb48(struct SwsContext *c, uint16_t *dst,
                 z = AV_RL16(src + xp + 2);
             }
 
-            x = c->xyzgamma[x>>4];
-            y = c->xyzgamma[y>>4];
-            z = c->xyzgamma[z>>4];
+            x = c->xyzgamma[x >> 4];
+            y = c->xyzgamma[y >> 4];
+            z = c->xyzgamma[z >> 4];
 
             // convert from XYZlinear to sRGBlinear
             r = c->xyz2rgb_matrix[0][0] * x +
@@ -696,11 +695,10 @@ static void xyz12Torgb48(struct SwsContext *c, uint16_t *dst,
 static void rgb48Toxyz12(struct SwsContext *c, uint16_t *dst,
                          const uint16_t *src, int stride, int h)
 {
-    int xp,yp;
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->dstFormat);
 
-    for (yp=0; yp<h; yp++) {
-        for (xp=0; xp+2<stride; xp+=3) {
+    for (int yp = 0; yp < h; yp++) {
+        for (int xp = 0; xp + 2 < stride; xp += 3) {
             int x, y, z, r, g, b;
 
             if (desc->flags & AV_PIX_FMT_FLAG_BE) {
-- 
2.46.1



More information about the ffmpeg-devel mailing list