[vlc-commits] nvdec: use vlc_align helper

Marvin Scholz git at videolan.org
Tue Mar 24 19:20:38 CET 2020


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Tue Mar 24 13:35:27 2020 +0100| [29e37a8c5cc6ef1f75c1e4258cbc7d72d7c29bf4] | committer: Marvin Scholz

nvdec: use vlc_align helper

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

 modules/hw/nvdec/nvdec.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/modules/hw/nvdec/nvdec.c b/modules/hw/nvdec/nvdec.c
index 76aec6a246..bfe7c4e30a 100644
--- a/modules/hw/nvdec/nvdec.c
+++ b/modules/hw/nvdec/nvdec.c
@@ -817,7 +817,6 @@ static int OpenDecoder(vlc_object_t *p_this)
     int i_sar_num, i_sar_den = 0;
 
     // try different output
-#define ALIGN(v, mod) ((v + (mod - 1)) & ~(mod - 1))
     if (p_sys->b_is_hxxx)
     {
         uint8_t i_chroma_idc, i_depth_chroma;
@@ -854,7 +853,7 @@ static int OpenDecoder(vlc_object_t *p_this)
             }
         }
 
-        p_dec->fmt_out.video.i_width = ALIGN(i_w, OUTPUT_WIDTH_ALIGN);
+        p_dec->fmt_out.video.i_width = vlc_align(i_w, OUTPUT_WIDTH_ALIGN);
         p_dec->fmt_out.video.i_height = i_h;
 
         if (!p_dec->fmt_in.video.i_visible_width || !p_dec->fmt_in.video.i_visible_height)
@@ -871,7 +870,7 @@ static int OpenDecoder(vlc_object_t *p_this)
     }
     else
     {
-        p_dec->fmt_out.video.i_width = ALIGN(p_dec->fmt_in.video.i_width, OUTPUT_WIDTH_ALIGN);
+        p_dec->fmt_out.video.i_width = vlc_align(p_dec->fmt_in.video.i_width, OUTPUT_WIDTH_ALIGN);
         p_dec->fmt_out.video.i_height = p_dec->fmt_in.video.i_height;
         cudaChroma = cudaVideoChromaFormat_420;
         i_depth_luma = 8;



More information about the vlc-commits mailing list