Skip to content
  1. May 17, 2021
    • Ralph Giles's avatar
      Fix parentheses warning around shifts. · ed7d6ef4
      Ralph Giles authored
      The output code uses (width + n) >> k to round up to the
      nearest boundary in calculating buffer sizes. Because
      many people are uncertain about the relative precedence
      of addition and shift operations, gcc warned about the
      code as-written.
      
      Abstract the calculation into a local variable for better
      readability and add parentheses to address the warning.
      ed7d6ef4
    • Ralph Giles's avatar
      Add multiple-include protection to global.h. · aa82a8b8
      Ralph Giles authored
      It's not a large file, but it ends up being read up to three times,
      and this matches style with configfile.h.
      aa82a8b8
    • Ralph Giles's avatar
      Reformat code and clean up whitespace. · e00e4fe9
      Ralph Giles authored
      Run the code through clang_format to clean up inconsistent
      whitespace. This also changed the brace style. Follow up
      with some manual reformatting of long doc comments mangled
      by clang_format, the config struct, and expand tabs in
      the config file.
      
      Also include global.h directly in configfile.h so the
      definition of `InputParameters` is available regardless
      of the include order.
      e00e4fe9
    • Ralph Giles's avatar
      Add gitlab continuous integration. · 256aadce
      Ralph Giles authored
      Invoke the makefile so we get some build feedback on repositories
      hosted under gitlab.
      256aadce
    • Ralph Giles's avatar
      Replace non-portable _itoa calls with snprintf. · 43eb4400
      Ralph Giles authored
      The code uses the MSVC-specific `_itoa` function to format
      numbered filenames. Replace this with the portable `snprintf`
      which is already used elsewhere, and performs bounds checks.
      
      Also expand the allowed number of digits to avoid overflow.
      The previous assumption of no more that 5 digits is exceeded
      is less than an hour of video. The new maximum of 23 is enough
      for a 64-bit integer, so even without configuration validation
      it will work as well as the rest of the code does.
      43eb4400
    • Ralph Giles's avatar
      Remove _snprintf fallback. · 1252f5aa
      Ralph Giles authored
      The code uses the `snprintf` function, standardized in C99.
      
      Prior to Visual Studio 2015 this was not supported on
      Microsoft Windows, so the code used a #define to map it
      to the `_snprintf` extension. The Makefile had the opposite
      define to undo this mapping for non-windows platforms.
      
      Since the fallback hasn't been necessary for some years,
      remove all references to _snprintf in favour of the
      standard library function.
      1252f5aa
    • Ralph Giles's avatar
      Move global variable declarations into sgi2yuv.c. · 30ce183e
      Ralph Giles authored
      The globals.h header declared a number of global variables
      as well as types, resulting in duplicate symbol warnings.
      This might have compiled 15 years ago, but it doesn't
      now.
      
      Instead, move the declarations into sgi2yuv.c where they
      are mostly used. The errortext global is converted to
      an extern in the header so it can also be used by the
      config file reader.
      30ce183e
    • Ralph Giles's avatar
      Make configinput private. · 7cb7eeda
      Ralph Giles authored
      Move the declaration of `configinput` into the protected section
      of configfile.h so it's only active when included in configfile.c.
      
      This addresses a multily-defined symbol error with gcc 10
      when configfile.h is included in other modules within the
      same target executable.
      7cb7eeda
  2. May 15, 2021
    • Ralph Giles's avatar
      Remove trailing whitespace. · 15c0e8c7
      Ralph Giles authored
      This is a standard style nit and makes editing the file cleaner.
      15c0e8c7
    • Ralph Giles's avatar
      Process data in row-major order. · 9db5b8fa
      Ralph Giles authored
      Apply a patch from derf (Timothy Terriberry) to access the image
      data in row-major instead of column-major order. This vastly
      improves cache coherency, speeding up the code significantly
      on modern architectures.
      
      The patch also adds a simple Makefile and cleans up various
      minor issues with the code.
      9db5b8fa
    • Ralph Giles's avatar
      Import sgi2yuv v0.4. · a10e3f12
      Ralph Giles authored
      This is the source of the 0.4 release of Tobias Oelbaum's
      sgi2yuv utility, for reading video in the format originally
      used by Irix Silicon Graphics workstations.
      
      This is from the zip file published in 2006 at
      http://www.ldv.ei.tum.de/Members/tobias/videotools/sgi2yuv.zip
      but excluding the compiled 32-bit Windows executable.
      a10e3f12
Loading