Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion thirdparty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ Files extracted from upstream source:
## libtheora

- Upstream: https://www.theora.org
- Version: git (7180717276af1ebc7da15c83162d6c5d6203aabf, 2020)
- Version: 1.2.0 (8e4808736e9c181b971306cc3f05df9e61354004, 2025)
- License: BSD-3-Clause

Files extracted from upstream source:
Expand Down
11 changes: 5 additions & 6 deletions thirdparty/libtheora/analyze.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
* 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 http://www.xiph.org/ *
* THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009,2025 *
* by the Xiph.Org Foundation https://www.xiph.org/ *
* *
********************************************************************

function: mode selection code
last mod: $Id$

********************************************************************/
#include <limits.h>
Expand Down Expand Up @@ -2168,14 +2167,14 @@ static void oc_cost_inter(oc_enc_ctx *_enc,oc_mode_choice *_modec,

static void oc_cost_inter_nomv(oc_enc_ctx *_enc,oc_mode_choice *_modec,
unsigned _mbi,int _mb_mode,const oc_fr_state *_fr,const oc_qii_state *_qs,
const unsigned _skip_ssd[12],const unsigned _rd_scale[4]){
const unsigned _skip_ssd[12],const unsigned _rd_scale[5]){
oc_cost_inter(_enc,_modec,_mbi,_mb_mode,0,_fr,_qs,_skip_ssd,_rd_scale);
}

static int oc_cost_inter1mv(oc_enc_ctx *_enc,oc_mode_choice *_modec,
unsigned _mbi,int _mb_mode,oc_mv _mv,
const oc_fr_state *_fr,const oc_qii_state *_qs,const unsigned _skip_ssd[12],
const unsigned _rd_scale[4]){
const unsigned _rd_scale[5]){
int bits0;
oc_cost_inter(_enc,_modec,_mbi,_mb_mode,_mv,_fr,_qs,_skip_ssd,_rd_scale);
bits0=OC_MV_BITS[0][OC_MV_X(_mv)+31]+OC_MV_BITS[0][OC_MV_Y(_mv)+31];
Expand Down Expand Up @@ -2645,7 +2644,7 @@ int oc_enc_analyze_inter(oc_enc_ctx *_enc,int _allow_keyframe,int _recode){
fragi=mb_maps[mbi][pli][bi];
/*If we switched from 4MV mode to INTER_MV mode, then the qii
values won't have been chosen with the right MV, but it's
probaby not worth re-estimating them.*/
probably not worth re-estimating them.*/
frags[fragi].qii=modes[mb_mode].qii[mapii];
frags[fragi].refi=refi;
frags[fragi].mb_mode=mb_mode;
Expand Down
4 changes: 2 additions & 2 deletions thirdparty/libtheora/apiwrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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$

********************************************************************/

Expand Down
4 changes: 2 additions & 2 deletions thirdparty/libtheora/apiwrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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: apiwrapper.h 13596 2007-08-23 20:05:38Z tterribe $

********************************************************************/

Expand Down
4 changes: 2 additions & 2 deletions thirdparty/libtheora/bitpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <string.h>
Expand Down
4 changes: 2 additions & 2 deletions thirdparty/libtheora/bitpack.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions thirdparty/libtheora/collect.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2011 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* by the Xiph.Org Foundation and contributors *
* https://www.xiph.org/ *
* *
********************************************************************

function: mode selection code
last mod: $Id$

********************************************************************/
#include <stdio.h>
Expand Down
3 changes: 1 addition & 2 deletions thirdparty/libtheora/collect.h
Original file line number Diff line number Diff line change
Expand Up @@ -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: mode selection code
last mod: $Id$

********************************************************************/
#if !defined(_collect_H)
Expand Down
4 changes: 2 additions & 2 deletions thirdparty/libtheora/dct.h
Original file line number Diff line number Diff line change
Expand Up @@ -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$

********************************************************************/

Expand Down
4 changes: 2 additions & 2 deletions thirdparty/libtheora/decapiwrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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: decapiwrapper.c 13596 2007-08-23 20:05:38Z tterribe $

********************************************************************/

Expand Down
51 changes: 28 additions & 23 deletions thirdparty/libtheora/decinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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$

********************************************************************/

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -217,7 +222,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);
Expand Down
8 changes: 4 additions & 4 deletions thirdparty/libtheora/decint.h
Original file line number Diff line number Diff line change
Expand Up @@ -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$

********************************************************************/

Expand Down Expand Up @@ -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]);
Expand Down
24 changes: 12 additions & 12 deletions thirdparty/libtheora/decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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$

********************************************************************/

Expand Down Expand Up @@ -147,7 +147,7 @@ static const unsigned char OC_INTERNAL_DCT_TOKEN_EXTRA_BITS[15]={
((_eobs)<<OC_DCT_CW_EOB_SHIFT| \
(_rlen)<<OC_DCT_CW_RLEN_SHIFT| \
(_flip)<<OC_DCT_CW_FLIP_BIT| \
(_mag)-(_flip)<<OC_DCT_CW_MAG_SHIFT)
((_mag)-(_flip))*(1<<OC_DCT_CW_MAG_SHIFT))

/*A special code word value that signals the end of the frame (a long EOB run
of zero).*/
Expand Down Expand Up @@ -1755,13 +1755,13 @@ static void oc_dec_deblock_frag_rows(oc_dec_ctx *_dec,
flimit=(qstep*3)>>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){
Expand All @@ -1777,7 +1777,7 @@ static void oc_dec_deblock_frag_rows(oc_dec_ctx *_dec,
for(x=8;x<width;x+=8){
qstep=_dec->pp_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++);
}
}
Expand Down Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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.*/
Expand Down Expand Up @@ -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:{
Expand Down
4 changes: 2 additions & 2 deletions thirdparty/libtheora/dequant.c
Original file line number Diff line number Diff line change
Expand Up @@ -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$

********************************************************************/

Expand Down
4 changes: 2 additions & 2 deletions thirdparty/libtheora/dequant.h
Original file line number Diff line number Diff line change
Expand Up @@ -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$

********************************************************************/

Expand Down
Loading