[vlc-commits] blend: use GetPackedRgbIndexes()

Rémi Denis-Courmont git at videolan.org
Mon Dec 17 18:46:13 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Dec 17 19:36:30 2018 +0200| [d7d1dca5321b82c8904cc5e8973893d133ecd819] | committer: Rémi Denis-Courmont

blend: use GetPackedRgbIndexes()

And fix big endian support.

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

 modules/video_filter/blend.cpp | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/modules/video_filter/blend.cpp b/modules/video_filter/blend.cpp
index a805e112d6..d0df9cee0a 100644
--- a/modules/video_filter/blend.cpp
+++ b/modules/video_filter/blend.cpp
@@ -281,15 +281,7 @@ public:
             }
             offset_a = 3;
         } else {
-#ifdef WORDS_BIGENDIAN
-            offset_r = (8 * bytes - fmt->i_lrshift) / 8;
-            offset_g = (8 * bytes - fmt->i_lgshift) / 8;
-            offset_b = (8 * bytes - fmt->i_lbshift) / 8;
-#else
-            offset_r = fmt->i_lrshift / 8;
-            offset_g = fmt->i_lgshift / 8;
-            offset_b = fmt->i_lbshift / 8;
-#endif
+            GetPackedRgbIndexes(fmt, &offset_r, &offset_g, &offset_b);
         }
         data = CPicture::getLine<1>(0);
     }
@@ -339,9 +331,9 @@ private:
     {
         return &data[(x + dx) * bytes];
     }
-    unsigned offset_r;
-    unsigned offset_g;
-    unsigned offset_b;
+    int offset_r;
+    int offset_g;
+    int offset_b;
     unsigned offset_a;
     uint8_t *data;
 };



More information about the vlc-commits mailing list