Skip to content
Snippets Groups Projects
  1. Mar 09, 2025
  2. Mar 08, 2025
    • Petter Reinholdtsen's avatar
      Adjusted OC_DCT_CW_PACK() for well defined C99 behaviour with negative _mag. · a768e356
      Petter Reinholdtsen authored
      Instead of shifting the negative number, shift one bit and multiply
      it with the negative number.
      
      Fixes the following clang message:
      ../../lib/decode.c:195:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0,10, -1,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:198:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 0,  0,1),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:208:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 1, -1,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:210:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 2, -1,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:212:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 3, -1,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:214:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 4, -1,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:216:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 5, -1,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:220:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 1, -2,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:221:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 1, -3,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:227:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 6, -1,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:228:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 7, -1,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:229:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 8, -1,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:230:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 9, -1,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:236:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 2, -2,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:237:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 3, -2,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:238:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 2, -3,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:239:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 3, -3,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:242:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 0,  0,1),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:253:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 0, -1,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:257:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 0, -2,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:260:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 0, -3,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:262:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 0, -4,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:264:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 0, -5,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:266:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 0, -6,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:270:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 0, -7,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:271:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 0, -8,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:277:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 0, -9,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:278:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 0,-10,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:279:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 0,-11,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      ../../lib/decode.c:280:3: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        OC_DCT_CW_PACK( 0, 0,-12,0),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../lib/decode.c:150:16: note: expanded from macro 'OC_DCT_CW_PACK'
       (_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
       ~~~~~~~~~~~~~~^
      
      Fixes #2322
      a768e356
    • Petter Reinholdtsen's avatar
      Make sure difference in encfrag.c is signed when taking absolute value. · f7c9abd4
      Petter Reinholdtsen authored
      Switching type of cd from unsigned to int make sure the difference
      passed to abs() wil be a signed value.
      
      As dc is calculated to at most ((8 * 8 * (2^8-1)) + 32) / 64, ie 255
      and the highest value it can hold before it is shifted 6 bit positions
      to the right is (8 * 8 * (2^8-1)) + 32) ie. 16352, it should fit nicely
      in an integer on any platform where int is at least 16 bit.
      
      Fixes this clang message:
      
      ../../../lib/encfrag.c:104:26: warning: taking the absolute value of unsigned type 'unsigned int' has no effect [-Wabsolute-value]
          for(j=0;j<8;j++)sad+=abs(_src[j]-dc);
                               ^
      ../../../lib/encfrag.c:104:26: note: remove the call to 'abs' since unsigned values cannot be negative
          for(j=0;j<8;j++)sad+=abs(_src[j]-dc);
                               ^~~
      f7c9abd4
    • Petter Reinholdtsen's avatar
      Stopped calculated unused total in oc_huff_tree_size(). · 4b90527c
      Petter Reinholdtsen authored
      This get rid of the following clang warning:
      
      huffdec.c:439:7: warning: variable 'total' set but not used [-Wunused-but-set-variable]
        int total;
            ^
      4b90527c
    • Petter Reinholdtsen's avatar
      Adjusted macros to avoid working outside OC_IDCT_CONSTS array. · 877ac811
      Petter Reinholdtsen authored
      The OC_IDCT_CONSTS array in x86/sse2idct.c is 64 elements long, so
      not use trying to pretend it is 128 elements long.
      
      This avoid the following copmiler message:
      
      In function 'oc_idct8x8_slow_mmx',
          inlined from 'oc_idct8x8_mmx' at ../../lib/x86/mmxidct.c:555:8:
      ../../lib/x86/mmxidct.c:290:3: warning: array subscript 'const struct <anonymous>[0]' is partly outside array bounds of 'const short unsigned int[64]' [-Warray-bounds]
        290 |   __asm__ __volatile__(
            |   ^~~~~~~
      In file included from ../../lib/x86/mmxidct.c:20:
      ../../lib/x86/x86int.h: In function 'oc_idct8x8_mmx':
      ../../lib/x86/x86int.h:95:58: note: object 'OC_IDCT_CONSTS' of size 128
         95 | extern const unsigned short __attribute__((aligned(16))) OC_IDCT_CONSTS[64];
            |                                                          ^~~~~~~~~~~~~~
      In function 'oc_idct8x8_10_mmx',
          inlined from 'oc_idct8x8_mmx' at ../../lib/x86/mmxidct.c:554:20:
      ../../lib/x86/mmxidct.c:492:3: warning: array subscript 'const struct <anonymous>[0]' is partly outside array bounds of 'const short unsigned int[64]' [-Warray-bounds]
        492 |   __asm__ __volatile__(
            |   ^~~~~~~
      ../../lib/x86/x86int.h: In function 'oc_idct8x8_mmx':
      ../../lib/x86/x86int.h:95:58: note: object 'OC_IDCT_CONSTS' of size 128
         95 | extern const unsigned short __attribute__((aligned(16))) OC_IDCT_CONSTS[64];
            |                                                          ^~~~~~~~~~~~~~
        CC       x86/sse2idct.lo
      In function 'oc_idct8x8_slow_sse2',
          inlined from 'oc_idct8x8_sse2' at ../../lib/x86/sse2idct.c:453:8:
      ../../lib/x86/sse2idct.c:213:3: warning: array subscript 'const struct <anonymous>[0]' is partly outside array bounds of 'const short unsigned int[64]' [-Warray-bounds]
        213 |   __asm__ __volatile__(
            |   ^~~~~~~
      ../../lib/x86/sse2idct.c: In function 'oc_idct8x8_sse2':
      ../../lib/x86/sse2idct.c:26:56: note: object 'OC_IDCT_CONSTS' of size 128
         26 | const unsigned short __attribute__((aligned(16),used)) OC_IDCT_CONSTS[64]={
            |                                                        ^~~~~~~~~~~~~~
      In function 'oc_idct8x8_10_sse2',
          inlined from 'oc_idct8x8_sse2' at ../../lib/x86/sse2idct.c:452:20:
      ../../lib/x86/sse2idct.c:398:3: warning: array subscript 'const struct <anonymous>[0]' is partly outside array bounds of 'const short unsigned int[64]' [-Warray-bounds]
        398 |   __asm__ __volatile__(
            |   ^~~~~~~
      ../../lib/x86/sse2idct.c: In function 'oc_idct8x8_sse2':
      ../../lib/x86/sse2idct.c:26:56: note: object 'OC_IDCT_CONSTS' of size 128
         26 | const unsigned short __attribute__((aligned(16),used)) OC_IDCT_CONSTS[64]={
            |                                                        ^~~~~~~~~~~~~~
      877ac811
  3. Mar 07, 2025
    • Petter Reinholdtsen's avatar
      Use correct array length in method definitions in analyze.c. · bb3e5cad
      Petter Reinholdtsen authored
      The arrays are 5 elements long, but some intermittent methods claim it
      was just four elements.
      bb3e5cad
    • Petter Reinholdtsen's avatar
      Corrected method definition for oc_enc_frag_sub_128_c(). · c2fe318c
      Petter Reinholdtsen authored
      Made sure the implementation matches the prototype.
      c2fe318c
    • Petter Reinholdtsen's avatar
    • Petter Reinholdtsen's avatar
      Switched valgrind run to use LOG_COMPILER and fail on valgrind errors. · f306a235
      Petter Reinholdtsen authored
      This will avoid running valgrind on bash and instead validate the
      test programs themselves.
      f306a235
    • Billae's avatar
    • Petter Reinholdtsen's avatar
      Improve encoder example to reject audio without any channels. · 56615e23
      Petter Reinholdtsen authored
      This avoid a crash on bogus input, just exit with a message instead.
      
      Fixes #2305
      56615e23
    • Petter Reinholdtsen's avatar
      Replaced obsolete uint32 and uint8 with more standard types in example. · 01e16d5d
      Petter Reinholdtsen authored
      Using ogg_uint32_t and uint8_t instead.
      
      Get rid of the following compiler message:
      
      ../../examples/tiff2theora.c:283:1: warning: ‘uint32’ is deprecated [-Wdeprecated-declarations]
        283 | rgb_to_yuv(uint32 *raster,
            | ^~~~~~~~~~
      ../../examples/tiff2theora.c: In function ‘rgb_to_yuv’:
      ../../examples/tiff2theora.c:314:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations]
        314 |         uint8 r0 = TIFFGetR(raster[(h-y)*w + x]);
            |         ^~~~~
      ../../examples/tiff2theora.c:315:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations]
        315 |         uint8 g0 = TIFFGetG(raster[(h-y)*w + x]);
            |         ^~~~~
      ../../examples/tiff2theora.c:316:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations]
        316 |         uint8 b0 = TIFFGetB(raster[(h-y)*w + x]);
            |         ^~~~~
      ../../examples/tiff2theora.c:317:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations]
        317 |         uint8 r1 = TIFFGetR(raster[(h-y)*w + x1]);
            |         ^~~~~
      ../../examples/tiff2theora.c:318:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations]
        318 |         uint8 g1 = TIFFGetG(raster[(h-y)*w + x1]);
            |         ^~~~~
      ../../examples/tiff2theora.c:319:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations]
        319 |         uint8 b1 = TIFFGetB(raster[(h-y)*w + x1]);
            |         ^~~~~
      ../../examples/tiff2theora.c:320:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations]
        320 |         uint8 r2 = TIFFGetR(raster[(h-y1)*w + x]);
            |         ^~~~~
      ../../examples/tiff2theora.c:321:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations]
        321 |         uint8 g2 = TIFFGetG(raster[(h-y1)*w + x]);
            |         ^~~~~
      ../../examples/tiff2theora.c:322:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations]
        322 |         uint8 b2 = TIFFGetB(raster[(h-y1)*w + x]);
            |         ^~~~~
      ../../examples/tiff2theora.c:323:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations]
        323 |         uint8 r3 = TIFFGetR(raster[(h-y1)*w + x1]);
            |         ^~~~~
      ../../examples/tiff2theora.c:324:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations]
        324 |         uint8 g3 = TIFFGetG(raster[(h-y1)*w + x1]);
            |         ^~~~~
      ../../examples/tiff2theora.c:325:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations]
        325 |         uint8 b3 = TIFFGetB(raster[(h-y1)*w + x1]);
            |         ^~~~~
      ../../examples/tiff2theora.c:347:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations]
        347 |         uint8 r = TIFFGetR(raster[(h-y)*w + x]);
            |         ^~~~~
      ../../examples/tiff2theora.c:348:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations]
        348 |         uint8 g = TIFFGetG(raster[(h-y)*w + x]);
            |         ^~~~~
      ../../examples/tiff2theora.c:349:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations]
        349 |         uint8 b = TIFFGetB(raster[(h-y)*w + x]);
            |         ^~~~~
      ../../examples/tiff2theora.c:360:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations]
        360 |         uint8 r0 = TIFFGetR(raster[(h-y)*w + x]);
            |         ^~~~~
      ../../examples/tiff2theora.c:361:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations]
        361 |         uint8 g0 = TIFFGetG(raster[(h-y)*w + x]);
            |         ^~~~~
      ../../examples/tiff2theora.c:362:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations]
        362 |         uint8 b0 = TIFFGetB(raster[(h-y)*w + x]);
            |         ^~~~~
      ../../examples/tiff2theora.c:363:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations]
        363 |         uint8 r1 = TIFFGetR(raster[(h-y)*w + x1]);
            |         ^~~~~
      ../../examples/tiff2theora.c:364:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations]
        364 |         uint8 g1 = TIFFGetG(raster[(h-y)*w + x1]);
            |         ^~~~~
      ../../examples/tiff2theora.c:365:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations]
        365 |         uint8 b1 = TIFFGetB(raster[(h-y)*w + x1]);
            |         ^~~~~
      ../../examples/tiff2theora.c: In function ‘tiff_read’:
      ../../examples/tiff2theora.c:387:3: warning: ‘uint32’ is deprecated [-Wdeprecated-declarations]
        387 |   uint32 width;
            |   ^~~~~~
      ../../examples/tiff2theora.c:388:3: warning: ‘uint32’ is deprecated [-Wdeprecated-declarations]
        388 |   uint32 height;
            |   ^~~~~~
      ../../examples/tiff2theora.c:390:3: warning: ‘uint32’ is deprecated [-Wdeprecated-declarations]
        390 |   uint32 *raster;
            |   ^~~~~~
      ../../examples/tiff2theora.c:404:3: warning: ‘uint32’ is deprecated [-Wdeprecated-declarations]
        404 |   raster = malloc(pixels*sizeof(uint32));
            |   ^~~~~~
      01e16d5d
    • Petter Reinholdtsen's avatar
      Rewrote dump_video example to prefer clock_gettime() over ftime() · 794bf8c6
      Petter Reinholdtsen authored
      The ftime method has been removed from POSIX and is depricated on Linux.
      clock_gettime() work better on Linux, but is not available on Windows,
      so fall back to ftime() if autotools/scons fail to detect clock_gettime().
      
      Based on proposal in
      opusfile!9.
      
      Fixes the following compiler messages:
      
      ../../examples/dump_video.c: In function ‘main’:
      ../../examples/dump_video.c:490:5: warning: ‘ftime’ is deprecated: Use gettimeofday or clock_gettime instead [-Werror=deprecated-declarations]
        490 |     ftime(&start);
            |     ^~~~~
      In file included from ../../examples/dump_video.c:40:
      /usr/include/x86_64-linux-gnu/sys/timeb.h:29:12: note: declared here
         29 | extern int ftime (struct timeb *__timebuf)
            |            ^~~~~
      ../../examples/dump_video.c:491:5: warning: ‘ftime’ is deprecated: Use gettimeofday or clock_gettime instead [-Werror=deprecated-declarations]
        491 |     ftime(&last);
            |     ^~~~~
      /usr/include/x86_64-linux-gnu/sys/timeb.h:29:12: note: declared here
         29 | extern int ftime (struct timeb *__timebuf)
            |            ^~~~~
      ../../examples/dump_video.c:505:13: warning: ‘ftime’ is deprecated: Use gettimeofday or clock_gettime instead [-Werror=deprecated-declarations]
        505 |             ftime(&after);
            |             ^~~~~
      /usr/include/x86_64-linux-gnu/sys/timeb.h:29:12: note: declared here
         29 | extern int ftime (struct timeb *__timebuf)
            |            ^~~~~
      794bf8c6
    • Petter Reinholdtsen's avatar
      Use consistent declaration of oc_state_loop_filter_frag_rows_c(). · 46df56a5
      Petter Reinholdtsen authored
      The header used signed char _bf[256], make sure the method uses the
      same.  Adjust pointer arithmetic to use array notation to make operation
      explicit.
      
      Avoid the following compiler message:
      
      ../../lib/state.c:1056:15: warning: argument 2 of type 'signed char *' declared as a pointer [-Warray-parameter=]
       1056 |  signed char *_bv,int _refi,int _pli,int _fragy0,int _fragy_end){
            |  ~~~~~~~~~~~~~^~~
      In file included from ../../lib/state.c:20:
      ../../lib/state.h:526:14: note: previously declared as an array 'signed char[256]'
        526 |  signed char _bv[256],int _refi,int _pli,int _fragy0,int _fragy_end);
            |  ~~~~~~~~~~~~^~~~~~~~
      46df56a5
    • Petter Reinholdtsen's avatar
    • Petter Reinholdtsen's avatar
      Updated autotools setup to avoid warnings from autogen.sh. · 34bf8766
      Petter Reinholdtsen authored
      This avoid obsolete notation.
      
      Increase autoconf dependency to version 2.71.
      34bf8766
    • Petter Reinholdtsen's avatar
      Made sure libtheoraenc do not need libtheoradec. · 14045376
      Petter Reinholdtsen authored
      Added info.c to libtheoraenc source and dropped library dependency on libtheoradec.
      
      Addresses issue reported in https://bugs.debian.org/923940 about some symbols being unresolved.
      14045376
    • Petter Reinholdtsen's avatar
    • Petter Reinholdtsen's avatar
      Dropped passing dummy variable to select() in example, use NULL instead. · 070b5c40
      Petter Reinholdtsen authored
      Both POSIX, the Linux documentation and UNIX Network Programming volume 1
      by Stephens state that NULL is accepted.
      
      This avoid the following compiler message:
      
      ../../examples/player_example.c: In function ‘main’:
      ../../examples/player_example.c:839:22: warning: passing argument 2 to ‘restrict’-qualified parameter aliases with argument 4 [-Werror=restrict]
        839 |           n=select(n,&empty,&writefs,&empty,&timeout);
            |                      ^~~~~~          ~~~~~~
      ../../examples/player_example.c:843:18: warning: passing argument 2 to ‘restrict’-qualified parameter aliases with argument 4 [-Werror=restrict]
        843 |         select(n,&empty,&writefs,&empty,NULL);
            |                  ^~~~~~          ~~~~~~
      070b5c40
  4. Oct 27, 2020
    • Ralph Giles's avatar
      gitlab-ci: Add scons build. · 71807172
      Ralph Giles authored
      Apparently this still has users, so test it, rather than
      removing it. Verify we can build and clean up without error.
      71807172
    • Ralph Giles's avatar
      Add a gitlab ci configuration. · c5a83d0a
      Ralph Giles authored
      Add a build description for gitlab's continuous integration build
      and test runners. This gives us ongoing converage on commmits
      and merge requests in the upstream repository.
      
      Based on the gcc:9 image we currently use for most projects.
      It already includes make and autotools, but we need to install
      dependencies for the example programs and documentation.
      
        - debian buster has fig2dev in its own package.
        - latex-extras is needed for wrapfig, which has been superceeded
          by lwarp-wrapfig.
      
      NB defining a separate job at the test stage clears all the
      generated artefacts, which means we lose our configure script
      and makefiles. Therefore isn't more efficient to just do the
      tests as extra steps in the build stage.
      c5a83d0a
  5. Oct 24, 2020
  6. Oct 22, 2020
    • Zebediah Figura's avatar
      Avoid creating a Cairo buffer if all telemetry options are set to 0. · 5f38d062
      Zebediah Figura authored
      GStreamer's "theoradec" element always calls th_decode_ctl() for all telemetry
      options, passing 0 if they are not enabled. This results in our creating a
      Cairo buffer and performing YUV/RGB conversion, even if all telemetry is
      disabled, which is very slow and can cause noticeable lag during playback.
      5f38d062
  7. Jun 18, 2020
  8. Feb 25, 2020
  9. Feb 14, 2020
  10. Oct 23, 2017
Loading