diff mbox series

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

Message ID 20241007175303.576863-1-ffmpeg@haasn.xyz
State New
Headers show
Series [FFmpeg-devel,v2,1/5] swscale/rgb2xyz: minor style fixes | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 fail Make failed

Commit Message

Niklas Haas Oct. 7, 2024, 5:52 p.m. UTC
From: Niklas Haas <git@haasn.dev>

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

Comments

Michael Niedermayer Oct. 7, 2024, 6:34 p.m. UTC | #1
On Mon, Oct 07, 2024 at 07:52:59PM +0200, Niklas Haas wrote:
> From: Niklas Haas <git@haasn.dev>
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Niklas Haas <git@haasn.dev>
> ---
>  libswscale/swscale.c | 16 +++++++---------
>  1 file changed, 7 insertions(+), 9 deletions(-)

ok

thx

[...]
diff mbox series

Patch

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