diff --git a/media/libtheora/AUTHORS b/media/libtheora/AUTHORS index 8a4e529b5..7384070f9 100644 --- a/media/libtheora/AUTHORS +++ b/media/libtheora/AUTHORS @@ -28,6 +28,8 @@ Cristian Adam Sebastian Pippin Simon Hosie Brad Smith +Petter Reinholdtsen +Tristan Matthews - Bug fixes, enhancements, build systems. Mauricio Piacentini diff --git a/media/libtheora/CHANGES b/media/libtheora/CHANGES index fb09793a3..54d919934 100644 --- a/media/libtheora/CHANGES +++ b/media/libtheora/CHANGES @@ -1,169 +1,218 @@ -libteora 1.2.0alpha1 (2010 September 23) +libtheora 1.2.0 (2025 March 29) + * Bumped minor SONAME versions as oc_comment_unpack() implementation + changed. + * Added example wrapper script encoder_example_ffmpeg (#1601 #2336). + * Improve comment handling on platforms where malloc(0) return NULL + (#2304). + * Added pragma in example code to quiet clang op precedenca warnings. + * Adjusted encoder_example help text. + * Adjusted README, CHANGES, pkg-config and spec files to better reflect + current release (#2331 #2328). + * Corrected english typos in source and build system. + * Switched http links to https in doc and comments where relevant. + Did not touch RFC drafts. -- New 'ptalarbvorm' encoder with better rate/distortion optimization -- New th_encode_ctl option for copying configuration from an existing - setup header, useful for splicing streams. -- Returns TH_DUPFRAME in more cases. -- Add ARM optimizations -- Add TI C64x+ DSP optimizations -- Other performance improvements -- Rename speedlevel 2 to 3 and provide a new speedlevel 2 -- Various minor bug fixes +libtheora 1.2.0beta1 (2025 March 15) + * Bumped minor SONAME versions as methods changed constness + of arguments. + * Updated libogg dependency to version 1.3.4 for ogg_uint64_t. + * Updated doxygen setup. + * Updated autotools setup and support scripts (#1467 #1800 #1987 #2318 + #2320). + * Added support for RISC OS. + * Fixed mingw build (#2141). + * Improved ARM support. + * Converted SCons setup to work with Python 3. + * Introduced new configure options --enable-mem-constraint and + --enable-gcc-sanitizers. + * Fixed all known compiler warnings and errors from gcc and clang. + * Improved examples for stability and correctness. + * Various speed, bug fixes and code quality improvements. + - Fixed build problem with Visual Studio (#2317). + - Avoids undefined bit shift of signed numbers (#2321, #2322). + - Avoids example encoder crash on bogus audio input (#2305). + - Fixed musl linking issue with asm enabled (#2287). + - Fixed some broken clamping in rate control (#2229). + - Added NULL check _tc and _setup even for data packets (#2279). + - Fixed mismatched oc_mb_fill_cmapping11 signature (#2068). + - Updated the documentation for theora_encode_comment() (#726). + - Adjusted build to only link libcompat with dump_video (#1587). + - Corrected an operator precedence error in the visualization + code (#1751). + - Fixed two spelling errors in the comments (#1804). + - Avoid negative bit shift operation in huffdec.c (CVE-2024-56431). + * Improved library documentation and specification text. + * Adjusted library dependencies so libtheoraenc do not depend on + libtheoradec. + * Handle fallout from CVE-2017-14633 in libvorbis, check return value + in encoder_example and transcoder_example. + +libtheora 1.2.0alpha1 (2010 September 23) + + * New 'ptalarbvorm' encoder with better rate/distortion optimization + * New th_encode_ctl option for copying configuration from an existing + setup header, useful for splicing streams. + * Returns TH_DUPFRAME in more cases. + * Add ARM optimizations + * Add TI C64x+ DSP optimizations + * Other performance improvements + * Rename speedlevel 2 to 3 and provide a new speedlevel 2 + * Various minor bug fixes libtheora 1.1.2 (unreleased snapshot) - - Fix Huffman table decoding with OC_HUFF_SLUSH is set to 0 - - Fix a frame size bug in player_example - - Add support for passing a buffer the size of the picture + * Fix Huffman table decoding with OC_HUFF_SLUSH is set to 0 + * Fix a frame size bug in player_example + * Add support for passing a buffer the size of the picture region, rather than a full padded frame to th_encode_ycbcr_in() as was possible with the legacy pre-1.0 API. - - 4:4:4 support in player_example using software yuv->rgb - - Better rgb->yuv conversion in png2theora - - Clean up warnings and local variables - - Build and documentation fixes + * 4:4:4 support in player_example using software yuv->rgb + * Better rgb->yuv conversion in png2theora + * Clean up warnings and local variables + * Build and documentation fixes libtheora 1.1.1 (2009 October 1) - - Fix problems with MSVC inline assembly - - Add the missing encoder_disabled.c to the distribution - - build updates: autogen.sh should work better after switching systems + * Fix problems with MSVC inline assembly + * Add the missing encoder_disabled.c to the distribution + * build updates: autogen.sh should work better after switching systems and the MSVC project now defaults to the dynamic runtime library - - Namespace some variables to avoid conflicts on wince. + * Namespace some variables to avoid conflicts on wince. libtheora 1.1.0 (2009 September 24) - - Fix various small issues with the example and telemetry code - - Fix handing a zero-byte packet as the first frame - - Documentation cleanup - - Two minor build fixes + * Fix various small issues with the example and telemetry code + * Fix handing a zero-byte packet as the first frame + * Documentation cleanup + * Two minor build fixes libtheora 1.1beta3 (2009 August 22) - - Rate control fixes to smooth quality - - MSVC build now exports all of the 1.0 api - - Assorted small bug fixes + * Rate control fixes to smooth quality + * MSVC build now exports all of the 1.0 api + * Assorted small bug fixes libtheora 1.1beta2 (2009 August 12) - - Fix a rate control problem with difficult input - - Build fixes for OpenBSD and Apple Xcode - - Examples now all use the 1.0 api - - TH_ENCCTL_SET_SPLEVEL works again - - Various bug fixes and source tree rearrangement + * Fix a rate control problem with difficult input + * Build fixes for OpenBSD and Apple Xcode + * Examples now all use the 1.0 api + * TH_ENCCTL_SET_SPLEVEL works again + * Various bug fixes and source tree rearrangement libtheora 1.1beta1 (2009 August 5) - - Support for two-pass encoding - - Performance optimization of both encoder and decoder - - Encoder supports dynamic adjustment of quality and + * Support for two-pass encoding + * Performance optimization of both encoder and decoder + * Encoder supports dynamic adjustment of quality and bitrate targets - - Encoder is generally more configurable, and all + * Encoder is generally more configurable, and all rate control modes perform better - - Encoder now accepts 4:2:2 and 4:4:4 chroma sampling - - Decoder telemetry output shows quantization choice + * Encoder now accepts 4:2:2 and 4:4:4 chroma sampling + * Decoder telemetry output shows quantization choice and a breakdown of bitrate usage in the frame - - MSVC assembly optimizations up to date and functional + * MSVC assembly optimizations up to date and functional libtheora 1.1alpha2 (2009 May 26) - - Reduce lambda for small quantizers. - - New encoder fDCT does better on smooth gradients - - Use SATD for mode decisions (1-2% bitrate reduction) - - Assembly rewrite for new features and general speed up - - Share code between the encoder and decoder for performance - - Fix 4:2:2 decoding and telemetry - - MSVC project files updated, but assembly is disabled. - - New configure option --disable-spec to work around toolchain + * Reduce lambda for small quantizers. + * New encoder fDCT does better on smooth gradients + * Use SATD for mode decisions (1-2% bitrate reduction) + * Assembly rewrite for new features and general speed up + * Share code between the encoder and decoder for performance + * Fix 4:2:2 decoding and telemetry + * MSVC project files updated, but assembly is disabled. + * New configure option --disable-spec to work around toolchain detection failures. - - Limit symbol exports on MacOS X. - - Port remaining unit tests from the 1.0 release. + * Limit symbol exports on MacOS X. + * Port remaining unit tests from the 1.0 release. libtheora 1.1alpha1 (2009 March 27) - - Encoder rewrite with much improved vbr quality/bitrate and + * Encoder rewrite with much improved vbr quality/bitrate and better tracking of the target rate in cbr mode. - - MSVC project files do not work in this release. + * MSVC project files do not work in this release. libtheora 1.0 (2008 November 3) - - Merge x86 assembly for forward DCT from Thusnelda branch. - - Update 32 bit MMX with loop filter fix. - - Check for an uninitialized state before dereferencing in propagating + * Merge x86 assembly for forward DCT from Thusnelda branch. + * Update 32 bit MMX with loop filter fix. + * Check for an uninitialized state before dereferencing in propagating decode calls. - - Remove all TH_DEBUG statements. - - Rename the bitpacker source files copied from libogg to avoid + * Remove all TH_DEBUG statements. + * Rename the bitpacker source files copied from libogg to avoid confusing simple build systems using both libraries. - - Declare bitfield entries to be explicitly signed for Solaris cc. - - Set quantization parameters to default values when an empty buffer is + * Declare bitfield entries to be explicitly signed for Solaris cc. + * Set quantization parameters to default values when an empty buffer is passed with TH_ENCCTL_SET_QUANT_PARAMS. - - Split encoder and decoder tests depending on configure settings. - - Return lstylex.sty to the distribution. - - Disable inline assembly on gcc versions prior to 3.1. - - Remove extern references for OC_*_QUANT_MIN. - - Make various data tables static const so they can be read-only. - - Remove ENCCTL codes from the old encoder API. - - Implement TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE ctl. - - Fix segfault when exactly one of the width or height is not a multiple + * Split encoder and decoder tests depending on configure settings. + * Return lstylex.sty to the distribution. + * Disable inline assembly on gcc versions prior to 3.1. + * Remove extern references for OC_*_QUANT_MIN. + * Make various data tables static const so they can be read-only. + * Remove ENCCTL codes from the old encoder API. + * Implement TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE ctl. + * Fix segfault when exactly one of the width or height is not a multiple of 16, but the other is. - - Compute the correct vertical offset for chroma. - - cpuid assembly fix for MSVC. - - Add VS2008 project files. - - Build updates for 64-bit platforms, Mingw32, VS and XCode. - - Do not clobber the cropping rectangle. - - Declare ourselves 1.0final to pkg-config to sort after beta releases. - - Fix the scons build to include asm in libtheoradec/enc. + * Compute the correct vertical offset for chroma. + * cpuid assembly fix for MSVC. + * Add VS2008 project files. + * Build updates for 64-bit platforms, Mingw32, VS and XCode. + * Do not clobber the cropping rectangle. + * Declare ourselves 1.0final to pkg-config to sort after beta releases. + * Fix the scons build to include asm in libtheoradec/enc. libtheora 1.0beta3 (2008 April 16) - - Build new libtheoradec and libtheoraenc libraries + * Build new libtheoradec and libtheoraenc libraries supporting the new API from theora-exp. This API should not be considered stable yet. - - Change granule_frame() to return an index as documented. + * Change granule_frame() to return an index as documented. This is a change of behaviour from 1.0beta1. - - Document that granule_time() returns the end of the + * Document that granule_time() returns the end of the presentation interval. - - Use a custom copy of the libogg bitpacker in the decoder + * Use a custom copy of the libogg bitpacker in the decoder to avoid function call overhead. - - MMX code improved and ported to MSVC. - - Fix a problem with the MMX code on SELinux. - - Fix a problem with decoder quantizer initialization. - - Fix a page queue problem with png2theora. - - Improved robustness. - - Updated VS2005 project files. - - Dropped build support for Microsoft VS2003. - - Dropped build support for the unreleased libogg2. - - Added the specification to the autotools build. - - Specification corrections. + * MMX code improved and ported to MSVC. + * Fix a problem with the MMX code on SELinux. + * Fix a problem with decoder quantizer initialization. + * Fix a page queue problem with png2theora. + * Improved robustness. + * Updated VS2005 project files. + * Dropped build support for Microsoft VS2003. + * Dropped build support for the unreleased libogg2. + * Added the specification to the autotools build. + * Specification corrections. libtheora 1.0beta2 (2007 October 12) - - Fix a crash bug on char-is-unsigned architectures (PowerPC) - - Fix a buffer sizing issue that caused rare encoder crashes - - Fix a buffer alignment issue - - Build fixes for MingW32, MSVC - - Improved format documentation. + * Fix a crash bug on char-is-unsigned architectures (PowerPC) + * Fix a buffer sizing issue that caused rare encoder crashes + * Fix a buffer alignment issue + * Build fixes for MingW32, MSVC + * Improved format documentation. libtheora 1.0beta1 (2007 September 22) - - Granulepos scheme modified to match other codecs. This bumps + * Granulepos scheme modified to match other codecs. This bumps the bitstream revision to 3.2.1. Bitstreams marked 3.2.0 are handled correctly by this decoder. Older decoders will show a one frame sync error in the less noticeable direction. libtheora 1.0alpha8 (2007 September 18) - - Switch to new spec compliant decoder from theora-exp branch. + * Switch to new spec compliant decoder from theora-exp branch. Written by Dr. Timothy Terriberry. - - Add support to the encoder for using quantization settings + * Add support to the encoder for using quantization settings provided by the application. - - more assembly optimizations + * more assembly optimizations libtheora 1.0alpha7 (2006 June 20) - - Enable mmx assembly by default - - Avoid some relocations that caused problems on SELinux - - Other build fixes - - time testing mode (-f) for the dump_video example + * Enable mmx assembly by default + * Avoid some relocations that caused problems on SELinux + * Other build fixes + * time testing mode (-f) for the dump_video example libtheora 1.0alpha6 (2006 May 30) @@ -183,7 +232,7 @@ libtheora 1.0alpha5 (2005 August 20) * Fixed bitrate management bugs that caused popping and encode errors * Fixed a crash problem with the theora_state internals not - being intialized properly. + being initialized properly. * new utility function: - theora_granule_shift() * dump_video example now makes YUV4MPEG files by default, so @@ -220,7 +269,7 @@ libtheora 1.0alpha3 (2004 March 20) - move the granulepos shift field to maintain byte alignment longer. - reserve 5 additional bits for subsampling and interlace flags. * Bitstream setup header FORMAT CHANGES: - - support for a range of interpolated quant matricies. + - support for a range of interpolated quant matrices. - include the in-loop block filter coeff. * Bitsteam data packet FORMAT CHANGES: - Reserve a bit for per-block Q index selection. diff --git a/media/libtheora/README.md b/media/libtheora/README.md index b136f7114..7bf7b6d6c 100644 --- a/media/libtheora/README.md +++ b/media/libtheora/README.md @@ -10,13 +10,13 @@ while allowing it a longer useful lifetime. The 1.0 release decoder supported all the new features, but the encoder is nearly identical to the VP3 code. -The 1.1 release featured a completely rewritten encoder, offering -better performance and compression, and making more complete use -of the format's feature set. +The 1.1 release, codenamed Thusnelda, featured a completely rewritten +encoder, offering better performance and compression, and making more +complete use of the format's feature set. -The 1.2 release features significant additional improvements in -compression and performance. Files produced by newer encoders can -be decoded by earlier releases. +The 1.2 release, codenamed Ptalarbvorm, features significant +additional improvements in compression and performance. Files produced +by newer encoders can be decoded by earlier releases. ### Where is Theora? @@ -35,7 +35,7 @@ Requirements summary: For libtheora: -* libogg 1.1 or newer. +* libogg 1.3.4 or newer. For example encoder: @@ -59,7 +59,9 @@ For the player only: The provided build system is the GNU automake/autoconf system, and the main library, libtheora, should already build smoothly on any system. Failure of libtheora to build on a GNU-enabled system is -considered a bug; please report problems to theora-dev@xiph.org. +considered a bug; please report problems to theora-dev@xiph.org, +https://lists.xiph.org/mailman/listinfo/theora-dev or preferably to +https://gitlab.xiph.org/xiph/theora. Windows build support is included in the win32 directory. @@ -67,6 +69,9 @@ Project files for Apple XCode are included in the macosx directory. There is also a more limited scons build. +The mailing list theora@xiph.org has been created for discussing use +of the theora video codec, https://lists.xiph.org/mailman/listinfo/theora. + ### How do I use the sample encoder? The sample encoder takes raw video in YUV4MPEG2 format, as used by @@ -111,7 +116,7 @@ Jan Gerber's ffmpeg2theora is an excellent encoding front end. encoder_internal.h:664: parse error before `ogg_uint16_t` -This means you have version of libogg prior to 1.1. A *complete* new Ogg +This means you have version of libogg prior to 1.3.4. A *complete* new Ogg install, libs and headers is needed. Also be sure that there aren't multiple copies of Ogg installed in @@ -122,7 +127,7 @@ for libs and headers. undefined reference to `oggpackB_stream` -See above; you need libogg 1.1 or later. +See above; you need libogg 1.3.4 or later. ### Link error, such as: diff --git a/media/libtheora/README_MCP b/media/libtheora/README_MCP index d0b00002e..dfbc40bf2 100644 --- a/media/libtheora/README_MCP +++ b/media/libtheora/README_MCP @@ -4,4 +4,4 @@ made were those applied by update.sh and the addition/update of Makefile.in files for the UXP build system. The upstream release used was https://gitlab.xiph.org/xiph/theora -The git revision used was 7180717276af1ebc7da15c83162d6c5d6203aabf. +The version used was tagged v1.2.0. diff --git a/media/libtheora/include/theora/codec.h b/media/libtheora/include/theora/codec.h index 29b860232..36e27c8b1 100644 --- a/media/libtheora/include/theora/codec.h +++ b/media/libtheora/include/theora/codec.h @@ -6,12 +6,11 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation http://www.xiph.org/ * + * by the Xiph.Org Foundation https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id: theora.h,v 1.8 2004/03/15 22:17:32 derf Exp $ ********************************************************************/ @@ -22,13 +21,13 @@ * This is the documentation for the libtheora C API. * * The \c libtheora package is the current reference - * implementation for Theora, a free, + * implementation for Theora, a free, * patent-unencumbered video codec. * Theora is derived from On2's VP3 codec with additional features and * integration with Ogg multimedia formats by - * the Xiph.Org Foundation. + * the Xiph.Org Foundation. * Complete documentation of the format itself is available in - * the Theora + * the Theora * specification. * * \section Organization @@ -47,7 +46,7 @@ * During initial development, prior to the 1.0 release, * \c libtheora exported a different \ref oldfuncs which * combined both encode and decode functions. - * In general, legacy API symbols can be indentified + * In general, legacy API symbols can be identified * by their \c theora_ or \c OC_ namespace prefixes. * The current API uses \c th_ or \c TH_ instead. * @@ -62,8 +61,8 @@ * The shared libtheoradec and libtheoraenc C API. * You don't need to include this directly.*/ -#if !defined(_O_THEORA_CODEC_H_) -# define _O_THEORA_CODEC_H_ (1) +#if !defined(OGG_THEORA_CODEC_HEADER) +# define OGG_THEORA_CODEC_HEADER (1) # include #if defined(__cplusplus) @@ -95,7 +94,7 @@ extern "C" { /*@}*/ /**The currently defined color space tags. - * See the Theora + * See the Theora * specification, Chapter 4, for exact details on the meaning * of each of these color spaces.*/ typedef enum{ @@ -111,7 +110,7 @@ typedef enum{ }th_colorspace; /**The currently defined pixel format tags. - * See the Theora + * See the Theora * specification, Section 4.4, for details on the precise sample * locations.*/ typedef enum{ @@ -195,7 +194,7 @@ typedef th_img_plane th_ycbcr_buffer[3]; * * It is also generally recommended that the offsets and sizes should still be * multiples of 2 to avoid chroma sampling shifts when chroma is sub-sampled. - * See the Theora + * See the Theora * specification, Section 4.4, for more details. * * Frame rate, in frames per second, is stored as a rational fraction, as is @@ -314,7 +313,7 @@ typedef struct{ * A particular tag may occur more than once, and order is significant. * The character set encoding for the strings is always UTF-8, but the tag * names are limited to ASCII, and treated as case-insensitive. - * See the Theora + * See the Theora * specification, Section 6.3.3 for details. * * In filling in this structure, th_decode_headerin() will null-terminate @@ -603,4 +602,4 @@ extern void th_comment_clear(th_comment *_tc); } #endif -#endif +#endif /* OGG_THEORA_CODEC_HEADER */ diff --git a/media/libtheora/include/theora/theora.h b/media/libtheora/include/theora/theora.h index a729a7689..882825f08 100644 --- a/media/libtheora/include/theora/theora.h +++ b/media/libtheora/include/theora/theora.h @@ -6,17 +6,16 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation http://www.xiph.org/ * + * by the Xiph.Org Foundation https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id: theora.h,v 1.17 2003/12/06 18:06:19 arc Exp $ ********************************************************************/ -#ifndef _O_THEORA_H_ -#define _O_THEORA_H_ +#ifndef OGG_THEORA_HEADER +#define OGG_THEORA_HEADER #ifdef __cplusplus extern "C" @@ -41,16 +40,16 @@ extern "C" * declared in theoradec.h and theoraenc.h. * * libtheora is the reference implementation for - * Theora, a free video codec. + * Theora, a free video codec. * Theora is derived from On2's VP3 codec with improved integration with - * Ogg multimedia formats by Xiph.Org. + * Ogg multimedia formats by Xiph.Org. * * \section overview Overview * * This library will both decode and encode theora packets to/from raw YUV * frames. In either case, the packets will most likely either come from or * need to be embedded in an Ogg stream. Use - * libogg or + * libogg or * liboggz * to extract/package these packets. * @@ -260,7 +259,7 @@ typedef struct{ * the 'comment' header packet. * * Meta data is stored as a series of (tag, value) pairs, in - * length-encoded string vectors. The first occurence of the + * length-encoded string vectors. The first occurrence of the * '=' character delimits the tag and value. A particular tag * may occur more than once. The character set encoding for * the strings is always UTF-8, but the tag names are limited @@ -330,7 +329,7 @@ typedef struct theora_comment{ * Call this after a seek, to update the internal granulepos * in the decoder, to insure that subsequent frames are marked * properly. If you track timestamps yourself and do not use - * the granule postion returned by the decoder, then you do + * the granule position returned by the decoder, then you do * not need to use this control. */ #define TH_DECCTL_SET_GRANPOS (5) @@ -755,7 +754,7 @@ extern char *theora_comment_query(theora_comment *tc, char *tag, int count); * \param tag The tag to look up * \returns The number on instances of a particular tag. * - * Call this first when querying for a specific tag and then interate + * Call this first when querying for a specific tag and then iterate * over the number of instances with separate calls to * theora_comment_query() to retrieve all instances in order. **/ @@ -783,4 +782,4 @@ extern int theora_control(theora_state *th,int req,void *buf,size_t buf_sz); } #endif /* __cplusplus */ -#endif /* _O_THEORA_H_ */ +#endif /* OGG_THEORA_HEADER */ diff --git a/media/libtheora/include/theora/theoradec.h b/media/libtheora/include/theora/theoradec.h index 77bef8190..f2cce0657 100644 --- a/media/libtheora/include/theora/theoradec.h +++ b/media/libtheora/include/theora/theoradec.h @@ -6,20 +6,19 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation http://www.xiph.org/ * + * by the Xiph.Org Foundation https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id: theora.h,v 1.8 2004/03/15 22:17:32 derf Exp $ ********************************************************************/ /**\file * The libtheoradec C decoding API.*/ -#if !defined(_O_THEORA_THEORADEC_H_) -# define _O_THEORA_THEORADEC_H_ (1) +#if !defined(OGG_THEORA_THEORADEC_HEADER) +# define OGG_THEORA_THEORADEC_HEADER (1) # include # include # include "codec.h" @@ -330,4 +329,4 @@ extern void th_decode_free(th_dec_ctx *_dec); } #endif -#endif +#endif /* OGG_THEORA_THEORADEC_HEADER */ diff --git a/media/libtheora/lib/arm/armbits.h b/media/libtheora/lib/arm/armbits.h index 1540d7eb5..cad78f620 100644 --- a/media/libtheora/lib/arm/armbits.h +++ b/media/libtheora/lib/arm/armbits.h @@ -6,12 +6,12 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2010 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id: x86int.h 17344 2010-07-21 01:42:18Z tterribe $ ********************************************************************/ #if !defined(_arm_armbits_H) diff --git a/media/libtheora/lib/arm/armbits.s b/media/libtheora/lib/arm/armbits.s index 940072254..9607eda81 100644 --- a/media/libtheora/lib/arm/armbits.s +++ b/media/libtheora/lib/arm/armbits.s @@ -6,12 +6,12 @@ ;* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * ;* * ;* THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2010 * -;* by the Xiph.Org Foundation and contributors http://www.xiph.org/ * +;* by the Xiph.Org Foundation and contributors * +;* https://www.xiph.org/ * ;* * ;******************************************************************** ; ; function: -; last mod: $Id$ ; ;******************************************************************** diff --git a/media/libtheora/lib/arm/armcpu.c b/media/libtheora/lib/arm/armcpu.c index f1941bdc1..6d25582a1 100644 --- a/media/libtheora/lib/arm/armcpu.c +++ b/media/libtheora/lib/arm/armcpu.c @@ -6,14 +6,14 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2010 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** CPU capability detection for ARM processors. function: - last mod: $Id: cpu.c 17344 2010-07-21 01:42:18Z tterribe $ ********************************************************************/ @@ -147,7 +147,7 @@ ogg_uint32_t oc_cpu_flags_get(void) { #else /*The feature registers which can tell us what the processor supports are - accessible in priveleged modes only, so we can't have a general user-space + accessible in privileged modes only, so we can't have a general user-space detection method like on x86.*/ # error "Configured to use ARM asm but no CPU detection method available for " \ "your platform. Reconfigure with --disable-asm (or send patches)." diff --git a/media/libtheora/lib/arm/armcpu.h b/media/libtheora/lib/arm/armcpu.h index 18dd95821..96a0ad500 100644 --- a/media/libtheora/lib/arm/armcpu.h +++ b/media/libtheora/lib/arm/armcpu.h @@ -6,11 +6,11 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2010 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id: cpu.h 17344 2010-07-21 01:42:18Z tterribe $ ********************************************************************/ diff --git a/media/libtheora/lib/arm/armfrag.s b/media/libtheora/lib/arm/armfrag.s index 38627ed66..0b282b53a 100644 --- a/media/libtheora/lib/arm/armfrag.s +++ b/media/libtheora/lib/arm/armfrag.s @@ -6,12 +6,12 @@ ;* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * ;* * ;* THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2010 * -;* by the Xiph.Org Foundation and contributors http://www.xiph.org/ * +;* by the Xiph.Org Foundation and contributors * +;* https://www.xiph.org/ * ;* * ;******************************************************************** ; Original implementation: ; Copyright (C) 2009 Robin Watts for Pinknoise Productions Ltd -; last mod: $Id$ ;******************************************************************** AREA |.text|, CODE, READONLY diff --git a/media/libtheora/lib/arm/armidct.s b/media/libtheora/lib/arm/armidct.s index 68530c714..b496e8690 100644 --- a/media/libtheora/lib/arm/armidct.s +++ b/media/libtheora/lib/arm/armidct.s @@ -6,12 +6,12 @@ ;* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * ;* * ;* THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2010 * -;* by the Xiph.Org Foundation and contributors http://www.xiph.org/ * +;* by the Xiph.Org Foundation and contributors * +;* https://www.xiph.org/ * ;* * ;******************************************************************** ; Original implementation: ; Copyright (C) 2009 Robin Watts for Pinknoise Productions Ltd -; last mod: $Id$ ;******************************************************************** AREA |.text|, CODE, READONLY diff --git a/media/libtheora/lib/arm/armint.h b/media/libtheora/lib/arm/armint.h index cc62d2438..0f8a67176 100644 --- a/media/libtheora/lib/arm/armint.h +++ b/media/libtheora/lib/arm/armint.h @@ -6,12 +6,12 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2010 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id: x86int.h 17344 2010-07-21 01:42:18Z tterribe $ ********************************************************************/ #if !defined(_arm_armint_H) diff --git a/media/libtheora/lib/arm/armloop.s b/media/libtheora/lib/arm/armloop.s index bbd4d630e..c35da0f9a 100644 --- a/media/libtheora/lib/arm/armloop.s +++ b/media/libtheora/lib/arm/armloop.s @@ -6,12 +6,12 @@ ;* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * ;* * ;* THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2010 * -;* by the Xiph.Org Foundation and contributors http://www.xiph.org/ * +;* by the Xiph.Org Foundation and contributors * +;* https://www.xiph.org/ * ;* * ;******************************************************************** ; Original implementation: ; Copyright (C) 2009 Robin Watts for Pinknoise Productions Ltd -; last mod: $Id$ ;******************************************************************** AREA |.text|, CODE, READONLY diff --git a/media/libtheora/lib/arm/armopts.s b/media/libtheora/lib/arm/armopts.s index 4dfdca960..9e4ca30ea 100644 --- a/media/libtheora/lib/arm/armopts.s +++ b/media/libtheora/lib/arm/armopts.s @@ -6,12 +6,12 @@ ;* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * ;* * ;* THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2010 * -;* by the Xiph.Org Foundation and contributors http://www.xiph.org/ * +;* by the Xiph.Org Foundation and contributors * +;* https://www.xiph.org/ * ;* * ;******************************************************************** ; Original implementation: ; Copyright (C) 2009 Robin Watts for Pinknoise Productions Ltd -; last mod: $Id$ ;******************************************************************** ; Set the following to 1 if we have EDSP instructions diff --git a/media/libtheora/lib/arm/armstate.c b/media/libtheora/lib/arm/armstate.c index a56060838..572992002 100644 --- a/media/libtheora/lib/arm/armstate.c +++ b/media/libtheora/lib/arm/armstate.c @@ -6,12 +6,12 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2010 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id: x86state.c 17344 2010-07-21 01:42:18Z tterribe $ ********************************************************************/ #include "armint.h" diff --git a/media/libtheora/lib/bitpack.c b/media/libtheora/lib/bitpack.c index 5125dde6b..a36c37391 100644 --- a/media/libtheora/lib/bitpack.c +++ b/media/libtheora/lib/bitpack.c @@ -6,12 +6,12 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggTheora SOURCE CODE IS (C) COPYRIGHT 1994-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: packing variable sized words into an octet stream - last mod: $Id$ ********************************************************************/ #include diff --git a/media/libtheora/lib/bitpack.h b/media/libtheora/lib/bitpack.h index 237b58405..fc9623ffa 100644 --- a/media/libtheora/lib/bitpack.h +++ b/media/libtheora/lib/bitpack.h @@ -6,12 +6,12 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggTheora SOURCE CODE IS (C) COPYRIGHT 1994-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: packing variable sized words into an octet stream - last mod: $Id: bitwise.c 7675 2004-09-01 00:34:39Z xiphmont $ ********************************************************************/ #if !defined(_bitpack_H) diff --git a/media/libtheora/lib/config.h b/media/libtheora/lib/config.h index b5c9aedfb..875242c49 100644 --- a/media/libtheora/lib/config.h +++ b/media/libtheora/lib/config.h @@ -89,7 +89,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.2.0alpha1+git" +#define PACKAGE_VERSION "1.2.0" /* Define to 1 if all of the C90 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for @@ -100,4 +100,4 @@ /* #undef THEORA_DISABLE_ENCODE */ /* Version number of package */ -#define VERSION "1.2.0alpha1+git" +#define VERSION "1.2.0" diff --git a/media/libtheora/lib/dct.h b/media/libtheora/lib/dct.h index 8052ea6bc..c981daa1c 100644 --- a/media/libtheora/lib/dct.h +++ b/media/libtheora/lib/dct.h @@ -6,12 +6,12 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id$ ********************************************************************/ diff --git a/media/libtheora/lib/decinfo.c b/media/libtheora/lib/decinfo.c index 996b29b6e..dfedf186a 100644 --- a/media/libtheora/lib/decinfo.c +++ b/media/libtheora/lib/decinfo.c @@ -6,12 +6,12 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id$ ********************************************************************/ @@ -134,28 +134,33 @@ static int oc_comment_unpack(oc_pack_buf *_opb,th_comment *_tc){ _tc->comments=0; return TH_EBADHEADER; } - _tc->comment_lengths=(int *)_ogg_malloc( - _tc->comments*sizeof(_tc->comment_lengths[0])); - _tc->user_comments=(char **)_ogg_malloc( - _tc->comments*sizeof(_tc->user_comments[0])); - if(_tc->comment_lengths==NULL||_tc->user_comments==NULL){ - _tc->comments=0; - return TH_EFAULT; - } - for(i=0;i<_tc->comments;i++){ - len=oc_unpack_length(_opb); - if(len<0||len>oc_pack_bytes_left(_opb)){ - _tc->comments=i; - return TH_EBADHEADER; - } - _tc->comment_lengths[i]=len; - _tc->user_comments[i]=_ogg_malloc((size_t)len+1); - if(_tc->user_comments[i]==NULL){ - _tc->comments=i; + if(0<_tc->comments){ + _tc->comment_lengths=(int *)_ogg_malloc( + _tc->comments*sizeof(_tc->comment_lengths[0])); + _tc->user_comments=(char **)_ogg_malloc( + _tc->comments*sizeof(_tc->user_comments[0])); + if(_tc->comment_lengths==NULL||_tc->user_comments==NULL){ + _tc->comments=0; return TH_EFAULT; } - oc_unpack_octets(_opb,_tc->user_comments[i],len); - _tc->user_comments[i][len]='\0'; + for(i=0;i<_tc->comments;i++){ + len=oc_unpack_length(_opb); + if(len<0||len>oc_pack_bytes_left(_opb)){ + _tc->comments=i; + return TH_EBADHEADER; + } + _tc->comment_lengths[i]=len; + _tc->user_comments[i]=_ogg_malloc((size_t)len+1); + if(_tc->user_comments[i]==NULL){ + _tc->comments=i; + return TH_EFAULT; + } + oc_unpack_octets(_opb,_tc->user_comments[i],len); + _tc->user_comments[i][len]='\0'; + } + } else { + _tc->comment_lengths=NULL; + _tc->user_comments=NULL; } return oc_pack_bytes_left(_opb)<0?TH_EBADHEADER:0; } @@ -219,7 +224,7 @@ static int oc_dec_headerin(oc_pack_buf *_opb,th_info *_info, /*Comment header.*/ case 0x81:{ if(_tc==NULL)return TH_EFAULT; - /*We shoud have already decoded the info header, and should not yet have + /*We should have already decoded the info header, and should not yet have decoded the comment header.*/ if(_info->frame_width==0||_tc->vendor!=NULL)return TH_EBADHEADER; ret=oc_comment_unpack(_opb,_tc); diff --git a/media/libtheora/lib/decint.h b/media/libtheora/lib/decint.h index 3cea6b143..e4178b299 100644 --- a/media/libtheora/lib/decint.h +++ b/media/libtheora/lib/decint.h @@ -6,12 +6,12 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id$ ********************************************************************/ @@ -86,12 +86,12 @@ struct oc_dec_pipeline_state{ from buffer overflow. We make it fully twice as large so that the second half can serve as the reconstruction buffer, which saves passing another parameter to all the - acceleration functios. + acceleration functions. It also solves problems with 16-byte alignment for NEON on ARM. gcc (as of 4.2.1) only seems to be able to give stack variables 8-byte alignment, and silently produces incorrect results if you ask for 16. Finally, keeping it off the stack means there's less likely to be a data - hazard beween the NEON co-processor and the regular ARM core, which avoids + hazard between the NEON co-processor and the regular ARM core, which avoids unnecessary stalls.*/ OC_ALIGN16(ogg_int16_t dct_coeffs[128]); OC_ALIGN16(signed char bounding_values[256]); diff --git a/media/libtheora/lib/decode.c b/media/libtheora/lib/decode.c index fad26e092..3e9ec999b 100644 --- a/media/libtheora/lib/decode.c +++ b/media/libtheora/lib/decode.c @@ -5,13 +5,13 @@ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * - * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009,2025 * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id$ ********************************************************************/ @@ -147,7 +147,7 @@ static const unsigned char OC_INTERNAL_DCT_TOKEN_EXTRA_BITS[15]={ ((_eobs)<>2; oc_filter_hedge(dst+x,dst_ystride,src+x-src_ystride,src_ystride, qstep,flimit,variance,variance+nhfrags); - oc_filter_vedge(dst+x-(dst_ystride<<2)-4,dst_ystride, + oc_filter_vedge(dst+x-(dst_ystride*4)-4,dst_ystride, qstep,flimit,variance-1); variance++; dc_qi++; } - dst+=dst_ystride<<3; - src+=src_ystride<<3; + dst+=dst_ystride*8; + src+=src_ystride*8; } /*And finally, handle the last row in the frame, if it's in the range.*/ if(!notdone){ @@ -1777,7 +1777,7 @@ static void oc_dec_deblock_frag_rows(oc_dec_ctx *_dec, for(x=8;xpp_dc_scale[*dc_qi++]; flimit=(qstep*3)>>2; - oc_filter_vedge(dst+x-(dst_ystride<<3)-4,dst_ystride, + oc_filter_vedge(dst+x-(dst_ystride*8)-4,dst_ystride, qstep,flimit,variance++); } } @@ -1952,7 +1952,7 @@ static void oc_dec_dering_frag_rows(oc_dec_ctx *_dec,th_img_plane *_img, frag++; variance++; } - idata+=ystride<<3; + idata+=ystride*8; } } @@ -2101,7 +2101,7 @@ static void oc_render_telemetry(th_dec_ctx *_dec,th_ycbcr_buffer _ycbcr, hdec=!(_dec->state.info.pixel_fmt&1); vdec=!(_dec->state.info.pixel_fmt&2); /*Lazy data buffer init. - We could try to re-use the post-processing buffer, which would save + We could try to reuse the post-processing buffer, which would save memory, but complicate the allocation logic there. I don't think anyone cares about memory usage when using telemetry; it is not meant for embedded devices.*/ @@ -2674,10 +2674,10 @@ static void oc_render_telemetry(th_dec_ctx *_dec,th_ycbcr_buffer _ycbcr, u_row[x>>1]=OC_CLAMP255(u); v_row[x>>1]=OC_CLAMP255(v); } - y_row+=_ycbcr[0].stride<<1; + y_row+=_ycbcr[0].stride*2; u_row+=_ycbcr[1].stride; v_row+=_ycbcr[2].stride; - rgb_row+=cstride<<1; + rgb_row+=cstride*2; } }break; case TH_PF_422:{ diff --git a/media/libtheora/lib/dequant.c b/media/libtheora/lib/dequant.c index 860536f72..0835e2a6d 100644 --- a/media/libtheora/lib/dequant.c +++ b/media/libtheora/lib/dequant.c @@ -6,12 +6,12 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id$ ********************************************************************/ diff --git a/media/libtheora/lib/dequant.h b/media/libtheora/lib/dequant.h index 9d6cd6be5..693e0e012 100644 --- a/media/libtheora/lib/dequant.h +++ b/media/libtheora/lib/dequant.h @@ -6,12 +6,12 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id$ ********************************************************************/ diff --git a/media/libtheora/lib/fragment.c b/media/libtheora/lib/fragment.c index 14c38be50..6ff6a397a 100644 --- a/media/libtheora/lib/fragment.c +++ b/media/libtheora/lib/fragment.c @@ -6,12 +6,12 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id$ ********************************************************************/ #include diff --git a/media/libtheora/lib/huffdec.c b/media/libtheora/lib/huffdec.c index e227b40d7..0873b887a 100644 --- a/media/libtheora/lib/huffdec.c +++ b/media/libtheora/lib/huffdec.c @@ -5,13 +5,13 @@ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * - * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009,2025 * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id$ ********************************************************************/ @@ -225,6 +225,7 @@ int oc_huff_tree_unpack(oc_pack_buf *_opb,unsigned char _tokens[256][2]){ _tokens[ntokens][1]=(unsigned char)(len+neb); ntokens++; } + if(len<=0)break; code_bit=0x80000000U>>len-1; while(len>0&&(code&code_bit)){ code^=code_bit; @@ -442,13 +443,10 @@ static size_t oc_huff_tree_size(const ogg_int16_t *_tree,int _node){ _src: The array of trees to copy.*/ int oc_huff_trees_copy(ogg_int16_t *_dst[TH_NHUFFMAN_TABLES], const ogg_int16_t *const _src[TH_NHUFFMAN_TABLES]){ - int total; int i; - total=0; for(i=0;i0)_ogg_free(_dst[i]); diff --git a/media/libtheora/lib/huffdec.h b/media/libtheora/lib/huffdec.h index 03d25dcd1..623f00ae9 100644 --- a/media/libtheora/lib/huffdec.h +++ b/media/libtheora/lib/huffdec.h @@ -6,12 +6,12 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id$ ********************************************************************/ diff --git a/media/libtheora/lib/huffman.h b/media/libtheora/lib/huffman.h index eb805866b..15a0dfee1 100644 --- a/media/libtheora/lib/huffman.h +++ b/media/libtheora/lib/huffman.h @@ -6,12 +6,12 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id$ ********************************************************************/ diff --git a/media/libtheora/lib/idct.c b/media/libtheora/lib/idct.c index 838e3ad8c..893cdebc8 100644 --- a/media/libtheora/lib/idct.c +++ b/media/libtheora/lib/idct.c @@ -6,12 +6,12 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id$ ********************************************************************/ diff --git a/media/libtheora/lib/info.c b/media/libtheora/lib/info.c index e5cecd2de..8e3e20b67 100644 --- a/media/libtheora/lib/info.c +++ b/media/libtheora/lib/info.c @@ -6,12 +6,12 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id$ ********************************************************************/ diff --git a/media/libtheora/lib/internal.c b/media/libtheora/lib/internal.c index afbb6efae..99a50cf06 100644 --- a/media/libtheora/lib/internal.c +++ b/media/libtheora/lib/internal.c @@ -6,12 +6,12 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id$ ********************************************************************/ diff --git a/media/libtheora/lib/internal.h b/media/libtheora/lib/internal.h index 53c77b88b..6bffe8d17 100644 --- a/media/libtheora/lib/internal.h +++ b/media/libtheora/lib/internal.h @@ -6,12 +6,12 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id$ ********************************************************************/ #if !defined(_internal_H) @@ -44,6 +44,10 @@ # if __GNUC_PREREQ(4,2) # pragma GCC diagnostic ignored "-Wparentheses" # endif +/*Et tu, clang.*/ +# if defined(__clang__) +# pragma clang diagnostic ignored "-Wparentheses" +# endif /*Some assembly constructs require aligned operands. The following macros are _only_ intended for structure member declarations. @@ -72,7 +76,7 @@ /*This library's version.*/ -# define OC_VENDOR_STRING "Xiph.Org libtheora 1.2.0alpha 20100924 (Ptalarbvorm)" +# define OC_VENDOR_STRING "Xiph.Org libtheora 1.2.0 20250329 (Ptalarbvorm)" /*Theora bitstream version.*/ # define TH_VERSION_MAJOR (3) diff --git a/media/libtheora/lib/mathops.h b/media/libtheora/lib/mathops.h index a1a4f9df0..f821f850c 100644 --- a/media/libtheora/lib/mathops.h +++ b/media/libtheora/lib/mathops.h @@ -67,7 +67,7 @@ int oc_ilog64(ogg_int64_t _v); * This is the number of bits that would be required to represent _v in two's * complement notation with all of the leading zeros stripped. */ -# define OC_ILOG_32(_v) (OC_ILOGNZ_32(_v)&-!!(_v)) +# define OC_ILOG_32(_v) ((_v)?OC_ILOGNZ_32(_v):0) # else # define OC_ILOGNZ_32(_v) (oc_ilog32(_v)) # define OC_ILOG_32(_v) (oc_ilog32(_v)) @@ -90,7 +90,7 @@ int oc_ilog64(ogg_int64_t _v); * This is the number of bits that would be required to represent _v in two's * complement notation with all of the leading zeros stripped. */ -# define OC_ILOG_64(_v) (OC_ILOGNZ_64(_v)&-!!(_v)) +# define OC_ILOG_64(_v) ((_v)?OC_ILOGNZ_64(_v):0) # else # define OC_ILOGNZ_64(_v) (oc_ilog64(_v)) # define OC_ILOG_64(_v) (oc_ilog64(_v)) @@ -131,7 +131,7 @@ int oc_ilog64(ogg_int64_t _v); */ # define OC_STATIC_ILOG_64(_v) (OC_STATIC_ILOG6((ogg_int64_t)(_v))) -#define OC_Q57(_v) ((ogg_int64_t)(_v)<<57) +#define OC_Q57(_v) ((_v)*((ogg_int64_t)1<<57)) #define OC_Q10(_v) ((_v)<<10) ogg_int64_t oc_bexp64(ogg_int64_t _z); diff --git a/media/libtheora/lib/ocintrin.h b/media/libtheora/lib/ocintrin.h index b200ceafc..5bc0e5cbd 100644 --- a/media/libtheora/lib/ocintrin.h +++ b/media/libtheora/lib/ocintrin.h @@ -6,12 +6,12 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id$ ********************************************************************/ @@ -34,13 +34,13 @@ speed difference between the two approaches is not measurable). Interestingly, the bit-twiddling method was patented in 2000 (US 6,073,150) by Sun Microsystems, despite prior art dating back to at least 1996: - http://web.archive.org/web/19961201174141/www.x86.org/ftp/articles/pentopt/PENTOPT.TXT + https://web.archive.org/web/19961201174141/www.x86.org/ftp/articles/pentopt/PENTOPT.TXT On gcc 3.x, however, our assumption is not true, as abs() is translated to a conditional jump, which is horrible on deeply piplined architectures (e.g., all consumer architectures for the past decade or more). Also be warned that -C*abs(x) where C is a constant is mis-optimized as abs(C*x) on every gcc release before 4.2.3. - See bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34130 */ + See bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=34130 */ /*Modern gcc (4.x) can compile the naive versions of min and max with cmov if given an appropriate architecture, but the branchless bit-twiddling versions diff --git a/media/libtheora/lib/quant.c b/media/libtheora/lib/quant.c index e20620284..e0ed86c40 100644 --- a/media/libtheora/lib/quant.c +++ b/media/libtheora/lib/quant.c @@ -6,12 +6,12 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id$ ********************************************************************/ @@ -66,7 +66,7 @@ void oc_dequant_tables_init(ogg_uint16_t *_dequant[64][3][2], qi_start=qi; if(qri==_qinfo->qi_ranges[qti][pli].nranges)qi_end=qi+1; else qi_end=qi+_qinfo->qi_ranges[qti][pli].sizes[qri]; - /*Iterate over quality indicies in this range.*/ + /*Iterate over quality indices in this range.*/ for(;;){ ogg_uint32_t qfac; int zzi; diff --git a/media/libtheora/lib/quant.h b/media/libtheora/lib/quant.h index 247210eaa..287d6738a 100644 --- a/media/libtheora/lib/quant.h +++ b/media/libtheora/lib/quant.h @@ -6,12 +6,12 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id$ ********************************************************************/ diff --git a/media/libtheora/lib/state.c b/media/libtheora/lib/state.c index f4c624038..28a602715 100644 --- a/media/libtheora/lib/state.c +++ b/media/libtheora/lib/state.c @@ -5,13 +5,13 @@ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * - * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009,2025 * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id$ ********************************************************************/ @@ -388,7 +388,7 @@ static void oc_state_border_init(oc_theora_state *_state){ /*Otherwise, check to see if it straddles the border.*/ else if(x=crop_x0&&x+j=crop_y0&&y+ifplanes+_pli; nhfrags=fplane->nhfrags; fragi_top=fplane->froffset; @@ -1095,7 +1095,7 @@ void oc_state_loop_filter_frag_rows_c(const oc_theora_state *_state, loop_filter_h(ref+8,ystride,_bv); } if(fragi+nhfrags>8) #define OC_MV_ADD(_mv1,_mv2) \ @@ -523,7 +523,7 @@ void oc_idct8x8_c(ogg_int16_t _y[64],ogg_int16_t _x[64],int _last_zzi); void oc_state_frag_recon_c(const oc_theora_state *_state,ptrdiff_t _fragi, int _pli,ogg_int16_t _dct_coeffs[128],int _last_zzi,ogg_uint16_t _dc_quant); void oc_state_loop_filter_frag_rows_c(const oc_theora_state *_state, - signed char _bv[256],int _refi,int _pli,int _fragy0,int _fragy_end); + signed char _bvarray[256],int _refi,int _pli,int _fragy0,int _fragy_end); void oc_restore_fpu_c(void); /*We need a way to call a few encoder functions without introducing a link-time diff --git a/media/libtheora/lib/x86/mmxfrag.c b/media/libtheora/lib/x86/mmxfrag.c index b3ec50895..df85f9949 100644 --- a/media/libtheora/lib/x86/mmxfrag.c +++ b/media/libtheora/lib/x86/mmxfrag.c @@ -5,13 +5,13 @@ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * - * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009,2025 * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id$ ********************************************************************/ @@ -216,7 +216,7 @@ void oc_frag_recon_intra_mmx(unsigned char *_dst,int _ystride, : :[residue]"r"(_residue), [dst]"r"(_dst), - [dst4]"r"(_dst+(_ystride<<2)), + [dst4]"r"(_dst+(_ystride*4)), [ystride]"r"((ptrdiff_t)_ystride), [ystride3]"r"((ptrdiff_t)_ystride*3) :"memory" diff --git a/media/libtheora/lib/x86/mmxidct.c b/media/libtheora/lib/x86/mmxidct.c index b8e307706..9dbaaf08a 100644 --- a/media/libtheora/lib/x86/mmxidct.c +++ b/media/libtheora/lib/x86/mmxidct.c @@ -5,13 +5,13 @@ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * - * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009,2025 * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id$ ********************************************************************/ @@ -312,7 +312,7 @@ static void oc_idct8x8_slow_mmx(ogg_int16_t _y[64],ogg_int16_t _x[64]){ #undef OC_J :[y]"=m"OC_ARRAY_OPERAND(ogg_int16_t,_y,64) :[x]"m"OC_CONST_ARRAY_OPERAND(ogg_int16_t,_x,64), - [c]"m"OC_CONST_ARRAY_OPERAND(ogg_int16_t,OC_IDCT_CONSTS,128) + [c]"m"OC_CONST_ARRAY_OPERAND(ogg_int16_t,OC_IDCT_CONSTS,64) ); __asm__ __volatile__("pxor %%mm0,%%mm0\n\t"::); for(i=0;i<4;i++){ @@ -510,7 +510,7 @@ static void oc_idct8x8_10_mmx(ogg_int16_t _y[64],ogg_int16_t _x[64]){ #undef OC_J :[y]"=m"OC_ARRAY_OPERAND(ogg_int16_t,_y,64) :[x]"m"OC_CONST_ARRAY_OPERAND(ogg_int16_t,_x,64), - [c]"m"OC_CONST_ARRAY_OPERAND(ogg_int16_t,OC_IDCT_CONSTS,128) + [c]"m"OC_CONST_ARRAY_OPERAND(ogg_int16_t,OC_IDCT_CONSTS,64) ); __asm__ __volatile__( "pxor %%mm0,%%mm0\n\t" diff --git a/media/libtheora/lib/x86/mmxstate.c b/media/libtheora/lib/x86/mmxstate.c index eebea14fb..af49ee97b 100644 --- a/media/libtheora/lib/x86/mmxstate.c +++ b/media/libtheora/lib/x86/mmxstate.c @@ -6,12 +6,12 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors * + * https://www.xiph.org/ * * * ******************************************************************** function: - last mod: $Id$ ********************************************************************/ @@ -147,7 +147,7 @@ void oc_state_loop_filter_frag_rows_mmx(const oc_theora_state *_state, OC_LOOP_FILTER_H(OC_LOOP_FILTER8_MMX,ref+8,ystride,ll); } if(fragi+nhfrags