[FFmpeg-cvslog] swscale/rgb2xyz: minor style fixes

Niklas Haas git at videolan.org
Wed Oct 9 14:21:29 EEST 2024


ffmpeg | branch: master | Niklas Haas <git at haasn.dev> | Mon Oct  7 18:50:44 2024 +0200| [ea228fc41524caff68a20b6d18a9b1ddcc927928] | committer: Niklas Haas

swscale/rgb2xyz: minor style fixes

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git at haasn.dev>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ea228fc41524caff68a20b6d18a9b1ddcc927928
---

 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) {



More information about the ffmpeg-cvslog mailing list